@event-calendar/core 5.2.4 → 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 +132 -13
- package/dist/index.css +1 -1
- package/dist/index.js +289 -189
- package/package.json +2 -2
- package/src/Calendar.svelte +6 -1
- package/src/lib/chunks.js +6 -3
- package/src/lib/components/BaseEvent.svelte +11 -5
- package/src/lib/dom.js +9 -0
- package/src/lib/resources.js +9 -8
- package/src/lib/utils.js +8 -9
- package/src/plugins/day-grid/View.svelte +5 -5
- package/src/plugins/interaction/Action.svelte +14 -11
- package/src/plugins/interaction/Resizer.svelte +2 -0
- package/src/plugins/list/View.svelte +2 -2
- package/src/plugins/resource-time-grid/View.svelte +10 -10
- package/src/plugins/resource-time-grid/derived.js +1 -1
- package/src/plugins/resource-timeline/View.svelte +9 -7
- package/src/plugins/resource-timeline/derived.js +1 -1
- package/src/plugins/resource-timeline/lib.js +7 -4
- package/src/plugins/time-grid/View.svelte +7 -7
- package/src/plugins/time-grid/lib.js +1 -0
- package/src/storage/derived.js +4 -3
- package/src/storage/effects.js +126 -77
- package/src/storage/options.svelte.js +6 -5
- package/src/storage/state.svelte.js +8 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.
|
|
2
|
+
* EventCalendar v5.3.1
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
|
-
import { untrack,
|
|
5
|
+
import { untrack, tick, getAbortSignal, getContext, setContext, onMount, mount, unmount } from "svelte";
|
|
6
6
|
import * as $ from "svelte/internal/client";
|
|
7
7
|
import "svelte/internal/disclose-version";
|
|
8
8
|
import { SvelteMap } from "svelte/reactivity";
|
|
@@ -87,6 +87,12 @@ function max(...args) {
|
|
|
87
87
|
function symbol() {
|
|
88
88
|
return /* @__PURE__ */ Symbol("ec");
|
|
89
89
|
}
|
|
90
|
+
function length(array) {
|
|
91
|
+
return array.length;
|
|
92
|
+
}
|
|
93
|
+
function empty(array) {
|
|
94
|
+
return !length(array);
|
|
95
|
+
}
|
|
90
96
|
function isArray(value) {
|
|
91
97
|
return Array.isArray(value);
|
|
92
98
|
}
|
|
@@ -112,14 +118,6 @@ function runAll(fns) {
|
|
|
112
118
|
function noop() {
|
|
113
119
|
}
|
|
114
120
|
const identity = (x) => x;
|
|
115
|
-
function stopPropagation(fn, _this = void 0) {
|
|
116
|
-
return function(event) {
|
|
117
|
-
event.stopPropagation();
|
|
118
|
-
if (fn) {
|
|
119
|
-
fn.call(_this, event);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
121
|
function isRtl() {
|
|
124
122
|
return window.getComputedStyle(document.documentElement).direction === "rtl";
|
|
125
123
|
}
|
|
@@ -323,6 +321,14 @@ function listen(node, event, handler, options) {
|
|
|
323
321
|
node.addEventListener(event, handler, options);
|
|
324
322
|
return () => node.removeEventListener(event, handler, options);
|
|
325
323
|
}
|
|
324
|
+
function stopPropagation(fn, _this = void 0) {
|
|
325
|
+
return function(jsEvent) {
|
|
326
|
+
jsEvent.stopPropagation();
|
|
327
|
+
if (fn) {
|
|
328
|
+
fn.call(_this, jsEvent);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
}
|
|
326
332
|
function createView(view2, _viewTitle, _currentRange, _activeRange) {
|
|
327
333
|
return {
|
|
328
334
|
type: view2,
|
|
@@ -492,19 +498,21 @@ function createAllDayChunks(event, days, withId = true) {
|
|
|
492
498
|
let lastEnd;
|
|
493
499
|
let gridColumn;
|
|
494
500
|
let gridRow;
|
|
495
|
-
|
|
496
|
-
|
|
501
|
+
let resource;
|
|
502
|
+
for (let { gridColumn: column, gridRow: row, resource: dayResource, dayStart, dayEnd, disabled } of days) {
|
|
503
|
+
if (!disabled && eventIntersects(event, dayStart, dayEnd, dayResource)) {
|
|
497
504
|
dates.push(dayStart);
|
|
498
505
|
lastEnd = dayEnd;
|
|
499
506
|
if (!gridColumn) {
|
|
500
507
|
gridColumn = column;
|
|
501
508
|
gridRow = row;
|
|
509
|
+
resource = dayResource;
|
|
502
510
|
}
|
|
503
511
|
}
|
|
504
512
|
}
|
|
505
513
|
if (dates.length) {
|
|
506
514
|
let chunk = createEventChunk(event, dates[0], lastEnd);
|
|
507
|
-
assign(chunk, { gridColumn, gridRow, dates });
|
|
515
|
+
assign(chunk, { gridColumn, gridRow, resource, dates });
|
|
508
516
|
if (withId) {
|
|
509
517
|
assignChunkId(chunk);
|
|
510
518
|
}
|
|
@@ -694,19 +702,19 @@ function createResource(input) {
|
|
|
694
702
|
return {
|
|
695
703
|
id: String(input.id),
|
|
696
704
|
title: input.title || "",
|
|
697
|
-
eventBackgroundColor: input
|
|
698
|
-
eventTextColor: input
|
|
705
|
+
eventBackgroundColor: eventBackgroundColor(input),
|
|
706
|
+
eventTextColor: eventTextColor(input),
|
|
699
707
|
extendedProps: input.extendedProps ?? {}
|
|
700
708
|
};
|
|
701
709
|
}
|
|
702
|
-
function
|
|
703
|
-
return
|
|
710
|
+
function eventBackgroundColor(resource) {
|
|
711
|
+
return resource?.eventBackgroundColor;
|
|
704
712
|
}
|
|
705
|
-
function
|
|
706
|
-
return
|
|
713
|
+
function eventTextColor(resource) {
|
|
714
|
+
return resource?.eventTextColor;
|
|
707
715
|
}
|
|
708
|
-
function
|
|
709
|
-
return resources.find((resource) => event.resourceIds.includes(resource.id));
|
|
716
|
+
function findFirstResource(event, resources) {
|
|
717
|
+
return empty(event.resourceIds) ? void 0 : resources.find((resource) => event.resourceIds.includes(resource.id));
|
|
710
718
|
}
|
|
711
719
|
function createSlots(date, slotDuration, slotLabelPeriodicity2, slotTimeLimits2, intlSlotLabel) {
|
|
712
720
|
let slots2 = [];
|
|
@@ -800,6 +808,7 @@ function createOptions(plugins) {
|
|
|
800
808
|
lazyFetching: true,
|
|
801
809
|
loading: void 0,
|
|
802
810
|
locale: void 0,
|
|
811
|
+
refetchResourcesOnNavigate: false,
|
|
803
812
|
resources: [],
|
|
804
813
|
selectable: false,
|
|
805
814
|
theme: {
|
|
@@ -857,13 +866,13 @@ function createOptions(plugins) {
|
|
|
857
866
|
}
|
|
858
867
|
function createParsers(plugins) {
|
|
859
868
|
let parsers = {
|
|
860
|
-
date: (
|
|
869
|
+
date: (input) => setMidnight(createDate(input)),
|
|
861
870
|
duration: createDuration,
|
|
862
871
|
events: createEvents,
|
|
863
872
|
eventSources: createEventSources,
|
|
864
|
-
hiddenDays: (
|
|
865
|
-
highlightedDates: (
|
|
866
|
-
resources: createResources,
|
|
873
|
+
hiddenDays: (input) => [...new Set(input)],
|
|
874
|
+
highlightedDates: (input) => input.map((item) => setMidnight(createDate(item))),
|
|
875
|
+
resources: (input) => isArray(input) ? createResources(input) : input,
|
|
867
876
|
validRange: createDateRange
|
|
868
877
|
};
|
|
869
878
|
for (let plugin of plugins) {
|
|
@@ -986,71 +995,121 @@ function diff(options, prevOptions) {
|
|
|
986
995
|
}
|
|
987
996
|
return diff2;
|
|
988
997
|
}
|
|
989
|
-
function loadEvents(mainState) {
|
|
990
|
-
let fetching = 0;
|
|
998
|
+
function loadEvents(mainState, loadingInvoker) {
|
|
991
999
|
return () => {
|
|
992
|
-
let {
|
|
1000
|
+
let {
|
|
1001
|
+
activeRange: activeRange2,
|
|
1002
|
+
fetchedRange: { events: fetchedRange },
|
|
1003
|
+
viewDates: viewDates2,
|
|
1004
|
+
options: { events, eventSources, lazyFetching }
|
|
1005
|
+
} = mainState;
|
|
993
1006
|
untrack(() => {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
mainState.events =
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1007
|
+
load(
|
|
1008
|
+
eventSources.map((source) => isFunction(source.events) ? source.events : source),
|
|
1009
|
+
events,
|
|
1010
|
+
createEvents,
|
|
1011
|
+
(result) => mainState.events = result,
|
|
1012
|
+
activeRange2,
|
|
1013
|
+
fetchedRange,
|
|
1014
|
+
viewDates2,
|
|
1015
|
+
true,
|
|
1016
|
+
lazyFetching,
|
|
1017
|
+
loadingInvoker
|
|
1018
|
+
);
|
|
1019
|
+
});
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
function loadResources(mainState, loadingInvoker) {
|
|
1023
|
+
return () => {
|
|
1024
|
+
let {
|
|
1025
|
+
activeRange: activeRange2,
|
|
1026
|
+
fetchedRange: { resources: fetchedRange },
|
|
1027
|
+
viewDates: viewDates2,
|
|
1028
|
+
options: { lazyFetching, refetchResourcesOnNavigate, resources }
|
|
1029
|
+
} = mainState;
|
|
1030
|
+
untrack(() => {
|
|
1031
|
+
load(
|
|
1032
|
+
isArray(resources) ? [] : [resources],
|
|
1033
|
+
resources,
|
|
1034
|
+
createResources,
|
|
1035
|
+
(result) => mainState.resources = result,
|
|
1036
|
+
activeRange2,
|
|
1037
|
+
fetchedRange,
|
|
1038
|
+
viewDates2,
|
|
1039
|
+
refetchResourcesOnNavigate,
|
|
1040
|
+
lazyFetching,
|
|
1041
|
+
loadingInvoker
|
|
1042
|
+
);
|
|
1043
|
+
});
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
function load(sources, defaultResult, parseResult, applyResult, activeRange2, fetchedRange, viewDates2, refetchOnNavigate, lazyFetching, loading) {
|
|
1047
|
+
if (empty(viewDates2)) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
if (empty(sources)) {
|
|
1051
|
+
applyResult(defaultResult);
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
if ((refetchOnNavigate || !fetchedRange.start) && (!lazyFetching || !fetchedRange.start || fetchedRange.start > activeRange2.start || fetchedRange.end < activeRange2.end)) {
|
|
1055
|
+
let result = [];
|
|
1056
|
+
let failure = (e) => loading.stop();
|
|
1057
|
+
let success = (data) => {
|
|
1058
|
+
result = result.concat(parseResult(data));
|
|
1059
|
+
applyResult(result);
|
|
1060
|
+
loading.stop();
|
|
1061
|
+
};
|
|
1062
|
+
let startStr = toISOString(activeRange2.start);
|
|
1063
|
+
let endStr = toISOString(activeRange2.end);
|
|
1064
|
+
for (let source of sources) {
|
|
1065
|
+
loading.start();
|
|
1066
|
+
if (isFunction(source)) {
|
|
1067
|
+
let result2 = source(refetchOnNavigate ? {
|
|
1068
|
+
start: toLocalDate(activeRange2.start),
|
|
1069
|
+
end: toLocalDate(activeRange2.end),
|
|
1070
|
+
startStr,
|
|
1071
|
+
endStr
|
|
1072
|
+
} : {}, success, failure);
|
|
1073
|
+
if (result2 !== void 0) {
|
|
1074
|
+
Promise.resolve(result2).then(success, failure);
|
|
1003
1075
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
let
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
let endStr = toISOString(activeRange2.end);
|
|
1018
|
-
for (let source of eventSources) {
|
|
1019
|
-
if (isFunction(source.events)) {
|
|
1020
|
-
let result = source.events({
|
|
1021
|
-
start: toLocalDate(activeRange2.start),
|
|
1022
|
-
end: toLocalDate(activeRange2.end),
|
|
1023
|
-
startStr,
|
|
1024
|
-
endStr
|
|
1025
|
-
}, success, failure);
|
|
1026
|
-
if (result !== void 0) {
|
|
1027
|
-
Promise.resolve(result).then(success, failure);
|
|
1028
|
-
}
|
|
1029
|
-
} else {
|
|
1030
|
-
let params = isFunction(source.extraParams) ? source.extraParams() : assign({}, source.extraParams);
|
|
1031
|
-
params.start = startStr;
|
|
1032
|
-
params.end = endStr;
|
|
1033
|
-
params = new URLSearchParams(params);
|
|
1034
|
-
let url = source.url, headers = {}, body;
|
|
1035
|
-
if (["GET", "HEAD"].includes(source.method)) {
|
|
1036
|
-
url += (url.includes("?") ? "&" : "?") + params;
|
|
1037
|
-
} else {
|
|
1038
|
-
headers["content-type"] = "application/x-www-form-urlencoded;charset=UTF-8";
|
|
1039
|
-
body = String(params);
|
|
1040
|
-
}
|
|
1041
|
-
fetch(url, {
|
|
1042
|
-
method: source.method,
|
|
1043
|
-
headers,
|
|
1044
|
-
body,
|
|
1045
|
-
signal: getAbortSignal(),
|
|
1046
|
-
credentials: "same-origin"
|
|
1047
|
-
}).then((response) => response.json()).then(success).catch(failure);
|
|
1048
|
-
}
|
|
1049
|
-
++fetching;
|
|
1076
|
+
} else {
|
|
1077
|
+
let params = isFunction(source.extraParams) ? source.extraParams() : assign({}, source.extraParams);
|
|
1078
|
+
if (refetchOnNavigate) {
|
|
1079
|
+
params.start = startStr;
|
|
1080
|
+
params.end = endStr;
|
|
1081
|
+
}
|
|
1082
|
+
params = new URLSearchParams(params);
|
|
1083
|
+
let url = source.url, headers = {}, body;
|
|
1084
|
+
if (["GET", "HEAD"].includes(source.method)) {
|
|
1085
|
+
url += (url.includes("?") ? "&" : "?") + params;
|
|
1086
|
+
} else {
|
|
1087
|
+
headers["content-type"] = "application/x-www-form-urlencoded;charset=UTF-8";
|
|
1088
|
+
body = String(params);
|
|
1050
1089
|
}
|
|
1051
|
-
|
|
1090
|
+
fetch(url, {
|
|
1091
|
+
method: source.method,
|
|
1092
|
+
headers,
|
|
1093
|
+
body,
|
|
1094
|
+
signal: getAbortSignal(),
|
|
1095
|
+
credentials: "same-origin"
|
|
1096
|
+
}).then((response) => response.json()).then(success).catch(failure);
|
|
1052
1097
|
}
|
|
1053
|
-
}
|
|
1098
|
+
}
|
|
1099
|
+
assign(fetchedRange, activeRange2);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
function createLoadingInvoker(options) {
|
|
1103
|
+
let counter = 0;
|
|
1104
|
+
function invoke(value) {
|
|
1105
|
+
let { loading } = options;
|
|
1106
|
+
if (isFunction(loading)) {
|
|
1107
|
+
loading(value);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return {
|
|
1111
|
+
start: () => ++counter === 1 && invoke(true),
|
|
1112
|
+
stop: () => --counter === 0 && invoke(false)
|
|
1054
1113
|
};
|
|
1055
1114
|
}
|
|
1056
1115
|
function setNowAndToday(mainState) {
|
|
@@ -1173,8 +1232,8 @@ function viewDates(mainState) {
|
|
|
1173
1232
|
let { hiddenDays } = options;
|
|
1174
1233
|
let dates = [];
|
|
1175
1234
|
untrack(() => {
|
|
1176
|
-
let date = cloneDate(activeRange2.start);
|
|
1177
|
-
let end = cloneDate(activeRange2.end);
|
|
1235
|
+
let date = setMidnight(cloneDate(activeRange2.start));
|
|
1236
|
+
let end = setMidnight(cloneDate(activeRange2.end));
|
|
1178
1237
|
while (date < end) {
|
|
1179
1238
|
if (!hiddenDays.includes(date.getUTCDay())) {
|
|
1180
1239
|
dates.push(cloneDate(date));
|
|
@@ -1240,7 +1299,7 @@ class State {
|
|
|
1240
1299
|
return $.get(this.#fetchedRange);
|
|
1241
1300
|
}
|
|
1242
1301
|
set fetchedRange(value) {
|
|
1243
|
-
$.set(this.#fetchedRange, value);
|
|
1302
|
+
$.set(this.#fetchedRange, value, true);
|
|
1244
1303
|
}
|
|
1245
1304
|
#events;
|
|
1246
1305
|
get events() {
|
|
@@ -1270,6 +1329,13 @@ class State {
|
|
|
1270
1329
|
set now(value) {
|
|
1271
1330
|
$.set(this.#now, value, true);
|
|
1272
1331
|
}
|
|
1332
|
+
#resources;
|
|
1333
|
+
get resources() {
|
|
1334
|
+
return $.get(this.#resources);
|
|
1335
|
+
}
|
|
1336
|
+
set resources(value) {
|
|
1337
|
+
$.set(this.#resources, value);
|
|
1338
|
+
}
|
|
1273
1339
|
#today;
|
|
1274
1340
|
get today() {
|
|
1275
1341
|
return $.get(this.#today);
|
|
@@ -1376,11 +1442,12 @@ class State {
|
|
|
1376
1442
|
this.#auxComponents = $.state($.proxy([]));
|
|
1377
1443
|
this.#currentRange = $.derived(currentRange(this));
|
|
1378
1444
|
this.#activeRange = $.derived(activeRange(this));
|
|
1379
|
-
this.#fetchedRange = $.state({
|
|
1445
|
+
this.#fetchedRange = $.state($.proxy({ events: {}, resources: {} }));
|
|
1380
1446
|
this.#events = $.state([]);
|
|
1381
1447
|
this.#filteredEvents = $.derived(filteredEvents(this));
|
|
1382
1448
|
this.#mainEl = $.state();
|
|
1383
1449
|
this.#now = $.state($.proxy(createDate()));
|
|
1450
|
+
this.#resources = $.state([]);
|
|
1384
1451
|
this.#today = $.state($.proxy(setMidnight(createDate())));
|
|
1385
1452
|
this.#intlEventTime = $.derived(intlRange(this, "eventTimeFormat"));
|
|
1386
1453
|
this.#intlDayHeader = $.derived(intl(this, "dayHeaderFormat"));
|
|
@@ -1403,8 +1470,10 @@ class State {
|
|
|
1403
1470
|
this.#initEffects();
|
|
1404
1471
|
}
|
|
1405
1472
|
#initEffects() {
|
|
1473
|
+
let loading = createLoadingInvoker(this.options);
|
|
1406
1474
|
$.user_pre_effect(setNowAndToday(this));
|
|
1407
|
-
$.user_effect(loadEvents(this));
|
|
1475
|
+
$.user_effect(loadEvents(this, loading));
|
|
1476
|
+
$.user_effect(loadResources(this, loading));
|
|
1408
1477
|
$.user_effect(runDatesSet(this));
|
|
1409
1478
|
$.user_effect(runEventAllUpdated(this));
|
|
1410
1479
|
$.user_effect(runViewDidMount(this));
|
|
@@ -1727,8 +1796,12 @@ function Calendar($$anchor, $$props) {
|
|
|
1727
1796
|
let value = mainState.options[name];
|
|
1728
1797
|
return isDate(value) ? toLocalDate(value) : value;
|
|
1729
1798
|
}
|
|
1799
|
+
function refetchResources() {
|
|
1800
|
+
mainState.fetchedRange.resources = {};
|
|
1801
|
+
return this;
|
|
1802
|
+
}
|
|
1730
1803
|
function refetchEvents() {
|
|
1731
|
-
mainState.fetchedRange = {
|
|
1804
|
+
mainState.fetchedRange.events = {};
|
|
1732
1805
|
return this;
|
|
1733
1806
|
}
|
|
1734
1807
|
function getEvents() {
|
|
@@ -1796,6 +1869,7 @@ function Calendar($$anchor, $$props) {
|
|
|
1796
1869
|
var $$exports = {
|
|
1797
1870
|
setOption,
|
|
1798
1871
|
getOption,
|
|
1872
|
+
refetchResources,
|
|
1799
1873
|
refetchEvents,
|
|
1800
1874
|
getEvents,
|
|
1801
1875
|
getEventById,
|
|
@@ -2059,11 +2133,11 @@ var root$8 = $.from_html(`<article><!></article>`);
|
|
|
2059
2133
|
function BaseEvent($$anchor, $$props) {
|
|
2060
2134
|
$.push($$props, true);
|
|
2061
2135
|
let el = $.prop($$props, "el", 15), classes = $.prop($$props, "classes", 3, identity), styles = $.prop($$props, "styles", 3, identity);
|
|
2062
|
-
let $$d = $.derived(() => getContext("state")), intlEventTime = $.derived(() => $.get($$d).intlEventTime), view2 = $.derived(() => $.get($$d).view), displayEventEnd = $.derived(() => $.get($$d).options.displayEventEnd), eventBackgroundColor = $.derived(() => $.get($$d).options.eventBackgroundColor), eventColor = $.derived(() => $.get($$d).options.eventColor), eventContent = $.derived(() => $.get($$d).options.eventContent), eventClick = $.derived(() => $.get($$d).options.eventClick), eventDidMount = $.derived(() => $.get($$d).options.eventDidMount), eventClassNames = $.derived(() => $.get($$d).options.eventClassNames), eventMouseEnter = $.derived(() => $.get($$d).options.eventMouseEnter), eventMouseLeave = $.derived(() => $.get($$d).options.eventMouseLeave), eventTextColor = $.derived(() => $.get($$d).options.eventTextColor),
|
|
2136
|
+
let $$d = $.derived(() => getContext("state")), intlEventTime = $.derived(() => $.get($$d).intlEventTime), resources = $.derived(() => $.get($$d).resources), view2 = $.derived(() => $.get($$d).view), displayEventEnd = $.derived(() => $.get($$d).options.displayEventEnd), eventBackgroundColor$1 = $.derived(() => $.get($$d).options.eventBackgroundColor), eventColor = $.derived(() => $.get($$d).options.eventColor), eventContent = $.derived(() => $.get($$d).options.eventContent), eventClick = $.derived(() => $.get($$d).options.eventClick), eventDidMount = $.derived(() => $.get($$d).options.eventDidMount), eventClassNames = $.derived(() => $.get($$d).options.eventClassNames), eventMouseEnter = $.derived(() => $.get($$d).options.eventMouseEnter), eventMouseLeave = $.derived(() => $.get($$d).options.eventMouseLeave), eventTextColor$1 = $.derived(() => $.get($$d).options.eventTextColor), theme = $.derived(() => $.get($$d).options.theme);
|
|
2063
2137
|
let event = $.derived(() => $$props.chunk.event);
|
|
2064
2138
|
let display = $.derived(() => $$props.chunk.event.display);
|
|
2065
|
-
let bgColor = $.derived(() => $.get(event).backgroundColor ??
|
|
2066
|
-
let txtColor = $.derived(() => $.get(event).textColor ??
|
|
2139
|
+
let bgColor = $.derived(() => $.get(event).backgroundColor ?? eventBackgroundColor($$props.chunk.resource ?? findFirstResource($.get(event), $.get(resources))) ?? $.get(eventBackgroundColor$1) ?? $.get(eventColor));
|
|
2140
|
+
let txtColor = $.derived(() => $.get(event).textColor ?? eventTextColor($$props.chunk.resource ?? findFirstResource($.get(event), $.get(resources))) ?? $.get(eventTextColor$1));
|
|
2067
2141
|
let style = $.derived(() => entries(styles()({ "background-color": $.get(bgColor), "color": $.get(txtColor) })).map((entry) => `${entry[0]}:${entry[1]}`).concat($.get(event).styles).join(";"));
|
|
2068
2142
|
let classNames = $.derived(() => classes()([
|
|
2069
2143
|
bgEvent($.get(display)) ? $.get(theme).bgEvent : $.get(theme).event,
|
|
@@ -2682,8 +2756,8 @@ function View$3($$anchor, $$props) {
|
|
|
2682
2756
|
var node_1 = $.first_child(fragment_1);
|
|
2683
2757
|
$.each(node_1, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
2684
2758
|
{
|
|
2685
|
-
let $0 = $.derived(() => j + 1 === $.get(days)
|
|
2686
|
-
let $1 = $.derived(() => i + 1 === $.get(grid2)
|
|
2759
|
+
let $0 = $.derived(() => j + 1 === length($.get(days)));
|
|
2760
|
+
let $1 = $.derived(() => i + 1 === length($.get(grid2)));
|
|
2687
2761
|
Day$3($$anchor4, {
|
|
2688
2762
|
get day() {
|
|
2689
2763
|
return $.get(day);
|
|
@@ -2745,25 +2819,30 @@ function View$3($$anchor, $$props) {
|
|
|
2745
2819
|
$.reset(section);
|
|
2746
2820
|
$.bind_this(section, ($$value) => mainState.mainEl = $$value, () => mainState?.mainEl);
|
|
2747
2821
|
$.attach(section, () => resizeObserver(reposition));
|
|
2748
|
-
$.template_effect(
|
|
2749
|
-
|
|
2750
|
-
$.
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
"
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2822
|
+
$.template_effect(
|
|
2823
|
+
($0) => {
|
|
2824
|
+
$.set_class(section, 1, $.clsx([
|
|
2825
|
+
$.get(theme).main,
|
|
2826
|
+
$.get(dayMaxEvents) === true && $.get(theme).uniform
|
|
2827
|
+
]));
|
|
2828
|
+
styles = $.set_style(section, "", styles, $0);
|
|
2829
|
+
$.set_class(header, 1, $.get(theme).header);
|
|
2830
|
+
$.set_class(div, 1, $.get(theme).grid);
|
|
2831
|
+
$.set_class(div_2, 1, $.get(theme).body);
|
|
2832
|
+
$.set_class(div_3, 1, $.get(theme).grid);
|
|
2833
|
+
$.set_class(div_4, 1, $.get(theme).events);
|
|
2834
|
+
},
|
|
2835
|
+
[
|
|
2836
|
+
() => ({
|
|
2837
|
+
"--ec-grid-cols": length($.get(grid2)[0]),
|
|
2838
|
+
"--ec-grid-rows": length($.get(grid2))
|
|
2839
|
+
})
|
|
2840
|
+
]
|
|
2841
|
+
);
|
|
2763
2842
|
$.append($$anchor2, section);
|
|
2764
2843
|
};
|
|
2765
2844
|
$.if(node, ($$render) => {
|
|
2766
|
-
if ($.get(grid2)
|
|
2845
|
+
if (!empty($.get(grid2)) && !empty($.get(grid2)[0])) $$render(consequent_1);
|
|
2767
2846
|
});
|
|
2768
2847
|
}
|
|
2769
2848
|
$.append($$anchor, fragment);
|
|
@@ -3203,16 +3282,19 @@ function Action($$anchor, $$props) {
|
|
|
3203
3282
|
}
|
|
3204
3283
|
}
|
|
3205
3284
|
}
|
|
3206
|
-
|
|
3207
|
-
action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta = extraDuration = allDay = minResize = selectStep = margin = gridEl = viewport = snapDuration = void 0;
|
|
3208
|
-
mainState.iClass = void 0;
|
|
3209
|
-
if (timer) {
|
|
3210
|
-
clearTimeout(timer);
|
|
3211
|
-
timer = void 0;
|
|
3212
|
-
}
|
|
3285
|
+
handlePointerCancel();
|
|
3213
3286
|
}
|
|
3214
3287
|
noDateClick = false;
|
|
3215
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
|
+
}
|
|
3216
3298
|
function findDayEl() {
|
|
3217
3299
|
return getElementWithPayload(limit(toX, viewport.left, viewport.right), limit(toY, viewport.top, viewport.bottom));
|
|
3218
3300
|
}
|
|
@@ -3403,7 +3485,7 @@ function Action($$anchor, $$props) {
|
|
|
3403
3485
|
};
|
|
3404
3486
|
$.event("pointermove", $.window, handlePointerMove);
|
|
3405
3487
|
$.event("pointerup", $.window, handlePointerUp);
|
|
3406
|
-
$.event("pointercancel", $.window,
|
|
3488
|
+
$.event("pointercancel", $.window, handlePointerCancel);
|
|
3407
3489
|
$.event("scroll", $.window, handleScroll2);
|
|
3408
3490
|
var event_handler = $.derived(() => createPreventDefaultHandler(complexAction));
|
|
3409
3491
|
$.event("selectstart", $.window, function(...$$args) {
|
|
@@ -3736,7 +3818,7 @@ function View$2($$anchor, $$props) {
|
|
|
3736
3818
|
let filteredEvents2 = $.derived(() => mainState.filteredEvents), view2 = $.derived(() => mainState.view), viewDates2 = $.derived(() => mainState.viewDates), noEventsClick = $.derived(() => mainState.options.noEventsClick), noEventsContent = $.derived(() => mainState.options.noEventsContent), theme = $.derived(() => mainState.options.theme);
|
|
3737
3819
|
let noEvents = $.derived(() => {
|
|
3738
3820
|
let noEvents2 = true;
|
|
3739
|
-
if ($.get(viewDates2)
|
|
3821
|
+
if (!empty($.get(viewDates2))) {
|
|
3740
3822
|
let start = $.get(viewDates2)[0];
|
|
3741
3823
|
let end = addDay(cloneDate($.get(viewDates2).at(-1)));
|
|
3742
3824
|
for (let event of $.get(filteredEvents2)) {
|
|
@@ -3850,6 +3932,7 @@ function createChunks$1(event, days, withId = true) {
|
|
|
3850
3932
|
assign(chunk, {
|
|
3851
3933
|
gridColumn,
|
|
3852
3934
|
gridRow,
|
|
3935
|
+
resource,
|
|
3853
3936
|
top: (chunk.start - start) / 1e3,
|
|
3854
3937
|
height: (chunk.end - chunk.start) / 1e3,
|
|
3855
3938
|
maxHeight: (end - chunk.start) / 1e3
|
|
@@ -4231,7 +4314,8 @@ function viewResources(mainState) {
|
|
|
4231
4314
|
let {
|
|
4232
4315
|
activeRange: activeRange2,
|
|
4233
4316
|
filteredEvents: filteredEvents2,
|
|
4234
|
-
|
|
4317
|
+
resources,
|
|
4318
|
+
options: { filterResourcesWithEvents },
|
|
4235
4319
|
extensions: { viewResources: viewResources2 }
|
|
4236
4320
|
} = mainState;
|
|
4237
4321
|
let result = viewResources2 ? viewResources2(resources) : resources;
|
|
@@ -4540,7 +4624,7 @@ function View$1($$anchor, $$props) {
|
|
|
4540
4624
|
let allDayText = $.derived(() => createAllDayContent($.get(allDayContent)));
|
|
4541
4625
|
$.user_effect(() => {
|
|
4542
4626
|
$.get(scrollTime);
|
|
4543
|
-
if ($.get(viewDates2)
|
|
4627
|
+
if (!empty($.get(viewDates2))) {
|
|
4544
4628
|
tick().then(scrollToTime);
|
|
4545
4629
|
}
|
|
4546
4630
|
});
|
|
@@ -4617,7 +4701,7 @@ function View$1($$anchor, $$props) {
|
|
|
4617
4701
|
var node_5 = $.first_child(fragment_5);
|
|
4618
4702
|
$.each(node_5, 17, () => $.get(days), $.index, ($$anchor5, day, j) => {
|
|
4619
4703
|
{
|
|
4620
|
-
let $0 = $.derived(() => i + 1 === $.get(grid2)
|
|
4704
|
+
let $0 = $.derived(() => i + 1 === length($.get(grid2)) && j + 1 === length($.get(days)));
|
|
4621
4705
|
Day$1($$anchor5, {
|
|
4622
4706
|
get day() {
|
|
4623
4707
|
return $.get(day);
|
|
@@ -4699,7 +4783,7 @@ function View$1($$anchor, $$props) {
|
|
|
4699
4783
|
var node_9 = $.first_child(fragment_10);
|
|
4700
4784
|
$.each(node_9, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
4701
4785
|
{
|
|
4702
|
-
let $0 = $.derived(() => i + 1 === $.get(grid2)
|
|
4786
|
+
let $0 = $.derived(() => i + 1 === length($.get(grid2)) && j + 1 === length($.get(days)));
|
|
4703
4787
|
Day$1($$anchor4, {
|
|
4704
4788
|
get day() {
|
|
4705
4789
|
return $.get(day);
|
|
@@ -4774,31 +4858,36 @@ function View$1($$anchor, $$props) {
|
|
|
4774
4858
|
$.reset(section);
|
|
4775
4859
|
$.bind_this(section, ($$value) => mainState.mainEl = $$value, () => mainState?.mainEl);
|
|
4776
4860
|
$.attach(section, () => resizeObserver(reposition));
|
|
4777
|
-
$.template_effect(
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4861
|
+
$.template_effect(
|
|
4862
|
+
($0) => {
|
|
4863
|
+
$.set_class(section, 1, $.get(theme).main);
|
|
4864
|
+
styles = $.set_style(section, "", styles, $0);
|
|
4865
|
+
$.set_class(header_1, 1, $.get(theme).header);
|
|
4866
|
+
$.set_class(aside, 1, $.get(theme).sidebar);
|
|
4867
|
+
$.set_class(div, 1, $.get(theme).grid);
|
|
4868
|
+
$.set_class(div_4, 1, $.get(theme).body);
|
|
4869
|
+
$.set_class(aside_2, 1, $.get(theme).sidebar);
|
|
4870
|
+
$.set_class(div_6, 1, $.get(theme).grid);
|
|
4871
|
+
$.set_class(div_7, 1, $.get(theme).events);
|
|
4872
|
+
},
|
|
4873
|
+
[
|
|
4874
|
+
() => ({
|
|
4875
|
+
"--ec-grid-cols": length($.get(grid2)) * length($.get(grid2)[0]),
|
|
4876
|
+
"--ec-col-group-span": length($.get(grid2)[0]),
|
|
4877
|
+
"--ec-col-width": $.get(columnWidth) ?? "minmax(0, 1fr)",
|
|
4878
|
+
"--ec-slot-label-periodicity": $.get(slotLabelPeriodicity2),
|
|
4879
|
+
"--ec-slot-height": `${$.get(slotHeight) ?? ""}px`,
|
|
4880
|
+
"--ec-header-height": `${$.get(headerHeight) ?? ""}px`,
|
|
4881
|
+
"--ec-sidebar-width": `${$.get(sidebarWidth) ?? ""}px`
|
|
4882
|
+
})
|
|
4883
|
+
]
|
|
4884
|
+
);
|
|
4796
4885
|
$.bind_element_size(aside, "offsetWidth", ($$value) => viewState().sidebarWidth = $$value);
|
|
4797
4886
|
$.bind_element_size(header_1, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
4798
4887
|
$.append($$anchor2, section);
|
|
4799
4888
|
};
|
|
4800
4889
|
$.if(node, ($$render) => {
|
|
4801
|
-
if ($.get(grid2)
|
|
4890
|
+
if (!empty($.get(grid2)) && !empty($.get(grid2)[0])) $$render(consequent_4);
|
|
4802
4891
|
});
|
|
4803
4892
|
}
|
|
4804
4893
|
$.append($$anchor, fragment);
|
|
@@ -4824,7 +4913,7 @@ function View_1($$anchor, $$props) {
|
|
|
4824
4913
|
for (let days of $.get(grid2)) {
|
|
4825
4914
|
let day = days[0];
|
|
4826
4915
|
if (datesEqual(day.dayStart, $.get(today))) {
|
|
4827
|
-
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / ($.get(grid2)
|
|
4916
|
+
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / (length($.get(grid2)) * length(days)) * (day.gridColumn - 1) * (isRtl() ? -1 : 1);
|
|
4828
4917
|
break;
|
|
4829
4918
|
}
|
|
4830
4919
|
}
|
|
@@ -4840,10 +4929,11 @@ function View_1($$anchor, $$props) {
|
|
|
4840
4929
|
return { date, resource, disabled, highlight };
|
|
4841
4930
|
});
|
|
4842
4931
|
{
|
|
4843
|
-
let $0 = $.derived(() => $.get(grid2)[0]
|
|
4844
|
-
let $1 = $.derived(() =>
|
|
4845
|
-
let $2 = $.derived(() =>
|
|
4846
|
-
let $3 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).
|
|
4932
|
+
let $0 = $.derived(() => length($.get(grid2)[0]) > 1 ? $.get(theme).colGroup : void 0);
|
|
4933
|
+
let $1 = $.derived(() => length($.get(days)));
|
|
4934
|
+
let $2 = $.derived(() => 1 + i * length($.get(days)));
|
|
4935
|
+
let $3 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).disabled);
|
|
4936
|
+
let $4 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).highlight);
|
|
4847
4937
|
ColHead($$anchor3, {
|
|
4848
4938
|
get date() {
|
|
4849
4939
|
return $.get(computed_const).date;
|
|
@@ -4855,16 +4945,16 @@ function View_1($$anchor, $$props) {
|
|
|
4855
4945
|
return $.get(datesAboveResources);
|
|
4856
4946
|
},
|
|
4857
4947
|
get colSpan() {
|
|
4858
|
-
return $.get(
|
|
4948
|
+
return $.get($1);
|
|
4859
4949
|
},
|
|
4860
4950
|
get colIndex() {
|
|
4861
|
-
return $.get($
|
|
4951
|
+
return $.get($2);
|
|
4862
4952
|
},
|
|
4863
4953
|
get disabled() {
|
|
4864
|
-
return $.get($
|
|
4954
|
+
return $.get($3);
|
|
4865
4955
|
},
|
|
4866
4956
|
get highlight() {
|
|
4867
|
-
return $.get($
|
|
4957
|
+
return $.get($4);
|
|
4868
4958
|
},
|
|
4869
4959
|
children: ($$anchor4, $$slotProps) => {
|
|
4870
4960
|
var fragment_3 = $.comment();
|
|
@@ -4910,7 +5000,7 @@ function View_1($$anchor, $$props) {
|
|
|
4910
5000
|
return { date, resource, disabled, highlight };
|
|
4911
5001
|
});
|
|
4912
5002
|
{
|
|
4913
|
-
let $0 = $.derived(() => 1 + j + i * $.get(days)
|
|
5003
|
+
let $0 = $.derived(() => 1 + j + i * length($.get(days)));
|
|
4914
5004
|
ColHead($$anchor5, {
|
|
4915
5005
|
get date() {
|
|
4916
5006
|
return $.get(computed_const_1).date;
|
|
@@ -4964,7 +5054,7 @@ function View_1($$anchor, $$props) {
|
|
|
4964
5054
|
$.append($$anchor3, fragment_6);
|
|
4965
5055
|
};
|
|
4966
5056
|
$.if(node_2, ($$render) => {
|
|
4967
|
-
if ($.get(grid2)[0]
|
|
5057
|
+
if (length($.get(grid2)[0]) > 1) $$render(consequent_2);
|
|
4968
5058
|
});
|
|
4969
5059
|
}
|
|
4970
5060
|
$.append($$anchor2, fragment_1);
|
|
@@ -4976,12 +5066,13 @@ function View_1($$anchor, $$props) {
|
|
|
4976
5066
|
var consequent_3 = ($$anchor3) => {
|
|
4977
5067
|
{
|
|
4978
5068
|
let $0 = $.derived(() => $.get(grid2).flat());
|
|
5069
|
+
let $1 = $.derived(() => length($.get(grid2)[0]));
|
|
4979
5070
|
NowIndicator$1($$anchor3, {
|
|
4980
5071
|
get days() {
|
|
4981
5072
|
return $.get($0);
|
|
4982
5073
|
},
|
|
4983
5074
|
get span() {
|
|
4984
|
-
return $.get(
|
|
5075
|
+
return $.get($1);
|
|
4985
5076
|
}
|
|
4986
5077
|
});
|
|
4987
5078
|
}
|
|
@@ -5005,18 +5096,19 @@ function View_1($$anchor, $$props) {
|
|
|
5005
5096
|
var alternate_2 = ($$anchor4) => {
|
|
5006
5097
|
{
|
|
5007
5098
|
let $0 = $.derived(() => $.get(grid2).flat());
|
|
5099
|
+
let $1 = $.derived(() => length($.get(grid2)));
|
|
5008
5100
|
NowIndicator$1($$anchor4, {
|
|
5009
5101
|
get days() {
|
|
5010
5102
|
return $.get($0);
|
|
5011
5103
|
},
|
|
5012
5104
|
get span() {
|
|
5013
|
-
return $.get(
|
|
5105
|
+
return $.get($1);
|
|
5014
5106
|
}
|
|
5015
5107
|
});
|
|
5016
5108
|
}
|
|
5017
5109
|
};
|
|
5018
5110
|
$.if(node_7, ($$render) => {
|
|
5019
|
-
if ($.get(grid2)[0]
|
|
5111
|
+
if (length($.get(grid2)[0]) > 1) $$render(consequent_4);
|
|
5020
5112
|
else $$render(alternate_2, false);
|
|
5021
5113
|
});
|
|
5022
5114
|
}
|
|
@@ -5087,26 +5179,29 @@ function createChunks(event, days, monthView2, withId = true) {
|
|
|
5087
5179
|
let lastEnd;
|
|
5088
5180
|
let gridColumn;
|
|
5089
5181
|
let gridRow;
|
|
5182
|
+
let resource;
|
|
5090
5183
|
let left;
|
|
5091
5184
|
let width = 0;
|
|
5092
|
-
for (let { gridColumn: column, gridRow: row, resource, dayStart, dayEnd, start, end, disabled } of days) {
|
|
5185
|
+
for (let { gridColumn: column, gridRow: row, resource: dayResource, dayStart, dayEnd, start, end, disabled } of days) {
|
|
5093
5186
|
if (!disabled) {
|
|
5094
5187
|
if (monthView2) {
|
|
5095
|
-
if (eventIntersects(event, dayStart, dayEnd,
|
|
5188
|
+
if (eventIntersects(event, dayStart, dayEnd, dayResource)) {
|
|
5096
5189
|
if (!dates.length) {
|
|
5097
5190
|
firstStart = dayStart;
|
|
5098
5191
|
gridColumn = column;
|
|
5099
5192
|
gridRow = row;
|
|
5193
|
+
resource = dayResource;
|
|
5100
5194
|
}
|
|
5101
5195
|
dates.push(dayStart);
|
|
5102
5196
|
lastEnd = end;
|
|
5103
5197
|
}
|
|
5104
5198
|
} else {
|
|
5105
|
-
if (eventIntersects(event, start, end,
|
|
5199
|
+
if (eventIntersects(event, start, end, dayResource)) {
|
|
5106
5200
|
if (!dates.length) {
|
|
5107
5201
|
firstStart = start;
|
|
5108
5202
|
gridColumn = column;
|
|
5109
5203
|
gridRow = row;
|
|
5204
|
+
resource = dayResource;
|
|
5110
5205
|
left = max(event.start - start, 0) / 1e3;
|
|
5111
5206
|
}
|
|
5112
5207
|
dates.push(dayStart);
|
|
@@ -5118,7 +5213,7 @@ function createChunks(event, days, monthView2, withId = true) {
|
|
|
5118
5213
|
}
|
|
5119
5214
|
if (dates.length) {
|
|
5120
5215
|
let chunk = createEventChunk(event, firstStart, lastEnd);
|
|
5121
|
-
assign(chunk, { gridColumn, gridRow, dates, left, width });
|
|
5216
|
+
assign(chunk, { gridColumn, gridRow, resource, dates, left, width });
|
|
5122
5217
|
if (withId) {
|
|
5123
5218
|
assignChunkId(chunk);
|
|
5124
5219
|
}
|
|
@@ -5270,7 +5365,7 @@ function daySlots(mainState, viewState) {
|
|
|
5270
5365
|
}
|
|
5271
5366
|
function nestedResources(mainState) {
|
|
5272
5367
|
return () => {
|
|
5273
|
-
let {
|
|
5368
|
+
let { resources } = mainState;
|
|
5274
5369
|
let nested;
|
|
5275
5370
|
untrack(() => {
|
|
5276
5371
|
nested = resources.some((resource) => getPayload(resource).children.length);
|
|
@@ -5595,7 +5690,7 @@ function View($$anchor, $$props) {
|
|
|
5595
5690
|
let headerHeight = $.state(0);
|
|
5596
5691
|
$.user_effect(() => {
|
|
5597
5692
|
$.get(scrollTime);
|
|
5598
|
-
if ($.get(viewDates2)
|
|
5693
|
+
if (!empty($.get(viewDates2))) {
|
|
5599
5694
|
tick().then(scrollToTime);
|
|
5600
5695
|
}
|
|
5601
5696
|
});
|
|
@@ -5607,7 +5702,7 @@ function View($$anchor, $$props) {
|
|
|
5607
5702
|
let days = $.get(grid2)[0];
|
|
5608
5703
|
for (let day of days) {
|
|
5609
5704
|
if (datesEqual(day.dayStart, $.get(today))) {
|
|
5610
|
-
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / days
|
|
5705
|
+
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / length(days) * (day.gridColumn - 1) * (isRtl() ? -1 : 1);
|
|
5611
5706
|
break;
|
|
5612
5707
|
}
|
|
5613
5708
|
}
|
|
@@ -5751,8 +5846,8 @@ function View($$anchor, $$props) {
|
|
|
5751
5846
|
var node_7 = $.first_child(fragment_7);
|
|
5752
5847
|
$.each(node_7, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
5753
5848
|
{
|
|
5754
|
-
let $0 = $.derived(() => j + 1 === $.get(days)
|
|
5755
|
-
let $1 = $.derived(() => i + 1 === $.get(grid2)
|
|
5849
|
+
let $0 = $.derived(() => j + 1 === length($.get(days)));
|
|
5850
|
+
let $1 = $.derived(() => i + 1 === length($.get(grid2)));
|
|
5756
5851
|
Day($$anchor4, {
|
|
5757
5852
|
get day() {
|
|
5758
5853
|
return $.get(day);
|
|
@@ -5813,32 +5908,37 @@ function View($$anchor, $$props) {
|
|
|
5813
5908
|
$.reset(section);
|
|
5814
5909
|
$.bind_this(section, ($$value) => mainState.mainEl = $$value, () => mainState?.mainEl);
|
|
5815
5910
|
$.attach(section, () => resizeObserver(reposition));
|
|
5816
|
-
$.template_effect(
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
"
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
}
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5911
|
+
$.template_effect(
|
|
5912
|
+
($0) => {
|
|
5913
|
+
$.set_class(section, 1, $.get(theme).main);
|
|
5914
|
+
styles = $.set_style(section, "", styles, $0);
|
|
5915
|
+
$.set_class(header, 1, $.get(theme).header);
|
|
5916
|
+
$.set_class(aside, 1, $.get(theme).sidebar);
|
|
5917
|
+
$.set_class(div, 1, $.get(theme).grid);
|
|
5918
|
+
$.set_class(div_2, 1, $.get(theme).body);
|
|
5919
|
+
$.set_class(aside_1, 1, $.get(theme).sidebar);
|
|
5920
|
+
$.set_class(div_4, 1, $.get(theme).grid);
|
|
5921
|
+
$.set_class(div_5, 1, $.get(theme).events);
|
|
5922
|
+
},
|
|
5923
|
+
[
|
|
5924
|
+
() => ({
|
|
5925
|
+
"--ec-grid-cols": length($.get(grid2)[0]),
|
|
5926
|
+
"--ec-grid-rows": `${length($.get(grid2)) > 1 ? `repeat(${length($.get(grid2)) - 1}, auto)` : ""} 1fr`,
|
|
5927
|
+
"--ec-col-width": $.get(columnWidth) ?? "minmax(4em, 1fr)",
|
|
5928
|
+
"--ec-slot-label-periodicity": $.get(slotLabelPeriodicity2),
|
|
5929
|
+
"--ec-slot-height": `${$.get(slotHeight) ?? ""}px`,
|
|
5930
|
+
"--ec-slot-width": `${$.get(slotWidth) ?? ""}px`,
|
|
5931
|
+
"--ec-header-height": `${$.get(headerHeight) ?? ""}px`,
|
|
5932
|
+
"--ec-sidebar-width": `${$.get(sidebarWidth) ?? ""}px`
|
|
5933
|
+
})
|
|
5934
|
+
]
|
|
5935
|
+
);
|
|
5836
5936
|
$.bind_element_size(aside, "offsetWidth", ($$value) => viewState.sidebarWidth = $$value);
|
|
5837
5937
|
$.bind_element_size(header, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
5838
5938
|
$.append($$anchor2, section);
|
|
5839
5939
|
};
|
|
5840
5940
|
$.if(node, ($$render) => {
|
|
5841
|
-
if ($.get(grid2)
|
|
5941
|
+
if (!empty($.get(grid2)) && !empty($.get(grid2)[0])) $$render(consequent_3);
|
|
5842
5942
|
});
|
|
5843
5943
|
}
|
|
5844
5944
|
$.append($$anchor, fragment);
|