@event-calendar/core 4.5.0 → 4.5.2
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 +2 -1
- package/dist/index.js +156 -177
- package/package.json +1 -1
- package/src/plugins/resource-timeline/Body.svelte +2 -2
- package/src/plugins/resource-timeline/Days.svelte +4 -6
- package/src/plugins/resource-timeline/Label.svelte +11 -3
- package/src/plugins/resource-timeline/Sidebar.svelte +10 -3
- package/src/plugins/resource-timeline/index.js +1 -0
- package/src/styles/timeline.scss +1 -0
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.5.
|
|
232
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.
|
|
246
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.2/dist/event-calendar.min.css">
|
|
247
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.2/dist/event-calendar.min.js"></script>
|
|
233
248
|
```
|
|
234
249
|
|
|
235
250
|
<details>
|
package/dist/index.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v4.5.
|
|
2
|
+
* EventCalendar v4.5.2
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
.ec {
|
|
@@ -185,6 +185,7 @@
|
|
|
185
185
|
}
|
|
186
186
|
.ec-timeline .ec-sidebar .ec-resource span {
|
|
187
187
|
padding-top: 8px;
|
|
188
|
+
height: fit-content;
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
.ec-time-grid .ec-body .ec-event {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v4.5.
|
|
2
|
+
* EventCalendar v4.5.2
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { tick, getContext, untrack, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -1359,7 +1359,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1359
1359
|
$.template_effect(() => $.set_class(h2, 1, ($theme(), $.untrack(() => $theme().title))));
|
|
1360
1360
|
$.append($$anchor3, h2);
|
|
1361
1361
|
};
|
|
1362
|
-
var
|
|
1362
|
+
var alternate_4 = ($$anchor3) => {
|
|
1363
|
+
var fragment_2 = $.comment();
|
|
1364
|
+
var node_2 = $.first_child(fragment_2);
|
|
1363
1365
|
{
|
|
1364
1366
|
var consequent_1 = ($$anchor4) => {
|
|
1365
1367
|
var button_1 = root_4$3();
|
|
@@ -1375,7 +1377,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1375
1377
|
$.event("click", button_1, prev);
|
|
1376
1378
|
$.append($$anchor4, button_1);
|
|
1377
1379
|
};
|
|
1378
|
-
var
|
|
1380
|
+
var alternate_3 = ($$anchor4) => {
|
|
1381
|
+
var fragment_3 = $.comment();
|
|
1382
|
+
var node_3 = $.first_child(fragment_3);
|
|
1379
1383
|
{
|
|
1380
1384
|
var consequent_2 = ($$anchor5) => {
|
|
1381
1385
|
var button_2 = root_6$1();
|
|
@@ -1391,7 +1395,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1391
1395
|
$.event("click", button_2, next);
|
|
1392
1396
|
$.append($$anchor5, button_2);
|
|
1393
1397
|
};
|
|
1394
|
-
var alternate_2 = ($$anchor5
|
|
1398
|
+
var alternate_2 = ($$anchor5) => {
|
|
1399
|
+
var fragment_4 = $.comment();
|
|
1400
|
+
var node_4 = $.first_child(fragment_4);
|
|
1395
1401
|
{
|
|
1396
1402
|
var consequent_3 = ($$anchor6) => {
|
|
1397
1403
|
var button_3 = root_8$1();
|
|
@@ -1405,7 +1411,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1405
1411
|
$.event("click", button_3, () => $.store_set(date, cloneDate(today2)));
|
|
1406
1412
|
$.append($$anchor6, button_3);
|
|
1407
1413
|
};
|
|
1408
|
-
var
|
|
1414
|
+
var alternate_1 = ($$anchor6) => {
|
|
1415
|
+
var fragment_5 = $.comment();
|
|
1416
|
+
var node_5 = $.first_child(fragment_5);
|
|
1409
1417
|
{
|
|
1410
1418
|
var consequent_4 = ($$anchor7) => {
|
|
1411
1419
|
var button_4 = root_10$1();
|
|
@@ -1417,7 +1425,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1417
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 : "")) ?? ""}`));
|
|
1418
1426
|
$.append($$anchor7, button_4);
|
|
1419
1427
|
};
|
|
1420
|
-
var
|
|
1428
|
+
var alternate = ($$anchor7) => {
|
|
1429
|
+
var fragment_6 = $.comment();
|
|
1430
|
+
var node_6 = $.first_child(fragment_6);
|
|
1421
1431
|
{
|
|
1422
1432
|
var consequent_5 = ($$anchor8) => {
|
|
1423
1433
|
var button_5 = root_12$1();
|
|
@@ -1431,57 +1441,62 @@ function Buttons($$anchor, $$props) {
|
|
|
1431
1441
|
$.append($$anchor8, button_5);
|
|
1432
1442
|
};
|
|
1433
1443
|
$.if(
|
|
1434
|
-
|
|
1444
|
+
node_6,
|
|
1435
1445
|
($$render) => {
|
|
1436
1446
|
if ($.get(button) != "") $$render(consequent_5);
|
|
1437
1447
|
},
|
|
1438
|
-
|
|
1448
|
+
true
|
|
1439
1449
|
);
|
|
1440
1450
|
}
|
|
1451
|
+
$.append($$anchor7, fragment_6);
|
|
1441
1452
|
};
|
|
1442
1453
|
$.if(
|
|
1443
|
-
|
|
1454
|
+
node_5,
|
|
1444
1455
|
($$render) => {
|
|
1445
1456
|
if ($customButtons(), $.get(button), $.untrack(() => $customButtons()[$.get(button)])) $$render(consequent_4);
|
|
1446
|
-
else $$render(
|
|
1457
|
+
else $$render(alternate, false);
|
|
1447
1458
|
},
|
|
1448
|
-
|
|
1459
|
+
true
|
|
1449
1460
|
);
|
|
1450
1461
|
}
|
|
1462
|
+
$.append($$anchor6, fragment_5);
|
|
1451
1463
|
};
|
|
1452
1464
|
$.if(
|
|
1453
|
-
|
|
1465
|
+
node_4,
|
|
1454
1466
|
($$render) => {
|
|
1455
1467
|
if ($.get(button) == "today") $$render(consequent_3);
|
|
1456
|
-
else $$render(
|
|
1468
|
+
else $$render(alternate_1, false);
|
|
1457
1469
|
},
|
|
1458
|
-
|
|
1470
|
+
true
|
|
1459
1471
|
);
|
|
1460
1472
|
}
|
|
1473
|
+
$.append($$anchor5, fragment_4);
|
|
1461
1474
|
};
|
|
1462
1475
|
$.if(
|
|
1463
|
-
|
|
1476
|
+
node_3,
|
|
1464
1477
|
($$render) => {
|
|
1465
1478
|
if ($.get(button) == "next") $$render(consequent_2);
|
|
1466
1479
|
else $$render(alternate_2, false);
|
|
1467
1480
|
},
|
|
1468
|
-
|
|
1481
|
+
true
|
|
1469
1482
|
);
|
|
1470
1483
|
}
|
|
1484
|
+
$.append($$anchor4, fragment_3);
|
|
1471
1485
|
};
|
|
1472
1486
|
$.if(
|
|
1473
|
-
|
|
1487
|
+
node_2,
|
|
1474
1488
|
($$render) => {
|
|
1475
1489
|
if ($.get(button) == "prev") $$render(consequent_1);
|
|
1476
|
-
else $$render(
|
|
1490
|
+
else $$render(alternate_3, false);
|
|
1477
1491
|
},
|
|
1478
|
-
|
|
1492
|
+
true
|
|
1479
1493
|
);
|
|
1480
1494
|
}
|
|
1495
|
+
$.append($$anchor3, fragment_2);
|
|
1481
1496
|
};
|
|
1482
1497
|
$.if(node_1, ($$render) => {
|
|
1483
1498
|
if ($.get(button) == "title") $$render(consequent);
|
|
1484
|
-
else $$render(
|
|
1499
|
+
else $$render(alternate_4, false);
|
|
1485
1500
|
});
|
|
1486
1501
|
}
|
|
1487
1502
|
$.append($$anchor2, fragment_1);
|
|
@@ -1753,13 +1768,14 @@ function Calendar($$anchor, $$props) {
|
|
|
1753
1768
|
var node_2 = $.sibling(div, 2);
|
|
1754
1769
|
Auxiliary$1(node_2, {});
|
|
1755
1770
|
$.template_effect(
|
|
1756
|
-
($0) => {
|
|
1771
|
+
($0, $1) => {
|
|
1757
1772
|
$.set_class(div, 1, `${$theme().calendar ?? ""} ${$theme().view ?? ""}${$_scrollable() ? " " + $theme().withScroll : ""}${$_iClass() ? " " + $theme()[$_iClass()] : ""}`);
|
|
1758
1773
|
$.set_attribute(div, "role", $0);
|
|
1759
|
-
styles = $.set_style(div, "", styles,
|
|
1774
|
+
styles = $.set_style(div, "", styles, $1);
|
|
1760
1775
|
},
|
|
1761
1776
|
[
|
|
1762
|
-
() => listView($view()) ? "list" : "table"
|
|
1777
|
+
() => listView($view()) ? "list" : "table",
|
|
1778
|
+
() => ({ height: $height() })
|
|
1763
1779
|
]
|
|
1764
1780
|
);
|
|
1765
1781
|
$.append($$anchor, fragment);
|
|
@@ -1808,12 +1824,7 @@ function Header$1($$anchor, $$props) {
|
|
|
1808
1824
|
const $_days = () => $.store_get(_days, "$_days", $$stores);
|
|
1809
1825
|
const $_intlDayHeaderAL = () => $.store_get(_intlDayHeaderAL, "$_intlDayHeaderAL", $$stores);
|
|
1810
1826
|
const $_intlDayHeader = () => $.store_get(_intlDayHeader, "$_intlDayHeader", $$stores);
|
|
1811
|
-
let {
|
|
1812
|
-
theme,
|
|
1813
|
-
_intlDayHeader,
|
|
1814
|
-
_intlDayHeaderAL,
|
|
1815
|
-
_days
|
|
1816
|
-
} = getContext("state");
|
|
1827
|
+
let { theme, _intlDayHeader, _intlDayHeaderAL, _days } = getContext("state");
|
|
1817
1828
|
$.init();
|
|
1818
1829
|
var div = root$p();
|
|
1819
1830
|
var div_1 = $.child(div);
|
|
@@ -1833,8 +1844,7 @@ function Header$1($$anchor, $$props) {
|
|
|
1833
1844
|
return (_a = $theme().weekdays) == null ? void 0 : _a[$.get(day).getUTCDay()];
|
|
1834
1845
|
},
|
|
1835
1846
|
() => $_intlDayHeaderAL().format($.get(day))
|
|
1836
|
-
]
|
|
1837
|
-
$.derived_safe_equal
|
|
1847
|
+
]
|
|
1838
1848
|
);
|
|
1839
1849
|
$.append($$anchor2, div_2);
|
|
1840
1850
|
});
|
|
@@ -1890,10 +1900,7 @@ function BaseEvent($$anchor, $$props) {
|
|
|
1890
1900
|
let display = $.derived(() => $$props.chunk.event.display);
|
|
1891
1901
|
let bgColor = $.derived(() => $.get(event).backgroundColor ?? resourceBackgroundColor($.get(event), $resources()) ?? $eventBackgroundColor() ?? $eventColor());
|
|
1892
1902
|
let txtColor = $.derived(() => $.get(event).textColor ?? resourceTextColor($.get(event), $resources()) ?? $eventTextColor());
|
|
1893
|
-
let style = $.derived(() => entries(styles()({
|
|
1894
|
-
"background-color": $.get(bgColor),
|
|
1895
|
-
"color": $.get(txtColor)
|
|
1896
|
-
})).map((entry) => `${entry[0]}:${entry[1]}`).concat($.get(event).styles).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(";"));
|
|
1897
1904
|
let classNames = $.derived(() => classes()([
|
|
1898
1905
|
bgEvent($.get(display)) ? $theme().bgEvent : $theme().event,
|
|
1899
1906
|
...createEventClasses($eventClassNames(), $.get(event), $_view())
|
|
@@ -3061,11 +3068,7 @@ function Action($$anchor, $$props) {
|
|
|
3061
3068
|
let payload = findPayload(findDayEl());
|
|
3062
3069
|
if (payload) {
|
|
3063
3070
|
let newAllDay;
|
|
3064
|
-
({
|
|
3065
|
-
allDay: newAllDay,
|
|
3066
|
-
date: newDate,
|
|
3067
|
-
resource: newResource
|
|
3068
|
-
} = payload);
|
|
3071
|
+
({ allDay: newAllDay, date: newDate, resource: newResource } = payload);
|
|
3069
3072
|
if (newAllDay === allDay) {
|
|
3070
3073
|
let candidate = copyIEventData({}, $_iEvents()[0]);
|
|
3071
3074
|
let constraintFn = $resizeConstraint();
|
|
@@ -3326,13 +3329,7 @@ function Action($$anchor, $$props) {
|
|
|
3326
3329
|
function createCallbackInfo(event2, oldEvent, jsEvent) {
|
|
3327
3330
|
let info;
|
|
3328
3331
|
if (resizing()) {
|
|
3329
|
-
info = resizingStart() ? {
|
|
3330
|
-
startDelta: delta,
|
|
3331
|
-
endDelta: createDuration(0)
|
|
3332
|
-
} : {
|
|
3333
|
-
startDelta: createDuration(0),
|
|
3334
|
-
endDelta: delta
|
|
3335
|
-
};
|
|
3332
|
+
info = resizingStart() ? { startDelta: delta, endDelta: createDuration(0) } : { startDelta: createDuration(0), endDelta: delta };
|
|
3336
3333
|
} else {
|
|
3337
3334
|
info = {
|
|
3338
3335
|
delta,
|
|
@@ -3377,10 +3374,7 @@ function Action($$anchor, $$props) {
|
|
|
3377
3374
|
selected = false;
|
|
3378
3375
|
destroyIEvent();
|
|
3379
3376
|
if (isFunction($unselectFn())) {
|
|
3380
|
-
$unselectFn()({
|
|
3381
|
-
jsEvent,
|
|
3382
|
-
view: toViewWithLocalDates($_view())
|
|
3383
|
-
});
|
|
3377
|
+
$unselectFn()({ jsEvent, view: toViewWithLocalDates($_view()) });
|
|
3384
3378
|
}
|
|
3385
3379
|
}
|
|
3386
3380
|
}
|
|
@@ -3702,10 +3696,6 @@ function Event$3($$anchor, $$props) {
|
|
|
3702
3696
|
delete style["color"];
|
|
3703
3697
|
return style;
|
|
3704
3698
|
});
|
|
3705
|
-
const expression = $.derived(() => {
|
|
3706
|
-
var _a;
|
|
3707
|
-
return (_a = $_interaction().action) == null ? void 0 : _a.noAction;
|
|
3708
|
-
});
|
|
3709
3699
|
{
|
|
3710
3700
|
const body = ($$anchor2, defaultBody = $.noop, bgColor = $.noop, txtColor = $.noop) => {
|
|
3711
3701
|
var fragment_1 = root_1$8();
|
|
@@ -3713,12 +3703,19 @@ function Event$3($$anchor, $$props) {
|
|
|
3713
3703
|
let styles_1;
|
|
3714
3704
|
var node = $.sibling(div, 2);
|
|
3715
3705
|
$.snippet(node, defaultBody);
|
|
3716
|
-
$.template_effect(
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
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
|
+
);
|
|
3720
3713
|
$.append($$anchor2, fragment_1);
|
|
3721
3714
|
};
|
|
3715
|
+
let $0 = $.derived(() => {
|
|
3716
|
+
var _a;
|
|
3717
|
+
return (_a = $_interaction().action) == null ? void 0 : _a.noAction;
|
|
3718
|
+
});
|
|
3722
3719
|
BaseEvent($$anchor, {
|
|
3723
3720
|
get chunk() {
|
|
3724
3721
|
return $$props.chunk;
|
|
@@ -3727,7 +3724,7 @@ function Event$3($$anchor, $$props) {
|
|
|
3727
3724
|
return $.get(styles);
|
|
3728
3725
|
},
|
|
3729
3726
|
get onpointerdown() {
|
|
3730
|
-
return $.get(
|
|
3727
|
+
return $.get($0);
|
|
3731
3728
|
},
|
|
3732
3729
|
body,
|
|
3733
3730
|
$$slots: { body: true }
|
|
@@ -3826,12 +3823,10 @@ function Day$3($$anchor, $$props) {
|
|
|
3826
3823
|
$.set_class(time_1, 1, $theme().daySide);
|
|
3827
3824
|
$.set_attribute(time_1, "datetime", $.get(datetime));
|
|
3828
3825
|
},
|
|
3829
|
-
[
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
}
|
|
3834
|
-
]
|
|
3826
|
+
[() => {
|
|
3827
|
+
var _a;
|
|
3828
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
3829
|
+
}]
|
|
3835
3830
|
);
|
|
3836
3831
|
$.append($$anchor2, div);
|
|
3837
3832
|
};
|
|
@@ -3846,10 +3841,7 @@ function Day$3($$anchor, $$props) {
|
|
|
3846
3841
|
$.delegate(["pointerdown"]);
|
|
3847
3842
|
function onclick$1(jsEvent, $noEventsClick, noEventsClick, $_view, _view) {
|
|
3848
3843
|
if (isFunction($noEventsClick())) {
|
|
3849
|
-
$noEventsClick()({
|
|
3850
|
-
jsEvent,
|
|
3851
|
-
view: toViewWithLocalDates($_view())
|
|
3852
|
-
});
|
|
3844
|
+
$noEventsClick()({ jsEvent, view: toViewWithLocalDates($_view()) });
|
|
3853
3845
|
}
|
|
3854
3846
|
}
|
|
3855
3847
|
var root_1$6 = $.from_html(`<div></div>`);
|
|
@@ -3894,13 +3886,7 @@ function Body$2($$anchor, $$props) {
|
|
|
3894
3886
|
{
|
|
3895
3887
|
var consequent = ($$anchor2) => {
|
|
3896
3888
|
var div_2 = root_1$6();
|
|
3897
|
-
div_2.__click = [
|
|
3898
|
-
onclick$1,
|
|
3899
|
-
$noEventsClick,
|
|
3900
|
-
noEventsClick,
|
|
3901
|
-
$_view,
|
|
3902
|
-
_view
|
|
3903
|
-
];
|
|
3889
|
+
div_2.__click = [onclick$1, $noEventsClick, noEventsClick, $_view, _view];
|
|
3904
3890
|
$.action(div_2, ($$node, $$action_arg) => setContent == null ? void 0 : setContent($$node, $$action_arg), () => $.get(content));
|
|
3905
3891
|
$.template_effect(() => $.set_class(div_2, 1, $theme().noEvents));
|
|
3906
3892
|
$.append($$anchor2, div_2);
|
|
@@ -4051,12 +4037,7 @@ function Section($$anchor, $$props) {
|
|
|
4051
4037
|
const $slotLabelInterval = () => $.store_get(slotLabelInterval, "$slotLabelInterval", $$stores);
|
|
4052
4038
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
4053
4039
|
const $_times = () => $.store_get(_times, "$_times", $$stores);
|
|
4054
|
-
let {
|
|
4055
|
-
allDayContent,
|
|
4056
|
-
slotLabelInterval,
|
|
4057
|
-
theme,
|
|
4058
|
-
_times
|
|
4059
|
-
} = getContext("state");
|
|
4040
|
+
let { allDayContent, slotLabelInterval, theme, _times } = getContext("state");
|
|
4060
4041
|
let allDayText = $.derived(() => createAllDayContent($allDayContent()));
|
|
4061
4042
|
let showAllTimes = $.derived(() => $slotLabelInterval() && $slotLabelInterval().seconds <= 0);
|
|
4062
4043
|
var fragment = root$f();
|
|
@@ -4188,12 +4169,7 @@ function Event$2($$anchor, $$props) {
|
|
|
4188
4169
|
const $_slotTimeLimits = () => $.store_get(_slotTimeLimits, "$_slotTimeLimits", $$stores);
|
|
4189
4170
|
const $slotHeight = () => $.store_get(slotHeight, "$slotHeight", $$stores);
|
|
4190
4171
|
const $slotEventOverlap = () => $.store_get(slotEventOverlap, "$slotEventOverlap", $$stores);
|
|
4191
|
-
let {
|
|
4192
|
-
slotEventOverlap,
|
|
4193
|
-
slotDuration,
|
|
4194
|
-
slotHeight,
|
|
4195
|
-
_slotTimeLimits
|
|
4196
|
-
} = getContext("state");
|
|
4172
|
+
let { slotEventOverlap, slotDuration, slotHeight, _slotTimeLimits } = getContext("state");
|
|
4197
4173
|
let display = $.derived(() => $$props.chunk.event.display);
|
|
4198
4174
|
let styles = $.derived(() => (style) => {
|
|
4199
4175
|
let step = $slotDuration().seconds;
|
|
@@ -4443,12 +4419,10 @@ function Day$2($$anchor, $$props) {
|
|
|
4443
4419
|
$.set_class(div_2, 1, $theme().events);
|
|
4444
4420
|
$.set_class(div_3, 1, $theme().extra);
|
|
4445
4421
|
},
|
|
4446
|
-
[
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
}
|
|
4451
|
-
]
|
|
4422
|
+
[() => {
|
|
4423
|
+
var _a;
|
|
4424
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
4425
|
+
}]
|
|
4452
4426
|
);
|
|
4453
4427
|
$.append($$anchor, div);
|
|
4454
4428
|
$.pop();
|
|
@@ -4506,13 +4480,7 @@ function Day$1($$anchor, $$props) {
|
|
|
4506
4480
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
4507
4481
|
const $_interaction = () => $.store_get(_interaction, "$_interaction", $$stores);
|
|
4508
4482
|
let iChunks = $.prop($$props, "iChunks", 19, () => []), resource = $.prop($$props, "resource", 3, void 0);
|
|
4509
|
-
let {
|
|
4510
|
-
highlightedDates,
|
|
4511
|
-
theme,
|
|
4512
|
-
validRange,
|
|
4513
|
-
_interaction,
|
|
4514
|
-
_today
|
|
4515
|
-
} = getContext("state");
|
|
4483
|
+
let { highlightedDates, theme, validRange, _interaction, _today } = getContext("state");
|
|
4516
4484
|
let el = $.state(void 0);
|
|
4517
4485
|
let refs = [];
|
|
4518
4486
|
let dayChunks = $.derived(() => $$props.chunks.filter((chunk) => datesEqual(chunk.date, $$props.date)));
|
|
@@ -4613,12 +4581,10 @@ function Day$1($$anchor, $$props) {
|
|
|
4613
4581
|
$.set_class(div_1, 1, $theme().bgEvents);
|
|
4614
4582
|
$.set_class(div_3, 1, $theme().events);
|
|
4615
4583
|
},
|
|
4616
|
-
[
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
}
|
|
4621
|
-
]
|
|
4584
|
+
[() => {
|
|
4585
|
+
var _a;
|
|
4586
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
4587
|
+
}]
|
|
4622
4588
|
);
|
|
4623
4589
|
$.append($$anchor, div);
|
|
4624
4590
|
var $$pop = $.pop({ reposition });
|
|
@@ -4763,8 +4729,7 @@ function View$2($$anchor, $$props) {
|
|
|
4763
4729
|
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : "",
|
|
4764
4730
|
() => toISOString($.get(date), 10),
|
|
4765
4731
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
4766
|
-
]
|
|
4767
|
-
$.derived_safe_equal
|
|
4732
|
+
]
|
|
4768
4733
|
);
|
|
4769
4734
|
$.append($$anchor3, div_1);
|
|
4770
4735
|
});
|
|
@@ -5080,15 +5045,17 @@ function View$1($$anchor, $$props) {
|
|
|
5080
5045
|
$.each(node_10, 1, $_viewDates, $.index, ($$anchor5, date) => {
|
|
5081
5046
|
var div_10 = root_12();
|
|
5082
5047
|
$.each(div_10, 5, $_viewResources, $.index, ($$anchor6, resource) => {
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
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
|
+
}
|
|
5092
5059
|
});
|
|
5093
5060
|
$.reset(div_10);
|
|
5094
5061
|
$.template_effect(() => $.set_class(div_10, 1, $theme().resource));
|
|
@@ -5147,16 +5114,18 @@ function View$1($$anchor, $$props) {
|
|
|
5147
5114
|
$.each(node_14, 17, () => $.get(loops)[0], $.index, ($$anchor3, item0) => {
|
|
5148
5115
|
var div_13 = root_17();
|
|
5149
5116
|
$.each(div_13, 21, () => $.get(loops)[1], $.index, ($$anchor4, item1) => {
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
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
|
+
}
|
|
5160
5129
|
});
|
|
5161
5130
|
$.reset(div_13);
|
|
5162
5131
|
$.template_effect(() => $.set_class(div_13, 1, $theme().resource));
|
|
@@ -5241,9 +5210,10 @@ function Label($$anchor, $$props) {
|
|
|
5241
5210
|
$.push($$props, true);
|
|
5242
5211
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
5243
5212
|
const $resourceLabelContent = () => $.store_get(resourceLabelContent, "$resourceLabelContent", $$stores);
|
|
5213
|
+
const $_resHs = () => $.store_get(_resHs, "$_resHs", $$stores);
|
|
5244
5214
|
const $resourceLabelDidMount = () => $.store_get(resourceLabelDidMount, "$resourceLabelDidMount", $$stores);
|
|
5245
5215
|
let date = $.prop($$props, "date", 3, void 0);
|
|
5246
|
-
let { resourceLabelContent, resourceLabelDidMount } = getContext("state");
|
|
5216
|
+
let { resourceLabelContent, resourceLabelDidMount, _resHs } = getContext("state");
|
|
5247
5217
|
let el = $.state(void 0);
|
|
5248
5218
|
let content = $.derived(() => {
|
|
5249
5219
|
if ($resourceLabelContent()) {
|
|
@@ -5255,6 +5225,13 @@ function Label($$anchor, $$props) {
|
|
|
5255
5225
|
return $$props.resource.title;
|
|
5256
5226
|
}
|
|
5257
5227
|
});
|
|
5228
|
+
$.user_effect(() => {
|
|
5229
|
+
$.get(content);
|
|
5230
|
+
untrack(() => {
|
|
5231
|
+
$_resHs().set($$props.resource, ceil(height($.get(el)) + 10));
|
|
5232
|
+
$.store_set(_resHs, $_resHs());
|
|
5233
|
+
});
|
|
5234
|
+
});
|
|
5258
5235
|
onMount(() => {
|
|
5259
5236
|
if (isFunction($resourceLabelDidMount())) {
|
|
5260
5237
|
$resourceLabelDidMount()({
|
|
@@ -5312,13 +5289,7 @@ function Expander($$anchor, $$props) {
|
|
|
5312
5289
|
{
|
|
5313
5290
|
var consequent_1 = ($$anchor2) => {
|
|
5314
5291
|
var button = root_2$2();
|
|
5315
|
-
button.__click = [
|
|
5316
|
-
onclick,
|
|
5317
|
-
expanded,
|
|
5318
|
-
payload,
|
|
5319
|
-
toggle,
|
|
5320
|
-
resources
|
|
5321
|
-
];
|
|
5292
|
+
button.__click = [onclick, expanded, payload, toggle, resources];
|
|
5322
5293
|
var node_2 = $.child(button);
|
|
5323
5294
|
{
|
|
5324
5295
|
var consequent = ($$anchor3) => {
|
|
@@ -5353,28 +5324,35 @@ $.delegate(["click"]);
|
|
|
5353
5324
|
var root_1$3 = $.from_html(`<div role="rowheader"><!> <!></div>`);
|
|
5354
5325
|
var root$5 = $.from_html(`<div><div></div> <div></div></div>`);
|
|
5355
5326
|
function Sidebar($$anchor, $$props) {
|
|
5356
|
-
$.push($$props,
|
|
5327
|
+
$.push($$props, true);
|
|
5357
5328
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
5329
|
+
const $_viewResources = () => $.store_get(_viewResources, "$_viewResources", $$stores);
|
|
5330
|
+
const $_resHs = () => $.store_get(_resHs, "$_resHs", $$stores);
|
|
5358
5331
|
const $_bodyEl = () => $.store_get(_bodyEl, "$_bodyEl", $$stores);
|
|
5359
5332
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
5360
5333
|
const $_headerHeight = () => $.store_get(_headerHeight, "$_headerHeight", $$stores);
|
|
5361
5334
|
const $_sidebarEl = () => $.store_get(_sidebarEl, "$_sidebarEl", $$stores);
|
|
5362
|
-
const $
|
|
5363
|
-
const $_resHs = () => $.store_get(_resHs, "$_resHs", $$stores);
|
|
5335
|
+
const $_daysHs = () => $.store_get(_daysHs, "$_daysHs", $$stores);
|
|
5364
5336
|
const $_nestedResources = () => $.store_get(_nestedResources, "$_nestedResources", $$stores);
|
|
5365
5337
|
let {
|
|
5366
5338
|
_viewResources,
|
|
5367
5339
|
_headerHeight,
|
|
5368
5340
|
_bodyEl,
|
|
5341
|
+
_daysHs,
|
|
5369
5342
|
_resHs,
|
|
5370
5343
|
_sidebarEl,
|
|
5371
5344
|
_nestedResources,
|
|
5372
5345
|
theme
|
|
5373
5346
|
} = getContext("state");
|
|
5347
|
+
$.user_pre_effect(() => {
|
|
5348
|
+
$_viewResources();
|
|
5349
|
+
untrack(() => {
|
|
5350
|
+
$_resHs().clear();
|
|
5351
|
+
});
|
|
5352
|
+
});
|
|
5374
5353
|
function onwheel(jsEvent) {
|
|
5375
5354
|
$_bodyEl().scrollBy({ top: jsEvent.deltaY < 0 ? -30 : 30 });
|
|
5376
5355
|
}
|
|
5377
|
-
$.init();
|
|
5378
5356
|
var div = root$5();
|
|
5379
5357
|
var div_1 = $.child(div);
|
|
5380
5358
|
var div_2 = $.sibling(div_1, 2);
|
|
@@ -5406,9 +5384,8 @@ function Sidebar($$anchor, $$props) {
|
|
|
5406
5384
|
$.set_style(div_3, `flex-basis: ${$0 ?? ""}px`);
|
|
5407
5385
|
},
|
|
5408
5386
|
[
|
|
5409
|
-
() => max($_resHs().get($.get(resource)) ?? 0, 34)
|
|
5410
|
-
]
|
|
5411
|
-
$.derived_safe_equal
|
|
5387
|
+
() => max($_daysHs().get($.get(resource)) ?? 0, $_resHs().get($.get(resource)) ?? 0, 34)
|
|
5388
|
+
]
|
|
5412
5389
|
);
|
|
5413
5390
|
$.append($$anchor2, div_3);
|
|
5414
5391
|
});
|
|
@@ -5489,8 +5466,7 @@ function Header($$anchor, $$props) {
|
|
|
5489
5466
|
[
|
|
5490
5467
|
() => toISOString($.get(date), 10),
|
|
5491
5468
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
5492
|
-
]
|
|
5493
|
-
$.derived_safe_equal
|
|
5469
|
+
]
|
|
5494
5470
|
);
|
|
5495
5471
|
$.append($$anchor3, fragment);
|
|
5496
5472
|
};
|
|
@@ -5508,8 +5484,7 @@ function Header($$anchor, $$props) {
|
|
|
5508
5484
|
[
|
|
5509
5485
|
() => toISOString($.get(date), 10),
|
|
5510
5486
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
5511
|
-
]
|
|
5512
|
-
$.derived_safe_equal
|
|
5487
|
+
]
|
|
5513
5488
|
);
|
|
5514
5489
|
$.append($$anchor3, div_6);
|
|
5515
5490
|
};
|
|
@@ -5519,17 +5494,13 @@ function Header($$anchor, $$props) {
|
|
|
5519
5494
|
});
|
|
5520
5495
|
}
|
|
5521
5496
|
$.reset(div_2);
|
|
5522
|
-
$.template_effect(
|
|
5523
|
-
(
|
|
5524
|
-
|
|
5525
|
-
()
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : ""
|
|
5530
|
-
],
|
|
5531
|
-
$.derived_safe_equal
|
|
5532
|
-
);
|
|
5497
|
+
$.template_effect(($0, $1) => $.set_class(div_2, 1, `${$theme().day ?? ""} ${$0 ?? ""}${$1 ?? ""}`), [
|
|
5498
|
+
() => {
|
|
5499
|
+
var _a;
|
|
5500
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$.get(date).getUTCDay()];
|
|
5501
|
+
},
|
|
5502
|
+
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : ""
|
|
5503
|
+
]);
|
|
5533
5504
|
$.append($$anchor2, div_2);
|
|
5534
5505
|
});
|
|
5535
5506
|
$.reset(div_1);
|
|
@@ -5890,20 +5861,21 @@ function Days($$anchor, $$props) {
|
|
|
5890
5861
|
const $_filteredEvents = () => $.store_get(_filteredEvents, "$_filteredEvents", $$stores);
|
|
5891
5862
|
const $slotDuration = () => $.store_get(slotDuration, "$slotDuration", $$stores);
|
|
5892
5863
|
const $_iEvents = () => $.store_get(_iEvents, "$_iEvents", $$stores);
|
|
5893
|
-
const $
|
|
5864
|
+
const $_daysHs = () => $.store_get(_daysHs, "$_daysHs", $$stores);
|
|
5894
5865
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
5866
|
+
const $_resHs = () => $.store_get(_resHs, "$_resHs", $$stores);
|
|
5895
5867
|
let {
|
|
5896
5868
|
_viewDates,
|
|
5897
5869
|
_filteredEvents,
|
|
5898
5870
|
_iEvents,
|
|
5899
|
-
_resHs,
|
|
5900
5871
|
_dayTimeLimits,
|
|
5872
|
+
_daysHs,
|
|
5873
|
+
_resHs,
|
|
5901
5874
|
slotDuration,
|
|
5902
5875
|
theme,
|
|
5903
5876
|
validRange
|
|
5904
5877
|
} = getContext("state");
|
|
5905
5878
|
let refs = [];
|
|
5906
|
-
let height2 = $.state(0);
|
|
5907
5879
|
let $$d = $.derived(() => {
|
|
5908
5880
|
let start2 = cloneDate(limitToRange($_viewDates()[0], $validRange()));
|
|
5909
5881
|
let end2 = cloneDate(limitToRange($_viewDates().at(-1), $validRange()));
|
|
@@ -5946,9 +5918,8 @@ function Days($$anchor, $$props) {
|
|
|
5946
5918
|
return chunk;
|
|
5947
5919
|
}));
|
|
5948
5920
|
function reposition() {
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
$.store_set(_resHs, $_resHs());
|
|
5921
|
+
$_daysHs().set($$props.resource, ceil(max(...runReposition(refs, $_viewDates()))) + 10);
|
|
5922
|
+
$.store_set(_daysHs, $_daysHs());
|
|
5952
5923
|
}
|
|
5953
5924
|
var div = root$2();
|
|
5954
5925
|
$.each(div, 5, $_viewDates, $.index, ($$anchor2, date, i) => {
|
|
@@ -5984,7 +5955,9 @@ function Days($$anchor, $$props) {
|
|
|
5984
5955
|
$.set_class(div, 1, $theme().days);
|
|
5985
5956
|
$.set_style(div, `flex-basis: ${$0 ?? ""}px`);
|
|
5986
5957
|
},
|
|
5987
|
-
[
|
|
5958
|
+
[
|
|
5959
|
+
() => max($_daysHs().get($$props.resource) ?? 0, $_resHs().get($$props.resource) ?? 0, 34)
|
|
5960
|
+
]
|
|
5988
5961
|
);
|
|
5989
5962
|
$.append($$anchor, div);
|
|
5990
5963
|
var $$pop = $.pop({ reposition });
|
|
@@ -6002,7 +5975,7 @@ function Body($$anchor, $$props) {
|
|
|
6002
5975
|
const $scrollTime = () => $.store_get(scrollTime, "$scrollTime", $$stores);
|
|
6003
5976
|
const $slotDuration = () => $.store_get(slotDuration, "$slotDuration", $$stores);
|
|
6004
5977
|
const $slotWidth = () => $.store_get(slotWidth, "$slotWidth", $$stores);
|
|
6005
|
-
const $
|
|
5978
|
+
const $_daysHs = () => $.store_get(_daysHs, "$_daysHs", $$stores);
|
|
6006
5979
|
const $_viewResources = () => $.store_get(_viewResources, "$_viewResources", $$stores);
|
|
6007
5980
|
const $_filteredEvents = () => $.store_get(_filteredEvents, "$_filteredEvents", $$stores);
|
|
6008
5981
|
const $_headerEl = () => $.store_get(_headerEl, "$_headerEl", $$stores);
|
|
@@ -6020,7 +5993,7 @@ function Body($$anchor, $$props) {
|
|
|
6020
5993
|
_dayTimes,
|
|
6021
5994
|
_dayTimeLimits,
|
|
6022
5995
|
_recheckScrollable,
|
|
6023
|
-
|
|
5996
|
+
_daysHs,
|
|
6024
5997
|
_viewResources,
|
|
6025
5998
|
_viewDates,
|
|
6026
5999
|
scrollTime,
|
|
@@ -6040,7 +6013,7 @@ function Body($$anchor, $$props) {
|
|
|
6040
6013
|
untrack(scrollToTime);
|
|
6041
6014
|
});
|
|
6042
6015
|
function reposition() {
|
|
6043
|
-
$
|
|
6016
|
+
$_daysHs().clear();
|
|
6044
6017
|
runReposition(refs, $_viewResources());
|
|
6045
6018
|
}
|
|
6046
6019
|
$.user_effect(() => {
|
|
@@ -6154,14 +6127,19 @@ function NowIndicator($$anchor, $$props) {
|
|
|
6154
6127
|
var consequent = ($$anchor2) => {
|
|
6155
6128
|
var div = root_1();
|
|
6156
6129
|
let styles;
|
|
6157
|
-
$.template_effect(
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6130
|
+
$.template_effect(
|
|
6131
|
+
($0) => {
|
|
6132
|
+
$.set_class(div, 1, $theme().nowIndicator);
|
|
6133
|
+
styles = $.set_style(div, "", styles, $0);
|
|
6134
|
+
},
|
|
6135
|
+
[
|
|
6136
|
+
() => ({
|
|
6137
|
+
top: `${$_headerHeight() + 2}px`,
|
|
6138
|
+
left: `${$.get(left) ?? ""}px`,
|
|
6139
|
+
height: `${$_bodyHeight() - 1}px`
|
|
6140
|
+
})
|
|
6141
|
+
]
|
|
6142
|
+
);
|
|
6165
6143
|
$.append($$anchor2, div);
|
|
6166
6144
|
};
|
|
6167
6145
|
$.if(node, ($$render) => {
|
|
@@ -6260,6 +6238,7 @@ const index = {
|
|
|
6260
6238
|
state._headerHeight = writable(0);
|
|
6261
6239
|
state._dayTimeLimits = dayTimeLimits(state);
|
|
6262
6240
|
state._dayTimes = dayTimes(state);
|
|
6241
|
+
state._daysHs = writable(/* @__PURE__ */ new Map());
|
|
6263
6242
|
state._nestedResources = nestedResources(state);
|
|
6264
6243
|
state._resHs = writable(/* @__PURE__ */ new Map());
|
|
6265
6244
|
state._sidebarEl = writable(void 0);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Days from './Days.svelte';
|
|
6
6
|
|
|
7
7
|
let {_bodyEl, _bodyHeight, _bodyWidth, _bodyScrollLeft, _headerEl, _filteredEvents, _sidebarEl, _dayTimes, _dayTimeLimits,
|
|
8
|
-
_recheckScrollable,
|
|
8
|
+
_recheckScrollable, _daysHs, _viewResources, _viewDates, scrollTime, slotDuration, slotWidth, theme} = getContext('state');
|
|
9
9
|
|
|
10
10
|
let refs = [];
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
function reposition() {
|
|
24
|
-
$
|
|
24
|
+
$_daysHs.clear();
|
|
25
25
|
runReposition(refs, $_viewResources);
|
|
26
26
|
}
|
|
27
27
|
$effect(() => {
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
let {resource} = $props();
|
|
11
11
|
|
|
12
12
|
let {
|
|
13
|
-
_viewDates, _filteredEvents, _iEvents,
|
|
13
|
+
_viewDates, _filteredEvents, _iEvents, _dayTimeLimits, _daysHs, _resHs, slotDuration, theme, validRange
|
|
14
14
|
} = getContext('state');
|
|
15
15
|
|
|
16
16
|
let refs = [];
|
|
17
|
-
let height = $state(0);
|
|
18
17
|
|
|
19
18
|
let [start, end] = $derived.by(() => {
|
|
20
19
|
let start = cloneDate(limitToRange($_viewDates[0], $validRange));
|
|
@@ -61,13 +60,12 @@
|
|
|
61
60
|
}));
|
|
62
61
|
|
|
63
62
|
export function reposition() {
|
|
64
|
-
|
|
65
|
-
$
|
|
66
|
-
$_resHs = $_resHs;
|
|
63
|
+
$_daysHs.set(resource, ceil(max(...runReposition(refs, $_viewDates))) + 10);
|
|
64
|
+
$_daysHs = $_daysHs;
|
|
67
65
|
}
|
|
68
66
|
</script>
|
|
69
67
|
|
|
70
|
-
<div class="{$theme.days}" style="flex-basis: {max(
|
|
68
|
+
<div class="{$theme.days}" style="flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px" role="row">
|
|
71
69
|
{#each $_viewDates as date, i}
|
|
72
70
|
<!-- svelte-ignore binding_property_non_reactive -->
|
|
73
71
|
<Day {date} {resource} {chunks} {bgChunks} {longChunks} {iChunks} bind:this={refs[i]}/>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {getContext, onMount} from 'svelte';
|
|
3
|
-
import {setContent, toLocalDate, isFunction} from '#lib';
|
|
2
|
+
import {getContext, onMount, untrack} from 'svelte';
|
|
3
|
+
import {ceil, height, setContent, toLocalDate, isFunction} from '#lib';
|
|
4
4
|
|
|
5
5
|
let {resource, date = undefined} = $props();
|
|
6
6
|
|
|
7
|
-
let {resourceLabelContent, resourceLabelDidMount} = getContext('state');
|
|
7
|
+
let {resourceLabelContent, resourceLabelDidMount, _resHs} = getContext('state');
|
|
8
8
|
|
|
9
9
|
let el = $state();
|
|
10
10
|
// Content
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
$effect(() => {
|
|
25
|
+
content;
|
|
26
|
+
untrack(() => {
|
|
27
|
+
$_resHs.set(resource, ceil(height(el) + 10));
|
|
28
|
+
$_resHs = $_resHs;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
24
32
|
onMount(() => {
|
|
25
33
|
if (isFunction($resourceLabelDidMount)) {
|
|
26
34
|
$resourceLabelDidMount({
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {getContext} from 'svelte';
|
|
2
|
+
import {getContext, untrack} from 'svelte';
|
|
3
3
|
import {max} from '#lib';
|
|
4
4
|
import Label from './Label.svelte';
|
|
5
5
|
import Expander from './Expander.svelte';
|
|
6
6
|
|
|
7
|
-
let {_viewResources, _headerHeight, _bodyEl, _resHs, _sidebarEl, _nestedResources, theme} = getContext('state');
|
|
7
|
+
let {_viewResources, _headerHeight, _bodyEl, _daysHs, _resHs, _sidebarEl, _nestedResources, theme} = getContext('state');
|
|
8
|
+
|
|
9
|
+
$effect.pre(() => {
|
|
10
|
+
$_viewResources;
|
|
11
|
+
untrack(() => {
|
|
12
|
+
$_resHs.clear();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
8
15
|
|
|
9
16
|
function onwheel(jsEvent) {
|
|
10
17
|
$_bodyEl.scrollBy({
|
|
@@ -17,7 +24,7 @@
|
|
|
17
24
|
<div class="{$theme.sidebarTitle}" style="flex-basis: {$_headerHeight}px"></div>
|
|
18
25
|
<div class="{$theme.content}" bind:this={$_sidebarEl} {onwheel}>
|
|
19
26
|
{#each $_viewResources as resource}
|
|
20
|
-
<div class="{$theme.resource}" style="flex-basis: {max($_resHs.get(resource) ?? 0, 34)}px" role="rowheader">
|
|
27
|
+
<div class="{$theme.resource}" style="flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px" role="rowheader">
|
|
21
28
|
{#if $_nestedResources}
|
|
22
29
|
<Expander {resource} />
|
|
23
30
|
{/if}
|
|
@@ -58,6 +58,7 @@ export default {
|
|
|
58
58
|
state._headerHeight = writable(0);
|
|
59
59
|
state._dayTimeLimits = dayTimeLimits(state); // flexible time limits per day
|
|
60
60
|
state._dayTimes = dayTimes(state);
|
|
61
|
+
state._daysHs = writable(new Map()); // days row heights
|
|
61
62
|
state._nestedResources = nestedResources(state);
|
|
62
63
|
state._resHs = writable(new Map()); // resource row heights
|
|
63
64
|
state._sidebarEl = writable(undefined);
|