@event-calendar/core 5.2.4 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -14
- package/dist/index.css +1 -1
- package/dist/index.js +278 -181
- 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/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.0
|
|
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
|
-
let events2 = [];
|
|
1010
|
-
let failure = (e) => stopLoading();
|
|
1011
|
-
let success = (data) => {
|
|
1012
|
-
events2 = events2.concat(createEvents(data));
|
|
1013
|
-
mainState.events = events2;
|
|
1014
|
-
stopLoading();
|
|
1015
|
-
};
|
|
1016
|
-
let startStr = toISOString(activeRange2.start);
|
|
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;
|
|
1050
1081
|
}
|
|
1051
|
-
|
|
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);
|
|
1089
|
+
}
|
|
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);
|
|
@@ -3736,7 +3815,7 @@ function View$2($$anchor, $$props) {
|
|
|
3736
3815
|
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
3816
|
let noEvents = $.derived(() => {
|
|
3738
3817
|
let noEvents2 = true;
|
|
3739
|
-
if ($.get(viewDates2)
|
|
3818
|
+
if (!empty($.get(viewDates2))) {
|
|
3740
3819
|
let start = $.get(viewDates2)[0];
|
|
3741
3820
|
let end = addDay(cloneDate($.get(viewDates2).at(-1)));
|
|
3742
3821
|
for (let event of $.get(filteredEvents2)) {
|
|
@@ -3850,6 +3929,7 @@ function createChunks$1(event, days, withId = true) {
|
|
|
3850
3929
|
assign(chunk, {
|
|
3851
3930
|
gridColumn,
|
|
3852
3931
|
gridRow,
|
|
3932
|
+
resource,
|
|
3853
3933
|
top: (chunk.start - start) / 1e3,
|
|
3854
3934
|
height: (chunk.end - chunk.start) / 1e3,
|
|
3855
3935
|
maxHeight: (end - chunk.start) / 1e3
|
|
@@ -4231,7 +4311,8 @@ function viewResources(mainState) {
|
|
|
4231
4311
|
let {
|
|
4232
4312
|
activeRange: activeRange2,
|
|
4233
4313
|
filteredEvents: filteredEvents2,
|
|
4234
|
-
|
|
4314
|
+
resources,
|
|
4315
|
+
options: { filterResourcesWithEvents },
|
|
4235
4316
|
extensions: { viewResources: viewResources2 }
|
|
4236
4317
|
} = mainState;
|
|
4237
4318
|
let result = viewResources2 ? viewResources2(resources) : resources;
|
|
@@ -4540,7 +4621,7 @@ function View$1($$anchor, $$props) {
|
|
|
4540
4621
|
let allDayText = $.derived(() => createAllDayContent($.get(allDayContent)));
|
|
4541
4622
|
$.user_effect(() => {
|
|
4542
4623
|
$.get(scrollTime);
|
|
4543
|
-
if ($.get(viewDates2)
|
|
4624
|
+
if (!empty($.get(viewDates2))) {
|
|
4544
4625
|
tick().then(scrollToTime);
|
|
4545
4626
|
}
|
|
4546
4627
|
});
|
|
@@ -4617,7 +4698,7 @@ function View$1($$anchor, $$props) {
|
|
|
4617
4698
|
var node_5 = $.first_child(fragment_5);
|
|
4618
4699
|
$.each(node_5, 17, () => $.get(days), $.index, ($$anchor5, day, j) => {
|
|
4619
4700
|
{
|
|
4620
|
-
let $0 = $.derived(() => i + 1 === $.get(grid2)
|
|
4701
|
+
let $0 = $.derived(() => i + 1 === length($.get(grid2)) && j + 1 === length($.get(days)));
|
|
4621
4702
|
Day$1($$anchor5, {
|
|
4622
4703
|
get day() {
|
|
4623
4704
|
return $.get(day);
|
|
@@ -4699,7 +4780,7 @@ function View$1($$anchor, $$props) {
|
|
|
4699
4780
|
var node_9 = $.first_child(fragment_10);
|
|
4700
4781
|
$.each(node_9, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
4701
4782
|
{
|
|
4702
|
-
let $0 = $.derived(() => i + 1 === $.get(grid2)
|
|
4783
|
+
let $0 = $.derived(() => i + 1 === length($.get(grid2)) && j + 1 === length($.get(days)));
|
|
4703
4784
|
Day$1($$anchor4, {
|
|
4704
4785
|
get day() {
|
|
4705
4786
|
return $.get(day);
|
|
@@ -4774,31 +4855,36 @@ function View$1($$anchor, $$props) {
|
|
|
4774
4855
|
$.reset(section);
|
|
4775
4856
|
$.bind_this(section, ($$value) => mainState.mainEl = $$value, () => mainState?.mainEl);
|
|
4776
4857
|
$.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
|
-
|
|
4858
|
+
$.template_effect(
|
|
4859
|
+
($0) => {
|
|
4860
|
+
$.set_class(section, 1, $.get(theme).main);
|
|
4861
|
+
styles = $.set_style(section, "", styles, $0);
|
|
4862
|
+
$.set_class(header_1, 1, $.get(theme).header);
|
|
4863
|
+
$.set_class(aside, 1, $.get(theme).sidebar);
|
|
4864
|
+
$.set_class(div, 1, $.get(theme).grid);
|
|
4865
|
+
$.set_class(div_4, 1, $.get(theme).body);
|
|
4866
|
+
$.set_class(aside_2, 1, $.get(theme).sidebar);
|
|
4867
|
+
$.set_class(div_6, 1, $.get(theme).grid);
|
|
4868
|
+
$.set_class(div_7, 1, $.get(theme).events);
|
|
4869
|
+
},
|
|
4870
|
+
[
|
|
4871
|
+
() => ({
|
|
4872
|
+
"--ec-grid-cols": length($.get(grid2)) * length($.get(grid2)[0]),
|
|
4873
|
+
"--ec-col-group-span": length($.get(grid2)[0]),
|
|
4874
|
+
"--ec-col-width": $.get(columnWidth) ?? "minmax(0, 1fr)",
|
|
4875
|
+
"--ec-slot-label-periodicity": $.get(slotLabelPeriodicity2),
|
|
4876
|
+
"--ec-slot-height": `${$.get(slotHeight) ?? ""}px`,
|
|
4877
|
+
"--ec-header-height": `${$.get(headerHeight) ?? ""}px`,
|
|
4878
|
+
"--ec-sidebar-width": `${$.get(sidebarWidth) ?? ""}px`
|
|
4879
|
+
})
|
|
4880
|
+
]
|
|
4881
|
+
);
|
|
4796
4882
|
$.bind_element_size(aside, "offsetWidth", ($$value) => viewState().sidebarWidth = $$value);
|
|
4797
4883
|
$.bind_element_size(header_1, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
4798
4884
|
$.append($$anchor2, section);
|
|
4799
4885
|
};
|
|
4800
4886
|
$.if(node, ($$render) => {
|
|
4801
|
-
if ($.get(grid2)
|
|
4887
|
+
if (!empty($.get(grid2)) && !empty($.get(grid2)[0])) $$render(consequent_4);
|
|
4802
4888
|
});
|
|
4803
4889
|
}
|
|
4804
4890
|
$.append($$anchor, fragment);
|
|
@@ -4824,7 +4910,7 @@ function View_1($$anchor, $$props) {
|
|
|
4824
4910
|
for (let days of $.get(grid2)) {
|
|
4825
4911
|
let day = days[0];
|
|
4826
4912
|
if (datesEqual(day.dayStart, $.get(today))) {
|
|
4827
|
-
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / ($.get(grid2)
|
|
4913
|
+
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / (length($.get(grid2)) * length(days)) * (day.gridColumn - 1) * (isRtl() ? -1 : 1);
|
|
4828
4914
|
break;
|
|
4829
4915
|
}
|
|
4830
4916
|
}
|
|
@@ -4840,10 +4926,11 @@ function View_1($$anchor, $$props) {
|
|
|
4840
4926
|
return { date, resource, disabled, highlight };
|
|
4841
4927
|
});
|
|
4842
4928
|
{
|
|
4843
|
-
let $0 = $.derived(() => $.get(grid2)[0]
|
|
4844
|
-
let $1 = $.derived(() =>
|
|
4845
|
-
let $2 = $.derived(() =>
|
|
4846
|
-
let $3 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).
|
|
4929
|
+
let $0 = $.derived(() => length($.get(grid2)[0]) > 1 ? $.get(theme).colGroup : void 0);
|
|
4930
|
+
let $1 = $.derived(() => length($.get(days)));
|
|
4931
|
+
let $2 = $.derived(() => 1 + i * length($.get(days)));
|
|
4932
|
+
let $3 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).disabled);
|
|
4933
|
+
let $4 = $.derived(() => $.get(datesAboveResources) && $.get(computed_const).highlight);
|
|
4847
4934
|
ColHead($$anchor3, {
|
|
4848
4935
|
get date() {
|
|
4849
4936
|
return $.get(computed_const).date;
|
|
@@ -4855,16 +4942,16 @@ function View_1($$anchor, $$props) {
|
|
|
4855
4942
|
return $.get(datesAboveResources);
|
|
4856
4943
|
},
|
|
4857
4944
|
get colSpan() {
|
|
4858
|
-
return $.get(
|
|
4945
|
+
return $.get($1);
|
|
4859
4946
|
},
|
|
4860
4947
|
get colIndex() {
|
|
4861
|
-
return $.get($
|
|
4948
|
+
return $.get($2);
|
|
4862
4949
|
},
|
|
4863
4950
|
get disabled() {
|
|
4864
|
-
return $.get($
|
|
4951
|
+
return $.get($3);
|
|
4865
4952
|
},
|
|
4866
4953
|
get highlight() {
|
|
4867
|
-
return $.get($
|
|
4954
|
+
return $.get($4);
|
|
4868
4955
|
},
|
|
4869
4956
|
children: ($$anchor4, $$slotProps) => {
|
|
4870
4957
|
var fragment_3 = $.comment();
|
|
@@ -4910,7 +4997,7 @@ function View_1($$anchor, $$props) {
|
|
|
4910
4997
|
return { date, resource, disabled, highlight };
|
|
4911
4998
|
});
|
|
4912
4999
|
{
|
|
4913
|
-
let $0 = $.derived(() => 1 + j + i * $.get(days)
|
|
5000
|
+
let $0 = $.derived(() => 1 + j + i * length($.get(days)));
|
|
4914
5001
|
ColHead($$anchor5, {
|
|
4915
5002
|
get date() {
|
|
4916
5003
|
return $.get(computed_const_1).date;
|
|
@@ -4964,7 +5051,7 @@ function View_1($$anchor, $$props) {
|
|
|
4964
5051
|
$.append($$anchor3, fragment_6);
|
|
4965
5052
|
};
|
|
4966
5053
|
$.if(node_2, ($$render) => {
|
|
4967
|
-
if ($.get(grid2)[0]
|
|
5054
|
+
if (length($.get(grid2)[0]) > 1) $$render(consequent_2);
|
|
4968
5055
|
});
|
|
4969
5056
|
}
|
|
4970
5057
|
$.append($$anchor2, fragment_1);
|
|
@@ -4976,12 +5063,13 @@ function View_1($$anchor, $$props) {
|
|
|
4976
5063
|
var consequent_3 = ($$anchor3) => {
|
|
4977
5064
|
{
|
|
4978
5065
|
let $0 = $.derived(() => $.get(grid2).flat());
|
|
5066
|
+
let $1 = $.derived(() => length($.get(grid2)[0]));
|
|
4979
5067
|
NowIndicator$1($$anchor3, {
|
|
4980
5068
|
get days() {
|
|
4981
5069
|
return $.get($0);
|
|
4982
5070
|
},
|
|
4983
5071
|
get span() {
|
|
4984
|
-
return $.get(
|
|
5072
|
+
return $.get($1);
|
|
4985
5073
|
}
|
|
4986
5074
|
});
|
|
4987
5075
|
}
|
|
@@ -5005,18 +5093,19 @@ function View_1($$anchor, $$props) {
|
|
|
5005
5093
|
var alternate_2 = ($$anchor4) => {
|
|
5006
5094
|
{
|
|
5007
5095
|
let $0 = $.derived(() => $.get(grid2).flat());
|
|
5096
|
+
let $1 = $.derived(() => length($.get(grid2)));
|
|
5008
5097
|
NowIndicator$1($$anchor4, {
|
|
5009
5098
|
get days() {
|
|
5010
5099
|
return $.get($0);
|
|
5011
5100
|
},
|
|
5012
5101
|
get span() {
|
|
5013
|
-
return $.get(
|
|
5102
|
+
return $.get($1);
|
|
5014
5103
|
}
|
|
5015
5104
|
});
|
|
5016
5105
|
}
|
|
5017
5106
|
};
|
|
5018
5107
|
$.if(node_7, ($$render) => {
|
|
5019
|
-
if ($.get(grid2)[0]
|
|
5108
|
+
if (length($.get(grid2)[0]) > 1) $$render(consequent_4);
|
|
5020
5109
|
else $$render(alternate_2, false);
|
|
5021
5110
|
});
|
|
5022
5111
|
}
|
|
@@ -5087,26 +5176,29 @@ function createChunks(event, days, monthView2, withId = true) {
|
|
|
5087
5176
|
let lastEnd;
|
|
5088
5177
|
let gridColumn;
|
|
5089
5178
|
let gridRow;
|
|
5179
|
+
let resource;
|
|
5090
5180
|
let left;
|
|
5091
5181
|
let width = 0;
|
|
5092
|
-
for (let { gridColumn: column, gridRow: row, resource, dayStart, dayEnd, start, end, disabled } of days) {
|
|
5182
|
+
for (let { gridColumn: column, gridRow: row, resource: dayResource, dayStart, dayEnd, start, end, disabled } of days) {
|
|
5093
5183
|
if (!disabled) {
|
|
5094
5184
|
if (monthView2) {
|
|
5095
|
-
if (eventIntersects(event, dayStart, dayEnd,
|
|
5185
|
+
if (eventIntersects(event, dayStart, dayEnd, dayResource)) {
|
|
5096
5186
|
if (!dates.length) {
|
|
5097
5187
|
firstStart = dayStart;
|
|
5098
5188
|
gridColumn = column;
|
|
5099
5189
|
gridRow = row;
|
|
5190
|
+
resource = dayResource;
|
|
5100
5191
|
}
|
|
5101
5192
|
dates.push(dayStart);
|
|
5102
5193
|
lastEnd = end;
|
|
5103
5194
|
}
|
|
5104
5195
|
} else {
|
|
5105
|
-
if (eventIntersects(event, start, end,
|
|
5196
|
+
if (eventIntersects(event, start, end, dayResource)) {
|
|
5106
5197
|
if (!dates.length) {
|
|
5107
5198
|
firstStart = start;
|
|
5108
5199
|
gridColumn = column;
|
|
5109
5200
|
gridRow = row;
|
|
5201
|
+
resource = dayResource;
|
|
5110
5202
|
left = max(event.start - start, 0) / 1e3;
|
|
5111
5203
|
}
|
|
5112
5204
|
dates.push(dayStart);
|
|
@@ -5118,7 +5210,7 @@ function createChunks(event, days, monthView2, withId = true) {
|
|
|
5118
5210
|
}
|
|
5119
5211
|
if (dates.length) {
|
|
5120
5212
|
let chunk = createEventChunk(event, firstStart, lastEnd);
|
|
5121
|
-
assign(chunk, { gridColumn, gridRow, dates, left, width });
|
|
5213
|
+
assign(chunk, { gridColumn, gridRow, resource, dates, left, width });
|
|
5122
5214
|
if (withId) {
|
|
5123
5215
|
assignChunkId(chunk);
|
|
5124
5216
|
}
|
|
@@ -5270,7 +5362,7 @@ function daySlots(mainState, viewState) {
|
|
|
5270
5362
|
}
|
|
5271
5363
|
function nestedResources(mainState) {
|
|
5272
5364
|
return () => {
|
|
5273
|
-
let {
|
|
5365
|
+
let { resources } = mainState;
|
|
5274
5366
|
let nested;
|
|
5275
5367
|
untrack(() => {
|
|
5276
5368
|
nested = resources.some((resource) => getPayload(resource).children.length);
|
|
@@ -5595,7 +5687,7 @@ function View($$anchor, $$props) {
|
|
|
5595
5687
|
let headerHeight = $.state(0);
|
|
5596
5688
|
$.user_effect(() => {
|
|
5597
5689
|
$.get(scrollTime);
|
|
5598
|
-
if ($.get(viewDates2)
|
|
5690
|
+
if (!empty($.get(viewDates2))) {
|
|
5599
5691
|
tick().then(scrollToTime);
|
|
5600
5692
|
}
|
|
5601
5693
|
});
|
|
@@ -5607,7 +5699,7 @@ function View($$anchor, $$props) {
|
|
|
5607
5699
|
let days = $.get(grid2)[0];
|
|
5608
5700
|
for (let day of days) {
|
|
5609
5701
|
if (datesEqual(day.dayStart, $.get(today))) {
|
|
5610
|
-
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / days
|
|
5702
|
+
$.get(mainEl).scrollLeft = ($.get(mainEl).scrollWidth - $.get(sidebarWidth)) / length(days) * (day.gridColumn - 1) * (isRtl() ? -1 : 1);
|
|
5611
5703
|
break;
|
|
5612
5704
|
}
|
|
5613
5705
|
}
|
|
@@ -5751,8 +5843,8 @@ function View($$anchor, $$props) {
|
|
|
5751
5843
|
var node_7 = $.first_child(fragment_7);
|
|
5752
5844
|
$.each(node_7, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
5753
5845
|
{
|
|
5754
|
-
let $0 = $.derived(() => j + 1 === $.get(days)
|
|
5755
|
-
let $1 = $.derived(() => i + 1 === $.get(grid2)
|
|
5846
|
+
let $0 = $.derived(() => j + 1 === length($.get(days)));
|
|
5847
|
+
let $1 = $.derived(() => i + 1 === length($.get(grid2)));
|
|
5756
5848
|
Day($$anchor4, {
|
|
5757
5849
|
get day() {
|
|
5758
5850
|
return $.get(day);
|
|
@@ -5813,32 +5905,37 @@ function View($$anchor, $$props) {
|
|
|
5813
5905
|
$.reset(section);
|
|
5814
5906
|
$.bind_this(section, ($$value) => mainState.mainEl = $$value, () => mainState?.mainEl);
|
|
5815
5907
|
$.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
|
-
|
|
5908
|
+
$.template_effect(
|
|
5909
|
+
($0) => {
|
|
5910
|
+
$.set_class(section, 1, $.get(theme).main);
|
|
5911
|
+
styles = $.set_style(section, "", styles, $0);
|
|
5912
|
+
$.set_class(header, 1, $.get(theme).header);
|
|
5913
|
+
$.set_class(aside, 1, $.get(theme).sidebar);
|
|
5914
|
+
$.set_class(div, 1, $.get(theme).grid);
|
|
5915
|
+
$.set_class(div_2, 1, $.get(theme).body);
|
|
5916
|
+
$.set_class(aside_1, 1, $.get(theme).sidebar);
|
|
5917
|
+
$.set_class(div_4, 1, $.get(theme).grid);
|
|
5918
|
+
$.set_class(div_5, 1, $.get(theme).events);
|
|
5919
|
+
},
|
|
5920
|
+
[
|
|
5921
|
+
() => ({
|
|
5922
|
+
"--ec-grid-cols": length($.get(grid2)[0]),
|
|
5923
|
+
"--ec-grid-rows": `${length($.get(grid2)) > 1 ? `repeat(${length($.get(grid2)) - 1}, auto)` : ""} 1fr`,
|
|
5924
|
+
"--ec-col-width": $.get(columnWidth) ?? "minmax(4em, 1fr)",
|
|
5925
|
+
"--ec-slot-label-periodicity": $.get(slotLabelPeriodicity2),
|
|
5926
|
+
"--ec-slot-height": `${$.get(slotHeight) ?? ""}px`,
|
|
5927
|
+
"--ec-slot-width": `${$.get(slotWidth) ?? ""}px`,
|
|
5928
|
+
"--ec-header-height": `${$.get(headerHeight) ?? ""}px`,
|
|
5929
|
+
"--ec-sidebar-width": `${$.get(sidebarWidth) ?? ""}px`
|
|
5930
|
+
})
|
|
5931
|
+
]
|
|
5932
|
+
);
|
|
5836
5933
|
$.bind_element_size(aside, "offsetWidth", ($$value) => viewState.sidebarWidth = $$value);
|
|
5837
5934
|
$.bind_element_size(header, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
5838
5935
|
$.append($$anchor2, section);
|
|
5839
5936
|
};
|
|
5840
5937
|
$.if(node, ($$render) => {
|
|
5841
|
-
if ($.get(grid2)
|
|
5938
|
+
if (!empty($.get(grid2)) && !empty($.get(grid2)[0])) $$render(consequent_3);
|
|
5842
5939
|
});
|
|
5843
5940
|
}
|
|
5844
5941
|
$.append($$anchor, fragment);
|