@k2b/ui 0.20.0 → 0.21.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/dist/browser/actions/Button.js +20 -31
- package/dist/browser/actions/Button.js.map +1 -1
- package/dist/browser/actions/ContextMenu.js +7 -3
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/CopyButton.js +10 -8
- package/dist/browser/actions/CopyButton.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +4 -0
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/content/Calendar.js +1951 -565
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/calendar-messages.js +83 -0
- package/dist/browser/content/calendar-messages.js.map +1 -0
- package/dist/browser/content/calendar-month-layout.js +108 -0
- package/dist/browser/content/calendar-month-layout.js.map +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/inputs/DatePicker.js +46 -10
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/date-picker.js +24 -0
- package/dist/browser/inputs/date-picker.js.map +1 -1
- package/dist/browser/intl/messages.js +6 -0
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/ssr/actions/Button.js +21 -32
- package/dist/ssr/actions/Button.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +7 -3
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/CopyButton.js +9 -7
- package/dist/ssr/actions/CopyButton.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +4 -0
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/content/Calendar.js +1223 -105
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/calendar-messages.js +83 -0
- package/dist/ssr/content/calendar-messages.js.map +1 -0
- package/dist/ssr/content/calendar-month-layout.js +108 -0
- package/dist/ssr/content/calendar-month-layout.js.map +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/inputs/DatePicker.js +34 -4
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/date-picker.js +24 -0
- package/dist/ssr/inputs/date-picker.js.map +1 -1
- package/dist/ssr/intl/messages.js +6 -0
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/GestureMenu.d.ts +2 -0
- package/dist/types/content/Calendar.d.ts +32 -0
- package/dist/types/content/calendar-messages.d.ts +41 -0
- package/dist/types/content/calendar-month-layout.d.ts +52 -0
- package/dist/types/content/index.d.ts +1 -1
- package/dist/types/inputs/date-picker.d.ts +7 -0
- package/dist/types/intl/messages.d.ts +3 -0
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import { template as _$template } from "solid-js/web";
|
|
|
2
2
|
import { delegateEvents as _$delegateEvents } from "solid-js/web";
|
|
3
3
|
import { use as _$use } from "solid-js/web";
|
|
4
4
|
import { setStyleProperty as _$setStyleProperty } from "solid-js/web";
|
|
5
|
-
import { memo as _$memo } from "solid-js/web";
|
|
6
5
|
import { className as _$className } from "solid-js/web";
|
|
7
6
|
import { spread as _$spread } from "solid-js/web";
|
|
8
7
|
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
@@ -11,65 +10,90 @@ import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
|
11
10
|
import { effect as _$effect } from "solid-js/web";
|
|
12
11
|
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
13
12
|
import { addEventListener as _$addEventListener } from "solid-js/web";
|
|
13
|
+
import { memo as _$memo } from "solid-js/web";
|
|
14
14
|
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
15
|
-
import { insert as _$insert } from "solid-js/web";
|
|
16
15
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
17
16
|
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_tmpl$
|
|
21
|
-
_tmpl$
|
|
22
|
-
_tmpl$
|
|
23
|
-
_tmpl$
|
|
24
|
-
_tmpl$
|
|
25
|
-
_tmpl$
|
|
26
|
-
_tmpl$
|
|
27
|
-
_tmpl$
|
|
28
|
-
_tmpl$
|
|
29
|
-
_tmpl$
|
|
30
|
-
_tmpl$
|
|
31
|
-
_tmpl$
|
|
32
|
-
_tmpl$
|
|
33
|
-
_tmpl$
|
|
34
|
-
_tmpl$
|
|
35
|
-
_tmpl$
|
|
36
|
-
_tmpl$
|
|
37
|
-
_tmpl$
|
|
38
|
-
_tmpl$
|
|
39
|
-
_tmpl$
|
|
40
|
-
_tmpl$
|
|
41
|
-
_tmpl$
|
|
42
|
-
_tmpl$
|
|
43
|
-
_tmpl$
|
|
44
|
-
_tmpl$
|
|
45
|
-
_tmpl$
|
|
46
|
-
_tmpl$
|
|
47
|
-
_tmpl$
|
|
48
|
-
_tmpl$
|
|
49
|
-
_tmpl$
|
|
50
|
-
_tmpl$
|
|
51
|
-
_tmpl$
|
|
52
|
-
_tmpl$
|
|
53
|
-
_tmpl$
|
|
54
|
-
_tmpl$
|
|
55
|
-
_tmpl$
|
|
56
|
-
_tmpl$
|
|
57
|
-
_tmpl$
|
|
58
|
-
_tmpl$
|
|
59
|
-
_tmpl$
|
|
60
|
-
_tmpl$
|
|
61
|
-
_tmpl$
|
|
62
|
-
_tmpl$
|
|
63
|
-
_tmpl$
|
|
64
|
-
_tmpl$
|
|
17
|
+
import { insert as _$insert } from "solid-js/web";
|
|
18
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__time>`),
|
|
19
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__marker aria-hidden=true>`),
|
|
20
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__title><!$><!/><!$><!/>`),
|
|
21
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__meta>`),
|
|
22
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__description>`),
|
|
23
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__hint data-edge=start aria-hidden=true>`),
|
|
24
|
+
_tmpl$7 = /*#__PURE__*/_$template(`<span class=k2b-calendar-event__hint data-edge=end aria-hidden=true>`),
|
|
25
|
+
_tmpl$8 = /*#__PURE__*/_$template(`<a class=k2b-calendar-event data-calendar-event>`),
|
|
26
|
+
_tmpl$9 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-event data-calendar-event data-interactive=true>`),
|
|
27
|
+
_tmpl$0 = /*#__PURE__*/_$template(`<div class=k2b-calendar-event role=group data-calendar-event>`),
|
|
28
|
+
_tmpl$1 = /*#__PURE__*/_$template(`<a>`),
|
|
29
|
+
_tmpl$10 = /*#__PURE__*/_$template(`<div role=radiogroup aria-orientation=horizontal class="k2b-segmented-control k2b-calendar-view-switcher">`),
|
|
30
|
+
_tmpl$11 = /*#__PURE__*/_$template(`<i>`),
|
|
31
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-header__nav-button><i>`),
|
|
32
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<span class=k2b-button__label>`),
|
|
33
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<div class=k2b-calendar-header__content>`),
|
|
34
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<span class=k2b-calendar-header__progress aria-hidden=true>`),
|
|
35
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<header class=k2b-calendar-header><div class=k2b-calendar-header__navigation><!$><!/><!$><!/><div class=k2b-calendar-header__title><span></span><!$><!/></div></div><!$><!/><div class=k2b-calendar-header__actions><!$><!/><!$><!/><!$><!/></div><!$><!/>`),
|
|
36
|
+
_tmpl$17 = /*#__PURE__*/_$template(`<span class=k2b-calendar-header__title-size aria-hidden=true>`),
|
|
37
|
+
_tmpl$18 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekday>`),
|
|
38
|
+
_tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month><div class=k2b-calendar-month__weekdays><!$><!/><!$><!/></div><!$><!/>`),
|
|
39
|
+
_tmpl$20 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week-number>`),
|
|
40
|
+
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week><!$><!/><!$><!/>`),
|
|
41
|
+
_tmpl$22 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__day-target data-interactive=true>`),
|
|
42
|
+
_tmpl$23 = /*#__PURE__*/_$template(`<div class=k2b-calendar-preview>`),
|
|
43
|
+
_tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__day><!$><!/><div class=k2b-calendar-month__day-header><!$><!/><!$><!/></div><div class=k2b-calendar-month__events><!$><!/><!$><!/><!$><!/></div><div class=k2b-calendar-month__dots>`),
|
|
44
|
+
_tmpl$25 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__day-number>`),
|
|
45
|
+
_tmpl$26 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__badge><!$><!/><!$><!/>`),
|
|
46
|
+
_tmpl$27 = /*#__PURE__*/_$template(`<span class=k2b-calendar-dot>`),
|
|
47
|
+
_tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekday role=columnheader>`),
|
|
48
|
+
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month role=grid aria-multiselectable=true data-lanes=true style=--k2b-calendar-lane:1.25rem;--k2b-calendar-lane-gap:0.125rem><div class=k2b-calendar-month__weekdays role=row><!$><!/><!$><!/></div><!$><!/>`),
|
|
49
|
+
_tmpl$30 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week-number role=rowheader>`),
|
|
50
|
+
_tmpl$31 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week role=row><!$><!/><!$><!/>`),
|
|
51
|
+
_tmpl$32 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__week-link tabindex=-1>`),
|
|
52
|
+
_tmpl$33 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__more tabindex=-1 aria-haspopup=dialog><span class=k2b-calendar-month__more-long></span><span class=k2b-calendar-month__more-short>+<!$><!/>`),
|
|
53
|
+
_tmpl$34 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__day role=gridcell><div class=k2b-calendar-month__day-header><span class=k2b-calendar-month__day-number></span><!$><!/></div><div class=k2b-calendar-month__lanes><!$><!/><!$><!/><!$><!/>`),
|
|
54
|
+
_tmpl$35 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment data-bar=true>`),
|
|
55
|
+
_tmpl$36 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment style=--k2b-calendar-span:1>`),
|
|
56
|
+
_tmpl$37 = /*#__PURE__*/_$template(`<ul class=k2b-calendar-day-list__events>`),
|
|
57
|
+
_tmpl$38 = /*#__PURE__*/_$template(`<i class="ti ti-plus"aria-hidden=true>`),
|
|
58
|
+
_tmpl$39 = /*#__PURE__*/_$template(`<div class=k2b-calendar-day-list><div class=k2b-calendar-day-list__title></div><!$><!/><div class=k2b-calendar-day-list__actions><!$><!/><!$><!/>`),
|
|
59
|
+
_tmpl$40 = /*#__PURE__*/_$template(`<p class=k2b-calendar-day-list__empty>`),
|
|
60
|
+
_tmpl$41 = /*#__PURE__*/_$template(`<li>`),
|
|
61
|
+
_tmpl$42 = /*#__PURE__*/_$template(`<i class="ti ti-zoom-in"aria-hidden=true>`),
|
|
62
|
+
_tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-calendar-popover popover=auto role=dialog>`),
|
|
63
|
+
_tmpl$44 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day><div class=k2b-calendar-time-grid__all-day-label></div><!$><!/>`),
|
|
64
|
+
_tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid><div class=k2b-calendar-time-grid__days><div></div><!$><!/></div><!$><!/><div class=k2b-calendar-time-grid__scroll><div class=k2b-calendar-time-grid__grid><div class=k2b-calendar-time-grid__gutter></div><!$><!/>`),
|
|
65
|
+
_tmpl$46 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__day-label>`),
|
|
66
|
+
_tmpl$47 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__badge><!$><!/><!$><!/>`),
|
|
67
|
+
_tmpl$48 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day-cell><div class=k2b-calendar-time-grid__all-day-events><!$><!/><!$><!/>`),
|
|
68
|
+
_tmpl$49 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__hour><!$><!/>:00`),
|
|
69
|
+
_tmpl$50 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__now>`),
|
|
70
|
+
_tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__column><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
71
|
+
_tmpl$52 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__slot>`),
|
|
72
|
+
_tmpl$53 = /*#__PURE__*/_$template(`<div class=k2b-calendar-preview__title>`),
|
|
73
|
+
_tmpl$54 = /*#__PURE__*/_$template(`<div class="k2b-calendar-preview k2b-calendar-preview--timed"><div class=k2b-calendar-preview__content><!$><!/><div class=k2b-calendar-preview__label><!$><!/> - <!$><!/>`),
|
|
74
|
+
_tmpl$55 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__resize><span class=k2b-calendar-time-grid__resize-icon aria-hidden=true>`),
|
|
75
|
+
_tmpl$56 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__event-position><div class=k2b-calendar-time-grid__event-frame><!$><!/><!$><!/>`),
|
|
76
|
+
_tmpl$57 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__overflow><span class=k2b-calendar-time-grid__overflow-count>+<!$><!/>`),
|
|
77
|
+
_tmpl$58 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__overflow-menu><div class=k2b-calendar-time-grid__overflow-title><!$><!/> - <!$><!/></div><!$><!/>`),
|
|
78
|
+
_tmpl$59 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year>`),
|
|
79
|
+
_tmpl$60 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year__month><div class=k2b-calendar-year__title></div><div class=k2b-calendar-year__grid>`),
|
|
80
|
+
_tmpl$61 = /*#__PURE__*/_$template(`<span class=k2b-calendar-year__indicator>`),
|
|
81
|
+
_tmpl$62 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__events>`),
|
|
82
|
+
_tmpl$63 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month><!$><!/><div class=k2b-calendar-mobile-month__agenda><div class=k2b-calendar-mobile-month__title></div><!$><!/>`),
|
|
83
|
+
_tmpl$64 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__empty>`),
|
|
84
|
+
_tmpl$65 = /*#__PURE__*/_$template(`<div class=k2b-calendar-body>`),
|
|
85
|
+
_tmpl$66 = /*#__PURE__*/_$template(`<section><!$><!/><!$><!/>`);
|
|
65
86
|
import { Link } from "@k2b/ssr/nav";
|
|
66
87
|
import { dates as calendar } from "@k2b/stdlib";
|
|
67
|
-
import { createMemo, createSignal, For, mergeProps, onCleanup, onMount, Show } from "solid-js";
|
|
88
|
+
import { createEffect, createMemo, createSignal, For, mergeProps, on, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
68
89
|
import { Button } from "../actions/Button";
|
|
90
|
+
import { GestureMenu } from "../actions/GestureMenu";
|
|
69
91
|
import SegmentedControl from "../actions/SegmentedControl";
|
|
70
92
|
import { useDateConfigLocale } from "../intl/locale";
|
|
71
93
|
import { useUiMessages } from "../intl/messages";
|
|
72
94
|
import { layoutCalendarIntervals } from "./calendar-event-layout";
|
|
95
|
+
import { useCalendarMessages } from "./calendar-messages";
|
|
96
|
+
import { fitMonthWeek, layoutMonthWeek, monthLaneCapacity } from "./calendar-month-layout";
|
|
73
97
|
import { calendarDayIndexAtPoint, calendarMinuteAtPoint, startCalendarPointerSession } from "./calendar-pointer";
|
|
74
98
|
|
|
75
99
|
/** A view the application adds to the switcher; the calendar shows its header and toolbar, the application the body. */
|
|
@@ -246,7 +270,7 @@ const EventChip = props => {
|
|
|
246
270
|
const showDescription = () => Boolean(props.event.description?.trim() && props.fill && !props.event.allDay && !props.compact && durationHours() >= 1.5);
|
|
247
271
|
const timeLabel = () => `${formatTime(props.event.startDate, dateConfig())} - ${formatTime(props.event.endDate, dateConfig())}`;
|
|
248
272
|
const ariaLabel = () => {
|
|
249
|
-
const label = props.event.allDay ? props.event.title : messages().calendarEventTime({
|
|
273
|
+
const label = props.label ? props.label : props.event.allDay ? props.event.title : messages().calendarEventTime({
|
|
250
274
|
title: props.event.title,
|
|
251
275
|
start: formatTime(props.event.startDate, dateConfig()),
|
|
252
276
|
end: formatTime(props.event.endDate, dateConfig())
|
|
@@ -260,53 +284,81 @@ const EventChip = props => {
|
|
|
260
284
|
end: props.event.endDate,
|
|
261
285
|
allDay: props.event.allDay ?? false,
|
|
262
286
|
durationHours: durationHours(),
|
|
263
|
-
timeLabel: timeLabel()
|
|
287
|
+
timeLabel: timeLabel(),
|
|
288
|
+
leadingTime: props.leadingTime
|
|
264
289
|
});
|
|
265
|
-
const defaultContent = [(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
290
|
+
const defaultContent = [_$createComponent(Show, {
|
|
291
|
+
get when() {
|
|
292
|
+
return props.leadingTime;
|
|
293
|
+
},
|
|
294
|
+
get children() {
|
|
295
|
+
var _el$ = _$getNextElement(_tmpl$);
|
|
296
|
+
_$insert(_el$, () => props.leadingTime);
|
|
297
|
+
return _el$;
|
|
298
|
+
}
|
|
299
|
+
}), (() => {
|
|
300
|
+
var _el$2 = _$getNextElement(_tmpl$3),
|
|
301
|
+
_el$4 = _el$2.firstChild,
|
|
302
|
+
[_el$5, _co$] = _$getNextMarker(_el$4.nextSibling),
|
|
303
|
+
_el$6 = _el$5.nextSibling,
|
|
304
|
+
[_el$7, _co$2] = _$getNextMarker(_el$6.nextSibling);
|
|
305
|
+
_$insert(_el$2, _$createComponent(Show, {
|
|
272
306
|
get when() {
|
|
273
307
|
return props.event.display === "marker";
|
|
274
308
|
},
|
|
275
309
|
get children() {
|
|
276
|
-
return _$getNextElement(_tmpl$);
|
|
310
|
+
return _$getNextElement(_tmpl$2);
|
|
277
311
|
}
|
|
278
|
-
}), _el$
|
|
279
|
-
_$insert(_el
|
|
280
|
-
return _el
|
|
312
|
+
}), _el$5, _co$);
|
|
313
|
+
_$insert(_el$2, () => props.event.title, _el$7, _co$2);
|
|
314
|
+
return _el$2;
|
|
281
315
|
})(), _$createComponent(Show, {
|
|
282
316
|
get when() {
|
|
283
317
|
return showTime();
|
|
284
318
|
},
|
|
285
319
|
get children() {
|
|
286
|
-
var _el$
|
|
287
|
-
_$insert(_el$
|
|
288
|
-
return _el$
|
|
320
|
+
var _el$8 = _$getNextElement(_tmpl$4);
|
|
321
|
+
_$insert(_el$8, timeLabel);
|
|
322
|
+
return _el$8;
|
|
289
323
|
}
|
|
290
324
|
}), _$createComponent(Show, {
|
|
291
325
|
get when() {
|
|
292
326
|
return showLocation();
|
|
293
327
|
},
|
|
294
328
|
get children() {
|
|
295
|
-
var _el$
|
|
296
|
-
_$insert(_el$
|
|
297
|
-
return _el$
|
|
329
|
+
var _el$9 = _$getNextElement(_tmpl$4);
|
|
330
|
+
_$insert(_el$9, () => props.event.location);
|
|
331
|
+
return _el$9;
|
|
298
332
|
}
|
|
299
333
|
}), _$createComponent(Show, {
|
|
300
334
|
get when() {
|
|
301
335
|
return showDescription();
|
|
302
336
|
},
|
|
303
337
|
get children() {
|
|
304
|
-
var _el$
|
|
305
|
-
_$insert(_el$
|
|
306
|
-
return _el$
|
|
338
|
+
var _el$0 = _$getNextElement(_tmpl$5);
|
|
339
|
+
_$insert(_el$0, () => props.event.description);
|
|
340
|
+
return _el$0;
|
|
341
|
+
}
|
|
342
|
+
})];
|
|
343
|
+
const content = () => [_$createComponent(Show, {
|
|
344
|
+
get when() {
|
|
345
|
+
return props.hintStart;
|
|
346
|
+
},
|
|
347
|
+
get children() {
|
|
348
|
+
var _el$1 = _$getNextElement(_tmpl$6);
|
|
349
|
+
_$insert(_el$1, () => props.hintStart);
|
|
350
|
+
return _el$1;
|
|
351
|
+
}
|
|
352
|
+
}), _$memo(() => renderedEvent() ?? defaultContent), _$createComponent(Show, {
|
|
353
|
+
get when() {
|
|
354
|
+
return props.hintEnd;
|
|
355
|
+
},
|
|
356
|
+
get children() {
|
|
357
|
+
var _el$10 = _$getNextElement(_tmpl$7);
|
|
358
|
+
_$insert(_el$10, () => props.hintEnd);
|
|
359
|
+
return _el$10;
|
|
307
360
|
}
|
|
308
361
|
})];
|
|
309
|
-
const content = () => renderedEvent() ?? defaultContent;
|
|
310
362
|
const isActionable = () => isInteractive() || Boolean(props.onMovePointerDown);
|
|
311
363
|
let suppressClickUntil = 0;
|
|
312
364
|
const onClick = event => {
|
|
@@ -339,12 +391,12 @@ const EventChip = props => {
|
|
|
339
391
|
});
|
|
340
392
|
};
|
|
341
393
|
return props.href ? (() => {
|
|
342
|
-
var _el$
|
|
343
|
-
_el$
|
|
344
|
-
_$addEventListener(_el$
|
|
345
|
-
_el$
|
|
346
|
-
_el$
|
|
347
|
-
_$insert(_el$
|
|
394
|
+
var _el$11 = _$getNextElement(_tmpl$8);
|
|
395
|
+
_el$11.$$pointerdown = onPointerDown;
|
|
396
|
+
_$addEventListener(_el$11, "dragstart", props.onMovePointerDown ? event => event.preventDefault() : undefined);
|
|
397
|
+
_el$11.$$dblclick = onDoubleClick;
|
|
398
|
+
_el$11.$$click = onClick;
|
|
399
|
+
_$insert(_el$11, content);
|
|
348
400
|
_$effect(_p$ => {
|
|
349
401
|
var _v$ = props.href,
|
|
350
402
|
_v$2 = props.event.colorHex ? undefined : color(),
|
|
@@ -353,25 +405,31 @@ const EventChip = props => {
|
|
|
353
405
|
_v$5 = props.fill ? "true" : undefined,
|
|
354
406
|
_v$6 = short() ? "true" : undefined,
|
|
355
407
|
_v$7 = props.moving ? "true" : undefined,
|
|
356
|
-
_v$8 =
|
|
357
|
-
_v$9 = props.
|
|
358
|
-
_v$0 = props.
|
|
359
|
-
_v$1 =
|
|
360
|
-
_v$10 = props.
|
|
361
|
-
_v$11 =
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
_v$
|
|
366
|
-
_v$
|
|
367
|
-
_v$
|
|
368
|
-
_v$
|
|
369
|
-
_v$
|
|
370
|
-
_v$
|
|
371
|
-
_v$
|
|
372
|
-
_p$.
|
|
373
|
-
_v$
|
|
374
|
-
_v$
|
|
408
|
+
_v$8 = props.continuesBefore ? "true" : undefined,
|
|
409
|
+
_v$9 = props.continuesAfter ? "true" : undefined,
|
|
410
|
+
_v$0 = props.bar ? "true" : undefined,
|
|
411
|
+
_v$1 = isInteractive() ? "true" : undefined,
|
|
412
|
+
_v$10 = props.event.display,
|
|
413
|
+
_v$11 = props.event.dataSpaceItemId,
|
|
414
|
+
_v$12 = style(),
|
|
415
|
+
_v$13 = props.onMovePointerDown ? false : undefined,
|
|
416
|
+
_v$14 = ariaLabel();
|
|
417
|
+
_v$ !== _p$.e && _$setAttribute(_el$11, "href", _p$.e = _v$);
|
|
418
|
+
_v$2 !== _p$.t && _$setAttribute(_el$11, "data-color", _p$.t = _v$2);
|
|
419
|
+
_v$3 !== _p$.a && _$setAttribute(_el$11, "data-selected", _p$.a = _v$3);
|
|
420
|
+
_v$4 !== _p$.o && _$setAttribute(_el$11, "data-compact", _p$.o = _v$4);
|
|
421
|
+
_v$5 !== _p$.i && _$setAttribute(_el$11, "data-fill", _p$.i = _v$5);
|
|
422
|
+
_v$6 !== _p$.n && _$setAttribute(_el$11, "data-short", _p$.n = _v$6);
|
|
423
|
+
_v$7 !== _p$.s && _$setAttribute(_el$11, "data-moving", _p$.s = _v$7);
|
|
424
|
+
_v$8 !== _p$.h && _$setAttribute(_el$11, "data-continues-before", _p$.h = _v$8);
|
|
425
|
+
_v$9 !== _p$.r && _$setAttribute(_el$11, "data-continues-after", _p$.r = _v$9);
|
|
426
|
+
_v$0 !== _p$.d && _$setAttribute(_el$11, "data-bar", _p$.d = _v$0);
|
|
427
|
+
_v$1 !== _p$.l && _$setAttribute(_el$11, "data-interactive", _p$.l = _v$1);
|
|
428
|
+
_v$10 !== _p$.u && _$setAttribute(_el$11, "data-display", _p$.u = _v$10);
|
|
429
|
+
_v$11 !== _p$.c && _$setAttribute(_el$11, "data-space-item-id", _p$.c = _v$11);
|
|
430
|
+
_p$.w = _$style(_el$11, _v$12, _p$.w);
|
|
431
|
+
_v$13 !== _p$.m && _$setAttribute(_el$11, "draggable", _p$.m = _v$13);
|
|
432
|
+
_v$14 !== _p$.f && _$setAttribute(_el$11, "aria-label", _p$.f = _v$14);
|
|
375
433
|
return _p$;
|
|
376
434
|
}, {
|
|
377
435
|
e: undefined,
|
|
@@ -386,36 +444,45 @@ const EventChip = props => {
|
|
|
386
444
|
d: undefined,
|
|
387
445
|
l: undefined,
|
|
388
446
|
u: undefined,
|
|
389
|
-
c: undefined
|
|
447
|
+
c: undefined,
|
|
448
|
+
w: undefined,
|
|
449
|
+
m: undefined,
|
|
450
|
+
f: undefined
|
|
390
451
|
});
|
|
391
452
|
_$runHydrationEvents();
|
|
392
|
-
return _el$
|
|
453
|
+
return _el$11;
|
|
393
454
|
})() : isActionable() ? (() => {
|
|
394
|
-
var _el$
|
|
395
|
-
_el$
|
|
396
|
-
_el$
|
|
397
|
-
_el$
|
|
398
|
-
_el$
|
|
399
|
-
_$insert(_el$
|
|
455
|
+
var _el$12 = _$getNextElement(_tmpl$9);
|
|
456
|
+
_el$12.$$keydown = onButtonKeyDown;
|
|
457
|
+
_el$12.$$pointerdown = onPointerDown;
|
|
458
|
+
_el$12.$$dblclick = onDoubleClick;
|
|
459
|
+
_el$12.$$click = onClick;
|
|
460
|
+
_$insert(_el$12, content);
|
|
400
461
|
_$effect(_p$ => {
|
|
401
|
-
var _v$
|
|
402
|
-
_v$
|
|
403
|
-
_v$
|
|
404
|
-
_v$
|
|
405
|
-
_v$
|
|
406
|
-
_v$
|
|
407
|
-
_v$
|
|
408
|
-
_v$
|
|
409
|
-
_v$
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
_v$15 !== _p$.
|
|
414
|
-
_v$16 !== _p$.
|
|
415
|
-
_v$17 !== _p$.
|
|
416
|
-
_v$18 !== _p$.
|
|
417
|
-
_p$.
|
|
418
|
-
_v$20 !== _p$.
|
|
462
|
+
var _v$15 = props.event.colorHex ? undefined : color(),
|
|
463
|
+
_v$16 = selected() ? "true" : undefined,
|
|
464
|
+
_v$17 = props.compact ? "true" : undefined,
|
|
465
|
+
_v$18 = props.fill ? "true" : undefined,
|
|
466
|
+
_v$19 = short() ? "true" : undefined,
|
|
467
|
+
_v$20 = props.moving ? "true" : undefined,
|
|
468
|
+
_v$21 = props.continuesBefore ? "true" : undefined,
|
|
469
|
+
_v$22 = props.continuesAfter ? "true" : undefined,
|
|
470
|
+
_v$23 = props.bar ? "true" : undefined,
|
|
471
|
+
_v$24 = props.event.display,
|
|
472
|
+
_v$25 = style(),
|
|
473
|
+
_v$26 = ariaLabel();
|
|
474
|
+
_v$15 !== _p$.e && _$setAttribute(_el$12, "data-color", _p$.e = _v$15);
|
|
475
|
+
_v$16 !== _p$.t && _$setAttribute(_el$12, "data-selected", _p$.t = _v$16);
|
|
476
|
+
_v$17 !== _p$.a && _$setAttribute(_el$12, "data-compact", _p$.a = _v$17);
|
|
477
|
+
_v$18 !== _p$.o && _$setAttribute(_el$12, "data-fill", _p$.o = _v$18);
|
|
478
|
+
_v$19 !== _p$.i && _$setAttribute(_el$12, "data-short", _p$.i = _v$19);
|
|
479
|
+
_v$20 !== _p$.n && _$setAttribute(_el$12, "data-moving", _p$.n = _v$20);
|
|
480
|
+
_v$21 !== _p$.s && _$setAttribute(_el$12, "data-continues-before", _p$.s = _v$21);
|
|
481
|
+
_v$22 !== _p$.h && _$setAttribute(_el$12, "data-continues-after", _p$.h = _v$22);
|
|
482
|
+
_v$23 !== _p$.r && _$setAttribute(_el$12, "data-bar", _p$.r = _v$23);
|
|
483
|
+
_v$24 !== _p$.d && _$setAttribute(_el$12, "data-display", _p$.d = _v$24);
|
|
484
|
+
_p$.l = _$style(_el$12, _v$25, _p$.l);
|
|
485
|
+
_v$26 !== _p$.u && _$setAttribute(_el$12, "aria-label", _p$.u = _v$26);
|
|
419
486
|
return _p$;
|
|
420
487
|
}, {
|
|
421
488
|
e: undefined,
|
|
@@ -426,33 +493,42 @@ const EventChip = props => {
|
|
|
426
493
|
n: undefined,
|
|
427
494
|
s: undefined,
|
|
428
495
|
h: undefined,
|
|
429
|
-
r: undefined
|
|
496
|
+
r: undefined,
|
|
497
|
+
d: undefined,
|
|
498
|
+
l: undefined,
|
|
499
|
+
u: undefined
|
|
430
500
|
});
|
|
431
501
|
_$runHydrationEvents();
|
|
432
|
-
return _el$
|
|
502
|
+
return _el$12;
|
|
433
503
|
})() : (() => {
|
|
434
|
-
var _el$
|
|
435
|
-
_$setAttribute(_el$
|
|
436
|
-
_$insert(_el$
|
|
504
|
+
var _el$13 = _$getNextElement(_tmpl$0);
|
|
505
|
+
_$setAttribute(_el$13, "data-interactive", undefined);
|
|
506
|
+
_$insert(_el$13, content);
|
|
437
507
|
_$effect(_p$ => {
|
|
438
|
-
var _v$
|
|
439
|
-
_v$
|
|
440
|
-
_v$
|
|
441
|
-
_v$
|
|
442
|
-
_v$
|
|
443
|
-
_v$
|
|
444
|
-
_v$
|
|
445
|
-
_v$
|
|
446
|
-
_v$
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
_v$
|
|
451
|
-
_v$
|
|
452
|
-
_v$
|
|
453
|
-
_v$
|
|
454
|
-
_p$.
|
|
455
|
-
_v$
|
|
508
|
+
var _v$27 = props.event.colorHex ? undefined : color(),
|
|
509
|
+
_v$28 = selected() ? "true" : undefined,
|
|
510
|
+
_v$29 = props.compact ? "true" : undefined,
|
|
511
|
+
_v$30 = props.fill ? "true" : undefined,
|
|
512
|
+
_v$31 = short() ? "true" : undefined,
|
|
513
|
+
_v$32 = props.moving ? "true" : undefined,
|
|
514
|
+
_v$33 = props.continuesBefore ? "true" : undefined,
|
|
515
|
+
_v$34 = props.continuesAfter ? "true" : undefined,
|
|
516
|
+
_v$35 = props.bar ? "true" : undefined,
|
|
517
|
+
_v$36 = props.event.display,
|
|
518
|
+
_v$37 = style(),
|
|
519
|
+
_v$38 = ariaLabel();
|
|
520
|
+
_v$27 !== _p$.e && _$setAttribute(_el$13, "data-color", _p$.e = _v$27);
|
|
521
|
+
_v$28 !== _p$.t && _$setAttribute(_el$13, "data-selected", _p$.t = _v$28);
|
|
522
|
+
_v$29 !== _p$.a && _$setAttribute(_el$13, "data-compact", _p$.a = _v$29);
|
|
523
|
+
_v$30 !== _p$.o && _$setAttribute(_el$13, "data-fill", _p$.o = _v$30);
|
|
524
|
+
_v$31 !== _p$.i && _$setAttribute(_el$13, "data-short", _p$.i = _v$31);
|
|
525
|
+
_v$32 !== _p$.n && _$setAttribute(_el$13, "data-moving", _p$.n = _v$32);
|
|
526
|
+
_v$33 !== _p$.s && _$setAttribute(_el$13, "data-continues-before", _p$.s = _v$33);
|
|
527
|
+
_v$34 !== _p$.h && _$setAttribute(_el$13, "data-continues-after", _p$.h = _v$34);
|
|
528
|
+
_v$35 !== _p$.r && _$setAttribute(_el$13, "data-bar", _p$.r = _v$35);
|
|
529
|
+
_v$36 !== _p$.d && _$setAttribute(_el$13, "data-display", _p$.d = _v$36);
|
|
530
|
+
_p$.l = _$style(_el$13, _v$37, _p$.l);
|
|
531
|
+
_v$38 !== _p$.u && _$setAttribute(_el$13, "aria-label", _p$.u = _v$38);
|
|
456
532
|
return _p$;
|
|
457
533
|
}, {
|
|
458
534
|
e: undefined,
|
|
@@ -463,9 +539,12 @@ const EventChip = props => {
|
|
|
463
539
|
n: undefined,
|
|
464
540
|
s: undefined,
|
|
465
541
|
h: undefined,
|
|
466
|
-
r: undefined
|
|
542
|
+
r: undefined,
|
|
543
|
+
d: undefined,
|
|
544
|
+
l: undefined,
|
|
545
|
+
u: undefined
|
|
467
546
|
});
|
|
468
|
-
return _el$
|
|
547
|
+
return _el$13;
|
|
469
548
|
})();
|
|
470
549
|
};
|
|
471
550
|
const slotInteractionProps = (owner, slot, suppressed, nativeControl = false) => {
|
|
@@ -508,8 +587,8 @@ const CalendarNavigationLink = props => {
|
|
|
508
587
|
props.owner.onNavigateHref?.(props.href);
|
|
509
588
|
};
|
|
510
589
|
return props.owner.onNavigateHref ? (() => {
|
|
511
|
-
var _el$
|
|
512
|
-
_$spread(_el$
|
|
590
|
+
var _el$14 = _$getNextElement(_tmpl$1);
|
|
591
|
+
_$spread(_el$14, _$mergeProps(() => props.anchorProps, {
|
|
513
592
|
get href() {
|
|
514
593
|
return props.href;
|
|
515
594
|
},
|
|
@@ -517,9 +596,9 @@ const CalendarNavigationLink = props => {
|
|
|
517
596
|
"onPointerEnter": preload,
|
|
518
597
|
"onFocus": preload
|
|
519
598
|
}), false, true);
|
|
520
|
-
_$insert(_el$
|
|
599
|
+
_$insert(_el$14, () => props.children);
|
|
521
600
|
_$runHydrationEvents();
|
|
522
|
-
return _el$
|
|
601
|
+
return _el$14;
|
|
523
602
|
})() : props.owner.onNavigate ? _$createComponent(Link, _$mergeProps(() => props.anchorProps, {
|
|
524
603
|
get href() {
|
|
525
604
|
return props.href;
|
|
@@ -534,17 +613,17 @@ const CalendarNavigationLink = props => {
|
|
|
534
613
|
return props.children;
|
|
535
614
|
}
|
|
536
615
|
})) : (() => {
|
|
537
|
-
var _el$
|
|
538
|
-
_$spread(_el$
|
|
616
|
+
var _el$15 = _$getNextElement(_tmpl$1);
|
|
617
|
+
_$spread(_el$15, _$mergeProps(() => props.anchorProps, {
|
|
539
618
|
get href() {
|
|
540
619
|
return props.href;
|
|
541
620
|
},
|
|
542
621
|
"onPointerEnter": preload,
|
|
543
622
|
"onFocus": preload
|
|
544
623
|
}), false, true);
|
|
545
|
-
_$insert(_el$
|
|
624
|
+
_$insert(_el$15, () => props.children);
|
|
546
625
|
_$runHydrationEvents();
|
|
547
|
-
return _el$
|
|
626
|
+
return _el$15;
|
|
548
627
|
})();
|
|
549
628
|
};
|
|
550
629
|
const CalendarViewLinks = props => {
|
|
@@ -567,14 +646,18 @@ const CalendarViewLinks = props => {
|
|
|
567
646
|
}
|
|
568
647
|
};
|
|
569
648
|
return (() => {
|
|
570
|
-
var _el$
|
|
571
|
-
_$insert(_el$
|
|
649
|
+
var _el$16 = _$getNextElement(_tmpl$10);
|
|
650
|
+
_$insert(_el$16, _$createComponent(For, {
|
|
572
651
|
get each() {
|
|
573
652
|
return props.options;
|
|
574
653
|
},
|
|
575
654
|
children: (option, index) => {
|
|
576
655
|
const active = () => (props.view === "mobile-month" ? "month" : props.view) === option.value;
|
|
577
|
-
const href = () =>
|
|
656
|
+
const href = () => {
|
|
657
|
+
const day = props.focusDay;
|
|
658
|
+
const atDay = day && !active() ? props.owner.getDateHref?.(day, option.value) : undefined;
|
|
659
|
+
return atDay ?? props.owner.getViewHref?.(option.value) ?? "#";
|
|
660
|
+
};
|
|
578
661
|
return _$createComponent(CalendarNavigationLink, {
|
|
579
662
|
get owner() {
|
|
580
663
|
return props.owner;
|
|
@@ -601,17 +684,33 @@ const CalendarViewLinks = props => {
|
|
|
601
684
|
});
|
|
602
685
|
}
|
|
603
686
|
}));
|
|
604
|
-
_$effect(() => _$setAttribute(_el$
|
|
605
|
-
return _el$
|
|
687
|
+
_$effect(() => _$setAttribute(_el$16, "aria-label", messages().calendarView));
|
|
688
|
+
return _el$16;
|
|
606
689
|
})();
|
|
607
690
|
};
|
|
608
691
|
|
|
692
|
+
/**
|
|
693
|
+
* The same day some months later, or the last day of that month when it is shorter: a step from January 31 lands on
|
|
694
|
+
* February 28, never in March. stdlib's `addMonths` runs over into the next month.
|
|
695
|
+
*/
|
|
696
|
+
const addMonthsClamped = (date, months, dateConfig) => {
|
|
697
|
+
const moved = calendar.addMonths(date, months, dateConfig);
|
|
698
|
+
if (calendar.formatDateKey(moved, dateConfig).slice(8) === calendar.formatDateKey(date, dateConfig).slice(8)) return moved;
|
|
699
|
+
return calendar.addDays(calendar.startOfMonth(moved, dateConfig), -1, dateConfig);
|
|
700
|
+
};
|
|
701
|
+
|
|
609
702
|
/** Custom views page by day, like the day view. */
|
|
610
703
|
const adjacentCalendarDate = (date, view, direction, dateConfig) => {
|
|
611
|
-
if (view === "year") return
|
|
612
|
-
if (view === "month" || view === "mobile-month") return
|
|
704
|
+
if (view === "year") return addMonthsClamped(date, direction * 12, dateConfig);
|
|
705
|
+
if (view === "month" || view === "mobile-month") return addMonthsClamped(date, direction, dateConfig);
|
|
613
706
|
return calendar.addDays(date, direction * (view === "week" ? 7 : 1), dateConfig);
|
|
614
707
|
};
|
|
708
|
+
|
|
709
|
+
/** Opens a view at a day through the host's callbacks. Hosts may keep the view and the date apart, so both hear it. */
|
|
710
|
+
const openViewAt = (owner, date, view) => {
|
|
711
|
+
owner.onViewChange?.(view);
|
|
712
|
+
owner.onDateChange?.(date, view);
|
|
713
|
+
};
|
|
615
714
|
const CalendarHeader = props => {
|
|
616
715
|
const messages = useUiMessages();
|
|
617
716
|
const dateConfig = () => ownerDateConfig(props.owner);
|
|
@@ -632,8 +731,51 @@ const CalendarHeader = props => {
|
|
|
632
731
|
if (props.view === "week") return `${formatDay(calendar.startOfWeek(props.date, dateConfig()), dateConfig())} - ${formatDay(calendar.addDays(calendar.startOfWeek(props.date, dateConfig()), 6, dateConfig()), dateConfig())}`;
|
|
633
732
|
return formatMonth(props.date, dateConfig());
|
|
634
733
|
};
|
|
734
|
+
/**
|
|
735
|
+
* The titles this view can show around the current date: the months of the year, the weeks of the month, or a day
|
|
736
|
+
* of each weekday in every month. Their widest one sets the title's width.
|
|
737
|
+
*/
|
|
738
|
+
const titleWidths = createMemo(() => {
|
|
739
|
+
const context = dateConfig();
|
|
740
|
+
if (props.view === "year") return [];
|
|
741
|
+
const {
|
|
742
|
+
year
|
|
743
|
+
} = zonedYearMonth(props.date, context);
|
|
744
|
+
if (props.view === "month" || props.view === "mobile-month") return Array.from({
|
|
745
|
+
length: 12
|
|
746
|
+
}, (_, month) => formatMonth(zonedMonthDate(year, month, context), context));
|
|
747
|
+
if (props.view === "week") {
|
|
748
|
+
const first = calendar.startOfWeek(calendar.startOfMonth(props.date, context), context);
|
|
749
|
+
return Array.from({
|
|
750
|
+
length: 6
|
|
751
|
+
}, (_, week) => {
|
|
752
|
+
const start = calendar.addDays(first, week * 7, context);
|
|
753
|
+
return `${formatDay(start, context)} - ${formatDay(calendar.addDays(start, 6, context), context)}`;
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
return Array.from({
|
|
757
|
+
length: 12
|
|
758
|
+
}, (_, month) => month).flatMap(month => {
|
|
759
|
+
const first = zonedMonthDate(year, month, context);
|
|
760
|
+
return Array.from({
|
|
761
|
+
length: 7
|
|
762
|
+
}, (_, offset) => calendar.addDays(first, 21 + offset, context).toLocaleDateString(context.locale ?? "en", {
|
|
763
|
+
weekday: "long",
|
|
764
|
+
month: "long",
|
|
765
|
+
day: "numeric",
|
|
766
|
+
year: "numeric",
|
|
767
|
+
timeZone: context.timeZone
|
|
768
|
+
}));
|
|
769
|
+
});
|
|
770
|
+
});
|
|
635
771
|
const goDate = date => props.owner.onDateChange?.(date, props.view);
|
|
636
772
|
const goView = view => {
|
|
773
|
+
// Like the switcher's links, the other views open at the day selected in the month view.
|
|
774
|
+
const day = props.focusDay;
|
|
775
|
+
if (day && props.owner.onDateChange && view !== props.view) {
|
|
776
|
+
openViewAt(props.owner, day, view);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
637
779
|
if (props.owner.onViewChange) {
|
|
638
780
|
props.owner.onViewChange(view);
|
|
639
781
|
return;
|
|
@@ -654,18 +796,18 @@ const CalendarHeader = props => {
|
|
|
654
796
|
class: "k2b-calendar-header__nav-button"
|
|
655
797
|
},
|
|
656
798
|
get children() {
|
|
657
|
-
var _el$
|
|
658
|
-
_$className(_el$
|
|
659
|
-
return _el$
|
|
799
|
+
var _el$17 = _$getNextElement(_tmpl$11);
|
|
800
|
+
_$className(_el$17, `ti ${icon}`);
|
|
801
|
+
return _el$17;
|
|
660
802
|
}
|
|
661
803
|
}) : props.owner.onDateChange ? (() => {
|
|
662
|
-
var _el$
|
|
663
|
-
_el$
|
|
664
|
-
_el$
|
|
665
|
-
_$setAttribute(_el$
|
|
666
|
-
_$className(_el$
|
|
804
|
+
var _el$18 = _$getNextElement(_tmpl$12),
|
|
805
|
+
_el$19 = _el$18.firstChild;
|
|
806
|
+
_el$18.$$click = () => goDate(date);
|
|
807
|
+
_$setAttribute(_el$18, "aria-label", label);
|
|
808
|
+
_$className(_el$19, `ti ${icon}`);
|
|
667
809
|
_$runHydrationEvents();
|
|
668
|
-
return _el$
|
|
810
|
+
return _el$18;
|
|
669
811
|
})() : _$createComponent(CalendarNavigationLink, {
|
|
670
812
|
get owner() {
|
|
671
813
|
return props.owner;
|
|
@@ -677,9 +819,9 @@ const CalendarHeader = props => {
|
|
|
677
819
|
class: "k2b-calendar-header__nav-button"
|
|
678
820
|
},
|
|
679
821
|
get children() {
|
|
680
|
-
var _el$
|
|
681
|
-
_$className(_el$
|
|
682
|
-
return _el$
|
|
822
|
+
var _el$20 = _$getNextElement(_tmpl$11);
|
|
823
|
+
_$className(_el$20, `ti ${icon}`);
|
|
824
|
+
return _el$20;
|
|
683
825
|
}
|
|
684
826
|
});
|
|
685
827
|
};
|
|
@@ -687,9 +829,9 @@ const CalendarHeader = props => {
|
|
|
687
829
|
const today = calendar.today(dateConfig());
|
|
688
830
|
const href = props.owner.getDateHref?.(today, props.view);
|
|
689
831
|
const label = (() => {
|
|
690
|
-
var _el$
|
|
691
|
-
_$insert(_el$
|
|
692
|
-
return _el$
|
|
832
|
+
var _el$21 = _$getNextElement(_tmpl$13);
|
|
833
|
+
_$insert(_el$21, () => props.labels.today);
|
|
834
|
+
return _el$21;
|
|
693
835
|
})();
|
|
694
836
|
return (props.owner.onNavigateHref || props.owner.onNavigate) && href ? _$createComponent(CalendarNavigationLink, {
|
|
695
837
|
get owner() {
|
|
@@ -738,27 +880,52 @@ const CalendarHeader = props => {
|
|
|
738
880
|
label: props.labels.year
|
|
739
881
|
}].filter(option => !props.owner.views || props.owner.views.includes(option.value)), ...(props.owner.customViews ?? [])]);
|
|
740
882
|
return (() => {
|
|
741
|
-
var _el$
|
|
742
|
-
_el$
|
|
743
|
-
_el$
|
|
744
|
-
[_el$
|
|
745
|
-
_el$
|
|
746
|
-
[_el$
|
|
747
|
-
_el$
|
|
748
|
-
_el$
|
|
749
|
-
_el$
|
|
750
|
-
[_el$
|
|
751
|
-
_el$
|
|
752
|
-
[_el$
|
|
753
|
-
_el$
|
|
754
|
-
|
|
755
|
-
_el$
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
883
|
+
var _el$22 = _$getNextElement(_tmpl$16),
|
|
884
|
+
_el$23 = _el$22.firstChild,
|
|
885
|
+
_el$28 = _el$23.firstChild,
|
|
886
|
+
[_el$29, _co$4] = _$getNextMarker(_el$28.nextSibling),
|
|
887
|
+
_el$30 = _el$29.nextSibling,
|
|
888
|
+
[_el$31, _co$5] = _$getNextMarker(_el$30.nextSibling),
|
|
889
|
+
_el$24 = _el$31.nextSibling,
|
|
890
|
+
_el$25 = _el$24.firstChild,
|
|
891
|
+
_el$26 = _el$25.nextSibling,
|
|
892
|
+
[_el$27, _co$3] = _$getNextMarker(_el$26.nextSibling),
|
|
893
|
+
_el$41 = _el$23.nextSibling,
|
|
894
|
+
[_el$42, _co$9] = _$getNextMarker(_el$41.nextSibling),
|
|
895
|
+
_el$33 = _el$42.nextSibling,
|
|
896
|
+
_el$34 = _el$33.firstChild,
|
|
897
|
+
[_el$35, _co$6] = _$getNextMarker(_el$34.nextSibling),
|
|
898
|
+
_el$36 = _el$35.nextSibling,
|
|
899
|
+
[_el$37, _co$7] = _$getNextMarker(_el$36.nextSibling),
|
|
900
|
+
_el$38 = _el$37.nextSibling,
|
|
901
|
+
[_el$39, _co$8] = _$getNextMarker(_el$38.nextSibling),
|
|
902
|
+
_el$43 = _el$33.nextSibling,
|
|
903
|
+
[_el$44, _co$0] = _$getNextMarker(_el$43.nextSibling);
|
|
904
|
+
_$insert(_el$23, () => navButton(previous(), "ti-chevron-left", props.labels.previous), _el$29, _co$4);
|
|
905
|
+
_$insert(_el$23, () => navButton(next(), "ti-chevron-right", props.labels.next), _el$31, _co$5);
|
|
906
|
+
_$insert(_el$25, title);
|
|
907
|
+
_$insert(_el$24, _$createComponent(For, {
|
|
908
|
+
get each() {
|
|
909
|
+
return titleWidths();
|
|
910
|
+
},
|
|
911
|
+
children: candidate => (() => {
|
|
912
|
+
var _el$45 = _$getNextElement(_tmpl$17);
|
|
913
|
+
_$insert(_el$45, candidate);
|
|
914
|
+
return _el$45;
|
|
915
|
+
})()
|
|
916
|
+
}), _el$27, _co$3);
|
|
917
|
+
_$insert(_el$22, _$createComponent(Show, {
|
|
918
|
+
get when() {
|
|
919
|
+
return props.owner.toolbarContent;
|
|
920
|
+
},
|
|
921
|
+
get children() {
|
|
922
|
+
var _el$32 = _$getNextElement(_tmpl$14);
|
|
923
|
+
_$insert(_el$32, () => props.owner.toolbarContent);
|
|
924
|
+
return _el$32;
|
|
925
|
+
}
|
|
926
|
+
}), _el$42, _co$9);
|
|
927
|
+
_$insert(_el$33, todayButton, _el$35, _co$6);
|
|
928
|
+
_$insert(_el$33, _$createComponent(Show, {
|
|
762
929
|
get when() {
|
|
763
930
|
return _$memo(() => !!!props.owner.onViewChange)() && props.owner.getViewHref;
|
|
764
931
|
},
|
|
@@ -784,24 +951,30 @@ const CalendarHeader = props => {
|
|
|
784
951
|
},
|
|
785
952
|
get options() {
|
|
786
953
|
return viewOptions();
|
|
954
|
+
},
|
|
955
|
+
get focusDay() {
|
|
956
|
+
return props.focusDay;
|
|
787
957
|
}
|
|
788
958
|
});
|
|
789
959
|
}
|
|
790
|
-
}), _el$
|
|
791
|
-
_$insert(_el$
|
|
792
|
-
_$insert(_el$
|
|
960
|
+
}), _el$37, _co$7);
|
|
961
|
+
_$insert(_el$33, () => props.owner.toolbarActions, _el$39, _co$8);
|
|
962
|
+
_$insert(_el$22, _$createComponent(Show, {
|
|
793
963
|
get when() {
|
|
794
964
|
return props.owner.navigationPending;
|
|
795
965
|
},
|
|
796
966
|
get children() {
|
|
797
|
-
return _$getNextElement(_tmpl$
|
|
967
|
+
return _$getNextElement(_tmpl$15);
|
|
798
968
|
}
|
|
799
|
-
}), _el$
|
|
800
|
-
return _el$
|
|
969
|
+
}), _el$44, _co$0);
|
|
970
|
+
return _el$22;
|
|
801
971
|
})();
|
|
802
972
|
};
|
|
803
|
-
|
|
973
|
+
|
|
974
|
+
/** The compact month of `mobile-month`: a picker whose days link to their agenda. */
|
|
975
|
+
const MonthPickerView = props => {
|
|
804
976
|
const messages = useUiMessages();
|
|
977
|
+
const calendarMessages = useCalendarMessages();
|
|
805
978
|
const dateConfig = createMemo(() => ownerDateConfig(props.owner));
|
|
806
979
|
const [movePreview, setMovePreview] = createSignal(null);
|
|
807
980
|
const [movingEventId, setMovingEventId] = createSignal("");
|
|
@@ -855,55 +1028,55 @@ const MonthView = props => {
|
|
|
855
1028
|
};
|
|
856
1029
|
onCleanup(() => cancelInteraction?.());
|
|
857
1030
|
return (() => {
|
|
858
|
-
var _el$
|
|
859
|
-
_el$
|
|
860
|
-
_el$
|
|
861
|
-
[_el$
|
|
862
|
-
_el$
|
|
863
|
-
[_el$
|
|
864
|
-
_el$
|
|
865
|
-
[_el$
|
|
866
|
-
_$insert(_el$
|
|
1031
|
+
var _el$46 = _$getNextElement(_tmpl$19),
|
|
1032
|
+
_el$47 = _el$46.firstChild,
|
|
1033
|
+
_el$49 = _el$47.firstChild,
|
|
1034
|
+
[_el$50, _co$1] = _$getNextMarker(_el$49.nextSibling),
|
|
1035
|
+
_el$51 = _el$50.nextSibling,
|
|
1036
|
+
[_el$52, _co$10] = _$getNextMarker(_el$51.nextSibling),
|
|
1037
|
+
_el$53 = _el$47.nextSibling,
|
|
1038
|
+
[_el$54, _co$11] = _$getNextMarker(_el$53.nextSibling);
|
|
1039
|
+
_$insert(_el$47, _$createComponent(Show, {
|
|
867
1040
|
get when() {
|
|
868
1041
|
return props.owner.withWeekNumbers;
|
|
869
1042
|
},
|
|
870
1043
|
get children() {
|
|
871
|
-
var _el$
|
|
872
|
-
_$insert(_el$
|
|
873
|
-
return _el$
|
|
1044
|
+
var _el$48 = _$getNextElement(_tmpl$18);
|
|
1045
|
+
_$insert(_el$48, () => messages().weekShort);
|
|
1046
|
+
return _el$48;
|
|
874
1047
|
}
|
|
875
|
-
}), _el$
|
|
876
|
-
_$insert(_el$
|
|
1048
|
+
}), _el$50, _co$1);
|
|
1049
|
+
_$insert(_el$47, _$createComponent(For, {
|
|
877
1050
|
get each() {
|
|
878
1051
|
return weekdays();
|
|
879
1052
|
},
|
|
880
1053
|
children: day => (() => {
|
|
881
|
-
var _el$
|
|
882
|
-
_$insert(_el$
|
|
883
|
-
return _el$
|
|
1054
|
+
var _el$55 = _$getNextElement(_tmpl$18);
|
|
1055
|
+
_$insert(_el$55, day);
|
|
1056
|
+
return _el$55;
|
|
884
1057
|
})()
|
|
885
|
-
}), _el$
|
|
886
|
-
_$insert(_el$
|
|
1058
|
+
}), _el$52, _co$10);
|
|
1059
|
+
_$insert(_el$46, _$createComponent(For, {
|
|
887
1060
|
get each() {
|
|
888
1061
|
return weeks();
|
|
889
1062
|
},
|
|
890
1063
|
children: week => (() => {
|
|
891
|
-
var _el$
|
|
892
|
-
_el$
|
|
893
|
-
[_el$
|
|
894
|
-
_el$
|
|
895
|
-
[_el$
|
|
896
|
-
_$insert(_el$
|
|
1064
|
+
var _el$56 = _$getNextElement(_tmpl$21),
|
|
1065
|
+
_el$58 = _el$56.firstChild,
|
|
1066
|
+
[_el$59, _co$12] = _$getNextMarker(_el$58.nextSibling),
|
|
1067
|
+
_el$60 = _el$59.nextSibling,
|
|
1068
|
+
[_el$61, _co$13] = _$getNextMarker(_el$60.nextSibling);
|
|
1069
|
+
_$insert(_el$56, _$createComponent(Show, {
|
|
897
1070
|
get when() {
|
|
898
1071
|
return props.owner.withWeekNumbers;
|
|
899
1072
|
},
|
|
900
1073
|
get children() {
|
|
901
|
-
var _el$
|
|
902
|
-
_$insert(_el$
|
|
903
|
-
return _el$
|
|
1074
|
+
var _el$57 = _$getNextElement(_tmpl$20);
|
|
1075
|
+
_$insert(_el$57, () => zonedWeekNumber(week[0], dateConfig()));
|
|
1076
|
+
return _el$57;
|
|
904
1077
|
}
|
|
905
|
-
}), _el$
|
|
906
|
-
_$insert(_el$
|
|
1078
|
+
}), _el$59, _co$12);
|
|
1079
|
+
_$insert(_el$56, _$createComponent(For, {
|
|
907
1080
|
each: week,
|
|
908
1081
|
children: day => {
|
|
909
1082
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
@@ -931,25 +1104,25 @@ const MonthView = props => {
|
|
|
931
1104
|
};
|
|
932
1105
|
});
|
|
933
1106
|
return (() => {
|
|
934
|
-
var _el$
|
|
935
|
-
_el$
|
|
936
|
-
[_el$
|
|
937
|
-
_el$
|
|
938
|
-
_el$
|
|
939
|
-
[_el$
|
|
940
|
-
_el$
|
|
941
|
-
[_el$
|
|
942
|
-
_el$
|
|
943
|
-
_el$
|
|
944
|
-
[_el$
|
|
945
|
-
_el$
|
|
946
|
-
[_el$
|
|
947
|
-
_el$
|
|
948
|
-
[_el$
|
|
949
|
-
_el$
|
|
950
|
-
_$setAttribute(_el$
|
|
951
|
-
_$setAttribute(_el$
|
|
952
|
-
_$insert(_el$
|
|
1107
|
+
var _el$62 = _$getNextElement(_tmpl$24),
|
|
1108
|
+
_el$78 = _el$62.firstChild,
|
|
1109
|
+
[_el$79, _co$19] = _$getNextMarker(_el$78.nextSibling),
|
|
1110
|
+
_el$64 = _el$79.nextSibling,
|
|
1111
|
+
_el$65 = _el$64.firstChild,
|
|
1112
|
+
[_el$66, _co$14] = _$getNextMarker(_el$65.nextSibling),
|
|
1113
|
+
_el$67 = _el$66.nextSibling,
|
|
1114
|
+
[_el$68, _co$15] = _$getNextMarker(_el$67.nextSibling),
|
|
1115
|
+
_el$69 = _el$64.nextSibling,
|
|
1116
|
+
_el$71 = _el$69.firstChild,
|
|
1117
|
+
[_el$72, _co$16] = _$getNextMarker(_el$71.nextSibling),
|
|
1118
|
+
_el$73 = _el$72.nextSibling,
|
|
1119
|
+
[_el$74, _co$17] = _$getNextMarker(_el$73.nextSibling),
|
|
1120
|
+
_el$75 = _el$74.nextSibling,
|
|
1121
|
+
[_el$76, _co$18] = _$getNextMarker(_el$75.nextSibling),
|
|
1122
|
+
_el$77 = _el$69.nextSibling;
|
|
1123
|
+
_$setAttribute(_el$62, "data-calendar-day-key", dayKey);
|
|
1124
|
+
_$setAttribute(_el$62, "data-outside", !sameMonth ? "true" : undefined);
|
|
1125
|
+
_$insert(_el$62, _$createComponent(Show, {
|
|
953
1126
|
get when() {
|
|
954
1127
|
return props.owner.onSlotActivate;
|
|
955
1128
|
},
|
|
@@ -975,8 +1148,8 @@ const MonthView = props => {
|
|
|
975
1148
|
});
|
|
976
1149
|
},
|
|
977
1150
|
get children() {
|
|
978
|
-
var _el$
|
|
979
|
-
_$spread(_el$
|
|
1151
|
+
var _el$63 = _$getNextElement(_tmpl$22);
|
|
1152
|
+
_$spread(_el$63, _$mergeProps({
|
|
980
1153
|
get ["aria-label"]() {
|
|
981
1154
|
return messages().createEventOn({
|
|
982
1155
|
label: dayLabel
|
|
@@ -991,20 +1164,20 @@ const MonthView = props => {
|
|
|
991
1164
|
};
|
|
992
1165
|
}, () => performance.now() < suppressSlotClickUntil, true)), false, false);
|
|
993
1166
|
_$runHydrationEvents();
|
|
994
|
-
return _el$
|
|
1167
|
+
return _el$63;
|
|
995
1168
|
}
|
|
996
|
-
}), _el$
|
|
997
|
-
_$insert(_el$
|
|
1169
|
+
}), _el$79, _co$19);
|
|
1170
|
+
_$insert(_el$64, _$createComponent(Show, {
|
|
998
1171
|
get when() {
|
|
999
1172
|
return props.owner.onSlotActivate && href;
|
|
1000
1173
|
},
|
|
1001
1174
|
get fallback() {
|
|
1002
1175
|
return (() => {
|
|
1003
|
-
var _el$
|
|
1004
|
-
_$setAttribute(_el$
|
|
1005
|
-
_$setAttribute(_el$
|
|
1006
|
-
_$insert(_el$
|
|
1007
|
-
return _el$
|
|
1176
|
+
var _el$80 = _$getNextElement(_tmpl$25);
|
|
1177
|
+
_$setAttribute(_el$80, "data-today", isToday ? "true" : undefined);
|
|
1178
|
+
_$setAttribute(_el$80, "data-outside", !sameMonth ? "true" : undefined);
|
|
1179
|
+
_$insert(_el$80, () => calendar.formatDayNumber(day, dateConfig()));
|
|
1180
|
+
return _el$80;
|
|
1008
1181
|
})();
|
|
1009
1182
|
},
|
|
1010
1183
|
children: dayHref => _$createComponent(CalendarNavigationLink, {
|
|
@@ -1028,40 +1201,40 @@ const MonthView = props => {
|
|
|
1028
1201
|
return calendar.formatDayNumber(day, dateConfig());
|
|
1029
1202
|
}
|
|
1030
1203
|
})
|
|
1031
|
-
}), _el$
|
|
1032
|
-
_$insert(_el$
|
|
1204
|
+
}), _el$66, _co$14);
|
|
1205
|
+
_$insert(_el$64, _$createComponent(Show, {
|
|
1033
1206
|
when: dayBadge,
|
|
1034
1207
|
children: badge => (() => {
|
|
1035
|
-
var _el$
|
|
1036
|
-
_el$
|
|
1037
|
-
[_el$
|
|
1038
|
-
_el$
|
|
1039
|
-
[_el$
|
|
1040
|
-
_$insert(_el$
|
|
1208
|
+
var _el$81 = _$getNextElement(_tmpl$26),
|
|
1209
|
+
_el$82 = _el$81.firstChild,
|
|
1210
|
+
[_el$83, _co$20] = _$getNextMarker(_el$82.nextSibling),
|
|
1211
|
+
_el$84 = _el$83.nextSibling,
|
|
1212
|
+
[_el$85, _co$21] = _$getNextMarker(_el$84.nextSibling);
|
|
1213
|
+
_$insert(_el$81, _$createComponent(Show, {
|
|
1041
1214
|
get when() {
|
|
1042
1215
|
return badge().icon;
|
|
1043
1216
|
},
|
|
1044
1217
|
children: icon => (() => {
|
|
1045
|
-
var _el$
|
|
1046
|
-
_$effect(() => _$className(_el$
|
|
1047
|
-
return _el$
|
|
1218
|
+
var _el$86 = _$getNextElement(_tmpl$11);
|
|
1219
|
+
_$effect(() => _$className(_el$86, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1220
|
+
return _el$86;
|
|
1048
1221
|
})()
|
|
1049
|
-
}), _el$
|
|
1050
|
-
_$insert(_el$
|
|
1051
|
-
return _el$
|
|
1222
|
+
}), _el$83, _co$20);
|
|
1223
|
+
_$insert(_el$81, () => badge().label, _el$85, _co$21);
|
|
1224
|
+
return _el$81;
|
|
1052
1225
|
})()
|
|
1053
|
-
}), _el$
|
|
1054
|
-
_$insert(_el$
|
|
1226
|
+
}), _el$68, _co$15);
|
|
1227
|
+
_$insert(_el$69, _$createComponent(Show, {
|
|
1055
1228
|
get when() {
|
|
1056
1229
|
return eventStack().preview;
|
|
1057
1230
|
},
|
|
1058
1231
|
get children() {
|
|
1059
|
-
var _el$
|
|
1060
|
-
_$insert(_el$
|
|
1061
|
-
return _el$
|
|
1232
|
+
var _el$70 = _$getNextElement(_tmpl$23);
|
|
1233
|
+
_$insert(_el$70, () => props.events.find(event => event.id === eventStack().preview.id)?.title ?? messages().moveEvent);
|
|
1234
|
+
return _el$70;
|
|
1062
1235
|
}
|
|
1063
|
-
}), _el$
|
|
1064
|
-
_$insert(_el$
|
|
1236
|
+
}), _el$72, _co$16);
|
|
1237
|
+
_$insert(_el$69, _$createComponent(For, {
|
|
1065
1238
|
get each() {
|
|
1066
1239
|
return eventStack().visibleEvents;
|
|
1067
1240
|
},
|
|
@@ -1081,8 +1254,8 @@ const MonthView = props => {
|
|
|
1081
1254
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, event, markDragged) : undefined;
|
|
1082
1255
|
}
|
|
1083
1256
|
})
|
|
1084
|
-
}), _el$
|
|
1085
|
-
_$insert(_el$
|
|
1257
|
+
}), _el$74, _co$17);
|
|
1258
|
+
_$insert(_el$69, _$createComponent(Show, {
|
|
1086
1259
|
get when() {
|
|
1087
1260
|
return eventStack().hiddenCount > 0;
|
|
1088
1261
|
},
|
|
@@ -1096,53 +1269,1263 @@ const MonthView = props => {
|
|
|
1096
1269
|
class: "k2b-calendar-month__more"
|
|
1097
1270
|
},
|
|
1098
1271
|
get children() {
|
|
1099
|
-
return
|
|
1272
|
+
return calendarMessages().calendarMoreEvents({
|
|
1273
|
+
count: eventStack().hiddenCount
|
|
1274
|
+
});
|
|
1100
1275
|
}
|
|
1101
1276
|
});
|
|
1102
1277
|
}
|
|
1103
|
-
}), _el$
|
|
1104
|
-
_$insert(_el$
|
|
1278
|
+
}), _el$76, _co$18);
|
|
1279
|
+
_$insert(_el$77, _$createComponent(For, {
|
|
1105
1280
|
get each() {
|
|
1106
1281
|
return events.slice(0, 4);
|
|
1107
1282
|
},
|
|
1108
1283
|
children: event => (() => {
|
|
1109
|
-
var _el$
|
|
1284
|
+
var _el$87 = _$getNextElement(_tmpl$27);
|
|
1110
1285
|
_$effect(_p$ => {
|
|
1111
|
-
var _v$
|
|
1112
|
-
_v$
|
|
1286
|
+
var _v$41 = event.colorHex ? undefined : event.color ?? "blue",
|
|
1287
|
+
_v$42 = event.colorHex ? {
|
|
1113
1288
|
"background-color": event.colorHex
|
|
1114
1289
|
} : undefined;
|
|
1115
|
-
_v$
|
|
1116
|
-
_p$.t = _$style(_el$
|
|
1290
|
+
_v$41 !== _p$.e && _$setAttribute(_el$87, "data-color", _p$.e = _v$41);
|
|
1291
|
+
_p$.t = _$style(_el$87, _v$42, _p$.t);
|
|
1117
1292
|
return _p$;
|
|
1118
1293
|
}, {
|
|
1119
1294
|
e: undefined,
|
|
1120
1295
|
t: undefined
|
|
1121
1296
|
});
|
|
1122
|
-
return _el$
|
|
1297
|
+
return _el$87;
|
|
1123
1298
|
})()
|
|
1124
1299
|
}));
|
|
1125
|
-
_$effect(() => _$setAttribute(_el$
|
|
1126
|
-
return _el$
|
|
1300
|
+
_$effect(() => _$setAttribute(_el$62, "data-drop-preview", movePreview()?.start && calendar.formatDateKey(movePreview().start, dateConfig()) === dayKey ? "true" : undefined));
|
|
1301
|
+
return _el$62;
|
|
1127
1302
|
})();
|
|
1128
1303
|
}
|
|
1129
|
-
}), _el$
|
|
1130
|
-
_$effect(() => _$setAttribute(_el$
|
|
1131
|
-
return _el$
|
|
1304
|
+
}), _el$61, _co$13);
|
|
1305
|
+
_$effect(() => _$setAttribute(_el$56, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
1306
|
+
return _el$56;
|
|
1132
1307
|
})()
|
|
1133
|
-
}), _el$
|
|
1308
|
+
}), _el$54, _co$11);
|
|
1134
1309
|
_$effect(_p$ => {
|
|
1135
|
-
var _v$
|
|
1136
|
-
_v$
|
|
1137
|
-
_v$
|
|
1138
|
-
_v$
|
|
1310
|
+
var _v$39 = `auto repeat(${weeks().length}, ${props.compact ? "minmax(2.75rem, auto)" : "minmax(5rem, 1fr)"})`,
|
|
1311
|
+
_v$40 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
1312
|
+
_v$39 !== _p$.e && _$setStyleProperty(_el$46, "grid-template-rows", _p$.e = _v$39);
|
|
1313
|
+
_v$40 !== _p$.t && _$setAttribute(_el$47, "data-week-numbers", _p$.t = _v$40);
|
|
1139
1314
|
return _p$;
|
|
1140
1315
|
}, {
|
|
1141
1316
|
e: undefined,
|
|
1142
1317
|
t: undefined
|
|
1143
1318
|
});
|
|
1144
|
-
return _el$
|
|
1319
|
+
return _el$46;
|
|
1320
|
+
})();
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
/** One entry of the month grid: its whole range, and the days it covers as `YYYY-MM-DD` keys. */
|
|
1324
|
+
|
|
1325
|
+
/** Lane height and gap of the month entries, in rem; the stylesheet reads both from the grid's custom properties. */
|
|
1326
|
+
const MONTH_LANE_REM = 1.25;
|
|
1327
|
+
const MONTH_LANE_GAP_REM = 0.125;
|
|
1328
|
+
/** Rows drawn before the browser has measured the cells, as in the server response. */
|
|
1329
|
+
const MONTH_DEFAULT_LANES = 3;
|
|
1330
|
+
/** Room a bar keeps beside its title and date hint: padding, torn edge, gap, and an icon such as a task box or a flag. */
|
|
1331
|
+
const MONTH_HINT_SLACK_REM = 2.25;
|
|
1332
|
+
const dayKeyNumber = key => {
|
|
1333
|
+
const [year = "1970", month = "1", day = "1"] = key.split("-");
|
|
1334
|
+
return Date.UTC(Number(year), Number(month) - 1, Number(day)) / 86_400_000;
|
|
1335
|
+
};
|
|
1336
|
+
const orderedSelection = (anchor, focus) => anchor <= focus ? {
|
|
1337
|
+
first: anchor,
|
|
1338
|
+
last: focus
|
|
1339
|
+
} : {
|
|
1340
|
+
first: focus,
|
|
1341
|
+
last: anchor
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
/** Groups the per-day pieces of the events back into one entry each: bars first, then the others by time. */
|
|
1345
|
+
const monthItems = events => {
|
|
1346
|
+
const items = new Map();
|
|
1347
|
+
for (const piece of events) {
|
|
1348
|
+
const key = `${piece.id}\u0000${piece.sourceStartDate.getTime()}`;
|
|
1349
|
+
const item = items.get(key);
|
|
1350
|
+
if (item) {
|
|
1351
|
+
if (piece.dayKey < item.firstKey) item.firstKey = piece.dayKey;
|
|
1352
|
+
if (piece.dayKey > item.lastKey) item.lastKey = piece.dayKey;
|
|
1353
|
+
item.days.set(piece.dayKey, piece);
|
|
1354
|
+
continue;
|
|
1355
|
+
}
|
|
1356
|
+
items.set(key, {
|
|
1357
|
+
key,
|
|
1358
|
+
event: {
|
|
1359
|
+
...piece,
|
|
1360
|
+
startDate: piece.sourceStartDate,
|
|
1361
|
+
endDate: piece.sourceEndDate
|
|
1362
|
+
},
|
|
1363
|
+
firstKey: piece.dayKey,
|
|
1364
|
+
lastKey: piece.dayKey,
|
|
1365
|
+
bar: false,
|
|
1366
|
+
days: new Map([[piece.dayKey, piece]])
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
for (const item of items.values()) item.bar = item.firstKey !== item.lastKey || Boolean(item.event.allDay && item.event.display !== "marker");
|
|
1370
|
+
return [...items.values()].sort((left, right) => Number(right.bar) - Number(left.bar) || left.event.sourceStartDate.getTime() - right.event.sourceStartDate.getTime() || left.event.title.localeCompare(right.event.title));
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
/** Places a calendar popover below its anchor when there is room and above it otherwise, inside the viewport. */
|
|
1374
|
+
const placeCalendarPopover = (anchor, popover) => {
|
|
1375
|
+
const margin = 8;
|
|
1376
|
+
const gap = 4;
|
|
1377
|
+
const rect = anchor.getBoundingClientRect();
|
|
1378
|
+
const width = Math.min(popover.offsetWidth || 288, window.innerWidth - margin * 2);
|
|
1379
|
+
const height = popover.offsetHeight;
|
|
1380
|
+
const left = Math.max(margin, Math.min(rect.left, window.innerWidth - width - margin));
|
|
1381
|
+
const roomBelow = window.innerHeight - rect.bottom - gap - margin;
|
|
1382
|
+
const above = height > roomBelow && rect.top - gap - margin > roomBelow;
|
|
1383
|
+
const top = above ? Math.max(margin, rect.top - height - gap) : Math.min(rect.bottom + gap, window.innerHeight - height - margin);
|
|
1384
|
+
popover.style.left = `${left}px`;
|
|
1385
|
+
popover.style.top = `${Math.max(margin, top)}px`;
|
|
1386
|
+
};
|
|
1387
|
+
let measureContext;
|
|
1388
|
+
/** The width of a text in a font, from a canvas, so a bar can tell whether its title leaves room for a date hint. */
|
|
1389
|
+
const textWidth = (text, font) => {
|
|
1390
|
+
measureContext ??= typeof document === "undefined" ? null : document.createElement("canvas").getContext("2d");
|
|
1391
|
+
if (!measureContext) return Number.POSITIVE_INFINITY;
|
|
1392
|
+
measureContext.font = font;
|
|
1393
|
+
return measureContext.measureText(text).width;
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
/** Follows a calendar link the way the calendar's own links do: through the host's navigation when it has one. */
|
|
1397
|
+
const followCalendarHref = (owner, href) => {
|
|
1398
|
+
if (owner.onNavigateHref) owner.onNavigateHref(href);else window.location.assign(href);
|
|
1399
|
+
};
|
|
1400
|
+
const PRINTABLE_KEY = /^.$/u;
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* The month grid. A click selects a day and never navigates, a drag or Shift selects a range, and the arrow keys move
|
|
1404
|
+
* the selection. The quick create opens at the selection: quietly after a click, with the focus after a drag, a
|
|
1405
|
+
* double-click, Enter, or N. Every event is one bar per week row in a lane it keeps on each of its days, and each
|
|
1406
|
+
* cell shows as many entries as its height holds.
|
|
1407
|
+
*/
|
|
1408
|
+
const MonthView = props => {
|
|
1409
|
+
const messages = useUiMessages();
|
|
1410
|
+
const calendarMessages = useCalendarMessages();
|
|
1411
|
+
const dateConfig = createMemo(() => ownerDateConfig(props.owner));
|
|
1412
|
+
// The shown month and its grid change only with the month, so a refresh of the same month keeps every cell and its
|
|
1413
|
+
// focus.
|
|
1414
|
+
const month = createMemo(() => zonedYearMonth(props.date, dateConfig()), undefined, {
|
|
1415
|
+
equals: (previous, next) => previous.year === next.year && previous.month === next.month
|
|
1416
|
+
});
|
|
1417
|
+
const weeks = createMemo(() => calendar.getMonthGrid(month().year, month().month, dateConfig()).map(week => week.map(day => ({
|
|
1418
|
+
day,
|
|
1419
|
+
key: calendar.formatDateKey(day, dateConfig())
|
|
1420
|
+
}))), undefined, {
|
|
1421
|
+
equals: (previous, next) => previous.map(week => week[0]?.key).join() === next.map(week => week[0]?.key).join()
|
|
1422
|
+
});
|
|
1423
|
+
const weekdays = createMemo(() => calendar.weekdays(dateConfig()));
|
|
1424
|
+
const todayKey = createMemo(() => calendar.formatDateKey(props.now, dateConfig()));
|
|
1425
|
+
const items = createMemo(() => monthItems(props.events));
|
|
1426
|
+
const weekLayouts = createMemo(() => weeks().map(week => layoutMonthWeek(week.map(entry => entry.key), items().map(item => ({
|
|
1427
|
+
item,
|
|
1428
|
+
firstKey: item.firstKey,
|
|
1429
|
+
lastKey: item.lastKey,
|
|
1430
|
+
bar: item.bar
|
|
1431
|
+
})))));
|
|
1432
|
+
const [capacities, setCapacities] = createSignal([]);
|
|
1433
|
+
const [cellWidth, setCellWidth] = createSignal(0);
|
|
1434
|
+
const [barFont, setBarFont] = createSignal("");
|
|
1435
|
+
const [anchorKey, setAnchorKey] = createSignal(null);
|
|
1436
|
+
const [focusKey, setFocusKey] = createSignal(null);
|
|
1437
|
+
const [popover, setPopover] = createSignal(null);
|
|
1438
|
+
/** Whether the quick create holds the focus; until then the grid keeps it. */
|
|
1439
|
+
const [createActive, setCreateActive] = createSignal(false);
|
|
1440
|
+
const [linkedItem, setLinkedItem] = createSignal("");
|
|
1441
|
+
const [movePreview, setMovePreview] = createSignal(null);
|
|
1442
|
+
const [movingEventId, setMovingEventId] = createSignal("");
|
|
1443
|
+
const cells = new Map();
|
|
1444
|
+
let popoverElement;
|
|
1445
|
+
let cancelInteraction;
|
|
1446
|
+
let suppressClickUntil = 0;
|
|
1447
|
+
let lastPointer = "mouse";
|
|
1448
|
+
let menuKey = null;
|
|
1449
|
+
/** The day to select once paging with Page Up or Page Down has shown its month. */
|
|
1450
|
+
let pendingKey = null;
|
|
1451
|
+
const selection = createMemo(() => {
|
|
1452
|
+
const anchor = anchorKey();
|
|
1453
|
+
const focus = focusKey();
|
|
1454
|
+
return anchor && focus ? orderedSelection(anchor, focus) : null;
|
|
1455
|
+
});
|
|
1456
|
+
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
1457
|
+
const rangeOf = range => ({
|
|
1458
|
+
start: parseKey(range.first),
|
|
1459
|
+
end: calendar.addDays(parseKey(range.last), 1, dateConfig()),
|
|
1460
|
+
allDay: true
|
|
1461
|
+
});
|
|
1462
|
+
const visibleKeys = createMemo(() => weeks().flatMap(week => week.map(entry => entry.key)));
|
|
1463
|
+
const rovingKey = createMemo(() => {
|
|
1464
|
+
const keys = visibleKeys();
|
|
1465
|
+
const focus = focusKey();
|
|
1466
|
+
if (focus && keys.includes(focus)) return focus;
|
|
1467
|
+
if (keys.includes(todayKey())) return todayKey();
|
|
1468
|
+
return calendar.formatDateKey(zonedMonthDate(month().year, month().month, dateConfig()), dateConfig());
|
|
1469
|
+
});
|
|
1470
|
+
const dropRange = createMemo(() => {
|
|
1471
|
+
const preview = movePreview();
|
|
1472
|
+
if (!preview) return null;
|
|
1473
|
+
const keys = previewSegments(preview, visibleKeys().map(parseKey), dateConfig()).map(piece => piece.dayKey);
|
|
1474
|
+
if (keys.length === 0) return null;
|
|
1475
|
+
keys.sort();
|
|
1476
|
+
return {
|
|
1477
|
+
first: keys[0],
|
|
1478
|
+
last: keys[keys.length - 1]
|
|
1479
|
+
};
|
|
1480
|
+
});
|
|
1481
|
+
const within = (range, key) => Boolean(range && key >= range.first && key <= range.last);
|
|
1482
|
+
/** Where a day sits in the selection: alone, at its start or end, or in between. */
|
|
1483
|
+
const selectionPart = key => {
|
|
1484
|
+
const range = selection();
|
|
1485
|
+
if (!range || !within(range, key)) return undefined;
|
|
1486
|
+
if (range.first === range.last) return "single";
|
|
1487
|
+
return key === range.first ? "start" : key === range.last ? "end" : "middle";
|
|
1488
|
+
};
|
|
1489
|
+
const select = (anchor, focus = anchor) => {
|
|
1490
|
+
setAnchorKey(anchor);
|
|
1491
|
+
setFocusKey(focus);
|
|
1492
|
+
};
|
|
1493
|
+
// The host learns every change of the selected days, and a new month starts without a selection. The selection
|
|
1494
|
+
// goes with the view, so switching to another view reports that nothing is selected.
|
|
1495
|
+
createEffect(on(selection, range => props.owner.onSelectionChange?.(range ? rangeOf(range) : null), {
|
|
1496
|
+
defer: true
|
|
1497
|
+
}));
|
|
1498
|
+
onCleanup(() => {
|
|
1499
|
+
if (untrack(selection)) props.owner.onSelectionChange?.(null);
|
|
1500
|
+
});
|
|
1501
|
+
createEffect(on(selection, range => props.onFocusDay?.(range ? parseKey(range.first) : null)));
|
|
1502
|
+
createEffect(on(month, () => {
|
|
1503
|
+
setPopover(null);
|
|
1504
|
+
const key = pendingKey;
|
|
1505
|
+
pendingKey = null;
|
|
1506
|
+
if (key && visibleKeys().includes(key)) {
|
|
1507
|
+
select(key);
|
|
1508
|
+
queueMicrotask(() => focusCell(key));
|
|
1509
|
+
} else select(null);
|
|
1510
|
+
}, {
|
|
1511
|
+
defer: true
|
|
1512
|
+
}));
|
|
1513
|
+
const dayLabel = day => day.toLocaleDateString(dateConfig().locale ?? "en", {
|
|
1514
|
+
weekday: "long",
|
|
1515
|
+
year: "numeric",
|
|
1516
|
+
month: "long",
|
|
1517
|
+
day: "numeric",
|
|
1518
|
+
timeZone: dateConfig().timeZone
|
|
1519
|
+
});
|
|
1520
|
+
const shortDayLabel = (key, withMonth = true) => parseKey(key).toLocaleDateString(dateConfig().locale ?? "en", {
|
|
1521
|
+
day: "numeric",
|
|
1522
|
+
...(withMonth ? {
|
|
1523
|
+
month: "short"
|
|
1524
|
+
} : {}),
|
|
1525
|
+
timeZone: dateConfig().timeZone
|
|
1526
|
+
});
|
|
1527
|
+
const monthDayLabel = (date, withTime) => date.toLocaleString(dateConfig().locale ?? "en", {
|
|
1528
|
+
month: "long",
|
|
1529
|
+
day: "numeric",
|
|
1530
|
+
...(withTime ? {
|
|
1531
|
+
hour: "2-digit",
|
|
1532
|
+
minute: "2-digit"
|
|
1533
|
+
} : {}),
|
|
1534
|
+
timeZone: dateConfig().timeZone
|
|
1535
|
+
});
|
|
1536
|
+
/** A long event names the days it spans; a one-day event keeps the chip's own title and time. */
|
|
1537
|
+
const itemLabel = item => {
|
|
1538
|
+
if (item.firstKey === item.lastKey) return undefined;
|
|
1539
|
+
const allDay = Boolean(item.event.allDay);
|
|
1540
|
+
return messages().calendarEventTime({
|
|
1541
|
+
title: item.event.title,
|
|
1542
|
+
start: monthDayLabel(allDay ? parseKey(item.firstKey) : item.event.sourceStartDate, !allDay),
|
|
1543
|
+
end: monthDayLabel(allDay ? parseKey(item.lastKey) : item.event.sourceEndDate, !allDay)
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1546
|
+
/** The start time before the title of a one-day entry; bars and all-day entries show none. */
|
|
1547
|
+
const leadingTime = item => item.bar || item.event.allDay ? undefined : formatTime(item.event.sourceStartDate, dateConfig());
|
|
1548
|
+
/** The day at a torn end of a bar, with its month when that day lies outside the shown month. */
|
|
1549
|
+
const hintDate = target => ({
|
|
1550
|
+
day: Number(target.slice(8, 10)),
|
|
1551
|
+
month: Number(target.slice(0, 4)) === month().year && Number(target.slice(5, 7)) === month().month + 1 ? undefined : parseKey(target).toLocaleDateString(dateConfig().locale ?? "en", {
|
|
1552
|
+
month: "short",
|
|
1553
|
+
timeZone: dateConfig().timeZone
|
|
1554
|
+
}).replace(/\.$/, "")
|
|
1555
|
+
});
|
|
1556
|
+
const selectionHeading = range => {
|
|
1557
|
+
if (range.first === range.last) return parseKey(range.first).toLocaleDateString(dateConfig().locale ?? "en", {
|
|
1558
|
+
weekday: "long",
|
|
1559
|
+
month: "long",
|
|
1560
|
+
day: "numeric",
|
|
1561
|
+
timeZone: dateConfig().timeZone
|
|
1562
|
+
});
|
|
1563
|
+
const days = dayKeyNumber(range.last) - dayKeyNumber(range.first) + 1;
|
|
1564
|
+
return calendarMessages().calendarSelectedDays({
|
|
1565
|
+
start: shortDayLabel(range.first),
|
|
1566
|
+
end: shortDayLabel(range.last),
|
|
1567
|
+
count: days
|
|
1568
|
+
});
|
|
1569
|
+
};
|
|
1570
|
+
const viewAvailable = view => !props.owner.views || props.owner.views.includes(view);
|
|
1571
|
+
const viewHref = (key, view) => viewAvailable(view) ? props.owner.getDateHref?.(parseKey(key), view) : undefined;
|
|
1572
|
+
/** Whether the calendar can open another view at a day: through a link, or through the host's date change. */
|
|
1573
|
+
const canOpenView = view => viewAvailable(view) && Boolean(props.owner.getDateHref || props.owner.onDateChange);
|
|
1574
|
+
const openView = (key, view) => {
|
|
1575
|
+
const href = viewHref(key, view);
|
|
1576
|
+
if (href) followCalendarHref(props.owner, href);else openViewAt(props.owner, parseKey(key), view);
|
|
1577
|
+
};
|
|
1578
|
+
/** The calendar's own entries of the day menu, Open day and Open week, need no application entries. */
|
|
1579
|
+
const hasMenu = () => Boolean(props.owner.selectionMenu) || canOpenView("day") || canOpenView("week");
|
|
1580
|
+
|
|
1581
|
+
/** The day cell under a point, from the cells' boxes: a bar lies over days that are not its parent. */
|
|
1582
|
+
const dayKeyAtPoint = (clientX, clientY) => {
|
|
1583
|
+
for (const [key, cell] of cells) {
|
|
1584
|
+
if (!cell.isConnected) continue;
|
|
1585
|
+
const rect = cell.getBoundingClientRect();
|
|
1586
|
+
if (clientX >= rect.left && clientX < rect.right && clientY >= rect.top && clientY < rect.bottom) return key;
|
|
1587
|
+
}
|
|
1588
|
+
return null;
|
|
1589
|
+
};
|
|
1590
|
+
const focusCell = key => cells.get(key)?.focus({
|
|
1591
|
+
preventScroll: true
|
|
1592
|
+
});
|
|
1593
|
+
const closePopover = (restoreFocus = true) => {
|
|
1594
|
+
if (!popover()) return;
|
|
1595
|
+
setPopover(null);
|
|
1596
|
+
setCreateActive(false);
|
|
1597
|
+
if (restoreFocus) focusCell(rovingKey());
|
|
1598
|
+
};
|
|
1599
|
+
const popoverFocusable = () => popoverElement?.querySelector("input,textarea,select,button,a[href],[tabindex]:not([tabindex='-1'])") ?? null;
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* Opens the quick create at the selection. Quietly, it only shows beside the grid, which keeps the focus until the
|
|
1603
|
+
* person types or tabs into it; otherwise it takes the focus at once.
|
|
1604
|
+
*/
|
|
1605
|
+
const openCreate = (range, options) => {
|
|
1606
|
+
if (!props.owner.renderQuickCreate) return false;
|
|
1607
|
+
const anchor = cells.get(focusKey() && within(range, focusKey()) ? focusKey() : range.last);
|
|
1608
|
+
if (!anchor) return false;
|
|
1609
|
+
setCreateActive(options.active);
|
|
1610
|
+
setPopover({
|
|
1611
|
+
kind: "create",
|
|
1612
|
+
range,
|
|
1613
|
+
anchor,
|
|
1614
|
+
create: options.create
|
|
1615
|
+
});
|
|
1616
|
+
return true;
|
|
1617
|
+
};
|
|
1618
|
+
const activateCreate = () => {
|
|
1619
|
+
if (popover()?.kind !== "create") return false;
|
|
1620
|
+
setCreateActive(true);
|
|
1621
|
+
popoverFocusable()?.focus();
|
|
1622
|
+
return true;
|
|
1623
|
+
};
|
|
1624
|
+
/** Enter, a double-click, and N create on the selection, with the quick create or the host's own create action. */
|
|
1625
|
+
const createOnSelection = () => {
|
|
1626
|
+
const range = selection();
|
|
1627
|
+
if (!range) return;
|
|
1628
|
+
if (openCreate(range, {
|
|
1629
|
+
active: true
|
|
1630
|
+
})) return;
|
|
1631
|
+
if (props.owner.onSlotActivate) props.owner.onSlotActivate(rangeOf(range));
|
|
1632
|
+
};
|
|
1633
|
+
const openDayList = key => {
|
|
1634
|
+
const anchor = cells.get(key);
|
|
1635
|
+
if (!anchor) return;
|
|
1636
|
+
setCreateActive(true);
|
|
1637
|
+
setPopover({
|
|
1638
|
+
kind: "day",
|
|
1639
|
+
dayKey: key,
|
|
1640
|
+
anchor
|
|
1641
|
+
});
|
|
1642
|
+
};
|
|
1643
|
+
/** A quiet quick create follows the selection; any other popover closes when the selection changes. */
|
|
1644
|
+
const followSelection = () => {
|
|
1645
|
+
const current = popover();
|
|
1646
|
+
const range = selection();
|
|
1647
|
+
if (!current) return;
|
|
1648
|
+
if (current.kind === "create" && !createActive() && range) openCreate(range, {
|
|
1649
|
+
active: false
|
|
1650
|
+
});else closePopover(false);
|
|
1651
|
+
};
|
|
1652
|
+
const pageTo = target => {
|
|
1653
|
+
const date = parseKey(target);
|
|
1654
|
+
const href = props.owner.getDateHref?.(date, "month");
|
|
1655
|
+
// Only a month that is on its way may select the day, so a host that cannot page never leaves one behind.
|
|
1656
|
+
if (props.owner.onDateChange) {
|
|
1657
|
+
pendingKey = target;
|
|
1658
|
+
props.owner.onDateChange(date, "month");
|
|
1659
|
+
} else if (href) {
|
|
1660
|
+
pendingKey = target;
|
|
1661
|
+
followCalendarHref(props.owner, href);
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
const moveFocus = (key, extend) => {
|
|
1665
|
+
if (!visibleKeys().includes(key)) {
|
|
1666
|
+
pageTo(key);
|
|
1667
|
+
return;
|
|
1668
|
+
}
|
|
1669
|
+
if (extend) select(anchorKey() ?? focusKey() ?? key, key);else select(key);
|
|
1670
|
+
focusCell(key);
|
|
1671
|
+
followSelection();
|
|
1672
|
+
};
|
|
1673
|
+
const onCellKeyDown = (event, key) => {
|
|
1674
|
+
if (event.target !== event.currentTarget || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
1675
|
+
const current = popover();
|
|
1676
|
+
const quiet = current?.kind === "create" && !createActive();
|
|
1677
|
+
// The quiet quick create takes over once the person types or tabs into it. Space stays the grid's key for the day
|
|
1678
|
+
// list; N is a title's first letter like any other, as the quick create it would open is already there.
|
|
1679
|
+
if (quiet && (event.key === "Tab" && !event.shiftKey || PRINTABLE_KEY.test(event.key) && event.key !== " ")) {
|
|
1680
|
+
const field = popoverFocusable();
|
|
1681
|
+
if (field) {
|
|
1682
|
+
if (event.key === "Tab") event.preventDefault();
|
|
1683
|
+
setCreateActive(true);
|
|
1684
|
+
field.focus();
|
|
1685
|
+
return;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
const day = parseKey(key);
|
|
1689
|
+
const shift = days => calendar.formatDateKey(calendar.addDays(day, days, dateConfig()), dateConfig());
|
|
1690
|
+
const weekday = (dayKeyNumber(key) - dayKeyNumber(calendar.formatDateKey(calendar.startOfWeek(day, dateConfig()), dateConfig()))) % 7;
|
|
1691
|
+
const target = event.key === "ArrowLeft" ? shift(-1) : event.key === "ArrowRight" ? shift(1) : event.key === "ArrowUp" ? shift(-7) : event.key === "ArrowDown" ? shift(7) : event.key === "Home" ? shift(-weekday) : event.key === "End" ? shift(6 - weekday) : null;
|
|
1692
|
+
if (target) {
|
|
1693
|
+
event.preventDefault();
|
|
1694
|
+
moveFocus(target, event.shiftKey);
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
if (event.key === "PageUp" || event.key === "PageDown") {
|
|
1698
|
+
event.preventDefault();
|
|
1699
|
+
pageTo(calendar.formatDateKey(addMonthsClamped(day, event.key === "PageUp" ? -1 : 1, dateConfig()), dateConfig()));
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
if (event.key === "Enter" || (event.key === "n" || event.key === "N") && !event.shiftKey) {
|
|
1703
|
+
event.preventDefault();
|
|
1704
|
+
if (!within(selection(), key)) select(key);
|
|
1705
|
+
createOnSelection();
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
if (event.key === " ") {
|
|
1709
|
+
event.preventDefault();
|
|
1710
|
+
if (!within(selection(), key)) select(key);
|
|
1711
|
+
openDayList(key);
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
if (event.key === "Escape") {
|
|
1715
|
+
if (current) closePopover(false);else if (selection()) select(null);else return;
|
|
1716
|
+
event.preventDefault();
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
// The keyboard opens the day's menu where the day is, as a right-click there would.
|
|
1720
|
+
if (hasMenu() && (event.key === "ContextMenu" || event.shiftKey && event.key === "F10")) {
|
|
1721
|
+
event.preventDefault();
|
|
1722
|
+
event.stopPropagation();
|
|
1723
|
+
menuKey = key;
|
|
1724
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
1725
|
+
event.currentTarget?.dispatchEvent(new MouseEvent("contextmenu", {
|
|
1726
|
+
bubbles: true,
|
|
1727
|
+
cancelable: true,
|
|
1728
|
+
clientX: rect.left + 12,
|
|
1729
|
+
clientY: rect.top + 12
|
|
1730
|
+
}));
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
const fromControl = event => event.target instanceof Element && Boolean(event.target.closest("a,button,[data-calendar-event],.k2b-calendar-month__lanes > *"));
|
|
1734
|
+
const onCellClick = (event, key) => {
|
|
1735
|
+
if (fromControl(event) || performance.now() < suppressClickUntil) return;
|
|
1736
|
+
// A second tap on the one selected day opens the quick create, as a double-click does with a mouse.
|
|
1737
|
+
if (lastPointer === "touch") {
|
|
1738
|
+
const range = selection();
|
|
1739
|
+
if (range && range.first === key && range.last === key && openCreate(range, {
|
|
1740
|
+
active: true
|
|
1741
|
+
})) return;
|
|
1742
|
+
select(key);
|
|
1743
|
+
closePopover(false);
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
if (event.shiftKey && anchorKey()) select(anchorKey(), key);else select(key);
|
|
1747
|
+
focusCell(key);
|
|
1748
|
+
const range = selection();
|
|
1749
|
+
if (range) openCreate(range, {
|
|
1750
|
+
active: false
|
|
1751
|
+
});
|
|
1752
|
+
};
|
|
1753
|
+
const onCellDoubleClick = (event, key) => {
|
|
1754
|
+
if (fromControl(event) || lastPointer === "touch") return;
|
|
1755
|
+
event.preventDefault();
|
|
1756
|
+
if (!within(selection(), key)) select(key);
|
|
1757
|
+
if (popover()?.kind === "create") activateCreate();else createOnSelection();
|
|
1758
|
+
};
|
|
1759
|
+
/** The day under the pointer: a bar that spans several days sits in the cell of its first day. */
|
|
1760
|
+
const pressedKey = (event, key) => dayKeyAtPoint(event.clientX, event.clientY) ?? key;
|
|
1761
|
+
const onCellPointerDown = (event, key) => {
|
|
1762
|
+
lastPointer = event.pointerType;
|
|
1763
|
+
// The menu acts on the pressed day, or on the selection when the press is inside it.
|
|
1764
|
+
menuKey = pressedKey(event, key);
|
|
1765
|
+
if (event.pointerType !== "mouse" || event.button !== 0 || event.shiftKey || fromControl(event)) return;
|
|
1766
|
+
cancelInteraction?.();
|
|
1767
|
+
cancelInteraction = startCalendarPointerSession({
|
|
1768
|
+
event,
|
|
1769
|
+
resolve: (clientX, clientY) => dayKeyAtPoint(clientX, clientY),
|
|
1770
|
+
onActivate: () => {
|
|
1771
|
+
suppressClickUntil = performance.now() + 400;
|
|
1772
|
+
closePopover(false);
|
|
1773
|
+
select(key);
|
|
1774
|
+
},
|
|
1775
|
+
onPreview: current => select(key, current),
|
|
1776
|
+
onCommit: current => {
|
|
1777
|
+
select(key, current);
|
|
1778
|
+
focusCell(current);
|
|
1779
|
+
const range = orderedSelection(key, current);
|
|
1780
|
+
openCreate(range, {
|
|
1781
|
+
active: range.first !== range.last
|
|
1782
|
+
});
|
|
1783
|
+
},
|
|
1784
|
+
onCancel: () => select(key)
|
|
1785
|
+
});
|
|
1786
|
+
};
|
|
1787
|
+
const onMenuOpen = () => {
|
|
1788
|
+
closePopover(false);
|
|
1789
|
+
const key = menuKey;
|
|
1790
|
+
if (key && !within(selection(), key)) select(key);
|
|
1791
|
+
};
|
|
1792
|
+
// Until a day is selected, the menu acts on the day that takes focus, so it is never empty.
|
|
1793
|
+
const menuItems = createMemo(() => {
|
|
1794
|
+
if (!hasMenu()) return [];
|
|
1795
|
+
const range = selection() ?? {
|
|
1796
|
+
first: rovingKey(),
|
|
1797
|
+
last: rovingKey()
|
|
1798
|
+
};
|
|
1799
|
+
const own = props.owner.selectionMenu?.(rangeOf(range), {
|
|
1800
|
+
quickCreate: create => {
|
|
1801
|
+
select(range.first, range.last);
|
|
1802
|
+
if (!openCreate(range, {
|
|
1803
|
+
active: true,
|
|
1804
|
+
create
|
|
1805
|
+
})) props.owner.onSlotActivate?.(rangeOf(range));
|
|
1806
|
+
}
|
|
1807
|
+
}) ?? [];
|
|
1808
|
+
const actions = own.filter(item => !("items" in item));
|
|
1809
|
+
const sections = own.filter(item => "items" in item);
|
|
1810
|
+
const navigation = [...(canOpenView("day") ? [{
|
|
1811
|
+
label: calendarMessages().calendarOpenDay,
|
|
1812
|
+
icon: "ti ti-zoom-in",
|
|
1813
|
+
action: () => openView(range.first, "day")
|
|
1814
|
+
}] : []), ...(canOpenView("week") ? [{
|
|
1815
|
+
label: calendarMessages().calendarOpenWeek,
|
|
1816
|
+
icon: "ti ti-calendar-week",
|
|
1817
|
+
action: () => openView(range.first, "week")
|
|
1818
|
+
}] : []), ...(range.first !== range.last ? [{
|
|
1819
|
+
label: calendarMessages().calendarClearSelection,
|
|
1820
|
+
icon: "ti ti-x",
|
|
1821
|
+
action: () => select(null)
|
|
1822
|
+
}] : [])];
|
|
1823
|
+
const groups = [{
|
|
1824
|
+
items: actions
|
|
1825
|
+
}, ...sections, {
|
|
1826
|
+
items: navigation
|
|
1827
|
+
}].filter(section => section.items.length > 0);
|
|
1828
|
+
// The first group names the days the menu acts on, also when the calendar's own entries are all it has.
|
|
1829
|
+
const [first, ...rest] = groups;
|
|
1830
|
+
return first && !first.sectionLabel ? [{
|
|
1831
|
+
...first,
|
|
1832
|
+
sectionLabel: selectionHeading(range)
|
|
1833
|
+
}, ...rest] : groups;
|
|
1834
|
+
});
|
|
1835
|
+
const clearMove = () => {
|
|
1836
|
+
setMovePreview(null);
|
|
1837
|
+
setMovingEventId("");
|
|
1838
|
+
};
|
|
1839
|
+
const startMove = (pointerEvent, item, markDragged) => {
|
|
1840
|
+
if (!props.owner.onEventDrop) return;
|
|
1841
|
+
const event = item.event;
|
|
1842
|
+
const grabbed = dayKeyAtPoint(pointerEvent.clientX, pointerEvent.clientY) ?? item.firstKey;
|
|
1843
|
+
const firstDay = startOfDay(event.sourceStartDate, dateConfig());
|
|
1844
|
+
cancelInteraction?.();
|
|
1845
|
+
cancelInteraction = startCalendarPointerSession({
|
|
1846
|
+
event: pointerEvent,
|
|
1847
|
+
resolve: (clientX, clientY) => {
|
|
1848
|
+
const key = dayKeyAtPoint(clientX, clientY);
|
|
1849
|
+
if (!key) return null;
|
|
1850
|
+
// The event moves by as many days as the pointer, wherever on the bar it was grabbed.
|
|
1851
|
+
const day = calendar.addDays(firstDay, dayKeyNumber(key) - dayKeyNumber(grabbed), dateConfig());
|
|
1852
|
+
return {
|
|
1853
|
+
id: event.id,
|
|
1854
|
+
title: event.title,
|
|
1855
|
+
...moveEventToDay(event, day, dateConfig())
|
|
1856
|
+
};
|
|
1857
|
+
},
|
|
1858
|
+
onActivate: () => {
|
|
1859
|
+
markDragged();
|
|
1860
|
+
suppressClickUntil = performance.now() + 400;
|
|
1861
|
+
closePopover(false);
|
|
1862
|
+
setMovingEventId(event.id);
|
|
1863
|
+
},
|
|
1864
|
+
onPreview: setMovePreview,
|
|
1865
|
+
onCommit: next => {
|
|
1866
|
+
clearMove();
|
|
1867
|
+
if (eventTimeChanged(event, next)) props.owner.onEventDrop?.(event, next);
|
|
1868
|
+
},
|
|
1869
|
+
onCancel: clearMove
|
|
1870
|
+
});
|
|
1871
|
+
};
|
|
1872
|
+
|
|
1873
|
+
// Each week row measures the room below its day numbers; the rows only resize with the grid, never with content.
|
|
1874
|
+
let observer;
|
|
1875
|
+
const lanesOf = new WeakMap();
|
|
1876
|
+
const measure = (element, week) => {
|
|
1877
|
+
const style = getComputedStyle(element);
|
|
1878
|
+
const rootSize = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
1879
|
+
const capacity = monthLaneCapacity(element.clientHeight, MONTH_LANE_REM * rootSize, MONTH_LANE_GAP_REM * rootSize);
|
|
1880
|
+
setCapacities(current => {
|
|
1881
|
+
if (current[week] === capacity) return current;
|
|
1882
|
+
const next = [...current];
|
|
1883
|
+
next[week] = capacity;
|
|
1884
|
+
return next;
|
|
1885
|
+
});
|
|
1886
|
+
if (week === 0) {
|
|
1887
|
+
setCellWidth(element.clientWidth);
|
|
1888
|
+
setBarFont(`600 ${0.6875 * rootSize}px ${style.fontFamily}`);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
const observeLanes = (element, week) => {
|
|
1892
|
+
lanesOf.set(element, week);
|
|
1893
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
1894
|
+
observer ??= new ResizeObserver(entries => {
|
|
1895
|
+
for (const entry of entries) {
|
|
1896
|
+
const index = lanesOf.get(entry.target);
|
|
1897
|
+
if (index !== undefined) measure(entry.target, index);
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
observer.observe(element);
|
|
1901
|
+
onCleanup(() => observer?.unobserve(element));
|
|
1902
|
+
};
|
|
1903
|
+
/** A date hint shows only when the bar holds its title and the hint whole; screen readers get the range anyway. */
|
|
1904
|
+
const hintFits = (title, hint, span) => {
|
|
1905
|
+
const width = cellWidth();
|
|
1906
|
+
const font = barFont();
|
|
1907
|
+
if (width <= 0 || !font) return false;
|
|
1908
|
+
const rootSize = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
1909
|
+
return textWidth(title, font) + textWidth(hint, font) + MONTH_HINT_SLACK_REM * rootSize <= span * width;
|
|
1910
|
+
};
|
|
1911
|
+
createEffect(() => {
|
|
1912
|
+
const current = popover();
|
|
1913
|
+
const element = popoverElement;
|
|
1914
|
+
if (!element) return;
|
|
1915
|
+
if (!current) {
|
|
1916
|
+
if (element.matches(":popover-open")) element.hidePopover();
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
if (!element.matches(":popover-open")) element.showPopover();
|
|
1920
|
+
const focus = untrack(createActive);
|
|
1921
|
+
queueMicrotask(() => {
|
|
1922
|
+
if (popover() !== current || !element.isConnected) return;
|
|
1923
|
+
placeCalendarPopover(current.anchor, element);
|
|
1924
|
+
if (focus) popoverFocusable()?.focus();
|
|
1925
|
+
});
|
|
1926
|
+
});
|
|
1927
|
+
onMount(() => {
|
|
1928
|
+
const reposition = () => {
|
|
1929
|
+
const current = popover();
|
|
1930
|
+
if (current && popoverElement) placeCalendarPopover(current.anchor, popoverElement);
|
|
1931
|
+
};
|
|
1932
|
+
window.addEventListener("resize", reposition);
|
|
1933
|
+
window.addEventListener("scroll", reposition, true);
|
|
1934
|
+
onCleanup(() => {
|
|
1935
|
+
window.removeEventListener("resize", reposition);
|
|
1936
|
+
window.removeEventListener("scroll", reposition, true);
|
|
1937
|
+
});
|
|
1938
|
+
});
|
|
1939
|
+
onCleanup(() => {
|
|
1940
|
+
cancelInteraction?.();
|
|
1941
|
+
observer?.disconnect();
|
|
1942
|
+
});
|
|
1943
|
+
const dayEntries = dayKey => items().filter(item => item.days.has(dayKey));
|
|
1944
|
+
/** Every bar of a long entry lights up with the one under the pointer. */
|
|
1945
|
+
const linkProps = item => ({
|
|
1946
|
+
onPointerEnter: event => {
|
|
1947
|
+
if (event.pointerType === "mouse") setLinkedItem(item.key);
|
|
1948
|
+
},
|
|
1949
|
+
onPointerLeave: () => {
|
|
1950
|
+
if (linkedItem() === item.key) setLinkedItem("");
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
const grid = () => (() => {
|
|
1954
|
+
var _el$88 = _$getNextElement(_tmpl$29),
|
|
1955
|
+
_el$89 = _el$88.firstChild,
|
|
1956
|
+
_el$91 = _el$89.firstChild,
|
|
1957
|
+
[_el$92, _co$22] = _$getNextMarker(_el$91.nextSibling),
|
|
1958
|
+
_el$93 = _el$92.nextSibling,
|
|
1959
|
+
[_el$94, _co$23] = _$getNextMarker(_el$93.nextSibling),
|
|
1960
|
+
_el$95 = _el$89.nextSibling,
|
|
1961
|
+
[_el$96, _co$24] = _$getNextMarker(_el$95.nextSibling);
|
|
1962
|
+
_$insert(_el$89, _$createComponent(Show, {
|
|
1963
|
+
get when() {
|
|
1964
|
+
return props.owner.withWeekNumbers;
|
|
1965
|
+
},
|
|
1966
|
+
get children() {
|
|
1967
|
+
var _el$90 = _$getNextElement(_tmpl$28);
|
|
1968
|
+
_$insert(_el$90, () => messages().weekShort);
|
|
1969
|
+
return _el$90;
|
|
1970
|
+
}
|
|
1971
|
+
}), _el$92, _co$22);
|
|
1972
|
+
_$insert(_el$89, _$createComponent(For, {
|
|
1973
|
+
get each() {
|
|
1974
|
+
return weekdays();
|
|
1975
|
+
},
|
|
1976
|
+
children: (day, index) => (() => {
|
|
1977
|
+
var _el$97 = _$getNextElement(_tmpl$28);
|
|
1978
|
+
_$insert(_el$97, day);
|
|
1979
|
+
_$effect(() => _$setAttribute(_el$97, "data-weekend", index() > 4 ? "true" : undefined));
|
|
1980
|
+
return _el$97;
|
|
1981
|
+
})()
|
|
1982
|
+
}), _el$94, _co$23);
|
|
1983
|
+
_$insert(_el$88, _$createComponent(For, {
|
|
1984
|
+
get each() {
|
|
1985
|
+
return weeks();
|
|
1986
|
+
},
|
|
1987
|
+
children: (week, weekIndex) => {
|
|
1988
|
+
const fit = createMemo(() => fitMonthWeek(weekLayouts()[weekIndex()] ?? {
|
|
1989
|
+
bars: [],
|
|
1990
|
+
singles: []
|
|
1991
|
+
}, capacities()[weekIndex()] ?? MONTH_DEFAULT_LANES));
|
|
1992
|
+
const weekHref = () => viewHref(week[0].key, "week");
|
|
1993
|
+
const weekNumber = () => zonedWeekNumber(week[0].day, dateConfig());
|
|
1994
|
+
return (() => {
|
|
1995
|
+
var _el$98 = _$getNextElement(_tmpl$31),
|
|
1996
|
+
_el$100 = _el$98.firstChild,
|
|
1997
|
+
[_el$101, _co$25] = _$getNextMarker(_el$100.nextSibling),
|
|
1998
|
+
_el$102 = _el$101.nextSibling,
|
|
1999
|
+
[_el$103, _co$26] = _$getNextMarker(_el$102.nextSibling);
|
|
2000
|
+
_$insert(_el$98, _$createComponent(Show, {
|
|
2001
|
+
get when() {
|
|
2002
|
+
return props.owner.withWeekNumbers;
|
|
2003
|
+
},
|
|
2004
|
+
get children() {
|
|
2005
|
+
var _el$99 = _$getNextElement(_tmpl$30);
|
|
2006
|
+
_$insert(_el$99, _$createComponent(Show, {
|
|
2007
|
+
get when() {
|
|
2008
|
+
return weekHref();
|
|
2009
|
+
},
|
|
2010
|
+
get fallback() {
|
|
2011
|
+
return _$createComponent(Show, {
|
|
2012
|
+
get when() {
|
|
2013
|
+
return canOpenView("week");
|
|
2014
|
+
},
|
|
2015
|
+
get fallback() {
|
|
2016
|
+
return weekNumber();
|
|
2017
|
+
},
|
|
2018
|
+
get children() {
|
|
2019
|
+
var _el$104 = _$getNextElement(_tmpl$32);
|
|
2020
|
+
_el$104.$$click = () => openView(week[0].key, "week");
|
|
2021
|
+
_$insert(_el$104, weekNumber);
|
|
2022
|
+
_$effect(_p$ => {
|
|
2023
|
+
var _v$46 = calendarMessages().calendarOpenWeekNumber({
|
|
2024
|
+
week: weekNumber()
|
|
2025
|
+
}),
|
|
2026
|
+
_v$47 = calendarMessages().calendarOpenWeekNumber({
|
|
2027
|
+
week: weekNumber()
|
|
2028
|
+
});
|
|
2029
|
+
_v$46 !== _p$.e && _$setAttribute(_el$104, "title", _p$.e = _v$46);
|
|
2030
|
+
_v$47 !== _p$.t && _$setAttribute(_el$104, "aria-label", _p$.t = _v$47);
|
|
2031
|
+
return _p$;
|
|
2032
|
+
}, {
|
|
2033
|
+
e: undefined,
|
|
2034
|
+
t: undefined
|
|
2035
|
+
});
|
|
2036
|
+
_$runHydrationEvents();
|
|
2037
|
+
return _el$104;
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
2040
|
+
},
|
|
2041
|
+
children: href => _$createComponent(CalendarNavigationLink, {
|
|
2042
|
+
get owner() {
|
|
2043
|
+
return props.owner;
|
|
2044
|
+
},
|
|
2045
|
+
get href() {
|
|
2046
|
+
return href();
|
|
2047
|
+
},
|
|
2048
|
+
get anchorProps() {
|
|
2049
|
+
return {
|
|
2050
|
+
class: "k2b-calendar-month__week-link",
|
|
2051
|
+
tabIndex: -1,
|
|
2052
|
+
title: calendarMessages().calendarOpenWeekNumber({
|
|
2053
|
+
week: weekNumber()
|
|
2054
|
+
}),
|
|
2055
|
+
"aria-label": calendarMessages().calendarOpenWeekNumber({
|
|
2056
|
+
week: weekNumber()
|
|
2057
|
+
})
|
|
2058
|
+
};
|
|
2059
|
+
},
|
|
2060
|
+
get children() {
|
|
2061
|
+
return weekNumber();
|
|
2062
|
+
}
|
|
2063
|
+
})
|
|
2064
|
+
}));
|
|
2065
|
+
return _el$99;
|
|
2066
|
+
}
|
|
2067
|
+
}), _el$101, _co$25);
|
|
2068
|
+
_$insert(_el$98, _$createComponent(For, {
|
|
2069
|
+
each: week,
|
|
2070
|
+
children: ({
|
|
2071
|
+
day,
|
|
2072
|
+
key
|
|
2073
|
+
}, column) => {
|
|
2074
|
+
const dayBadge = props.owner.dayBadges?.[key];
|
|
2075
|
+
const sameMonth = calendar.isSameMonth(day, props.date, dateConfig());
|
|
2076
|
+
const label = dayLabel(day);
|
|
2077
|
+
const bars = createMemo(() => fit().bars.filter(bar => bar.startColumn === column()));
|
|
2078
|
+
const cell = () => fit().cells[column()] ?? {
|
|
2079
|
+
top: 0,
|
|
2080
|
+
shown: [],
|
|
2081
|
+
hidden: 0
|
|
2082
|
+
};
|
|
2083
|
+
return (() => {
|
|
2084
|
+
var _el$105 = _$getNextElement(_tmpl$34),
|
|
2085
|
+
_el$106 = _el$105.firstChild,
|
|
2086
|
+
_el$107 = _el$106.firstChild,
|
|
2087
|
+
_el$108 = _el$107.nextSibling,
|
|
2088
|
+
[_el$109, _co$27] = _$getNextMarker(_el$108.nextSibling),
|
|
2089
|
+
_el$110 = _el$106.nextSibling,
|
|
2090
|
+
_el$117 = _el$110.firstChild,
|
|
2091
|
+
[_el$118, _co$29] = _$getNextMarker(_el$117.nextSibling),
|
|
2092
|
+
_el$119 = _el$118.nextSibling,
|
|
2093
|
+
[_el$120, _co$30] = _$getNextMarker(_el$119.nextSibling),
|
|
2094
|
+
_el$121 = _el$120.nextSibling,
|
|
2095
|
+
[_el$122, _co$31] = _$getNextMarker(_el$121.nextSibling);
|
|
2096
|
+
_el$105.$$keydown = event => onCellKeyDown(event, key);
|
|
2097
|
+
_el$105.$$contextmenu = event => {
|
|
2098
|
+
// The pressed day takes the focus, so closing the menu with Escape returns there.
|
|
2099
|
+
menuKey = pressedKey(event, key);
|
|
2100
|
+
if (hasMenu()) focusCell(menuKey);
|
|
2101
|
+
};
|
|
2102
|
+
_el$105.$$pointerdown = event => onCellPointerDown(event, key);
|
|
2103
|
+
_el$105.$$dblclick = event => onCellDoubleClick(event, key);
|
|
2104
|
+
_el$105.$$click = event => onCellClick(event, key);
|
|
2105
|
+
_$use(element => cells.set(key, element), _el$105);
|
|
2106
|
+
_$setAttribute(_el$105, "aria-label", label);
|
|
2107
|
+
_$setAttribute(_el$105, "data-calendar-day-key", key);
|
|
2108
|
+
_$setAttribute(_el$105, "data-outside", !sameMonth ? "true" : undefined);
|
|
2109
|
+
_$setAttribute(_el$107, "data-outside", !sameMonth ? "true" : undefined);
|
|
2110
|
+
_$insert(_el$107, () => calendar.formatDayNumber(day, dateConfig()));
|
|
2111
|
+
_$insert(_el$106, _$createComponent(Show, {
|
|
2112
|
+
when: dayBadge,
|
|
2113
|
+
children: badge => (() => {
|
|
2114
|
+
var _el$123 = _$getNextElement(_tmpl$26),
|
|
2115
|
+
_el$124 = _el$123.firstChild,
|
|
2116
|
+
[_el$125, _co$32] = _$getNextMarker(_el$124.nextSibling),
|
|
2117
|
+
_el$126 = _el$125.nextSibling,
|
|
2118
|
+
[_el$127, _co$33] = _$getNextMarker(_el$126.nextSibling);
|
|
2119
|
+
_$insert(_el$123, _$createComponent(Show, {
|
|
2120
|
+
get when() {
|
|
2121
|
+
return badge().icon;
|
|
2122
|
+
},
|
|
2123
|
+
children: icon => (() => {
|
|
2124
|
+
var _el$128 = _$getNextElement(_tmpl$11);
|
|
2125
|
+
_$effect(() => _$className(_el$128, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
2126
|
+
return _el$128;
|
|
2127
|
+
})()
|
|
2128
|
+
}), _el$125, _co$32);
|
|
2129
|
+
_$insert(_el$123, () => badge().label, _el$127, _co$33);
|
|
2130
|
+
return _el$123;
|
|
2131
|
+
})()
|
|
2132
|
+
}), _el$109, _co$27);
|
|
2133
|
+
_$use(element => {
|
|
2134
|
+
if (column() === 0) observeLanes(element, weekIndex());
|
|
2135
|
+
}, _el$110);
|
|
2136
|
+
_$insert(_el$110, _$createComponent(For, {
|
|
2137
|
+
get each() {
|
|
2138
|
+
return bars();
|
|
2139
|
+
},
|
|
2140
|
+
children: bar => {
|
|
2141
|
+
const span = bar.endColumn - bar.startColumn + 1;
|
|
2142
|
+
const startHint = () => {
|
|
2143
|
+
if (!bar.continuesBefore) return undefined;
|
|
2144
|
+
const hint = calendarMessages().calendarContinuesFrom(hintDate(bar.item.firstKey));
|
|
2145
|
+
return hintFits(bar.item.event.title, hint, span) ? hint : undefined;
|
|
2146
|
+
};
|
|
2147
|
+
const endHint = () => {
|
|
2148
|
+
if (!bar.continuesAfter) return undefined;
|
|
2149
|
+
const hint = calendarMessages().calendarContinuesUntil(hintDate(bar.item.lastKey));
|
|
2150
|
+
return hintFits(`${bar.item.event.title}${startHint() ?? ""}`, hint, span) ? hint : undefined;
|
|
2151
|
+
};
|
|
2152
|
+
return (() => {
|
|
2153
|
+
var _el$129 = _$getNextElement(_tmpl$35);
|
|
2154
|
+
_$spread(_el$129, _$mergeProps({
|
|
2155
|
+
get style() {
|
|
2156
|
+
return {
|
|
2157
|
+
"--k2b-calendar-span": String(span),
|
|
2158
|
+
"--k2b-calendar-row": String(bar.lane)
|
|
2159
|
+
};
|
|
2160
|
+
},
|
|
2161
|
+
get ["data-linked"]() {
|
|
2162
|
+
return linkedItem() === bar.item.key && bar.item.firstKey !== bar.item.lastKey ? "true" : undefined;
|
|
2163
|
+
},
|
|
2164
|
+
get ["data-continues-before"]() {
|
|
2165
|
+
return bar.continuesBefore ? "true" : undefined;
|
|
2166
|
+
},
|
|
2167
|
+
get ["data-continues-after"]() {
|
|
2168
|
+
return bar.continuesAfter ? "true" : undefined;
|
|
2169
|
+
}
|
|
2170
|
+
}, () => linkProps(bar.item)), false, true);
|
|
2171
|
+
_$insert(_el$129, _$createComponent(EventChip, {
|
|
2172
|
+
get event() {
|
|
2173
|
+
return bar.item.event;
|
|
2174
|
+
},
|
|
2175
|
+
get owner() {
|
|
2176
|
+
return props.owner;
|
|
2177
|
+
},
|
|
2178
|
+
get href() {
|
|
2179
|
+
return eventHref(props.owner, bar.item.event);
|
|
2180
|
+
},
|
|
2181
|
+
get label() {
|
|
2182
|
+
return itemLabel(bar.item);
|
|
2183
|
+
},
|
|
2184
|
+
compact: true,
|
|
2185
|
+
bar: true,
|
|
2186
|
+
get continuesBefore() {
|
|
2187
|
+
return bar.continuesBefore;
|
|
2188
|
+
},
|
|
2189
|
+
get continuesAfter() {
|
|
2190
|
+
return bar.continuesAfter;
|
|
2191
|
+
},
|
|
2192
|
+
get hintStart() {
|
|
2193
|
+
return startHint();
|
|
2194
|
+
},
|
|
2195
|
+
get hintEnd() {
|
|
2196
|
+
return endHint();
|
|
2197
|
+
},
|
|
2198
|
+
get moving() {
|
|
2199
|
+
return movingEventId() === bar.item.event.id;
|
|
2200
|
+
},
|
|
2201
|
+
get onMovePointerDown() {
|
|
2202
|
+
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, bar.item, markDragged) : undefined;
|
|
2203
|
+
}
|
|
2204
|
+
}));
|
|
2205
|
+
_$runHydrationEvents();
|
|
2206
|
+
return _el$129;
|
|
2207
|
+
})();
|
|
2208
|
+
}
|
|
2209
|
+
}), _el$118, _co$29);
|
|
2210
|
+
_$insert(_el$110, _$createComponent(For, {
|
|
2211
|
+
get each() {
|
|
2212
|
+
return cell().shown;
|
|
2213
|
+
},
|
|
2214
|
+
children: (item, index) => (() => {
|
|
2215
|
+
var _el$130 = _$getNextElement(_tmpl$36);
|
|
2216
|
+
_$insert(_el$130, _$createComponent(EventChip, {
|
|
2217
|
+
get event() {
|
|
2218
|
+
return item.event;
|
|
2219
|
+
},
|
|
2220
|
+
get owner() {
|
|
2221
|
+
return props.owner;
|
|
2222
|
+
},
|
|
2223
|
+
get href() {
|
|
2224
|
+
return eventHref(props.owner, item.event);
|
|
2225
|
+
},
|
|
2226
|
+
compact: true,
|
|
2227
|
+
get leadingTime() {
|
|
2228
|
+
return leadingTime(item);
|
|
2229
|
+
},
|
|
2230
|
+
get moving() {
|
|
2231
|
+
return movingEventId() === item.event.id;
|
|
2232
|
+
},
|
|
2233
|
+
get onMovePointerDown() {
|
|
2234
|
+
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, item, markDragged) : undefined;
|
|
2235
|
+
}
|
|
2236
|
+
}));
|
|
2237
|
+
_$effect(_$p => _$setStyleProperty(_el$130, "--k2b-calendar-row", String(cell().top + index())));
|
|
2238
|
+
return _el$130;
|
|
2239
|
+
})()
|
|
2240
|
+
}), _el$120, _co$30);
|
|
2241
|
+
_$insert(_el$110, _$createComponent(Show, {
|
|
2242
|
+
get when() {
|
|
2243
|
+
return cell().hidden > 0;
|
|
2244
|
+
},
|
|
2245
|
+
get children() {
|
|
2246
|
+
var _el$111 = _$getNextElement(_tmpl$33),
|
|
2247
|
+
_el$112 = _el$111.firstChild,
|
|
2248
|
+
_el$113 = _el$112.nextSibling,
|
|
2249
|
+
_el$114 = _el$113.firstChild,
|
|
2250
|
+
_el$115 = _el$114.nextSibling,
|
|
2251
|
+
[_el$116, _co$28] = _$getNextMarker(_el$115.nextSibling);
|
|
2252
|
+
_el$111.$$click = () => {
|
|
2253
|
+
const current = popover();
|
|
2254
|
+
if (current?.kind === "day" && current.dayKey === key) closePopover(false);else openDayList(key);
|
|
2255
|
+
};
|
|
2256
|
+
_$insert(_el$112, () => calendarMessages().calendarMoreEvents({
|
|
2257
|
+
count: cell().hidden
|
|
2258
|
+
}));
|
|
2259
|
+
_$insert(_el$113, () => cell().hidden, _el$116, _co$28);
|
|
2260
|
+
_$effect(_p$ => {
|
|
2261
|
+
var _v$48 = String(cell().top + cell().shown.length),
|
|
2262
|
+
_v$49 = calendarMessages().calendarMoreEventsOn({
|
|
2263
|
+
count: cell().hidden,
|
|
2264
|
+
label
|
|
2265
|
+
}),
|
|
2266
|
+
_v$50 = (() => {
|
|
2267
|
+
const current = popover();
|
|
2268
|
+
return current?.kind === "day" && current.dayKey === key;
|
|
2269
|
+
})();
|
|
2270
|
+
_v$48 !== _p$.e && _$setStyleProperty(_el$111, "--k2b-calendar-row", _p$.e = _v$48);
|
|
2271
|
+
_v$49 !== _p$.t && _$setAttribute(_el$111, "aria-label", _p$.t = _v$49);
|
|
2272
|
+
_v$50 !== _p$.a && _$setAttribute(_el$111, "aria-expanded", _p$.a = _v$50);
|
|
2273
|
+
return _p$;
|
|
2274
|
+
}, {
|
|
2275
|
+
e: undefined,
|
|
2276
|
+
t: undefined,
|
|
2277
|
+
a: undefined
|
|
2278
|
+
});
|
|
2279
|
+
_$runHydrationEvents();
|
|
2280
|
+
return _el$111;
|
|
2281
|
+
}
|
|
2282
|
+
}), _el$122, _co$31);
|
|
2283
|
+
_$effect(_p$ => {
|
|
2284
|
+
var _v$51 = rovingKey() === key ? 0 : -1,
|
|
2285
|
+
_v$52 = within(selection(), key) ? "true" : "false",
|
|
2286
|
+
_v$53 = key === todayKey() ? "date" : undefined,
|
|
2287
|
+
_v$54 = column() > 4 ? "true" : undefined,
|
|
2288
|
+
_v$55 = key < todayKey() ? "true" : undefined,
|
|
2289
|
+
_v$56 = selectionPart(key),
|
|
2290
|
+
_v$57 = within(dropRange(), key) ? "true" : undefined,
|
|
2291
|
+
_v$58 = key === todayKey() ? "true" : undefined;
|
|
2292
|
+
_v$51 !== _p$.e && _$setAttribute(_el$105, "tabindex", _p$.e = _v$51);
|
|
2293
|
+
_v$52 !== _p$.t && _$setAttribute(_el$105, "aria-selected", _p$.t = _v$52);
|
|
2294
|
+
_v$53 !== _p$.a && _$setAttribute(_el$105, "aria-current", _p$.a = _v$53);
|
|
2295
|
+
_v$54 !== _p$.o && _$setAttribute(_el$105, "data-weekend", _p$.o = _v$54);
|
|
2296
|
+
_v$55 !== _p$.i && _$setAttribute(_el$105, "data-past", _p$.i = _v$55);
|
|
2297
|
+
_v$56 !== _p$.n && _$setAttribute(_el$105, "data-selected", _p$.n = _v$56);
|
|
2298
|
+
_v$57 !== _p$.s && _$setAttribute(_el$105, "data-drop-preview", _p$.s = _v$57);
|
|
2299
|
+
_v$58 !== _p$.h && _$setAttribute(_el$107, "data-today", _p$.h = _v$58);
|
|
2300
|
+
return _p$;
|
|
2301
|
+
}, {
|
|
2302
|
+
e: undefined,
|
|
2303
|
+
t: undefined,
|
|
2304
|
+
a: undefined,
|
|
2305
|
+
o: undefined,
|
|
2306
|
+
i: undefined,
|
|
2307
|
+
n: undefined,
|
|
2308
|
+
s: undefined,
|
|
2309
|
+
h: undefined
|
|
2310
|
+
});
|
|
2311
|
+
_$runHydrationEvents();
|
|
2312
|
+
return _el$105;
|
|
2313
|
+
})();
|
|
2314
|
+
}
|
|
2315
|
+
}), _el$103, _co$26);
|
|
2316
|
+
_$effect(() => _$setAttribute(_el$98, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
2317
|
+
return _el$98;
|
|
2318
|
+
})();
|
|
2319
|
+
}
|
|
2320
|
+
}), _el$96, _co$24);
|
|
2321
|
+
_$effect(_p$ => {
|
|
2322
|
+
var _v$43 = formatMonth(props.date, dateConfig()),
|
|
2323
|
+
_v$44 = `auto repeat(${weeks().length}, minmax(5rem, 1fr))`,
|
|
2324
|
+
_v$45 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
2325
|
+
_v$43 !== _p$.e && _$setAttribute(_el$88, "aria-label", _p$.e = _v$43);
|
|
2326
|
+
_v$44 !== _p$.t && _$setStyleProperty(_el$88, "grid-template-rows", _p$.t = _v$44);
|
|
2327
|
+
_v$45 !== _p$.a && _$setAttribute(_el$89, "data-week-numbers", _p$.a = _v$45);
|
|
2328
|
+
return _p$;
|
|
2329
|
+
}, {
|
|
2330
|
+
e: undefined,
|
|
2331
|
+
t: undefined,
|
|
2332
|
+
a: undefined
|
|
2333
|
+
});
|
|
2334
|
+
return _el$88;
|
|
1145
2335
|
})();
|
|
2336
|
+
const dayList = dayKey => {
|
|
2337
|
+
const day = parseKey(dayKey);
|
|
2338
|
+
const href = viewHref(dayKey, "day");
|
|
2339
|
+
// Read where it renders, so a refresh while the list is open updates it as it does the grid.
|
|
2340
|
+
const entries = () => dayEntries(dayKey);
|
|
2341
|
+
return (() => {
|
|
2342
|
+
var _el$131 = _$getNextElement(_tmpl$39),
|
|
2343
|
+
_el$132 = _el$131.firstChild,
|
|
2344
|
+
_el$140 = _el$132.nextSibling,
|
|
2345
|
+
[_el$141, _co$36] = _$getNextMarker(_el$140.nextSibling),
|
|
2346
|
+
_el$134 = _el$141.nextSibling,
|
|
2347
|
+
_el$136 = _el$134.firstChild,
|
|
2348
|
+
[_el$137, _co$34] = _$getNextMarker(_el$136.nextSibling),
|
|
2349
|
+
_el$138 = _el$137.nextSibling,
|
|
2350
|
+
[_el$139, _co$35] = _$getNextMarker(_el$138.nextSibling);
|
|
2351
|
+
_$insert(_el$132, () => dayLabel(day));
|
|
2352
|
+
_$insert(_el$131, _$createComponent(Show, {
|
|
2353
|
+
get when() {
|
|
2354
|
+
return entries().length > 0;
|
|
2355
|
+
},
|
|
2356
|
+
get fallback() {
|
|
2357
|
+
return (() => {
|
|
2358
|
+
var _el$142 = _$getNextElement(_tmpl$40);
|
|
2359
|
+
_$insert(_el$142, () => calendarMessages().calendarNothingPlanned);
|
|
2360
|
+
return _el$142;
|
|
2361
|
+
})();
|
|
2362
|
+
},
|
|
2363
|
+
get children() {
|
|
2364
|
+
var _el$133 = _$getNextElement(_tmpl$37);
|
|
2365
|
+
_$insert(_el$133, _$createComponent(For, {
|
|
2366
|
+
get each() {
|
|
2367
|
+
return entries();
|
|
2368
|
+
},
|
|
2369
|
+
children: item => (() => {
|
|
2370
|
+
var _el$143 = _$getNextElement(_tmpl$41);
|
|
2371
|
+
_$insert(_el$143, _$createComponent(EventChip, {
|
|
2372
|
+
get event() {
|
|
2373
|
+
return item.event;
|
|
2374
|
+
},
|
|
2375
|
+
get owner() {
|
|
2376
|
+
return props.owner;
|
|
2377
|
+
},
|
|
2378
|
+
get href() {
|
|
2379
|
+
return eventHref(props.owner, item.event);
|
|
2380
|
+
},
|
|
2381
|
+
get label() {
|
|
2382
|
+
return itemLabel(item);
|
|
2383
|
+
},
|
|
2384
|
+
compact: true,
|
|
2385
|
+
get bar() {
|
|
2386
|
+
return item.bar;
|
|
2387
|
+
},
|
|
2388
|
+
get leadingTime() {
|
|
2389
|
+
return leadingTime(item);
|
|
2390
|
+
}
|
|
2391
|
+
}));
|
|
2392
|
+
return _el$143;
|
|
2393
|
+
})()
|
|
2394
|
+
}));
|
|
2395
|
+
return _el$133;
|
|
2396
|
+
}
|
|
2397
|
+
}), _el$141, _co$36);
|
|
2398
|
+
_$insert(_el$134, _$createComponent(Show, {
|
|
2399
|
+
when: href,
|
|
2400
|
+
get fallback() {
|
|
2401
|
+
return _$createComponent(Show, {
|
|
2402
|
+
get when() {
|
|
2403
|
+
return canOpenView("day");
|
|
2404
|
+
},
|
|
2405
|
+
get children() {
|
|
2406
|
+
return _$createComponent(Button, {
|
|
2407
|
+
type: "button",
|
|
2408
|
+
variant: "ghost",
|
|
2409
|
+
size: "sm",
|
|
2410
|
+
onClick: () => openView(dayKey, "day"),
|
|
2411
|
+
get children() {
|
|
2412
|
+
return [_$getNextElement(_tmpl$42), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2413
|
+
}
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
},
|
|
2418
|
+
children: dayHref => _$createComponent(CalendarNavigationLink, {
|
|
2419
|
+
get owner() {
|
|
2420
|
+
return props.owner;
|
|
2421
|
+
},
|
|
2422
|
+
get href() {
|
|
2423
|
+
return dayHref();
|
|
2424
|
+
},
|
|
2425
|
+
anchorProps: {
|
|
2426
|
+
class: "k2b-button",
|
|
2427
|
+
"data-variant": "ghost",
|
|
2428
|
+
"data-size": "sm"
|
|
2429
|
+
},
|
|
2430
|
+
get children() {
|
|
2431
|
+
return [_$getNextElement(_tmpl$42), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2432
|
+
}
|
|
2433
|
+
})
|
|
2434
|
+
}), _el$137, _co$34);
|
|
2435
|
+
_$insert(_el$134, _$createComponent(Show, {
|
|
2436
|
+
get when() {
|
|
2437
|
+
return props.owner.renderQuickCreate;
|
|
2438
|
+
},
|
|
2439
|
+
get children() {
|
|
2440
|
+
return _$createComponent(Button, {
|
|
2441
|
+
type: "button",
|
|
2442
|
+
variant: "ghost",
|
|
2443
|
+
size: "sm",
|
|
2444
|
+
onClick: () => {
|
|
2445
|
+
select(dayKey);
|
|
2446
|
+
openCreate({
|
|
2447
|
+
first: dayKey,
|
|
2448
|
+
last: dayKey
|
|
2449
|
+
}, {
|
|
2450
|
+
active: true
|
|
2451
|
+
});
|
|
2452
|
+
},
|
|
2453
|
+
get children() {
|
|
2454
|
+
return [_$getNextElement(_tmpl$38), _$memo(() => calendarMessages().calendarNewEvent)];
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
}), _el$139, _co$35);
|
|
2459
|
+
return _el$131;
|
|
2460
|
+
})();
|
|
2461
|
+
};
|
|
2462
|
+
return [_$createComponent(Show, {
|
|
2463
|
+
get when() {
|
|
2464
|
+
return hasMenu();
|
|
2465
|
+
},
|
|
2466
|
+
get fallback() {
|
|
2467
|
+
return grid();
|
|
2468
|
+
},
|
|
2469
|
+
get children() {
|
|
2470
|
+
return _$createComponent(GestureMenu, {
|
|
2471
|
+
get items() {
|
|
2472
|
+
return menuItems();
|
|
2473
|
+
},
|
|
2474
|
+
get label() {
|
|
2475
|
+
return calendarMessages().calendarSelectionActions;
|
|
2476
|
+
},
|
|
2477
|
+
tabIndex: -1,
|
|
2478
|
+
onOpen: onMenuOpen,
|
|
2479
|
+
"class": "k2b-calendar-month-menu",
|
|
2480
|
+
get children() {
|
|
2481
|
+
return grid();
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
}), (() => {
|
|
2486
|
+
var _el$146 = _$getNextElement(_tmpl$43);
|
|
2487
|
+
_el$146.addEventListener("toggle", event => {
|
|
2488
|
+
// A late close of the popover that another opening already replaced keeps the new one. Focus returns to the
|
|
2489
|
+
// grid only from inside the popover, never from what a click outside it chose.
|
|
2490
|
+
if (event.newState !== "closed" || !popover() || event.currentTarget.matches(":popover-open")) return;
|
|
2491
|
+
const inside = event.currentTarget.contains(document.activeElement) || document.activeElement === document.body;
|
|
2492
|
+
closePopover(inside);
|
|
2493
|
+
});
|
|
2494
|
+
_el$146.$$focusin = () => setCreateActive(true);
|
|
2495
|
+
var _ref$ = popoverElement;
|
|
2496
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$146) : popoverElement = _el$146;
|
|
2497
|
+
_$insert(_el$146, _$createComponent(Show, {
|
|
2498
|
+
get when() {
|
|
2499
|
+
return popover();
|
|
2500
|
+
},
|
|
2501
|
+
keyed: true,
|
|
2502
|
+
children: value => value.kind === "create" ? props.owner.renderQuickCreate?.(rangeOf(value.range), {
|
|
2503
|
+
create: value.create,
|
|
2504
|
+
close: () => {
|
|
2505
|
+
if (popover() === value) closePopover();
|
|
2506
|
+
}
|
|
2507
|
+
}) : dayList(value.dayKey)
|
|
2508
|
+
}));
|
|
2509
|
+
_$effect(_p$ => {
|
|
2510
|
+
var _v$59 = (() => {
|
|
2511
|
+
const current = popover();
|
|
2512
|
+
if (current?.kind === "day") return dayLabel(parseKey(current.dayKey));
|
|
2513
|
+
return calendarMessages().calendarQuickCreate;
|
|
2514
|
+
})(),
|
|
2515
|
+
_v$60 = popover()?.kind,
|
|
2516
|
+
_v$61 = popover()?.kind === "create" && !createActive() ? "true" : undefined;
|
|
2517
|
+
_v$59 !== _p$.e && _$setAttribute(_el$146, "aria-label", _p$.e = _v$59);
|
|
2518
|
+
_v$60 !== _p$.t && _$setAttribute(_el$146, "data-kind", _p$.t = _v$60);
|
|
2519
|
+
_v$61 !== _p$.a && _$setAttribute(_el$146, "data-quiet", _p$.a = _v$61);
|
|
2520
|
+
return _p$;
|
|
2521
|
+
}, {
|
|
2522
|
+
e: undefined,
|
|
2523
|
+
t: undefined,
|
|
2524
|
+
a: undefined
|
|
2525
|
+
});
|
|
2526
|
+
_$runHydrationEvents();
|
|
2527
|
+
return _el$146;
|
|
2528
|
+
})()];
|
|
1146
2529
|
};
|
|
1147
2530
|
const TimeGridView = props => {
|
|
1148
2531
|
const messages = useUiMessages();
|
|
@@ -1356,19 +2739,19 @@ const TimeGridView = props => {
|
|
|
1356
2739
|
});
|
|
1357
2740
|
});
|
|
1358
2741
|
return (() => {
|
|
1359
|
-
var _el$
|
|
1360
|
-
_el$
|
|
1361
|
-
_el$
|
|
1362
|
-
_el$
|
|
1363
|
-
[_el$
|
|
1364
|
-
_el$
|
|
1365
|
-
[_el$
|
|
1366
|
-
_el$
|
|
1367
|
-
_el$
|
|
1368
|
-
_el$
|
|
1369
|
-
_el$
|
|
1370
|
-
[_el$
|
|
1371
|
-
_$insert(_el$
|
|
2742
|
+
var _el$147 = _$getNextElement(_tmpl$45),
|
|
2743
|
+
_el$148 = _el$147.firstChild,
|
|
2744
|
+
_el$149 = _el$148.firstChild,
|
|
2745
|
+
_el$150 = _el$149.nextSibling,
|
|
2746
|
+
[_el$151, _co$37] = _$getNextMarker(_el$150.nextSibling),
|
|
2747
|
+
_el$161 = _el$148.nextSibling,
|
|
2748
|
+
[_el$162, _co$40] = _$getNextMarker(_el$161.nextSibling),
|
|
2749
|
+
_el$156 = _el$162.nextSibling,
|
|
2750
|
+
_el$157 = _el$156.firstChild,
|
|
2751
|
+
_el$158 = _el$157.firstChild,
|
|
2752
|
+
_el$159 = _el$158.nextSibling,
|
|
2753
|
+
[_el$160, _co$39] = _$getNextMarker(_el$159.nextSibling);
|
|
2754
|
+
_$insert(_el$148, _$createComponent(For, {
|
|
1372
2755
|
get each() {
|
|
1373
2756
|
return props.days;
|
|
1374
2757
|
},
|
|
@@ -1387,47 +2770,47 @@ const TimeGridView = props => {
|
|
|
1387
2770
|
},
|
|
1388
2771
|
get children() {
|
|
1389
2772
|
return [(() => {
|
|
1390
|
-
var _el$
|
|
1391
|
-
_$insert(_el$
|
|
1392
|
-
_$effect(() => _$setAttribute(_el$
|
|
1393
|
-
return _el$
|
|
2773
|
+
var _el$163 = _$getNextElement(_tmpl$46);
|
|
2774
|
+
_$insert(_el$163, () => formatDay(day, dateConfig()));
|
|
2775
|
+
_$effect(() => _$setAttribute(_el$163, "data-today", today() ? "true" : undefined));
|
|
2776
|
+
return _el$163;
|
|
1394
2777
|
})(), _$createComponent(Show, {
|
|
1395
2778
|
when: dayBadge,
|
|
1396
2779
|
children: badge => (() => {
|
|
1397
|
-
var _el$
|
|
1398
|
-
_el$
|
|
1399
|
-
[_el$
|
|
1400
|
-
_el$
|
|
1401
|
-
[_el$
|
|
1402
|
-
_$insert(_el$
|
|
2780
|
+
var _el$164 = _$getNextElement(_tmpl$47),
|
|
2781
|
+
_el$165 = _el$164.firstChild,
|
|
2782
|
+
[_el$166, _co$41] = _$getNextMarker(_el$165.nextSibling),
|
|
2783
|
+
_el$167 = _el$166.nextSibling,
|
|
2784
|
+
[_el$168, _co$42] = _$getNextMarker(_el$167.nextSibling);
|
|
2785
|
+
_$insert(_el$164, _$createComponent(Show, {
|
|
1403
2786
|
get when() {
|
|
1404
2787
|
return badge().icon;
|
|
1405
2788
|
},
|
|
1406
2789
|
children: icon => (() => {
|
|
1407
|
-
var _el$
|
|
1408
|
-
_$effect(() => _$className(_el$
|
|
1409
|
-
return _el$
|
|
2790
|
+
var _el$169 = _$getNextElement(_tmpl$11);
|
|
2791
|
+
_$effect(() => _$className(_el$169, `k2b-calendar-time-grid__badge-icon ti ti-${icon()}`));
|
|
2792
|
+
return _el$169;
|
|
1410
2793
|
})()
|
|
1411
|
-
}), _el$
|
|
1412
|
-
_$insert(_el$
|
|
1413
|
-
return _el$
|
|
2794
|
+
}), _el$166, _co$41);
|
|
2795
|
+
_$insert(_el$164, () => badge().label, _el$168, _co$42);
|
|
2796
|
+
return _el$164;
|
|
1414
2797
|
})()
|
|
1415
2798
|
})];
|
|
1416
2799
|
}
|
|
1417
2800
|
});
|
|
1418
2801
|
}
|
|
1419
|
-
}), _el$
|
|
1420
|
-
_$insert(_el$
|
|
2802
|
+
}), _el$151, _co$37);
|
|
2803
|
+
_$insert(_el$147, _$createComponent(Show, {
|
|
1421
2804
|
get when() {
|
|
1422
2805
|
return !props.owner.hideAllDay;
|
|
1423
2806
|
},
|
|
1424
2807
|
get children() {
|
|
1425
|
-
var _el$
|
|
1426
|
-
_el$
|
|
1427
|
-
_el$
|
|
1428
|
-
[_el$
|
|
1429
|
-
_$insert(_el$
|
|
1430
|
-
_$insert(_el$
|
|
2808
|
+
var _el$152 = _$getNextElement(_tmpl$44),
|
|
2809
|
+
_el$153 = _el$152.firstChild,
|
|
2810
|
+
_el$154 = _el$153.nextSibling,
|
|
2811
|
+
[_el$155, _co$38] = _$getNextMarker(_el$154.nextSibling);
|
|
2812
|
+
_$insert(_el$153, () => props.labels.allDay);
|
|
2813
|
+
_$insert(_el$152, _$createComponent(For, {
|
|
1431
2814
|
get each() {
|
|
1432
2815
|
return props.days;
|
|
1433
2816
|
},
|
|
@@ -1436,14 +2819,14 @@ const TimeGridView = props => {
|
|
|
1436
2819
|
const allDay = () => eventsByDay().get(dayKey)?.allDay ?? [];
|
|
1437
2820
|
const previewAllDay = previewEvents().filter(event => event.dayKey === dayKey && event.allDay);
|
|
1438
2821
|
return (() => {
|
|
1439
|
-
var _el$
|
|
1440
|
-
_el$
|
|
1441
|
-
_el$
|
|
1442
|
-
[_el$
|
|
1443
|
-
_el$
|
|
1444
|
-
[_el$
|
|
1445
|
-
_$setAttribute(_el$
|
|
1446
|
-
_$spread(_el$
|
|
2822
|
+
var _el$170 = _$getNextElement(_tmpl$48),
|
|
2823
|
+
_el$171 = _el$170.firstChild,
|
|
2824
|
+
_el$172 = _el$171.firstChild,
|
|
2825
|
+
[_el$173, _co$43] = _$getNextMarker(_el$172.nextSibling),
|
|
2826
|
+
_el$174 = _el$173.nextSibling,
|
|
2827
|
+
[_el$175, _co$44] = _$getNextMarker(_el$174.nextSibling);
|
|
2828
|
+
_$setAttribute(_el$170, "data-calendar-day-key", dayKey);
|
|
2829
|
+
_$spread(_el$170, _$mergeProps({
|
|
1447
2830
|
get ["data-drop-preview"]() {
|
|
1448
2831
|
return timePreview()?.allDay && calendar.formatDateKey(timePreview().start, dateConfig()) === dayKey ? "true" : undefined;
|
|
1449
2832
|
},
|
|
@@ -1458,15 +2841,15 @@ const TimeGridView = props => {
|
|
|
1458
2841
|
allDay: true
|
|
1459
2842
|
};
|
|
1460
2843
|
}, () => performance.now() < suppressSlotClickUntil)), false, true);
|
|
1461
|
-
_$insert(_el$
|
|
2844
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
1462
2845
|
each: previewAllDay,
|
|
1463
2846
|
children: event => (() => {
|
|
1464
|
-
var _el$
|
|
1465
|
-
_$insert(_el$
|
|
1466
|
-
return _el$
|
|
2847
|
+
var _el$176 = _$getNextElement(_tmpl$23);
|
|
2848
|
+
_$insert(_el$176, () => event.title);
|
|
2849
|
+
return _el$176;
|
|
1467
2850
|
})()
|
|
1468
|
-
}), _el$
|
|
1469
|
-
_$insert(_el$
|
|
2851
|
+
}), _el$173, _co$43);
|
|
2852
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
1470
2853
|
get each() {
|
|
1471
2854
|
return allDay();
|
|
1472
2855
|
},
|
|
@@ -1486,49 +2869,49 @@ const TimeGridView = props => {
|
|
|
1486
2869
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startAllDayMove(pointerEvent, event, markDragged) : undefined;
|
|
1487
2870
|
}
|
|
1488
2871
|
})
|
|
1489
|
-
}), _el$
|
|
2872
|
+
}), _el$175, _co$44);
|
|
1490
2873
|
_$runHydrationEvents();
|
|
1491
|
-
return _el$
|
|
2874
|
+
return _el$170;
|
|
1492
2875
|
})();
|
|
1493
2876
|
}
|
|
1494
|
-
}), _el$
|
|
2877
|
+
}), _el$155, _co$38);
|
|
1495
2878
|
_$effect(_p$ => {
|
|
1496
|
-
var _v$
|
|
1497
|
-
_v$
|
|
1498
|
-
_v$
|
|
1499
|
-
_v$
|
|
2879
|
+
var _v$62 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
2880
|
+
_v$63 = `${props.owner.allDayMaxHeightRem ?? 7}rem`;
|
|
2881
|
+
_v$62 !== _p$.e && _$setStyleProperty(_el$152, "grid-template-columns", _p$.e = _v$62);
|
|
2882
|
+
_v$63 !== _p$.t && _$setStyleProperty(_el$152, "max-height", _p$.t = _v$63);
|
|
1500
2883
|
return _p$;
|
|
1501
2884
|
}, {
|
|
1502
2885
|
e: undefined,
|
|
1503
2886
|
t: undefined
|
|
1504
2887
|
});
|
|
1505
|
-
return _el$
|
|
2888
|
+
return _el$152;
|
|
1506
2889
|
}
|
|
1507
|
-
}), _el$
|
|
1508
|
-
var _ref$ = scrollContainer;
|
|
1509
|
-
typeof _ref$ === "function" ? _$use(_ref
|
|
1510
|
-
var _ref$
|
|
1511
|
-
typeof _ref$
|
|
1512
|
-
var _ref$
|
|
1513
|
-
typeof _ref$
|
|
1514
|
-
_$insert(_el$
|
|
2890
|
+
}), _el$162, _co$40);
|
|
2891
|
+
var _ref$2 = scrollContainer;
|
|
2892
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$156) : scrollContainer = _el$156;
|
|
2893
|
+
var _ref$3 = timeGrid;
|
|
2894
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$157) : timeGrid = _el$157;
|
|
2895
|
+
var _ref$4 = timeGutter;
|
|
2896
|
+
typeof _ref$4 === "function" ? _$use(_ref$4, _el$158) : timeGutter = _el$158;
|
|
2897
|
+
_$insert(_el$158, _$createComponent(For, {
|
|
1515
2898
|
get each() {
|
|
1516
2899
|
return hours();
|
|
1517
2900
|
},
|
|
1518
2901
|
children: hour => (() => {
|
|
1519
|
-
var _el$
|
|
1520
|
-
_el$
|
|
1521
|
-
[_el$
|
|
1522
|
-
_el$
|
|
2902
|
+
var _el$177 = _$getNextElement(_tmpl$49),
|
|
2903
|
+
_el$179 = _el$177.firstChild,
|
|
2904
|
+
[_el$180, _co$45] = _$getNextMarker(_el$179.nextSibling),
|
|
2905
|
+
_el$178 = _el$180.nextSibling;
|
|
1523
2906
|
_$use(element => {
|
|
1524
2907
|
if (hour === businessStartHour()) defaultHourMarker = element;
|
|
1525
|
-
}, _el$
|
|
1526
|
-
_$insert(_el$
|
|
1527
|
-
_$effect(() => _$setAttribute(_el$
|
|
1528
|
-
return _el$
|
|
2908
|
+
}, _el$177);
|
|
2909
|
+
_$insert(_el$177, () => `${hour}`.padStart(2, "0"), _el$180, _co$45);
|
|
2910
|
+
_$effect(() => _$setAttribute(_el$177, "data-outside-business", hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined));
|
|
2911
|
+
return _el$177;
|
|
1529
2912
|
})()
|
|
1530
2913
|
}));
|
|
1531
|
-
_$insert(_el$
|
|
2914
|
+
_$insert(_el$157, _$createComponent(For, {
|
|
1532
2915
|
get each() {
|
|
1533
2916
|
return props.days;
|
|
1534
2917
|
},
|
|
@@ -1536,34 +2919,34 @@ const TimeGridView = props => {
|
|
|
1536
2919
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
1537
2920
|
const layouts = createMemo(() => timedEventLayouts(eventsByDay().get(dayKey)?.timed ?? []));
|
|
1538
2921
|
return (() => {
|
|
1539
|
-
var _el$
|
|
1540
|
-
_el$
|
|
1541
|
-
[_el$
|
|
1542
|
-
_el$
|
|
1543
|
-
[_el$
|
|
1544
|
-
_el$
|
|
1545
|
-
[_el$
|
|
1546
|
-
_el$
|
|
1547
|
-
[_el$
|
|
1548
|
-
_el$
|
|
1549
|
-
[_el$
|
|
1550
|
-
_$insert(_el$
|
|
2922
|
+
var _el$181 = _$getNextElement(_tmpl$51),
|
|
2923
|
+
_el$183 = _el$181.firstChild,
|
|
2924
|
+
[_el$184, _co$46] = _$getNextMarker(_el$183.nextSibling),
|
|
2925
|
+
_el$185 = _el$184.nextSibling,
|
|
2926
|
+
[_el$186, _co$47] = _$getNextMarker(_el$185.nextSibling),
|
|
2927
|
+
_el$187 = _el$186.nextSibling,
|
|
2928
|
+
[_el$188, _co$48] = _$getNextMarker(_el$187.nextSibling),
|
|
2929
|
+
_el$189 = _el$188.nextSibling,
|
|
2930
|
+
[_el$190, _co$49] = _$getNextMarker(_el$189.nextSibling),
|
|
2931
|
+
_el$191 = _el$190.nextSibling,
|
|
2932
|
+
[_el$192, _co$50] = _$getNextMarker(_el$191.nextSibling);
|
|
2933
|
+
_$insert(_el$181, _$createComponent(Show, {
|
|
1551
2934
|
get when() {
|
|
1552
2935
|
return currentTimeLine(day) !== null;
|
|
1553
2936
|
},
|
|
1554
2937
|
get children() {
|
|
1555
|
-
var _el$
|
|
1556
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
1557
|
-
return _el$
|
|
2938
|
+
var _el$182 = _$getNextElement(_tmpl$50);
|
|
2939
|
+
_$effect(_$p => _$setStyleProperty(_el$182, "top", `${currentTimeLine(day) ?? 0}%`));
|
|
2940
|
+
return _el$182;
|
|
1558
2941
|
}
|
|
1559
|
-
}), _el$
|
|
1560
|
-
_$insert(_el$
|
|
2942
|
+
}), _el$184, _co$46);
|
|
2943
|
+
_$insert(_el$181, _$createComponent(For, {
|
|
1561
2944
|
get each() {
|
|
1562
2945
|
return hours();
|
|
1563
2946
|
},
|
|
1564
2947
|
children: hour => (() => {
|
|
1565
|
-
var _el$
|
|
1566
|
-
_$spread(_el$
|
|
2948
|
+
var _el$193 = _$getNextElement(_tmpl$52);
|
|
2949
|
+
_$spread(_el$193, _$mergeProps({
|
|
1567
2950
|
get ["data-outside-business"]() {
|
|
1568
2951
|
return hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined;
|
|
1569
2952
|
},
|
|
@@ -1581,10 +2964,10 @@ const TimeGridView = props => {
|
|
|
1581
2964
|
"onPointerDown": startRange
|
|
1582
2965
|
}), false, false);
|
|
1583
2966
|
_$runHydrationEvents();
|
|
1584
|
-
return _el$
|
|
2967
|
+
return _el$193;
|
|
1585
2968
|
})()
|
|
1586
|
-
}), _el$
|
|
1587
|
-
_$insert(_el$
|
|
2969
|
+
}), _el$186, _co$47);
|
|
2970
|
+
_$insert(_el$181, _$createComponent(For, {
|
|
1588
2971
|
get each() {
|
|
1589
2972
|
return previewEvents().filter(event => event.dayKey === dayKey && !event.allDay);
|
|
1590
2973
|
},
|
|
@@ -1592,44 +2975,44 @@ const TimeGridView = props => {
|
|
|
1592
2975
|
const layout = eventLayout(event);
|
|
1593
2976
|
const short = event.endDate.getTime() - event.startDate.getTime() < 60 * 60_000;
|
|
1594
2977
|
return (() => {
|
|
1595
|
-
var _el$
|
|
1596
|
-
_el$
|
|
1597
|
-
_el$
|
|
1598
|
-
[_el$
|
|
1599
|
-
_el$
|
|
1600
|
-
_el$
|
|
1601
|
-
[_el$
|
|
1602
|
-
_el$
|
|
1603
|
-
_el$
|
|
1604
|
-
[_el$
|
|
1605
|
-
_$setAttribute(_el$
|
|
1606
|
-
_$insert(_el$
|
|
2978
|
+
var _el$194 = _$getNextElement(_tmpl$54),
|
|
2979
|
+
_el$195 = _el$194.firstChild,
|
|
2980
|
+
_el$203 = _el$195.firstChild,
|
|
2981
|
+
[_el$204, _co$53] = _$getNextMarker(_el$203.nextSibling),
|
|
2982
|
+
_el$197 = _el$204.nextSibling,
|
|
2983
|
+
_el$199 = _el$197.firstChild,
|
|
2984
|
+
[_el$200, _co$51] = _$getNextMarker(_el$199.nextSibling),
|
|
2985
|
+
_el$198 = _el$200.nextSibling,
|
|
2986
|
+
_el$201 = _el$198.nextSibling,
|
|
2987
|
+
[_el$202, _co$52] = _$getNextMarker(_el$201.nextSibling);
|
|
2988
|
+
_$setAttribute(_el$194, "data-short", short ? "true" : undefined);
|
|
2989
|
+
_$insert(_el$195, _$createComponent(Show, {
|
|
1607
2990
|
get when() {
|
|
1608
2991
|
return event.title;
|
|
1609
2992
|
},
|
|
1610
2993
|
get children() {
|
|
1611
|
-
var _el$
|
|
1612
|
-
_$insert(_el$
|
|
1613
|
-
return _el$
|
|
2994
|
+
var _el$196 = _$getNextElement(_tmpl$53);
|
|
2995
|
+
_$insert(_el$196, () => event.title);
|
|
2996
|
+
return _el$196;
|
|
1614
2997
|
}
|
|
1615
|
-
}), _el$
|
|
1616
|
-
_$insert(_el$
|
|
1617
|
-
_$insert(_el$
|
|
2998
|
+
}), _el$204, _co$53);
|
|
2999
|
+
_$insert(_el$197, () => formatTime(event.startDate, dateConfig()), _el$200, _co$51);
|
|
3000
|
+
_$insert(_el$197, () => formatTime(event.endDate, dateConfig()), _el$202, _co$52);
|
|
1618
3001
|
_$effect(_p$ => {
|
|
1619
|
-
var _v$
|
|
1620
|
-
_v$
|
|
1621
|
-
_v$
|
|
1622
|
-
_v$
|
|
3002
|
+
var _v$69 = `${layout.top}%`,
|
|
3003
|
+
_v$70 = `${layout.height}%`;
|
|
3004
|
+
_v$69 !== _p$.e && _$setStyleProperty(_el$194, "top", _p$.e = _v$69);
|
|
3005
|
+
_v$70 !== _p$.t && _$setStyleProperty(_el$194, "height", _p$.t = _v$70);
|
|
1623
3006
|
return _p$;
|
|
1624
3007
|
}, {
|
|
1625
3008
|
e: undefined,
|
|
1626
3009
|
t: undefined
|
|
1627
3010
|
});
|
|
1628
|
-
return _el$
|
|
3011
|
+
return _el$194;
|
|
1629
3012
|
})();
|
|
1630
3013
|
}
|
|
1631
|
-
}), _el$
|
|
1632
|
-
_$insert(_el$
|
|
3014
|
+
}), _el$188, _co$48);
|
|
3015
|
+
_$insert(_el$181, _$createComponent(For, {
|
|
1633
3016
|
get each() {
|
|
1634
3017
|
return layouts();
|
|
1635
3018
|
},
|
|
@@ -1672,13 +3055,13 @@ const TimeGridView = props => {
|
|
|
1672
3055
|
});
|
|
1673
3056
|
};
|
|
1674
3057
|
return (() => {
|
|
1675
|
-
var _el$
|
|
1676
|
-
_el$
|
|
1677
|
-
_el$
|
|
1678
|
-
[_el$
|
|
1679
|
-
_el$
|
|
1680
|
-
[_el$
|
|
1681
|
-
_$insert(_el$
|
|
3058
|
+
var _el$205 = _$getNextElement(_tmpl$56),
|
|
3059
|
+
_el$206 = _el$205.firstChild,
|
|
3060
|
+
_el$208 = _el$206.firstChild,
|
|
3061
|
+
[_el$209, _co$54] = _$getNextMarker(_el$208.nextSibling),
|
|
3062
|
+
_el$210 = _el$209.nextSibling,
|
|
3063
|
+
[_el$211, _co$55] = _$getNextMarker(_el$210.nextSibling);
|
|
3064
|
+
_$insert(_el$206, _$createComponent(EventChip, {
|
|
1682
3065
|
event: event,
|
|
1683
3066
|
get owner() {
|
|
1684
3067
|
return props.owner;
|
|
@@ -1693,32 +3076,32 @@ const TimeGridView = props => {
|
|
|
1693
3076
|
get onMovePointerDown() {
|
|
1694
3077
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startTimedMove(pointerEvent, event, markDragged) : undefined;
|
|
1695
3078
|
}
|
|
1696
|
-
}), _el$
|
|
1697
|
-
_$insert(_el$
|
|
3079
|
+
}), _el$209, _co$54);
|
|
3080
|
+
_$insert(_el$206, _$createComponent(Show, {
|
|
1698
3081
|
get when() {
|
|
1699
3082
|
return props.owner.onEventResize;
|
|
1700
3083
|
},
|
|
1701
3084
|
get children() {
|
|
1702
|
-
var _el$
|
|
1703
|
-
_el$
|
|
1704
|
-
_el$
|
|
1705
|
-
_$setAttribute(_el$
|
|
1706
|
-
_$effect(() => _$setAttribute(_el$
|
|
3085
|
+
var _el$207 = _$getNextElement(_tmpl$55);
|
|
3086
|
+
_el$207.addEventListener("dragstart", event => event.preventDefault());
|
|
3087
|
+
_el$207.$$pointerdown = resizeStart;
|
|
3088
|
+
_$setAttribute(_el$207, "draggable", false);
|
|
3089
|
+
_$effect(() => _$setAttribute(_el$207, "aria-label", messages().resizeEvent));
|
|
1707
3090
|
_$runHydrationEvents();
|
|
1708
|
-
return _el$
|
|
3091
|
+
return _el$207;
|
|
1709
3092
|
}
|
|
1710
|
-
}), _el$
|
|
3093
|
+
}), _el$211, _co$55);
|
|
1711
3094
|
_$effect(_p$ => {
|
|
1712
|
-
var _v$
|
|
1713
|
-
_v$
|
|
1714
|
-
_v$
|
|
1715
|
-
_v$
|
|
1716
|
-
_v$
|
|
1717
|
-
_v$
|
|
1718
|
-
_v$
|
|
1719
|
-
_v$
|
|
1720
|
-
_v$
|
|
1721
|
-
_v$
|
|
3095
|
+
var _v$71 = `${layout.top}%`,
|
|
3096
|
+
_v$72 = `${layout.height}%`,
|
|
3097
|
+
_v$73 = position.left,
|
|
3098
|
+
_v$74 = position.width,
|
|
3099
|
+
_v$75 = String(20 + layoutItem.lane);
|
|
3100
|
+
_v$71 !== _p$.e && _$setStyleProperty(_el$205, "top", _p$.e = _v$71);
|
|
3101
|
+
_v$72 !== _p$.t && _$setStyleProperty(_el$205, "height", _p$.t = _v$72);
|
|
3102
|
+
_v$73 !== _p$.a && _$setStyleProperty(_el$205, "left", _p$.a = _v$73);
|
|
3103
|
+
_v$74 !== _p$.o && _$setStyleProperty(_el$205, "width", _p$.o = _v$74);
|
|
3104
|
+
_v$75 !== _p$.i && _$setStyleProperty(_el$205, "z-index", _p$.i = _v$75);
|
|
1722
3105
|
return _p$;
|
|
1723
3106
|
}, {
|
|
1724
3107
|
e: undefined,
|
|
@@ -1727,11 +3110,11 @@ const TimeGridView = props => {
|
|
|
1727
3110
|
o: undefined,
|
|
1728
3111
|
i: undefined
|
|
1729
3112
|
});
|
|
1730
|
-
return _el$
|
|
3113
|
+
return _el$205;
|
|
1731
3114
|
})();
|
|
1732
3115
|
}
|
|
1733
|
-
}), _el$
|
|
1734
|
-
_$insert(_el$
|
|
3116
|
+
}), _el$190, _co$49);
|
|
3117
|
+
_$insert(_el$181, _$createComponent(For, {
|
|
1735
3118
|
get each() {
|
|
1736
3119
|
return overflowLayouts(layouts());
|
|
1737
3120
|
},
|
|
@@ -1740,27 +3123,27 @@ const TimeGridView = props => {
|
|
|
1740
3123
|
const key = `${dayKey}-${overflow.groupId}`;
|
|
1741
3124
|
const hiddenTitle = () => overflow.hiddenEvents.map(event => `${formatTime(event.startDate, dateConfig())} ${event.title}`).join("\n");
|
|
1742
3125
|
return [(() => {
|
|
1743
|
-
var _el$
|
|
1744
|
-
_el$
|
|
1745
|
-
_el$
|
|
1746
|
-
_el$
|
|
1747
|
-
[_el$
|
|
1748
|
-
_el$
|
|
3126
|
+
var _el$212 = _$getNextElement(_tmpl$57),
|
|
3127
|
+
_el$213 = _el$212.firstChild,
|
|
3128
|
+
_el$214 = _el$213.firstChild,
|
|
3129
|
+
_el$215 = _el$214.nextSibling,
|
|
3130
|
+
[_el$216, _co$56] = _$getNextMarker(_el$215.nextSibling);
|
|
3131
|
+
_el$212.$$click = event => {
|
|
1749
3132
|
event.stopPropagation();
|
|
1750
3133
|
setExpandedOverflow(expandedOverflow() === key ? "" : key);
|
|
1751
3134
|
};
|
|
1752
|
-
_$insert(_el$
|
|
3135
|
+
_$insert(_el$213, () => overflow.hiddenEvents.length, _el$216, _co$56);
|
|
1753
3136
|
_$effect(_p$ => {
|
|
1754
|
-
var _v$
|
|
1755
|
-
_v$
|
|
1756
|
-
_v$
|
|
1757
|
-
_v$
|
|
3137
|
+
var _v$76 = `${layout.top}%`,
|
|
3138
|
+
_v$77 = `${layout.height}%`,
|
|
3139
|
+
_v$78 = hiddenTitle(),
|
|
3140
|
+
_v$79 = messages().hiddenOverlappingEvents({
|
|
1758
3141
|
count: overflow.hiddenEvents.length
|
|
1759
3142
|
});
|
|
1760
|
-
_v$
|
|
1761
|
-
_v$
|
|
1762
|
-
_v$
|
|
1763
|
-
_v$
|
|
3143
|
+
_v$76 !== _p$.e && _$setStyleProperty(_el$212, "top", _p$.e = _v$76);
|
|
3144
|
+
_v$77 !== _p$.t && _$setStyleProperty(_el$212, "height", _p$.t = _v$77);
|
|
3145
|
+
_v$78 !== _p$.a && _$setAttribute(_el$212, "title", _p$.a = _v$78);
|
|
3146
|
+
_v$79 !== _p$.o && _$setAttribute(_el$212, "aria-label", _p$.o = _v$79);
|
|
1764
3147
|
return _p$;
|
|
1765
3148
|
}, {
|
|
1766
3149
|
e: undefined,
|
|
@@ -1769,24 +3152,24 @@ const TimeGridView = props => {
|
|
|
1769
3152
|
o: undefined
|
|
1770
3153
|
});
|
|
1771
3154
|
_$runHydrationEvents();
|
|
1772
|
-
return _el$
|
|
3155
|
+
return _el$212;
|
|
1773
3156
|
})(), _$createComponent(Show, {
|
|
1774
3157
|
get when() {
|
|
1775
3158
|
return expandedOverflow() === key;
|
|
1776
3159
|
},
|
|
1777
3160
|
get children() {
|
|
1778
|
-
var _el$
|
|
1779
|
-
_el$
|
|
1780
|
-
_el$
|
|
1781
|
-
[_el$
|
|
1782
|
-
_el$
|
|
1783
|
-
_el$
|
|
1784
|
-
[_el$
|
|
1785
|
-
_el$
|
|
1786
|
-
[_el$
|
|
1787
|
-
_$insert(_el$
|
|
1788
|
-
_$insert(_el$
|
|
1789
|
-
_$insert(_el$
|
|
3161
|
+
var _el$217 = _$getNextElement(_tmpl$58),
|
|
3162
|
+
_el$218 = _el$217.firstChild,
|
|
3163
|
+
_el$220 = _el$218.firstChild,
|
|
3164
|
+
[_el$221, _co$57] = _$getNextMarker(_el$220.nextSibling),
|
|
3165
|
+
_el$219 = _el$221.nextSibling,
|
|
3166
|
+
_el$222 = _el$219.nextSibling,
|
|
3167
|
+
[_el$223, _co$58] = _$getNextMarker(_el$222.nextSibling),
|
|
3168
|
+
_el$224 = _el$218.nextSibling,
|
|
3169
|
+
[_el$225, _co$59] = _$getNextMarker(_el$224.nextSibling);
|
|
3170
|
+
_$insert(_el$218, () => formatTime(overflow.groupStartDate, dateConfig()), _el$221, _co$57);
|
|
3171
|
+
_$insert(_el$218, () => formatTime(overflow.groupEndDate, dateConfig()), _el$223, _co$58);
|
|
3172
|
+
_$insert(_el$217, _$createComponent(For, {
|
|
1790
3173
|
get each() {
|
|
1791
3174
|
return overflow.hiddenEvents;
|
|
1792
3175
|
},
|
|
@@ -1800,41 +3183,41 @@ const TimeGridView = props => {
|
|
|
1800
3183
|
},
|
|
1801
3184
|
compact: true
|
|
1802
3185
|
})
|
|
1803
|
-
}), _el$
|
|
1804
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
1805
|
-
return _el$
|
|
3186
|
+
}), _el$225, _co$59);
|
|
3187
|
+
_$effect(_$p => _$setStyleProperty(_el$217, "top", `${layout.top}%`));
|
|
3188
|
+
return _el$217;
|
|
1806
3189
|
}
|
|
1807
3190
|
})];
|
|
1808
3191
|
}
|
|
1809
|
-
}), _el$
|
|
3192
|
+
}), _el$192, _co$50);
|
|
1810
3193
|
_$effect(_p$ => {
|
|
1811
|
-
var _v$
|
|
1812
|
-
_v$
|
|
1813
|
-
_v$
|
|
1814
|
-
_v$
|
|
3194
|
+
var _v$67 = dayColumnMinWidth(layouts()),
|
|
3195
|
+
_v$68 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3196
|
+
_v$67 !== _p$.e && _$setStyleProperty(_el$181, "min-width", _p$.e = _v$67);
|
|
3197
|
+
_v$68 !== _p$.t && _$setStyleProperty(_el$181, "grid-template-rows", _p$.t = _v$68);
|
|
1815
3198
|
return _p$;
|
|
1816
3199
|
}, {
|
|
1817
3200
|
e: undefined,
|
|
1818
3201
|
t: undefined
|
|
1819
3202
|
});
|
|
1820
|
-
return _el$
|
|
3203
|
+
return _el$181;
|
|
1821
3204
|
})();
|
|
1822
3205
|
}
|
|
1823
|
-
}), _el$
|
|
3206
|
+
}), _el$160, _co$39);
|
|
1824
3207
|
_$effect(_p$ => {
|
|
1825
|
-
var _v$
|
|
1826
|
-
_v$
|
|
1827
|
-
_v$
|
|
1828
|
-
_v$
|
|
1829
|
-
_v$
|
|
1830
|
-
_v$
|
|
3208
|
+
var _v$64 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
3209
|
+
_v$65 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
3210
|
+
_v$66 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3211
|
+
_v$64 !== _p$.e && _$setStyleProperty(_el$148, "grid-template-columns", _p$.e = _v$64);
|
|
3212
|
+
_v$65 !== _p$.t && _$setStyleProperty(_el$157, "grid-template-columns", _p$.t = _v$65);
|
|
3213
|
+
_v$66 !== _p$.a && _$setStyleProperty(_el$158, "grid-template-rows", _p$.a = _v$66);
|
|
1831
3214
|
return _p$;
|
|
1832
3215
|
}, {
|
|
1833
3216
|
e: undefined,
|
|
1834
3217
|
t: undefined,
|
|
1835
3218
|
a: undefined
|
|
1836
3219
|
});
|
|
1837
|
-
return _el$
|
|
3220
|
+
return _el$147;
|
|
1838
3221
|
})();
|
|
1839
3222
|
};
|
|
1840
3223
|
const YearView = props => {
|
|
@@ -1875,17 +3258,17 @@ const YearView = props => {
|
|
|
1875
3258
|
});
|
|
1876
3259
|
});
|
|
1877
3260
|
return (() => {
|
|
1878
|
-
var _el$
|
|
1879
|
-
_$insert(_el$
|
|
3261
|
+
var _el$226 = _$getNextElement(_tmpl$59);
|
|
3262
|
+
_$insert(_el$226, _$createComponent(For, {
|
|
1880
3263
|
get each() {
|
|
1881
3264
|
return months();
|
|
1882
3265
|
},
|
|
1883
3266
|
children: month => (() => {
|
|
1884
|
-
var _el$
|
|
1885
|
-
_el$
|
|
1886
|
-
_el$
|
|
1887
|
-
_$insert(_el$
|
|
1888
|
-
_$insert(_el$
|
|
3267
|
+
var _el$227 = _$getNextElement(_tmpl$60),
|
|
3268
|
+
_el$228 = _el$227.firstChild,
|
|
3269
|
+
_el$229 = _el$228.nextSibling;
|
|
3270
|
+
_$insert(_el$228, () => month.label);
|
|
3271
|
+
_$insert(_el$229, _$createComponent(For, {
|
|
1889
3272
|
get each() {
|
|
1890
3273
|
return month.days;
|
|
1891
3274
|
},
|
|
@@ -1909,32 +3292,32 @@ const YearView = props => {
|
|
|
1909
3292
|
return day.events[0];
|
|
1910
3293
|
},
|
|
1911
3294
|
children: event => (() => {
|
|
1912
|
-
var _el$
|
|
3295
|
+
var _el$230 = _$getNextElement(_tmpl$61);
|
|
1913
3296
|
_$effect(_p$ => {
|
|
1914
|
-
var _v$
|
|
1915
|
-
_v$
|
|
1916
|
-
_v$
|
|
3297
|
+
var _v$80 = event().colorHex ? undefined : event().color ?? "blue",
|
|
3298
|
+
_v$81 = day.isToday ? "true" : undefined,
|
|
3299
|
+
_v$82 = event().colorHex ? {
|
|
1917
3300
|
"background-color": day.isToday ? "white" : event().colorHex
|
|
1918
3301
|
} : undefined;
|
|
1919
|
-
_v$
|
|
1920
|
-
_v$
|
|
1921
|
-
_p$.a = _$style(_el$
|
|
3302
|
+
_v$80 !== _p$.e && _$setAttribute(_el$230, "data-color", _p$.e = _v$80);
|
|
3303
|
+
_v$81 !== _p$.t && _$setAttribute(_el$230, "data-today", _p$.t = _v$81);
|
|
3304
|
+
_p$.a = _$style(_el$230, _v$82, _p$.a);
|
|
1922
3305
|
return _p$;
|
|
1923
3306
|
}, {
|
|
1924
3307
|
e: undefined,
|
|
1925
3308
|
t: undefined,
|
|
1926
3309
|
a: undefined
|
|
1927
3310
|
});
|
|
1928
|
-
return _el$
|
|
3311
|
+
return _el$230;
|
|
1929
3312
|
})()
|
|
1930
3313
|
})];
|
|
1931
3314
|
}
|
|
1932
3315
|
})
|
|
1933
3316
|
}));
|
|
1934
|
-
return _el$
|
|
3317
|
+
return _el$227;
|
|
1935
3318
|
})()
|
|
1936
3319
|
}));
|
|
1937
|
-
return _el$
|
|
3320
|
+
return _el$226;
|
|
1938
3321
|
})();
|
|
1939
3322
|
};
|
|
1940
3323
|
const MobileMonthView = props => {
|
|
@@ -1942,14 +3325,14 @@ const MobileMonthView = props => {
|
|
|
1942
3325
|
const selectedDateKey = createMemo(() => calendar.formatDateKey(props.selectedDate, dateConfig()));
|
|
1943
3326
|
const selectedEvents = createMemo(() => props.events.filter(event => event.dayKey === selectedDateKey()));
|
|
1944
3327
|
return (() => {
|
|
1945
|
-
var _el$
|
|
1946
|
-
_el$
|
|
1947
|
-
[_el$
|
|
1948
|
-
_el$
|
|
1949
|
-
_el$
|
|
1950
|
-
_el$
|
|
1951
|
-
[_el$
|
|
1952
|
-
_$insert(_el$
|
|
3328
|
+
var _el$231 = _$getNextElement(_tmpl$63),
|
|
3329
|
+
_el$237 = _el$231.firstChild,
|
|
3330
|
+
[_el$238, _co$61] = _$getNextMarker(_el$237.nextSibling),
|
|
3331
|
+
_el$232 = _el$238.nextSibling,
|
|
3332
|
+
_el$233 = _el$232.firstChild,
|
|
3333
|
+
_el$235 = _el$233.nextSibling,
|
|
3334
|
+
[_el$236, _co$60] = _$getNextMarker(_el$235.nextSibling);
|
|
3335
|
+
_$insert(_el$231, _$createComponent(MonthPickerView, {
|
|
1953
3336
|
get owner() {
|
|
1954
3337
|
return {
|
|
1955
3338
|
...props.owner,
|
|
@@ -1969,27 +3352,27 @@ const MobileMonthView = props => {
|
|
|
1969
3352
|
return props.labels;
|
|
1970
3353
|
},
|
|
1971
3354
|
compact: true
|
|
1972
|
-
}), _el$
|
|
1973
|
-
_$insert(_el$
|
|
3355
|
+
}), _el$238, _co$61);
|
|
3356
|
+
_$insert(_el$233, () => props.selectedDate.toLocaleDateString(dateConfig().locale ?? "en", {
|
|
1974
3357
|
weekday: "long",
|
|
1975
3358
|
month: "long",
|
|
1976
3359
|
day: "numeric",
|
|
1977
3360
|
timeZone: dateConfig().timeZone
|
|
1978
3361
|
}));
|
|
1979
|
-
_$insert(_el$
|
|
3362
|
+
_$insert(_el$232, _$createComponent(Show, {
|
|
1980
3363
|
get when() {
|
|
1981
3364
|
return selectedEvents().length > 0;
|
|
1982
3365
|
},
|
|
1983
3366
|
get fallback() {
|
|
1984
3367
|
return (() => {
|
|
1985
|
-
var _el$
|
|
1986
|
-
_$insert(_el$
|
|
1987
|
-
return _el$
|
|
3368
|
+
var _el$239 = _$getNextElement(_tmpl$64);
|
|
3369
|
+
_$insert(_el$239, () => props.labels.noEvents);
|
|
3370
|
+
return _el$239;
|
|
1988
3371
|
})();
|
|
1989
3372
|
},
|
|
1990
3373
|
get children() {
|
|
1991
|
-
var _el$
|
|
1992
|
-
_$insert(_el$
|
|
3374
|
+
var _el$234 = _$getNextElement(_tmpl$62);
|
|
3375
|
+
_$insert(_el$234, _$createComponent(For, {
|
|
1993
3376
|
get each() {
|
|
1994
3377
|
return selectedEvents();
|
|
1995
3378
|
},
|
|
@@ -2003,16 +3386,16 @@ const MobileMonthView = props => {
|
|
|
2003
3386
|
}
|
|
2004
3387
|
})
|
|
2005
3388
|
}));
|
|
2006
|
-
return _el$
|
|
3389
|
+
return _el$234;
|
|
2007
3390
|
}
|
|
2008
|
-
}), _el$
|
|
2009
|
-
return _el$
|
|
3391
|
+
}), _el$236, _co$60);
|
|
3392
|
+
return _el$231;
|
|
2010
3393
|
})();
|
|
2011
3394
|
};
|
|
2012
3395
|
const CalendarBody = props => (() => {
|
|
2013
|
-
var _el$
|
|
2014
|
-
_$insert(_el$
|
|
2015
|
-
return _el$
|
|
3396
|
+
var _el$240 = _$getNextElement(_tmpl$65);
|
|
3397
|
+
_$insert(_el$240, () => props.children);
|
|
3398
|
+
return _el$240;
|
|
2016
3399
|
})();
|
|
2017
3400
|
const CalendarRoot = props => {
|
|
2018
3401
|
const messages = useUiMessages();
|
|
@@ -2034,6 +3417,8 @@ const CalendarRoot = props => {
|
|
|
2034
3417
|
const date = createMemo(() => safeDate(props.date));
|
|
2035
3418
|
const selectedDate = createMemo(() => safeDate(props.selectedDate ?? props.date));
|
|
2036
3419
|
const [now, setNow] = createSignal(new Date());
|
|
3420
|
+
/** The first day selected in the month view, so the view switcher opens the other views at it. */
|
|
3421
|
+
const [focusDay, setFocusDay] = createSignal(null);
|
|
2037
3422
|
const normalizedEvents = createMemo(() => normalizeEvents(props.events, dateConfig()));
|
|
2038
3423
|
const mergedLabels = createMemo(() => ({
|
|
2039
3424
|
today: messages().today,
|
|
@@ -2061,14 +3446,12 @@ const CalendarRoot = props => {
|
|
|
2061
3446
|
});
|
|
2062
3447
|
});
|
|
2063
3448
|
return (() => {
|
|
2064
|
-
var _el$
|
|
2065
|
-
_el$
|
|
2066
|
-
[_el$
|
|
2067
|
-
_el$
|
|
2068
|
-
[_el$
|
|
2069
|
-
|
|
2070
|
-
[_el$178, _co$47] = _$getNextMarker(_el$177.nextSibling);
|
|
2071
|
-
_$insert(_el$172, _$createComponent(CalendarHeader, {
|
|
3449
|
+
var _el$241 = _$getNextElement(_tmpl$66),
|
|
3450
|
+
_el$242 = _el$241.firstChild,
|
|
3451
|
+
[_el$243, _co$62] = _$getNextMarker(_el$242.nextSibling),
|
|
3452
|
+
_el$244 = _el$243.nextSibling,
|
|
3453
|
+
[_el$245, _co$63] = _$getNextMarker(_el$244.nextSibling);
|
|
3454
|
+
_$insert(_el$241, _$createComponent(CalendarHeader, {
|
|
2072
3455
|
get date() {
|
|
2073
3456
|
return date();
|
|
2074
3457
|
},
|
|
@@ -2078,10 +3461,12 @@ const CalendarRoot = props => {
|
|
|
2078
3461
|
get labels() {
|
|
2079
3462
|
return mergedLabels();
|
|
2080
3463
|
},
|
|
2081
|
-
owner: owner
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
3464
|
+
owner: owner,
|
|
3465
|
+
get focusDay() {
|
|
3466
|
+
return _$memo(() => view() === "month")() ? focusDay() : null;
|
|
3467
|
+
}
|
|
3468
|
+
}), _el$243, _co$62);
|
|
3469
|
+
_$insert(_el$241, _$createComponent(Show, {
|
|
2085
3470
|
get when() {
|
|
2086
3471
|
return !custom();
|
|
2087
3472
|
},
|
|
@@ -2113,7 +3498,8 @@ const CalendarRoot = props => {
|
|
|
2113
3498
|
},
|
|
2114
3499
|
get labels() {
|
|
2115
3500
|
return mergedLabels();
|
|
2116
|
-
}
|
|
3501
|
+
},
|
|
3502
|
+
onFocusDay: setFocusDay
|
|
2117
3503
|
});
|
|
2118
3504
|
}
|
|
2119
3505
|
});
|
|
@@ -2196,18 +3582,18 @@ const CalendarRoot = props => {
|
|
|
2196
3582
|
}
|
|
2197
3583
|
});
|
|
2198
3584
|
}
|
|
2199
|
-
}), _el$
|
|
3585
|
+
}), _el$245, _co$63);
|
|
2200
3586
|
_$effect(_p$ => {
|
|
2201
|
-
var _v$
|
|
2202
|
-
_v$
|
|
2203
|
-
_v$
|
|
2204
|
-
_v$
|
|
3587
|
+
var _v$83 = `k2b-content-calendar ${props.class ?? ""}`,
|
|
3588
|
+
_v$84 = props.navigationPending ? "true" : undefined;
|
|
3589
|
+
_v$83 !== _p$.e && _$className(_el$241, _p$.e = _v$83);
|
|
3590
|
+
_v$84 !== _p$.t && _$setAttribute(_el$241, "aria-busy", _p$.t = _v$84);
|
|
2205
3591
|
return _p$;
|
|
2206
3592
|
}, {
|
|
2207
3593
|
e: undefined,
|
|
2208
3594
|
t: undefined
|
|
2209
3595
|
});
|
|
2210
|
-
return _el$
|
|
3596
|
+
return _el$241;
|
|
2211
3597
|
})();
|
|
2212
3598
|
};
|
|
2213
3599
|
|
|
@@ -2217,5 +3603,5 @@ function Calendar(props) {
|
|
|
2217
3603
|
return CalendarRoot(props);
|
|
2218
3604
|
}
|
|
2219
3605
|
export default Calendar;
|
|
2220
|
-
_$delegateEvents(["click", "dblclick", "pointerdown", "keydown"]);
|
|
3606
|
+
_$delegateEvents(["click", "dblclick", "pointerdown", "keydown", "contextmenu", "focusin"]);
|
|
2221
3607
|
//# sourceMappingURL=Calendar.js.map
|