@k2b/ui 0.22.0 → 0.24.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 +1122 -1065
- 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 +1593 -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 +235 -197
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +111 -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 +1654 -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 +125 -97
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Navigation.js +18 -3
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +18 -1
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/SidebarSwitcher.js +505 -0
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +174 -86
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/navigation-model.js +1 -0
- package/dist/browser/layout/navigation-model.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 +553 -341
- 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 +1090 -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 +88 -66
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +111 -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 +1311 -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 +40 -29
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +12 -2
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +18 -1
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/SidebarSwitcher.js +271 -0
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +174 -86
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/navigation-model.js +1 -0
- package/dist/ssr/layout/navigation-model.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 +95 -1
- 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 +14 -0
- package/dist/types/content/calendar-day-scroll.d.ts +47 -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 +27 -3
- package/dist/types/layout/PageTitle.d.ts +2 -1
- package/dist/types/layout/SidebarSwitcher.d.ts +65 -0
- package/dist/types/layout/app-workspace-controller.d.ts +9 -1
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/layout/navigation-model.d.ts +4 -0
- package/dist/types/surfaces/StatCell.d.ts +5 -0
- package/package.json +3 -3
|
@@ -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><div class=k2b-calendar-time-grid__days><div class=k2b-calendar-time-grid__corner></div><!$><!/></div><!$><!/><div class="k2b-calendar-time-grid__scroll k2b-detail-trail"><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
|
/**
|
|
@@ -1588,6 +1400,8 @@ const MonthView = props => {
|
|
|
1588
1400
|
const focusCell = key => cells.get(key)?.focus({
|
|
1589
1401
|
preventScroll: true
|
|
1590
1402
|
});
|
|
1403
|
+
/** Whether the focus is in the popover, or fell to the page as it hid: only then does a close return it. */
|
|
1404
|
+
const focusInPopover = () => popoverElement?.contains(document.activeElement) || document.activeElement === document.body;
|
|
1591
1405
|
const closePopover = (restoreFocus = true) => {
|
|
1592
1406
|
if (!popover()) return;
|
|
1593
1407
|
setPopover(null);
|
|
@@ -1628,6 +1442,25 @@ const MonthView = props => {
|
|
|
1628
1442
|
})) return;
|
|
1629
1443
|
if (props.owner.onSlotActivate) props.owner.onSlotActivate(rangeOf(range));
|
|
1630
1444
|
};
|
|
1445
|
+
onMount(() => props.register?.({
|
|
1446
|
+
quickCreate: create => {
|
|
1447
|
+
const range = selection() ?? {
|
|
1448
|
+
first: rovingKey(),
|
|
1449
|
+
last: rovingKey()
|
|
1450
|
+
};
|
|
1451
|
+
select(range.first, range.last);
|
|
1452
|
+
if (!openCreate(range, {
|
|
1453
|
+
active: true,
|
|
1454
|
+
create
|
|
1455
|
+
})) props.owner.onSlotActivate?.(rangeOf(range));
|
|
1456
|
+
},
|
|
1457
|
+
createTarget: () => rangeOf(selection() ?? {
|
|
1458
|
+
first: rovingKey(),
|
|
1459
|
+
last: rovingKey()
|
|
1460
|
+
}),
|
|
1461
|
+
typing: () => popover()?.kind === "create" && !createActive()
|
|
1462
|
+
}));
|
|
1463
|
+
onCleanup(() => props.register?.(null));
|
|
1631
1464
|
const openDayList = key => {
|
|
1632
1465
|
const anchor = cells.get(key);
|
|
1633
1466
|
if (!anchor) return;
|
|
@@ -1949,36 +1782,36 @@ const MonthView = props => {
|
|
|
1949
1782
|
}
|
|
1950
1783
|
});
|
|
1951
1784
|
const grid = () => (() => {
|
|
1952
|
-
var _el$
|
|
1953
|
-
_el$
|
|
1954
|
-
_el$
|
|
1955
|
-
[_el$
|
|
1956
|
-
_el$
|
|
1957
|
-
[_el$
|
|
1958
|
-
_el$
|
|
1959
|
-
[_el$
|
|
1960
|
-
_$insert(_el$
|
|
1785
|
+
var _el$78 = _$getNextElement(_tmpl$22),
|
|
1786
|
+
_el$79 = _el$78.firstChild,
|
|
1787
|
+
_el$81 = _el$79.firstChild,
|
|
1788
|
+
[_el$82, _co$21] = _$getNextMarker(_el$81.nextSibling),
|
|
1789
|
+
_el$83 = _el$82.nextSibling,
|
|
1790
|
+
[_el$84, _co$22] = _$getNextMarker(_el$83.nextSibling),
|
|
1791
|
+
_el$85 = _el$79.nextSibling,
|
|
1792
|
+
[_el$86, _co$23] = _$getNextMarker(_el$85.nextSibling);
|
|
1793
|
+
_$insert(_el$79, _$createComponent(Show, {
|
|
1961
1794
|
get when() {
|
|
1962
1795
|
return props.owner.withWeekNumbers;
|
|
1963
1796
|
},
|
|
1964
1797
|
get children() {
|
|
1965
|
-
var _el$
|
|
1966
|
-
_$insert(_el$
|
|
1967
|
-
return _el$
|
|
1798
|
+
var _el$80 = _$getNextElement(_tmpl$21);
|
|
1799
|
+
_$insert(_el$80, () => calendarMessages().weekShort);
|
|
1800
|
+
return _el$80;
|
|
1968
1801
|
}
|
|
1969
|
-
}), _el$
|
|
1970
|
-
_$insert(_el$
|
|
1802
|
+
}), _el$82, _co$21);
|
|
1803
|
+
_$insert(_el$79, _$createComponent(For, {
|
|
1971
1804
|
get each() {
|
|
1972
1805
|
return weekdays();
|
|
1973
1806
|
},
|
|
1974
1807
|
children: (day, index) => (() => {
|
|
1975
|
-
var _el$
|
|
1976
|
-
_$insert(_el$
|
|
1977
|
-
_$effect(() => _$setAttribute(_el$
|
|
1978
|
-
return _el$
|
|
1808
|
+
var _el$87 = _$getNextElement(_tmpl$21);
|
|
1809
|
+
_$insert(_el$87, day);
|
|
1810
|
+
_$effect(() => _$setAttribute(_el$87, "data-weekend", index() > 4 ? "true" : undefined));
|
|
1811
|
+
return _el$87;
|
|
1979
1812
|
})()
|
|
1980
|
-
}), _el$
|
|
1981
|
-
_$insert(_el$
|
|
1813
|
+
}), _el$84, _co$22);
|
|
1814
|
+
_$insert(_el$78, _$createComponent(For, {
|
|
1982
1815
|
get each() {
|
|
1983
1816
|
return weeks();
|
|
1984
1817
|
},
|
|
@@ -1990,18 +1823,18 @@ const MonthView = props => {
|
|
|
1990
1823
|
const weekHref = () => viewHref(week[0].key, "week");
|
|
1991
1824
|
const weekNumber = () => zonedWeekNumber(week[0].day, dateConfig());
|
|
1992
1825
|
return (() => {
|
|
1993
|
-
var _el$
|
|
1994
|
-
_el$
|
|
1995
|
-
[_el$
|
|
1996
|
-
_el$
|
|
1997
|
-
[_el$
|
|
1998
|
-
_$insert(_el$
|
|
1826
|
+
var _el$88 = _$getNextElement(_tmpl$24),
|
|
1827
|
+
_el$90 = _el$88.firstChild,
|
|
1828
|
+
[_el$91, _co$24] = _$getNextMarker(_el$90.nextSibling),
|
|
1829
|
+
_el$92 = _el$91.nextSibling,
|
|
1830
|
+
[_el$93, _co$25] = _$getNextMarker(_el$92.nextSibling);
|
|
1831
|
+
_$insert(_el$88, _$createComponent(Show, {
|
|
1999
1832
|
get when() {
|
|
2000
1833
|
return props.owner.withWeekNumbers;
|
|
2001
1834
|
},
|
|
2002
1835
|
get children() {
|
|
2003
|
-
var _el$
|
|
2004
|
-
_$insert(_el$
|
|
1836
|
+
var _el$89 = _$getNextElement(_tmpl$23);
|
|
1837
|
+
_$insert(_el$89, _$createComponent(Show, {
|
|
2005
1838
|
get when() {
|
|
2006
1839
|
return weekHref();
|
|
2007
1840
|
},
|
|
@@ -2014,25 +1847,25 @@ const MonthView = props => {
|
|
|
2014
1847
|
return weekNumber();
|
|
2015
1848
|
},
|
|
2016
1849
|
get children() {
|
|
2017
|
-
var _el$
|
|
2018
|
-
_el$
|
|
2019
|
-
_$insert(_el$
|
|
1850
|
+
var _el$94 = _$getNextElement(_tmpl$25);
|
|
1851
|
+
_el$94.$$click = () => openView(week[0].key, "week");
|
|
1852
|
+
_$insert(_el$94, weekNumber);
|
|
2020
1853
|
_$effect(_p$ => {
|
|
2021
|
-
var _v$
|
|
1854
|
+
var _v$0 = calendarMessages().calendarOpenWeekNumber({
|
|
2022
1855
|
week: weekNumber()
|
|
2023
1856
|
}),
|
|
2024
|
-
_v$
|
|
1857
|
+
_v$1 = calendarMessages().calendarOpenWeekNumber({
|
|
2025
1858
|
week: weekNumber()
|
|
2026
1859
|
});
|
|
2027
|
-
_v$
|
|
2028
|
-
_v$
|
|
1860
|
+
_v$0 !== _p$.e && _$setAttribute(_el$94, "title", _p$.e = _v$0);
|
|
1861
|
+
_v$1 !== _p$.t && _$setAttribute(_el$94, "aria-label", _p$.t = _v$1);
|
|
2029
1862
|
return _p$;
|
|
2030
1863
|
}, {
|
|
2031
1864
|
e: undefined,
|
|
2032
1865
|
t: undefined
|
|
2033
1866
|
});
|
|
2034
1867
|
_$runHydrationEvents();
|
|
2035
|
-
return _el$
|
|
1868
|
+
return _el$94;
|
|
2036
1869
|
}
|
|
2037
1870
|
});
|
|
2038
1871
|
},
|
|
@@ -2060,10 +1893,10 @@ const MonthView = props => {
|
|
|
2060
1893
|
}
|
|
2061
1894
|
})
|
|
2062
1895
|
}));
|
|
2063
|
-
return _el$
|
|
1896
|
+
return _el$89;
|
|
2064
1897
|
}
|
|
2065
|
-
}), _el$
|
|
2066
|
-
_$insert(_el$
|
|
1898
|
+
}), _el$91, _co$24);
|
|
1899
|
+
_$insert(_el$88, _$createComponent(For, {
|
|
2067
1900
|
each: week,
|
|
2068
1901
|
children: ({
|
|
2069
1902
|
day,
|
|
@@ -2079,59 +1912,59 @@ const MonthView = props => {
|
|
|
2079
1912
|
hidden: 0
|
|
2080
1913
|
};
|
|
2081
1914
|
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$
|
|
1915
|
+
var _el$95 = _$getNextElement(_tmpl$27),
|
|
1916
|
+
_el$96 = _el$95.firstChild,
|
|
1917
|
+
_el$97 = _el$96.firstChild,
|
|
1918
|
+
_el$98 = _el$97.nextSibling,
|
|
1919
|
+
[_el$99, _co$26] = _$getNextMarker(_el$98.nextSibling),
|
|
1920
|
+
_el$100 = _el$96.nextSibling,
|
|
1921
|
+
_el$107 = _el$100.firstChild,
|
|
1922
|
+
[_el$108, _co$28] = _$getNextMarker(_el$107.nextSibling),
|
|
1923
|
+
_el$109 = _el$108.nextSibling,
|
|
1924
|
+
[_el$110, _co$29] = _$getNextMarker(_el$109.nextSibling),
|
|
1925
|
+
_el$111 = _el$110.nextSibling,
|
|
1926
|
+
[_el$112, _co$30] = _$getNextMarker(_el$111.nextSibling);
|
|
1927
|
+
_el$95.$$keydown = event => onCellKeyDown(event, key);
|
|
1928
|
+
_el$95.$$contextmenu = event => {
|
|
2096
1929
|
// The pressed day takes the focus, so closing the menu with Escape returns there.
|
|
2097
1930
|
menuKey = pressedKey(event, key);
|
|
2098
1931
|
if (hasMenu()) focusCell(menuKey);
|
|
2099
1932
|
};
|
|
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$
|
|
1933
|
+
_el$95.$$pointerdown = event => onCellPointerDown(event, key);
|
|
1934
|
+
_el$95.$$dblclick = event => onCellDoubleClick(event, key);
|
|
1935
|
+
_el$95.$$click = event => onCellClick(event, key);
|
|
1936
|
+
_$use(element => cells.set(key, element), _el$95);
|
|
1937
|
+
_$setAttribute(_el$95, "aria-label", label);
|
|
1938
|
+
_$setAttribute(_el$95, "data-calendar-day-key", key);
|
|
1939
|
+
_$setAttribute(_el$95, "data-outside", !sameMonth ? "true" : undefined);
|
|
1940
|
+
_$setAttribute(_el$97, "data-outside", !sameMonth ? "true" : undefined);
|
|
1941
|
+
_$insert(_el$97, () => calendar.formatDayNumber(day, dateConfig()));
|
|
1942
|
+
_$insert(_el$96, _$createComponent(Show, {
|
|
2110
1943
|
when: dayBadge,
|
|
2111
1944
|
children: badge => (() => {
|
|
2112
|
-
var _el$
|
|
2113
|
-
_el$
|
|
2114
|
-
[_el$
|
|
2115
|
-
_el$
|
|
2116
|
-
[_el$
|
|
2117
|
-
_$insert(_el$
|
|
1945
|
+
var _el$113 = _$getNextElement(_tmpl$19),
|
|
1946
|
+
_el$114 = _el$113.firstChild,
|
|
1947
|
+
[_el$115, _co$31] = _$getNextMarker(_el$114.nextSibling),
|
|
1948
|
+
_el$116 = _el$115.nextSibling,
|
|
1949
|
+
[_el$117, _co$32] = _$getNextMarker(_el$116.nextSibling);
|
|
1950
|
+
_$insert(_el$113, _$createComponent(Show, {
|
|
2118
1951
|
get when() {
|
|
2119
1952
|
return badge().icon;
|
|
2120
1953
|
},
|
|
2121
1954
|
children: icon => (() => {
|
|
2122
|
-
var _el$
|
|
2123
|
-
_$effect(() => _$className(_el$
|
|
2124
|
-
return _el$
|
|
1955
|
+
var _el$118 = _$getNextElement(_tmpl$3);
|
|
1956
|
+
_$effect(() => _$className(_el$118, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1957
|
+
return _el$118;
|
|
2125
1958
|
})()
|
|
2126
|
-
}), _el$
|
|
2127
|
-
_$insert(_el$
|
|
2128
|
-
return _el$
|
|
1959
|
+
}), _el$115, _co$31);
|
|
1960
|
+
_$insert(_el$113, () => badge().label, _el$117, _co$32);
|
|
1961
|
+
return _el$113;
|
|
2129
1962
|
})()
|
|
2130
|
-
}), _el$
|
|
1963
|
+
}), _el$99, _co$26);
|
|
2131
1964
|
_$use(element => {
|
|
2132
1965
|
if (column() === 0) observeLanes(element, weekIndex());
|
|
2133
|
-
}, _el$
|
|
2134
|
-
_$insert(_el$
|
|
1966
|
+
}, _el$100);
|
|
1967
|
+
_$insert(_el$100, _$createComponent(For, {
|
|
2135
1968
|
get each() {
|
|
2136
1969
|
return bars();
|
|
2137
1970
|
},
|
|
@@ -2148,8 +1981,8 @@ const MonthView = props => {
|
|
|
2148
1981
|
return hintFits(`${bar.item.event.title}${startHint() ?? ""}`, hint, span) ? hint : undefined;
|
|
2149
1982
|
};
|
|
2150
1983
|
return (() => {
|
|
2151
|
-
var _el$
|
|
2152
|
-
_$spread(_el$
|
|
1984
|
+
var _el$119 = _$getNextElement(_tmpl$28);
|
|
1985
|
+
_$spread(_el$119, _$mergeProps({
|
|
2153
1986
|
get style() {
|
|
2154
1987
|
return {
|
|
2155
1988
|
"--k2b-calendar-span": String(span),
|
|
@@ -2166,7 +1999,7 @@ const MonthView = props => {
|
|
|
2166
1999
|
return bar.continuesAfter ? "true" : undefined;
|
|
2167
2000
|
}
|
|
2168
2001
|
}, () => linkProps(bar.item)), false, true);
|
|
2169
|
-
_$insert(_el$
|
|
2002
|
+
_$insert(_el$119, _$createComponent(EventChip, {
|
|
2170
2003
|
get event() {
|
|
2171
2004
|
return bar.item.event;
|
|
2172
2005
|
},
|
|
@@ -2201,17 +2034,17 @@ const MonthView = props => {
|
|
|
2201
2034
|
}
|
|
2202
2035
|
}));
|
|
2203
2036
|
_$runHydrationEvents();
|
|
2204
|
-
return _el$
|
|
2037
|
+
return _el$119;
|
|
2205
2038
|
})();
|
|
2206
2039
|
}
|
|
2207
|
-
}), _el$
|
|
2208
|
-
_$insert(_el$
|
|
2040
|
+
}), _el$108, _co$28);
|
|
2041
|
+
_$insert(_el$100, _$createComponent(For, {
|
|
2209
2042
|
get each() {
|
|
2210
2043
|
return cell().shown;
|
|
2211
2044
|
},
|
|
2212
2045
|
children: (item, index) => (() => {
|
|
2213
|
-
var _el$
|
|
2214
|
-
_$insert(_el$
|
|
2046
|
+
var _el$120 = _$getNextElement(_tmpl$29);
|
|
2047
|
+
_$insert(_el$120, _$createComponent(EventChip, {
|
|
2215
2048
|
get event() {
|
|
2216
2049
|
return item.event;
|
|
2217
2050
|
},
|
|
@@ -2232,42 +2065,42 @@ const MonthView = props => {
|
|
|
2232
2065
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, item, markDragged) : undefined;
|
|
2233
2066
|
}
|
|
2234
2067
|
}));
|
|
2235
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
2236
|
-
return _el$
|
|
2068
|
+
_$effect(_$p => _$setStyleProperty(_el$120, "--k2b-calendar-row", String(cell().top + index())));
|
|
2069
|
+
return _el$120;
|
|
2237
2070
|
})()
|
|
2238
|
-
}), _el$
|
|
2239
|
-
_$insert(_el$
|
|
2071
|
+
}), _el$110, _co$29);
|
|
2072
|
+
_$insert(_el$100, _$createComponent(Show, {
|
|
2240
2073
|
get when() {
|
|
2241
2074
|
return cell().hidden > 0;
|
|
2242
2075
|
},
|
|
2243
2076
|
get children() {
|
|
2244
|
-
var _el$
|
|
2245
|
-
_el$
|
|
2246
|
-
_el$
|
|
2247
|
-
_el$
|
|
2248
|
-
_el$
|
|
2249
|
-
[_el$
|
|
2250
|
-
_el$
|
|
2077
|
+
var _el$101 = _$getNextElement(_tmpl$26),
|
|
2078
|
+
_el$102 = _el$101.firstChild,
|
|
2079
|
+
_el$103 = _el$102.nextSibling,
|
|
2080
|
+
_el$104 = _el$103.firstChild,
|
|
2081
|
+
_el$105 = _el$104.nextSibling,
|
|
2082
|
+
[_el$106, _co$27] = _$getNextMarker(_el$105.nextSibling);
|
|
2083
|
+
_el$101.$$click = () => {
|
|
2251
2084
|
const current = popover();
|
|
2252
2085
|
if (current?.kind === "day" && current.dayKey === key) closePopover(false);else openDayList(key);
|
|
2253
2086
|
};
|
|
2254
|
-
_$insert(_el$
|
|
2087
|
+
_$insert(_el$102, () => calendarMessages().calendarMoreEvents({
|
|
2255
2088
|
count: cell().hidden
|
|
2256
2089
|
}));
|
|
2257
|
-
_$insert(_el$
|
|
2090
|
+
_$insert(_el$103, () => cell().hidden, _el$106, _co$27);
|
|
2258
2091
|
_$effect(_p$ => {
|
|
2259
|
-
var _v$
|
|
2260
|
-
_v$
|
|
2092
|
+
var _v$10 = String(cell().top + cell().shown.length),
|
|
2093
|
+
_v$11 = calendarMessages().calendarMoreEventsOn({
|
|
2261
2094
|
count: cell().hidden,
|
|
2262
2095
|
label
|
|
2263
2096
|
}),
|
|
2264
|
-
_v$
|
|
2097
|
+
_v$12 = (() => {
|
|
2265
2098
|
const current = popover();
|
|
2266
2099
|
return current?.kind === "day" && current.dayKey === key;
|
|
2267
2100
|
})();
|
|
2268
|
-
_v$
|
|
2269
|
-
_v$
|
|
2270
|
-
_v$
|
|
2101
|
+
_v$10 !== _p$.e && _$setStyleProperty(_el$101, "--k2b-calendar-row", _p$.e = _v$10);
|
|
2102
|
+
_v$11 !== _p$.t && _$setAttribute(_el$101, "aria-label", _p$.t = _v$11);
|
|
2103
|
+
_v$12 !== _p$.a && _$setAttribute(_el$101, "aria-expanded", _p$.a = _v$12);
|
|
2271
2104
|
return _p$;
|
|
2272
2105
|
}, {
|
|
2273
2106
|
e: undefined,
|
|
@@ -2275,26 +2108,26 @@ const MonthView = props => {
|
|
|
2275
2108
|
a: undefined
|
|
2276
2109
|
});
|
|
2277
2110
|
_$runHydrationEvents();
|
|
2278
|
-
return _el$
|
|
2111
|
+
return _el$101;
|
|
2279
2112
|
}
|
|
2280
|
-
}), _el$
|
|
2113
|
+
}), _el$112, _co$30);
|
|
2281
2114
|
_$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$
|
|
2115
|
+
var _v$13 = rovingKey() === key ? 0 : -1,
|
|
2116
|
+
_v$14 = within(selection(), key) ? "true" : "false",
|
|
2117
|
+
_v$15 = key === todayKey() ? "date" : undefined,
|
|
2118
|
+
_v$16 = column() > 4 ? "true" : undefined,
|
|
2119
|
+
_v$17 = key < todayKey() ? "true" : undefined,
|
|
2120
|
+
_v$18 = selectionPart(key),
|
|
2121
|
+
_v$19 = within(dropRange(), key) ? "true" : undefined,
|
|
2122
|
+
_v$20 = key === todayKey() ? "true" : undefined;
|
|
2123
|
+
_v$13 !== _p$.e && _$setAttribute(_el$95, "tabindex", _p$.e = _v$13);
|
|
2124
|
+
_v$14 !== _p$.t && _$setAttribute(_el$95, "aria-selected", _p$.t = _v$14);
|
|
2125
|
+
_v$15 !== _p$.a && _$setAttribute(_el$95, "aria-current", _p$.a = _v$15);
|
|
2126
|
+
_v$16 !== _p$.o && _$setAttribute(_el$95, "data-weekend", _p$.o = _v$16);
|
|
2127
|
+
_v$17 !== _p$.i && _$setAttribute(_el$95, "data-past", _p$.i = _v$17);
|
|
2128
|
+
_v$18 !== _p$.n && _$setAttribute(_el$95, "data-selected", _p$.n = _v$18);
|
|
2129
|
+
_v$19 !== _p$.s && _$setAttribute(_el$95, "data-drop-preview", _p$.s = _v$19);
|
|
2130
|
+
_v$20 !== _p$.h && _$setAttribute(_el$97, "data-today", _p$.h = _v$20);
|
|
2298
2131
|
return _p$;
|
|
2299
2132
|
}, {
|
|
2300
2133
|
e: undefined,
|
|
@@ -2307,29 +2140,29 @@ const MonthView = props => {
|
|
|
2307
2140
|
h: undefined
|
|
2308
2141
|
});
|
|
2309
2142
|
_$runHydrationEvents();
|
|
2310
|
-
return _el$
|
|
2143
|
+
return _el$95;
|
|
2311
2144
|
})();
|
|
2312
2145
|
}
|
|
2313
|
-
}), _el$
|
|
2314
|
-
_$effect(() => _$setAttribute(_el$
|
|
2315
|
-
return _el$
|
|
2146
|
+
}), _el$93, _co$25);
|
|
2147
|
+
_$effect(() => _$setAttribute(_el$88, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
2148
|
+
return _el$88;
|
|
2316
2149
|
})();
|
|
2317
2150
|
}
|
|
2318
|
-
}), _el$
|
|
2151
|
+
}), _el$86, _co$23);
|
|
2319
2152
|
_$effect(_p$ => {
|
|
2320
|
-
var _v$
|
|
2321
|
-
_v$
|
|
2322
|
-
_v$
|
|
2323
|
-
_v$
|
|
2324
|
-
_v$
|
|
2325
|
-
_v$
|
|
2153
|
+
var _v$7 = formatMonth(props.date, dateConfig()),
|
|
2154
|
+
_v$8 = `auto repeat(${weeks().length}, minmax(5rem, 1fr))`,
|
|
2155
|
+
_v$9 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
2156
|
+
_v$7 !== _p$.e && _$setAttribute(_el$78, "aria-label", _p$.e = _v$7);
|
|
2157
|
+
_v$8 !== _p$.t && _$setStyleProperty(_el$78, "grid-template-rows", _p$.t = _v$8);
|
|
2158
|
+
_v$9 !== _p$.a && _$setAttribute(_el$79, "data-week-numbers", _p$.a = _v$9);
|
|
2326
2159
|
return _p$;
|
|
2327
2160
|
}, {
|
|
2328
2161
|
e: undefined,
|
|
2329
2162
|
t: undefined,
|
|
2330
2163
|
a: undefined
|
|
2331
2164
|
});
|
|
2332
|
-
return _el$
|
|
2165
|
+
return _el$78;
|
|
2333
2166
|
})();
|
|
2334
2167
|
const dayList = dayKey => {
|
|
2335
2168
|
const day = parseKey(dayKey);
|
|
@@ -2337,36 +2170,36 @@ const MonthView = props => {
|
|
|
2337
2170
|
// Read where it renders, so a refresh while the list is open updates it as it does the grid.
|
|
2338
2171
|
const entries = () => dayEntries(dayKey);
|
|
2339
2172
|
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$
|
|
2173
|
+
var _el$121 = _$getNextElement(_tmpl$32),
|
|
2174
|
+
_el$122 = _el$121.firstChild,
|
|
2175
|
+
_el$130 = _el$122.nextSibling,
|
|
2176
|
+
[_el$131, _co$35] = _$getNextMarker(_el$130.nextSibling),
|
|
2177
|
+
_el$124 = _el$131.nextSibling,
|
|
2178
|
+
_el$126 = _el$124.firstChild,
|
|
2179
|
+
[_el$127, _co$33] = _$getNextMarker(_el$126.nextSibling),
|
|
2180
|
+
_el$128 = _el$127.nextSibling,
|
|
2181
|
+
[_el$129, _co$34] = _$getNextMarker(_el$128.nextSibling);
|
|
2182
|
+
_$insert(_el$122, () => dayLabel(day));
|
|
2183
|
+
_$insert(_el$121, _$createComponent(Show, {
|
|
2351
2184
|
get when() {
|
|
2352
2185
|
return entries().length > 0;
|
|
2353
2186
|
},
|
|
2354
2187
|
get fallback() {
|
|
2355
2188
|
return (() => {
|
|
2356
|
-
var _el$
|
|
2357
|
-
_$insert(_el$
|
|
2358
|
-
return _el$
|
|
2189
|
+
var _el$132 = _$getNextElement(_tmpl$33);
|
|
2190
|
+
_$insert(_el$132, () => calendarMessages().calendarNothingPlanned);
|
|
2191
|
+
return _el$132;
|
|
2359
2192
|
})();
|
|
2360
2193
|
},
|
|
2361
2194
|
get children() {
|
|
2362
|
-
var _el$
|
|
2363
|
-
_$insert(_el$
|
|
2195
|
+
var _el$123 = _$getNextElement(_tmpl$30);
|
|
2196
|
+
_$insert(_el$123, _$createComponent(For, {
|
|
2364
2197
|
get each() {
|
|
2365
2198
|
return entries();
|
|
2366
2199
|
},
|
|
2367
2200
|
children: item => (() => {
|
|
2368
|
-
var _el$
|
|
2369
|
-
_$insert(_el$
|
|
2201
|
+
var _el$133 = _$getNextElement(_tmpl$34);
|
|
2202
|
+
_$insert(_el$133, _$createComponent(EventChip, {
|
|
2370
2203
|
get event() {
|
|
2371
2204
|
return item.event;
|
|
2372
2205
|
},
|
|
@@ -2387,13 +2220,13 @@ const MonthView = props => {
|
|
|
2387
2220
|
return leadingTime(item);
|
|
2388
2221
|
}
|
|
2389
2222
|
}));
|
|
2390
|
-
return _el$
|
|
2223
|
+
return _el$133;
|
|
2391
2224
|
})()
|
|
2392
2225
|
}));
|
|
2393
|
-
return _el$
|
|
2226
|
+
return _el$123;
|
|
2394
2227
|
}
|
|
2395
|
-
}), _el$
|
|
2396
|
-
_$insert(_el$
|
|
2228
|
+
}), _el$131, _co$35);
|
|
2229
|
+
_$insert(_el$124, _$createComponent(Show, {
|
|
2397
2230
|
when: href,
|
|
2398
2231
|
get fallback() {
|
|
2399
2232
|
return _$createComponent(Show, {
|
|
@@ -2407,7 +2240,7 @@ const MonthView = props => {
|
|
|
2407
2240
|
size: "sm",
|
|
2408
2241
|
onClick: () => openView(dayKey, "day"),
|
|
2409
2242
|
get children() {
|
|
2410
|
-
return [_$getNextElement(_tmpl$
|
|
2243
|
+
return [_$getNextElement(_tmpl$35), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2411
2244
|
}
|
|
2412
2245
|
});
|
|
2413
2246
|
}
|
|
@@ -2426,11 +2259,11 @@ const MonthView = props => {
|
|
|
2426
2259
|
"data-size": "sm"
|
|
2427
2260
|
},
|
|
2428
2261
|
get children() {
|
|
2429
|
-
return [_$getNextElement(_tmpl$
|
|
2262
|
+
return [_$getNextElement(_tmpl$35), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2430
2263
|
}
|
|
2431
2264
|
})
|
|
2432
|
-
}), _el$
|
|
2433
|
-
_$insert(_el$
|
|
2265
|
+
}), _el$127, _co$33);
|
|
2266
|
+
_$insert(_el$124, _$createComponent(Show, {
|
|
2434
2267
|
get when() {
|
|
2435
2268
|
return props.owner.renderQuickCreate;
|
|
2436
2269
|
},
|
|
@@ -2449,12 +2282,12 @@ const MonthView = props => {
|
|
|
2449
2282
|
});
|
|
2450
2283
|
},
|
|
2451
2284
|
get children() {
|
|
2452
|
-
return [_$getNextElement(_tmpl$
|
|
2285
|
+
return [_$getNextElement(_tmpl$31), _$memo(() => calendarMessages().calendarNewEvent)];
|
|
2453
2286
|
}
|
|
2454
2287
|
});
|
|
2455
2288
|
}
|
|
2456
|
-
}), _el$
|
|
2457
|
-
return _el$
|
|
2289
|
+
}), _el$129, _co$34);
|
|
2290
|
+
return _el$121;
|
|
2458
2291
|
})();
|
|
2459
2292
|
};
|
|
2460
2293
|
return [_$createComponent(Show, {
|
|
@@ -2481,18 +2314,17 @@ const MonthView = props => {
|
|
|
2481
2314
|
});
|
|
2482
2315
|
}
|
|
2483
2316
|
}), (() => {
|
|
2484
|
-
var _el$
|
|
2485
|
-
_el$
|
|
2317
|
+
var _el$136 = _$getNextElement(_tmpl$36);
|
|
2318
|
+
_el$136.addEventListener("toggle", event => {
|
|
2486
2319
|
// A late close of the popover that another opening already replaced keeps the new one. Focus returns to the
|
|
2487
2320
|
// grid only from inside the popover, never from what a click outside it chose.
|
|
2488
2321
|
if (event.newState !== "closed" || !popover() || event.currentTarget.matches(":popover-open")) return;
|
|
2489
|
-
|
|
2490
|
-
closePopover(inside);
|
|
2322
|
+
closePopover(focusInPopover());
|
|
2491
2323
|
});
|
|
2492
|
-
_el$
|
|
2324
|
+
_el$136.$$focusin = () => setCreateActive(true);
|
|
2493
2325
|
var _ref$ = popoverElement;
|
|
2494
|
-
typeof _ref$ === "function" ? _$use(_ref$, _el$
|
|
2495
|
-
_$insert(_el$
|
|
2326
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$136) : popoverElement = _el$136;
|
|
2327
|
+
_$insert(_el$136, _$createComponent(Show, {
|
|
2496
2328
|
get when() {
|
|
2497
2329
|
return popover();
|
|
2498
2330
|
},
|
|
@@ -2500,21 +2332,21 @@ const MonthView = props => {
|
|
|
2500
2332
|
children: value => value.kind === "create" ? props.owner.renderQuickCreate?.(rangeOf(value.range), {
|
|
2501
2333
|
create: value.create,
|
|
2502
2334
|
close: () => {
|
|
2503
|
-
if (popover() === value) closePopover();
|
|
2335
|
+
if (popover() === value) closePopover(focusInPopover());
|
|
2504
2336
|
}
|
|
2505
2337
|
}) : dayList(value.dayKey)
|
|
2506
2338
|
}));
|
|
2507
2339
|
_$effect(_p$ => {
|
|
2508
|
-
var _v$
|
|
2340
|
+
var _v$21 = (() => {
|
|
2509
2341
|
const current = popover();
|
|
2510
2342
|
if (current?.kind === "day") return dayLabel(parseKey(current.dayKey));
|
|
2511
2343
|
return calendarMessages().calendarQuickCreate;
|
|
2512
2344
|
})(),
|
|
2513
|
-
_v$
|
|
2514
|
-
_v$
|
|
2515
|
-
_v$
|
|
2516
|
-
_v$
|
|
2517
|
-
_v$
|
|
2345
|
+
_v$22 = popover()?.kind,
|
|
2346
|
+
_v$23 = popover()?.kind === "create" && !createActive() ? "true" : undefined;
|
|
2347
|
+
_v$21 !== _p$.e && _$setAttribute(_el$136, "aria-label", _p$.e = _v$21);
|
|
2348
|
+
_v$22 !== _p$.t && _$setAttribute(_el$136, "data-kind", _p$.t = _v$22);
|
|
2349
|
+
_v$23 !== _p$.a && _$setAttribute(_el$136, "data-quiet", _p$.a = _v$23);
|
|
2518
2350
|
return _p$;
|
|
2519
2351
|
}, {
|
|
2520
2352
|
e: undefined,
|
|
@@ -2522,7 +2354,7 @@ const MonthView = props => {
|
|
|
2522
2354
|
a: undefined
|
|
2523
2355
|
});
|
|
2524
2356
|
_$runHydrationEvents();
|
|
2525
|
-
return _el$
|
|
2357
|
+
return _el$136;
|
|
2526
2358
|
})()];
|
|
2527
2359
|
};
|
|
2528
2360
|
const TimeGridView = props => {
|
|
@@ -2541,6 +2373,8 @@ const TimeGridView = props => {
|
|
|
2541
2373
|
let scrollContainer;
|
|
2542
2374
|
let timeGrid;
|
|
2543
2375
|
let timeGutter;
|
|
2376
|
+
let daysRow;
|
|
2377
|
+
let allDayRow;
|
|
2544
2378
|
let defaultHourMarker;
|
|
2545
2379
|
let cancelInteraction;
|
|
2546
2380
|
let suppressSlotClickUntil = 0;
|
|
@@ -2571,7 +2405,10 @@ const TimeGridView = props => {
|
|
|
2571
2405
|
if (!timeGrid || !timeGutter) return null;
|
|
2572
2406
|
const gridRect = timeGrid.getBoundingClientRect();
|
|
2573
2407
|
const gutterRect = timeGutter.getBoundingClientRect();
|
|
2574
|
-
|
|
2408
|
+
// The gutter stays in view while the days scroll sideways under it, so the days start one gutter after the grid.
|
|
2409
|
+
if (clientX < gutterRect.right) return null;
|
|
2410
|
+
const daysLeft = gridRect.left + gutterRect.width;
|
|
2411
|
+
const dayIndex = calendarDayIndexAtPoint(clientX, daysLeft, gridRect.right - daysLeft, props.days.length);
|
|
2575
2412
|
if (dayIndex === null) return null;
|
|
2576
2413
|
const minute = Math.min(gridEndHour() * 60 + 45, calendarMinuteAtPoint(clientY, gridRect.top, gridRect.height, gridStartHour(), gridEndHour()));
|
|
2577
2414
|
return zonedMinuteSlot(props.days[dayIndex], minute, dateConfig());
|
|
@@ -2697,10 +2534,28 @@ const TimeGridView = props => {
|
|
|
2697
2534
|
}
|
|
2698
2535
|
return [...groups.values()];
|
|
2699
2536
|
};
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2537
|
+
// A week shares 36 rem between its days; a single day takes 12 rem per overlapping lane. The 40 rem grid is wider
|
|
2538
|
+
// than one or two lanes, so only three or more make the day scroll, and one lane fits beside a tablet drawer.
|
|
2539
|
+
const columnTemplate = createMemo(() => {
|
|
2540
|
+
let dayMin = "var(--k2b-calendar-day-min)";
|
|
2541
|
+
if (isDayView()) {
|
|
2542
|
+
const day = props.days[0];
|
|
2543
|
+
const layouts = timedEventLayouts(eventsByDay().get(calendar.formatDateKey(day, dateConfig()))?.timed ?? []);
|
|
2544
|
+
dayMin = `${Math.max(1, ...layouts.map(layout => layout.lanes)) * 12}rem`;
|
|
2545
|
+
}
|
|
2546
|
+
return `4rem repeat(${props.days.length}, minmax(${dayMin}, 1fr))`;
|
|
2547
|
+
});
|
|
2548
|
+
// The hours scroll sideways themselves; the day and all-day rows follow, also when focus scrolls one of them.
|
|
2549
|
+
// A row's scroll event from our own write arrives a frame late; echoing it back would undo a smooth scroll or fling.
|
|
2550
|
+
const followed = new WeakMap();
|
|
2551
|
+
const followColumns = source => {
|
|
2552
|
+
if (followed.get(source) === source.scrollLeft) return;
|
|
2553
|
+
followed.delete(source);
|
|
2554
|
+
for (const row of [scrollContainer, daysRow, allDayRow]) {
|
|
2555
|
+
if (!row || row === source || row.scrollLeft === source.scrollLeft) continue;
|
|
2556
|
+
row.scrollLeft = source.scrollLeft;
|
|
2557
|
+
followed.set(row, row.scrollLeft);
|
|
2558
|
+
}
|
|
2704
2559
|
};
|
|
2705
2560
|
const laneStyle = layoutItem => {
|
|
2706
2561
|
if (isDayView()) {
|
|
@@ -2737,19 +2592,22 @@ const TimeGridView = props => {
|
|
|
2737
2592
|
});
|
|
2738
2593
|
});
|
|
2739
2594
|
return (() => {
|
|
2740
|
-
var _el$
|
|
2595
|
+
var _el$137 = _$getNextElement(_tmpl$38),
|
|
2596
|
+
_el$138 = _el$137.firstChild,
|
|
2597
|
+
_el$139 = _el$138.firstChild,
|
|
2598
|
+
_el$140 = _el$139.nextSibling,
|
|
2599
|
+
[_el$141, _co$36] = _$getNextMarker(_el$140.nextSibling),
|
|
2600
|
+
_el$151 = _el$138.nextSibling,
|
|
2601
|
+
[_el$152, _co$39] = _$getNextMarker(_el$151.nextSibling),
|
|
2602
|
+
_el$146 = _el$152.nextSibling,
|
|
2603
|
+
_el$147 = _el$146.firstChild,
|
|
2741
2604
|
_el$148 = _el$147.firstChild,
|
|
2742
|
-
_el$149 = _el$148.
|
|
2743
|
-
_el$150 = _el$149.nextSibling
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
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, {
|
|
2605
|
+
_el$149 = _el$148.nextSibling,
|
|
2606
|
+
[_el$150, _co$38] = _$getNextMarker(_el$149.nextSibling);
|
|
2607
|
+
_el$138.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
2608
|
+
var _ref$2 = daysRow;
|
|
2609
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$138) : daysRow = _el$138;
|
|
2610
|
+
_$insert(_el$138, _$createComponent(For, {
|
|
2753
2611
|
get each() {
|
|
2754
2612
|
return props.days;
|
|
2755
2613
|
},
|
|
@@ -2768,47 +2626,50 @@ const TimeGridView = props => {
|
|
|
2768
2626
|
},
|
|
2769
2627
|
get children() {
|
|
2770
2628
|
return [(() => {
|
|
2771
|
-
var _el$
|
|
2772
|
-
_$insert(_el$
|
|
2773
|
-
_$effect(() => _$setAttribute(_el$
|
|
2774
|
-
return _el$
|
|
2629
|
+
var _el$153 = _$getNextElement(_tmpl$39);
|
|
2630
|
+
_$insert(_el$153, () => formatDay(day, dateConfig()));
|
|
2631
|
+
_$effect(() => _$setAttribute(_el$153, "data-today", today() ? "true" : undefined));
|
|
2632
|
+
return _el$153;
|
|
2775
2633
|
})(), _$createComponent(Show, {
|
|
2776
2634
|
when: dayBadge,
|
|
2777
2635
|
children: badge => (() => {
|
|
2778
|
-
var _el$
|
|
2779
|
-
_el$
|
|
2780
|
-
[_el$
|
|
2781
|
-
_el$
|
|
2782
|
-
[_el$
|
|
2783
|
-
_$insert(_el$
|
|
2636
|
+
var _el$154 = _$getNextElement(_tmpl$40),
|
|
2637
|
+
_el$155 = _el$154.firstChild,
|
|
2638
|
+
[_el$156, _co$40] = _$getNextMarker(_el$155.nextSibling),
|
|
2639
|
+
_el$157 = _el$156.nextSibling,
|
|
2640
|
+
[_el$158, _co$41] = _$getNextMarker(_el$157.nextSibling);
|
|
2641
|
+
_$insert(_el$154, _$createComponent(Show, {
|
|
2784
2642
|
get when() {
|
|
2785
2643
|
return badge().icon;
|
|
2786
2644
|
},
|
|
2787
2645
|
children: icon => (() => {
|
|
2788
|
-
var _el$
|
|
2789
|
-
_$effect(() => _$className(_el$
|
|
2790
|
-
return _el$
|
|
2646
|
+
var _el$159 = _$getNextElement(_tmpl$3);
|
|
2647
|
+
_$effect(() => _$className(_el$159, `k2b-calendar-time-grid__badge-icon ti ti-${icon()}`));
|
|
2648
|
+
return _el$159;
|
|
2791
2649
|
})()
|
|
2792
|
-
}), _el$
|
|
2793
|
-
_$insert(_el$
|
|
2794
|
-
return _el$
|
|
2650
|
+
}), _el$156, _co$40);
|
|
2651
|
+
_$insert(_el$154, () => badge().label, _el$158, _co$41);
|
|
2652
|
+
return _el$154;
|
|
2795
2653
|
})()
|
|
2796
2654
|
})];
|
|
2797
2655
|
}
|
|
2798
2656
|
});
|
|
2799
2657
|
}
|
|
2800
|
-
}), _el$
|
|
2801
|
-
_$insert(_el$
|
|
2658
|
+
}), _el$141, _co$36);
|
|
2659
|
+
_$insert(_el$137, _$createComponent(Show, {
|
|
2802
2660
|
get when() {
|
|
2803
2661
|
return !props.owner.hideAllDay;
|
|
2804
2662
|
},
|
|
2805
2663
|
get children() {
|
|
2806
|
-
var _el$
|
|
2807
|
-
_el$
|
|
2808
|
-
_el$
|
|
2809
|
-
[_el$
|
|
2810
|
-
|
|
2811
|
-
|
|
2664
|
+
var _el$142 = _$getNextElement(_tmpl$37),
|
|
2665
|
+
_el$143 = _el$142.firstChild,
|
|
2666
|
+
_el$144 = _el$143.nextSibling,
|
|
2667
|
+
[_el$145, _co$37] = _$getNextMarker(_el$144.nextSibling);
|
|
2668
|
+
_el$142.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
2669
|
+
var _ref$3 = allDayRow;
|
|
2670
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$142) : allDayRow = _el$142;
|
|
2671
|
+
_$insert(_el$143, () => props.labels.allDay);
|
|
2672
|
+
_$insert(_el$142, _$createComponent(For, {
|
|
2812
2673
|
get each() {
|
|
2813
2674
|
return props.days;
|
|
2814
2675
|
},
|
|
@@ -2817,14 +2678,14 @@ const TimeGridView = props => {
|
|
|
2817
2678
|
const allDay = () => eventsByDay().get(dayKey)?.allDay ?? [];
|
|
2818
2679
|
const previewAllDay = previewEvents().filter(event => event.dayKey === dayKey && event.allDay);
|
|
2819
2680
|
return (() => {
|
|
2820
|
-
var _el$
|
|
2821
|
-
_el$
|
|
2822
|
-
_el$
|
|
2823
|
-
[_el$
|
|
2824
|
-
_el$
|
|
2825
|
-
[_el$
|
|
2826
|
-
_$setAttribute(_el$
|
|
2827
|
-
_$spread(_el$
|
|
2681
|
+
var _el$160 = _$getNextElement(_tmpl$41),
|
|
2682
|
+
_el$161 = _el$160.firstChild,
|
|
2683
|
+
_el$162 = _el$161.firstChild,
|
|
2684
|
+
[_el$163, _co$42] = _$getNextMarker(_el$162.nextSibling),
|
|
2685
|
+
_el$164 = _el$163.nextSibling,
|
|
2686
|
+
[_el$165, _co$43] = _$getNextMarker(_el$164.nextSibling);
|
|
2687
|
+
_$setAttribute(_el$160, "data-calendar-day-key", dayKey);
|
|
2688
|
+
_$spread(_el$160, _$mergeProps({
|
|
2828
2689
|
get ["data-drop-preview"]() {
|
|
2829
2690
|
return timePreview()?.allDay && calendar.formatDateKey(timePreview().start, dateConfig()) === dayKey ? "true" : undefined;
|
|
2830
2691
|
},
|
|
@@ -2839,15 +2700,15 @@ const TimeGridView = props => {
|
|
|
2839
2700
|
allDay: true
|
|
2840
2701
|
};
|
|
2841
2702
|
}, () => performance.now() < suppressSlotClickUntil)), false, true);
|
|
2842
|
-
_$insert(_el$
|
|
2703
|
+
_$insert(_el$161, _$createComponent(For, {
|
|
2843
2704
|
each: previewAllDay,
|
|
2844
2705
|
children: event => (() => {
|
|
2845
|
-
var _el$
|
|
2846
|
-
_$insert(_el$
|
|
2847
|
-
return _el$
|
|
2706
|
+
var _el$166 = _$getNextElement(_tmpl$16);
|
|
2707
|
+
_$insert(_el$166, () => event.title);
|
|
2708
|
+
return _el$166;
|
|
2848
2709
|
})()
|
|
2849
|
-
}), _el$
|
|
2850
|
-
_$insert(_el$
|
|
2710
|
+
}), _el$163, _co$42);
|
|
2711
|
+
_$insert(_el$161, _$createComponent(For, {
|
|
2851
2712
|
get each() {
|
|
2852
2713
|
return allDay();
|
|
2853
2714
|
},
|
|
@@ -2867,49 +2728,50 @@ const TimeGridView = props => {
|
|
|
2867
2728
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startAllDayMove(pointerEvent, event, markDragged) : undefined;
|
|
2868
2729
|
}
|
|
2869
2730
|
})
|
|
2870
|
-
}), _el$
|
|
2731
|
+
}), _el$165, _co$43);
|
|
2871
2732
|
_$runHydrationEvents();
|
|
2872
|
-
return _el$
|
|
2733
|
+
return _el$160;
|
|
2873
2734
|
})();
|
|
2874
2735
|
}
|
|
2875
|
-
}), _el$
|
|
2736
|
+
}), _el$145, _co$37);
|
|
2876
2737
|
_$effect(_p$ => {
|
|
2877
|
-
var _v$
|
|
2878
|
-
_v$
|
|
2879
|
-
_v$
|
|
2880
|
-
_v$
|
|
2738
|
+
var _v$24 = columnTemplate(),
|
|
2739
|
+
_v$25 = `${props.owner.allDayMaxHeightRem ?? 7}rem`;
|
|
2740
|
+
_v$24 !== _p$.e && _$setStyleProperty(_el$142, "grid-template-columns", _p$.e = _v$24);
|
|
2741
|
+
_v$25 !== _p$.t && _$setStyleProperty(_el$142, "max-height", _p$.t = _v$25);
|
|
2881
2742
|
return _p$;
|
|
2882
2743
|
}, {
|
|
2883
2744
|
e: undefined,
|
|
2884
2745
|
t: undefined
|
|
2885
2746
|
});
|
|
2886
|
-
return _el$
|
|
2747
|
+
return _el$142;
|
|
2887
2748
|
}
|
|
2888
|
-
}), _el$
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
_$
|
|
2749
|
+
}), _el$152, _co$39);
|
|
2750
|
+
_el$146.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
2751
|
+
var _ref$4 = scrollContainer;
|
|
2752
|
+
typeof _ref$4 === "function" ? _$use(_ref$4, _el$146) : scrollContainer = _el$146;
|
|
2753
|
+
var _ref$5 = timeGrid;
|
|
2754
|
+
typeof _ref$5 === "function" ? _$use(_ref$5, _el$147) : timeGrid = _el$147;
|
|
2755
|
+
var _ref$6 = timeGutter;
|
|
2756
|
+
typeof _ref$6 === "function" ? _$use(_ref$6, _el$148) : timeGutter = _el$148;
|
|
2757
|
+
_$insert(_el$148, _$createComponent(For, {
|
|
2896
2758
|
get each() {
|
|
2897
2759
|
return hours();
|
|
2898
2760
|
},
|
|
2899
2761
|
children: hour => (() => {
|
|
2900
|
-
var _el$
|
|
2901
|
-
_el$
|
|
2902
|
-
[_el$
|
|
2903
|
-
_el$
|
|
2762
|
+
var _el$167 = _$getNextElement(_tmpl$42),
|
|
2763
|
+
_el$169 = _el$167.firstChild,
|
|
2764
|
+
[_el$170, _co$44] = _$getNextMarker(_el$169.nextSibling),
|
|
2765
|
+
_el$168 = _el$170.nextSibling;
|
|
2904
2766
|
_$use(element => {
|
|
2905
2767
|
if (hour === businessStartHour()) defaultHourMarker = element;
|
|
2906
|
-
}, _el$
|
|
2907
|
-
_$insert(_el$
|
|
2908
|
-
_$effect(() => _$setAttribute(_el$
|
|
2909
|
-
return _el$
|
|
2768
|
+
}, _el$167);
|
|
2769
|
+
_$insert(_el$167, () => `${hour}`.padStart(2, "0"), _el$170, _co$44);
|
|
2770
|
+
_$effect(() => _$setAttribute(_el$167, "data-outside-business", hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined));
|
|
2771
|
+
return _el$167;
|
|
2910
2772
|
})()
|
|
2911
2773
|
}));
|
|
2912
|
-
_$insert(_el$
|
|
2774
|
+
_$insert(_el$147, _$createComponent(For, {
|
|
2913
2775
|
get each() {
|
|
2914
2776
|
return props.days;
|
|
2915
2777
|
},
|
|
@@ -2917,34 +2779,34 @@ const TimeGridView = props => {
|
|
|
2917
2779
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
2918
2780
|
const layouts = createMemo(() => timedEventLayouts(eventsByDay().get(dayKey)?.timed ?? []));
|
|
2919
2781
|
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$
|
|
2782
|
+
var _el$171 = _$getNextElement(_tmpl$44),
|
|
2783
|
+
_el$173 = _el$171.firstChild,
|
|
2784
|
+
[_el$174, _co$45] = _$getNextMarker(_el$173.nextSibling),
|
|
2785
|
+
_el$175 = _el$174.nextSibling,
|
|
2786
|
+
[_el$176, _co$46] = _$getNextMarker(_el$175.nextSibling),
|
|
2787
|
+
_el$177 = _el$176.nextSibling,
|
|
2788
|
+
[_el$178, _co$47] = _$getNextMarker(_el$177.nextSibling),
|
|
2789
|
+
_el$179 = _el$178.nextSibling,
|
|
2790
|
+
[_el$180, _co$48] = _$getNextMarker(_el$179.nextSibling),
|
|
2791
|
+
_el$181 = _el$180.nextSibling,
|
|
2792
|
+
[_el$182, _co$49] = _$getNextMarker(_el$181.nextSibling);
|
|
2793
|
+
_$insert(_el$171, _$createComponent(Show, {
|
|
2932
2794
|
get when() {
|
|
2933
2795
|
return currentTimeLine(day) !== null;
|
|
2934
2796
|
},
|
|
2935
2797
|
get children() {
|
|
2936
|
-
var _el$
|
|
2937
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
2938
|
-
return _el$
|
|
2798
|
+
var _el$172 = _$getNextElement(_tmpl$43);
|
|
2799
|
+
_$effect(_$p => _$setStyleProperty(_el$172, "top", `${currentTimeLine(day) ?? 0}%`));
|
|
2800
|
+
return _el$172;
|
|
2939
2801
|
}
|
|
2940
|
-
}), _el$
|
|
2941
|
-
_$insert(_el$
|
|
2802
|
+
}), _el$174, _co$45);
|
|
2803
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
2942
2804
|
get each() {
|
|
2943
2805
|
return hours();
|
|
2944
2806
|
},
|
|
2945
2807
|
children: hour => (() => {
|
|
2946
|
-
var _el$
|
|
2947
|
-
_$spread(_el$
|
|
2808
|
+
var _el$183 = _$getNextElement(_tmpl$45);
|
|
2809
|
+
_$spread(_el$183, _$mergeProps({
|
|
2948
2810
|
get ["data-outside-business"]() {
|
|
2949
2811
|
return hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined;
|
|
2950
2812
|
},
|
|
@@ -2962,10 +2824,10 @@ const TimeGridView = props => {
|
|
|
2962
2824
|
"onPointerDown": startRange
|
|
2963
2825
|
}), false, false);
|
|
2964
2826
|
_$runHydrationEvents();
|
|
2965
|
-
return _el$
|
|
2827
|
+
return _el$183;
|
|
2966
2828
|
})()
|
|
2967
|
-
}), _el$
|
|
2968
|
-
_$insert(_el$
|
|
2829
|
+
}), _el$176, _co$46);
|
|
2830
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
2969
2831
|
get each() {
|
|
2970
2832
|
return previewEvents().filter(event => event.dayKey === dayKey && !event.allDay);
|
|
2971
2833
|
},
|
|
@@ -2973,44 +2835,44 @@ const TimeGridView = props => {
|
|
|
2973
2835
|
const layout = eventLayout(event);
|
|
2974
2836
|
const short = event.endDate.getTime() - event.startDate.getTime() < 60 * 60_000;
|
|
2975
2837
|
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$
|
|
2838
|
+
var _el$184 = _$getNextElement(_tmpl$47),
|
|
2839
|
+
_el$185 = _el$184.firstChild,
|
|
2840
|
+
_el$193 = _el$185.firstChild,
|
|
2841
|
+
[_el$194, _co$52] = _$getNextMarker(_el$193.nextSibling),
|
|
2842
|
+
_el$187 = _el$194.nextSibling,
|
|
2843
|
+
_el$189 = _el$187.firstChild,
|
|
2844
|
+
[_el$190, _co$50] = _$getNextMarker(_el$189.nextSibling),
|
|
2845
|
+
_el$188 = _el$190.nextSibling,
|
|
2846
|
+
_el$191 = _el$188.nextSibling,
|
|
2847
|
+
[_el$192, _co$51] = _$getNextMarker(_el$191.nextSibling);
|
|
2848
|
+
_$setAttribute(_el$184, "data-short", short ? "true" : undefined);
|
|
2849
|
+
_$insert(_el$185, _$createComponent(Show, {
|
|
2988
2850
|
get when() {
|
|
2989
2851
|
return event.title;
|
|
2990
2852
|
},
|
|
2991
2853
|
get children() {
|
|
2992
|
-
var _el$
|
|
2993
|
-
_$insert(_el$
|
|
2994
|
-
return _el$
|
|
2854
|
+
var _el$186 = _$getNextElement(_tmpl$46);
|
|
2855
|
+
_$insert(_el$186, () => event.title);
|
|
2856
|
+
return _el$186;
|
|
2995
2857
|
}
|
|
2996
|
-
}), _el$
|
|
2997
|
-
_$insert(_el$
|
|
2998
|
-
_$insert(_el$
|
|
2858
|
+
}), _el$194, _co$52);
|
|
2859
|
+
_$insert(_el$187, () => formatTime(event.startDate, dateConfig()), _el$190, _co$50);
|
|
2860
|
+
_$insert(_el$187, () => formatTime(event.endDate, dateConfig()), _el$192, _co$51);
|
|
2999
2861
|
_$effect(_p$ => {
|
|
3000
|
-
var _v$
|
|
3001
|
-
_v$
|
|
3002
|
-
_v$
|
|
3003
|
-
_v$
|
|
2862
|
+
var _v$30 = `${layout.top}%`,
|
|
2863
|
+
_v$31 = `${layout.height}%`;
|
|
2864
|
+
_v$30 !== _p$.e && _$setStyleProperty(_el$184, "top", _p$.e = _v$30);
|
|
2865
|
+
_v$31 !== _p$.t && _$setStyleProperty(_el$184, "height", _p$.t = _v$31);
|
|
3004
2866
|
return _p$;
|
|
3005
2867
|
}, {
|
|
3006
2868
|
e: undefined,
|
|
3007
2869
|
t: undefined
|
|
3008
2870
|
});
|
|
3009
|
-
return _el$
|
|
2871
|
+
return _el$184;
|
|
3010
2872
|
})();
|
|
3011
2873
|
}
|
|
3012
|
-
}), _el$
|
|
3013
|
-
_$insert(_el$
|
|
2874
|
+
}), _el$178, _co$47);
|
|
2875
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
3014
2876
|
get each() {
|
|
3015
2877
|
return layouts();
|
|
3016
2878
|
},
|
|
@@ -3053,13 +2915,13 @@ const TimeGridView = props => {
|
|
|
3053
2915
|
});
|
|
3054
2916
|
};
|
|
3055
2917
|
return (() => {
|
|
3056
|
-
var _el$
|
|
3057
|
-
_el$
|
|
3058
|
-
_el$
|
|
3059
|
-
[_el$
|
|
3060
|
-
_el$
|
|
3061
|
-
[_el$
|
|
3062
|
-
_$insert(_el$
|
|
2918
|
+
var _el$195 = _$getNextElement(_tmpl$49),
|
|
2919
|
+
_el$196 = _el$195.firstChild,
|
|
2920
|
+
_el$198 = _el$196.firstChild,
|
|
2921
|
+
[_el$199, _co$53] = _$getNextMarker(_el$198.nextSibling),
|
|
2922
|
+
_el$200 = _el$199.nextSibling,
|
|
2923
|
+
[_el$201, _co$54] = _$getNextMarker(_el$200.nextSibling);
|
|
2924
|
+
_$insert(_el$196, _$createComponent(EventChip, {
|
|
3063
2925
|
event: event,
|
|
3064
2926
|
get owner() {
|
|
3065
2927
|
return props.owner;
|
|
@@ -3074,32 +2936,32 @@ const TimeGridView = props => {
|
|
|
3074
2936
|
get onMovePointerDown() {
|
|
3075
2937
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startTimedMove(pointerEvent, event, markDragged) : undefined;
|
|
3076
2938
|
}
|
|
3077
|
-
}), _el$
|
|
3078
|
-
_$insert(_el$
|
|
2939
|
+
}), _el$199, _co$53);
|
|
2940
|
+
_$insert(_el$196, _$createComponent(Show, {
|
|
3079
2941
|
get when() {
|
|
3080
2942
|
return props.owner.onEventResize;
|
|
3081
2943
|
},
|
|
3082
2944
|
get children() {
|
|
3083
|
-
var _el$
|
|
3084
|
-
_el$
|
|
3085
|
-
_el$
|
|
3086
|
-
_$setAttribute(_el$
|
|
3087
|
-
_$effect(() => _$setAttribute(_el$
|
|
2945
|
+
var _el$197 = _$getNextElement(_tmpl$48);
|
|
2946
|
+
_el$197.addEventListener("dragstart", event => event.preventDefault());
|
|
2947
|
+
_el$197.$$pointerdown = resizeStart;
|
|
2948
|
+
_$setAttribute(_el$197, "draggable", false);
|
|
2949
|
+
_$effect(() => _$setAttribute(_el$197, "aria-label", calendarMessages().resizeEvent));
|
|
3088
2950
|
_$runHydrationEvents();
|
|
3089
|
-
return _el$
|
|
2951
|
+
return _el$197;
|
|
3090
2952
|
}
|
|
3091
|
-
}), _el$
|
|
2953
|
+
}), _el$201, _co$54);
|
|
3092
2954
|
_$effect(_p$ => {
|
|
3093
|
-
var _v$
|
|
3094
|
-
_v$
|
|
3095
|
-
_v$
|
|
3096
|
-
_v$
|
|
3097
|
-
_v$
|
|
3098
|
-
_v$
|
|
3099
|
-
_v$
|
|
3100
|
-
_v$
|
|
3101
|
-
_v$
|
|
3102
|
-
_v$
|
|
2955
|
+
var _v$32 = `${layout.top}%`,
|
|
2956
|
+
_v$33 = `${layout.height}%`,
|
|
2957
|
+
_v$34 = position.left,
|
|
2958
|
+
_v$35 = position.width,
|
|
2959
|
+
_v$36 = String(20 + layoutItem.lane);
|
|
2960
|
+
_v$32 !== _p$.e && _$setStyleProperty(_el$195, "top", _p$.e = _v$32);
|
|
2961
|
+
_v$33 !== _p$.t && _$setStyleProperty(_el$195, "height", _p$.t = _v$33);
|
|
2962
|
+
_v$34 !== _p$.a && _$setStyleProperty(_el$195, "left", _p$.a = _v$34);
|
|
2963
|
+
_v$35 !== _p$.o && _$setStyleProperty(_el$195, "width", _p$.o = _v$35);
|
|
2964
|
+
_v$36 !== _p$.i && _$setStyleProperty(_el$195, "z-index", _p$.i = _v$36);
|
|
3103
2965
|
return _p$;
|
|
3104
2966
|
}, {
|
|
3105
2967
|
e: undefined,
|
|
@@ -3108,11 +2970,11 @@ const TimeGridView = props => {
|
|
|
3108
2970
|
o: undefined,
|
|
3109
2971
|
i: undefined
|
|
3110
2972
|
});
|
|
3111
|
-
return _el$
|
|
2973
|
+
return _el$195;
|
|
3112
2974
|
})();
|
|
3113
2975
|
}
|
|
3114
|
-
}), _el$
|
|
3115
|
-
_$insert(_el$
|
|
2976
|
+
}), _el$180, _co$48);
|
|
2977
|
+
_$insert(_el$171, _$createComponent(For, {
|
|
3116
2978
|
get each() {
|
|
3117
2979
|
return overflowLayouts(layouts());
|
|
3118
2980
|
},
|
|
@@ -3121,27 +2983,27 @@ const TimeGridView = props => {
|
|
|
3121
2983
|
const key = `${dayKey}-${overflow.groupId}`;
|
|
3122
2984
|
const hiddenTitle = () => overflow.hiddenEvents.map(event => `${formatTime(event.startDate, dateConfig())} ${event.title}`).join("\n");
|
|
3123
2985
|
return [(() => {
|
|
3124
|
-
var _el$
|
|
3125
|
-
_el$
|
|
3126
|
-
_el$
|
|
3127
|
-
_el$
|
|
3128
|
-
[_el$
|
|
3129
|
-
_el$
|
|
2986
|
+
var _el$202 = _$getNextElement(_tmpl$50),
|
|
2987
|
+
_el$203 = _el$202.firstChild,
|
|
2988
|
+
_el$204 = _el$203.firstChild,
|
|
2989
|
+
_el$205 = _el$204.nextSibling,
|
|
2990
|
+
[_el$206, _co$55] = _$getNextMarker(_el$205.nextSibling);
|
|
2991
|
+
_el$202.$$click = event => {
|
|
3130
2992
|
event.stopPropagation();
|
|
3131
2993
|
setExpandedOverflow(expandedOverflow() === key ? "" : key);
|
|
3132
2994
|
};
|
|
3133
|
-
_$insert(_el$
|
|
2995
|
+
_$insert(_el$203, () => overflow.hiddenEvents.length, _el$206, _co$55);
|
|
3134
2996
|
_$effect(_p$ => {
|
|
3135
|
-
var _v$
|
|
3136
|
-
_v$
|
|
3137
|
-
_v$
|
|
3138
|
-
_v$
|
|
2997
|
+
var _v$37 = `${layout.top}%`,
|
|
2998
|
+
_v$38 = `${layout.height}%`,
|
|
2999
|
+
_v$39 = hiddenTitle(),
|
|
3000
|
+
_v$40 = calendarMessages().hiddenOverlappingEvents({
|
|
3139
3001
|
count: overflow.hiddenEvents.length
|
|
3140
3002
|
});
|
|
3141
|
-
_v$
|
|
3142
|
-
_v$
|
|
3143
|
-
_v$
|
|
3144
|
-
_v$
|
|
3003
|
+
_v$37 !== _p$.e && _$setStyleProperty(_el$202, "top", _p$.e = _v$37);
|
|
3004
|
+
_v$38 !== _p$.t && _$setStyleProperty(_el$202, "height", _p$.t = _v$38);
|
|
3005
|
+
_v$39 !== _p$.a && _$setAttribute(_el$202, "title", _p$.a = _v$39);
|
|
3006
|
+
_v$40 !== _p$.o && _$setAttribute(_el$202, "aria-label", _p$.o = _v$40);
|
|
3145
3007
|
return _p$;
|
|
3146
3008
|
}, {
|
|
3147
3009
|
e: undefined,
|
|
@@ -3150,24 +3012,24 @@ const TimeGridView = props => {
|
|
|
3150
3012
|
o: undefined
|
|
3151
3013
|
});
|
|
3152
3014
|
_$runHydrationEvents();
|
|
3153
|
-
return _el$
|
|
3015
|
+
return _el$202;
|
|
3154
3016
|
})(), _$createComponent(Show, {
|
|
3155
3017
|
get when() {
|
|
3156
3018
|
return expandedOverflow() === key;
|
|
3157
3019
|
},
|
|
3158
3020
|
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$
|
|
3021
|
+
var _el$207 = _$getNextElement(_tmpl$51),
|
|
3022
|
+
_el$208 = _el$207.firstChild,
|
|
3023
|
+
_el$210 = _el$208.firstChild,
|
|
3024
|
+
[_el$211, _co$56] = _$getNextMarker(_el$210.nextSibling),
|
|
3025
|
+
_el$209 = _el$211.nextSibling,
|
|
3026
|
+
_el$212 = _el$209.nextSibling,
|
|
3027
|
+
[_el$213, _co$57] = _$getNextMarker(_el$212.nextSibling),
|
|
3028
|
+
_el$214 = _el$208.nextSibling,
|
|
3029
|
+
[_el$215, _co$58] = _$getNextMarker(_el$214.nextSibling);
|
|
3030
|
+
_$insert(_el$208, () => formatTime(overflow.groupStartDate, dateConfig()), _el$211, _co$56);
|
|
3031
|
+
_$insert(_el$208, () => formatTime(overflow.groupEndDate, dateConfig()), _el$213, _co$57);
|
|
3032
|
+
_$insert(_el$207, _$createComponent(For, {
|
|
3171
3033
|
get each() {
|
|
3172
3034
|
return overflow.hiddenEvents;
|
|
3173
3035
|
},
|
|
@@ -3181,41 +3043,35 @@ const TimeGridView = props => {
|
|
|
3181
3043
|
},
|
|
3182
3044
|
compact: true
|
|
3183
3045
|
})
|
|
3184
|
-
}), _el$
|
|
3185
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
3186
|
-
return _el$
|
|
3046
|
+
}), _el$215, _co$58);
|
|
3047
|
+
_$effect(_$p => _$setStyleProperty(_el$207, "top", `${layout.top}%`));
|
|
3048
|
+
return _el$207;
|
|
3187
3049
|
}
|
|
3188
3050
|
})];
|
|
3189
3051
|
}
|
|
3190
|
-
}), _el$
|
|
3191
|
-
_$effect(
|
|
3192
|
-
|
|
3193
|
-
_v$68 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3194
|
-
_v$67 !== _p$.e && _$setStyleProperty(_el$181, "min-width", _p$.e = _v$67);
|
|
3195
|
-
_v$68 !== _p$.t && _$setStyleProperty(_el$181, "grid-template-rows", _p$.t = _v$68);
|
|
3196
|
-
return _p$;
|
|
3197
|
-
}, {
|
|
3198
|
-
e: undefined,
|
|
3199
|
-
t: undefined
|
|
3200
|
-
});
|
|
3201
|
-
return _el$181;
|
|
3052
|
+
}), _el$182, _co$49);
|
|
3053
|
+
_$effect(_$p => _$setStyleProperty(_el$171, "grid-template-rows", `repeat(${hours().length}, minmax(4rem, 1fr))`));
|
|
3054
|
+
return _el$171;
|
|
3202
3055
|
})();
|
|
3203
3056
|
}
|
|
3204
|
-
}), _el$
|
|
3057
|
+
}), _el$150, _co$38);
|
|
3205
3058
|
_$effect(_p$ => {
|
|
3206
|
-
var _v$
|
|
3207
|
-
_v$
|
|
3208
|
-
_v$
|
|
3209
|
-
|
|
3210
|
-
_v$
|
|
3211
|
-
_v$
|
|
3059
|
+
var _v$26 = isDayView() ? "day" : "week",
|
|
3060
|
+
_v$27 = columnTemplate(),
|
|
3061
|
+
_v$28 = columnTemplate(),
|
|
3062
|
+
_v$29 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3063
|
+
_v$26 !== _p$.e && _$setAttribute(_el$137, "data-view", _p$.e = _v$26);
|
|
3064
|
+
_v$27 !== _p$.t && _$setStyleProperty(_el$138, "grid-template-columns", _p$.t = _v$27);
|
|
3065
|
+
_v$28 !== _p$.a && _$setStyleProperty(_el$147, "grid-template-columns", _p$.a = _v$28);
|
|
3066
|
+
_v$29 !== _p$.o && _$setStyleProperty(_el$148, "grid-template-rows", _p$.o = _v$29);
|
|
3212
3067
|
return _p$;
|
|
3213
3068
|
}, {
|
|
3214
3069
|
e: undefined,
|
|
3215
3070
|
t: undefined,
|
|
3216
|
-
a: undefined
|
|
3071
|
+
a: undefined,
|
|
3072
|
+
o: undefined
|
|
3217
3073
|
});
|
|
3218
|
-
return _el$
|
|
3074
|
+
return _el$137;
|
|
3219
3075
|
})();
|
|
3220
3076
|
};
|
|
3221
3077
|
const YearView = props => {
|
|
@@ -3256,17 +3112,17 @@ const YearView = props => {
|
|
|
3256
3112
|
});
|
|
3257
3113
|
});
|
|
3258
3114
|
return (() => {
|
|
3259
|
-
var _el$
|
|
3260
|
-
_$insert(_el$
|
|
3115
|
+
var _el$216 = _$getNextElement(_tmpl$52);
|
|
3116
|
+
_$insert(_el$216, _$createComponent(For, {
|
|
3261
3117
|
get each() {
|
|
3262
3118
|
return months();
|
|
3263
3119
|
},
|
|
3264
3120
|
children: month => (() => {
|
|
3265
|
-
var _el$
|
|
3266
|
-
_el$
|
|
3267
|
-
_el$
|
|
3268
|
-
_$insert(_el$
|
|
3269
|
-
_$insert(_el$
|
|
3121
|
+
var _el$217 = _$getNextElement(_tmpl$53),
|
|
3122
|
+
_el$218 = _el$217.firstChild,
|
|
3123
|
+
_el$219 = _el$218.nextSibling;
|
|
3124
|
+
_$insert(_el$218, () => month.label);
|
|
3125
|
+
_$insert(_el$219, _$createComponent(For, {
|
|
3270
3126
|
get each() {
|
|
3271
3127
|
return month.days;
|
|
3272
3128
|
},
|
|
@@ -3290,32 +3146,32 @@ const YearView = props => {
|
|
|
3290
3146
|
return day.events[0];
|
|
3291
3147
|
},
|
|
3292
3148
|
children: event => (() => {
|
|
3293
|
-
var _el$
|
|
3149
|
+
var _el$220 = _$getNextElement(_tmpl$54);
|
|
3294
3150
|
_$effect(_p$ => {
|
|
3295
|
-
var _v$
|
|
3296
|
-
_v$
|
|
3297
|
-
_v$
|
|
3151
|
+
var _v$41 = event().colorHex ? undefined : event().color ?? "blue",
|
|
3152
|
+
_v$42 = day.isToday ? "true" : undefined,
|
|
3153
|
+
_v$43 = event().colorHex ? {
|
|
3298
3154
|
"background-color": day.isToday ? "white" : event().colorHex
|
|
3299
3155
|
} : undefined;
|
|
3300
|
-
_v$
|
|
3301
|
-
_v$
|
|
3302
|
-
_p$.a = _$style(_el$
|
|
3156
|
+
_v$41 !== _p$.e && _$setAttribute(_el$220, "data-color", _p$.e = _v$41);
|
|
3157
|
+
_v$42 !== _p$.t && _$setAttribute(_el$220, "data-today", _p$.t = _v$42);
|
|
3158
|
+
_p$.a = _$style(_el$220, _v$43, _p$.a);
|
|
3303
3159
|
return _p$;
|
|
3304
3160
|
}, {
|
|
3305
3161
|
e: undefined,
|
|
3306
3162
|
t: undefined,
|
|
3307
3163
|
a: undefined
|
|
3308
3164
|
});
|
|
3309
|
-
return _el$
|
|
3165
|
+
return _el$220;
|
|
3310
3166
|
})()
|
|
3311
3167
|
})];
|
|
3312
3168
|
}
|
|
3313
3169
|
})
|
|
3314
3170
|
}));
|
|
3315
|
-
return _el$
|
|
3171
|
+
return _el$217;
|
|
3316
3172
|
})()
|
|
3317
3173
|
}));
|
|
3318
|
-
return _el$
|
|
3174
|
+
return _el$216;
|
|
3319
3175
|
})();
|
|
3320
3176
|
};
|
|
3321
3177
|
const MobileMonthView = props => {
|
|
@@ -3323,14 +3179,14 @@ const MobileMonthView = props => {
|
|
|
3323
3179
|
const selectedDateKey = createMemo(() => calendar.formatDateKey(props.selectedDate, dateConfig()));
|
|
3324
3180
|
const selectedEvents = createMemo(() => props.events.filter(event => event.dayKey === selectedDateKey()));
|
|
3325
3181
|
return (() => {
|
|
3326
|
-
var _el$
|
|
3327
|
-
_el$
|
|
3328
|
-
[_el$
|
|
3329
|
-
_el$
|
|
3330
|
-
_el$
|
|
3331
|
-
_el$
|
|
3332
|
-
[_el$
|
|
3333
|
-
_$insert(_el$
|
|
3182
|
+
var _el$221 = _$getNextElement(_tmpl$56),
|
|
3183
|
+
_el$227 = _el$221.firstChild,
|
|
3184
|
+
[_el$228, _co$60] = _$getNextMarker(_el$227.nextSibling),
|
|
3185
|
+
_el$222 = _el$228.nextSibling,
|
|
3186
|
+
_el$223 = _el$222.firstChild,
|
|
3187
|
+
_el$225 = _el$223.nextSibling,
|
|
3188
|
+
[_el$226, _co$59] = _$getNextMarker(_el$225.nextSibling);
|
|
3189
|
+
_$insert(_el$221, _$createComponent(MonthPickerView, {
|
|
3334
3190
|
get owner() {
|
|
3335
3191
|
return {
|
|
3336
3192
|
...props.owner,
|
|
@@ -3350,27 +3206,27 @@ const MobileMonthView = props => {
|
|
|
3350
3206
|
return props.labels;
|
|
3351
3207
|
},
|
|
3352
3208
|
compact: true
|
|
3353
|
-
}), _el$
|
|
3354
|
-
_$insert(_el$
|
|
3209
|
+
}), _el$228, _co$60);
|
|
3210
|
+
_$insert(_el$223, () => props.selectedDate.toLocaleDateString(dateConfig().locale ?? "en", {
|
|
3355
3211
|
weekday: "long",
|
|
3356
3212
|
month: "long",
|
|
3357
3213
|
day: "numeric",
|
|
3358
3214
|
timeZone: dateConfig().timeZone
|
|
3359
3215
|
}));
|
|
3360
|
-
_$insert(_el$
|
|
3216
|
+
_$insert(_el$222, _$createComponent(Show, {
|
|
3361
3217
|
get when() {
|
|
3362
3218
|
return selectedEvents().length > 0;
|
|
3363
3219
|
},
|
|
3364
3220
|
get fallback() {
|
|
3365
3221
|
return (() => {
|
|
3366
|
-
var _el$
|
|
3367
|
-
_$insert(_el$
|
|
3368
|
-
return _el$
|
|
3222
|
+
var _el$229 = _$getNextElement(_tmpl$57);
|
|
3223
|
+
_$insert(_el$229, () => props.labels.noEvents);
|
|
3224
|
+
return _el$229;
|
|
3369
3225
|
})();
|
|
3370
3226
|
},
|
|
3371
3227
|
get children() {
|
|
3372
|
-
var _el$
|
|
3373
|
-
_$insert(_el$
|
|
3228
|
+
var _el$224 = _$getNextElement(_tmpl$55);
|
|
3229
|
+
_$insert(_el$224, _$createComponent(For, {
|
|
3374
3230
|
get each() {
|
|
3375
3231
|
return selectedEvents();
|
|
3376
3232
|
},
|
|
@@ -3384,16 +3240,16 @@ const MobileMonthView = props => {
|
|
|
3384
3240
|
}
|
|
3385
3241
|
})
|
|
3386
3242
|
}));
|
|
3387
|
-
return _el$
|
|
3243
|
+
return _el$224;
|
|
3388
3244
|
}
|
|
3389
|
-
}), _el$
|
|
3390
|
-
return _el$
|
|
3245
|
+
}), _el$226, _co$59);
|
|
3246
|
+
return _el$221;
|
|
3391
3247
|
})();
|
|
3392
3248
|
};
|
|
3393
3249
|
const CalendarBody = props => (() => {
|
|
3394
|
-
var _el$
|
|
3395
|
-
_$insert(_el$
|
|
3396
|
-
return _el$
|
|
3250
|
+
var _el$230 = _$getNextElement(_tmpl$58);
|
|
3251
|
+
_$insert(_el$230, () => props.children);
|
|
3252
|
+
return _el$230;
|
|
3397
3253
|
})();
|
|
3398
3254
|
const CalendarRoot = props => {
|
|
3399
3255
|
const messages = useUiMessages();
|
|
@@ -3444,13 +3300,189 @@ const CalendarRoot = props => {
|
|
|
3444
3300
|
document.removeEventListener("visibilitychange", updateNow);
|
|
3445
3301
|
});
|
|
3446
3302
|
});
|
|
3303
|
+
|
|
3304
|
+
// The day and week views with `dayHours` scroll through their days; the header and the commands ask them first.
|
|
3305
|
+
const [timeView, setTimeView] = createSignal(null);
|
|
3306
|
+
const [monthCreate, setMonthCreate] = createSignal(null);
|
|
3307
|
+
const timeMode = () => Boolean(props.dayHours) && (view() === "day" || view() === "week");
|
|
3308
|
+
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
3309
|
+
/** The first shown day of a day or week view, or the selected day of the month view, for the other views. */
|
|
3310
|
+
const shownDay = () => {
|
|
3311
|
+
const first = timeView()?.visibleKeys().first;
|
|
3312
|
+
if (first) return parseKey(first);
|
|
3313
|
+
return view() === "month" ? focusDay() : null;
|
|
3314
|
+
};
|
|
3315
|
+
const go = (target, nextView) => {
|
|
3316
|
+
const href = props.getDateHref?.(target, nextView);
|
|
3317
|
+
if (href) followCalendarHref(owner, href);else openViewAt(props, target, nextView);
|
|
3318
|
+
};
|
|
3319
|
+
const step = direction => {
|
|
3320
|
+
if (timeView()?.step(direction)) return;
|
|
3321
|
+
go(adjacentCalendarDate(shownDay() ?? date(), view(), direction, dateConfig()), view());
|
|
3322
|
+
};
|
|
3323
|
+
const goToday = () => {
|
|
3324
|
+
if (timeView()?.today()) return;
|
|
3325
|
+
go(calendar.today(dateConfig()), view());
|
|
3326
|
+
};
|
|
3327
|
+
const goView = nextView => {
|
|
3328
|
+
const day = shownDay();
|
|
3329
|
+
if (day) {
|
|
3330
|
+
go(day, nextView);
|
|
3331
|
+
return;
|
|
3332
|
+
}
|
|
3333
|
+
const href = props.getViewHref?.(nextView);
|
|
3334
|
+
if (href) followCalendarHref(owner, href);else props.onViewChange?.(nextView);
|
|
3335
|
+
};
|
|
3336
|
+
const goToKey = key => {
|
|
3337
|
+
if (timeView()?.goTo(key)) return;
|
|
3338
|
+
go(parseKey(key), view());
|
|
3339
|
+
};
|
|
3340
|
+
const openGoTo = () => void openCalendarGoTo({
|
|
3341
|
+
messages: calendarMessages(),
|
|
3342
|
+
today: calendar.formatDateKey(new Date(), dateConfig()),
|
|
3343
|
+
describe: key => parseKey(key).toLocaleDateString(dateConfig().locale ?? "en", {
|
|
3344
|
+
weekday: "long",
|
|
3345
|
+
day: "numeric",
|
|
3346
|
+
month: "long",
|
|
3347
|
+
year: "numeric",
|
|
3348
|
+
timeZone: dateConfig().timeZone
|
|
3349
|
+
}),
|
|
3350
|
+
onGo: goToKey
|
|
3351
|
+
});
|
|
3352
|
+
const ownCommands = createMemo(() => {
|
|
3353
|
+
const text = calendarMessages();
|
|
3354
|
+
const available = ["day", "week", "month", "year"].filter(option => !props.views || props.views.includes(option));
|
|
3355
|
+
const viewLabels = {
|
|
3356
|
+
day: mergedLabels().day,
|
|
3357
|
+
week: mergedLabels().week,
|
|
3358
|
+
month: mergedLabels().month,
|
|
3359
|
+
year: mergedLabels().year
|
|
3360
|
+
};
|
|
3361
|
+
return [{
|
|
3362
|
+
id: "calendar.today",
|
|
3363
|
+
label: text.calendarCommandToday,
|
|
3364
|
+
description: text.calendarCommandTodayDescription,
|
|
3365
|
+
shortcut: "h",
|
|
3366
|
+
icon: "ti ti-calendar-event",
|
|
3367
|
+
run: goToday
|
|
3368
|
+
}, {
|
|
3369
|
+
id: "calendar.next",
|
|
3370
|
+
label: text.calendarCommandNext,
|
|
3371
|
+
description: text.calendarCommandNextDescription,
|
|
3372
|
+
shortcut: "j",
|
|
3373
|
+
icon: "ti ti-chevron-right",
|
|
3374
|
+
run: () => step(1)
|
|
3375
|
+
}, {
|
|
3376
|
+
id: "calendar.previous",
|
|
3377
|
+
label: text.calendarCommandPrevious,
|
|
3378
|
+
description: text.calendarCommandPreviousDescription,
|
|
3379
|
+
shortcut: "k",
|
|
3380
|
+
icon: "ti ti-chevron-left",
|
|
3381
|
+
run: () => step(-1)
|
|
3382
|
+
}, ...available.map((option, index) => ({
|
|
3383
|
+
id: `calendar.view.${option}`,
|
|
3384
|
+
label: text.calendarCommandView({
|
|
3385
|
+
view: viewLabels[option]
|
|
3386
|
+
}),
|
|
3387
|
+
description: text.calendarCommandViewDescription({
|
|
3388
|
+
view: viewLabels[option]
|
|
3389
|
+
}),
|
|
3390
|
+
shortcut: String(index + 1),
|
|
3391
|
+
icon: "ti ti-layout-columns",
|
|
3392
|
+
run: () => goView(option)
|
|
3393
|
+
})), {
|
|
3394
|
+
id: "calendar.goto",
|
|
3395
|
+
label: text.calendarCommandGoTo,
|
|
3396
|
+
description: text.calendarCommandGoToDescription,
|
|
3397
|
+
shortcut: "g",
|
|
3398
|
+
icon: "ti ti-calendar-search",
|
|
3399
|
+
run: openGoTo
|
|
3400
|
+
}];
|
|
3401
|
+
});
|
|
3402
|
+
const allCommands = createMemo(() => [...ownCommands(), ...(props.commands ?? [])]);
|
|
3403
|
+
/** While the month's quiet quick create waits for typing, a single key is the first letter of a title. */
|
|
3404
|
+
const typing = () => view() === "month" && (monthCreate()?.typing() ?? false);
|
|
3405
|
+
createEffect(() => {
|
|
3406
|
+
const commands = typing() ? allCommands().map(command => command.shortcut && singleKey(command.shortcut) ? {
|
|
3407
|
+
...command,
|
|
3408
|
+
shortcut: undefined
|
|
3409
|
+
} : command) : allCommands();
|
|
3410
|
+
untrack(() => props.onCommandsChange?.(commands));
|
|
3411
|
+
});
|
|
3412
|
+
// The arrow keys page like J and K while the keyboard is in the calendar or nowhere, unless something there uses
|
|
3413
|
+
// them, such as the grid of the week or the month.
|
|
3414
|
+
let root;
|
|
3415
|
+
onMount(() => {
|
|
3416
|
+
const onKeyDown = event => {
|
|
3417
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
3418
|
+
if (event.defaultPrevented || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
3419
|
+
if (!props.onCommandsChange || custom() || document.querySelector('dialog[open], [role="dialog"][aria-modal="true"]')) return;
|
|
3420
|
+
const target = event.target;
|
|
3421
|
+
const inCalendar = target instanceof Element && Boolean(root?.contains(target));
|
|
3422
|
+
if (!inCalendar && target !== document.body && target !== document.documentElement) return;
|
|
3423
|
+
if (target instanceof Element && target.closest("input, textarea, select, [contenteditable]:not([contenteditable=false]), [role=textbox], [popover], [role=dialog]")) return;
|
|
3424
|
+
event.preventDefault();
|
|
3425
|
+
step(event.key === "ArrowRight" ? 1 : -1);
|
|
3426
|
+
};
|
|
3427
|
+
window.addEventListener("keydown", onKeyDown);
|
|
3428
|
+
onCleanup(() => window.removeEventListener("keydown", onKeyDown));
|
|
3429
|
+
});
|
|
3430
|
+
const headerNav = {
|
|
3431
|
+
timeView,
|
|
3432
|
+
commands: () => props.onCommandsChange ? allCommands() : [],
|
|
3433
|
+
// The arrow keys page like J and K, so the list names them beside those keys.
|
|
3434
|
+
openShortcuts: () => void openCalendarShortcuts(allCommands(), calendarMessages(), custom() ? {} : {
|
|
3435
|
+
"calendar.next": "arrowright",
|
|
3436
|
+
"calendar.previous": "arrowleft"
|
|
3437
|
+
})
|
|
3438
|
+
};
|
|
3439
|
+
const controller = {
|
|
3440
|
+
quickCreate: create => {
|
|
3441
|
+
const active = timeView();
|
|
3442
|
+
if (active) active.controller.quickCreate(create);else monthCreate()?.quickCreate(create);
|
|
3443
|
+
},
|
|
3444
|
+
createTarget: () => {
|
|
3445
|
+
const active = timeView()?.controller.createTarget() ?? monthCreate()?.createTarget();
|
|
3446
|
+
if (active) return active;
|
|
3447
|
+
const start = calendar.today(dateConfig());
|
|
3448
|
+
return {
|
|
3449
|
+
start,
|
|
3450
|
+
end: calendar.addDays(start, 1, dateConfig()),
|
|
3451
|
+
allDay: true
|
|
3452
|
+
};
|
|
3453
|
+
},
|
|
3454
|
+
dragIn: (event, item, onDrop) => timeView()?.controller.dragIn(event, item, onDrop)
|
|
3455
|
+
};
|
|
3456
|
+
onMount(() => props.controller?.(controller));
|
|
3457
|
+
const timeProps = timeViewName => ({
|
|
3458
|
+
owner,
|
|
3459
|
+
view: timeViewName,
|
|
3460
|
+
get date() {
|
|
3461
|
+
return date();
|
|
3462
|
+
},
|
|
3463
|
+
get now() {
|
|
3464
|
+
return now();
|
|
3465
|
+
},
|
|
3466
|
+
get events() {
|
|
3467
|
+
return props.events;
|
|
3468
|
+
},
|
|
3469
|
+
get labels() {
|
|
3470
|
+
return mergedLabels();
|
|
3471
|
+
},
|
|
3472
|
+
get hours() {
|
|
3473
|
+
return props.dayHours ?? [0, 24];
|
|
3474
|
+
},
|
|
3475
|
+
register: setTimeView
|
|
3476
|
+
});
|
|
3447
3477
|
return (() => {
|
|
3448
|
-
var _el$
|
|
3449
|
-
_el$
|
|
3450
|
-
[_el$
|
|
3451
|
-
_el$
|
|
3452
|
-
[_el$
|
|
3453
|
-
|
|
3478
|
+
var _el$231 = _$getNextElement(_tmpl$59),
|
|
3479
|
+
_el$232 = _el$231.firstChild,
|
|
3480
|
+
[_el$233, _co$61] = _$getNextMarker(_el$232.nextSibling),
|
|
3481
|
+
_el$234 = _el$233.nextSibling,
|
|
3482
|
+
[_el$235, _co$62] = _$getNextMarker(_el$234.nextSibling);
|
|
3483
|
+
var _ref$7 = root;
|
|
3484
|
+
typeof _ref$7 === "function" ? _$use(_ref$7, _el$231) : root = _el$231;
|
|
3485
|
+
_$insert(_el$231, _$createComponent(CalendarHeader, {
|
|
3454
3486
|
get date() {
|
|
3455
3487
|
return date();
|
|
3456
3488
|
},
|
|
@@ -3462,10 +3494,11 @@ const CalendarRoot = props => {
|
|
|
3462
3494
|
},
|
|
3463
3495
|
owner: owner,
|
|
3464
3496
|
get focusDay() {
|
|
3465
|
-
return _$memo(() => view() === "month")() ? focusDay() : null;
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
|
-
|
|
3497
|
+
return _$memo(() => view() === "month")() ? focusDay() : _$memo(() => !!timeView())() ? shownDay() : null;
|
|
3498
|
+
},
|
|
3499
|
+
nav: headerNav
|
|
3500
|
+
}), _el$233, _co$61);
|
|
3501
|
+
_$insert(_el$231, _$createComponent(Show, {
|
|
3469
3502
|
get when() {
|
|
3470
3503
|
return !custom();
|
|
3471
3504
|
},
|
|
@@ -3498,7 +3531,8 @@ const CalendarRoot = props => {
|
|
|
3498
3531
|
get labels() {
|
|
3499
3532
|
return mergedLabels();
|
|
3500
3533
|
},
|
|
3501
|
-
onFocusDay: setFocusDay
|
|
3534
|
+
onFocusDay: setFocusDay,
|
|
3535
|
+
register: setMonthCreate
|
|
3502
3536
|
});
|
|
3503
3537
|
}
|
|
3504
3538
|
});
|
|
@@ -3556,22 +3590,42 @@ const CalendarRoot = props => {
|
|
|
3556
3590
|
});
|
|
3557
3591
|
},
|
|
3558
3592
|
get children() {
|
|
3559
|
-
return _$createComponent(
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
return date();
|
|
3563
|
-
},
|
|
3564
|
-
get now() {
|
|
3565
|
-
return now();
|
|
3566
|
-
},
|
|
3567
|
-
get events() {
|
|
3568
|
-
return normalizedEvents();
|
|
3593
|
+
return _$createComponent(Show, {
|
|
3594
|
+
get when() {
|
|
3595
|
+
return timeMode();
|
|
3569
3596
|
},
|
|
3570
|
-
get
|
|
3571
|
-
return
|
|
3597
|
+
get fallback() {
|
|
3598
|
+
return _$createComponent(TimeGridView, {
|
|
3599
|
+
owner: owner,
|
|
3600
|
+
get date() {
|
|
3601
|
+
return date();
|
|
3602
|
+
},
|
|
3603
|
+
get now() {
|
|
3604
|
+
return now();
|
|
3605
|
+
},
|
|
3606
|
+
get events() {
|
|
3607
|
+
return normalizedEvents();
|
|
3608
|
+
},
|
|
3609
|
+
get labels() {
|
|
3610
|
+
return mergedLabels();
|
|
3611
|
+
},
|
|
3612
|
+
get days() {
|
|
3613
|
+
return days();
|
|
3614
|
+
}
|
|
3615
|
+
});
|
|
3572
3616
|
},
|
|
3573
|
-
get
|
|
3574
|
-
return
|
|
3617
|
+
get children() {
|
|
3618
|
+
return _$createComponent(Show, {
|
|
3619
|
+
get when() {
|
|
3620
|
+
return view() === "day";
|
|
3621
|
+
},
|
|
3622
|
+
get fallback() {
|
|
3623
|
+
return _$createComponent(CalendarWeekView, _$mergeProps(() => timeProps("week")));
|
|
3624
|
+
},
|
|
3625
|
+
get children() {
|
|
3626
|
+
return _$createComponent(CalendarDayView, _$mergeProps(() => timeProps("day")));
|
|
3627
|
+
}
|
|
3628
|
+
});
|
|
3575
3629
|
}
|
|
3576
3630
|
});
|
|
3577
3631
|
}
|
|
@@ -3581,26 +3635,29 @@ const CalendarRoot = props => {
|
|
|
3581
3635
|
}
|
|
3582
3636
|
});
|
|
3583
3637
|
}
|
|
3584
|
-
}), _el$
|
|
3638
|
+
}), _el$235, _co$62);
|
|
3585
3639
|
_$effect(_p$ => {
|
|
3586
|
-
var _v$
|
|
3587
|
-
_v$
|
|
3588
|
-
_v$
|
|
3589
|
-
_v$
|
|
3640
|
+
var _v$44 = `k2b-content-calendar ${props.class ?? ""}`,
|
|
3641
|
+
_v$45 = props.navigationPending ? "true" : undefined;
|
|
3642
|
+
_v$44 !== _p$.e && _$className(_el$231, _p$.e = _v$44);
|
|
3643
|
+
_v$45 !== _p$.t && _$setAttribute(_el$231, "aria-busy", _p$.t = _v$45);
|
|
3590
3644
|
return _p$;
|
|
3591
3645
|
}, {
|
|
3592
3646
|
e: undefined,
|
|
3593
3647
|
t: undefined
|
|
3594
3648
|
});
|
|
3595
|
-
return _el$
|
|
3649
|
+
return _el$231;
|
|
3596
3650
|
})();
|
|
3597
3651
|
};
|
|
3598
3652
|
|
|
3653
|
+
/** A shortcut without Ctrl, Meta, or Mod, which typing would set off. */
|
|
3654
|
+
const singleKey = shortcut => !/(^|\+)(ctrl|meta|mod)\+/i.test(shortcut);
|
|
3655
|
+
|
|
3599
3656
|
/** JSX infers the values of `customViews`; inference from the last signature, as in `createComponent`, sees plain props. */
|
|
3600
3657
|
|
|
3601
3658
|
function Calendar(props) {
|
|
3602
3659
|
return CalendarRoot(props);
|
|
3603
3660
|
}
|
|
3604
3661
|
export default Calendar;
|
|
3605
|
-
_$delegateEvents(["click", "dblclick", "pointerdown", "
|
|
3662
|
+
_$delegateEvents(["click", "dblclick", "pointerdown", "contextmenu", "keydown", "focusin"]);
|
|
3606
3663
|
//# sourceMappingURL=Calendar.js.map
|