@event-calendar/core 5.0.0 → 5.0.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 +8 -8
- package/dist/index.css +89 -31
- package/dist/index.js +284 -136
- package/package.json +2 -2
- package/src/lib/components/BaseDay.svelte +5 -1
- package/src/lib/utils.js +4 -0
- package/src/plugins/day-grid/Day.svelte +2 -2
- package/src/plugins/day-grid/View.svelte +3 -3
- package/src/plugins/interaction/Action.svelte +18 -11
- package/src/plugins/resource-time-grid/View.svelte +29 -13
- package/src/plugins/resource-time-grid/index.js +1 -0
- package/src/plugins/resource-timeline/Day.svelte +2 -2
- package/src/plugins/resource-timeline/Event.svelte +2 -2
- package/src/plugins/resource-timeline/NowIndicator.svelte +2 -2
- package/src/plugins/resource-timeline/View.svelte +4 -6
- package/src/plugins/resource-timeline/lib.js +1 -1
- package/src/plugins/time-grid/Day.svelte +2 -2
- package/src/plugins/time-grid/NowIndicator.svelte +9 -6
- package/src/plugins/time-grid/View.svelte +15 -13
- package/src/storage/options.js +2 -0
- package/src/storage/stores.js +3 -3
- package/src/styles/days.css +35 -6
- package/src/styles/index.css +8 -7
- package/src/styles/now-indicator.css +2 -1
- package/src/styles/sidebar.css +21 -11
- package/src/styles/slots.css +12 -2
- package/src/styles/toolbar.css +11 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.0.
|
|
2
|
+
* EventCalendar v5.0.2
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { tick, getContext, untrack, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -259,6 +259,9 @@ function stopPropagation(fn, _this = void 0) {
|
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
+
function isRtl() {
|
|
263
|
+
return window.getComputedStyle(document.documentElement).direction === "rtl";
|
|
264
|
+
}
|
|
262
265
|
let payloadProp = symbol();
|
|
263
266
|
function setPayload(obj, payload) {
|
|
264
267
|
obj[payloadProp] = payload;
|
|
@@ -827,6 +830,10 @@ function createOptions(plugins) {
|
|
|
827
830
|
highlight: "ec-highlight",
|
|
828
831
|
icon: "ec-icon",
|
|
829
832
|
main: "ec-main",
|
|
833
|
+
noBeb: "ec-no-beb",
|
|
834
|
+
// no block end border
|
|
835
|
+
noIeb: "ec-no-ieb",
|
|
836
|
+
// no inline end border
|
|
830
837
|
today: "ec-today",
|
|
831
838
|
title: "ec-title",
|
|
832
839
|
toolbar: "ec-toolbar",
|
|
@@ -1025,8 +1032,9 @@ function filteredEvents(state) {
|
|
|
1025
1032
|
let [$_events, $eventFilter, $eventOrder, $filterEventsWithResources, $resources] = values;
|
|
1026
1033
|
let result = [...$_events];
|
|
1027
1034
|
if (isFunction($eventFilter)) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1035
|
+
let events2 = $_events.map(toEventWithLocalDates);
|
|
1036
|
+
result = result.filter((event, index2) => $eventFilter({
|
|
1037
|
+
event: toEventWithLocalDates(event),
|
|
1030
1038
|
index: index2,
|
|
1031
1039
|
events: events2,
|
|
1032
1040
|
view: view2
|
|
@@ -1733,7 +1741,7 @@ function BaseDay($$anchor, $$props) {
|
|
|
1733
1741
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
1734
1742
|
const $_interaction = () => $.store_get(_interaction, "$_interaction", $$stores);
|
|
1735
1743
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
1736
|
-
let el = $.prop($$props, "el", 15), allDay = $.prop($$props, "allDay", 3, false), resource = $.prop($$props, "resource", 3, void 0), dateFromPoint = $.prop($$props, "dateFromPoint", 3, () => $$props.date), classes = $.prop($$props, "classes", 3, identity), disabled = $.prop($$props, "disabled", 3, false), highlight = $.prop($$props, "highlight", 3, false), role = $.prop($$props, "role", 3, "cell");
|
|
1744
|
+
let el = $.prop($$props, "el", 15), allDay = $.prop($$props, "allDay", 3, false), resource = $.prop($$props, "resource", 3, void 0), dateFromPoint = $.prop($$props, "dateFromPoint", 3, () => $$props.date), classes = $.prop($$props, "classes", 3, identity), disabled = $.prop($$props, "disabled", 3, false), highlight = $.prop($$props, "highlight", 3, false), role = $.prop($$props, "role", 3, "cell"), noIeb = $.prop($$props, "noIeb", 3, false), noBeb = $.prop($$props, "noBeb", 3, false);
|
|
1737
1745
|
let { _interaction, _today, highlightedDates, theme } = getContext("state");
|
|
1738
1746
|
let isToday = $.derived(() => datesEqual($$props.date, $_today()));
|
|
1739
1747
|
let classNames = $.derived(() => classes()([
|
|
@@ -1741,7 +1749,9 @@ function BaseDay($$anchor, $$props) {
|
|
|
1741
1749
|
$theme().weekdays?.[$$props.date.getUTCDay()],
|
|
1742
1750
|
$.get(isToday) && $theme().today,
|
|
1743
1751
|
highlight() && $theme().highlight,
|
|
1744
|
-
disabled() && $theme().disabled
|
|
1752
|
+
disabled() && $theme().disabled,
|
|
1753
|
+
noIeb() && $theme().noIeb,
|
|
1754
|
+
noBeb() && $theme().noBeb
|
|
1745
1755
|
]));
|
|
1746
1756
|
onMount(() => {
|
|
1747
1757
|
setPayload(el(), (x, y) => {
|
|
@@ -2108,6 +2118,12 @@ function Day$3($$anchor, $$props) {
|
|
|
2108
2118
|
get highlight() {
|
|
2109
2119
|
return $.get(highlight);
|
|
2110
2120
|
},
|
|
2121
|
+
get noIeb() {
|
|
2122
|
+
return $$props.noIeb;
|
|
2123
|
+
},
|
|
2124
|
+
get noBeb() {
|
|
2125
|
+
return $$props.noBeb;
|
|
2126
|
+
},
|
|
2111
2127
|
children: ($$anchor2, $$slotProps) => {
|
|
2112
2128
|
var fragment_1 = root_1$8();
|
|
2113
2129
|
var div = $.first_child(fragment_1);
|
|
@@ -2533,15 +2549,25 @@ function View$3($$anchor, $$props) {
|
|
|
2533
2549
|
$.reset(header);
|
|
2534
2550
|
var div_2 = $.sibling(header, 2);
|
|
2535
2551
|
var div_3 = $.child(div_2);
|
|
2536
|
-
$.each(div_3, 21, () => $.get(grid), $.index, ($$anchor2, days) => {
|
|
2552
|
+
$.each(div_3, 21, () => $.get(grid), $.index, ($$anchor2, days, i) => {
|
|
2537
2553
|
var fragment = $.comment();
|
|
2538
2554
|
var node = $.first_child(fragment);
|
|
2539
|
-
$.each(node, 17, () => $.get(days), $.index, ($$anchor3, day) => {
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2555
|
+
$.each(node, 17, () => $.get(days), $.index, ($$anchor3, day, j) => {
|
|
2556
|
+
{
|
|
2557
|
+
let $0 = $.derived(() => j + 1 === $.get(days).length);
|
|
2558
|
+
let $1 = $.derived(() => i + 1 === $.get(grid).length);
|
|
2559
|
+
Day$3($$anchor3, {
|
|
2560
|
+
get day() {
|
|
2561
|
+
return $.get(day);
|
|
2562
|
+
},
|
|
2563
|
+
get noIeb() {
|
|
2564
|
+
return $.get($0);
|
|
2565
|
+
},
|
|
2566
|
+
get noBeb() {
|
|
2567
|
+
return $.get($1);
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
}
|
|
2545
2571
|
});
|
|
2546
2572
|
$.append($$anchor2, fragment);
|
|
2547
2573
|
});
|
|
@@ -2761,7 +2787,7 @@ function Action($$anchor, $$props) {
|
|
|
2761
2787
|
let toX;
|
|
2762
2788
|
let toY;
|
|
2763
2789
|
let gridEl;
|
|
2764
|
-
let
|
|
2790
|
+
let allDaySlot;
|
|
2765
2791
|
let delta;
|
|
2766
2792
|
let allDay;
|
|
2767
2793
|
let iClass;
|
|
@@ -2873,7 +2899,7 @@ function Action($$anchor, $$props) {
|
|
|
2873
2899
|
fromY = toY = jsEvent.clientY;
|
|
2874
2900
|
let dayEl = getElementWithPayload(toX, toY);
|
|
2875
2901
|
({ allDay, date, resource } = getPayload(dayEl)(toX, toY));
|
|
2876
|
-
|
|
2902
|
+
allDaySlot = $_mainEl() !== ancestor(dayEl, 3);
|
|
2877
2903
|
gridEl = ancestor(dayEl, 1);
|
|
2878
2904
|
calcViewport();
|
|
2879
2905
|
if (jsEvent.pointerType !== "mouse") {
|
|
@@ -2960,19 +2986,19 @@ function Action($$anchor, $$props) {
|
|
|
2960
2986
|
let thresholdX = 24;
|
|
2961
2987
|
animate(() => {
|
|
2962
2988
|
if (viewport) {
|
|
2963
|
-
if (
|
|
2989
|
+
if (!allDaySlot) {
|
|
2964
2990
|
if (toY < viewport.top + thresholdY) {
|
|
2965
2991
|
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollTop += max(-8, (toY - viewport.top - thresholdY) / 3), $.untrack($_mainEl));
|
|
2966
2992
|
}
|
|
2967
2993
|
if (toY > viewport.bottom - thresholdY) {
|
|
2968
2994
|
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollTop += min(8, (toY - viewport.bottom + thresholdY) / 3), $.untrack($_mainEl));
|
|
2969
2995
|
}
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2996
|
+
}
|
|
2997
|
+
if (toX < viewport.left + thresholdX) {
|
|
2998
|
+
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollLeft += max(-8, (toX - viewport.left - thresholdX) / 3), $.untrack($_mainEl));
|
|
2999
|
+
}
|
|
3000
|
+
if (toX > viewport.right - thresholdX) {
|
|
3001
|
+
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollLeft += min(8, (toX - viewport.right + thresholdX) / 3), $.untrack($_mainEl));
|
|
2976
3002
|
}
|
|
2977
3003
|
if (toY < thresholdY) {
|
|
2978
3004
|
window.scrollBy(0, max(-8, (toY - thresholdY) / 3));
|
|
@@ -3077,6 +3103,13 @@ function Action($$anchor, $$props) {
|
|
|
3077
3103
|
return findPayload(dayEl.previousElementSibling);
|
|
3078
3104
|
}
|
|
3079
3105
|
} else {
|
|
3106
|
+
if (selecting() && payload.resource && !$_iEvents()[0].resourceIds.includes(payload.resource.id)) {
|
|
3107
|
+
if (toX > fromX) {
|
|
3108
|
+
return findPayload(dayEl.previousElementSibling);
|
|
3109
|
+
} else {
|
|
3110
|
+
return findPayload(dayEl.nextElementSibling);
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3080
3113
|
return payload;
|
|
3081
3114
|
}
|
|
3082
3115
|
}
|
|
@@ -3088,8 +3121,8 @@ function Action($$anchor, $$props) {
|
|
|
3088
3121
|
viewport = {
|
|
3089
3122
|
left: max(0, gridRect.left + $_mainEl().scrollLeft),
|
|
3090
3123
|
right: min(document.documentElement.clientWidth, mainRect.left + $_mainEl().clientWidth) - 2,
|
|
3091
|
-
top: max(0, gridRect.top + (
|
|
3092
|
-
bottom: min(document.documentElement.clientHeight,
|
|
3124
|
+
top: max(0, gridRect.top + (!allDaySlot ? $_mainEl().scrollTop : 0)),
|
|
3125
|
+
bottom: min(document.documentElement.clientHeight, !allDaySlot ? mainRect.top + $_mainEl().clientHeight : gridRect.bottom) - 2
|
|
3093
3126
|
};
|
|
3094
3127
|
}
|
|
3095
3128
|
function createIEvent(jsEvent, callback) {
|
|
@@ -4091,6 +4124,12 @@ function Day$1($$anchor, $$props) {
|
|
|
4091
4124
|
get highlight() {
|
|
4092
4125
|
return $.get(highlight);
|
|
4093
4126
|
},
|
|
4127
|
+
get noIeb() {
|
|
4128
|
+
return $$props.noIeb;
|
|
4129
|
+
},
|
|
4130
|
+
get noBeb() {
|
|
4131
|
+
return $$props.noBeb;
|
|
4132
|
+
},
|
|
4094
4133
|
get el() {
|
|
4095
4134
|
return $.get(el);
|
|
4096
4135
|
},
|
|
@@ -4179,14 +4218,14 @@ var root_1$3 = $.from_html(`<div></div>`);
|
|
|
4179
4218
|
function NowIndicator$1($$anchor, $$props) {
|
|
4180
4219
|
$.push($$props, true);
|
|
4181
4220
|
const $_today = () => $.store_get(_today, "$_today", $$stores);
|
|
4182
|
-
const $slotDuration = () => $.store_get(slotDuration, "$slotDuration", $$stores);
|
|
4183
4221
|
const $_now = () => $.store_get(_now, "$_now", $$stores);
|
|
4222
|
+
const $slotDuration = () => $.store_get(slotDuration, "$slotDuration", $$stores);
|
|
4184
4223
|
const $slotHeight = () => $.store_get(slotHeight, "$slotHeight", $$stores);
|
|
4185
4224
|
const $_mainEl = () => $.store_get(_mainEl, "$_mainEl", $$stores);
|
|
4186
4225
|
const $_sidebarWidth = () => $.store_get(_sidebarWidth, "$_sidebarWidth", $$stores);
|
|
4187
4226
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
4188
4227
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
4189
|
-
let
|
|
4228
|
+
let span = $.prop($$props, "span", 3, 1);
|
|
4190
4229
|
let {
|
|
4191
4230
|
_mainEl,
|
|
4192
4231
|
_now,
|
|
@@ -4203,14 +4242,17 @@ function NowIndicator$1($$anchor, $$props) {
|
|
|
4203
4242
|
}
|
|
4204
4243
|
}
|
|
4205
4244
|
return {};
|
|
4206
|
-
}), gridColumn = $.derived(() => $.get($$d).gridColumn), start = $.derived(() => $.get($$d).start);
|
|
4245
|
+
}), gridColumn = $.derived(() => $.get($$d).gridColumn), start = $.derived(() => $.get($$d).start), end = $.derived(() => $.get($$d).end);
|
|
4207
4246
|
let top = $.derived(() => {
|
|
4247
|
+
if ($_now() < $.get(start) || $_now() > $.get(end)) {
|
|
4248
|
+
return null;
|
|
4249
|
+
}
|
|
4208
4250
|
let step = toSeconds($slotDuration());
|
|
4209
4251
|
return ($_now() - $.get(start)) / 1e3 / step * $slotHeight();
|
|
4210
4252
|
});
|
|
4211
4253
|
let observerOptions = $.derived(() => ({
|
|
4212
4254
|
root: $_mainEl(),
|
|
4213
|
-
rootMargin: `0px 0px 0px -${$_sidebarWidth() + 5.5}px`,
|
|
4255
|
+
rootMargin: isRtl() ? `0px -${$_sidebarWidth() + 5.5}px 0px 0px` : `0px 0px 0px -${$_sidebarWidth() + 5.5}px`,
|
|
4214
4256
|
threshold: 0
|
|
4215
4257
|
}));
|
|
4216
4258
|
function onIntersect(el, entry) {
|
|
@@ -4226,14 +4268,14 @@ function NowIndicator$1($$anchor, $$props) {
|
|
|
4226
4268
|
$.template_effect(() => {
|
|
4227
4269
|
$.set_class(div, 1, $theme().nowIndicator);
|
|
4228
4270
|
styles = $.set_style(div, "", styles, {
|
|
4229
|
-
"grid-column": `${$.get(gridColumn) + 1}
|
|
4271
|
+
"grid-column": `${$.get(gridColumn) + 1} / span ${span() ?? ""}`,
|
|
4230
4272
|
"inset-block-start": `${$.get(top) ?? ""}px`
|
|
4231
4273
|
});
|
|
4232
4274
|
});
|
|
4233
4275
|
$.append($$anchor2, div);
|
|
4234
4276
|
};
|
|
4235
4277
|
$.if(node, ($$render) => {
|
|
4236
|
-
if ($.get(gridColumn)) $$render(consequent);
|
|
4278
|
+
if ($.get(gridColumn) && $.get(top) !== null) $$render(consequent);
|
|
4237
4279
|
});
|
|
4238
4280
|
}
|
|
4239
4281
|
$.append($$anchor, fragment);
|
|
@@ -4262,7 +4304,7 @@ function View$1($$anchor, $$props) {
|
|
|
4262
4304
|
const $_sidebarWidth = () => $.store_get(_sidebarWidth, "$_sidebarWidth", $$stores);
|
|
4263
4305
|
const $allDaySlot = () => $.store_get(allDaySlot, "$allDaySlot", $$stores);
|
|
4264
4306
|
const $_slots = () => $.store_get(_slots, "$_slots", $$stores);
|
|
4265
|
-
const $
|
|
4307
|
+
const $showNowIndicator = () => $.store_get(showNowIndicator, "$showNowIndicator", $$stores);
|
|
4266
4308
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
4267
4309
|
let {
|
|
4268
4310
|
_mainEl,
|
|
@@ -4277,7 +4319,7 @@ function View$1($$anchor, $$props) {
|
|
|
4277
4319
|
allDaySlot,
|
|
4278
4320
|
columnWidth,
|
|
4279
4321
|
highlightedDates,
|
|
4280
|
-
nowIndicator,
|
|
4322
|
+
nowIndicator: showNowIndicator,
|
|
4281
4323
|
scrollTime,
|
|
4282
4324
|
slotHeight,
|
|
4283
4325
|
slotDuration,
|
|
@@ -4358,16 +4400,22 @@ function View$1($$anchor, $$props) {
|
|
|
4358
4400
|
var aside_1 = $.child(div_1);
|
|
4359
4401
|
$.attach(aside_1, () => contentFrom($.get(allDayText)));
|
|
4360
4402
|
var div_2 = $.sibling(aside_1, 2);
|
|
4361
|
-
$.each(div_2, 21, () => $.get(grid), $.index, ($$anchor3, days) => {
|
|
4403
|
+
$.each(div_2, 21, () => $.get(grid), $.index, ($$anchor3, days, i) => {
|
|
4362
4404
|
var fragment_4 = $.comment();
|
|
4363
4405
|
var node_4 = $.first_child(fragment_4);
|
|
4364
|
-
$.each(node_4, 17, () => $.get(days), $.index, ($$anchor4, day) => {
|
|
4365
|
-
|
|
4366
|
-
get
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4406
|
+
$.each(node_4, 17, () => $.get(days), $.index, ($$anchor4, day, j) => {
|
|
4407
|
+
{
|
|
4408
|
+
let $0 = $.derived(() => i + 1 === $.get(grid).length && j + 1 === $.get(days).length);
|
|
4409
|
+
Day$1($$anchor4, {
|
|
4410
|
+
get day() {
|
|
4411
|
+
return $.get(day);
|
|
4412
|
+
},
|
|
4413
|
+
allDay: true,
|
|
4414
|
+
get noIeb() {
|
|
4415
|
+
return $.get($0);
|
|
4416
|
+
}
|
|
4417
|
+
});
|
|
4418
|
+
}
|
|
4371
4419
|
});
|
|
4372
4420
|
$.append($$anchor3, fragment_4);
|
|
4373
4421
|
});
|
|
@@ -4434,15 +4482,22 @@ function View$1($$anchor, $$props) {
|
|
|
4434
4482
|
});
|
|
4435
4483
|
$.reset(aside_2);
|
|
4436
4484
|
var div_6 = $.sibling(aside_2, 2);
|
|
4437
|
-
$.each(div_6, 21, () => $.get(grid), $.index, ($$anchor2, days) => {
|
|
4485
|
+
$.each(div_6, 21, () => $.get(grid), $.index, ($$anchor2, days, i) => {
|
|
4438
4486
|
var fragment_9 = $.comment();
|
|
4439
4487
|
var node_8 = $.first_child(fragment_9);
|
|
4440
|
-
$.each(node_8, 17, () => $.get(days), $.index, ($$anchor3, day) => {
|
|
4441
|
-
|
|
4442
|
-
get
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4488
|
+
$.each(node_8, 17, () => $.get(days), $.index, ($$anchor3, day, j) => {
|
|
4489
|
+
{
|
|
4490
|
+
let $0 = $.derived(() => i + 1 === $.get(grid).length && j + 1 === $.get(days).length);
|
|
4491
|
+
Day$1($$anchor3, {
|
|
4492
|
+
get day() {
|
|
4493
|
+
return $.get(day);
|
|
4494
|
+
},
|
|
4495
|
+
get noIeb() {
|
|
4496
|
+
return $.get($0);
|
|
4497
|
+
},
|
|
4498
|
+
noBeb: true
|
|
4499
|
+
});
|
|
4500
|
+
}
|
|
4446
4501
|
});
|
|
4447
4502
|
$.append($$anchor2, fragment_9);
|
|
4448
4503
|
});
|
|
@@ -4476,23 +4531,32 @@ function View$1($$anchor, $$props) {
|
|
|
4476
4531
|
$.reset(div_4);
|
|
4477
4532
|
var node_12 = $.sibling(div_4, 2);
|
|
4478
4533
|
{
|
|
4479
|
-
var
|
|
4534
|
+
var consequent_3 = ($$anchor2) => {
|
|
4480
4535
|
var fragment_14 = $.comment();
|
|
4481
4536
|
var node_13 = $.first_child(fragment_14);
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4537
|
+
{
|
|
4538
|
+
var consequent_2 = ($$anchor3) => {
|
|
4539
|
+
var fragment_15 = $.comment();
|
|
4540
|
+
var node_14 = $.first_child(fragment_15);
|
|
4541
|
+
$.snippet(node_14, () => $$props.nowIndicator, () => $.get(grid));
|
|
4542
|
+
$.append($$anchor3, fragment_15);
|
|
4543
|
+
};
|
|
4544
|
+
var alternate_1 = ($$anchor3) => {
|
|
4545
|
+
NowIndicator$1($$anchor3, {
|
|
4546
|
+
get days() {
|
|
4547
|
+
return $.get(grid)[0];
|
|
4548
|
+
}
|
|
4549
|
+
});
|
|
4550
|
+
};
|
|
4551
|
+
$.if(node_13, ($$render) => {
|
|
4552
|
+
if ($$props.nowIndicator) $$render(consequent_2);
|
|
4553
|
+
else $$render(alternate_1, false);
|
|
4490
4554
|
});
|
|
4491
|
-
}
|
|
4555
|
+
}
|
|
4492
4556
|
$.append($$anchor2, fragment_14);
|
|
4493
4557
|
};
|
|
4494
4558
|
$.if(node_12, ($$render) => {
|
|
4495
|
-
if ($
|
|
4559
|
+
if ($showNowIndicator()) $$render(consequent_3);
|
|
4496
4560
|
});
|
|
4497
4561
|
}
|
|
4498
4562
|
$.reset(section);
|
|
@@ -4554,15 +4618,16 @@ function View_1($$anchor, $$props) {
|
|
|
4554
4618
|
return { date, resource, disabled, highlight };
|
|
4555
4619
|
});
|
|
4556
4620
|
{
|
|
4557
|
-
let $0 = $.derived(() =>
|
|
4558
|
-
let $1 = $.derived(() =>
|
|
4559
|
-
let $2 = $.derived(() => $datesAboveResources() && $.get(computed_const).
|
|
4621
|
+
let $0 = $.derived(() => grid()[0].length > 1 ? $theme().colGroup : void 0);
|
|
4622
|
+
let $1 = $.derived(() => 1 + i * $.get(days).length);
|
|
4623
|
+
let $2 = $.derived(() => $datesAboveResources() && $.get(computed_const).disabled);
|
|
4624
|
+
let $3 = $.derived(() => $datesAboveResources() && $.get(computed_const).highlight);
|
|
4560
4625
|
ColHead($$anchor3, {
|
|
4561
4626
|
get date() {
|
|
4562
4627
|
return $.get(computed_const).date;
|
|
4563
4628
|
},
|
|
4564
4629
|
get className() {
|
|
4565
|
-
return $
|
|
4630
|
+
return $.get($0);
|
|
4566
4631
|
},
|
|
4567
4632
|
get weekday() {
|
|
4568
4633
|
return $datesAboveResources();
|
|
@@ -4571,13 +4636,13 @@ function View_1($$anchor, $$props) {
|
|
|
4571
4636
|
return $.get(days).length;
|
|
4572
4637
|
},
|
|
4573
4638
|
get colIndex() {
|
|
4574
|
-
return $.get($
|
|
4639
|
+
return $.get($1);
|
|
4575
4640
|
},
|
|
4576
4641
|
get disabled() {
|
|
4577
|
-
return $.get($
|
|
4642
|
+
return $.get($2);
|
|
4578
4643
|
},
|
|
4579
4644
|
get highlight() {
|
|
4580
|
-
return $.get($
|
|
4645
|
+
return $.get($3);
|
|
4581
4646
|
},
|
|
4582
4647
|
children: ($$anchor4, $$slotProps) => {
|
|
4583
4648
|
var fragment_3 = $.comment();
|
|
@@ -4610,75 +4675,143 @@ function View_1($$anchor, $$props) {
|
|
|
4610
4675
|
}
|
|
4611
4676
|
});
|
|
4612
4677
|
var node_2 = $.sibling(node, 2);
|
|
4613
|
-
|
|
4614
|
-
var
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4678
|
+
{
|
|
4679
|
+
var consequent_2 = ($$anchor3) => {
|
|
4680
|
+
var fragment_6 = $.comment();
|
|
4681
|
+
var node_3 = $.first_child(fragment_6);
|
|
4682
|
+
$.each(node_3, 17, grid, $.index, ($$anchor4, days, i) => {
|
|
4683
|
+
var fragment_7 = $.comment();
|
|
4684
|
+
var node_4 = $.first_child(fragment_7);
|
|
4685
|
+
$.each(node_4, 17, () => $.get(days), $.index, ($$anchor5, day, j) => {
|
|
4686
|
+
const computed_const_1 = $.derived(() => {
|
|
4687
|
+
const { dayStart: date, resource, disabled, highlight } = $.get(day);
|
|
4688
|
+
return { date, resource, disabled, highlight };
|
|
4689
|
+
});
|
|
4690
|
+
{
|
|
4691
|
+
let $0 = $.derived(() => 1 + j + i * $.get(days).length);
|
|
4692
|
+
ColHead($$anchor5, {
|
|
4693
|
+
get date() {
|
|
4694
|
+
return $.get(computed_const_1).date;
|
|
4695
|
+
},
|
|
4696
|
+
get colIndex() {
|
|
4697
|
+
return $.get($0);
|
|
4698
|
+
},
|
|
4699
|
+
get disabled() {
|
|
4700
|
+
return $.get(computed_const_1).disabled;
|
|
4701
|
+
},
|
|
4702
|
+
get highlight() {
|
|
4703
|
+
return $.get(computed_const_1).highlight;
|
|
4704
|
+
},
|
|
4705
|
+
children: ($$anchor6, $$slotProps) => {
|
|
4706
|
+
var fragment_9 = $.comment();
|
|
4707
|
+
var node_5 = $.first_child(fragment_9);
|
|
4708
|
+
{
|
|
4709
|
+
var consequent_1 = ($$anchor7) => {
|
|
4710
|
+
Label$1($$anchor7, {
|
|
4711
|
+
get resource() {
|
|
4712
|
+
return $.get(computed_const_1).resource;
|
|
4713
|
+
},
|
|
4714
|
+
get date() {
|
|
4715
|
+
return $.get(computed_const_1).date;
|
|
4716
|
+
}
|
|
4717
|
+
});
|
|
4718
|
+
};
|
|
4719
|
+
var alternate_1 = ($$anchor7) => {
|
|
4720
|
+
DayHeader($$anchor7, {
|
|
4721
|
+
get date() {
|
|
4722
|
+
return $.get(computed_const_1).date;
|
|
4723
|
+
},
|
|
4724
|
+
get alPrefix() {
|
|
4725
|
+
return resourceLabels[i];
|
|
4726
|
+
}
|
|
4727
|
+
});
|
|
4728
|
+
};
|
|
4729
|
+
$.if(node_5, ($$render) => {
|
|
4730
|
+
if ($datesAboveResources()) $$render(consequent_1);
|
|
4731
|
+
else $$render(alternate_1, false);
|
|
4732
|
+
});
|
|
4733
|
+
}
|
|
4734
|
+
$.append($$anchor6, fragment_9);
|
|
4735
|
+
},
|
|
4736
|
+
$$slots: { default: true }
|
|
4737
|
+
});
|
|
4738
|
+
}
|
|
4739
|
+
});
|
|
4740
|
+
$.append($$anchor4, fragment_7);
|
|
4620
4741
|
});
|
|
4742
|
+
$.append($$anchor3, fragment_6);
|
|
4743
|
+
};
|
|
4744
|
+
$.if(node_2, ($$render) => {
|
|
4745
|
+
if (grid()[0].length > 1) $$render(consequent_2);
|
|
4746
|
+
});
|
|
4747
|
+
}
|
|
4748
|
+
$.append($$anchor2, fragment_1);
|
|
4749
|
+
};
|
|
4750
|
+
const nowIndicator = ($$anchor2, grid = $.noop) => {
|
|
4751
|
+
var fragment_12 = $.comment();
|
|
4752
|
+
var node_6 = $.first_child(fragment_12);
|
|
4753
|
+
{
|
|
4754
|
+
var consequent_3 = ($$anchor3) => {
|
|
4621
4755
|
{
|
|
4622
|
-
let $0 = $.derived(() =>
|
|
4623
|
-
|
|
4624
|
-
get
|
|
4625
|
-
return $.get(computed_const_1).date;
|
|
4626
|
-
},
|
|
4627
|
-
get colIndex() {
|
|
4756
|
+
let $0 = $.derived(() => grid().flat());
|
|
4757
|
+
NowIndicator$1($$anchor3, {
|
|
4758
|
+
get days() {
|
|
4628
4759
|
return $.get($0);
|
|
4629
4760
|
},
|
|
4630
|
-
get
|
|
4631
|
-
return
|
|
4632
|
-
}
|
|
4633
|
-
get highlight() {
|
|
4634
|
-
return $.get(computed_const_1).highlight;
|
|
4635
|
-
},
|
|
4636
|
-
children: ($$anchor5, $$slotProps) => {
|
|
4637
|
-
var fragment_8 = $.comment();
|
|
4638
|
-
var node_4 = $.first_child(fragment_8);
|
|
4639
|
-
{
|
|
4640
|
-
var consequent_1 = ($$anchor6) => {
|
|
4641
|
-
Label$1($$anchor6, {
|
|
4642
|
-
get resource() {
|
|
4643
|
-
return $.get(computed_const_1).resource;
|
|
4644
|
-
},
|
|
4645
|
-
get date() {
|
|
4646
|
-
return $.get(computed_const_1).date;
|
|
4647
|
-
}
|
|
4648
|
-
});
|
|
4649
|
-
};
|
|
4650
|
-
var alternate_1 = ($$anchor6) => {
|
|
4651
|
-
DayHeader($$anchor6, {
|
|
4652
|
-
get date() {
|
|
4653
|
-
return $.get(computed_const_1).date;
|
|
4654
|
-
},
|
|
4655
|
-
get alPrefix() {
|
|
4656
|
-
return resourceLabels[i];
|
|
4657
|
-
}
|
|
4658
|
-
});
|
|
4659
|
-
};
|
|
4660
|
-
$.if(node_4, ($$render) => {
|
|
4661
|
-
if ($datesAboveResources()) $$render(consequent_1);
|
|
4662
|
-
else $$render(alternate_1, false);
|
|
4663
|
-
});
|
|
4664
|
-
}
|
|
4665
|
-
$.append($$anchor5, fragment_8);
|
|
4666
|
-
},
|
|
4667
|
-
$$slots: { default: true }
|
|
4761
|
+
get span() {
|
|
4762
|
+
return grid()[0].length;
|
|
4763
|
+
}
|
|
4668
4764
|
});
|
|
4669
4765
|
}
|
|
4766
|
+
};
|
|
4767
|
+
var alternate_3 = ($$anchor3) => {
|
|
4768
|
+
var fragment_14 = $.comment();
|
|
4769
|
+
var node_7 = $.first_child(fragment_14);
|
|
4770
|
+
{
|
|
4771
|
+
var consequent_4 = ($$anchor4) => {
|
|
4772
|
+
var fragment_15 = $.comment();
|
|
4773
|
+
var node_8 = $.first_child(fragment_15);
|
|
4774
|
+
$.each(node_8, 17, grid, $.index, ($$anchor5, days) => {
|
|
4775
|
+
NowIndicator$1($$anchor5, {
|
|
4776
|
+
get days() {
|
|
4777
|
+
return $.get(days);
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
4780
|
+
});
|
|
4781
|
+
$.append($$anchor4, fragment_15);
|
|
4782
|
+
};
|
|
4783
|
+
var alternate_2 = ($$anchor4) => {
|
|
4784
|
+
{
|
|
4785
|
+
let $0 = $.derived(() => grid().flat());
|
|
4786
|
+
NowIndicator$1($$anchor4, {
|
|
4787
|
+
get days() {
|
|
4788
|
+
return $.get($0);
|
|
4789
|
+
},
|
|
4790
|
+
get span() {
|
|
4791
|
+
return grid().length;
|
|
4792
|
+
}
|
|
4793
|
+
});
|
|
4794
|
+
}
|
|
4795
|
+
};
|
|
4796
|
+
$.if(node_7, ($$render) => {
|
|
4797
|
+
if (grid()[0].length > 1) $$render(consequent_4);
|
|
4798
|
+
else $$render(alternate_2, false);
|
|
4799
|
+
});
|
|
4800
|
+
}
|
|
4801
|
+
$.append($$anchor3, fragment_14);
|
|
4802
|
+
};
|
|
4803
|
+
$.if(node_6, ($$render) => {
|
|
4804
|
+
if ($datesAboveResources()) $$render(consequent_3);
|
|
4805
|
+
else $$render(alternate_3, false);
|
|
4670
4806
|
});
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
$.append($$anchor2, fragment_1);
|
|
4807
|
+
}
|
|
4808
|
+
$.append($$anchor2, fragment_12);
|
|
4674
4809
|
};
|
|
4675
4810
|
View$1($$anchor, {
|
|
4676
4811
|
createGridFn: () => createGrid$2($_viewDates(), $_viewResources(), $_slotTimeLimits(), $datesAboveResources(), $validRange(), $highlightedDates()),
|
|
4677
|
-
get fullwidthNowIndicator() {
|
|
4678
|
-
return $datesAboveResources();
|
|
4679
|
-
},
|
|
4680
4812
|
header,
|
|
4681
|
-
|
|
4813
|
+
nowIndicator,
|
|
4814
|
+
$$slots: { header: true, nowIndicator: true }
|
|
4682
4815
|
});
|
|
4683
4816
|
}
|
|
4684
4817
|
$.pop();
|
|
@@ -4697,6 +4830,7 @@ const index$2 = {
|
|
|
4697
4830
|
options.views.resourceTimeGridDay = {
|
|
4698
4831
|
buttonText: btnTextDay,
|
|
4699
4832
|
component: View_1,
|
|
4833
|
+
dayHeaderFormat: { weekday: "long" },
|
|
4700
4834
|
duration: { days: 1 },
|
|
4701
4835
|
theme: themeView("ec-resource ec-time-grid ec-day-view")
|
|
4702
4836
|
};
|
|
@@ -4851,7 +4985,7 @@ function prepareChunks(chunks) {
|
|
|
4851
4985
|
}
|
|
4852
4986
|
}
|
|
4853
4987
|
function repositionEvent(chunk, height2, monthView2) {
|
|
4854
|
-
let top =
|
|
4988
|
+
let top = 0;
|
|
4855
4989
|
let bottom = top + height2;
|
|
4856
4990
|
let dayChunks = chunk.day;
|
|
4857
4991
|
dayChunks.sort((a, b) => (a.top ?? Number.POSITIVE_INFINITY) - (b.top ?? Number.POSITIVE_INFINITY));
|
|
@@ -4900,6 +5034,12 @@ function Day($$anchor, $$props) {
|
|
|
4900
5034
|
get highlight() {
|
|
4901
5035
|
return $.get(highlight);
|
|
4902
5036
|
},
|
|
5037
|
+
get noIeb() {
|
|
5038
|
+
return $$props.noIeb;
|
|
5039
|
+
},
|
|
5040
|
+
get noBeb() {
|
|
5041
|
+
return $$props.noBeb;
|
|
5042
|
+
},
|
|
4903
5043
|
get el() {
|
|
4904
5044
|
return $.get(el);
|
|
4905
5045
|
},
|
|
@@ -4918,7 +5058,7 @@ function Event($$anchor, $$props) {
|
|
|
4918
5058
|
const [$$stores, $$cleanup] = $.setup_stores();
|
|
4919
5059
|
let { slotDuration, slotWidth, _monthView } = getContext("state");
|
|
4920
5060
|
let el = $.state(void 0);
|
|
4921
|
-
let margin = $.state(
|
|
5061
|
+
let margin = $.state(0);
|
|
4922
5062
|
let event = $.derived(() => $$props.chunk.event);
|
|
4923
5063
|
let styles = $.derived(() => (style) => {
|
|
4924
5064
|
style["grid-column"] = `${$$props.chunk.gridColumn} / span ${$$props.chunk.dates.length}`;
|
|
@@ -4926,7 +5066,7 @@ function Event($$anchor, $$props) {
|
|
|
4926
5066
|
if (!$_monthView()) {
|
|
4927
5067
|
let left = $$props.chunk.left / toSeconds($slotDuration()) * $slotWidth();
|
|
4928
5068
|
style["inset-inline-start"] = `${left}px`;
|
|
4929
|
-
style["inline-size"] = `${$$props.chunk.width / toSeconds($slotDuration()) * $slotWidth()
|
|
5069
|
+
style["inline-size"] = `${$$props.chunk.width / toSeconds($slotDuration()) * $slotWidth()}px`;
|
|
4930
5070
|
}
|
|
4931
5071
|
let marginTop = $.get(margin);
|
|
4932
5072
|
if ($.get(event)._margin) {
|
|
@@ -5111,7 +5251,7 @@ function NowIndicator($$anchor, $$props) {
|
|
|
5111
5251
|
});
|
|
5112
5252
|
let observerOptions = $.derived(() => ({
|
|
5113
5253
|
root: $_mainEl(),
|
|
5114
|
-
rootMargin: `0px 0px 0px -${$_sidebarWidth() + 1}px`,
|
|
5254
|
+
rootMargin: isRtl() ? `0px -${$_sidebarWidth() + 1}px 0px 0px` : `0px 0px 0px -${$_sidebarWidth() + 1}px`,
|
|
5115
5255
|
threshold: 0
|
|
5116
5256
|
}));
|
|
5117
5257
|
function onIntersect(el, entry) {
|
|
@@ -5206,7 +5346,6 @@ function View($$anchor, $$props) {
|
|
|
5206
5346
|
return;
|
|
5207
5347
|
}
|
|
5208
5348
|
let scrollLeft = 0;
|
|
5209
|
-
let gaps = 0;
|
|
5210
5349
|
let todayOutOfView = $_today() < $_viewDates()[0] || $_today() > $_viewDates().at(-1);
|
|
5211
5350
|
for (let date of $_viewDates()) {
|
|
5212
5351
|
let slotTimeLimits2 = getSlotTimeLimits($_dayTimeLimits(), date);
|
|
@@ -5215,10 +5354,9 @@ function View($$anchor, $$props) {
|
|
|
5215
5354
|
break;
|
|
5216
5355
|
} else {
|
|
5217
5356
|
scrollLeft += toSeconds(slotTimeLimits2.max) - toSeconds(slotTimeLimits2.min);
|
|
5218
|
-
++gaps;
|
|
5219
5357
|
}
|
|
5220
5358
|
}
|
|
5221
|
-
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollLeft = scrollLeft / toSeconds($slotDuration()) * $slotWidth()
|
|
5359
|
+
$.store_mutate(_mainEl, $.untrack($_mainEl).scrollLeft = scrollLeft / toSeconds($slotDuration()) * $slotWidth() * (document.dir === "rtl" ? -1 : 1), $.untrack($_mainEl));
|
|
5222
5360
|
}
|
|
5223
5361
|
let refs = [];
|
|
5224
5362
|
function reposition() {
|
|
@@ -5337,15 +5475,25 @@ function View($$anchor, $$props) {
|
|
|
5337
5475
|
});
|
|
5338
5476
|
$.reset(aside_1);
|
|
5339
5477
|
var div_4 = $.sibling(aside_1, 2);
|
|
5340
|
-
$.each(div_4, 21, () => $.get(grid), $.index, ($$anchor2, days) => {
|
|
5478
|
+
$.each(div_4, 21, () => $.get(grid), $.index, ($$anchor2, days, i) => {
|
|
5341
5479
|
var fragment_6 = $.comment();
|
|
5342
5480
|
var node_6 = $.first_child(fragment_6);
|
|
5343
|
-
$.each(node_6, 17, () => $.get(days), $.index, ($$anchor3, day) => {
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5481
|
+
$.each(node_6, 17, () => $.get(days), $.index, ($$anchor3, day, j) => {
|
|
5482
|
+
{
|
|
5483
|
+
let $0 = $.derived(() => j + 1 === $.get(days).length);
|
|
5484
|
+
let $1 = $.derived(() => i + 1 === $.get(grid).length);
|
|
5485
|
+
Day($$anchor3, {
|
|
5486
|
+
get day() {
|
|
5487
|
+
return $.get(day);
|
|
5488
|
+
},
|
|
5489
|
+
get noIeb() {
|
|
5490
|
+
return $.get($0);
|
|
5491
|
+
},
|
|
5492
|
+
get noBeb() {
|
|
5493
|
+
return $.get($1);
|
|
5494
|
+
}
|
|
5495
|
+
});
|
|
5496
|
+
}
|
|
5349
5497
|
});
|
|
5350
5498
|
$.append($$anchor2, fragment_6);
|
|
5351
5499
|
});
|