@k2b/ui 0.22.0 → 0.23.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/content/Calendar.js +1086 -1049
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1187 -0
- package/dist/browser/content/CalendarDayView.js.map +1 -0
- package/dist/browser/content/CalendarWeekView.js +1571 -0
- package/dist/browser/content/CalendarWeekView.js.map +1 -0
- package/dist/browser/content/ChartExplorer.js +174 -82
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartFilterControls.js +90 -33
- package/dist/browser/content/ChartFilterControls.js.map +1 -1
- package/dist/browser/content/DataTable.js +199 -171
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +98 -0
- package/dist/browser/content/calendar-day-scroll.js.map +1 -0
- package/dist/browser/content/calendar-days.js +408 -0
- package/dist/browser/content/calendar-days.js.map +1 -0
- package/dist/browser/content/calendar-dialogs.js +236 -0
- package/dist/browser/content/calendar-dialogs.js.map +1 -0
- package/dist/browser/content/calendar-messages.js +210 -2
- package/dist/browser/content/calendar-messages.js.map +1 -1
- package/dist/browser/content/calendar-pointer.js +15 -3
- package/dist/browser/content/calendar-pointer.js.map +1 -1
- package/dist/browser/content/calendar-shared.js +328 -0
- package/dist/browser/content/calendar-shared.js.map +1 -0
- package/dist/browser/content/calendar-time-view.js +1649 -0
- package/dist/browser/content/calendar-time-view.js.map +1 -0
- package/dist/browser/content/chart-messages.js +10 -0
- package/dist/browser/content/chart-messages.js.map +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +0 -1
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +123 -97
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +4 -1
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +164 -86
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +18 -6
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/content/Calendar.js +524 -335
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +800 -0
- package/dist/ssr/content/CalendarDayView.js.map +1 -0
- package/dist/ssr/content/CalendarWeekView.js +1069 -0
- package/dist/ssr/content/CalendarWeekView.js.map +1 -0
- package/dist/ssr/content/ChartExplorer.js +93 -34
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartFilterControls.js +49 -7
- package/dist/ssr/content/ChartFilterControls.js.map +1 -1
- package/dist/ssr/content/DataTable.js +69 -51
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +98 -0
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -0
- package/dist/ssr/content/calendar-days.js +408 -0
- package/dist/ssr/content/calendar-days.js.map +1 -0
- package/dist/ssr/content/calendar-dialogs.js +159 -0
- package/dist/ssr/content/calendar-dialogs.js.map +1 -0
- package/dist/ssr/content/calendar-messages.js +210 -2
- package/dist/ssr/content/calendar-messages.js.map +1 -1
- package/dist/ssr/content/calendar-pointer.js +15 -3
- package/dist/ssr/content/calendar-pointer.js.map +1 -1
- package/dist/ssr/content/calendar-shared.js +261 -0
- package/dist/ssr/content/calendar-shared.js.map +1 -0
- package/dist/ssr/content/calendar-time-view.js +1306 -0
- package/dist/ssr/content/calendar-time-view.js.map +1 -0
- package/dist/ssr/content/chart-messages.js +10 -0
- package/dist/ssr/content/chart-messages.js.map +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +38 -29
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +4 -1
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +164 -86
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +2 -2
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/content/Calendar.d.ts +91 -0
- package/dist/types/content/CalendarDayView.d.ts +7 -0
- package/dist/types/content/CalendarWeekView.d.ts +7 -0
- package/dist/types/content/ChartExplorer.d.ts +36 -1
- package/dist/types/content/ChartFilterControls.d.ts +6 -1
- package/dist/types/content/DataTable.d.ts +5 -0
- package/dist/types/content/calendar-day-scroll.d.ts +42 -0
- package/dist/types/content/calendar-days.d.ts +192 -0
- package/dist/types/content/calendar-dialogs.d.ts +22 -0
- package/dist/types/content/calendar-messages.d.ts +99 -0
- package/dist/types/content/calendar-pointer.d.ts +9 -0
- package/dist/types/content/calendar-shared.d.ts +69 -0
- package/dist/types/content/calendar-time-view.d.ts +252 -0
- package/dist/types/content/chart-messages.d.ts +5 -0
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/layout/AppWorkspace.d.ts +25 -3
- package/dist/types/layout/PageTitle.d.ts +2 -1
- package/dist/types/layout/app-workspace-controller.d.ts +9 -1
- package/dist/types/surfaces/StatCell.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,88 +1,80 @@
|
|
|
1
1
|
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
|
+
import { style as _$style } from "solid-js/web";
|
|
4
5
|
import { setStyleProperty as _$setStyleProperty } from "solid-js/web";
|
|
6
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
7
|
+
import { memo as _$memo } from "solid-js/web";
|
|
5
8
|
import { className as _$className } from "solid-js/web";
|
|
6
|
-
import { spread as _$spread } from "solid-js/web";
|
|
7
|
-
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
8
|
-
import { style as _$style } from "solid-js/web";
|
|
9
9
|
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
10
10
|
import { effect as _$effect } from "solid-js/web";
|
|
11
|
-
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
12
|
-
import { addEventListener as _$addEventListener } from "solid-js/web";
|
|
13
|
-
import { memo as _$memo } from "solid-js/web";
|
|
14
|
-
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
15
11
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
16
12
|
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
13
|
+
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
17
14
|
import { insert as _$insert } from "solid-js/web";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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$
|
|
65
|
-
_tmpl$
|
|
66
|
-
_tmpl$
|
|
67
|
-
_tmpl$
|
|
68
|
-
_tmpl$
|
|
69
|
-
_tmpl$
|
|
70
|
-
_tmpl$
|
|
71
|
-
_tmpl$
|
|
72
|
-
_tmpl$
|
|
73
|
-
_tmpl$
|
|
74
|
-
_tmpl$
|
|
75
|
-
_tmpl$
|
|
76
|
-
_tmpl$
|
|
77
|
-
_tmpl$
|
|
78
|
-
_tmpl$
|
|
79
|
-
_tmpl$
|
|
80
|
-
_tmpl$
|
|
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><!$><!/><!$><!/>`);
|
|
15
|
+
import { spread as _$spread } from "solid-js/web";
|
|
16
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
17
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<a>`),
|
|
18
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<div role=radiogroup aria-orientation=horizontal class="k2b-segmented-control k2b-calendar-view-switcher">`),
|
|
19
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<i>`),
|
|
20
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-header__nav-button><i>`),
|
|
21
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<i class="ti ti-arrow-narrow-right k2b-calendar-header__today-direction"aria-hidden=true>`),
|
|
22
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<i class="ti ti-point k2b-calendar-header__today-direction"aria-hidden=true>`),
|
|
23
|
+
_tmpl$7 = /*#__PURE__*/_$template(`<span class=k2b-button__label>`),
|
|
24
|
+
_tmpl$8 = /*#__PURE__*/_$template(`<div class=k2b-calendar-header__content>`),
|
|
25
|
+
_tmpl$9 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-header__shortcuts><i class="ti ti-keyboard"aria-hidden=true>`),
|
|
26
|
+
_tmpl$0 = /*#__PURE__*/_$template(`<span class=k2b-calendar-header__progress aria-hidden=true>`),
|
|
27
|
+
_tmpl$1 = /*#__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><!$><!/>`),
|
|
28
|
+
_tmpl$10 = /*#__PURE__*/_$template(`<span class=k2b-calendar-header__title-size aria-hidden=true>`),
|
|
29
|
+
_tmpl$11 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekday>`),
|
|
30
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month><div class=k2b-calendar-month__weekdays><!$><!/><!$><!/></div><!$><!/>`),
|
|
31
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week-number>`),
|
|
32
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week><!$><!/><!$><!/>`),
|
|
33
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__day-target data-interactive=true>`),
|
|
34
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<div class=k2b-calendar-preview>`),
|
|
35
|
+
_tmpl$17 = /*#__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>`),
|
|
36
|
+
_tmpl$18 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__day-number>`),
|
|
37
|
+
_tmpl$19 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__badge><!$><!/><!$><!/>`),
|
|
38
|
+
_tmpl$20 = /*#__PURE__*/_$template(`<span class=k2b-calendar-dot>`),
|
|
39
|
+
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekday role=columnheader>`),
|
|
40
|
+
_tmpl$22 = /*#__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><!$><!/>`),
|
|
41
|
+
_tmpl$23 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week-number role=rowheader>`),
|
|
42
|
+
_tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week role=row><!$><!/><!$><!/>`),
|
|
43
|
+
_tmpl$25 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__week-link tabindex=-1>`),
|
|
44
|
+
_tmpl$26 = /*#__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>+<!$><!/>`),
|
|
45
|
+
_tmpl$27 = /*#__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><!$><!/><!$><!/><!$><!/>`),
|
|
46
|
+
_tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment data-bar=true>`),
|
|
47
|
+
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment style=--k2b-calendar-span:1>`),
|
|
48
|
+
_tmpl$30 = /*#__PURE__*/_$template(`<ul class=k2b-calendar-day-list__events>`),
|
|
49
|
+
_tmpl$31 = /*#__PURE__*/_$template(`<i class="ti ti-plus"aria-hidden=true>`),
|
|
50
|
+
_tmpl$32 = /*#__PURE__*/_$template(`<div class=k2b-calendar-day-list><div class=k2b-calendar-day-list__title></div><!$><!/><div class=k2b-calendar-day-list__actions><!$><!/><!$><!/>`),
|
|
51
|
+
_tmpl$33 = /*#__PURE__*/_$template(`<p class=k2b-calendar-day-list__empty>`),
|
|
52
|
+
_tmpl$34 = /*#__PURE__*/_$template(`<li>`),
|
|
53
|
+
_tmpl$35 = /*#__PURE__*/_$template(`<i class="ti ti-zoom-in"aria-hidden=true>`),
|
|
54
|
+
_tmpl$36 = /*#__PURE__*/_$template(`<div class=k2b-calendar-popover popover=auto role=dialog>`),
|
|
55
|
+
_tmpl$37 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day><div class=k2b-calendar-time-grid__all-day-label></div><!$><!/>`),
|
|
56
|
+
_tmpl$38 = /*#__PURE__*/_$template(`<div class="k2b-calendar-time-grid k2b-detail-trail"><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><!$><!/>`),
|
|
57
|
+
_tmpl$39 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__day-label>`),
|
|
58
|
+
_tmpl$40 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__badge><!$><!/><!$><!/>`),
|
|
59
|
+
_tmpl$41 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day-cell><div class=k2b-calendar-time-grid__all-day-events><!$><!/><!$><!/>`),
|
|
60
|
+
_tmpl$42 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__hour><!$><!/>:00`),
|
|
61
|
+
_tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__now>`),
|
|
62
|
+
_tmpl$44 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__column><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
63
|
+
_tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__slot>`),
|
|
64
|
+
_tmpl$46 = /*#__PURE__*/_$template(`<div class=k2b-calendar-preview__title>`),
|
|
65
|
+
_tmpl$47 = /*#__PURE__*/_$template(`<div class="k2b-calendar-preview k2b-calendar-preview--timed"><div class=k2b-calendar-preview__content><!$><!/><div class=k2b-calendar-preview__label><!$><!/> - <!$><!/>`),
|
|
66
|
+
_tmpl$48 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__resize><span class=k2b-calendar-time-grid__resize-icon aria-hidden=true>`),
|
|
67
|
+
_tmpl$49 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__event-position><div class=k2b-calendar-time-grid__event-frame><!$><!/><!$><!/>`),
|
|
68
|
+
_tmpl$50 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__overflow><span class=k2b-calendar-time-grid__overflow-count>+<!$><!/>`),
|
|
69
|
+
_tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__overflow-menu><div class=k2b-calendar-time-grid__overflow-title><!$><!/> - <!$><!/></div><!$><!/>`),
|
|
70
|
+
_tmpl$52 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year>`),
|
|
71
|
+
_tmpl$53 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year__month><div class=k2b-calendar-year__title></div><div class=k2b-calendar-year__grid>`),
|
|
72
|
+
_tmpl$54 = /*#__PURE__*/_$template(`<span class=k2b-calendar-year__indicator>`),
|
|
73
|
+
_tmpl$55 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__events>`),
|
|
74
|
+
_tmpl$56 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month><!$><!/><div class=k2b-calendar-mobile-month__agenda><div class=k2b-calendar-mobile-month__title></div><!$><!/>`),
|
|
75
|
+
_tmpl$57 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__empty>`),
|
|
76
|
+
_tmpl$58 = /*#__PURE__*/_$template(`<div class=k2b-calendar-body>`),
|
|
77
|
+
_tmpl$59 = /*#__PURE__*/_$template(`<section><!$><!/><!$><!/>`);
|
|
86
78
|
import { Link } from "@k2b/ssr/nav";
|
|
87
79
|
import { dates as calendar } from "@k2b/stdlib";
|
|
88
80
|
import { createEffect, createMemo, createSignal, For, mergeProps, on, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
@@ -91,31 +83,29 @@ import { GestureMenu } from "../actions/GestureMenu";
|
|
|
91
83
|
import SegmentedControl from "../actions/SegmentedControl";
|
|
92
84
|
import { useDateConfigLocale } from "../intl/locale";
|
|
93
85
|
import { useUiMessages } from "../intl/messages";
|
|
86
|
+
import { CalendarDayView } from "./CalendarDayView";
|
|
87
|
+
import { CalendarWeekView } from "./CalendarWeekView";
|
|
88
|
+
import { openCalendarGoTo, openCalendarShortcuts } from "./calendar-dialogs";
|
|
94
89
|
import { layoutCalendarIntervals } from "./calendar-event-layout";
|
|
95
90
|
import { useCalendarMessages } from "./calendar-messages";
|
|
96
91
|
import { fitMonthWeek, layoutMonthWeek, monthLaneCapacity } from "./calendar-month-layout";
|
|
97
92
|
import { calendarDayIndexAtPoint, calendarMinuteAtPoint, startCalendarPointerSession } from "./calendar-pointer";
|
|
93
|
+
import { EventChip, eventHref, followCalendarHref, formatTime, ownerDateConfig, parseDate, placeCalendarPopover, textWidth, validDate } from "./calendar-shared";
|
|
94
|
+
import { compactGermanDate } from "./calendar-time-view";
|
|
98
95
|
|
|
99
|
-
/**
|
|
96
|
+
/** The days a host loaded events for, from the first day `from` up to `to`, both `YYYY-MM-DD` or dates. */
|
|
100
97
|
|
|
101
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* An action the calendar offers for keyboard shortcuts, the command palette, and its shortcuts dialog. The calendar
|
|
100
|
+
* publishes its own through `onCommandsChange`; the host registers them with its shortcut dispatcher.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/** An entry dragged into the day or week view from outside the calendar, such as a task from a list below it. */
|
|
104
|
+
|
|
105
|
+
/** Actions of the calendar that the host starts from its own controls. */
|
|
106
|
+
|
|
107
|
+
/** A view the application adds to the switcher; the calendar shows its header and toolbar, the application the body. */
|
|
102
108
|
|
|
103
|
-
const ownerDateConfig = owner => ({
|
|
104
|
-
...owner.dateConfig,
|
|
105
|
-
timeZone: owner.timeZone ?? owner.dateConfig?.timeZone,
|
|
106
|
-
firstDayOfWeek: owner.firstDayOfWeek ?? owner.dateConfig?.firstDayOfWeek ?? owner.dateConfig?.weekStartsOn ?? 1
|
|
107
|
-
});
|
|
108
|
-
const dateOnlyPattern = /^\d{4}-\d{2}-\d{2}$/;
|
|
109
|
-
const parseDate = (value, context) => {
|
|
110
|
-
if (value instanceof Date) return new Date(value);
|
|
111
|
-
if (dateOnlyPattern.test(value)) return calendar.parseCalendarDate(value, context);
|
|
112
|
-
const normalized = value.includes("T") ? value : value.replace(" ", "T");
|
|
113
|
-
const parsed = new Date(normalized);
|
|
114
|
-
if (!Number.isNaN(parsed.getTime())) return parsed;
|
|
115
|
-
const [year, month = "1", day = "1"] = value.split("-");
|
|
116
|
-
return new Date(Number(year), Number(month) - 1, Number(day), 12);
|
|
117
|
-
};
|
|
118
|
-
const validDate = value => !Number.isNaN(value.getTime());
|
|
119
109
|
const weekNumber = date => {
|
|
120
110
|
const target = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
121
111
|
const day = target.getUTCDay() || 7;
|
|
@@ -128,7 +118,6 @@ const zonedWeekNumber = (date, context) => {
|
|
|
128
118
|
const [year = "1970", month = "1", day = "1"] = calendar.formatDateKey(date, context).split("-");
|
|
129
119
|
return weekNumber(new Date(Date.UTC(Number(year), Number(month) - 1, Number(day))));
|
|
130
120
|
};
|
|
131
|
-
const formatTime = (date, context) => calendar.formatTime(date, context);
|
|
132
121
|
const formatDay = (date, context) => date.toLocaleDateString(context?.locale ?? "en", {
|
|
133
122
|
weekday: "short",
|
|
134
123
|
day: "numeric",
|
|
@@ -207,7 +196,6 @@ const normalizeEvents = (events, context) => events.flatMap(event => {
|
|
|
207
196
|
}
|
|
208
197
|
return days;
|
|
209
198
|
});
|
|
210
|
-
const eventHref = (props, event) => props.getEventHref?.(event) ?? event.href;
|
|
211
199
|
const moveEventTo = (event, target, allDay = false, context) => {
|
|
212
200
|
const duration = Math.max(30 * 60 * 1000, event.sourceEndDate.getTime() - event.sourceStartDate.getTime());
|
|
213
201
|
const start = allDay ? startOfDay(target, context) : new Date(target);
|
|
@@ -254,299 +242,6 @@ const timedEventLayouts = events => {
|
|
|
254
242
|
groupEndDate: new Date(groupEnd)
|
|
255
243
|
}));
|
|
256
244
|
};
|
|
257
|
-
const EventChip = props => {
|
|
258
|
-
const calendarMessages = useCalendarMessages();
|
|
259
|
-
const dateConfig = createMemo(() => ownerDateConfig(props.owner));
|
|
260
|
-
const color = () => props.event.color ?? "blue";
|
|
261
|
-
const selected = () => Boolean(props.owner.selectedEventId) && props.owner.selectedEventId === props.event.id;
|
|
262
|
-
const style = () => props.event.colorHex ? {
|
|
263
|
-
"--k2b-calendar-accent": props.event.colorHex
|
|
264
|
-
} : undefined;
|
|
265
|
-
const isInteractive = () => Boolean(props.owner.onEventActivate);
|
|
266
|
-
const durationHours = () => (props.event.endDate.getTime() - props.event.startDate.getTime()) / 3_600_000;
|
|
267
|
-
const short = () => Boolean(props.fill && !props.event.allDay && durationHours() < 0.75);
|
|
268
|
-
const showTime = () => !props.event.allDay && !props.compact && durationHours() >= 0.75;
|
|
269
|
-
const showLocation = () => Boolean(props.event.location && !props.compact && durationHours() >= 1.25);
|
|
270
|
-
const showDescription = () => Boolean(props.event.description?.trim() && props.fill && !props.event.allDay && !props.compact && durationHours() >= 1.5);
|
|
271
|
-
const timeLabel = () => `${formatTime(props.event.startDate, dateConfig())} - ${formatTime(props.event.endDate, dateConfig())}`;
|
|
272
|
-
const ariaLabel = () => {
|
|
273
|
-
const label = props.label ? props.label : props.event.allDay ? props.event.title : calendarMessages().calendarEventTime({
|
|
274
|
-
title: props.event.title,
|
|
275
|
-
start: formatTime(props.event.startDate, dateConfig()),
|
|
276
|
-
end: formatTime(props.event.endDate, dateConfig())
|
|
277
|
-
});
|
|
278
|
-
return props.event.accessibleDetail ? `${label}, ${props.event.accessibleDetail}` : label;
|
|
279
|
-
};
|
|
280
|
-
const renderedEvent = () => props.owner.renderEvent?.(props.event, {
|
|
281
|
-
compact: props.compact ?? false,
|
|
282
|
-
fill: props.fill ?? false,
|
|
283
|
-
start: props.event.startDate,
|
|
284
|
-
end: props.event.endDate,
|
|
285
|
-
allDay: props.event.allDay ?? false,
|
|
286
|
-
durationHours: durationHours(),
|
|
287
|
-
timeLabel: timeLabel(),
|
|
288
|
-
leadingTime: props.leadingTime
|
|
289
|
-
});
|
|
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, {
|
|
306
|
-
get when() {
|
|
307
|
-
return props.event.display === "marker";
|
|
308
|
-
},
|
|
309
|
-
get children() {
|
|
310
|
-
return _$getNextElement(_tmpl$2);
|
|
311
|
-
}
|
|
312
|
-
}), _el$5, _co$);
|
|
313
|
-
_$insert(_el$2, () => props.event.title, _el$7, _co$2);
|
|
314
|
-
return _el$2;
|
|
315
|
-
})(), _$createComponent(Show, {
|
|
316
|
-
get when() {
|
|
317
|
-
return showTime();
|
|
318
|
-
},
|
|
319
|
-
get children() {
|
|
320
|
-
var _el$8 = _$getNextElement(_tmpl$4);
|
|
321
|
-
_$insert(_el$8, timeLabel);
|
|
322
|
-
return _el$8;
|
|
323
|
-
}
|
|
324
|
-
}), _$createComponent(Show, {
|
|
325
|
-
get when() {
|
|
326
|
-
return showLocation();
|
|
327
|
-
},
|
|
328
|
-
get children() {
|
|
329
|
-
var _el$9 = _$getNextElement(_tmpl$4);
|
|
330
|
-
_$insert(_el$9, () => props.event.location);
|
|
331
|
-
return _el$9;
|
|
332
|
-
}
|
|
333
|
-
}), _$createComponent(Show, {
|
|
334
|
-
get when() {
|
|
335
|
-
return showDescription();
|
|
336
|
-
},
|
|
337
|
-
get children() {
|
|
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;
|
|
360
|
-
}
|
|
361
|
-
})];
|
|
362
|
-
const isActionable = () => isInteractive() || Boolean(props.onMovePointerDown);
|
|
363
|
-
let suppressClickUntil = 0;
|
|
364
|
-
const onClick = event => {
|
|
365
|
-
if (performance.now() < suppressClickUntil) {
|
|
366
|
-
event.preventDefault();
|
|
367
|
-
event.stopPropagation();
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (!props.owner.onEventActivate || props.owner.eventActivation === "double") return;
|
|
371
|
-
event.preventDefault();
|
|
372
|
-
event.stopPropagation();
|
|
373
|
-
props.owner.onEventActivate(props.event);
|
|
374
|
-
};
|
|
375
|
-
const onDoubleClick = event => {
|
|
376
|
-
if (!props.owner.onEventActivate || props.owner.eventActivation !== "double") return;
|
|
377
|
-
event.preventDefault();
|
|
378
|
-
event.stopPropagation();
|
|
379
|
-
props.owner.onEventActivate(props.event);
|
|
380
|
-
};
|
|
381
|
-
const onButtonKeyDown = event => {
|
|
382
|
-
if (!isInteractive() || event.key !== "Enter" && event.key !== " ") return;
|
|
383
|
-
event.preventDefault();
|
|
384
|
-
props.owner.onEventActivate?.(props.event);
|
|
385
|
-
};
|
|
386
|
-
const onPointerDown = event => {
|
|
387
|
-
if (event.pointerType === "touch") return;
|
|
388
|
-
if (props.onMovePointerDown) event.stopPropagation();
|
|
389
|
-
props.onMovePointerDown?.(event, () => {
|
|
390
|
-
suppressClickUntil = performance.now() + 400;
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
return props.href ? (() => {
|
|
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);
|
|
400
|
-
_$effect(_p$ => {
|
|
401
|
-
var _v$ = props.href,
|
|
402
|
-
_v$2 = props.event.colorHex ? undefined : color(),
|
|
403
|
-
_v$3 = selected() ? "true" : undefined,
|
|
404
|
-
_v$4 = props.compact ? "true" : undefined,
|
|
405
|
-
_v$5 = props.fill ? "true" : undefined,
|
|
406
|
-
_v$6 = short() ? "true" : undefined,
|
|
407
|
-
_v$7 = props.moving ? "true" : undefined,
|
|
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);
|
|
433
|
-
return _p$;
|
|
434
|
-
}, {
|
|
435
|
-
e: undefined,
|
|
436
|
-
t: undefined,
|
|
437
|
-
a: undefined,
|
|
438
|
-
o: undefined,
|
|
439
|
-
i: undefined,
|
|
440
|
-
n: undefined,
|
|
441
|
-
s: undefined,
|
|
442
|
-
h: undefined,
|
|
443
|
-
r: undefined,
|
|
444
|
-
d: undefined,
|
|
445
|
-
l: undefined,
|
|
446
|
-
u: undefined,
|
|
447
|
-
c: undefined,
|
|
448
|
-
w: undefined,
|
|
449
|
-
m: undefined,
|
|
450
|
-
f: undefined
|
|
451
|
-
});
|
|
452
|
-
_$runHydrationEvents();
|
|
453
|
-
return _el$11;
|
|
454
|
-
})() : isActionable() ? (() => {
|
|
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);
|
|
461
|
-
_$effect(_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);
|
|
486
|
-
return _p$;
|
|
487
|
-
}, {
|
|
488
|
-
e: undefined,
|
|
489
|
-
t: undefined,
|
|
490
|
-
a: undefined,
|
|
491
|
-
o: undefined,
|
|
492
|
-
i: undefined,
|
|
493
|
-
n: undefined,
|
|
494
|
-
s: undefined,
|
|
495
|
-
h: undefined,
|
|
496
|
-
r: undefined,
|
|
497
|
-
d: undefined,
|
|
498
|
-
l: undefined,
|
|
499
|
-
u: undefined
|
|
500
|
-
});
|
|
501
|
-
_$runHydrationEvents();
|
|
502
|
-
return _el$12;
|
|
503
|
-
})() : (() => {
|
|
504
|
-
var _el$13 = _$getNextElement(_tmpl$0);
|
|
505
|
-
_$setAttribute(_el$13, "data-interactive", undefined);
|
|
506
|
-
_$insert(_el$13, content);
|
|
507
|
-
_$effect(_p$ => {
|
|
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);
|
|
532
|
-
return _p$;
|
|
533
|
-
}, {
|
|
534
|
-
e: undefined,
|
|
535
|
-
t: undefined,
|
|
536
|
-
a: undefined,
|
|
537
|
-
o: undefined,
|
|
538
|
-
i: undefined,
|
|
539
|
-
n: undefined,
|
|
540
|
-
s: undefined,
|
|
541
|
-
h: undefined,
|
|
542
|
-
r: undefined,
|
|
543
|
-
d: undefined,
|
|
544
|
-
l: undefined,
|
|
545
|
-
u: undefined
|
|
546
|
-
});
|
|
547
|
-
return _el$13;
|
|
548
|
-
})();
|
|
549
|
-
};
|
|
550
245
|
const slotInteractionProps = (owner, slot, suppressed, nativeControl = false) => {
|
|
551
246
|
const isSlotChild = event => {
|
|
552
247
|
if (!(event.target instanceof Element)) return false;
|
|
@@ -575,20 +270,28 @@ const slotInteractionProps = (owner, slot, suppressed, nativeControl = false) =>
|
|
|
575
270
|
}
|
|
576
271
|
};
|
|
577
272
|
};
|
|
273
|
+
const plainClick = event => !event.defaultPrevented && event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
274
|
+
|
|
578
275
|
/** A real anchor is the baseline; the optional handler only enhances it after hydration. */
|
|
579
276
|
const CalendarNavigationLink = props => {
|
|
580
277
|
const preload = () => props.owner.onPrefetch?.(props.href);
|
|
278
|
+
const intercepted = event => {
|
|
279
|
+
if (!props.intercept || !plainClick(event) || !props.intercept()) return false;
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
return true;
|
|
282
|
+
};
|
|
581
283
|
const navigateHref = event => {
|
|
284
|
+
if (intercepted(event)) return;
|
|
582
285
|
const anchor = event.currentTarget;
|
|
583
|
-
if (event
|
|
286
|
+
if (!plainClick(event) || anchor.target && anchor.target !== "_self" || anchor.hasAttribute("download") || new URL(anchor.href).origin !== window.location.origin) {
|
|
584
287
|
return;
|
|
585
288
|
}
|
|
586
289
|
event.preventDefault();
|
|
587
290
|
props.owner.onNavigateHref?.(props.href);
|
|
588
291
|
};
|
|
589
292
|
return props.owner.onNavigateHref ? (() => {
|
|
590
|
-
var _el$
|
|
591
|
-
_$spread(_el
|
|
293
|
+
var _el$ = _$getNextElement(_tmpl$);
|
|
294
|
+
_$spread(_el$, _$mergeProps(() => props.anchorProps, {
|
|
592
295
|
get href() {
|
|
593
296
|
return props.href;
|
|
594
297
|
},
|
|
@@ -596,9 +299,9 @@ const CalendarNavigationLink = props => {
|
|
|
596
299
|
"onPointerEnter": preload,
|
|
597
300
|
"onFocus": preload
|
|
598
301
|
}), false, true);
|
|
599
|
-
_$insert(_el
|
|
302
|
+
_$insert(_el$, () => props.children);
|
|
600
303
|
_$runHydrationEvents();
|
|
601
|
-
return _el
|
|
304
|
+
return _el$;
|
|
602
305
|
})() : props.owner.onNavigate ? _$createComponent(Link, _$mergeProps(() => props.anchorProps, {
|
|
603
306
|
get href() {
|
|
604
307
|
return props.href;
|
|
@@ -607,23 +310,25 @@ const CalendarNavigationLink = props => {
|
|
|
607
310
|
get onNavigate() {
|
|
608
311
|
return props.owner.onNavigate;
|
|
609
312
|
},
|
|
313
|
+
onClick: event => void intercepted(event),
|
|
610
314
|
onPointerEnter: preload,
|
|
611
315
|
onFocus: preload,
|
|
612
316
|
get children() {
|
|
613
317
|
return props.children;
|
|
614
318
|
}
|
|
615
319
|
})) : (() => {
|
|
616
|
-
var _el$
|
|
617
|
-
_$spread(_el$
|
|
320
|
+
var _el$2 = _$getNextElement(_tmpl$);
|
|
321
|
+
_$spread(_el$2, _$mergeProps(() => props.anchorProps, {
|
|
618
322
|
get href() {
|
|
619
323
|
return props.href;
|
|
620
324
|
},
|
|
325
|
+
"onClick": event => void intercepted(event),
|
|
621
326
|
"onPointerEnter": preload,
|
|
622
327
|
"onFocus": preload
|
|
623
328
|
}), false, true);
|
|
624
|
-
_$insert(_el$
|
|
329
|
+
_$insert(_el$2, () => props.children);
|
|
625
330
|
_$runHydrationEvents();
|
|
626
|
-
return _el$
|
|
331
|
+
return _el$2;
|
|
627
332
|
})();
|
|
628
333
|
};
|
|
629
334
|
const CalendarViewLinks = props => {
|
|
@@ -646,8 +351,8 @@ const CalendarViewLinks = props => {
|
|
|
646
351
|
}
|
|
647
352
|
};
|
|
648
353
|
return (() => {
|
|
649
|
-
var _el$
|
|
650
|
-
_$insert(_el$
|
|
354
|
+
var _el$3 = _$getNextElement(_tmpl$2);
|
|
355
|
+
_$insert(_el$3, _$createComponent(For, {
|
|
651
356
|
get each() {
|
|
652
357
|
return props.options;
|
|
653
358
|
},
|
|
@@ -684,8 +389,8 @@ const CalendarViewLinks = props => {
|
|
|
684
389
|
});
|
|
685
390
|
}
|
|
686
391
|
}));
|
|
687
|
-
_$effect(() => _$setAttribute(_el$
|
|
688
|
-
return _el$
|
|
392
|
+
_$effect(() => _$setAttribute(_el$3, "aria-label", calendarMessages().calendarView));
|
|
393
|
+
return _el$3;
|
|
689
394
|
})();
|
|
690
395
|
};
|
|
691
396
|
|
|
@@ -711,12 +416,62 @@ const openViewAt = (owner, date, view) => {
|
|
|
711
416
|
owner.onViewChange?.(view);
|
|
712
417
|
owner.onDateChange?.(date, view);
|
|
713
418
|
};
|
|
419
|
+
|
|
420
|
+
/** What the header reads from the active view beyond the props: the days a day or week view shows, and its moves. */
|
|
421
|
+
|
|
422
|
+
const dayTitleOptions = {
|
|
423
|
+
weekday: "short",
|
|
424
|
+
day: "numeric",
|
|
425
|
+
month: "short",
|
|
426
|
+
year: "numeric"
|
|
427
|
+
};
|
|
428
|
+
const weekTitleOptions = {
|
|
429
|
+
day: "numeric",
|
|
430
|
+
month: "short",
|
|
431
|
+
year: "numeric"
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
/** Where today lies from the shown day or week before its view measured: the arrow of the Today button, or nothing. */
|
|
435
|
+
const todayDirectionOf = (view, date, context) => {
|
|
436
|
+
const today = calendar.formatDateKey(new Date(), context);
|
|
437
|
+
if (view === "week") {
|
|
438
|
+
const start = calendar.formatDateKey(calendar.startOfWeek(date, context), context);
|
|
439
|
+
const end = calendar.formatDateKey(calendar.addDays(calendar.startOfWeek(date, context), 6, context), context);
|
|
440
|
+
return today < start ? "left" : today > end ? "right" : "";
|
|
441
|
+
}
|
|
442
|
+
const shown = calendar.formatDateKey(date, context);
|
|
443
|
+
return today < shown ? "up" : today > shown ? "down" : "";
|
|
444
|
+
};
|
|
714
445
|
const CalendarHeader = props => {
|
|
715
446
|
const calendarMessages = useCalendarMessages();
|
|
716
447
|
const dateConfig = () => ownerDateConfig(props.owner);
|
|
717
|
-
const
|
|
718
|
-
const
|
|
448
|
+
const timeView = () => props.nav.timeView();
|
|
449
|
+
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
450
|
+
/** The date the header pages from: the first day a day or week view shows, else the date. */
|
|
451
|
+
const base = () => {
|
|
452
|
+
const shown = timeView()?.visibleKeys().first;
|
|
453
|
+
return shown ? parseKey(shown) : props.date;
|
|
454
|
+
};
|
|
455
|
+
const previous = () => adjacentCalendarDate(base(), props.view, -1, dateConfig());
|
|
456
|
+
const next = () => adjacentCalendarDate(base(), props.view, 1, dateConfig());
|
|
457
|
+
/** The day view's title, such as "Fri, Oct 9, 2026" or "Fr, 9. Okt 2026". */
|
|
458
|
+
const formatDayTitle = date => compactGermanDate(new Intl.DateTimeFormat(dateConfig().locale ?? "en", {
|
|
459
|
+
...dayTitleOptions,
|
|
460
|
+
timeZone: dateConfig().timeZone
|
|
461
|
+
}).format(date), dateConfig().locale, true);
|
|
462
|
+
const formatRange = (from, to) => compactGermanDate(new Intl.DateTimeFormat(dateConfig().locale ?? "en", {
|
|
463
|
+
...weekTitleOptions,
|
|
464
|
+
timeZone: dateConfig().timeZone
|
|
465
|
+
}).formatRange(from, to), dateConfig().locale);
|
|
466
|
+
/** The day and week views with `dayHours` name the days they show, also on the server before they measured. */
|
|
467
|
+
const timeMode = () => Boolean(props.owner.dayHours) && (props.view === "day" || props.view === "week");
|
|
719
468
|
const title = () => {
|
|
469
|
+
const shown = timeView()?.visibleKeys();
|
|
470
|
+
if (timeMode() && props.view === "day") return formatDayTitle(shown ? parseKey(shown.first) : props.date);
|
|
471
|
+
if (timeMode()) {
|
|
472
|
+
const start = shown ? parseKey(shown.first) : calendar.startOfWeek(props.date, dateConfig());
|
|
473
|
+
return formatRange(start, shown ? parseKey(shown.last) : calendar.addDays(start, 6, dateConfig()));
|
|
474
|
+
}
|
|
720
475
|
if (props.view === "year") return new Intl.DateTimeFormat(dateConfig().locale ?? "en", {
|
|
721
476
|
year: "numeric",
|
|
722
477
|
timeZone: dateConfig().timeZone
|
|
@@ -732,8 +487,8 @@ const CalendarHeader = props => {
|
|
|
732
487
|
return formatMonth(props.date, dateConfig());
|
|
733
488
|
};
|
|
734
489
|
/**
|
|
735
|
-
* The titles this view can show around the current date: the months of the year, the weeks of the month
|
|
736
|
-
* of each weekday in every month. Their widest one sets the title's width.
|
|
490
|
+
* The titles this view can show around the current date: the months of the year, the weeks of the month and across
|
|
491
|
+
* each month boundary, or a day of each weekday in every month. Their widest one sets the title's width.
|
|
737
492
|
*/
|
|
738
493
|
const titleWidths = createMemo(() => {
|
|
739
494
|
const context = dateConfig();
|
|
@@ -746,12 +501,22 @@ const CalendarHeader = props => {
|
|
|
746
501
|
}, (_, month) => formatMonth(zonedMonthDate(year, month, context), context));
|
|
747
502
|
if (props.view === "week") {
|
|
748
503
|
const first = calendar.startOfWeek(calendar.startOfMonth(props.date, context), context);
|
|
749
|
-
|
|
504
|
+
const weeks = Array.from({
|
|
750
505
|
length: 6
|
|
751
506
|
}, (_, week) => {
|
|
752
507
|
const start = calendar.addDays(first, week * 7, context);
|
|
508
|
+
if (timeMode()) return formatRange(start, calendar.addDays(start, 6, context));
|
|
753
509
|
return `${formatDay(start, context)} - ${formatDay(calendar.addDays(start, 6, context), context)}`;
|
|
754
510
|
});
|
|
511
|
+
if (timeMode()) {
|
|
512
|
+
return [...weeks, ...Array.from({
|
|
513
|
+
length: 12
|
|
514
|
+
}, (_, month) => {
|
|
515
|
+
const day28 = calendar.addDays(zonedMonthDate(year, month, context), 27, context);
|
|
516
|
+
return formatRange(day28, calendar.addDays(day28, 6, context));
|
|
517
|
+
})];
|
|
518
|
+
}
|
|
519
|
+
return weeks;
|
|
755
520
|
}
|
|
756
521
|
return Array.from({
|
|
757
522
|
length: 12
|
|
@@ -759,7 +524,7 @@ const CalendarHeader = props => {
|
|
|
759
524
|
const first = zonedMonthDate(year, month, context);
|
|
760
525
|
return Array.from({
|
|
761
526
|
length: 7
|
|
762
|
-
}, (_, offset) => calendar.addDays(first, 21 + offset, context).toLocaleDateString(context.locale ?? "en", {
|
|
527
|
+
}, (_, offset) => timeMode() ? formatDayTitle(calendar.addDays(first, 21 + offset, context)) : calendar.addDays(first, 21 + offset, context).toLocaleDateString(context.locale ?? "en", {
|
|
763
528
|
weekday: "long",
|
|
764
529
|
month: "long",
|
|
765
530
|
day: "numeric",
|
|
@@ -783,65 +548,101 @@ const CalendarHeader = props => {
|
|
|
783
548
|
const href = props.owner.getViewHref?.(view);
|
|
784
549
|
if (href) window.location.href = href;
|
|
785
550
|
};
|
|
786
|
-
const navButton = (date, icon, label) => {
|
|
551
|
+
const navButton = (date, icon, label, direction) => {
|
|
787
552
|
const href = props.owner.getDateHref?.(date, props.view);
|
|
553
|
+
const step = () => timeView()?.step(direction) ?? false;
|
|
554
|
+
const title = props.nav.commands().length > 0 ? `${label} (${direction > 0 ? "J" : "K"})` : label;
|
|
788
555
|
return (props.owner.onNavigateHref || props.owner.onNavigate) && href ? _$createComponent(CalendarNavigationLink, {
|
|
789
556
|
get owner() {
|
|
790
557
|
return props.owner;
|
|
791
558
|
},
|
|
792
559
|
href: href,
|
|
560
|
+
intercept: step,
|
|
793
561
|
anchorProps: {
|
|
794
562
|
"aria-label": label,
|
|
795
|
-
title
|
|
563
|
+
title,
|
|
796
564
|
class: "k2b-calendar-header__nav-button"
|
|
797
565
|
},
|
|
798
566
|
get children() {
|
|
799
|
-
var _el$
|
|
800
|
-
_$className(_el$
|
|
801
|
-
return _el$
|
|
567
|
+
var _el$4 = _$getNextElement(_tmpl$3);
|
|
568
|
+
_$className(_el$4, `ti ${icon}`);
|
|
569
|
+
return _el$4;
|
|
802
570
|
}
|
|
803
571
|
}) : props.owner.onDateChange ? (() => {
|
|
804
|
-
var _el$
|
|
805
|
-
_el$
|
|
806
|
-
_el$
|
|
807
|
-
|
|
808
|
-
|
|
572
|
+
var _el$5 = _$getNextElement(_tmpl$4),
|
|
573
|
+
_el$6 = _el$5.firstChild;
|
|
574
|
+
_el$5.$$click = () => {
|
|
575
|
+
if (!step()) goDate(date);
|
|
576
|
+
};
|
|
577
|
+
_$setAttribute(_el$5, "aria-label", label);
|
|
578
|
+
_$setAttribute(_el$5, "title", title);
|
|
579
|
+
_$className(_el$6, `ti ${icon}`);
|
|
809
580
|
_$runHydrationEvents();
|
|
810
|
-
return _el$
|
|
581
|
+
return _el$5;
|
|
811
582
|
})() : _$createComponent(CalendarNavigationLink, {
|
|
812
583
|
get owner() {
|
|
813
584
|
return props.owner;
|
|
814
585
|
},
|
|
815
586
|
href: href ?? "#",
|
|
587
|
+
intercept: step,
|
|
816
588
|
anchorProps: {
|
|
817
589
|
"aria-label": label,
|
|
818
|
-
title
|
|
590
|
+
title,
|
|
819
591
|
class: "k2b-calendar-header__nav-button"
|
|
820
592
|
},
|
|
821
593
|
get children() {
|
|
822
|
-
var _el$
|
|
823
|
-
_$className(_el$
|
|
824
|
-
return _el$
|
|
594
|
+
var _el$7 = _$getNextElement(_tmpl$3);
|
|
595
|
+
_$className(_el$7, `ti ${icon}`);
|
|
596
|
+
return _el$7;
|
|
825
597
|
}
|
|
826
598
|
});
|
|
827
599
|
};
|
|
600
|
+
/**
|
|
601
|
+
* In the day and week views that scroll through their days, Today points where today lies, or shows a calm dot while
|
|
602
|
+
* it is on screen; the icon keeps its place either way. The other views name their period in the title.
|
|
603
|
+
*/
|
|
604
|
+
const direction = () => timeMode() ? (timeView()?.todayDirection() ?? todayDirectionOf(String(props.view), props.date, dateConfig())) || "here" : undefined;
|
|
605
|
+
/** One arrow that the stylesheet turns toward today, or the dot while today shows. */
|
|
606
|
+
const todayIcon = () => _$createComponent(Show, {
|
|
607
|
+
get when() {
|
|
608
|
+
return direction();
|
|
609
|
+
},
|
|
610
|
+
children: current => _$createComponent(Show, {
|
|
611
|
+
get when() {
|
|
612
|
+
return current() !== "here";
|
|
613
|
+
},
|
|
614
|
+
get fallback() {
|
|
615
|
+
return _$getNextElement(_tmpl$6);
|
|
616
|
+
},
|
|
617
|
+
get children() {
|
|
618
|
+
return _$getNextElement(_tmpl$5);
|
|
619
|
+
}
|
|
620
|
+
})
|
|
621
|
+
});
|
|
828
622
|
const todayButton = () => {
|
|
829
623
|
const today = calendar.today(dateConfig());
|
|
830
624
|
const href = props.owner.getDateHref?.(today, props.view);
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
625
|
+
const intercept = () => timeView()?.today() ?? false;
|
|
626
|
+
const title = () => props.nav.commands().length > 0 ? `${props.labels.today} (H)` : undefined;
|
|
627
|
+
const label = [_$memo(todayIcon), (() => {
|
|
628
|
+
var _el$0 = _$getNextElement(_tmpl$7);
|
|
629
|
+
_$insert(_el$0, () => props.labels.today);
|
|
630
|
+
return _el$0;
|
|
631
|
+
})()];
|
|
836
632
|
return (props.owner.onNavigateHref || props.owner.onNavigate) && href ? _$createComponent(CalendarNavigationLink, {
|
|
837
633
|
get owner() {
|
|
838
634
|
return props.owner;
|
|
839
635
|
},
|
|
840
636
|
href: href,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
637
|
+
intercept: intercept,
|
|
638
|
+
get anchorProps() {
|
|
639
|
+
return {
|
|
640
|
+
class: "k2b-button k2b-calendar-header__today",
|
|
641
|
+
"data-size": "sm",
|
|
642
|
+
"data-variant": "input",
|
|
643
|
+
"data-direction": direction(),
|
|
644
|
+
title: title()
|
|
645
|
+
};
|
|
845
646
|
},
|
|
846
647
|
children: label
|
|
847
648
|
}) : props.owner.onDateChange ? _$createComponent(Button, {
|
|
@@ -849,19 +650,32 @@ const CalendarHeader = props => {
|
|
|
849
650
|
variant: "input",
|
|
850
651
|
size: "sm",
|
|
851
652
|
"class": "k2b-calendar-header__today",
|
|
852
|
-
|
|
653
|
+
get ["data-direction"]() {
|
|
654
|
+
return direction();
|
|
655
|
+
},
|
|
656
|
+
get title() {
|
|
657
|
+
return title();
|
|
658
|
+
},
|
|
659
|
+
onClick: () => {
|
|
660
|
+
if (!intercept()) goDate(today);
|
|
661
|
+
},
|
|
853
662
|
get children() {
|
|
854
|
-
return props.labels.today;
|
|
663
|
+
return [_$memo(() => todayIcon()), _$memo(() => props.labels.today)];
|
|
855
664
|
}
|
|
856
665
|
}) : _$createComponent(CalendarNavigationLink, {
|
|
857
666
|
get owner() {
|
|
858
667
|
return props.owner;
|
|
859
668
|
},
|
|
860
669
|
href: href ?? "#",
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
670
|
+
intercept: intercept,
|
|
671
|
+
get anchorProps() {
|
|
672
|
+
return {
|
|
673
|
+
class: "k2b-button k2b-calendar-header__today",
|
|
674
|
+
"data-size": "sm",
|
|
675
|
+
"data-variant": "input",
|
|
676
|
+
"data-direction": direction(),
|
|
677
|
+
title: title()
|
|
678
|
+
};
|
|
865
679
|
},
|
|
866
680
|
children: label
|
|
867
681
|
});
|
|
@@ -880,57 +694,60 @@ const CalendarHeader = props => {
|
|
|
880
694
|
label: props.labels.year
|
|
881
695
|
}].filter(option => !props.owner.views || props.owner.views.includes(option.value)), ...(props.owner.customViews ?? [])]);
|
|
882
696
|
return (() => {
|
|
883
|
-
var _el$
|
|
884
|
-
_el$
|
|
885
|
-
_el$
|
|
886
|
-
[_el$
|
|
887
|
-
_el$
|
|
888
|
-
[_el$
|
|
889
|
-
_el$
|
|
890
|
-
_el$
|
|
697
|
+
var _el$1 = _$getNextElement(_tmpl$1),
|
|
698
|
+
_el$10 = _el$1.firstChild,
|
|
699
|
+
_el$15 = _el$10.firstChild,
|
|
700
|
+
[_el$16, _co$2] = _$getNextMarker(_el$15.nextSibling),
|
|
701
|
+
_el$17 = _el$16.nextSibling,
|
|
702
|
+
[_el$18, _co$3] = _$getNextMarker(_el$17.nextSibling),
|
|
703
|
+
_el$11 = _el$18.nextSibling,
|
|
704
|
+
_el$12 = _el$11.firstChild,
|
|
705
|
+
_el$13 = _el$12.nextSibling,
|
|
706
|
+
[_el$14, _co$] = _$getNextMarker(_el$13.nextSibling),
|
|
707
|
+
_el$31 = _el$10.nextSibling,
|
|
708
|
+
[_el$32, _co$8] = _$getNextMarker(_el$31.nextSibling),
|
|
709
|
+
_el$20 = _el$32.nextSibling,
|
|
710
|
+
_el$22 = _el$20.firstChild,
|
|
711
|
+
[_el$23, _co$4] = _$getNextMarker(_el$22.nextSibling),
|
|
712
|
+
_el$24 = _el$23.nextSibling,
|
|
713
|
+
[_el$25, _co$5] = _$getNextMarker(_el$24.nextSibling),
|
|
891
714
|
_el$26 = _el$25.nextSibling,
|
|
892
|
-
[_el$27, _co$
|
|
893
|
-
_el$
|
|
894
|
-
[_el$
|
|
895
|
-
_el$33 = _el$
|
|
896
|
-
_el$34 = _el$33.
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
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, {
|
|
715
|
+
[_el$27, _co$6] = _$getNextMarker(_el$26.nextSibling),
|
|
716
|
+
_el$28 = _el$27.nextSibling,
|
|
717
|
+
[_el$29, _co$7] = _$getNextMarker(_el$28.nextSibling),
|
|
718
|
+
_el$33 = _el$20.nextSibling,
|
|
719
|
+
[_el$34, _co$9] = _$getNextMarker(_el$33.nextSibling);
|
|
720
|
+
_$insert(_el$10, () => navButton(previous(), "ti-chevron-left", props.labels.previous, -1), _el$16, _co$2);
|
|
721
|
+
_$insert(_el$10, () => navButton(next(), "ti-chevron-right", props.labels.next, 1), _el$18, _co$3);
|
|
722
|
+
_$insert(_el$12, title);
|
|
723
|
+
_$insert(_el$11, _$createComponent(For, {
|
|
908
724
|
get each() {
|
|
909
725
|
return titleWidths();
|
|
910
726
|
},
|
|
911
727
|
children: candidate => (() => {
|
|
912
|
-
var _el$
|
|
913
|
-
_$insert(_el$
|
|
914
|
-
return _el$
|
|
728
|
+
var _el$35 = _$getNextElement(_tmpl$10);
|
|
729
|
+
_$insert(_el$35, candidate);
|
|
730
|
+
return _el$35;
|
|
915
731
|
})()
|
|
916
|
-
}), _el$
|
|
917
|
-
_$insert(_el$
|
|
732
|
+
}), _el$14, _co$);
|
|
733
|
+
_$insert(_el$1, _$createComponent(Show, {
|
|
918
734
|
get when() {
|
|
919
735
|
return props.owner.toolbarContent;
|
|
920
736
|
},
|
|
921
737
|
get children() {
|
|
922
|
-
var _el$
|
|
923
|
-
_$insert(_el$
|
|
924
|
-
return _el$
|
|
738
|
+
var _el$19 = _$getNextElement(_tmpl$8);
|
|
739
|
+
_$insert(_el$19, () => props.owner.toolbarContent);
|
|
740
|
+
return _el$19;
|
|
925
741
|
}
|
|
926
|
-
}), _el$
|
|
927
|
-
_$insert(_el$
|
|
928
|
-
_$insert(_el$
|
|
742
|
+
}), _el$32, _co$8);
|
|
743
|
+
_$insert(_el$20, todayButton, _el$23, _co$4);
|
|
744
|
+
_$insert(_el$20, _$createComponent(Show, {
|
|
929
745
|
get when() {
|
|
930
746
|
return _$memo(() => !!!props.owner.onViewChange)() && props.owner.getViewHref;
|
|
931
747
|
},
|
|
932
748
|
get fallback() {
|
|
933
749
|
return _$createComponent(SegmentedControl, {
|
|
750
|
+
"class": "k2b-calendar-view-switcher",
|
|
934
751
|
value: () => props.view === "mobile-month" ? "month" : props.view,
|
|
935
752
|
onValueChange: goView,
|
|
936
753
|
get ariaLabel() {
|
|
@@ -957,17 +774,38 @@ const CalendarHeader = props => {
|
|
|
957
774
|
}
|
|
958
775
|
});
|
|
959
776
|
}
|
|
960
|
-
}), _el$
|
|
961
|
-
_$insert(_el$
|
|
962
|
-
_$insert(_el$
|
|
777
|
+
}), _el$25, _co$5);
|
|
778
|
+
_$insert(_el$20, () => props.owner.toolbarActions, _el$27, _co$6);
|
|
779
|
+
_$insert(_el$20, _$createComponent(Show, {
|
|
780
|
+
get when() {
|
|
781
|
+
return props.nav.commands().length > 0;
|
|
782
|
+
},
|
|
783
|
+
get children() {
|
|
784
|
+
var _el$21 = _$getNextElement(_tmpl$9);
|
|
785
|
+
_el$21.$$click = () => props.nav.openShortcuts();
|
|
786
|
+
_$effect(_p$ => {
|
|
787
|
+
var _v$ = calendarMessages().calendarShortcuts,
|
|
788
|
+
_v$2 = calendarMessages().calendarShortcuts;
|
|
789
|
+
_v$ !== _p$.e && _$setAttribute(_el$21, "aria-label", _p$.e = _v$);
|
|
790
|
+
_v$2 !== _p$.t && _$setAttribute(_el$21, "title", _p$.t = _v$2);
|
|
791
|
+
return _p$;
|
|
792
|
+
}, {
|
|
793
|
+
e: undefined,
|
|
794
|
+
t: undefined
|
|
795
|
+
});
|
|
796
|
+
_$runHydrationEvents();
|
|
797
|
+
return _el$21;
|
|
798
|
+
}
|
|
799
|
+
}), _el$29, _co$7);
|
|
800
|
+
_$insert(_el$1, _$createComponent(Show, {
|
|
963
801
|
get when() {
|
|
964
802
|
return props.owner.navigationPending;
|
|
965
803
|
},
|
|
966
804
|
get children() {
|
|
967
|
-
return _$getNextElement(_tmpl$
|
|
805
|
+
return _$getNextElement(_tmpl$0);
|
|
968
806
|
}
|
|
969
|
-
}), _el$
|
|
970
|
-
return _el$
|
|
807
|
+
}), _el$34, _co$9);
|
|
808
|
+
return _el$1;
|
|
971
809
|
})();
|
|
972
810
|
};
|
|
973
811
|
|
|
@@ -1027,55 +865,55 @@ const MonthPickerView = props => {
|
|
|
1027
865
|
};
|
|
1028
866
|
onCleanup(() => cancelInteraction?.());
|
|
1029
867
|
return (() => {
|
|
1030
|
-
var _el$
|
|
1031
|
-
_el$
|
|
1032
|
-
_el$
|
|
1033
|
-
[_el$
|
|
1034
|
-
_el$
|
|
1035
|
-
[_el$
|
|
1036
|
-
_el$
|
|
1037
|
-
[_el$
|
|
1038
|
-
_$insert(_el$
|
|
868
|
+
var _el$36 = _$getNextElement(_tmpl$12),
|
|
869
|
+
_el$37 = _el$36.firstChild,
|
|
870
|
+
_el$39 = _el$37.firstChild,
|
|
871
|
+
[_el$40, _co$0] = _$getNextMarker(_el$39.nextSibling),
|
|
872
|
+
_el$41 = _el$40.nextSibling,
|
|
873
|
+
[_el$42, _co$1] = _$getNextMarker(_el$41.nextSibling),
|
|
874
|
+
_el$43 = _el$37.nextSibling,
|
|
875
|
+
[_el$44, _co$10] = _$getNextMarker(_el$43.nextSibling);
|
|
876
|
+
_$insert(_el$37, _$createComponent(Show, {
|
|
1039
877
|
get when() {
|
|
1040
878
|
return props.owner.withWeekNumbers;
|
|
1041
879
|
},
|
|
1042
880
|
get children() {
|
|
1043
|
-
var _el$
|
|
1044
|
-
_$insert(_el$
|
|
1045
|
-
return _el$
|
|
881
|
+
var _el$38 = _$getNextElement(_tmpl$11);
|
|
882
|
+
_$insert(_el$38, () => calendarMessages().weekShort);
|
|
883
|
+
return _el$38;
|
|
1046
884
|
}
|
|
1047
|
-
}), _el$
|
|
1048
|
-
_$insert(_el$
|
|
885
|
+
}), _el$40, _co$0);
|
|
886
|
+
_$insert(_el$37, _$createComponent(For, {
|
|
1049
887
|
get each() {
|
|
1050
888
|
return weekdays();
|
|
1051
889
|
},
|
|
1052
890
|
children: day => (() => {
|
|
1053
|
-
var _el$
|
|
1054
|
-
_$insert(_el$
|
|
1055
|
-
return _el$
|
|
891
|
+
var _el$45 = _$getNextElement(_tmpl$11);
|
|
892
|
+
_$insert(_el$45, day);
|
|
893
|
+
return _el$45;
|
|
1056
894
|
})()
|
|
1057
|
-
}), _el$
|
|
1058
|
-
_$insert(_el$
|
|
895
|
+
}), _el$42, _co$1);
|
|
896
|
+
_$insert(_el$36, _$createComponent(For, {
|
|
1059
897
|
get each() {
|
|
1060
898
|
return weeks();
|
|
1061
899
|
},
|
|
1062
900
|
children: week => (() => {
|
|
1063
|
-
var _el$
|
|
1064
|
-
_el$
|
|
1065
|
-
[_el$
|
|
1066
|
-
_el$
|
|
1067
|
-
[_el$
|
|
1068
|
-
_$insert(_el$
|
|
901
|
+
var _el$46 = _$getNextElement(_tmpl$14),
|
|
902
|
+
_el$48 = _el$46.firstChild,
|
|
903
|
+
[_el$49, _co$11] = _$getNextMarker(_el$48.nextSibling),
|
|
904
|
+
_el$50 = _el$49.nextSibling,
|
|
905
|
+
[_el$51, _co$12] = _$getNextMarker(_el$50.nextSibling);
|
|
906
|
+
_$insert(_el$46, _$createComponent(Show, {
|
|
1069
907
|
get when() {
|
|
1070
908
|
return props.owner.withWeekNumbers;
|
|
1071
909
|
},
|
|
1072
910
|
get children() {
|
|
1073
|
-
var _el$
|
|
1074
|
-
_$insert(_el$
|
|
1075
|
-
return _el$
|
|
911
|
+
var _el$47 = _$getNextElement(_tmpl$13);
|
|
912
|
+
_$insert(_el$47, () => zonedWeekNumber(week[0], dateConfig()));
|
|
913
|
+
return _el$47;
|
|
1076
914
|
}
|
|
1077
|
-
}), _el$
|
|
1078
|
-
_$insert(_el$
|
|
915
|
+
}), _el$49, _co$11);
|
|
916
|
+
_$insert(_el$46, _$createComponent(For, {
|
|
1079
917
|
each: week,
|
|
1080
918
|
children: day => {
|
|
1081
919
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
@@ -1103,25 +941,25 @@ const MonthPickerView = props => {
|
|
|
1103
941
|
};
|
|
1104
942
|
});
|
|
1105
943
|
return (() => {
|
|
1106
|
-
var _el$
|
|
1107
|
-
_el$
|
|
1108
|
-
[_el$
|
|
1109
|
-
_el$
|
|
1110
|
-
_el$
|
|
1111
|
-
[_el$
|
|
1112
|
-
_el$
|
|
1113
|
-
[_el$
|
|
1114
|
-
_el$
|
|
1115
|
-
_el$
|
|
1116
|
-
[_el$
|
|
1117
|
-
_el$
|
|
1118
|
-
[_el$
|
|
1119
|
-
_el$
|
|
1120
|
-
[_el$
|
|
1121
|
-
_el$
|
|
1122
|
-
_$setAttribute(_el$
|
|
1123
|
-
_$setAttribute(_el$
|
|
1124
|
-
_$insert(_el$
|
|
944
|
+
var _el$52 = _$getNextElement(_tmpl$17),
|
|
945
|
+
_el$68 = _el$52.firstChild,
|
|
946
|
+
[_el$69, _co$18] = _$getNextMarker(_el$68.nextSibling),
|
|
947
|
+
_el$54 = _el$69.nextSibling,
|
|
948
|
+
_el$55 = _el$54.firstChild,
|
|
949
|
+
[_el$56, _co$13] = _$getNextMarker(_el$55.nextSibling),
|
|
950
|
+
_el$57 = _el$56.nextSibling,
|
|
951
|
+
[_el$58, _co$14] = _$getNextMarker(_el$57.nextSibling),
|
|
952
|
+
_el$59 = _el$54.nextSibling,
|
|
953
|
+
_el$61 = _el$59.firstChild,
|
|
954
|
+
[_el$62, _co$15] = _$getNextMarker(_el$61.nextSibling),
|
|
955
|
+
_el$63 = _el$62.nextSibling,
|
|
956
|
+
[_el$64, _co$16] = _$getNextMarker(_el$63.nextSibling),
|
|
957
|
+
_el$65 = _el$64.nextSibling,
|
|
958
|
+
[_el$66, _co$17] = _$getNextMarker(_el$65.nextSibling),
|
|
959
|
+
_el$67 = _el$59.nextSibling;
|
|
960
|
+
_$setAttribute(_el$52, "data-calendar-day-key", dayKey);
|
|
961
|
+
_$setAttribute(_el$52, "data-outside", !sameMonth ? "true" : undefined);
|
|
962
|
+
_$insert(_el$52, _$createComponent(Show, {
|
|
1125
963
|
get when() {
|
|
1126
964
|
return props.owner.onSlotActivate;
|
|
1127
965
|
},
|
|
@@ -1147,8 +985,8 @@ const MonthPickerView = props => {
|
|
|
1147
985
|
});
|
|
1148
986
|
},
|
|
1149
987
|
get children() {
|
|
1150
|
-
var _el$
|
|
1151
|
-
_$spread(_el$
|
|
988
|
+
var _el$53 = _$getNextElement(_tmpl$15);
|
|
989
|
+
_$spread(_el$53, _$mergeProps({
|
|
1152
990
|
get ["aria-label"]() {
|
|
1153
991
|
return calendarMessages().createEventOn({
|
|
1154
992
|
label: dayLabel
|
|
@@ -1163,20 +1001,20 @@ const MonthPickerView = props => {
|
|
|
1163
1001
|
};
|
|
1164
1002
|
}, () => performance.now() < suppressSlotClickUntil, true)), false, false);
|
|
1165
1003
|
_$runHydrationEvents();
|
|
1166
|
-
return _el$
|
|
1004
|
+
return _el$53;
|
|
1167
1005
|
}
|
|
1168
|
-
}), _el$
|
|
1169
|
-
_$insert(_el$
|
|
1006
|
+
}), _el$69, _co$18);
|
|
1007
|
+
_$insert(_el$54, _$createComponent(Show, {
|
|
1170
1008
|
get when() {
|
|
1171
1009
|
return props.owner.onSlotActivate && href;
|
|
1172
1010
|
},
|
|
1173
1011
|
get fallback() {
|
|
1174
1012
|
return (() => {
|
|
1175
|
-
var _el$
|
|
1176
|
-
_$setAttribute(_el$
|
|
1177
|
-
_$setAttribute(_el$
|
|
1178
|
-
_$insert(_el$
|
|
1179
|
-
return _el$
|
|
1013
|
+
var _el$70 = _$getNextElement(_tmpl$18);
|
|
1014
|
+
_$setAttribute(_el$70, "data-today", isToday ? "true" : undefined);
|
|
1015
|
+
_$setAttribute(_el$70, "data-outside", !sameMonth ? "true" : undefined);
|
|
1016
|
+
_$insert(_el$70, () => calendar.formatDayNumber(day, dateConfig()));
|
|
1017
|
+
return _el$70;
|
|
1180
1018
|
})();
|
|
1181
1019
|
},
|
|
1182
1020
|
children: dayHref => _$createComponent(CalendarNavigationLink, {
|
|
@@ -1200,40 +1038,40 @@ const MonthPickerView = props => {
|
|
|
1200
1038
|
return calendar.formatDayNumber(day, dateConfig());
|
|
1201
1039
|
}
|
|
1202
1040
|
})
|
|
1203
|
-
}), _el$
|
|
1204
|
-
_$insert(_el$
|
|
1041
|
+
}), _el$56, _co$13);
|
|
1042
|
+
_$insert(_el$54, _$createComponent(Show, {
|
|
1205
1043
|
when: dayBadge,
|
|
1206
1044
|
children: badge => (() => {
|
|
1207
|
-
var _el$
|
|
1208
|
-
_el$
|
|
1209
|
-
[_el$
|
|
1210
|
-
_el$
|
|
1211
|
-
[_el$
|
|
1212
|
-
_$insert(_el$
|
|
1045
|
+
var _el$71 = _$getNextElement(_tmpl$19),
|
|
1046
|
+
_el$72 = _el$71.firstChild,
|
|
1047
|
+
[_el$73, _co$19] = _$getNextMarker(_el$72.nextSibling),
|
|
1048
|
+
_el$74 = _el$73.nextSibling,
|
|
1049
|
+
[_el$75, _co$20] = _$getNextMarker(_el$74.nextSibling);
|
|
1050
|
+
_$insert(_el$71, _$createComponent(Show, {
|
|
1213
1051
|
get when() {
|
|
1214
1052
|
return badge().icon;
|
|
1215
1053
|
},
|
|
1216
1054
|
children: icon => (() => {
|
|
1217
|
-
var _el$
|
|
1218
|
-
_$effect(() => _$className(_el$
|
|
1219
|
-
return _el$
|
|
1055
|
+
var _el$76 = _$getNextElement(_tmpl$3);
|
|
1056
|
+
_$effect(() => _$className(_el$76, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1057
|
+
return _el$76;
|
|
1220
1058
|
})()
|
|
1221
|
-
}), _el$
|
|
1222
|
-
_$insert(_el$
|
|
1223
|
-
return _el$
|
|
1059
|
+
}), _el$73, _co$19);
|
|
1060
|
+
_$insert(_el$71, () => badge().label, _el$75, _co$20);
|
|
1061
|
+
return _el$71;
|
|
1224
1062
|
})()
|
|
1225
|
-
}), _el$
|
|
1226
|
-
_$insert(_el$
|
|
1063
|
+
}), _el$58, _co$14);
|
|
1064
|
+
_$insert(_el$59, _$createComponent(Show, {
|
|
1227
1065
|
get when() {
|
|
1228
1066
|
return eventStack().preview;
|
|
1229
1067
|
},
|
|
1230
1068
|
get children() {
|
|
1231
|
-
var _el$
|
|
1232
|
-
_$insert(_el$
|
|
1233
|
-
return _el$
|
|
1069
|
+
var _el$60 = _$getNextElement(_tmpl$16);
|
|
1070
|
+
_$insert(_el$60, () => props.events.find(event => event.id === eventStack().preview.id)?.title ?? calendarMessages().moveEvent);
|
|
1071
|
+
return _el$60;
|
|
1234
1072
|
}
|
|
1235
|
-
}), _el$
|
|
1236
|
-
_$insert(_el$
|
|
1073
|
+
}), _el$62, _co$15);
|
|
1074
|
+
_$insert(_el$59, _$createComponent(For, {
|
|
1237
1075
|
get each() {
|
|
1238
1076
|
return eventStack().visibleEvents;
|
|
1239
1077
|
},
|
|
@@ -1253,8 +1091,8 @@ const MonthPickerView = props => {
|
|
|
1253
1091
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, event, markDragged) : undefined;
|
|
1254
1092
|
}
|
|
1255
1093
|
})
|
|
1256
|
-
}), _el$
|
|
1257
|
-
_$insert(_el$
|
|
1094
|
+
}), _el$64, _co$16);
|
|
1095
|
+
_$insert(_el$59, _$createComponent(Show, {
|
|
1258
1096
|
get when() {
|
|
1259
1097
|
return eventStack().hiddenCount > 0;
|
|
1260
1098
|
},
|
|
@@ -1274,53 +1112,55 @@ const MonthPickerView = props => {
|
|
|
1274
1112
|
}
|
|
1275
1113
|
});
|
|
1276
1114
|
}
|
|
1277
|
-
}), _el$
|
|
1278
|
-
_$insert(_el$
|
|
1115
|
+
}), _el$66, _co$17);
|
|
1116
|
+
_$insert(_el$67, _$createComponent(For, {
|
|
1279
1117
|
get each() {
|
|
1280
1118
|
return events.slice(0, 4);
|
|
1281
1119
|
},
|
|
1282
1120
|
children: event => (() => {
|
|
1283
|
-
var _el$
|
|
1121
|
+
var _el$77 = _$getNextElement(_tmpl$20);
|
|
1284
1122
|
_$effect(_p$ => {
|
|
1285
|
-
var _v$
|
|
1286
|
-
_v$
|
|
1123
|
+
var _v$5 = event.colorHex ? undefined : event.color ?? "blue",
|
|
1124
|
+
_v$6 = event.colorHex ? {
|
|
1287
1125
|
"background-color": event.colorHex
|
|
1288
1126
|
} : undefined;
|
|
1289
|
-
_v$
|
|
1290
|
-
_p$.t = _$style(_el$
|
|
1127
|
+
_v$5 !== _p$.e && _$setAttribute(_el$77, "data-color", _p$.e = _v$5);
|
|
1128
|
+
_p$.t = _$style(_el$77, _v$6, _p$.t);
|
|
1291
1129
|
return _p$;
|
|
1292
1130
|
}, {
|
|
1293
1131
|
e: undefined,
|
|
1294
1132
|
t: undefined
|
|
1295
1133
|
});
|
|
1296
|
-
return _el$
|
|
1134
|
+
return _el$77;
|
|
1297
1135
|
})()
|
|
1298
1136
|
}));
|
|
1299
|
-
_$effect(() => _$setAttribute(_el$
|
|
1300
|
-
return _el$
|
|
1137
|
+
_$effect(() => _$setAttribute(_el$52, "data-drop-preview", movePreview()?.start && calendar.formatDateKey(movePreview().start, dateConfig()) === dayKey ? "true" : undefined));
|
|
1138
|
+
return _el$52;
|
|
1301
1139
|
})();
|
|
1302
1140
|
}
|
|
1303
|
-
}), _el$
|
|
1304
|
-
_$effect(() => _$setAttribute(_el$
|
|
1305
|
-
return _el$
|
|
1141
|
+
}), _el$51, _co$12);
|
|
1142
|
+
_$effect(() => _$setAttribute(_el$46, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
1143
|
+
return _el$46;
|
|
1306
1144
|
})()
|
|
1307
|
-
}), _el$
|
|
1145
|
+
}), _el$44, _co$10);
|
|
1308
1146
|
_$effect(_p$ => {
|
|
1309
|
-
var _v$
|
|
1310
|
-
_v$
|
|
1311
|
-
_v$
|
|
1312
|
-
_v$
|
|
1147
|
+
var _v$3 = `auto repeat(${weeks().length}, ${props.compact ? "minmax(2.75rem, auto)" : "minmax(5rem, 1fr)"})`,
|
|
1148
|
+
_v$4 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
1149
|
+
_v$3 !== _p$.e && _$setStyleProperty(_el$36, "grid-template-rows", _p$.e = _v$3);
|
|
1150
|
+
_v$4 !== _p$.t && _$setAttribute(_el$37, "data-week-numbers", _p$.t = _v$4);
|
|
1313
1151
|
return _p$;
|
|
1314
1152
|
}, {
|
|
1315
1153
|
e: undefined,
|
|
1316
1154
|
t: undefined
|
|
1317
1155
|
});
|
|
1318
|
-
return _el$
|
|
1156
|
+
return _el$36;
|
|
1319
1157
|
})();
|
|
1320
1158
|
};
|
|
1321
1159
|
|
|
1322
1160
|
/** One entry of the month grid: its whole range, and the days it covers as `YYYY-MM-DD` keys. */
|
|
1323
1161
|
|
|
1162
|
+
/** What the calendar's controller asks of the month view. */
|
|
1163
|
+
|
|
1324
1164
|
/** Lane height and gap of the month entries, in rem; the stylesheet reads both from the grid's custom properties. */
|
|
1325
1165
|
const MONTH_LANE_REM = 1.25;
|
|
1326
1166
|
const MONTH_LANE_GAP_REM = 0.125;
|
|
@@ -1368,34 +1208,6 @@ const monthItems = events => {
|
|
|
1368
1208
|
for (const item of items.values()) item.bar = item.firstKey !== item.lastKey || Boolean(item.event.allDay && item.event.display !== "marker");
|
|
1369
1209
|
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));
|
|
1370
1210
|
};
|
|
1371
|
-
|
|
1372
|
-
/** Places a calendar popover below its anchor when there is room and above it otherwise, inside the viewport. */
|
|
1373
|
-
const placeCalendarPopover = (anchor, popover) => {
|
|
1374
|
-
const margin = 8;
|
|
1375
|
-
const gap = 4;
|
|
1376
|
-
const rect = anchor.getBoundingClientRect();
|
|
1377
|
-
const width = Math.min(popover.offsetWidth || 288, window.innerWidth - margin * 2);
|
|
1378
|
-
const height = popover.offsetHeight;
|
|
1379
|
-
const left = Math.max(margin, Math.min(rect.left, window.innerWidth - width - margin));
|
|
1380
|
-
const roomBelow = window.innerHeight - rect.bottom - gap - margin;
|
|
1381
|
-
const above = height > roomBelow && rect.top - gap - margin > roomBelow;
|
|
1382
|
-
const top = above ? Math.max(margin, rect.top - height - gap) : Math.min(rect.bottom + gap, window.innerHeight - height - margin);
|
|
1383
|
-
popover.style.left = `${left}px`;
|
|
1384
|
-
popover.style.top = `${Math.max(margin, top)}px`;
|
|
1385
|
-
};
|
|
1386
|
-
let measureContext;
|
|
1387
|
-
/** 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. */
|
|
1388
|
-
const textWidth = (text, font) => {
|
|
1389
|
-
measureContext ??= typeof document === "undefined" ? null : document.createElement("canvas").getContext("2d");
|
|
1390
|
-
if (!measureContext) return Number.POSITIVE_INFINITY;
|
|
1391
|
-
measureContext.font = font;
|
|
1392
|
-
return measureContext.measureText(text).width;
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
/** Follows a calendar link the way the calendar's own links do: through the host's navigation when it has one. */
|
|
1396
|
-
const followCalendarHref = (owner, href) => {
|
|
1397
|
-
if (owner.onNavigateHref) owner.onNavigateHref(href);else window.location.assign(href);
|
|
1398
|
-
};
|
|
1399
1211
|
const PRINTABLE_KEY = /^.$/u;
|
|
1400
1212
|
|
|
1401
1213
|
/**
|
|
@@ -1628,6 +1440,25 @@ const MonthView = props => {
|
|
|
1628
1440
|
})) return;
|
|
1629
1441
|
if (props.owner.onSlotActivate) props.owner.onSlotActivate(rangeOf(range));
|
|
1630
1442
|
};
|
|
1443
|
+
onMount(() => props.register?.({
|
|
1444
|
+
quickCreate: create => {
|
|
1445
|
+
const range = selection() ?? {
|
|
1446
|
+
first: rovingKey(),
|
|
1447
|
+
last: rovingKey()
|
|
1448
|
+
};
|
|
1449
|
+
select(range.first, range.last);
|
|
1450
|
+
if (!openCreate(range, {
|
|
1451
|
+
active: true,
|
|
1452
|
+
create
|
|
1453
|
+
})) props.owner.onSlotActivate?.(rangeOf(range));
|
|
1454
|
+
},
|
|
1455
|
+
createTarget: () => rangeOf(selection() ?? {
|
|
1456
|
+
first: rovingKey(),
|
|
1457
|
+
last: rovingKey()
|
|
1458
|
+
}),
|
|
1459
|
+
typing: () => popover()?.kind === "create" && !createActive()
|
|
1460
|
+
}));
|
|
1461
|
+
onCleanup(() => props.register?.(null));
|
|
1631
1462
|
const openDayList = key => {
|
|
1632
1463
|
const anchor = cells.get(key);
|
|
1633
1464
|
if (!anchor) return;
|
|
@@ -1949,36 +1780,36 @@ const MonthView = props => {
|
|
|
1949
1780
|
}
|
|
1950
1781
|
});
|
|
1951
1782
|
const grid = () => (() => {
|
|
1952
|
-
var _el$
|
|
1953
|
-
_el$
|
|
1954
|
-
_el$
|
|
1955
|
-
[_el$
|
|
1956
|
-
_el$
|
|
1957
|
-
[_el$
|
|
1958
|
-
_el$
|
|
1959
|
-
[_el$
|
|
1960
|
-
_$insert(_el$
|
|
1783
|
+
var _el$78 = _$getNextElement(_tmpl$22),
|
|
1784
|
+
_el$79 = _el$78.firstChild,
|
|
1785
|
+
_el$81 = _el$79.firstChild,
|
|
1786
|
+
[_el$82, _co$21] = _$getNextMarker(_el$81.nextSibling),
|
|
1787
|
+
_el$83 = _el$82.nextSibling,
|
|
1788
|
+
[_el$84, _co$22] = _$getNextMarker(_el$83.nextSibling),
|
|
1789
|
+
_el$85 = _el$79.nextSibling,
|
|
1790
|
+
[_el$86, _co$23] = _$getNextMarker(_el$85.nextSibling);
|
|
1791
|
+
_$insert(_el$79, _$createComponent(Show, {
|
|
1961
1792
|
get when() {
|
|
1962
1793
|
return props.owner.withWeekNumbers;
|
|
1963
1794
|
},
|
|
1964
1795
|
get children() {
|
|
1965
|
-
var _el$
|
|
1966
|
-
_$insert(_el$
|
|
1967
|
-
return _el$
|
|
1796
|
+
var _el$80 = _$getNextElement(_tmpl$21);
|
|
1797
|
+
_$insert(_el$80, () => calendarMessages().weekShort);
|
|
1798
|
+
return _el$80;
|
|
1968
1799
|
}
|
|
1969
|
-
}), _el$
|
|
1970
|
-
_$insert(_el$
|
|
1800
|
+
}), _el$82, _co$21);
|
|
1801
|
+
_$insert(_el$79, _$createComponent(For, {
|
|
1971
1802
|
get each() {
|
|
1972
1803
|
return weekdays();
|
|
1973
1804
|
},
|
|
1974
1805
|
children: (day, index) => (() => {
|
|
1975
|
-
var _el$
|
|
1976
|
-
_$insert(_el$
|
|
1977
|
-
_$effect(() => _$setAttribute(_el$
|
|
1978
|
-
return _el$
|
|
1806
|
+
var _el$87 = _$getNextElement(_tmpl$21);
|
|
1807
|
+
_$insert(_el$87, day);
|
|
1808
|
+
_$effect(() => _$setAttribute(_el$87, "data-weekend", index() > 4 ? "true" : undefined));
|
|
1809
|
+
return _el$87;
|
|
1979
1810
|
})()
|
|
1980
|
-
}), _el$
|
|
1981
|
-
_$insert(_el$
|
|
1811
|
+
}), _el$84, _co$22);
|
|
1812
|
+
_$insert(_el$78, _$createComponent(For, {
|
|
1982
1813
|
get each() {
|
|
1983
1814
|
return weeks();
|
|
1984
1815
|
},
|
|
@@ -1990,18 +1821,18 @@ const MonthView = props => {
|
|
|
1990
1821
|
const weekHref = () => viewHref(week[0].key, "week");
|
|
1991
1822
|
const weekNumber = () => zonedWeekNumber(week[0].day, dateConfig());
|
|
1992
1823
|
return (() => {
|
|
1993
|
-
var _el$
|
|
1994
|
-
_el$
|
|
1995
|
-
[_el$
|
|
1996
|
-
_el$
|
|
1997
|
-
[_el$
|
|
1998
|
-
_$insert(_el$
|
|
1824
|
+
var _el$88 = _$getNextElement(_tmpl$24),
|
|
1825
|
+
_el$90 = _el$88.firstChild,
|
|
1826
|
+
[_el$91, _co$24] = _$getNextMarker(_el$90.nextSibling),
|
|
1827
|
+
_el$92 = _el$91.nextSibling,
|
|
1828
|
+
[_el$93, _co$25] = _$getNextMarker(_el$92.nextSibling);
|
|
1829
|
+
_$insert(_el$88, _$createComponent(Show, {
|
|
1999
1830
|
get when() {
|
|
2000
1831
|
return props.owner.withWeekNumbers;
|
|
2001
1832
|
},
|
|
2002
1833
|
get children() {
|
|
2003
|
-
var _el$
|
|
2004
|
-
_$insert(_el$
|
|
1834
|
+
var _el$89 = _$getNextElement(_tmpl$23);
|
|
1835
|
+
_$insert(_el$89, _$createComponent(Show, {
|
|
2005
1836
|
get when() {
|
|
2006
1837
|
return weekHref();
|
|
2007
1838
|
},
|
|
@@ -2014,25 +1845,25 @@ const MonthView = props => {
|
|
|
2014
1845
|
return weekNumber();
|
|
2015
1846
|
},
|
|
2016
1847
|
get children() {
|
|
2017
|
-
var _el$
|
|
2018
|
-
_el$
|
|
2019
|
-
_$insert(_el$
|
|
1848
|
+
var _el$94 = _$getNextElement(_tmpl$25);
|
|
1849
|
+
_el$94.$$click = () => openView(week[0].key, "week");
|
|
1850
|
+
_$insert(_el$94, weekNumber);
|
|
2020
1851
|
_$effect(_p$ => {
|
|
2021
|
-
var _v$
|
|
1852
|
+
var _v$0 = calendarMessages().calendarOpenWeekNumber({
|
|
2022
1853
|
week: weekNumber()
|
|
2023
1854
|
}),
|
|
2024
|
-
_v$
|
|
1855
|
+
_v$1 = calendarMessages().calendarOpenWeekNumber({
|
|
2025
1856
|
week: weekNumber()
|
|
2026
1857
|
});
|
|
2027
|
-
_v$
|
|
2028
|
-
_v$
|
|
1858
|
+
_v$0 !== _p$.e && _$setAttribute(_el$94, "title", _p$.e = _v$0);
|
|
1859
|
+
_v$1 !== _p$.t && _$setAttribute(_el$94, "aria-label", _p$.t = _v$1);
|
|
2029
1860
|
return _p$;
|
|
2030
1861
|
}, {
|
|
2031
1862
|
e: undefined,
|
|
2032
1863
|
t: undefined
|
|
2033
1864
|
});
|
|
2034
1865
|
_$runHydrationEvents();
|
|
2035
|
-
return _el$
|
|
1866
|
+
return _el$94;
|
|
2036
1867
|
}
|
|
2037
1868
|
});
|
|
2038
1869
|
},
|
|
@@ -2060,10 +1891,10 @@ const MonthView = props => {
|
|
|
2060
1891
|
}
|
|
2061
1892
|
})
|
|
2062
1893
|
}));
|
|
2063
|
-
return _el$
|
|
1894
|
+
return _el$89;
|
|
2064
1895
|
}
|
|
2065
|
-
}), _el$
|
|
2066
|
-
_$insert(_el$
|
|
1896
|
+
}), _el$91, _co$24);
|
|
1897
|
+
_$insert(_el$88, _$createComponent(For, {
|
|
2067
1898
|
each: week,
|
|
2068
1899
|
children: ({
|
|
2069
1900
|
day,
|
|
@@ -2079,59 +1910,59 @@ const MonthView = props => {
|
|
|
2079
1910
|
hidden: 0
|
|
2080
1911
|
};
|
|
2081
1912
|
return (() => {
|
|
2082
|
-
var _el$
|
|
2083
|
-
_el$
|
|
2084
|
-
_el$
|
|
2085
|
-
_el$
|
|
2086
|
-
[_el$
|
|
2087
|
-
_el$
|
|
2088
|
-
_el$
|
|
2089
|
-
[_el$
|
|
2090
|
-
_el$
|
|
2091
|
-
[_el$
|
|
2092
|
-
_el$
|
|
2093
|
-
[_el$
|
|
2094
|
-
_el$
|
|
2095
|
-
_el$
|
|
1913
|
+
var _el$95 = _$getNextElement(_tmpl$27),
|
|
1914
|
+
_el$96 = _el$95.firstChild,
|
|
1915
|
+
_el$97 = _el$96.firstChild,
|
|
1916
|
+
_el$98 = _el$97.nextSibling,
|
|
1917
|
+
[_el$99, _co$26] = _$getNextMarker(_el$98.nextSibling),
|
|
1918
|
+
_el$100 = _el$96.nextSibling,
|
|
1919
|
+
_el$107 = _el$100.firstChild,
|
|
1920
|
+
[_el$108, _co$28] = _$getNextMarker(_el$107.nextSibling),
|
|
1921
|
+
_el$109 = _el$108.nextSibling,
|
|
1922
|
+
[_el$110, _co$29] = _$getNextMarker(_el$109.nextSibling),
|
|
1923
|
+
_el$111 = _el$110.nextSibling,
|
|
1924
|
+
[_el$112, _co$30] = _$getNextMarker(_el$111.nextSibling);
|
|
1925
|
+
_el$95.$$keydown = event => onCellKeyDown(event, key);
|
|
1926
|
+
_el$95.$$contextmenu = event => {
|
|
2096
1927
|
// The pressed day takes the focus, so closing the menu with Escape returns there.
|
|
2097
1928
|
menuKey = pressedKey(event, key);
|
|
2098
1929
|
if (hasMenu()) focusCell(menuKey);
|
|
2099
1930
|
};
|
|
2100
|
-
_el$
|
|
2101
|
-
_el$
|
|
2102
|
-
_el$
|
|
2103
|
-
_$use(element => cells.set(key, element), _el$
|
|
2104
|
-
_$setAttribute(_el$
|
|
2105
|
-
_$setAttribute(_el$
|
|
2106
|
-
_$setAttribute(_el$
|
|
2107
|
-
_$setAttribute(_el$
|
|
2108
|
-
_$insert(_el$
|
|
2109
|
-
_$insert(_el$
|
|
1931
|
+
_el$95.$$pointerdown = event => onCellPointerDown(event, key);
|
|
1932
|
+
_el$95.$$dblclick = event => onCellDoubleClick(event, key);
|
|
1933
|
+
_el$95.$$click = event => onCellClick(event, key);
|
|
1934
|
+
_$use(element => cells.set(key, element), _el$95);
|
|
1935
|
+
_$setAttribute(_el$95, "aria-label", label);
|
|
1936
|
+
_$setAttribute(_el$95, "data-calendar-day-key", key);
|
|
1937
|
+
_$setAttribute(_el$95, "data-outside", !sameMonth ? "true" : undefined);
|
|
1938
|
+
_$setAttribute(_el$97, "data-outside", !sameMonth ? "true" : undefined);
|
|
1939
|
+
_$insert(_el$97, () => calendar.formatDayNumber(day, dateConfig()));
|
|
1940
|
+
_$insert(_el$96, _$createComponent(Show, {
|
|
2110
1941
|
when: dayBadge,
|
|
2111
1942
|
children: badge => (() => {
|
|
2112
|
-
var _el$
|
|
2113
|
-
_el$
|
|
2114
|
-
[_el$
|
|
2115
|
-
_el$
|
|
2116
|
-
[_el$
|
|
2117
|
-
_$insert(_el$
|
|
1943
|
+
var _el$113 = _$getNextElement(_tmpl$19),
|
|
1944
|
+
_el$114 = _el$113.firstChild,
|
|
1945
|
+
[_el$115, _co$31] = _$getNextMarker(_el$114.nextSibling),
|
|
1946
|
+
_el$116 = _el$115.nextSibling,
|
|
1947
|
+
[_el$117, _co$32] = _$getNextMarker(_el$116.nextSibling);
|
|
1948
|
+
_$insert(_el$113, _$createComponent(Show, {
|
|
2118
1949
|
get when() {
|
|
2119
1950
|
return badge().icon;
|
|
2120
1951
|
},
|
|
2121
1952
|
children: icon => (() => {
|
|
2122
|
-
var _el$
|
|
2123
|
-
_$effect(() => _$className(_el$
|
|
2124
|
-
return _el$
|
|
1953
|
+
var _el$118 = _$getNextElement(_tmpl$3);
|
|
1954
|
+
_$effect(() => _$className(_el$118, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1955
|
+
return _el$118;
|
|
2125
1956
|
})()
|
|
2126
|
-
}), _el$
|
|
2127
|
-
_$insert(_el$
|
|
2128
|
-
return _el$
|
|
1957
|
+
}), _el$115, _co$31);
|
|
1958
|
+
_$insert(_el$113, () => badge().label, _el$117, _co$32);
|
|
1959
|
+
return _el$113;
|
|
2129
1960
|
})()
|
|
2130
|
-
}), _el$
|
|
1961
|
+
}), _el$99, _co$26);
|
|
2131
1962
|
_$use(element => {
|
|
2132
1963
|
if (column() === 0) observeLanes(element, weekIndex());
|
|
2133
|
-
}, _el$
|
|
2134
|
-
_$insert(_el$
|
|
1964
|
+
}, _el$100);
|
|
1965
|
+
_$insert(_el$100, _$createComponent(For, {
|
|
2135
1966
|
get each() {
|
|
2136
1967
|
return bars();
|
|
2137
1968
|
},
|
|
@@ -2148,8 +1979,8 @@ const MonthView = props => {
|
|
|
2148
1979
|
return hintFits(`${bar.item.event.title}${startHint() ?? ""}`, hint, span) ? hint : undefined;
|
|
2149
1980
|
};
|
|
2150
1981
|
return (() => {
|
|
2151
|
-
var _el$
|
|
2152
|
-
_$spread(_el$
|
|
1982
|
+
var _el$119 = _$getNextElement(_tmpl$28);
|
|
1983
|
+
_$spread(_el$119, _$mergeProps({
|
|
2153
1984
|
get style() {
|
|
2154
1985
|
return {
|
|
2155
1986
|
"--k2b-calendar-span": String(span),
|
|
@@ -2166,7 +1997,7 @@ const MonthView = props => {
|
|
|
2166
1997
|
return bar.continuesAfter ? "true" : undefined;
|
|
2167
1998
|
}
|
|
2168
1999
|
}, () => linkProps(bar.item)), false, true);
|
|
2169
|
-
_$insert(_el$
|
|
2000
|
+
_$insert(_el$119, _$createComponent(EventChip, {
|
|
2170
2001
|
get event() {
|
|
2171
2002
|
return bar.item.event;
|
|
2172
2003
|
},
|
|
@@ -2201,17 +2032,17 @@ const MonthView = props => {
|
|
|
2201
2032
|
}
|
|
2202
2033
|
}));
|
|
2203
2034
|
_$runHydrationEvents();
|
|
2204
|
-
return _el$
|
|
2035
|
+
return _el$119;
|
|
2205
2036
|
})();
|
|
2206
2037
|
}
|
|
2207
|
-
}), _el$
|
|
2208
|
-
_$insert(_el$
|
|
2038
|
+
}), _el$108, _co$28);
|
|
2039
|
+
_$insert(_el$100, _$createComponent(For, {
|
|
2209
2040
|
get each() {
|
|
2210
2041
|
return cell().shown;
|
|
2211
2042
|
},
|
|
2212
2043
|
children: (item, index) => (() => {
|
|
2213
|
-
var _el$
|
|
2214
|
-
_$insert(_el$
|
|
2044
|
+
var _el$120 = _$getNextElement(_tmpl$29);
|
|
2045
|
+
_$insert(_el$120, _$createComponent(EventChip, {
|
|
2215
2046
|
get event() {
|
|
2216
2047
|
return item.event;
|
|
2217
2048
|
},
|
|
@@ -2232,42 +2063,42 @@ const MonthView = props => {
|
|
|
2232
2063
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, item, markDragged) : undefined;
|
|
2233
2064
|
}
|
|
2234
2065
|
}));
|
|
2235
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
2236
|
-
return _el$
|
|
2066
|
+
_$effect(_$p => _$setStyleProperty(_el$120, "--k2b-calendar-row", String(cell().top + index())));
|
|
2067
|
+
return _el$120;
|
|
2237
2068
|
})()
|
|
2238
|
-
}), _el$
|
|
2239
|
-
_$insert(_el$
|
|
2069
|
+
}), _el$110, _co$29);
|
|
2070
|
+
_$insert(_el$100, _$createComponent(Show, {
|
|
2240
2071
|
get when() {
|
|
2241
2072
|
return cell().hidden > 0;
|
|
2242
2073
|
},
|
|
2243
2074
|
get children() {
|
|
2244
|
-
var _el$
|
|
2245
|
-
_el$
|
|
2246
|
-
_el$
|
|
2247
|
-
_el$
|
|
2248
|
-
_el$
|
|
2249
|
-
[_el$
|
|
2250
|
-
_el$
|
|
2075
|
+
var _el$101 = _$getNextElement(_tmpl$26),
|
|
2076
|
+
_el$102 = _el$101.firstChild,
|
|
2077
|
+
_el$103 = _el$102.nextSibling,
|
|
2078
|
+
_el$104 = _el$103.firstChild,
|
|
2079
|
+
_el$105 = _el$104.nextSibling,
|
|
2080
|
+
[_el$106, _co$27] = _$getNextMarker(_el$105.nextSibling);
|
|
2081
|
+
_el$101.$$click = () => {
|
|
2251
2082
|
const current = popover();
|
|
2252
2083
|
if (current?.kind === "day" && current.dayKey === key) closePopover(false);else openDayList(key);
|
|
2253
2084
|
};
|
|
2254
|
-
_$insert(_el$
|
|
2085
|
+
_$insert(_el$102, () => calendarMessages().calendarMoreEvents({
|
|
2255
2086
|
count: cell().hidden
|
|
2256
2087
|
}));
|
|
2257
|
-
_$insert(_el$
|
|
2088
|
+
_$insert(_el$103, () => cell().hidden, _el$106, _co$27);
|
|
2258
2089
|
_$effect(_p$ => {
|
|
2259
|
-
var _v$
|
|
2260
|
-
_v$
|
|
2090
|
+
var _v$10 = String(cell().top + cell().shown.length),
|
|
2091
|
+
_v$11 = calendarMessages().calendarMoreEventsOn({
|
|
2261
2092
|
count: cell().hidden,
|
|
2262
2093
|
label
|
|
2263
2094
|
}),
|
|
2264
|
-
_v$
|
|
2095
|
+
_v$12 = (() => {
|
|
2265
2096
|
const current = popover();
|
|
2266
2097
|
return current?.kind === "day" && current.dayKey === key;
|
|
2267
2098
|
})();
|
|
2268
|
-
_v$
|
|
2269
|
-
_v$
|
|
2270
|
-
_v$
|
|
2099
|
+
_v$10 !== _p$.e && _$setStyleProperty(_el$101, "--k2b-calendar-row", _p$.e = _v$10);
|
|
2100
|
+
_v$11 !== _p$.t && _$setAttribute(_el$101, "aria-label", _p$.t = _v$11);
|
|
2101
|
+
_v$12 !== _p$.a && _$setAttribute(_el$101, "aria-expanded", _p$.a = _v$12);
|
|
2271
2102
|
return _p$;
|
|
2272
2103
|
}, {
|
|
2273
2104
|
e: undefined,
|
|
@@ -2275,26 +2106,26 @@ const MonthView = props => {
|
|
|
2275
2106
|
a: undefined
|
|
2276
2107
|
});
|
|
2277
2108
|
_$runHydrationEvents();
|
|
2278
|
-
return _el$
|
|
2109
|
+
return _el$101;
|
|
2279
2110
|
}
|
|
2280
|
-
}), _el$
|
|
2111
|
+
}), _el$112, _co$30);
|
|
2281
2112
|
_$effect(_p$ => {
|
|
2282
|
-
var _v$
|
|
2283
|
-
_v$
|
|
2284
|
-
_v$
|
|
2285
|
-
_v$
|
|
2286
|
-
_v$
|
|
2287
|
-
_v$
|
|
2288
|
-
_v$
|
|
2289
|
-
_v$
|
|
2290
|
-
_v$
|
|
2291
|
-
_v$
|
|
2292
|
-
_v$
|
|
2293
|
-
_v$
|
|
2294
|
-
_v$
|
|
2295
|
-
_v$
|
|
2296
|
-
_v$
|
|
2297
|
-
_v$
|
|
2113
|
+
var _v$13 = rovingKey() === key ? 0 : -1,
|
|
2114
|
+
_v$14 = within(selection(), key) ? "true" : "false",
|
|
2115
|
+
_v$15 = key === todayKey() ? "date" : undefined,
|
|
2116
|
+
_v$16 = column() > 4 ? "true" : undefined,
|
|
2117
|
+
_v$17 = key < todayKey() ? "true" : undefined,
|
|
2118
|
+
_v$18 = selectionPart(key),
|
|
2119
|
+
_v$19 = within(dropRange(), key) ? "true" : undefined,
|
|
2120
|
+
_v$20 = key === todayKey() ? "true" : undefined;
|
|
2121
|
+
_v$13 !== _p$.e && _$setAttribute(_el$95, "tabindex", _p$.e = _v$13);
|
|
2122
|
+
_v$14 !== _p$.t && _$setAttribute(_el$95, "aria-selected", _p$.t = _v$14);
|
|
2123
|
+
_v$15 !== _p$.a && _$setAttribute(_el$95, "aria-current", _p$.a = _v$15);
|
|
2124
|
+
_v$16 !== _p$.o && _$setAttribute(_el$95, "data-weekend", _p$.o = _v$16);
|
|
2125
|
+
_v$17 !== _p$.i && _$setAttribute(_el$95, "data-past", _p$.i = _v$17);
|
|
2126
|
+
_v$18 !== _p$.n && _$setAttribute(_el$95, "data-selected", _p$.n = _v$18);
|
|
2127
|
+
_v$19 !== _p$.s && _$setAttribute(_el$95, "data-drop-preview", _p$.s = _v$19);
|
|
2128
|
+
_v$20 !== _p$.h && _$setAttribute(_el$97, "data-today", _p$.h = _v$20);
|
|
2298
2129
|
return _p$;
|
|
2299
2130
|
}, {
|
|
2300
2131
|
e: undefined,
|
|
@@ -2307,29 +2138,29 @@ const MonthView = props => {
|
|
|
2307
2138
|
h: undefined
|
|
2308
2139
|
});
|
|
2309
2140
|
_$runHydrationEvents();
|
|
2310
|
-
return _el$
|
|
2141
|
+
return _el$95;
|
|
2311
2142
|
})();
|
|
2312
2143
|
}
|
|
2313
|
-
}), _el$
|
|
2314
|
-
_$effect(() => _$setAttribute(_el$
|
|
2315
|
-
return _el$
|
|
2144
|
+
}), _el$93, _co$25);
|
|
2145
|
+
_$effect(() => _$setAttribute(_el$88, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
2146
|
+
return _el$88;
|
|
2316
2147
|
})();
|
|
2317
2148
|
}
|
|
2318
|
-
}), _el$
|
|
2149
|
+
}), _el$86, _co$23);
|
|
2319
2150
|
_$effect(_p$ => {
|
|
2320
|
-
var _v$
|
|
2321
|
-
_v$
|
|
2322
|
-
_v$
|
|
2323
|
-
_v$
|
|
2324
|
-
_v$
|
|
2325
|
-
_v$
|
|
2151
|
+
var _v$7 = formatMonth(props.date, dateConfig()),
|
|
2152
|
+
_v$8 = `auto repeat(${weeks().length}, minmax(5rem, 1fr))`,
|
|
2153
|
+
_v$9 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
2154
|
+
_v$7 !== _p$.e && _$setAttribute(_el$78, "aria-label", _p$.e = _v$7);
|
|
2155
|
+
_v$8 !== _p$.t && _$setStyleProperty(_el$78, "grid-template-rows", _p$.t = _v$8);
|
|
2156
|
+
_v$9 !== _p$.a && _$setAttribute(_el$79, "data-week-numbers", _p$.a = _v$9);
|
|
2326
2157
|
return _p$;
|
|
2327
2158
|
}, {
|
|
2328
2159
|
e: undefined,
|
|
2329
2160
|
t: undefined,
|
|
2330
2161
|
a: undefined
|
|
2331
2162
|
});
|
|
2332
|
-
return _el$
|
|
2163
|
+
return _el$78;
|
|
2333
2164
|
})();
|
|
2334
2165
|
const dayList = dayKey => {
|
|
2335
2166
|
const day = parseKey(dayKey);
|
|
@@ -2337,36 +2168,36 @@ const MonthView = props => {
|
|
|
2337
2168
|
// Read where it renders, so a refresh while the list is open updates it as it does the grid.
|
|
2338
2169
|
const entries = () => dayEntries(dayKey);
|
|
2339
2170
|
return (() => {
|
|
2340
|
-
var _el$
|
|
2341
|
-
_el$
|
|
2342
|
-
_el$
|
|
2343
|
-
[_el$
|
|
2344
|
-
_el$
|
|
2345
|
-
_el$
|
|
2346
|
-
[_el$
|
|
2347
|
-
_el$
|
|
2348
|
-
[_el$
|
|
2349
|
-
_$insert(_el$
|
|
2350
|
-
_$insert(_el$
|
|
2171
|
+
var _el$121 = _$getNextElement(_tmpl$32),
|
|
2172
|
+
_el$122 = _el$121.firstChild,
|
|
2173
|
+
_el$130 = _el$122.nextSibling,
|
|
2174
|
+
[_el$131, _co$35] = _$getNextMarker(_el$130.nextSibling),
|
|
2175
|
+
_el$124 = _el$131.nextSibling,
|
|
2176
|
+
_el$126 = _el$124.firstChild,
|
|
2177
|
+
[_el$127, _co$33] = _$getNextMarker(_el$126.nextSibling),
|
|
2178
|
+
_el$128 = _el$127.nextSibling,
|
|
2179
|
+
[_el$129, _co$34] = _$getNextMarker(_el$128.nextSibling);
|
|
2180
|
+
_$insert(_el$122, () => dayLabel(day));
|
|
2181
|
+
_$insert(_el$121, _$createComponent(Show, {
|
|
2351
2182
|
get when() {
|
|
2352
2183
|
return entries().length > 0;
|
|
2353
2184
|
},
|
|
2354
2185
|
get fallback() {
|
|
2355
2186
|
return (() => {
|
|
2356
|
-
var _el$
|
|
2357
|
-
_$insert(_el$
|
|
2358
|
-
return _el$
|
|
2187
|
+
var _el$132 = _$getNextElement(_tmpl$33);
|
|
2188
|
+
_$insert(_el$132, () => calendarMessages().calendarNothingPlanned);
|
|
2189
|
+
return _el$132;
|
|
2359
2190
|
})();
|
|
2360
2191
|
},
|
|
2361
2192
|
get children() {
|
|
2362
|
-
var _el$
|
|
2363
|
-
_$insert(_el$
|
|
2193
|
+
var _el$123 = _$getNextElement(_tmpl$30);
|
|
2194
|
+
_$insert(_el$123, _$createComponent(For, {
|
|
2364
2195
|
get each() {
|
|
2365
2196
|
return entries();
|
|
2366
2197
|
},
|
|
2367
2198
|
children: item => (() => {
|
|
2368
|
-
var _el$
|
|
2369
|
-
_$insert(_el$
|
|
2199
|
+
var _el$133 = _$getNextElement(_tmpl$34);
|
|
2200
|
+
_$insert(_el$133, _$createComponent(EventChip, {
|
|
2370
2201
|
get event() {
|
|
2371
2202
|
return item.event;
|
|
2372
2203
|
},
|
|
@@ -2387,13 +2218,13 @@ const MonthView = props => {
|
|
|
2387
2218
|
return leadingTime(item);
|
|
2388
2219
|
}
|
|
2389
2220
|
}));
|
|
2390
|
-
return _el$
|
|
2221
|
+
return _el$133;
|
|
2391
2222
|
})()
|
|
2392
2223
|
}));
|
|
2393
|
-
return _el$
|
|
2224
|
+
return _el$123;
|
|
2394
2225
|
}
|
|
2395
|
-
}), _el$
|
|
2396
|
-
_$insert(_el$
|
|
2226
|
+
}), _el$131, _co$35);
|
|
2227
|
+
_$insert(_el$124, _$createComponent(Show, {
|
|
2397
2228
|
when: href,
|
|
2398
2229
|
get fallback() {
|
|
2399
2230
|
return _$createComponent(Show, {
|
|
@@ -2407,7 +2238,7 @@ const MonthView = props => {
|
|
|
2407
2238
|
size: "sm",
|
|
2408
2239
|
onClick: () => openView(dayKey, "day"),
|
|
2409
2240
|
get children() {
|
|
2410
|
-
return [_$getNextElement(_tmpl$
|
|
2241
|
+
return [_$getNextElement(_tmpl$35), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2411
2242
|
}
|
|
2412
2243
|
});
|
|
2413
2244
|
}
|
|
@@ -2426,11 +2257,11 @@ const MonthView = props => {
|
|
|
2426
2257
|
"data-size": "sm"
|
|
2427
2258
|
},
|
|
2428
2259
|
get children() {
|
|
2429
|
-
return [_$getNextElement(_tmpl$
|
|
2260
|
+
return [_$getNextElement(_tmpl$35), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2430
2261
|
}
|
|
2431
2262
|
})
|
|
2432
|
-
}), _el$
|
|
2433
|
-
_$insert(_el$
|
|
2263
|
+
}), _el$127, _co$33);
|
|
2264
|
+
_$insert(_el$124, _$createComponent(Show, {
|
|
2434
2265
|
get when() {
|
|
2435
2266
|
return props.owner.renderQuickCreate;
|
|
2436
2267
|
},
|
|
@@ -2449,12 +2280,12 @@ const MonthView = props => {
|
|
|
2449
2280
|
});
|
|
2450
2281
|
},
|
|
2451
2282
|
get children() {
|
|
2452
|
-
return [_$getNextElement(_tmpl$
|
|
2283
|
+
return [_$getNextElement(_tmpl$31), _$memo(() => calendarMessages().calendarNewEvent)];
|
|
2453
2284
|
}
|
|
2454
2285
|
});
|
|
2455
2286
|
}
|
|
2456
|
-
}), _el$
|
|
2457
|
-
return _el$
|
|
2287
|
+
}), _el$129, _co$34);
|
|
2288
|
+
return _el$121;
|
|
2458
2289
|
})();
|
|
2459
2290
|
};
|
|
2460
2291
|
return [_$createComponent(Show, {
|
|
@@ -2481,18 +2312,18 @@ const MonthView = props => {
|
|
|
2481
2312
|
});
|
|
2482
2313
|
}
|
|
2483
2314
|
}), (() => {
|
|
2484
|
-
var _el$
|
|
2485
|
-
_el$
|
|
2315
|
+
var _el$136 = _$getNextElement(_tmpl$36);
|
|
2316
|
+
_el$136.addEventListener("toggle", event => {
|
|
2486
2317
|
// A late close of the popover that another opening already replaced keeps the new one. Focus returns to the
|
|
2487
2318
|
// grid only from inside the popover, never from what a click outside it chose.
|
|
2488
2319
|
if (event.newState !== "closed" || !popover() || event.currentTarget.matches(":popover-open")) return;
|
|
2489
2320
|
const inside = event.currentTarget.contains(document.activeElement) || document.activeElement === document.body;
|
|
2490
2321
|
closePopover(inside);
|
|
2491
2322
|
});
|
|
2492
|
-
_el$
|
|
2323
|
+
_el$136.$$focusin = () => setCreateActive(true);
|
|
2493
2324
|
var _ref$ = popoverElement;
|
|
2494
|
-
typeof _ref$ === "function" ? _$use(_ref$, _el$
|
|
2495
|
-
_$insert(_el$
|
|
2325
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$136) : popoverElement = _el$136;
|
|
2326
|
+
_$insert(_el$136, _$createComponent(Show, {
|
|
2496
2327
|
get when() {
|
|
2497
2328
|
return popover();
|
|
2498
2329
|
},
|
|
@@ -2505,16 +2336,16 @@ const MonthView = props => {
|
|
|
2505
2336
|
}) : dayList(value.dayKey)
|
|
2506
2337
|
}));
|
|
2507
2338
|
_$effect(_p$ => {
|
|
2508
|
-
var _v$
|
|
2339
|
+
var _v$21 = (() => {
|
|
2509
2340
|
const current = popover();
|
|
2510
2341
|
if (current?.kind === "day") return dayLabel(parseKey(current.dayKey));
|
|
2511
2342
|
return calendarMessages().calendarQuickCreate;
|
|
2512
2343
|
})(),
|
|
2513
|
-
_v$
|
|
2514
|
-
_v$
|
|
2515
|
-
_v$
|
|
2516
|
-
_v$
|
|
2517
|
-
_v$
|
|
2344
|
+
_v$22 = popover()?.kind,
|
|
2345
|
+
_v$23 = popover()?.kind === "create" && !createActive() ? "true" : undefined;
|
|
2346
|
+
_v$21 !== _p$.e && _$setAttribute(_el$136, "aria-label", _p$.e = _v$21);
|
|
2347
|
+
_v$22 !== _p$.t && _$setAttribute(_el$136, "data-kind", _p$.t = _v$22);
|
|
2348
|
+
_v$23 !== _p$.a && _$setAttribute(_el$136, "data-quiet", _p$.a = _v$23);
|
|
2518
2349
|
return _p$;
|
|
2519
2350
|
}, {
|
|
2520
2351
|
e: undefined,
|
|
@@ -2522,7 +2353,7 @@ const MonthView = props => {
|
|
|
2522
2353
|
a: undefined
|
|
2523
2354
|
});
|
|
2524
2355
|
_$runHydrationEvents();
|
|
2525
|
-
return _el$
|
|
2356
|
+
return _el$136;
|
|
2526
2357
|
})()];
|
|
2527
2358
|
};
|
|
2528
2359
|
const TimeGridView = props => {
|
|
@@ -2697,10 +2528,12 @@ const TimeGridView = props => {
|
|
|
2697
2528
|
}
|
|
2698
2529
|
return [...groups.values()];
|
|
2699
2530
|
};
|
|
2531
|
+
// 12 rem per lane. The 40 rem grid is wider than one or two lanes, so only
|
|
2532
|
+
// three or more make the day scroll, and one lane fits beside a tablet drawer.
|
|
2700
2533
|
const dayColumnMinWidth = layouts => {
|
|
2701
2534
|
if (!isDayView()) return undefined;
|
|
2702
2535
|
const lanes = Math.max(1, ...layouts.map(layout => layout.lanes));
|
|
2703
|
-
return `${
|
|
2536
|
+
return `${lanes * 12}rem`;
|
|
2704
2537
|
};
|
|
2705
2538
|
const laneStyle = layoutItem => {
|
|
2706
2539
|
if (isDayView()) {
|
|
@@ -2737,19 +2570,19 @@ const TimeGridView = props => {
|
|
|
2737
2570
|
});
|
|
2738
2571
|
});
|
|
2739
2572
|
return (() => {
|
|
2740
|
-
var _el$
|
|
2573
|
+
var _el$137 = _$getNextElement(_tmpl$38),
|
|
2574
|
+
_el$138 = _el$137.firstChild,
|
|
2575
|
+
_el$139 = _el$138.firstChild,
|
|
2576
|
+
_el$140 = _el$139.nextSibling,
|
|
2577
|
+
[_el$141, _co$36] = _$getNextMarker(_el$140.nextSibling),
|
|
2578
|
+
_el$151 = _el$138.nextSibling,
|
|
2579
|
+
[_el$152, _co$39] = _$getNextMarker(_el$151.nextSibling),
|
|
2580
|
+
_el$146 = _el$152.nextSibling,
|
|
2581
|
+
_el$147 = _el$146.firstChild,
|
|
2741
2582
|
_el$148 = _el$147.firstChild,
|
|
2742
|
-
_el$149 = _el$148.
|
|
2743
|
-
_el$150 = _el$149.nextSibling
|
|
2744
|
-
|
|
2745
|
-
_el$161 = _el$148.nextSibling,
|
|
2746
|
-
[_el$162, _co$40] = _$getNextMarker(_el$161.nextSibling),
|
|
2747
|
-
_el$156 = _el$162.nextSibling,
|
|
2748
|
-
_el$157 = _el$156.firstChild,
|
|
2749
|
-
_el$158 = _el$157.firstChild,
|
|
2750
|
-
_el$159 = _el$158.nextSibling,
|
|
2751
|
-
[_el$160, _co$39] = _$getNextMarker(_el$159.nextSibling);
|
|
2752
|
-
_$insert(_el$148, _$createComponent(For, {
|
|
2583
|
+
_el$149 = _el$148.nextSibling,
|
|
2584
|
+
[_el$150, _co$38] = _$getNextMarker(_el$149.nextSibling);
|
|
2585
|
+
_$insert(_el$138, _$createComponent(For, {
|
|
2753
2586
|
get each() {
|
|
2754
2587
|
return props.days;
|
|
2755
2588
|
},
|
|
@@ -2768,47 +2601,47 @@ const TimeGridView = props => {
|
|
|
2768
2601
|
},
|
|
2769
2602
|
get children() {
|
|
2770
2603
|
return [(() => {
|
|
2771
|
-
var _el$
|
|
2772
|
-
_$insert(_el$
|
|
2773
|
-
_$effect(() => _$setAttribute(_el$
|
|
2774
|
-
return _el$
|
|
2604
|
+
var _el$153 = _$getNextElement(_tmpl$39);
|
|
2605
|
+
_$insert(_el$153, () => formatDay(day, dateConfig()));
|
|
2606
|
+
_$effect(() => _$setAttribute(_el$153, "data-today", today() ? "true" : undefined));
|
|
2607
|
+
return _el$153;
|
|
2775
2608
|
})(), _$createComponent(Show, {
|
|
2776
2609
|
when: dayBadge,
|
|
2777
2610
|
children: badge => (() => {
|
|
2778
|
-
var _el$
|
|
2779
|
-
_el$
|
|
2780
|
-
[_el$
|
|
2781
|
-
_el$
|
|
2782
|
-
[_el$
|
|
2783
|
-
_$insert(_el$
|
|
2611
|
+
var _el$154 = _$getNextElement(_tmpl$40),
|
|
2612
|
+
_el$155 = _el$154.firstChild,
|
|
2613
|
+
[_el$156, _co$40] = _$getNextMarker(_el$155.nextSibling),
|
|
2614
|
+
_el$157 = _el$156.nextSibling,
|
|
2615
|
+
[_el$158, _co$41] = _$getNextMarker(_el$157.nextSibling);
|
|
2616
|
+
_$insert(_el$154, _$createComponent(Show, {
|
|
2784
2617
|
get when() {
|
|
2785
2618
|
return badge().icon;
|
|
2786
2619
|
},
|
|
2787
2620
|
children: icon => (() => {
|
|
2788
|
-
var _el$
|
|
2789
|
-
_$effect(() => _$className(_el$
|
|
2790
|
-
return _el$
|
|
2621
|
+
var _el$159 = _$getNextElement(_tmpl$3);
|
|
2622
|
+
_$effect(() => _$className(_el$159, `k2b-calendar-time-grid__badge-icon ti ti-${icon()}`));
|
|
2623
|
+
return _el$159;
|
|
2791
2624
|
})()
|
|
2792
|
-
}), _el$
|
|
2793
|
-
_$insert(_el$
|
|
2794
|
-
return _el$
|
|
2625
|
+
}), _el$156, _co$40);
|
|
2626
|
+
_$insert(_el$154, () => badge().label, _el$158, _co$41);
|
|
2627
|
+
return _el$154;
|
|
2795
2628
|
})()
|
|
2796
2629
|
})];
|
|
2797
2630
|
}
|
|
2798
2631
|
});
|
|
2799
2632
|
}
|
|
2800
|
-
}), _el$
|
|
2801
|
-
_$insert(_el$
|
|
2633
|
+
}), _el$141, _co$36);
|
|
2634
|
+
_$insert(_el$137, _$createComponent(Show, {
|
|
2802
2635
|
get when() {
|
|
2803
2636
|
return !props.owner.hideAllDay;
|
|
2804
2637
|
},
|
|
2805
2638
|
get children() {
|
|
2806
|
-
var _el$
|
|
2807
|
-
_el$
|
|
2808
|
-
_el$
|
|
2809
|
-
[_el$
|
|
2810
|
-
_$insert(_el$
|
|
2811
|
-
_$insert(_el$
|
|
2639
|
+
var _el$142 = _$getNextElement(_tmpl$37),
|
|
2640
|
+
_el$143 = _el$142.firstChild,
|
|
2641
|
+
_el$144 = _el$143.nextSibling,
|
|
2642
|
+
[_el$145, _co$37] = _$getNextMarker(_el$144.nextSibling);
|
|
2643
|
+
_$insert(_el$143, () => props.labels.allDay);
|
|
2644
|
+
_$insert(_el$142, _$createComponent(For, {
|
|
2812
2645
|
get each() {
|
|
2813
2646
|
return props.days;
|
|
2814
2647
|
},
|
|
@@ -2817,14 +2650,14 @@ const TimeGridView = props => {
|
|
|
2817
2650
|
const allDay = () => eventsByDay().get(dayKey)?.allDay ?? [];
|
|
2818
2651
|
const previewAllDay = previewEvents().filter(event => event.dayKey === dayKey && event.allDay);
|
|
2819
2652
|
return (() => {
|
|
2820
|
-
var _el$
|
|
2821
|
-
_el$
|
|
2822
|
-
_el$
|
|
2823
|
-
[_el$
|
|
2824
|
-
_el$
|
|
2825
|
-
[_el$
|
|
2826
|
-
_$setAttribute(_el$
|
|
2827
|
-
_$spread(_el$
|
|
2653
|
+
var _el$160 = _$getNextElement(_tmpl$41),
|
|
2654
|
+
_el$161 = _el$160.firstChild,
|
|
2655
|
+
_el$162 = _el$161.firstChild,
|
|
2656
|
+
[_el$163, _co$42] = _$getNextMarker(_el$162.nextSibling),
|
|
2657
|
+
_el$164 = _el$163.nextSibling,
|
|
2658
|
+
[_el$165, _co$43] = _$getNextMarker(_el$164.nextSibling);
|
|
2659
|
+
_$setAttribute(_el$160, "data-calendar-day-key", dayKey);
|
|
2660
|
+
_$spread(_el$160, _$mergeProps({
|
|
2828
2661
|
get ["data-drop-preview"]() {
|
|
2829
2662
|
return timePreview()?.allDay && calendar.formatDateKey(timePreview().start, dateConfig()) === dayKey ? "true" : undefined;
|
|
2830
2663
|
},
|
|
@@ -2839,15 +2672,15 @@ const TimeGridView = props => {
|
|
|
2839
2672
|
allDay: true
|
|
2840
2673
|
};
|
|
2841
2674
|
}, () => performance.now() < suppressSlotClickUntil)), false, true);
|
|
2842
|
-
_$insert(_el$
|
|
2675
|
+
_$insert(_el$161, _$createComponent(For, {
|
|
2843
2676
|
each: previewAllDay,
|
|
2844
2677
|
children: event => (() => {
|
|
2845
|
-
var _el$
|
|
2846
|
-
_$insert(_el$
|
|
2847
|
-
return _el$
|
|
2678
|
+
var _el$166 = _$getNextElement(_tmpl$16);
|
|
2679
|
+
_$insert(_el$166, () => event.title);
|
|
2680
|
+
return _el$166;
|
|
2848
2681
|
})()
|
|
2849
|
-
}), _el$
|
|
2850
|
-
_$insert(_el$
|
|
2682
|
+
}), _el$163, _co$42);
|
|
2683
|
+
_$insert(_el$161, _$createComponent(For, {
|
|
2851
2684
|
get each() {
|
|
2852
2685
|
return allDay();
|
|
2853
2686
|
},
|
|
@@ -2867,49 +2700,49 @@ const TimeGridView = props => {
|
|
|
2867
2700
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startAllDayMove(pointerEvent, event, markDragged) : undefined;
|
|
2868
2701
|
}
|
|
2869
2702
|
})
|
|
2870
|
-
}), _el$
|
|
2703
|
+
}), _el$165, _co$43);
|
|
2871
2704
|
_$runHydrationEvents();
|
|
2872
|
-
return _el$
|
|
2705
|
+
return _el$160;
|
|
2873
2706
|
})();
|
|
2874
2707
|
}
|
|
2875
|
-
}), _el$
|
|
2708
|
+
}), _el$145, _co$37);
|
|
2876
2709
|
_$effect(_p$ => {
|
|
2877
|
-
var _v$
|
|
2878
|
-
_v$
|
|
2879
|
-
_v$
|
|
2880
|
-
_v$
|
|
2710
|
+
var _v$24 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
2711
|
+
_v$25 = `${props.owner.allDayMaxHeightRem ?? 7}rem`;
|
|
2712
|
+
_v$24 !== _p$.e && _$setStyleProperty(_el$142, "grid-template-columns", _p$.e = _v$24);
|
|
2713
|
+
_v$25 !== _p$.t && _$setStyleProperty(_el$142, "max-height", _p$.t = _v$25);
|
|
2881
2714
|
return _p$;
|
|
2882
2715
|
}, {
|
|
2883
2716
|
e: undefined,
|
|
2884
2717
|
t: undefined
|
|
2885
2718
|
});
|
|
2886
|
-
return _el$
|
|
2719
|
+
return _el$142;
|
|
2887
2720
|
}
|
|
2888
|
-
}), _el$
|
|
2721
|
+
}), _el$152, _co$39);
|
|
2889
2722
|
var _ref$2 = scrollContainer;
|
|
2890
|
-
typeof _ref$2 === "function" ? _$use(_ref$2, _el$
|
|
2723
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$146) : scrollContainer = _el$146;
|
|
2891
2724
|
var _ref$3 = timeGrid;
|
|
2892
|
-
typeof _ref$3 === "function" ? _$use(_ref$3, _el$
|
|
2725
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$147) : timeGrid = _el$147;
|
|
2893
2726
|
var _ref$4 = timeGutter;
|
|
2894
|
-
typeof _ref$4 === "function" ? _$use(_ref$4, _el$
|
|
2895
|
-
_$insert(_el$
|
|
2727
|
+
typeof _ref$4 === "function" ? _$use(_ref$4, _el$148) : timeGutter = _el$148;
|
|
2728
|
+
_$insert(_el$148, _$createComponent(For, {
|
|
2896
2729
|
get each() {
|
|
2897
2730
|
return hours();
|
|
2898
2731
|
},
|
|
2899
2732
|
children: hour => (() => {
|
|
2900
|
-
var _el$
|
|
2901
|
-
_el$
|
|
2902
|
-
[_el$
|
|
2903
|
-
_el$
|
|
2733
|
+
var _el$167 = _$getNextElement(_tmpl$42),
|
|
2734
|
+
_el$169 = _el$167.firstChild,
|
|
2735
|
+
[_el$170, _co$44] = _$getNextMarker(_el$169.nextSibling),
|
|
2736
|
+
_el$168 = _el$170.nextSibling;
|
|
2904
2737
|
_$use(element => {
|
|
2905
2738
|
if (hour === businessStartHour()) defaultHourMarker = element;
|
|
2906
|
-
}, _el$
|
|
2907
|
-
_$insert(_el$
|
|
2908
|
-
_$effect(() => _$setAttribute(_el$
|
|
2909
|
-
return _el$
|
|
2739
|
+
}, _el$167);
|
|
2740
|
+
_$insert(_el$167, () => `${hour}`.padStart(2, "0"), _el$170, _co$44);
|
|
2741
|
+
_$effect(() => _$setAttribute(_el$167, "data-outside-business", hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined));
|
|
2742
|
+
return _el$167;
|
|
2910
2743
|
})()
|
|
2911
2744
|
}));
|
|
2912
|
-
_$insert(_el$
|
|
2745
|
+
_$insert(_el$147, _$createComponent(For, {
|
|
2913
2746
|
get each() {
|
|
2914
2747
|
return props.days;
|
|
2915
2748
|
},
|
|
@@ -2917,34 +2750,34 @@ const TimeGridView = props => {
|
|
|
2917
2750
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
2918
2751
|
const layouts = createMemo(() => timedEventLayouts(eventsByDay().get(dayKey)?.timed ?? []));
|
|
2919
2752
|
return (() => {
|
|
2920
|
-
var _el$
|
|
2921
|
-
_el$
|
|
2922
|
-
[_el$
|
|
2923
|
-
_el$
|
|
2924
|
-
[_el$
|
|
2925
|
-
_el$
|
|
2926
|
-
[_el$
|
|
2927
|
-
_el$
|
|
2928
|
-
[_el$
|
|
2929
|
-
_el$
|
|
2930
|
-
[_el$
|
|
2931
|
-
_$insert(_el$
|
|
2753
|
+
var _el$171 = _$getNextElement(_tmpl$44),
|
|
2754
|
+
_el$173 = _el$171.firstChild,
|
|
2755
|
+
[_el$174, _co$45] = _$getNextMarker(_el$173.nextSibling),
|
|
2756
|
+
_el$175 = _el$174.nextSibling,
|
|
2757
|
+
[_el$176, _co$46] = _$getNextMarker(_el$175.nextSibling),
|
|
2758
|
+
_el$177 = _el$176.nextSibling,
|
|
2759
|
+
[_el$178, _co$47] = _$getNextMarker(_el$177.nextSibling),
|
|
2760
|
+
_el$179 = _el$178.nextSibling,
|
|
2761
|
+
[_el$180, _co$48] = _$getNextMarker(_el$179.nextSibling),
|
|
2762
|
+
_el$181 = _el$180.nextSibling,
|
|
2763
|
+
[_el$182, _co$49] = _$getNextMarker(_el$181.nextSibling);
|
|
2764
|
+
_$insert(_el$171, _$createComponent(Show, {
|
|
2932
2765
|
get when() {
|
|
2933
2766
|
return currentTimeLine(day) !== null;
|
|
2934
2767
|
},
|
|
2935
2768
|
get children() {
|
|
2936
|
-
var _el$
|
|
2937
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
2938
|
-
return _el$
|
|
2769
|
+
var _el$172 = _$getNextElement(_tmpl$43);
|
|
2770
|
+
_$effect(_$p => _$setStyleProperty(_el$172, "top", `${currentTimeLine(day) ?? 0}%`));
|
|
2771
|
+
return _el$172;
|
|
2939
2772
|
}
|
|
2940
|
-
}), _el$
|
|
2941
|
-
_$insert(_el$
|
|
2773
|
+
}), _el$174, _co$45);
|
|
2774
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
2942
2775
|
get each() {
|
|
2943
2776
|
return hours();
|
|
2944
2777
|
},
|
|
2945
2778
|
children: hour => (() => {
|
|
2946
|
-
var _el$
|
|
2947
|
-
_$spread(_el$
|
|
2779
|
+
var _el$183 = _$getNextElement(_tmpl$45);
|
|
2780
|
+
_$spread(_el$183, _$mergeProps({
|
|
2948
2781
|
get ["data-outside-business"]() {
|
|
2949
2782
|
return hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined;
|
|
2950
2783
|
},
|
|
@@ -2962,10 +2795,10 @@ const TimeGridView = props => {
|
|
|
2962
2795
|
"onPointerDown": startRange
|
|
2963
2796
|
}), false, false);
|
|
2964
2797
|
_$runHydrationEvents();
|
|
2965
|
-
return _el$
|
|
2798
|
+
return _el$183;
|
|
2966
2799
|
})()
|
|
2967
|
-
}), _el$
|
|
2968
|
-
_$insert(_el$
|
|
2800
|
+
}), _el$176, _co$46);
|
|
2801
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
2969
2802
|
get each() {
|
|
2970
2803
|
return previewEvents().filter(event => event.dayKey === dayKey && !event.allDay);
|
|
2971
2804
|
},
|
|
@@ -2973,44 +2806,44 @@ const TimeGridView = props => {
|
|
|
2973
2806
|
const layout = eventLayout(event);
|
|
2974
2807
|
const short = event.endDate.getTime() - event.startDate.getTime() < 60 * 60_000;
|
|
2975
2808
|
return (() => {
|
|
2976
|
-
var _el$
|
|
2977
|
-
_el$
|
|
2978
|
-
_el$
|
|
2979
|
-
[_el$
|
|
2980
|
-
_el$
|
|
2981
|
-
_el$
|
|
2982
|
-
[_el$
|
|
2983
|
-
_el$
|
|
2984
|
-
_el$
|
|
2985
|
-
[_el$
|
|
2986
|
-
_$setAttribute(_el$
|
|
2987
|
-
_$insert(_el$
|
|
2809
|
+
var _el$184 = _$getNextElement(_tmpl$47),
|
|
2810
|
+
_el$185 = _el$184.firstChild,
|
|
2811
|
+
_el$193 = _el$185.firstChild,
|
|
2812
|
+
[_el$194, _co$52] = _$getNextMarker(_el$193.nextSibling),
|
|
2813
|
+
_el$187 = _el$194.nextSibling,
|
|
2814
|
+
_el$189 = _el$187.firstChild,
|
|
2815
|
+
[_el$190, _co$50] = _$getNextMarker(_el$189.nextSibling),
|
|
2816
|
+
_el$188 = _el$190.nextSibling,
|
|
2817
|
+
_el$191 = _el$188.nextSibling,
|
|
2818
|
+
[_el$192, _co$51] = _$getNextMarker(_el$191.nextSibling);
|
|
2819
|
+
_$setAttribute(_el$184, "data-short", short ? "true" : undefined);
|
|
2820
|
+
_$insert(_el$185, _$createComponent(Show, {
|
|
2988
2821
|
get when() {
|
|
2989
2822
|
return event.title;
|
|
2990
2823
|
},
|
|
2991
2824
|
get children() {
|
|
2992
|
-
var _el$
|
|
2993
|
-
_$insert(_el$
|
|
2994
|
-
return _el$
|
|
2825
|
+
var _el$186 = _$getNextElement(_tmpl$46);
|
|
2826
|
+
_$insert(_el$186, () => event.title);
|
|
2827
|
+
return _el$186;
|
|
2995
2828
|
}
|
|
2996
|
-
}), _el$
|
|
2997
|
-
_$insert(_el$
|
|
2998
|
-
_$insert(_el$
|
|
2829
|
+
}), _el$194, _co$52);
|
|
2830
|
+
_$insert(_el$187, () => formatTime(event.startDate, dateConfig()), _el$190, _co$50);
|
|
2831
|
+
_$insert(_el$187, () => formatTime(event.endDate, dateConfig()), _el$192, _co$51);
|
|
2999
2832
|
_$effect(_p$ => {
|
|
3000
|
-
var _v$
|
|
3001
|
-
_v$
|
|
3002
|
-
_v$
|
|
3003
|
-
_v$
|
|
2833
|
+
var _v$32 = `${layout.top}%`,
|
|
2834
|
+
_v$33 = `${layout.height}%`;
|
|
2835
|
+
_v$32 !== _p$.e && _$setStyleProperty(_el$184, "top", _p$.e = _v$32);
|
|
2836
|
+
_v$33 !== _p$.t && _$setStyleProperty(_el$184, "height", _p$.t = _v$33);
|
|
3004
2837
|
return _p$;
|
|
3005
2838
|
}, {
|
|
3006
2839
|
e: undefined,
|
|
3007
2840
|
t: undefined
|
|
3008
2841
|
});
|
|
3009
|
-
return _el$
|
|
2842
|
+
return _el$184;
|
|
3010
2843
|
})();
|
|
3011
2844
|
}
|
|
3012
|
-
}), _el$
|
|
3013
|
-
_$insert(_el$
|
|
2845
|
+
}), _el$178, _co$47);
|
|
2846
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
3014
2847
|
get each() {
|
|
3015
2848
|
return layouts();
|
|
3016
2849
|
},
|
|
@@ -3053,13 +2886,13 @@ const TimeGridView = props => {
|
|
|
3053
2886
|
});
|
|
3054
2887
|
};
|
|
3055
2888
|
return (() => {
|
|
3056
|
-
var _el$
|
|
3057
|
-
_el$
|
|
3058
|
-
_el$
|
|
3059
|
-
[_el$
|
|
3060
|
-
_el$
|
|
3061
|
-
[_el$
|
|
3062
|
-
_$insert(_el$
|
|
2889
|
+
var _el$195 = _$getNextElement(_tmpl$49),
|
|
2890
|
+
_el$196 = _el$195.firstChild,
|
|
2891
|
+
_el$198 = _el$196.firstChild,
|
|
2892
|
+
[_el$199, _co$53] = _$getNextMarker(_el$198.nextSibling),
|
|
2893
|
+
_el$200 = _el$199.nextSibling,
|
|
2894
|
+
[_el$201, _co$54] = _$getNextMarker(_el$200.nextSibling);
|
|
2895
|
+
_$insert(_el$196, _$createComponent(EventChip, {
|
|
3063
2896
|
event: event,
|
|
3064
2897
|
get owner() {
|
|
3065
2898
|
return props.owner;
|
|
@@ -3074,32 +2907,32 @@ const TimeGridView = props => {
|
|
|
3074
2907
|
get onMovePointerDown() {
|
|
3075
2908
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startTimedMove(pointerEvent, event, markDragged) : undefined;
|
|
3076
2909
|
}
|
|
3077
|
-
}), _el$
|
|
3078
|
-
_$insert(_el$
|
|
2910
|
+
}), _el$199, _co$53);
|
|
2911
|
+
_$insert(_el$196, _$createComponent(Show, {
|
|
3079
2912
|
get when() {
|
|
3080
2913
|
return props.owner.onEventResize;
|
|
3081
2914
|
},
|
|
3082
2915
|
get children() {
|
|
3083
|
-
var _el$
|
|
3084
|
-
_el$
|
|
3085
|
-
_el$
|
|
3086
|
-
_$setAttribute(_el$
|
|
3087
|
-
_$effect(() => _$setAttribute(_el$
|
|
2916
|
+
var _el$197 = _$getNextElement(_tmpl$48);
|
|
2917
|
+
_el$197.addEventListener("dragstart", event => event.preventDefault());
|
|
2918
|
+
_el$197.$$pointerdown = resizeStart;
|
|
2919
|
+
_$setAttribute(_el$197, "draggable", false);
|
|
2920
|
+
_$effect(() => _$setAttribute(_el$197, "aria-label", calendarMessages().resizeEvent));
|
|
3088
2921
|
_$runHydrationEvents();
|
|
3089
|
-
return _el$
|
|
2922
|
+
return _el$197;
|
|
3090
2923
|
}
|
|
3091
|
-
}), _el$
|
|
2924
|
+
}), _el$201, _co$54);
|
|
3092
2925
|
_$effect(_p$ => {
|
|
3093
|
-
var _v$
|
|
3094
|
-
_v$
|
|
3095
|
-
_v$
|
|
3096
|
-
_v$
|
|
3097
|
-
_v$
|
|
3098
|
-
_v$
|
|
3099
|
-
_v$
|
|
3100
|
-
_v$
|
|
3101
|
-
_v$
|
|
3102
|
-
_v$
|
|
2926
|
+
var _v$34 = `${layout.top}%`,
|
|
2927
|
+
_v$35 = `${layout.height}%`,
|
|
2928
|
+
_v$36 = position.left,
|
|
2929
|
+
_v$37 = position.width,
|
|
2930
|
+
_v$38 = String(20 + layoutItem.lane);
|
|
2931
|
+
_v$34 !== _p$.e && _$setStyleProperty(_el$195, "top", _p$.e = _v$34);
|
|
2932
|
+
_v$35 !== _p$.t && _$setStyleProperty(_el$195, "height", _p$.t = _v$35);
|
|
2933
|
+
_v$36 !== _p$.a && _$setStyleProperty(_el$195, "left", _p$.a = _v$36);
|
|
2934
|
+
_v$37 !== _p$.o && _$setStyleProperty(_el$195, "width", _p$.o = _v$37);
|
|
2935
|
+
_v$38 !== _p$.i && _$setStyleProperty(_el$195, "z-index", _p$.i = _v$38);
|
|
3103
2936
|
return _p$;
|
|
3104
2937
|
}, {
|
|
3105
2938
|
e: undefined,
|
|
@@ -3108,11 +2941,11 @@ const TimeGridView = props => {
|
|
|
3108
2941
|
o: undefined,
|
|
3109
2942
|
i: undefined
|
|
3110
2943
|
});
|
|
3111
|
-
return _el$
|
|
2944
|
+
return _el$195;
|
|
3112
2945
|
})();
|
|
3113
2946
|
}
|
|
3114
|
-
}), _el$
|
|
3115
|
-
_$insert(_el$
|
|
2947
|
+
}), _el$180, _co$48);
|
|
2948
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
3116
2949
|
get each() {
|
|
3117
2950
|
return overflowLayouts(layouts());
|
|
3118
2951
|
},
|
|
@@ -3121,27 +2954,27 @@ const TimeGridView = props => {
|
|
|
3121
2954
|
const key = `${dayKey}-${overflow.groupId}`;
|
|
3122
2955
|
const hiddenTitle = () => overflow.hiddenEvents.map(event => `${formatTime(event.startDate, dateConfig())} ${event.title}`).join("\n");
|
|
3123
2956
|
return [(() => {
|
|
3124
|
-
var _el$
|
|
3125
|
-
_el$
|
|
3126
|
-
_el$
|
|
3127
|
-
_el$
|
|
3128
|
-
[_el$
|
|
3129
|
-
_el$
|
|
2957
|
+
var _el$202 = _$getNextElement(_tmpl$50),
|
|
2958
|
+
_el$203 = _el$202.firstChild,
|
|
2959
|
+
_el$204 = _el$203.firstChild,
|
|
2960
|
+
_el$205 = _el$204.nextSibling,
|
|
2961
|
+
[_el$206, _co$55] = _$getNextMarker(_el$205.nextSibling);
|
|
2962
|
+
_el$202.$$click = event => {
|
|
3130
2963
|
event.stopPropagation();
|
|
3131
2964
|
setExpandedOverflow(expandedOverflow() === key ? "" : key);
|
|
3132
2965
|
};
|
|
3133
|
-
_$insert(_el$
|
|
2966
|
+
_$insert(_el$203, () => overflow.hiddenEvents.length, _el$206, _co$55);
|
|
3134
2967
|
_$effect(_p$ => {
|
|
3135
|
-
var _v$
|
|
3136
|
-
_v$
|
|
3137
|
-
_v$
|
|
3138
|
-
_v$
|
|
2968
|
+
var _v$39 = `${layout.top}%`,
|
|
2969
|
+
_v$40 = `${layout.height}%`,
|
|
2970
|
+
_v$41 = hiddenTitle(),
|
|
2971
|
+
_v$42 = calendarMessages().hiddenOverlappingEvents({
|
|
3139
2972
|
count: overflow.hiddenEvents.length
|
|
3140
2973
|
});
|
|
3141
|
-
_v$
|
|
3142
|
-
_v$
|
|
3143
|
-
_v$
|
|
3144
|
-
_v$
|
|
2974
|
+
_v$39 !== _p$.e && _$setStyleProperty(_el$202, "top", _p$.e = _v$39);
|
|
2975
|
+
_v$40 !== _p$.t && _$setStyleProperty(_el$202, "height", _p$.t = _v$40);
|
|
2976
|
+
_v$41 !== _p$.a && _$setAttribute(_el$202, "title", _p$.a = _v$41);
|
|
2977
|
+
_v$42 !== _p$.o && _$setAttribute(_el$202, "aria-label", _p$.o = _v$42);
|
|
3145
2978
|
return _p$;
|
|
3146
2979
|
}, {
|
|
3147
2980
|
e: undefined,
|
|
@@ -3150,24 +2983,24 @@ const TimeGridView = props => {
|
|
|
3150
2983
|
o: undefined
|
|
3151
2984
|
});
|
|
3152
2985
|
_$runHydrationEvents();
|
|
3153
|
-
return _el$
|
|
2986
|
+
return _el$202;
|
|
3154
2987
|
})(), _$createComponent(Show, {
|
|
3155
2988
|
get when() {
|
|
3156
2989
|
return expandedOverflow() === key;
|
|
3157
2990
|
},
|
|
3158
2991
|
get children() {
|
|
3159
|
-
var _el$
|
|
3160
|
-
_el$
|
|
3161
|
-
_el$
|
|
3162
|
-
[_el$
|
|
3163
|
-
_el$
|
|
3164
|
-
_el$
|
|
3165
|
-
[_el$
|
|
3166
|
-
_el$
|
|
3167
|
-
[_el$
|
|
3168
|
-
_$insert(_el$
|
|
3169
|
-
_$insert(_el$
|
|
3170
|
-
_$insert(_el$
|
|
2992
|
+
var _el$207 = _$getNextElement(_tmpl$51),
|
|
2993
|
+
_el$208 = _el$207.firstChild,
|
|
2994
|
+
_el$210 = _el$208.firstChild,
|
|
2995
|
+
[_el$211, _co$56] = _$getNextMarker(_el$210.nextSibling),
|
|
2996
|
+
_el$209 = _el$211.nextSibling,
|
|
2997
|
+
_el$212 = _el$209.nextSibling,
|
|
2998
|
+
[_el$213, _co$57] = _$getNextMarker(_el$212.nextSibling),
|
|
2999
|
+
_el$214 = _el$208.nextSibling,
|
|
3000
|
+
[_el$215, _co$58] = _$getNextMarker(_el$214.nextSibling);
|
|
3001
|
+
_$insert(_el$208, () => formatTime(overflow.groupStartDate, dateConfig()), _el$211, _co$56);
|
|
3002
|
+
_$insert(_el$208, () => formatTime(overflow.groupEndDate, dateConfig()), _el$213, _co$57);
|
|
3003
|
+
_$insert(_el$207, _$createComponent(For, {
|
|
3171
3004
|
get each() {
|
|
3172
3005
|
return overflow.hiddenEvents;
|
|
3173
3006
|
},
|
|
@@ -3181,41 +3014,44 @@ const TimeGridView = props => {
|
|
|
3181
3014
|
},
|
|
3182
3015
|
compact: true
|
|
3183
3016
|
})
|
|
3184
|
-
}), _el$
|
|
3185
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
3186
|
-
return _el$
|
|
3017
|
+
}), _el$215, _co$58);
|
|
3018
|
+
_$effect(_$p => _$setStyleProperty(_el$207, "top", `${layout.top}%`));
|
|
3019
|
+
return _el$207;
|
|
3187
3020
|
}
|
|
3188
3021
|
})];
|
|
3189
3022
|
}
|
|
3190
|
-
}), _el$
|
|
3023
|
+
}), _el$182, _co$49);
|
|
3191
3024
|
_$effect(_p$ => {
|
|
3192
|
-
var _v$
|
|
3193
|
-
_v$
|
|
3194
|
-
_v$
|
|
3195
|
-
_v$
|
|
3025
|
+
var _v$30 = dayColumnMinWidth(layouts()),
|
|
3026
|
+
_v$31 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3027
|
+
_v$30 !== _p$.e && _$setStyleProperty(_el$171, "min-width", _p$.e = _v$30);
|
|
3028
|
+
_v$31 !== _p$.t && _$setStyleProperty(_el$171, "grid-template-rows", _p$.t = _v$31);
|
|
3196
3029
|
return _p$;
|
|
3197
3030
|
}, {
|
|
3198
3031
|
e: undefined,
|
|
3199
3032
|
t: undefined
|
|
3200
3033
|
});
|
|
3201
|
-
return _el$
|
|
3034
|
+
return _el$171;
|
|
3202
3035
|
})();
|
|
3203
3036
|
}
|
|
3204
|
-
}), _el$
|
|
3037
|
+
}), _el$150, _co$38);
|
|
3205
3038
|
_$effect(_p$ => {
|
|
3206
|
-
var _v$
|
|
3207
|
-
_v$
|
|
3208
|
-
_v$
|
|
3209
|
-
|
|
3210
|
-
_v$
|
|
3211
|
-
_v$
|
|
3039
|
+
var _v$26 = isDayView() ? "day" : "week",
|
|
3040
|
+
_v$27 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
3041
|
+
_v$28 = `4rem repeat(${props.days.length}, minmax(0, 1fr))`,
|
|
3042
|
+
_v$29 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3043
|
+
_v$26 !== _p$.e && _$setAttribute(_el$137, "data-view", _p$.e = _v$26);
|
|
3044
|
+
_v$27 !== _p$.t && _$setStyleProperty(_el$138, "grid-template-columns", _p$.t = _v$27);
|
|
3045
|
+
_v$28 !== _p$.a && _$setStyleProperty(_el$147, "grid-template-columns", _p$.a = _v$28);
|
|
3046
|
+
_v$29 !== _p$.o && _$setStyleProperty(_el$148, "grid-template-rows", _p$.o = _v$29);
|
|
3212
3047
|
return _p$;
|
|
3213
3048
|
}, {
|
|
3214
3049
|
e: undefined,
|
|
3215
3050
|
t: undefined,
|
|
3216
|
-
a: undefined
|
|
3051
|
+
a: undefined,
|
|
3052
|
+
o: undefined
|
|
3217
3053
|
});
|
|
3218
|
-
return _el$
|
|
3054
|
+
return _el$137;
|
|
3219
3055
|
})();
|
|
3220
3056
|
};
|
|
3221
3057
|
const YearView = props => {
|
|
@@ -3256,17 +3092,17 @@ const YearView = props => {
|
|
|
3256
3092
|
});
|
|
3257
3093
|
});
|
|
3258
3094
|
return (() => {
|
|
3259
|
-
var _el$
|
|
3260
|
-
_$insert(_el$
|
|
3095
|
+
var _el$216 = _$getNextElement(_tmpl$52);
|
|
3096
|
+
_$insert(_el$216, _$createComponent(For, {
|
|
3261
3097
|
get each() {
|
|
3262
3098
|
return months();
|
|
3263
3099
|
},
|
|
3264
3100
|
children: month => (() => {
|
|
3265
|
-
var _el$
|
|
3266
|
-
_el$
|
|
3267
|
-
_el$
|
|
3268
|
-
_$insert(_el$
|
|
3269
|
-
_$insert(_el$
|
|
3101
|
+
var _el$217 = _$getNextElement(_tmpl$53),
|
|
3102
|
+
_el$218 = _el$217.firstChild,
|
|
3103
|
+
_el$219 = _el$218.nextSibling;
|
|
3104
|
+
_$insert(_el$218, () => month.label);
|
|
3105
|
+
_$insert(_el$219, _$createComponent(For, {
|
|
3270
3106
|
get each() {
|
|
3271
3107
|
return month.days;
|
|
3272
3108
|
},
|
|
@@ -3290,32 +3126,32 @@ const YearView = props => {
|
|
|
3290
3126
|
return day.events[0];
|
|
3291
3127
|
},
|
|
3292
3128
|
children: event => (() => {
|
|
3293
|
-
var _el$
|
|
3129
|
+
var _el$220 = _$getNextElement(_tmpl$54);
|
|
3294
3130
|
_$effect(_p$ => {
|
|
3295
|
-
var _v$
|
|
3296
|
-
_v$
|
|
3297
|
-
_v$
|
|
3131
|
+
var _v$43 = event().colorHex ? undefined : event().color ?? "blue",
|
|
3132
|
+
_v$44 = day.isToday ? "true" : undefined,
|
|
3133
|
+
_v$45 = event().colorHex ? {
|
|
3298
3134
|
"background-color": day.isToday ? "white" : event().colorHex
|
|
3299
3135
|
} : undefined;
|
|
3300
|
-
_v$
|
|
3301
|
-
_v$
|
|
3302
|
-
_p$.a = _$style(_el$
|
|
3136
|
+
_v$43 !== _p$.e && _$setAttribute(_el$220, "data-color", _p$.e = _v$43);
|
|
3137
|
+
_v$44 !== _p$.t && _$setAttribute(_el$220, "data-today", _p$.t = _v$44);
|
|
3138
|
+
_p$.a = _$style(_el$220, _v$45, _p$.a);
|
|
3303
3139
|
return _p$;
|
|
3304
3140
|
}, {
|
|
3305
3141
|
e: undefined,
|
|
3306
3142
|
t: undefined,
|
|
3307
3143
|
a: undefined
|
|
3308
3144
|
});
|
|
3309
|
-
return _el$
|
|
3145
|
+
return _el$220;
|
|
3310
3146
|
})()
|
|
3311
3147
|
})];
|
|
3312
3148
|
}
|
|
3313
3149
|
})
|
|
3314
3150
|
}));
|
|
3315
|
-
return _el$
|
|
3151
|
+
return _el$217;
|
|
3316
3152
|
})()
|
|
3317
3153
|
}));
|
|
3318
|
-
return _el$
|
|
3154
|
+
return _el$216;
|
|
3319
3155
|
})();
|
|
3320
3156
|
};
|
|
3321
3157
|
const MobileMonthView = props => {
|
|
@@ -3323,14 +3159,14 @@ const MobileMonthView = props => {
|
|
|
3323
3159
|
const selectedDateKey = createMemo(() => calendar.formatDateKey(props.selectedDate, dateConfig()));
|
|
3324
3160
|
const selectedEvents = createMemo(() => props.events.filter(event => event.dayKey === selectedDateKey()));
|
|
3325
3161
|
return (() => {
|
|
3326
|
-
var _el$
|
|
3327
|
-
_el$
|
|
3328
|
-
[_el$
|
|
3329
|
-
_el$
|
|
3330
|
-
_el$
|
|
3331
|
-
_el$
|
|
3332
|
-
[_el$
|
|
3333
|
-
_$insert(_el$
|
|
3162
|
+
var _el$221 = _$getNextElement(_tmpl$56),
|
|
3163
|
+
_el$227 = _el$221.firstChild,
|
|
3164
|
+
[_el$228, _co$60] = _$getNextMarker(_el$227.nextSibling),
|
|
3165
|
+
_el$222 = _el$228.nextSibling,
|
|
3166
|
+
_el$223 = _el$222.firstChild,
|
|
3167
|
+
_el$225 = _el$223.nextSibling,
|
|
3168
|
+
[_el$226, _co$59] = _$getNextMarker(_el$225.nextSibling);
|
|
3169
|
+
_$insert(_el$221, _$createComponent(MonthPickerView, {
|
|
3334
3170
|
get owner() {
|
|
3335
3171
|
return {
|
|
3336
3172
|
...props.owner,
|
|
@@ -3350,27 +3186,27 @@ const MobileMonthView = props => {
|
|
|
3350
3186
|
return props.labels;
|
|
3351
3187
|
},
|
|
3352
3188
|
compact: true
|
|
3353
|
-
}), _el$
|
|
3354
|
-
_$insert(_el$
|
|
3189
|
+
}), _el$228, _co$60);
|
|
3190
|
+
_$insert(_el$223, () => props.selectedDate.toLocaleDateString(dateConfig().locale ?? "en", {
|
|
3355
3191
|
weekday: "long",
|
|
3356
3192
|
month: "long",
|
|
3357
3193
|
day: "numeric",
|
|
3358
3194
|
timeZone: dateConfig().timeZone
|
|
3359
3195
|
}));
|
|
3360
|
-
_$insert(_el$
|
|
3196
|
+
_$insert(_el$222, _$createComponent(Show, {
|
|
3361
3197
|
get when() {
|
|
3362
3198
|
return selectedEvents().length > 0;
|
|
3363
3199
|
},
|
|
3364
3200
|
get fallback() {
|
|
3365
3201
|
return (() => {
|
|
3366
|
-
var _el$
|
|
3367
|
-
_$insert(_el$
|
|
3368
|
-
return _el$
|
|
3202
|
+
var _el$229 = _$getNextElement(_tmpl$57);
|
|
3203
|
+
_$insert(_el$229, () => props.labels.noEvents);
|
|
3204
|
+
return _el$229;
|
|
3369
3205
|
})();
|
|
3370
3206
|
},
|
|
3371
3207
|
get children() {
|
|
3372
|
-
var _el$
|
|
3373
|
-
_$insert(_el$
|
|
3208
|
+
var _el$224 = _$getNextElement(_tmpl$55);
|
|
3209
|
+
_$insert(_el$224, _$createComponent(For, {
|
|
3374
3210
|
get each() {
|
|
3375
3211
|
return selectedEvents();
|
|
3376
3212
|
},
|
|
@@ -3384,16 +3220,16 @@ const MobileMonthView = props => {
|
|
|
3384
3220
|
}
|
|
3385
3221
|
})
|
|
3386
3222
|
}));
|
|
3387
|
-
return _el$
|
|
3223
|
+
return _el$224;
|
|
3388
3224
|
}
|
|
3389
|
-
}), _el$
|
|
3390
|
-
return _el$
|
|
3225
|
+
}), _el$226, _co$59);
|
|
3226
|
+
return _el$221;
|
|
3391
3227
|
})();
|
|
3392
3228
|
};
|
|
3393
3229
|
const CalendarBody = props => (() => {
|
|
3394
|
-
var _el$
|
|
3395
|
-
_$insert(_el$
|
|
3396
|
-
return _el$
|
|
3230
|
+
var _el$230 = _$getNextElement(_tmpl$58);
|
|
3231
|
+
_$insert(_el$230, () => props.children);
|
|
3232
|
+
return _el$230;
|
|
3397
3233
|
})();
|
|
3398
3234
|
const CalendarRoot = props => {
|
|
3399
3235
|
const messages = useUiMessages();
|
|
@@ -3444,13 +3280,189 @@ const CalendarRoot = props => {
|
|
|
3444
3280
|
document.removeEventListener("visibilitychange", updateNow);
|
|
3445
3281
|
});
|
|
3446
3282
|
});
|
|
3283
|
+
|
|
3284
|
+
// The day and week views with `dayHours` scroll through their days; the header and the commands ask them first.
|
|
3285
|
+
const [timeView, setTimeView] = createSignal(null);
|
|
3286
|
+
const [monthCreate, setMonthCreate] = createSignal(null);
|
|
3287
|
+
const timeMode = () => Boolean(props.dayHours) && (view() === "day" || view() === "week");
|
|
3288
|
+
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
3289
|
+
/** The first shown day of a day or week view, or the selected day of the month view, for the other views. */
|
|
3290
|
+
const shownDay = () => {
|
|
3291
|
+
const first = timeView()?.visibleKeys().first;
|
|
3292
|
+
if (first) return parseKey(first);
|
|
3293
|
+
return view() === "month" ? focusDay() : null;
|
|
3294
|
+
};
|
|
3295
|
+
const go = (target, nextView) => {
|
|
3296
|
+
const href = props.getDateHref?.(target, nextView);
|
|
3297
|
+
if (href) followCalendarHref(owner, href);else openViewAt(props, target, nextView);
|
|
3298
|
+
};
|
|
3299
|
+
const step = direction => {
|
|
3300
|
+
if (timeView()?.step(direction)) return;
|
|
3301
|
+
go(adjacentCalendarDate(shownDay() ?? date(), view(), direction, dateConfig()), view());
|
|
3302
|
+
};
|
|
3303
|
+
const goToday = () => {
|
|
3304
|
+
if (timeView()?.today()) return;
|
|
3305
|
+
go(calendar.today(dateConfig()), view());
|
|
3306
|
+
};
|
|
3307
|
+
const goView = nextView => {
|
|
3308
|
+
const day = shownDay();
|
|
3309
|
+
if (day) {
|
|
3310
|
+
go(day, nextView);
|
|
3311
|
+
return;
|
|
3312
|
+
}
|
|
3313
|
+
const href = props.getViewHref?.(nextView);
|
|
3314
|
+
if (href) followCalendarHref(owner, href);else props.onViewChange?.(nextView);
|
|
3315
|
+
};
|
|
3316
|
+
const goToKey = key => {
|
|
3317
|
+
if (timeView()?.goTo(key)) return;
|
|
3318
|
+
go(parseKey(key), view());
|
|
3319
|
+
};
|
|
3320
|
+
const openGoTo = () => void openCalendarGoTo({
|
|
3321
|
+
messages: calendarMessages(),
|
|
3322
|
+
today: calendar.formatDateKey(new Date(), dateConfig()),
|
|
3323
|
+
describe: key => parseKey(key).toLocaleDateString(dateConfig().locale ?? "en", {
|
|
3324
|
+
weekday: "long",
|
|
3325
|
+
day: "numeric",
|
|
3326
|
+
month: "long",
|
|
3327
|
+
year: "numeric",
|
|
3328
|
+
timeZone: dateConfig().timeZone
|
|
3329
|
+
}),
|
|
3330
|
+
onGo: goToKey
|
|
3331
|
+
});
|
|
3332
|
+
const ownCommands = createMemo(() => {
|
|
3333
|
+
const text = calendarMessages();
|
|
3334
|
+
const available = ["day", "week", "month", "year"].filter(option => !props.views || props.views.includes(option));
|
|
3335
|
+
const viewLabels = {
|
|
3336
|
+
day: mergedLabels().day,
|
|
3337
|
+
week: mergedLabels().week,
|
|
3338
|
+
month: mergedLabels().month,
|
|
3339
|
+
year: mergedLabels().year
|
|
3340
|
+
};
|
|
3341
|
+
return [{
|
|
3342
|
+
id: "calendar.today",
|
|
3343
|
+
label: text.calendarCommandToday,
|
|
3344
|
+
description: text.calendarCommandTodayDescription,
|
|
3345
|
+
shortcut: "h",
|
|
3346
|
+
icon: "ti ti-calendar-event",
|
|
3347
|
+
run: goToday
|
|
3348
|
+
}, {
|
|
3349
|
+
id: "calendar.next",
|
|
3350
|
+
label: text.calendarCommandNext,
|
|
3351
|
+
description: text.calendarCommandNextDescription,
|
|
3352
|
+
shortcut: "j",
|
|
3353
|
+
icon: "ti ti-chevron-right",
|
|
3354
|
+
run: () => step(1)
|
|
3355
|
+
}, {
|
|
3356
|
+
id: "calendar.previous",
|
|
3357
|
+
label: text.calendarCommandPrevious,
|
|
3358
|
+
description: text.calendarCommandPreviousDescription,
|
|
3359
|
+
shortcut: "k",
|
|
3360
|
+
icon: "ti ti-chevron-left",
|
|
3361
|
+
run: () => step(-1)
|
|
3362
|
+
}, ...available.map((option, index) => ({
|
|
3363
|
+
id: `calendar.view.${option}`,
|
|
3364
|
+
label: text.calendarCommandView({
|
|
3365
|
+
view: viewLabels[option]
|
|
3366
|
+
}),
|
|
3367
|
+
description: text.calendarCommandViewDescription({
|
|
3368
|
+
view: viewLabels[option]
|
|
3369
|
+
}),
|
|
3370
|
+
shortcut: String(index + 1),
|
|
3371
|
+
icon: "ti ti-layout-columns",
|
|
3372
|
+
run: () => goView(option)
|
|
3373
|
+
})), {
|
|
3374
|
+
id: "calendar.goto",
|
|
3375
|
+
label: text.calendarCommandGoTo,
|
|
3376
|
+
description: text.calendarCommandGoToDescription,
|
|
3377
|
+
shortcut: "g",
|
|
3378
|
+
icon: "ti ti-calendar-search",
|
|
3379
|
+
run: openGoTo
|
|
3380
|
+
}];
|
|
3381
|
+
});
|
|
3382
|
+
const allCommands = createMemo(() => [...ownCommands(), ...(props.commands ?? [])]);
|
|
3383
|
+
/** While the month's quiet quick create waits for typing, a single key is the first letter of a title. */
|
|
3384
|
+
const typing = () => view() === "month" && (monthCreate()?.typing() ?? false);
|
|
3385
|
+
createEffect(() => {
|
|
3386
|
+
const commands = typing() ? allCommands().map(command => command.shortcut && singleKey(command.shortcut) ? {
|
|
3387
|
+
...command,
|
|
3388
|
+
shortcut: undefined
|
|
3389
|
+
} : command) : allCommands();
|
|
3390
|
+
untrack(() => props.onCommandsChange?.(commands));
|
|
3391
|
+
});
|
|
3392
|
+
// The arrow keys page like J and K while the keyboard is in the calendar or nowhere, unless something there uses
|
|
3393
|
+
// them, such as the grid of the week or the month.
|
|
3394
|
+
let root;
|
|
3395
|
+
onMount(() => {
|
|
3396
|
+
const onKeyDown = event => {
|
|
3397
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
3398
|
+
if (event.defaultPrevented || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
3399
|
+
if (!props.onCommandsChange || custom() || document.querySelector('dialog[open], [role="dialog"][aria-modal="true"]')) return;
|
|
3400
|
+
const target = event.target;
|
|
3401
|
+
const inCalendar = target instanceof Element && Boolean(root?.contains(target));
|
|
3402
|
+
if (!inCalendar && target !== document.body && target !== document.documentElement) return;
|
|
3403
|
+
if (target instanceof Element && target.closest("input, textarea, select, [contenteditable]:not([contenteditable=false]), [role=textbox], [popover], [role=dialog]")) return;
|
|
3404
|
+
event.preventDefault();
|
|
3405
|
+
step(event.key === "ArrowRight" ? 1 : -1);
|
|
3406
|
+
};
|
|
3407
|
+
window.addEventListener("keydown", onKeyDown);
|
|
3408
|
+
onCleanup(() => window.removeEventListener("keydown", onKeyDown));
|
|
3409
|
+
});
|
|
3410
|
+
const headerNav = {
|
|
3411
|
+
timeView,
|
|
3412
|
+
commands: () => props.onCommandsChange ? allCommands() : [],
|
|
3413
|
+
// The arrow keys page like J and K, so the list names them beside those keys.
|
|
3414
|
+
openShortcuts: () => void openCalendarShortcuts(allCommands(), calendarMessages(), custom() ? {} : {
|
|
3415
|
+
"calendar.next": "arrowright",
|
|
3416
|
+
"calendar.previous": "arrowleft"
|
|
3417
|
+
})
|
|
3418
|
+
};
|
|
3419
|
+
const controller = {
|
|
3420
|
+
quickCreate: create => {
|
|
3421
|
+
const active = timeView();
|
|
3422
|
+
if (active) active.controller.quickCreate(create);else monthCreate()?.quickCreate(create);
|
|
3423
|
+
},
|
|
3424
|
+
createTarget: () => {
|
|
3425
|
+
const active = timeView()?.controller.createTarget() ?? monthCreate()?.createTarget();
|
|
3426
|
+
if (active) return active;
|
|
3427
|
+
const start = calendar.today(dateConfig());
|
|
3428
|
+
return {
|
|
3429
|
+
start,
|
|
3430
|
+
end: calendar.addDays(start, 1, dateConfig()),
|
|
3431
|
+
allDay: true
|
|
3432
|
+
};
|
|
3433
|
+
},
|
|
3434
|
+
dragIn: (event, item, onDrop) => timeView()?.controller.dragIn(event, item, onDrop)
|
|
3435
|
+
};
|
|
3436
|
+
onMount(() => props.controller?.(controller));
|
|
3437
|
+
const timeProps = timeViewName => ({
|
|
3438
|
+
owner,
|
|
3439
|
+
view: timeViewName,
|
|
3440
|
+
get date() {
|
|
3441
|
+
return date();
|
|
3442
|
+
},
|
|
3443
|
+
get now() {
|
|
3444
|
+
return now();
|
|
3445
|
+
},
|
|
3446
|
+
get events() {
|
|
3447
|
+
return props.events;
|
|
3448
|
+
},
|
|
3449
|
+
get labels() {
|
|
3450
|
+
return mergedLabels();
|
|
3451
|
+
},
|
|
3452
|
+
get hours() {
|
|
3453
|
+
return props.dayHours ?? [0, 24];
|
|
3454
|
+
},
|
|
3455
|
+
register: setTimeView
|
|
3456
|
+
});
|
|
3447
3457
|
return (() => {
|
|
3448
|
-
var _el$
|
|
3449
|
-
_el$
|
|
3450
|
-
[_el$
|
|
3451
|
-
_el$
|
|
3452
|
-
[_el$
|
|
3453
|
-
|
|
3458
|
+
var _el$231 = _$getNextElement(_tmpl$59),
|
|
3459
|
+
_el$232 = _el$231.firstChild,
|
|
3460
|
+
[_el$233, _co$61] = _$getNextMarker(_el$232.nextSibling),
|
|
3461
|
+
_el$234 = _el$233.nextSibling,
|
|
3462
|
+
[_el$235, _co$62] = _$getNextMarker(_el$234.nextSibling);
|
|
3463
|
+
var _ref$5 = root;
|
|
3464
|
+
typeof _ref$5 === "function" ? _$use(_ref$5, _el$231) : root = _el$231;
|
|
3465
|
+
_$insert(_el$231, _$createComponent(CalendarHeader, {
|
|
3454
3466
|
get date() {
|
|
3455
3467
|
return date();
|
|
3456
3468
|
},
|
|
@@ -3462,10 +3474,11 @@ const CalendarRoot = props => {
|
|
|
3462
3474
|
},
|
|
3463
3475
|
owner: owner,
|
|
3464
3476
|
get focusDay() {
|
|
3465
|
-
return _$memo(() => view() === "month")() ? focusDay() : null;
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
|
-
|
|
3477
|
+
return _$memo(() => view() === "month")() ? focusDay() : _$memo(() => !!timeView())() ? shownDay() : null;
|
|
3478
|
+
},
|
|
3479
|
+
nav: headerNav
|
|
3480
|
+
}), _el$233, _co$61);
|
|
3481
|
+
_$insert(_el$231, _$createComponent(Show, {
|
|
3469
3482
|
get when() {
|
|
3470
3483
|
return !custom();
|
|
3471
3484
|
},
|
|
@@ -3498,7 +3511,8 @@ const CalendarRoot = props => {
|
|
|
3498
3511
|
get labels() {
|
|
3499
3512
|
return mergedLabels();
|
|
3500
3513
|
},
|
|
3501
|
-
onFocusDay: setFocusDay
|
|
3514
|
+
onFocusDay: setFocusDay,
|
|
3515
|
+
register: setMonthCreate
|
|
3502
3516
|
});
|
|
3503
3517
|
}
|
|
3504
3518
|
});
|
|
@@ -3556,22 +3570,42 @@ const CalendarRoot = props => {
|
|
|
3556
3570
|
});
|
|
3557
3571
|
},
|
|
3558
3572
|
get children() {
|
|
3559
|
-
return _$createComponent(
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
return date();
|
|
3563
|
-
},
|
|
3564
|
-
get now() {
|
|
3565
|
-
return now();
|
|
3566
|
-
},
|
|
3567
|
-
get events() {
|
|
3568
|
-
return normalizedEvents();
|
|
3573
|
+
return _$createComponent(Show, {
|
|
3574
|
+
get when() {
|
|
3575
|
+
return timeMode();
|
|
3569
3576
|
},
|
|
3570
|
-
get
|
|
3571
|
-
return
|
|
3577
|
+
get fallback() {
|
|
3578
|
+
return _$createComponent(TimeGridView, {
|
|
3579
|
+
owner: owner,
|
|
3580
|
+
get date() {
|
|
3581
|
+
return date();
|
|
3582
|
+
},
|
|
3583
|
+
get now() {
|
|
3584
|
+
return now();
|
|
3585
|
+
},
|
|
3586
|
+
get events() {
|
|
3587
|
+
return normalizedEvents();
|
|
3588
|
+
},
|
|
3589
|
+
get labels() {
|
|
3590
|
+
return mergedLabels();
|
|
3591
|
+
},
|
|
3592
|
+
get days() {
|
|
3593
|
+
return days();
|
|
3594
|
+
}
|
|
3595
|
+
});
|
|
3572
3596
|
},
|
|
3573
|
-
get
|
|
3574
|
-
return
|
|
3597
|
+
get children() {
|
|
3598
|
+
return _$createComponent(Show, {
|
|
3599
|
+
get when() {
|
|
3600
|
+
return view() === "day";
|
|
3601
|
+
},
|
|
3602
|
+
get fallback() {
|
|
3603
|
+
return _$createComponent(CalendarWeekView, _$mergeProps(() => timeProps("week")));
|
|
3604
|
+
},
|
|
3605
|
+
get children() {
|
|
3606
|
+
return _$createComponent(CalendarDayView, _$mergeProps(() => timeProps("day")));
|
|
3607
|
+
}
|
|
3608
|
+
});
|
|
3575
3609
|
}
|
|
3576
3610
|
});
|
|
3577
3611
|
}
|
|
@@ -3581,26 +3615,29 @@ const CalendarRoot = props => {
|
|
|
3581
3615
|
}
|
|
3582
3616
|
});
|
|
3583
3617
|
}
|
|
3584
|
-
}), _el$
|
|
3618
|
+
}), _el$235, _co$62);
|
|
3585
3619
|
_$effect(_p$ => {
|
|
3586
|
-
var _v$
|
|
3587
|
-
_v$
|
|
3588
|
-
_v$
|
|
3589
|
-
_v$
|
|
3620
|
+
var _v$46 = `k2b-content-calendar ${props.class ?? ""}`,
|
|
3621
|
+
_v$47 = props.navigationPending ? "true" : undefined;
|
|
3622
|
+
_v$46 !== _p$.e && _$className(_el$231, _p$.e = _v$46);
|
|
3623
|
+
_v$47 !== _p$.t && _$setAttribute(_el$231, "aria-busy", _p$.t = _v$47);
|
|
3590
3624
|
return _p$;
|
|
3591
3625
|
}, {
|
|
3592
3626
|
e: undefined,
|
|
3593
3627
|
t: undefined
|
|
3594
3628
|
});
|
|
3595
|
-
return _el$
|
|
3629
|
+
return _el$231;
|
|
3596
3630
|
})();
|
|
3597
3631
|
};
|
|
3598
3632
|
|
|
3633
|
+
/** A shortcut without Ctrl, Meta, or Mod, which typing would set off. */
|
|
3634
|
+
const singleKey = shortcut => !/(^|\+)(ctrl|meta|mod)\+/i.test(shortcut);
|
|
3635
|
+
|
|
3599
3636
|
/** JSX infers the values of `customViews`; inference from the last signature, as in `createComponent`, sees plain props. */
|
|
3600
3637
|
|
|
3601
3638
|
function Calendar(props) {
|
|
3602
3639
|
return CalendarRoot(props);
|
|
3603
3640
|
}
|
|
3604
3641
|
export default Calendar;
|
|
3605
|
-
_$delegateEvents(["click", "dblclick", "pointerdown", "
|
|
3642
|
+
_$delegateEvents(["click", "dblclick", "pointerdown", "contextmenu", "keydown", "focusin"]);
|
|
3606
3643
|
//# sourceMappingURL=Calendar.js.map
|