@k2b/ui 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/browser/actions/Dropdown.js +67 -52
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +3 -3
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/SpotlightSearch.js +13 -6
- package/dist/browser/actions/SpotlightSearch.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +75 -1
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/content/Calendar.js +1538 -911
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1 -1
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/CalendarWeekView.js +1 -1
- package/dist/browser/content/CalendarWeekView.js.map +1 -1
- package/dist/browser/content/Kbd.js +51 -0
- package/dist/browser/content/Kbd.js.map +1 -0
- package/dist/browser/content/LabelChip.js +38 -0
- package/dist/browser/content/LabelChip.js.map +1 -0
- package/dist/browser/content/MarkdownView.js +2 -1
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/Steps.js +34 -0
- package/dist/browser/content/Steps.js.map +1 -0
- package/dist/browser/content/VirtualFeed.js +33 -1
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/content/calendar-dialogs.js +32 -60
- package/dist/browser/content/calendar-dialogs.js.map +1 -1
- package/dist/browser/content/calendar-month-scroll.js +80 -0
- package/dist/browser/content/calendar-month-scroll.js.map +1 -0
- package/dist/browser/content/index.js +4 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/markdown-info-blocks.js +33 -5
- package/dist/browser/content/markdown-info-blocks.js.map +1 -1
- package/dist/browser/feedback/prompts.js +17 -3
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/intl/index.js +1 -0
- package/dist/browser/intl/index.js.map +1 -1
- package/dist/browser/intl/shortcut-messages.js +77 -0
- package/dist/browser/intl/shortcut-messages.js.map +1 -0
- package/dist/browser/intl/shortcut.js +123 -0
- package/dist/browser/intl/shortcut.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +343 -325
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/TableOfContents.js +115 -0
- package/dist/browser/layout/TableOfContents.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +3 -46
- 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/table-of-contents-messages.js +19 -0
- package/dist/browser/layout/table-of-contents-messages.js.map +1 -0
- package/dist/browser/surfaces/LinkCard.js +40 -24
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +11 -5
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +3 -3
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/SpotlightSearch.js +9 -3
- package/dist/ssr/actions/SpotlightSearch.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +67 -1
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/content/Calendar.js +863 -312
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +1 -1
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/CalendarWeekView.js +1 -1
- package/dist/ssr/content/CalendarWeekView.js.map +1 -1
- package/dist/ssr/content/Kbd.js +38 -0
- package/dist/ssr/content/Kbd.js.map +1 -0
- package/dist/ssr/content/LabelChip.js +21 -0
- package/dist/ssr/content/LabelChip.js.map +1 -0
- package/dist/ssr/content/MarkdownView.js +2 -1
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/Steps.js +14 -0
- package/dist/ssr/content/Steps.js.map +1 -0
- package/dist/ssr/content/VirtualFeed.js +33 -1
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/content/calendar-dialogs.js +12 -32
- package/dist/ssr/content/calendar-dialogs.js.map +1 -1
- package/dist/ssr/content/calendar-month-scroll.js +80 -0
- package/dist/ssr/content/calendar-month-scroll.js.map +1 -0
- package/dist/ssr/content/index.js +4 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/markdown-info-blocks.js +33 -5
- package/dist/ssr/content/markdown-info-blocks.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +17 -3
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/intl/index.js +1 -0
- package/dist/ssr/intl/index.js.map +1 -1
- package/dist/ssr/intl/shortcut-messages.js +77 -0
- package/dist/ssr/intl/shortcut-messages.js.map +1 -0
- package/dist/ssr/intl/shortcut.js +123 -0
- package/dist/ssr/intl/shortcut.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +65 -59
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/TableOfContents.js +79 -0
- package/dist/ssr/layout/TableOfContents.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +3 -46
- 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/table-of-contents-messages.js +19 -0
- package/dist/ssr/layout/table-of-contents-messages.js.map +1 -0
- package/dist/ssr/surfaces/LinkCard.js +26 -10
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +12 -0
- package/dist/types/actions/SpotlightSearch.d.ts +2 -0
- package/dist/types/content/Calendar.d.ts +16 -6
- package/dist/types/content/Kbd.d.ts +16 -0
- package/dist/types/content/LabelChip.d.ts +12 -0
- package/dist/types/content/MarkdownView.d.ts +2 -1
- package/dist/types/content/Steps.d.ts +12 -0
- package/dist/types/content/VirtualFeed.d.ts +8 -0
- package/dist/types/content/calendar-dialogs.d.ts +0 -2
- package/dist/types/content/calendar-month-scroll.d.ts +25 -0
- package/dist/types/content/index.d.ts +7 -1
- package/dist/types/content/markdown-info-blocks.d.ts +21 -4
- package/dist/types/feedback/prompts.d.ts +8 -2
- package/dist/types/intl/index.d.ts +2 -0
- package/dist/types/intl/shortcut-messages.d.ts +35 -0
- package/dist/types/intl/shortcut.d.ts +29 -0
- package/dist/types/layout/AppWorkspace.d.ts +3 -1
- package/dist/types/layout/TableOfContents.d.ts +24 -0
- package/dist/types/layout/index.d.ts +2 -0
- package/dist/types/layout/table-of-contents-messages.d.ts +4 -0
- package/dist/types/surfaces/LinkCard.d.ts +3 -0
- package/package.json +3 -3
|
@@ -36,48 +36,50 @@ var _tmpl$ = /*#__PURE__*/_$template(`<a>`),
|
|
|
36
36
|
_tmpl$18 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__day-number>`),
|
|
37
37
|
_tmpl$19 = /*#__PURE__*/_$template(`<span class=k2b-calendar-month__badge><!$><!/><!$><!/>`),
|
|
38
38
|
_tmpl$20 = /*#__PURE__*/_$template(`<span class=k2b-calendar-dot>`),
|
|
39
|
-
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
40
|
-
_tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
41
|
-
_tmpl$23 = /*#__PURE__*/_$template(`<
|
|
42
|
-
_tmpl$24 = /*#__PURE__*/_$template(`<
|
|
43
|
-
_tmpl$25 = /*#__PURE__*/_$template(`<
|
|
44
|
-
_tmpl$26 = /*#__PURE__*/_$template(`<
|
|
45
|
-
_tmpl$27 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
46
|
-
_tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
47
|
-
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
48
|
-
_tmpl$30 = /*#__PURE__*/_$template(`<
|
|
49
|
-
_tmpl$31 = /*#__PURE__*/_$template(`<
|
|
50
|
-
_tmpl$32 = /*#__PURE__*/_$template(`<
|
|
51
|
-
_tmpl$33 = /*#__PURE__*/_$template(`<
|
|
52
|
-
_tmpl$34 = /*#__PURE__*/_$template(`<
|
|
53
|
-
_tmpl$35 = /*#__PURE__*/_$template(`<
|
|
54
|
-
_tmpl$36 = /*#__PURE__*/_$template(`<
|
|
55
|
-
_tmpl$37 = /*#__PURE__*/_$template(`<
|
|
56
|
-
_tmpl$38 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
57
|
-
_tmpl$39 = /*#__PURE__*/_$template(`<
|
|
58
|
-
_tmpl$40 = /*#__PURE__*/_$template(`<
|
|
59
|
-
_tmpl$41 = /*#__PURE__*/_$template(`<
|
|
60
|
-
_tmpl$42 = /*#__PURE__*/_$template(`<
|
|
61
|
-
_tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-
|
|
62
|
-
_tmpl$44 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-
|
|
63
|
-
_tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-
|
|
64
|
-
_tmpl$46 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
65
|
-
_tmpl$47 = /*#__PURE__*/_$template(`<div class=
|
|
66
|
-
_tmpl$48 = /*#__PURE__*/_$template(`<
|
|
67
|
-
_tmpl$49 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
68
|
-
_tmpl$50 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-
|
|
69
|
-
_tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-
|
|
70
|
-
_tmpl$52 = /*#__PURE__*/_$template(`<
|
|
71
|
-
_tmpl$53 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
72
|
-
_tmpl$54 = /*#__PURE__*/_$template(`<
|
|
73
|
-
_tmpl$55 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
74
|
-
_tmpl$56 = /*#__PURE__*/_$template(`<
|
|
75
|
-
_tmpl$57 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-
|
|
76
|
-
_tmpl$58 = /*#__PURE__*/_$template(`<div class=k2b-calendar-
|
|
77
|
-
_tmpl$59 = /*#__PURE__*/_$template(`<
|
|
39
|
+
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week-number role=rowheader>`),
|
|
40
|
+
_tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__week role=row><!$><!/><!$><!/>`),
|
|
41
|
+
_tmpl$23 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-month__week-link tabindex=-1>`),
|
|
42
|
+
_tmpl$24 = /*#__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>+<!$><!/>`),
|
|
43
|
+
_tmpl$25 = /*#__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><!$><!/><!$><!/><!$><!/>`),
|
|
44
|
+
_tmpl$26 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment data-bar=true>`),
|
|
45
|
+
_tmpl$27 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__segment style=--k2b-calendar-span:1>`),
|
|
46
|
+
_tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekday role=columnheader>`),
|
|
47
|
+
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month__weekdays role=row><!$><!/><!$><!/>`),
|
|
48
|
+
_tmpl$30 = /*#__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><!$><!/><!$><!/>`),
|
|
49
|
+
_tmpl$31 = /*#__PURE__*/_$template(`<div class=k2b-calendar-month-viewport><div class=k2b-calendar-month role=grid aria-multiselectable=true data-lanes=true data-continuous=true style=--k2b-calendar-lane:1.25rem;--k2b-calendar-lane-gap:0.125rem><!$><!/><div class=k2b-calendar-month__track role=rowgroup></div></div><div class=k2b-calendar-month__scroll-label aria-hidden=true>`),
|
|
50
|
+
_tmpl$32 = /*#__PURE__*/_$template(`<ul class=k2b-calendar-day-list__events>`),
|
|
51
|
+
_tmpl$33 = /*#__PURE__*/_$template(`<i class="ti ti-plus"aria-hidden=true>`),
|
|
52
|
+
_tmpl$34 = /*#__PURE__*/_$template(`<div class=k2b-calendar-day-list><div class=k2b-calendar-day-list__title></div><!$><!/><div class=k2b-calendar-day-list__actions><!$><!/><!$><!/>`),
|
|
53
|
+
_tmpl$35 = /*#__PURE__*/_$template(`<p class=k2b-calendar-day-list__empty>`),
|
|
54
|
+
_tmpl$36 = /*#__PURE__*/_$template(`<li>`),
|
|
55
|
+
_tmpl$37 = /*#__PURE__*/_$template(`<i class="ti ti-zoom-in"aria-hidden=true>`),
|
|
56
|
+
_tmpl$38 = /*#__PURE__*/_$template(`<div class=k2b-calendar-popover popover=auto role=dialog>`),
|
|
57
|
+
_tmpl$39 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day><div class=k2b-calendar-time-grid__all-day-label></div><!$><!/>`),
|
|
58
|
+
_tmpl$40 = /*#__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><!$><!/>`),
|
|
59
|
+
_tmpl$41 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__day-label>`),
|
|
60
|
+
_tmpl$42 = /*#__PURE__*/_$template(`<span class=k2b-calendar-time-grid__badge><!$><!/><!$><!/>`),
|
|
61
|
+
_tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__all-day-cell><div class=k2b-calendar-time-grid__all-day-events><!$><!/><!$><!/>`),
|
|
62
|
+
_tmpl$44 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__hour><!$><!/>:00`),
|
|
63
|
+
_tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__now>`),
|
|
64
|
+
_tmpl$46 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__column><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
65
|
+
_tmpl$47 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__slot>`),
|
|
66
|
+
_tmpl$48 = /*#__PURE__*/_$template(`<div class=k2b-calendar-preview__title>`),
|
|
67
|
+
_tmpl$49 = /*#__PURE__*/_$template(`<div class="k2b-calendar-preview k2b-calendar-preview--timed"><div class=k2b-calendar-preview__content><!$><!/><div class=k2b-calendar-preview__label><!$><!/> - <!$><!/>`),
|
|
68
|
+
_tmpl$50 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__resize><span class=k2b-calendar-time-grid__resize-icon aria-hidden=true>`),
|
|
69
|
+
_tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__event-position><div class=k2b-calendar-time-grid__event-frame><!$><!/><!$><!/>`),
|
|
70
|
+
_tmpl$52 = /*#__PURE__*/_$template(`<button type=button class=k2b-calendar-time-grid__overflow><span class=k2b-calendar-time-grid__overflow-count>+<!$><!/>`),
|
|
71
|
+
_tmpl$53 = /*#__PURE__*/_$template(`<div class=k2b-calendar-time-grid__overflow-menu><div class=k2b-calendar-time-grid__overflow-title><!$><!/> - <!$><!/></div><!$><!/>`),
|
|
72
|
+
_tmpl$54 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year>`),
|
|
73
|
+
_tmpl$55 = /*#__PURE__*/_$template(`<div class=k2b-calendar-year__month><div class=k2b-calendar-year__title></div><div class=k2b-calendar-year__grid>`),
|
|
74
|
+
_tmpl$56 = /*#__PURE__*/_$template(`<span class=k2b-calendar-year__indicator>`),
|
|
75
|
+
_tmpl$57 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__events>`),
|
|
76
|
+
_tmpl$58 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month><!$><!/><div class=k2b-calendar-mobile-month__agenda><div class=k2b-calendar-mobile-month__title></div><!$><!/>`),
|
|
77
|
+
_tmpl$59 = /*#__PURE__*/_$template(`<div class=k2b-calendar-mobile-month__empty>`),
|
|
78
|
+
_tmpl$60 = /*#__PURE__*/_$template(`<div class=k2b-calendar-body>`),
|
|
79
|
+
_tmpl$61 = /*#__PURE__*/_$template(`<section><!$><!/><!$><!/>`);
|
|
78
80
|
import { Link } from "@k2b/ssr/nav";
|
|
79
81
|
import { dates as calendar } from "@k2b/stdlib";
|
|
80
|
-
import { createEffect, createMemo, createSignal, For, mergeProps, on, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
82
|
+
import { createComputed, createEffect, createMemo, createSignal, For, mergeProps, on, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
81
83
|
import { Button } from "../actions/Button";
|
|
82
84
|
import { GestureMenu } from "../actions/GestureMenu";
|
|
83
85
|
import SegmentedControl from "../actions/SegmentedControl";
|
|
@@ -85,13 +87,15 @@ import { useDateConfigLocale } from "../intl/locale";
|
|
|
85
87
|
import { useUiMessages } from "../intl/messages";
|
|
86
88
|
import { CalendarDayView } from "./CalendarDayView";
|
|
87
89
|
import { CalendarWeekView } from "./CalendarWeekView";
|
|
90
|
+
import { addDayKeys } from "./calendar-days";
|
|
88
91
|
import { openCalendarGoTo, openCalendarShortcuts } from "./calendar-dialogs";
|
|
89
92
|
import { layoutCalendarIntervals } from "./calendar-event-layout";
|
|
90
93
|
import { useCalendarMessages } from "./calendar-messages";
|
|
91
94
|
import { fitMonthWeek, layoutMonthWeek, monthLaneCapacity } from "./calendar-month-layout";
|
|
95
|
+
import { MONTH_ROW_BLOCK, MONTH_ROWS_IN_VIEW, monthFocusRow, monthOfWeek, monthRenderWindow, monthRevealTop, monthRowOf, monthTodayDirection, monthVisibleRows, monthWeekKeys } from "./calendar-month-scroll";
|
|
92
96
|
import { calendarDayIndexAtPoint, calendarMinuteAtPoint, startCalendarPointerSession } from "./calendar-pointer";
|
|
93
97
|
import { EventChip, eventHref, followCalendarHref, formatTime, ownerDateConfig, parseDate, placeCalendarPopover, textWidth, validDate } from "./calendar-shared";
|
|
94
|
-
import { compactGermanDate } from "./calendar-time-view";
|
|
98
|
+
import { compactGermanDate, reducedMotion } from "./calendar-time-view";
|
|
95
99
|
|
|
96
100
|
/** The days a host loaded events for, from the first day `from` up to `to`, both `YYYY-MM-DD` or dates. */
|
|
97
101
|
|
|
@@ -446,11 +450,13 @@ const CalendarHeader = props => {
|
|
|
446
450
|
const calendarMessages = useCalendarMessages();
|
|
447
451
|
const dateConfig = () => ownerDateConfig(props.owner);
|
|
448
452
|
const timeView = () => props.nav.timeView();
|
|
453
|
+
const monthView = () => props.nav.monthView();
|
|
454
|
+
const scrollingView = () => timeView() ?? monthView();
|
|
449
455
|
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
450
456
|
/** The date the header pages from: the first day a day or week view shows, else the date. */
|
|
451
457
|
const base = () => {
|
|
452
458
|
const shown = timeView()?.visibleKeys().first;
|
|
453
|
-
return shown ? parseKey(shown) : props.date;
|
|
459
|
+
return shown ? parseKey(shown) : monthView()?.stepFrom() ?? props.date;
|
|
454
460
|
};
|
|
455
461
|
const previous = () => adjacentCalendarDate(base(), props.view, -1, dateConfig());
|
|
456
462
|
const next = () => adjacentCalendarDate(base(), props.view, 1, dateConfig());
|
|
@@ -484,7 +490,7 @@ const CalendarHeader = props => {
|
|
|
484
490
|
timeZone: dateConfig().timeZone
|
|
485
491
|
});
|
|
486
492
|
if (props.view === "week") return `${formatDay(calendar.startOfWeek(props.date, dateConfig()), dateConfig())} - ${formatDay(calendar.addDays(calendar.startOfWeek(props.date, dateConfig()), 6, dateConfig()), dateConfig())}`;
|
|
487
|
-
return formatMonth(props.date, dateConfig());
|
|
493
|
+
return formatMonth(monthView()?.focusMonth() ?? props.date, dateConfig());
|
|
488
494
|
};
|
|
489
495
|
/**
|
|
490
496
|
* The titles this view can show around the current date: the months of the year, the weeks of the month and across
|
|
@@ -548,52 +554,63 @@ const CalendarHeader = props => {
|
|
|
548
554
|
const href = props.owner.getViewHref?.(view);
|
|
549
555
|
if (href) window.location.href = href;
|
|
550
556
|
};
|
|
557
|
+
/**
|
|
558
|
+
* A previous or next button. Its element stays while its target changes, such as with each step through the months,
|
|
559
|
+
* so a repeated click or Enter lands on the same button and keeps its focus.
|
|
560
|
+
*/
|
|
551
561
|
const navButton = (date, icon, label, direction) => {
|
|
552
|
-
const href = props.owner.getDateHref?.(date, props.view);
|
|
553
|
-
const step = () =>
|
|
554
|
-
const title = props.nav.commands().length > 0 ? `${label} (${direction > 0 ? "J" : "K"})` : label;
|
|
555
|
-
|
|
562
|
+
const href = () => props.owner.getDateHref?.(date(), props.view);
|
|
563
|
+
const step = () => scrollingView()?.step(direction) ?? false;
|
|
564
|
+
const title = () => props.nav.commands().length > 0 ? `${label} (${direction > 0 ? "J" : "K"})` : label;
|
|
565
|
+
const link = target => _$createComponent(CalendarNavigationLink, {
|
|
556
566
|
get owner() {
|
|
557
567
|
return props.owner;
|
|
558
568
|
},
|
|
559
|
-
href
|
|
569
|
+
get href() {
|
|
570
|
+
return target();
|
|
571
|
+
},
|
|
560
572
|
intercept: step,
|
|
561
|
-
anchorProps
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
573
|
+
get anchorProps() {
|
|
574
|
+
return {
|
|
575
|
+
"aria-label": label,
|
|
576
|
+
title: title(),
|
|
577
|
+
class: "k2b-calendar-header__nav-button"
|
|
578
|
+
};
|
|
565
579
|
},
|
|
566
580
|
get children() {
|
|
567
581
|
var _el$4 = _$getNextElement(_tmpl$3);
|
|
568
582
|
_$className(_el$4, `ti ${icon}`);
|
|
569
583
|
return _el$4;
|
|
570
584
|
}
|
|
571
|
-
})
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
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}`);
|
|
580
|
-
_$runHydrationEvents();
|
|
581
|
-
return _el$5;
|
|
582
|
-
})() : _$createComponent(CalendarNavigationLink, {
|
|
583
|
-
get owner() {
|
|
584
|
-
return props.owner;
|
|
585
|
+
});
|
|
586
|
+
return _$createComponent(Show, {
|
|
587
|
+
get when() {
|
|
588
|
+
return Boolean((props.owner.onNavigateHref || props.owner.onNavigate) && href());
|
|
585
589
|
},
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
590
|
+
get fallback() {
|
|
591
|
+
return _$createComponent(Show, {
|
|
592
|
+
get when() {
|
|
593
|
+
return props.owner.onDateChange;
|
|
594
|
+
},
|
|
595
|
+
get fallback() {
|
|
596
|
+
return link(() => href() ?? "#");
|
|
597
|
+
},
|
|
598
|
+
get children() {
|
|
599
|
+
var _el$5 = _$getNextElement(_tmpl$4),
|
|
600
|
+
_el$6 = _el$5.firstChild;
|
|
601
|
+
_el$5.$$click = () => {
|
|
602
|
+
if (!step()) goDate(date());
|
|
603
|
+
};
|
|
604
|
+
_$setAttribute(_el$5, "aria-label", label);
|
|
605
|
+
_$className(_el$6, `ti ${icon}`);
|
|
606
|
+
_$effect(() => _$setAttribute(_el$5, "title", title()));
|
|
607
|
+
_$runHydrationEvents();
|
|
608
|
+
return _el$5;
|
|
609
|
+
}
|
|
610
|
+
});
|
|
592
611
|
},
|
|
593
612
|
get children() {
|
|
594
|
-
|
|
595
|
-
_$className(_el$7, `ti ${icon}`);
|
|
596
|
-
return _el$7;
|
|
613
|
+
return link(() => href() ?? "#");
|
|
597
614
|
}
|
|
598
615
|
});
|
|
599
616
|
};
|
|
@@ -601,7 +618,7 @@ const CalendarHeader = props => {
|
|
|
601
618
|
* In the day and week views that scroll through their days, Today points where today lies, or shows a calm dot while
|
|
602
619
|
* it is on screen; the icon keeps its place either way. The other views name their period in the title.
|
|
603
620
|
*/
|
|
604
|
-
const direction = () => timeMode() ? (
|
|
621
|
+
const direction = () => timeMode() || monthView() ? (scrollingView()?.todayDirection() ?? todayDirectionOf(String(props.view), props.date, dateConfig())) || "here" : undefined;
|
|
605
622
|
/** One arrow that the stylesheet turns toward today, or the dot while today shows. */
|
|
606
623
|
const todayIcon = () => _$createComponent(Show, {
|
|
607
624
|
get when() {
|
|
@@ -622,12 +639,12 @@ const CalendarHeader = props => {
|
|
|
622
639
|
const todayButton = () => {
|
|
623
640
|
const today = calendar.today(dateConfig());
|
|
624
641
|
const href = props.owner.getDateHref?.(today, props.view);
|
|
625
|
-
const intercept = () =>
|
|
642
|
+
const intercept = () => scrollingView()?.today() ?? false;
|
|
626
643
|
const title = () => props.nav.commands().length > 0 ? `${props.labels.today} (H)` : undefined;
|
|
627
644
|
const label = [_$memo(todayIcon), (() => {
|
|
628
|
-
var _el$
|
|
629
|
-
_$insert(_el$
|
|
630
|
-
return _el$
|
|
645
|
+
var _el$9 = _$getNextElement(_tmpl$7);
|
|
646
|
+
_$insert(_el$9, () => props.labels.today);
|
|
647
|
+
return _el$9;
|
|
631
648
|
})()];
|
|
632
649
|
return (props.owner.onNavigateHref || props.owner.onNavigate) && href ? _$createComponent(CalendarNavigationLink, {
|
|
633
650
|
get owner() {
|
|
@@ -694,54 +711,54 @@ const CalendarHeader = props => {
|
|
|
694
711
|
label: props.labels.year
|
|
695
712
|
}].filter(option => !props.owner.views || props.owner.views.includes(option.value)), ...(props.owner.customViews ?? [])]);
|
|
696
713
|
return (() => {
|
|
697
|
-
var _el$
|
|
698
|
-
_el$
|
|
699
|
-
_el$
|
|
700
|
-
[_el$
|
|
701
|
-
_el$
|
|
702
|
-
[_el$
|
|
703
|
-
_el$
|
|
704
|
-
_el$
|
|
705
|
-
_el$
|
|
706
|
-
[_el$
|
|
707
|
-
_el$
|
|
708
|
-
[_el$
|
|
709
|
-
_el$
|
|
710
|
-
_el$
|
|
711
|
-
[_el$
|
|
712
|
-
_el$
|
|
713
|
-
[_el$
|
|
714
|
-
_el$
|
|
715
|
-
[_el$
|
|
716
|
-
_el$
|
|
717
|
-
[_el$
|
|
718
|
-
_el$
|
|
719
|
-
[_el$
|
|
720
|
-
_$insert(_el$
|
|
721
|
-
_$insert(_el$
|
|
722
|
-
_$insert(_el$
|
|
723
|
-
_$insert(_el$
|
|
714
|
+
var _el$0 = _$getNextElement(_tmpl$1),
|
|
715
|
+
_el$1 = _el$0.firstChild,
|
|
716
|
+
_el$14 = _el$1.firstChild,
|
|
717
|
+
[_el$15, _co$2] = _$getNextMarker(_el$14.nextSibling),
|
|
718
|
+
_el$16 = _el$15.nextSibling,
|
|
719
|
+
[_el$17, _co$3] = _$getNextMarker(_el$16.nextSibling),
|
|
720
|
+
_el$10 = _el$17.nextSibling,
|
|
721
|
+
_el$11 = _el$10.firstChild,
|
|
722
|
+
_el$12 = _el$11.nextSibling,
|
|
723
|
+
[_el$13, _co$] = _$getNextMarker(_el$12.nextSibling),
|
|
724
|
+
_el$30 = _el$1.nextSibling,
|
|
725
|
+
[_el$31, _co$8] = _$getNextMarker(_el$30.nextSibling),
|
|
726
|
+
_el$19 = _el$31.nextSibling,
|
|
727
|
+
_el$21 = _el$19.firstChild,
|
|
728
|
+
[_el$22, _co$4] = _$getNextMarker(_el$21.nextSibling),
|
|
729
|
+
_el$23 = _el$22.nextSibling,
|
|
730
|
+
[_el$24, _co$5] = _$getNextMarker(_el$23.nextSibling),
|
|
731
|
+
_el$25 = _el$24.nextSibling,
|
|
732
|
+
[_el$26, _co$6] = _$getNextMarker(_el$25.nextSibling),
|
|
733
|
+
_el$27 = _el$26.nextSibling,
|
|
734
|
+
[_el$28, _co$7] = _$getNextMarker(_el$27.nextSibling),
|
|
735
|
+
_el$32 = _el$19.nextSibling,
|
|
736
|
+
[_el$33, _co$9] = _$getNextMarker(_el$32.nextSibling);
|
|
737
|
+
_$insert(_el$1, () => navButton(previous, "ti-chevron-left", props.labels.previous, -1), _el$15, _co$2);
|
|
738
|
+
_$insert(_el$1, () => navButton(next, "ti-chevron-right", props.labels.next, 1), _el$17, _co$3);
|
|
739
|
+
_$insert(_el$11, title);
|
|
740
|
+
_$insert(_el$10, _$createComponent(For, {
|
|
724
741
|
get each() {
|
|
725
742
|
return titleWidths();
|
|
726
743
|
},
|
|
727
744
|
children: candidate => (() => {
|
|
728
|
-
var _el$
|
|
729
|
-
_$insert(_el$
|
|
730
|
-
return _el$
|
|
745
|
+
var _el$34 = _$getNextElement(_tmpl$10);
|
|
746
|
+
_$insert(_el$34, candidate);
|
|
747
|
+
return _el$34;
|
|
731
748
|
})()
|
|
732
|
-
}), _el$
|
|
733
|
-
_$insert(_el$
|
|
749
|
+
}), _el$13, _co$);
|
|
750
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
734
751
|
get when() {
|
|
735
752
|
return props.owner.toolbarContent;
|
|
736
753
|
},
|
|
737
754
|
get children() {
|
|
738
|
-
var _el$
|
|
739
|
-
_$insert(_el$
|
|
740
|
-
return _el$
|
|
755
|
+
var _el$18 = _$getNextElement(_tmpl$8);
|
|
756
|
+
_$insert(_el$18, () => props.owner.toolbarContent);
|
|
757
|
+
return _el$18;
|
|
741
758
|
}
|
|
742
|
-
}), _el$
|
|
743
|
-
_$insert(_el$
|
|
744
|
-
_$insert(_el$
|
|
759
|
+
}), _el$31, _co$8);
|
|
760
|
+
_$insert(_el$19, todayButton, _el$22, _co$4);
|
|
761
|
+
_$insert(_el$19, _$createComponent(Show, {
|
|
745
762
|
get when() {
|
|
746
763
|
return _$memo(() => !!!props.owner.onViewChange)() && props.owner.getViewHref;
|
|
747
764
|
},
|
|
@@ -774,38 +791,38 @@ const CalendarHeader = props => {
|
|
|
774
791
|
}
|
|
775
792
|
});
|
|
776
793
|
}
|
|
777
|
-
}), _el$
|
|
778
|
-
_$insert(_el$
|
|
779
|
-
_$insert(_el$
|
|
794
|
+
}), _el$24, _co$5);
|
|
795
|
+
_$insert(_el$19, () => props.owner.toolbarActions, _el$26, _co$6);
|
|
796
|
+
_$insert(_el$19, _$createComponent(Show, {
|
|
780
797
|
get when() {
|
|
781
798
|
return props.nav.commands().length > 0;
|
|
782
799
|
},
|
|
783
800
|
get children() {
|
|
784
|
-
var _el$
|
|
785
|
-
_el$
|
|
801
|
+
var _el$20 = _$getNextElement(_tmpl$9);
|
|
802
|
+
_el$20.$$click = () => props.nav.openShortcuts();
|
|
786
803
|
_$effect(_p$ => {
|
|
787
804
|
var _v$ = calendarMessages().calendarShortcuts,
|
|
788
805
|
_v$2 = calendarMessages().calendarShortcuts;
|
|
789
|
-
_v$ !== _p$.e && _$setAttribute(_el$
|
|
790
|
-
_v$2 !== _p$.t && _$setAttribute(_el$
|
|
806
|
+
_v$ !== _p$.e && _$setAttribute(_el$20, "aria-label", _p$.e = _v$);
|
|
807
|
+
_v$2 !== _p$.t && _$setAttribute(_el$20, "title", _p$.t = _v$2);
|
|
791
808
|
return _p$;
|
|
792
809
|
}, {
|
|
793
810
|
e: undefined,
|
|
794
811
|
t: undefined
|
|
795
812
|
});
|
|
796
813
|
_$runHydrationEvents();
|
|
797
|
-
return _el$
|
|
814
|
+
return _el$20;
|
|
798
815
|
}
|
|
799
|
-
}), _el$
|
|
800
|
-
_$insert(_el$
|
|
816
|
+
}), _el$28, _co$7);
|
|
817
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
801
818
|
get when() {
|
|
802
819
|
return props.owner.navigationPending;
|
|
803
820
|
},
|
|
804
821
|
get children() {
|
|
805
822
|
return _$getNextElement(_tmpl$0);
|
|
806
823
|
}
|
|
807
|
-
}), _el$
|
|
808
|
-
return _el$
|
|
824
|
+
}), _el$33, _co$9);
|
|
825
|
+
return _el$0;
|
|
809
826
|
})();
|
|
810
827
|
};
|
|
811
828
|
|
|
@@ -865,55 +882,55 @@ const MonthPickerView = props => {
|
|
|
865
882
|
};
|
|
866
883
|
onCleanup(() => cancelInteraction?.());
|
|
867
884
|
return (() => {
|
|
868
|
-
var _el$
|
|
869
|
-
_el$
|
|
870
|
-
_el$
|
|
871
|
-
[_el$
|
|
872
|
-
_el$
|
|
873
|
-
[_el$
|
|
874
|
-
_el$
|
|
875
|
-
[_el$
|
|
876
|
-
_$insert(_el$
|
|
885
|
+
var _el$35 = _$getNextElement(_tmpl$12),
|
|
886
|
+
_el$36 = _el$35.firstChild,
|
|
887
|
+
_el$38 = _el$36.firstChild,
|
|
888
|
+
[_el$39, _co$0] = _$getNextMarker(_el$38.nextSibling),
|
|
889
|
+
_el$40 = _el$39.nextSibling,
|
|
890
|
+
[_el$41, _co$1] = _$getNextMarker(_el$40.nextSibling),
|
|
891
|
+
_el$42 = _el$36.nextSibling,
|
|
892
|
+
[_el$43, _co$10] = _$getNextMarker(_el$42.nextSibling);
|
|
893
|
+
_$insert(_el$36, _$createComponent(Show, {
|
|
877
894
|
get when() {
|
|
878
895
|
return props.owner.withWeekNumbers;
|
|
879
896
|
},
|
|
880
897
|
get children() {
|
|
881
|
-
var _el$
|
|
882
|
-
_$insert(_el$
|
|
883
|
-
return _el$
|
|
898
|
+
var _el$37 = _$getNextElement(_tmpl$11);
|
|
899
|
+
_$insert(_el$37, () => calendarMessages().weekShort);
|
|
900
|
+
return _el$37;
|
|
884
901
|
}
|
|
885
|
-
}), _el$
|
|
886
|
-
_$insert(_el$
|
|
902
|
+
}), _el$39, _co$0);
|
|
903
|
+
_$insert(_el$36, _$createComponent(For, {
|
|
887
904
|
get each() {
|
|
888
905
|
return weekdays();
|
|
889
906
|
},
|
|
890
907
|
children: day => (() => {
|
|
891
|
-
var _el$
|
|
892
|
-
_$insert(_el$
|
|
893
|
-
return _el$
|
|
908
|
+
var _el$44 = _$getNextElement(_tmpl$11);
|
|
909
|
+
_$insert(_el$44, day);
|
|
910
|
+
return _el$44;
|
|
894
911
|
})()
|
|
895
|
-
}), _el$
|
|
896
|
-
_$insert(_el$
|
|
912
|
+
}), _el$41, _co$1);
|
|
913
|
+
_$insert(_el$35, _$createComponent(For, {
|
|
897
914
|
get each() {
|
|
898
915
|
return weeks();
|
|
899
916
|
},
|
|
900
917
|
children: week => (() => {
|
|
901
|
-
var _el$
|
|
902
|
-
_el$
|
|
903
|
-
[_el$
|
|
904
|
-
_el$
|
|
905
|
-
[_el$
|
|
906
|
-
_$insert(_el$
|
|
918
|
+
var _el$45 = _$getNextElement(_tmpl$14),
|
|
919
|
+
_el$47 = _el$45.firstChild,
|
|
920
|
+
[_el$48, _co$11] = _$getNextMarker(_el$47.nextSibling),
|
|
921
|
+
_el$49 = _el$48.nextSibling,
|
|
922
|
+
[_el$50, _co$12] = _$getNextMarker(_el$49.nextSibling);
|
|
923
|
+
_$insert(_el$45, _$createComponent(Show, {
|
|
907
924
|
get when() {
|
|
908
925
|
return props.owner.withWeekNumbers;
|
|
909
926
|
},
|
|
910
927
|
get children() {
|
|
911
|
-
var _el$
|
|
912
|
-
_$insert(_el$
|
|
913
|
-
return _el$
|
|
928
|
+
var _el$46 = _$getNextElement(_tmpl$13);
|
|
929
|
+
_$insert(_el$46, () => zonedWeekNumber(week[0], dateConfig()));
|
|
930
|
+
return _el$46;
|
|
914
931
|
}
|
|
915
|
-
}), _el$
|
|
916
|
-
_$insert(_el$
|
|
932
|
+
}), _el$48, _co$11);
|
|
933
|
+
_$insert(_el$45, _$createComponent(For, {
|
|
917
934
|
each: week,
|
|
918
935
|
children: day => {
|
|
919
936
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
@@ -941,25 +958,25 @@ const MonthPickerView = props => {
|
|
|
941
958
|
};
|
|
942
959
|
});
|
|
943
960
|
return (() => {
|
|
944
|
-
var _el$
|
|
945
|
-
_el$
|
|
946
|
-
[_el$
|
|
947
|
-
_el$
|
|
948
|
-
_el$
|
|
949
|
-
[_el$
|
|
950
|
-
_el$
|
|
951
|
-
[_el$
|
|
952
|
-
_el$
|
|
953
|
-
_el$
|
|
954
|
-
[_el$
|
|
955
|
-
_el$
|
|
956
|
-
[_el$
|
|
957
|
-
_el$
|
|
958
|
-
[_el$
|
|
959
|
-
_el$
|
|
960
|
-
_$setAttribute(_el$
|
|
961
|
-
_$setAttribute(_el$
|
|
962
|
-
_$insert(_el$
|
|
961
|
+
var _el$51 = _$getNextElement(_tmpl$17),
|
|
962
|
+
_el$67 = _el$51.firstChild,
|
|
963
|
+
[_el$68, _co$18] = _$getNextMarker(_el$67.nextSibling),
|
|
964
|
+
_el$53 = _el$68.nextSibling,
|
|
965
|
+
_el$54 = _el$53.firstChild,
|
|
966
|
+
[_el$55, _co$13] = _$getNextMarker(_el$54.nextSibling),
|
|
967
|
+
_el$56 = _el$55.nextSibling,
|
|
968
|
+
[_el$57, _co$14] = _$getNextMarker(_el$56.nextSibling),
|
|
969
|
+
_el$58 = _el$53.nextSibling,
|
|
970
|
+
_el$60 = _el$58.firstChild,
|
|
971
|
+
[_el$61, _co$15] = _$getNextMarker(_el$60.nextSibling),
|
|
972
|
+
_el$62 = _el$61.nextSibling,
|
|
973
|
+
[_el$63, _co$16] = _$getNextMarker(_el$62.nextSibling),
|
|
974
|
+
_el$64 = _el$63.nextSibling,
|
|
975
|
+
[_el$65, _co$17] = _$getNextMarker(_el$64.nextSibling),
|
|
976
|
+
_el$66 = _el$58.nextSibling;
|
|
977
|
+
_$setAttribute(_el$51, "data-calendar-day-key", dayKey);
|
|
978
|
+
_$setAttribute(_el$51, "data-outside", !sameMonth ? "true" : undefined);
|
|
979
|
+
_$insert(_el$51, _$createComponent(Show, {
|
|
963
980
|
get when() {
|
|
964
981
|
return props.owner.onSlotActivate;
|
|
965
982
|
},
|
|
@@ -985,8 +1002,8 @@ const MonthPickerView = props => {
|
|
|
985
1002
|
});
|
|
986
1003
|
},
|
|
987
1004
|
get children() {
|
|
988
|
-
var _el$
|
|
989
|
-
_$spread(_el$
|
|
1005
|
+
var _el$52 = _$getNextElement(_tmpl$15);
|
|
1006
|
+
_$spread(_el$52, _$mergeProps({
|
|
990
1007
|
get ["aria-label"]() {
|
|
991
1008
|
return calendarMessages().createEventOn({
|
|
992
1009
|
label: dayLabel
|
|
@@ -1001,20 +1018,20 @@ const MonthPickerView = props => {
|
|
|
1001
1018
|
};
|
|
1002
1019
|
}, () => performance.now() < suppressSlotClickUntil, true)), false, false);
|
|
1003
1020
|
_$runHydrationEvents();
|
|
1004
|
-
return _el$
|
|
1021
|
+
return _el$52;
|
|
1005
1022
|
}
|
|
1006
|
-
}), _el$
|
|
1007
|
-
_$insert(_el$
|
|
1023
|
+
}), _el$68, _co$18);
|
|
1024
|
+
_$insert(_el$53, _$createComponent(Show, {
|
|
1008
1025
|
get when() {
|
|
1009
1026
|
return props.owner.onSlotActivate && href;
|
|
1010
1027
|
},
|
|
1011
1028
|
get fallback() {
|
|
1012
1029
|
return (() => {
|
|
1013
|
-
var _el$
|
|
1014
|
-
_$setAttribute(_el$
|
|
1015
|
-
_$setAttribute(_el$
|
|
1016
|
-
_$insert(_el$
|
|
1017
|
-
return _el$
|
|
1030
|
+
var _el$69 = _$getNextElement(_tmpl$18);
|
|
1031
|
+
_$setAttribute(_el$69, "data-today", isToday ? "true" : undefined);
|
|
1032
|
+
_$setAttribute(_el$69, "data-outside", !sameMonth ? "true" : undefined);
|
|
1033
|
+
_$insert(_el$69, () => calendar.formatDayNumber(day, dateConfig()));
|
|
1034
|
+
return _el$69;
|
|
1018
1035
|
})();
|
|
1019
1036
|
},
|
|
1020
1037
|
children: dayHref => _$createComponent(CalendarNavigationLink, {
|
|
@@ -1038,40 +1055,40 @@ const MonthPickerView = props => {
|
|
|
1038
1055
|
return calendar.formatDayNumber(day, dateConfig());
|
|
1039
1056
|
}
|
|
1040
1057
|
})
|
|
1041
|
-
}), _el$
|
|
1042
|
-
_$insert(_el$
|
|
1058
|
+
}), _el$55, _co$13);
|
|
1059
|
+
_$insert(_el$53, _$createComponent(Show, {
|
|
1043
1060
|
when: dayBadge,
|
|
1044
1061
|
children: badge => (() => {
|
|
1045
|
-
var _el$
|
|
1046
|
-
_el$
|
|
1047
|
-
[_el$
|
|
1048
|
-
_el$
|
|
1049
|
-
[_el$
|
|
1050
|
-
_$insert(_el$
|
|
1062
|
+
var _el$70 = _$getNextElement(_tmpl$19),
|
|
1063
|
+
_el$71 = _el$70.firstChild,
|
|
1064
|
+
[_el$72, _co$19] = _$getNextMarker(_el$71.nextSibling),
|
|
1065
|
+
_el$73 = _el$72.nextSibling,
|
|
1066
|
+
[_el$74, _co$20] = _$getNextMarker(_el$73.nextSibling);
|
|
1067
|
+
_$insert(_el$70, _$createComponent(Show, {
|
|
1051
1068
|
get when() {
|
|
1052
1069
|
return badge().icon;
|
|
1053
1070
|
},
|
|
1054
1071
|
children: icon => (() => {
|
|
1055
|
-
var _el$
|
|
1056
|
-
_$effect(() => _$className(_el$
|
|
1057
|
-
return _el$
|
|
1072
|
+
var _el$75 = _$getNextElement(_tmpl$3);
|
|
1073
|
+
_$effect(() => _$className(_el$75, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1074
|
+
return _el$75;
|
|
1058
1075
|
})()
|
|
1059
|
-
}), _el$
|
|
1060
|
-
_$insert(_el$
|
|
1061
|
-
return _el$
|
|
1076
|
+
}), _el$72, _co$19);
|
|
1077
|
+
_$insert(_el$70, () => badge().label, _el$74, _co$20);
|
|
1078
|
+
return _el$70;
|
|
1062
1079
|
})()
|
|
1063
|
-
}), _el$
|
|
1064
|
-
_$insert(_el$
|
|
1080
|
+
}), _el$57, _co$14);
|
|
1081
|
+
_$insert(_el$58, _$createComponent(Show, {
|
|
1065
1082
|
get when() {
|
|
1066
1083
|
return eventStack().preview;
|
|
1067
1084
|
},
|
|
1068
1085
|
get children() {
|
|
1069
|
-
var _el$
|
|
1070
|
-
_$insert(_el$
|
|
1071
|
-
return _el$
|
|
1086
|
+
var _el$59 = _$getNextElement(_tmpl$16);
|
|
1087
|
+
_$insert(_el$59, () => props.events.find(event => event.id === eventStack().preview.id)?.title ?? calendarMessages().moveEvent);
|
|
1088
|
+
return _el$59;
|
|
1072
1089
|
}
|
|
1073
|
-
}), _el$
|
|
1074
|
-
_$insert(_el$
|
|
1090
|
+
}), _el$61, _co$15);
|
|
1091
|
+
_$insert(_el$58, _$createComponent(For, {
|
|
1075
1092
|
get each() {
|
|
1076
1093
|
return eventStack().visibleEvents;
|
|
1077
1094
|
},
|
|
@@ -1091,8 +1108,8 @@ const MonthPickerView = props => {
|
|
|
1091
1108
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, event, markDragged) : undefined;
|
|
1092
1109
|
}
|
|
1093
1110
|
})
|
|
1094
|
-
}), _el$
|
|
1095
|
-
_$insert(_el$
|
|
1111
|
+
}), _el$63, _co$16);
|
|
1112
|
+
_$insert(_el$58, _$createComponent(Show, {
|
|
1096
1113
|
get when() {
|
|
1097
1114
|
return eventStack().hiddenCount > 0;
|
|
1098
1115
|
},
|
|
@@ -1112,54 +1129,54 @@ const MonthPickerView = props => {
|
|
|
1112
1129
|
}
|
|
1113
1130
|
});
|
|
1114
1131
|
}
|
|
1115
|
-
}), _el$
|
|
1116
|
-
_$insert(_el$
|
|
1132
|
+
}), _el$65, _co$17);
|
|
1133
|
+
_$insert(_el$66, _$createComponent(For, {
|
|
1117
1134
|
get each() {
|
|
1118
1135
|
return events.slice(0, 4);
|
|
1119
1136
|
},
|
|
1120
1137
|
children: event => (() => {
|
|
1121
|
-
var _el$
|
|
1138
|
+
var _el$76 = _$getNextElement(_tmpl$20);
|
|
1122
1139
|
_$effect(_p$ => {
|
|
1123
1140
|
var _v$5 = event.colorHex ? undefined : event.color ?? "blue",
|
|
1124
1141
|
_v$6 = event.colorHex ? {
|
|
1125
1142
|
"background-color": event.colorHex
|
|
1126
1143
|
} : undefined;
|
|
1127
|
-
_v$5 !== _p$.e && _$setAttribute(_el$
|
|
1128
|
-
_p$.t = _$style(_el$
|
|
1144
|
+
_v$5 !== _p$.e && _$setAttribute(_el$76, "data-color", _p$.e = _v$5);
|
|
1145
|
+
_p$.t = _$style(_el$76, _v$6, _p$.t);
|
|
1129
1146
|
return _p$;
|
|
1130
1147
|
}, {
|
|
1131
1148
|
e: undefined,
|
|
1132
1149
|
t: undefined
|
|
1133
1150
|
});
|
|
1134
|
-
return _el$
|
|
1151
|
+
return _el$76;
|
|
1135
1152
|
})()
|
|
1136
1153
|
}));
|
|
1137
|
-
_$effect(() => _$setAttribute(_el$
|
|
1138
|
-
return _el$
|
|
1154
|
+
_$effect(() => _$setAttribute(_el$51, "data-drop-preview", movePreview()?.start && calendar.formatDateKey(movePreview().start, dateConfig()) === dayKey ? "true" : undefined));
|
|
1155
|
+
return _el$51;
|
|
1139
1156
|
})();
|
|
1140
1157
|
}
|
|
1141
|
-
}), _el$
|
|
1142
|
-
_$effect(() => _$setAttribute(_el$
|
|
1143
|
-
return _el$
|
|
1158
|
+
}), _el$50, _co$12);
|
|
1159
|
+
_$effect(() => _$setAttribute(_el$45, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
1160
|
+
return _el$45;
|
|
1144
1161
|
})()
|
|
1145
|
-
}), _el$
|
|
1162
|
+
}), _el$43, _co$10);
|
|
1146
1163
|
_$effect(_p$ => {
|
|
1147
1164
|
var _v$3 = `auto repeat(${weeks().length}, ${props.compact ? "minmax(2.75rem, auto)" : "minmax(5rem, 1fr)"})`,
|
|
1148
1165
|
_v$4 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
1149
|
-
_v$3 !== _p$.e && _$setStyleProperty(_el$
|
|
1150
|
-
_v$4 !== _p$.t && _$setAttribute(_el$
|
|
1166
|
+
_v$3 !== _p$.e && _$setStyleProperty(_el$35, "grid-template-rows", _p$.e = _v$3);
|
|
1167
|
+
_v$4 !== _p$.t && _$setAttribute(_el$36, "data-week-numbers", _p$.t = _v$4);
|
|
1151
1168
|
return _p$;
|
|
1152
1169
|
}, {
|
|
1153
1170
|
e: undefined,
|
|
1154
1171
|
t: undefined
|
|
1155
1172
|
});
|
|
1156
|
-
return _el$
|
|
1173
|
+
return _el$35;
|
|
1157
1174
|
})();
|
|
1158
1175
|
};
|
|
1159
1176
|
|
|
1160
1177
|
/** One entry of the month grid: its whole range, and the days it covers as `YYYY-MM-DD` keys. */
|
|
1161
1178
|
|
|
1162
|
-
/** What the calendar's controller
|
|
1179
|
+
/** What the calendar's controller and header ask of the month view; the rest serves the month that scrolls. */
|
|
1163
1180
|
|
|
1164
1181
|
/** Lane height and gap of the month entries, in rem; the stylesheet reads both from the grid's custom properties. */
|
|
1165
1182
|
const MONTH_LANE_REM = 1.25;
|
|
@@ -1219,9 +1236,13 @@ const PRINTABLE_KEY = /^.$/u;
|
|
|
1219
1236
|
const MonthView = props => {
|
|
1220
1237
|
const calendarMessages = useCalendarMessages();
|
|
1221
1238
|
const dateConfig = createMemo(() => ownerDateConfig(props.owner));
|
|
1239
|
+
const continuous = createMemo(() => Boolean(props.owner.range));
|
|
1240
|
+
const [mounted, setMounted] = createSignal(false);
|
|
1241
|
+
const hostMonthKey = () => calendar.formatDateKey(calendar.startOfMonth(props.date, dateConfig()), dateConfig());
|
|
1242
|
+
const [focusMonthKey, setFocusMonthKey] = createSignal(untrack(hostMonthKey));
|
|
1222
1243
|
// The shown month and its grid change only with the month, so a refresh of the same month keeps every cell and its
|
|
1223
1244
|
// focus.
|
|
1224
|
-
const month = createMemo(() => zonedYearMonth(props.date, dateConfig()), undefined, {
|
|
1245
|
+
const month = createMemo(() => zonedYearMonth(continuous() ? calendar.parseCalendarDate(focusMonthKey(), dateConfig()) : props.date, dateConfig()), undefined, {
|
|
1225
1246
|
equals: (previous, next) => previous.year === next.year && previous.month === next.month
|
|
1226
1247
|
});
|
|
1227
1248
|
const weeks = createMemo(() => calendar.getMonthGrid(month().year, month().month, dateConfig()).map(week => week.map(day => ({
|
|
@@ -1233,17 +1254,12 @@ const MonthView = props => {
|
|
|
1233
1254
|
const weekdays = createMemo(() => calendar.weekdays(dateConfig()));
|
|
1234
1255
|
const todayKey = createMemo(() => calendar.formatDateKey(props.now, dateConfig()));
|
|
1235
1256
|
const items = createMemo(() => monthItems(props.events));
|
|
1236
|
-
const weekLayouts = createMemo(() => weeks().map(week => layoutMonthWeek(week.map(entry => entry.key), items().map(item => ({
|
|
1237
|
-
item,
|
|
1238
|
-
firstKey: item.firstKey,
|
|
1239
|
-
lastKey: item.lastKey,
|
|
1240
|
-
bar: item.bar
|
|
1241
|
-
})))));
|
|
1242
1257
|
const [capacities, setCapacities] = createSignal([]);
|
|
1243
1258
|
const [cellWidth, setCellWidth] = createSignal(0);
|
|
1244
1259
|
const [barFont, setBarFont] = createSignal("");
|
|
1245
1260
|
const [anchorKey, setAnchorKey] = createSignal(null);
|
|
1246
1261
|
const [focusKey, setFocusKey] = createSignal(null);
|
|
1262
|
+
const [focusedCellKey, setFocusedCellKey] = createSignal(null);
|
|
1247
1263
|
const [popover, setPopover] = createSignal(null);
|
|
1248
1264
|
/** Whether the quick create holds the focus; until then the grid keeps it. */
|
|
1249
1265
|
const [createActive, setCreateActive] = createSignal(false);
|
|
@@ -1269,13 +1285,479 @@ const MonthView = props => {
|
|
|
1269
1285
|
end: calendar.addDays(parseKey(range.last), 1, dateConfig()),
|
|
1270
1286
|
allDay: true
|
|
1271
1287
|
});
|
|
1272
|
-
const
|
|
1288
|
+
const hostKey = () => calendar.formatDateKey(props.date, dateConfig());
|
|
1289
|
+
const loadedRange = createMemo(() => {
|
|
1290
|
+
const range = props.owner.range;
|
|
1291
|
+
const keyOf = value => calendar.formatDateKey(parseDate(value, dateConfig()), dateConfig());
|
|
1292
|
+
return range ? {
|
|
1293
|
+
first: keyOf(range.from),
|
|
1294
|
+
to: keyOf(range.to)
|
|
1295
|
+
} : {
|
|
1296
|
+
first: hostMonthKey(),
|
|
1297
|
+
to: hostMonthKey()
|
|
1298
|
+
};
|
|
1299
|
+
});
|
|
1300
|
+
const loadedWeeks = createMemo(() => monthWeekKeys(loadedRange().first, loadedRange().to, dateConfig().firstDayOfWeek ?? 1));
|
|
1301
|
+
const loaded = key => key >= loadedRange().first && key < loadedRange().to;
|
|
1302
|
+
// The first paint starts at the month's first week. Mount adds the earlier weeks and positions synchronously.
|
|
1303
|
+
const trackWeeks = createMemo(() => {
|
|
1304
|
+
const all = loadedWeeks();
|
|
1305
|
+
const anchor = monthRowOf(all, hostMonthKey());
|
|
1306
|
+
return mounted() || anchor === undefined ? all : all.slice(anchor);
|
|
1307
|
+
});
|
|
1308
|
+
const [scrollTop, setScrollTop] = createSignal(0);
|
|
1309
|
+
const [rowHeight, setRowHeight] = createSignal(80);
|
|
1310
|
+
const [viewHeight, setViewHeight] = createSignal(400);
|
|
1311
|
+
const [labelShown, setLabelShown] = createSignal(false);
|
|
1312
|
+
const [pulseKey, setPulseKey] = createSignal("");
|
|
1313
|
+
let scroller;
|
|
1314
|
+
let weekdayElement;
|
|
1315
|
+
let ready = false;
|
|
1316
|
+
let positioned = false;
|
|
1317
|
+
let silentTop = null;
|
|
1318
|
+
let frame = 0;
|
|
1319
|
+
let labelTimer = 0;
|
|
1320
|
+
let reportTimer = 0;
|
|
1321
|
+
let queueTimer = 0;
|
|
1322
|
+
let glideTimer = 0;
|
|
1323
|
+
let arrivalTimer = 0;
|
|
1324
|
+
let pulseTimer = 0;
|
|
1325
|
+
/** The month that quick repeated steps head for; the next step and the arrows' links go on from it. */
|
|
1326
|
+
const [queuedMonth, setQueuedMonth] = createSignal(null);
|
|
1327
|
+
let pendingTarget = null;
|
|
1328
|
+
let pendingOrigin = null;
|
|
1329
|
+
let glideTarget = null;
|
|
1330
|
+
let pulseOnArrival = false;
|
|
1331
|
+
let reported = "";
|
|
1332
|
+
let reportedFocus = "";
|
|
1333
|
+
let askedEarlier = "";
|
|
1334
|
+
let askedLater = "";
|
|
1335
|
+
let exhaustedEarlier = "";
|
|
1336
|
+
let exhaustedLater = "";
|
|
1337
|
+
const scrollFocusDay = createMemo(() => {
|
|
1338
|
+
const first = focusMonthKey();
|
|
1339
|
+
const range = selection();
|
|
1340
|
+
const selected = range && range.last >= first ? range.first > first ? range.first : first : null;
|
|
1341
|
+
if (selected?.slice(0, 7) === first.slice(0, 7)) return selected;
|
|
1342
|
+
if (hostKey().slice(0, 7) === first.slice(0, 7)) return hostKey();
|
|
1343
|
+
return todayKey().slice(0, 7) === first.slice(0, 7) ? todayKey() : first;
|
|
1344
|
+
});
|
|
1345
|
+
const visibleRange = createMemo(() => {
|
|
1346
|
+
const weeks = trackWeeks();
|
|
1347
|
+
const rows = monthVisibleRows(scrollTop(), viewHeight(), rowHeight(), weeks.length);
|
|
1348
|
+
const first = weeks[rows.first] ?? focusMonthKey();
|
|
1349
|
+
return {
|
|
1350
|
+
first,
|
|
1351
|
+
last: addDayKeys(weeks[Math.max(rows.first, rows.end - 1)] ?? first, 6)
|
|
1352
|
+
};
|
|
1353
|
+
});
|
|
1354
|
+
const renderWindow = createMemo(() => mounted() ? monthRenderWindow(scrollTop(), viewHeight(), rowHeight(), trackWeeks().length) : {
|
|
1355
|
+
first: 0,
|
|
1356
|
+
end: Math.min(trackWeeks().length, MONTH_ROW_BLOCK * 2)
|
|
1357
|
+
}, undefined, {
|
|
1358
|
+
equals: (left, right) => left.first === right.first && left.end === right.end
|
|
1359
|
+
});
|
|
1360
|
+
/** The window's weeks, and those of the focused day, the selection's moving end, and an open popover's day. */
|
|
1361
|
+
const renderedWeeks = createMemo(() => {
|
|
1362
|
+
const weeks = trackWeeks();
|
|
1363
|
+
const window = renderWindow();
|
|
1364
|
+
const keys = new Set(weeks.slice(window.first, window.end));
|
|
1365
|
+
for (const key of [focusKey(), focusedCellKey(), popover()?.anchor.dataset.calendarDayKey]) {
|
|
1366
|
+
const row = key ? monthRowOf(weeks, key) : undefined;
|
|
1367
|
+
if (row !== undefined) keys.add(weeks[row]);
|
|
1368
|
+
}
|
|
1369
|
+
return [...keys].sort();
|
|
1370
|
+
});
|
|
1371
|
+
// Rows keep their elements, but the list moves a kept row when the window passes it, and a browser drops the focus
|
|
1372
|
+
// from an element that moves. The focused element takes it back once the rows are in place.
|
|
1373
|
+
let refocus = null;
|
|
1374
|
+
createComputed(on(renderedWeeks, () => {
|
|
1375
|
+
const active = typeof document === "undefined" ? null : document.activeElement;
|
|
1376
|
+
refocus = active && scroller?.contains(active) ? active : null;
|
|
1377
|
+
}, {
|
|
1378
|
+
defer: true
|
|
1379
|
+
}));
|
|
1380
|
+
createEffect(on(renderedWeeks, () => {
|
|
1381
|
+
const element = refocus;
|
|
1382
|
+
refocus = null;
|
|
1383
|
+
if (element instanceof HTMLElement && element.isConnected && document.activeElement !== element) element.focus({
|
|
1384
|
+
preventScroll: true
|
|
1385
|
+
});
|
|
1386
|
+
}, {
|
|
1387
|
+
defer: true
|
|
1388
|
+
}));
|
|
1389
|
+
const placeOfToday = () => {
|
|
1390
|
+
const weeks = trackWeeks();
|
|
1391
|
+
const row = monthRowOf(weeks, todayKey());
|
|
1392
|
+
return row === undefined ? todayKey() < (weeks[0] ?? focusMonthKey()) ? "up" : "down" : monthTodayDirection(row, scrollTop(), viewHeight(), rowHeight());
|
|
1393
|
+
};
|
|
1394
|
+
const measureScroll = () => {
|
|
1395
|
+
if (!scroller) return;
|
|
1396
|
+
const row = scroller.querySelector(".k2b-calendar-month__week");
|
|
1397
|
+
const height = row?.getBoundingClientRect().height;
|
|
1398
|
+
if (height && height > 0) setRowHeight(height);
|
|
1399
|
+
setViewHeight(Math.max(0, scroller.clientHeight - (weekdayElement?.getBoundingClientRect().height ?? 0)));
|
|
1400
|
+
};
|
|
1401
|
+
const loadMore = edge => {
|
|
1402
|
+
if (!ready) return;
|
|
1403
|
+
const range = loadedRange();
|
|
1404
|
+
const asked = edge === "earlier" ? range.first : range.to;
|
|
1405
|
+
const loader = edge === "earlier" ? props.owner.onLoadEarlier : props.owner.onLoadLater;
|
|
1406
|
+
if (!loader || (edge === "earlier" ? askedEarlier === asked || exhaustedEarlier === asked : askedLater === asked || exhaustedLater === asked)) return;
|
|
1407
|
+
if (edge === "earlier") askedEarlier = asked;else askedLater = asked;
|
|
1408
|
+
const result = loader();
|
|
1409
|
+
if (result !== null && (typeof result === "object" || typeof result === "function") && "then" in result && typeof result.then === "function") {
|
|
1410
|
+
const settled = () => {
|
|
1411
|
+
if (!ready || (edge === "earlier" ? loadedRange().first : loadedRange().to) !== asked) return;
|
|
1412
|
+
if (edge === "earlier") exhaustedEarlier = asked;else exhaustedLater = asked;
|
|
1413
|
+
const target = pendingOrigin === (edge === "earlier" ? -1 : 1) ? pendingTarget : null;
|
|
1414
|
+
if (target) {
|
|
1415
|
+
pendingTarget = null;
|
|
1416
|
+
pendingOrigin = null;
|
|
1417
|
+
setQueuedMonth(null);
|
|
1418
|
+
window.clearTimeout(queueTimer);
|
|
1419
|
+
}
|
|
1420
|
+
if (edge === "later" && glideTarget?.expires === Number.POSITIVE_INFINITY) {
|
|
1421
|
+
glideTarget = null;
|
|
1422
|
+
pulseOnArrival = false;
|
|
1423
|
+
setQueuedMonth(null);
|
|
1424
|
+
for (const timer of [queueTimer, glideTimer, arrivalTimer]) window.clearTimeout(timer);
|
|
1425
|
+
readScroll();
|
|
1426
|
+
}
|
|
1427
|
+
if (target) props.goToDate?.(parseKey(target));
|
|
1428
|
+
};
|
|
1429
|
+
void Promise.resolve(result).then(settled, settled);
|
|
1430
|
+
}
|
|
1431
|
+
};
|
|
1432
|
+
/** Asks for more weeks near either end; weeks inserted above a running glide would move its way, so it waits. */
|
|
1433
|
+
const loadNearEdges = () => {
|
|
1434
|
+
if (!scroller) return;
|
|
1435
|
+
if (!glideTarget && scroller.scrollTop < MONTH_ROWS_IN_VIEW * rowHeight()) loadMore("earlier");
|
|
1436
|
+
if (scroller.scrollTop + viewHeight() > (trackWeeks().length - MONTH_ROWS_IN_VIEW * 2) * rowHeight()) loadMore("later");
|
|
1437
|
+
};
|
|
1438
|
+
const reportVisible = () => {
|
|
1439
|
+
if (!ready) return;
|
|
1440
|
+
const {
|
|
1441
|
+
first,
|
|
1442
|
+
last
|
|
1443
|
+
} = untrack(visibleRange);
|
|
1444
|
+
const focus = untrack(scrollFocusDay);
|
|
1445
|
+
const value = `${first}/${last}/${focus}`;
|
|
1446
|
+
if (reported === value) return;
|
|
1447
|
+
reported = value;
|
|
1448
|
+
window.clearTimeout(reportTimer);
|
|
1449
|
+
reportTimer = window.setTimeout(() => {
|
|
1450
|
+
reportedFocus = focus;
|
|
1451
|
+
props.owner.onVisibleDateChange?.(parseKey(first), parseKey(last), parseKey(focus));
|
|
1452
|
+
}, 250);
|
|
1453
|
+
};
|
|
1454
|
+
const keepLabel = () => {
|
|
1455
|
+
window.clearTimeout(labelTimer);
|
|
1456
|
+
labelTimer = window.setTimeout(() => setLabelShown(false), 650);
|
|
1457
|
+
};
|
|
1458
|
+
const readScroll = (showLabel = true) => {
|
|
1459
|
+
if (!scroller) return;
|
|
1460
|
+
const top = scroller.scrollTop;
|
|
1461
|
+
setScrollTop(top);
|
|
1462
|
+
const weeks = trackWeeks();
|
|
1463
|
+
const week = weeks[monthFocusRow(top, viewHeight(), rowHeight(), weeks.length)];
|
|
1464
|
+
if (week) {
|
|
1465
|
+
const next = monthOfWeek(week);
|
|
1466
|
+
if (next !== untrack(focusMonthKey)) {
|
|
1467
|
+
setFocusMonthKey(next);
|
|
1468
|
+
if (showLabel && ready) {
|
|
1469
|
+
setLabelShown(true);
|
|
1470
|
+
keepLabel();
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
reportVisible();
|
|
1475
|
+
};
|
|
1476
|
+
const pulseToday = () => {
|
|
1477
|
+
if (reducedMotion()) return;
|
|
1478
|
+
setPulseKey(todayKey());
|
|
1479
|
+
window.clearTimeout(pulseTimer);
|
|
1480
|
+
pulseTimer = window.setTimeout(() => setPulseKey(""), 1000);
|
|
1481
|
+
};
|
|
1482
|
+
const finishGlide = () => {
|
|
1483
|
+
if (!scroller) return;
|
|
1484
|
+
const target = glideTarget;
|
|
1485
|
+
const row = target ? monthRowOf(trackWeeks(), target.week) : undefined;
|
|
1486
|
+
// A clamped glide may still be waiting for more weeks below; scrollend is not arrival then.
|
|
1487
|
+
if (target && row !== undefined && Math.abs(scroller.scrollTop - (row * rowHeight() + target.offset)) > 1) return;
|
|
1488
|
+
glideTarget = null;
|
|
1489
|
+
if (pendingOrigin !== -1 && pendingOrigin !== 1) {
|
|
1490
|
+
setQueuedMonth(null);
|
|
1491
|
+
window.clearTimeout(queueTimer);
|
|
1492
|
+
}
|
|
1493
|
+
window.clearTimeout(glideTimer);
|
|
1494
|
+
window.clearTimeout(arrivalTimer);
|
|
1495
|
+
readScroll();
|
|
1496
|
+
// A glide that lands near an end asks for the next weeks there, as the reader's own scrolling does.
|
|
1497
|
+
if (target) loadNearEdges();
|
|
1498
|
+
if (pulseOnArrival) {
|
|
1499
|
+
pulseOnArrival = false;
|
|
1500
|
+
pulseToday();
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
const cancelGlide = () => {
|
|
1504
|
+
if (!scroller) return;
|
|
1505
|
+
if (pendingOrigin === -1 || pendingOrigin === 1) {
|
|
1506
|
+
pendingTarget = null;
|
|
1507
|
+
pendingOrigin = null;
|
|
1508
|
+
setQueuedMonth(null);
|
|
1509
|
+
window.clearTimeout(queueTimer);
|
|
1510
|
+
}
|
|
1511
|
+
if (!glideTarget) return;
|
|
1512
|
+
// A reader's wheel or touch takes over from navigation, including any target waiting for more weeks.
|
|
1513
|
+
glideTarget = null;
|
|
1514
|
+
pulseOnArrival = false;
|
|
1515
|
+
setQueuedMonth(null);
|
|
1516
|
+
for (const timer of [queueTimer, glideTimer, arrivalTimer]) window.clearTimeout(timer);
|
|
1517
|
+
scroller.scrollTo({
|
|
1518
|
+
top: scroller.scrollTop,
|
|
1519
|
+
behavior: "instant"
|
|
1520
|
+
});
|
|
1521
|
+
};
|
|
1522
|
+
const issueGlide = (top, smooth) => {
|
|
1523
|
+
if (!scroller) return;
|
|
1524
|
+
const maximum = Math.max(0, scroller.scrollHeight - scroller.clientHeight);
|
|
1525
|
+
const target = Math.max(0, Math.min(top, maximum));
|
|
1526
|
+
if (smooth && !reducedMotion() && Math.abs(target - scroller.scrollTop) > viewHeight() * 3) {
|
|
1527
|
+
scroller.scrollTop = target - Math.sign(target - scroller.scrollTop) * viewHeight();
|
|
1528
|
+
readScroll();
|
|
1529
|
+
}
|
|
1530
|
+
scroller.scrollTo({
|
|
1531
|
+
top: target,
|
|
1532
|
+
behavior: smooth && !reducedMotion() ? "smooth" : "instant"
|
|
1533
|
+
});
|
|
1534
|
+
if (top > maximum + 1) loadMore("later");
|
|
1535
|
+
if (!smooth || reducedMotion()) {
|
|
1536
|
+
readScroll();
|
|
1537
|
+
finishGlide();
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
const glide = (top, smooth = true) => {
|
|
1541
|
+
if (!scroller) return;
|
|
1542
|
+
const row = Math.max(0, Math.min(trackWeeks().length - 1, Math.floor(top / rowHeight())));
|
|
1543
|
+
const week = trackWeeks()[row];
|
|
1544
|
+
if (!week) return;
|
|
1545
|
+
// A target past the loaded weeks waits for them however long they take; the reader's own scrolling ends the wait.
|
|
1546
|
+
const waiting = top > scroller.scrollHeight - scroller.clientHeight + 1;
|
|
1547
|
+
glideTarget = {
|
|
1548
|
+
week,
|
|
1549
|
+
offset: top - row * rowHeight(),
|
|
1550
|
+
expires: waiting ? Number.POSITIVE_INFINITY : performance.now() + 1600
|
|
1551
|
+
};
|
|
1552
|
+
window.clearTimeout(glideTimer);
|
|
1553
|
+
window.clearTimeout(arrivalTimer);
|
|
1554
|
+
if (!waiting) glideTimer = window.setTimeout(() => {
|
|
1555
|
+
glideTarget = null;
|
|
1556
|
+
pulseOnArrival = false;
|
|
1557
|
+
}, 1600);
|
|
1558
|
+
arrivalTimer = window.setTimeout(finishGlide, 900);
|
|
1559
|
+
issueGlide(top, smooth);
|
|
1560
|
+
};
|
|
1561
|
+
const positionMonth = (key, smooth = true, reveal = false) => {
|
|
1562
|
+
if (!continuous() || !loaded(key) || !scroller) return false;
|
|
1563
|
+
const weeks = trackWeeks();
|
|
1564
|
+
const first = monthRowOf(weeks, `${key.slice(0, 7)}-01`);
|
|
1565
|
+
const row = monthRowOf(weeks, key);
|
|
1566
|
+
if (first === undefined || row === undefined) return false;
|
|
1567
|
+
const top = first * rowHeight();
|
|
1568
|
+
glide(reveal ? monthRevealTop(row, top, viewHeight(), rowHeight()) ?? top : top, smooth);
|
|
1569
|
+
return true;
|
|
1570
|
+
};
|
|
1571
|
+
const goToMonth = key => positionMonth(key, true, true);
|
|
1572
|
+
const stepMonth = direction => {
|
|
1573
|
+
if (!continuous() || !scroller) return false;
|
|
1574
|
+
const target = calendar.formatDateKey(calendar.addMonths(parseKey(queuedMonth() ?? focusMonthKey()), direction, dateConfig()), dateConfig());
|
|
1575
|
+
if (loaded(target)) {
|
|
1576
|
+
pendingTarget = null;
|
|
1577
|
+
pendingOrigin = null;
|
|
1578
|
+
if (!positionMonth(target)) return false;
|
|
1579
|
+
} else {
|
|
1580
|
+
// A month past the loaded weeks asks for them and waits; an end the host has reached goes through its navigation.
|
|
1581
|
+
const range = loadedRange();
|
|
1582
|
+
const later = direction === 1;
|
|
1583
|
+
const edge = later ? range.to : range.first;
|
|
1584
|
+
if (!(later ? props.owner.onLoadLater : props.owner.onLoadEarlier) || (later ? exhaustedLater : exhaustedEarlier) === edge) return false;
|
|
1585
|
+
pendingTarget = target;
|
|
1586
|
+
pendingOrigin = direction;
|
|
1587
|
+
loadMore(later ? "later" : "earlier");
|
|
1588
|
+
}
|
|
1589
|
+
// Instant positioning may finish during positionMonth; queue afterwards so rapid clicks still accumulate.
|
|
1590
|
+
setQueuedMonth(target);
|
|
1591
|
+
window.clearTimeout(queueTimer);
|
|
1592
|
+
// A glide that waits for more weeks keeps its month queued until it arrives or the reader scrolls.
|
|
1593
|
+
queueTimer = window.setTimeout(() => {
|
|
1594
|
+
if (pendingOrigin !== -1 && pendingOrigin !== 1 && glideTarget?.expires !== Number.POSITIVE_INFINITY) setQueuedMonth(null);
|
|
1595
|
+
}, 1200);
|
|
1596
|
+
return true;
|
|
1597
|
+
};
|
|
1598
|
+
const goToday = () => {
|
|
1599
|
+
if (!continuous() || !loaded(todayKey()) || !scroller) return false;
|
|
1600
|
+
pulseOnArrival = !reducedMotion();
|
|
1601
|
+
if (positionMonth(todayKey(), true, true)) return true;
|
|
1602
|
+
pulseOnArrival = false;
|
|
1603
|
+
return false;
|
|
1604
|
+
};
|
|
1605
|
+
const revealDay = key => {
|
|
1606
|
+
const row = monthRowOf(trackWeeks(), key);
|
|
1607
|
+
if (row === undefined || !scroller) return;
|
|
1608
|
+
const top = monthRevealTop(row, scroller.scrollTop, viewHeight(), rowHeight());
|
|
1609
|
+
if (top !== undefined) glide(top);
|
|
1610
|
+
};
|
|
1611
|
+
const onScroll = () => {
|
|
1612
|
+
if (!ready || !scroller) return;
|
|
1613
|
+
// Initial positioning and range rebasing are not the reader asking for more weeks.
|
|
1614
|
+
if (silentTop !== null && Math.abs(scroller.scrollTop - silentTop) < 1) return;
|
|
1615
|
+
silentTop = null;
|
|
1616
|
+
if (untrack(labelShown)) keepLabel();
|
|
1617
|
+
if (!frame) frame = requestAnimationFrame(() => {
|
|
1618
|
+
frame = 0;
|
|
1619
|
+
readScroll();
|
|
1620
|
+
if (!scroller) return;
|
|
1621
|
+
loadNearEdges();
|
|
1622
|
+
});
|
|
1623
|
+
};
|
|
1624
|
+
// Capture the old track before render effects change its height, then restore the same week and pixel below.
|
|
1625
|
+
let previousWeeks = [];
|
|
1626
|
+
let savedAnchor = null;
|
|
1627
|
+
createComputed(on(loadedWeeks, weeks => {
|
|
1628
|
+
if (!untrack(mounted) || !scroller) return;
|
|
1629
|
+
const top = scroller.scrollTop;
|
|
1630
|
+
const row = Math.floor(top / untrack(rowHeight));
|
|
1631
|
+
const week = previousWeeks[row];
|
|
1632
|
+
savedAnchor = week ? {
|
|
1633
|
+
week,
|
|
1634
|
+
delta: top - row * untrack(rowHeight)
|
|
1635
|
+
} : null;
|
|
1636
|
+
const next = week ? monthRowOf(weeks, week) : undefined;
|
|
1637
|
+
// Move the render window before DOM updates, so even a larger rebase retains the visible rows' elements.
|
|
1638
|
+
if (next !== undefined && savedAnchor) setScrollTop(next * untrack(rowHeight) + savedAnchor.delta);
|
|
1639
|
+
}, {
|
|
1640
|
+
defer: true
|
|
1641
|
+
}));
|
|
1642
|
+
createEffect(on(loadedWeeks, () => {
|
|
1643
|
+
if (!untrack(mounted) || !scroller) return;
|
|
1644
|
+
measureScroll();
|
|
1645
|
+
previousWeeks = untrack(trackWeeks);
|
|
1646
|
+
const row = savedAnchor ? monthRowOf(previousWeeks, savedAnchor.week) : undefined;
|
|
1647
|
+
const top = row !== undefined && savedAnchor ? row * untrack(rowHeight) + savedAnchor.delta : scroller.scrollTop;
|
|
1648
|
+
// Weeks added below move nothing, and writing the same position would stop a glide on its way.
|
|
1649
|
+
const moved = Math.abs(scroller.scrollTop - top) >= 1;
|
|
1650
|
+
if (moved) scroller.scrollTop = top;
|
|
1651
|
+
if (pendingTarget && loaded(pendingTarget)) {
|
|
1652
|
+
const key = pendingTarget;
|
|
1653
|
+
pendingTarget = null;
|
|
1654
|
+
pendingOrigin = null;
|
|
1655
|
+
positioned = positionMonth(key, positioned) || positioned;
|
|
1656
|
+
if (pendingKey === key) {
|
|
1657
|
+
pendingKey = null;
|
|
1658
|
+
select(key);
|
|
1659
|
+
queueMicrotask(() => focusCell(key));
|
|
1660
|
+
}
|
|
1661
|
+
} else {
|
|
1662
|
+
if (pendingTarget && (pendingOrigin === -1 || pendingOrigin === 1)) loadMore(pendingOrigin === -1 ? "earlier" : "later");
|
|
1663
|
+
// A glide goes on after the weeks above moved it, and one that waited at the end goes on into the new weeks.
|
|
1664
|
+
if (glideTarget && performance.now() < glideTarget.expires && (moved || glideTarget.expires === Number.POSITIVE_INFINITY)) {
|
|
1665
|
+
const target = monthRowOf(previousWeeks, glideTarget.week);
|
|
1666
|
+
if (target !== undefined) issueGlide(target * untrack(rowHeight) + glideTarget.offset, true);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
savedAnchor = null;
|
|
1670
|
+
silentTop = scroller.scrollTop;
|
|
1671
|
+
readScroll(false);
|
|
1672
|
+
}, {
|
|
1673
|
+
defer: true
|
|
1674
|
+
}));
|
|
1675
|
+
createEffect(on(hostKey, key => {
|
|
1676
|
+
if (!continuous() || !untrack(mounted) || !scroller) return;
|
|
1677
|
+
if (key === reportedFocus) {
|
|
1678
|
+
if (pendingOrigin === "host") {
|
|
1679
|
+
pendingTarget = null;
|
|
1680
|
+
pendingOrigin = null;
|
|
1681
|
+
}
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
pendingTarget = loaded(key) ? null : key;
|
|
1685
|
+
pendingOrigin = pendingTarget ? "host" : null;
|
|
1686
|
+
if (pendingTarget) return;
|
|
1687
|
+
const visible = untrack(visibleRange);
|
|
1688
|
+
if (key.slice(0, 7) !== untrack(focusMonthKey).slice(0, 7) || key < visible.first || key > visible.last) positionMonth(key);
|
|
1689
|
+
if (pendingKey === key) {
|
|
1690
|
+
pendingKey = null;
|
|
1691
|
+
select(key);
|
|
1692
|
+
queueMicrotask(() => focusCell(key));
|
|
1693
|
+
}
|
|
1694
|
+
}, {
|
|
1695
|
+
defer: true
|
|
1696
|
+
}));
|
|
1697
|
+
createEffect(on(scrollFocusDay, () => {
|
|
1698
|
+
if (continuous()) reportVisible();
|
|
1699
|
+
}, {
|
|
1700
|
+
defer: true
|
|
1701
|
+
}));
|
|
1702
|
+
// The scrolling starts once the grid is on the page, also when a host passes `range` only later.
|
|
1703
|
+
createEffect(on(continuous, active => {
|
|
1704
|
+
if (!active || !scroller) return;
|
|
1705
|
+
setMounted(true);
|
|
1706
|
+
measureScroll();
|
|
1707
|
+
previousWeeks = trackWeeks();
|
|
1708
|
+
const row = monthRowOf(previousWeeks, hostMonthKey());
|
|
1709
|
+
if (row !== undefined && loaded(hostKey())) scroller.scrollTop = row * rowHeight();
|
|
1710
|
+
// Too few weeks below the month, such as the days of another view while the month's own load, cannot put its
|
|
1711
|
+
// first week on top yet; the month goes there once its weeks arrive.
|
|
1712
|
+
positioned = row !== undefined && Math.abs(scroller.scrollTop - row * rowHeight()) < 1;
|
|
1713
|
+
if (!positioned) {
|
|
1714
|
+
pendingTarget = hostKey();
|
|
1715
|
+
pendingOrigin = "mount";
|
|
1716
|
+
}
|
|
1717
|
+
readScroll(false);
|
|
1718
|
+
silentTop = scroller.scrollTop;
|
|
1719
|
+
ready = true;
|
|
1720
|
+
reportVisible();
|
|
1721
|
+
scroller.addEventListener("scrollend", finishGlide);
|
|
1722
|
+
const resize = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(() => {
|
|
1723
|
+
if (!scroller) return;
|
|
1724
|
+
const height = untrack(rowHeight);
|
|
1725
|
+
const position = scroller.scrollTop / height;
|
|
1726
|
+
measureScroll();
|
|
1727
|
+
if (height !== untrack(rowHeight)) {
|
|
1728
|
+
scroller.scrollTop = position * untrack(rowHeight);
|
|
1729
|
+
if (glideTarget) {
|
|
1730
|
+
const target = monthRowOf(untrack(trackWeeks), glideTarget.week);
|
|
1731
|
+
if (target !== undefined) issueGlide(target * untrack(rowHeight) + glideTarget.offset, true);
|
|
1732
|
+
}
|
|
1733
|
+
silentTop = scroller.scrollTop;
|
|
1734
|
+
}
|
|
1735
|
+
readScroll(false);
|
|
1736
|
+
});
|
|
1737
|
+
resize?.observe(scroller);
|
|
1738
|
+
const element = scroller;
|
|
1739
|
+
onCleanup(() => {
|
|
1740
|
+
resize?.disconnect();
|
|
1741
|
+
element.removeEventListener("scrollend", finishGlide);
|
|
1742
|
+
for (const timer of [labelTimer, reportTimer, queueTimer, glideTimer, arrivalTimer, pulseTimer]) window.clearTimeout(timer);
|
|
1743
|
+
if (frame) cancelAnimationFrame(frame);
|
|
1744
|
+
frame = 0;
|
|
1745
|
+
ready = false;
|
|
1746
|
+
setMounted(false);
|
|
1747
|
+
});
|
|
1748
|
+
}));
|
|
1749
|
+
const visibleKeys = createMemo(() => continuous() ? renderedWeeks().flatMap(key => Array.from({
|
|
1750
|
+
length: 7
|
|
1751
|
+
}, (_, day) => addDayKeys(key, day))) : weeks().flatMap(week => week.map(entry => entry.key)));
|
|
1273
1752
|
const rovingKey = createMemo(() => {
|
|
1274
1753
|
const keys = visibleKeys();
|
|
1275
|
-
const focus = focusKey();
|
|
1754
|
+
const focus = focusKey() ?? (continuous() ? focusedCellKey() : null);
|
|
1276
1755
|
if (focus && keys.includes(focus)) return focus;
|
|
1277
|
-
if (keys.includes(todayKey())) return todayKey();
|
|
1278
|
-
|
|
1756
|
+
if (keys.includes(todayKey()) && (!continuous() || todayKey() >= visibleRange().first && todayKey() <= visibleRange().last)) return todayKey();
|
|
1757
|
+
const first = calendar.formatDateKey(zonedMonthDate(month().year, month().month, dateConfig()), dateConfig());
|
|
1758
|
+
if (!continuous() || keys.includes(first)) return first;
|
|
1759
|
+
const visible = visibleRange();
|
|
1760
|
+
return keys.find(key => key.slice(0, 7) === first.slice(0, 7) && key >= visible.first && key <= visible.last) ?? keys.find(key => key >= visible.first && key <= visible.last) ?? keys[0] ?? first;
|
|
1279
1761
|
});
|
|
1280
1762
|
const dropRange = createMemo(() => {
|
|
1281
1763
|
const preview = movePreview();
|
|
@@ -1300,8 +1782,7 @@ const MonthView = props => {
|
|
|
1300
1782
|
setAnchorKey(anchor);
|
|
1301
1783
|
setFocusKey(focus);
|
|
1302
1784
|
};
|
|
1303
|
-
//
|
|
1304
|
-
// goes with the view, so switching to another view reports that nothing is selected.
|
|
1785
|
+
// Selection survives scrolling; only paging starts a month without it. Switching views clears the host's selection.
|
|
1305
1786
|
createEffect(on(selection, range => props.owner.onSelectionChange?.(range ? rangeOf(range) : null), {
|
|
1306
1787
|
defer: true
|
|
1307
1788
|
}));
|
|
@@ -1310,6 +1791,7 @@ const MonthView = props => {
|
|
|
1310
1791
|
});
|
|
1311
1792
|
createEffect(on(selection, range => props.onFocusDay?.(range ? parseKey(range.first) : null)));
|
|
1312
1793
|
createEffect(on(month, () => {
|
|
1794
|
+
if (continuous()) return;
|
|
1313
1795
|
setPopover(null);
|
|
1314
1796
|
const key = pendingKey;
|
|
1315
1797
|
pendingKey = null;
|
|
@@ -1433,6 +1915,11 @@ const MonthView = props => {
|
|
|
1433
1915
|
popoverFocusable()?.focus();
|
|
1434
1916
|
return true;
|
|
1435
1917
|
};
|
|
1918
|
+
/**
|
|
1919
|
+
* The day to create on without a selection. The month that scrolls takes the day it stands for, today or the 1st of
|
|
1920
|
+
* the month in focus, never a day the keyboard last visited in another month.
|
|
1921
|
+
*/
|
|
1922
|
+
const unselectedKey = () => continuous() ? scrollFocusDay() : rovingKey();
|
|
1436
1923
|
/** Enter, a double-click, and N create on the selection, with the quick create or the host's own create action. */
|
|
1437
1924
|
const createOnSelection = () => {
|
|
1438
1925
|
const range = selection();
|
|
@@ -1445,8 +1932,8 @@ const MonthView = props => {
|
|
|
1445
1932
|
onMount(() => props.register?.({
|
|
1446
1933
|
quickCreate: create => {
|
|
1447
1934
|
const range = selection() ?? {
|
|
1448
|
-
first:
|
|
1449
|
-
last:
|
|
1935
|
+
first: unselectedKey(),
|
|
1936
|
+
last: unselectedKey()
|
|
1450
1937
|
};
|
|
1451
1938
|
select(range.first, range.last);
|
|
1452
1939
|
if (!openCreate(range, {
|
|
@@ -1455,10 +1942,18 @@ const MonthView = props => {
|
|
|
1455
1942
|
})) props.owner.onSlotActivate?.(rangeOf(range));
|
|
1456
1943
|
},
|
|
1457
1944
|
createTarget: () => rangeOf(selection() ?? {
|
|
1458
|
-
first:
|
|
1459
|
-
last:
|
|
1945
|
+
first: unselectedKey(),
|
|
1946
|
+
last: unselectedKey()
|
|
1460
1947
|
}),
|
|
1461
|
-
typing: () => popover()?.kind === "create" && !createActive()
|
|
1948
|
+
typing: () => popover()?.kind === "create" && !createActive(),
|
|
1949
|
+
continuous,
|
|
1950
|
+
focusMonth: () => parseKey(focusMonthKey()),
|
|
1951
|
+
stepFrom: () => parseKey(queuedMonth() ?? focusMonthKey()),
|
|
1952
|
+
focusDay: () => parseKey(scrollFocusDay()),
|
|
1953
|
+
step: stepMonth,
|
|
1954
|
+
goTo: goToMonth,
|
|
1955
|
+
today: goToday,
|
|
1956
|
+
todayDirection: placeOfToday
|
|
1462
1957
|
}));
|
|
1463
1958
|
onCleanup(() => props.register?.(null));
|
|
1464
1959
|
const openDayList = key => {
|
|
@@ -1493,12 +1988,15 @@ const MonthView = props => {
|
|
|
1493
1988
|
}
|
|
1494
1989
|
};
|
|
1495
1990
|
const moveFocus = (key, extend) => {
|
|
1496
|
-
if (!visibleKeys().includes(key)) {
|
|
1991
|
+
if (continuous() ? !loaded(key) : !visibleKeys().includes(key)) {
|
|
1497
1992
|
pageTo(key);
|
|
1498
1993
|
return;
|
|
1499
1994
|
}
|
|
1500
1995
|
if (extend) select(anchorKey() ?? focusKey() ?? key, key);else select(key);
|
|
1501
|
-
|
|
1996
|
+
if (continuous()) {
|
|
1997
|
+
revealDay(key);
|
|
1998
|
+
queueMicrotask(() => focusCell(key));
|
|
1999
|
+
} else focusCell(key);
|
|
1502
2000
|
followSelection();
|
|
1503
2001
|
};
|
|
1504
2002
|
const onCellKeyDown = (event, key) => {
|
|
@@ -1527,7 +2025,12 @@ const MonthView = props => {
|
|
|
1527
2025
|
}
|
|
1528
2026
|
if (event.key === "PageUp" || event.key === "PageDown") {
|
|
1529
2027
|
event.preventDefault();
|
|
1530
|
-
|
|
2028
|
+
const target = calendar.formatDateKey(addMonthsClamped(day, event.key === "PageUp" ? -1 : 1, dateConfig()), dateConfig());
|
|
2029
|
+
if (continuous() && loaded(target)) {
|
|
2030
|
+
moveFocus(target, event.shiftKey);
|
|
2031
|
+
// The month's first week goes on top, unless the day lies in a sixth week that would then stay out of view.
|
|
2032
|
+
goToMonth(target);
|
|
2033
|
+
} else pageTo(target);
|
|
1531
2034
|
return;
|
|
1532
2035
|
}
|
|
1533
2036
|
if (event.key === "Enter" || (event.key === "n" || event.key === "N") && !event.shiftKey) {
|
|
@@ -1597,6 +2100,9 @@ const MonthView = props => {
|
|
|
1597
2100
|
cancelInteraction?.();
|
|
1598
2101
|
cancelInteraction = startCalendarPointerSession({
|
|
1599
2102
|
event,
|
|
2103
|
+
scrollContainer: continuous() ? scroller : undefined,
|
|
2104
|
+
// A drag along the last row on screen selects its days; the view scrolls once the pointer came from inside.
|
|
2105
|
+
armAutoScroll: true,
|
|
1600
2106
|
resolve: (clientX, clientY) => dayKeyAtPoint(clientX, clientY),
|
|
1601
2107
|
onActivate: () => {
|
|
1602
2108
|
suppressClickUntil = performance.now() + 400;
|
|
@@ -1605,6 +2111,8 @@ const MonthView = props => {
|
|
|
1605
2111
|
},
|
|
1606
2112
|
onPreview: current => select(key, current),
|
|
1607
2113
|
onCommit: current => {
|
|
2114
|
+
// The click that ends a long drag, such as one that scrolled the view, must not select the pressed day again.
|
|
2115
|
+
suppressClickUntil = performance.now() + 400;
|
|
1608
2116
|
select(key, current);
|
|
1609
2117
|
focusCell(current);
|
|
1610
2118
|
const range = orderedSelection(key, current);
|
|
@@ -1624,8 +2132,8 @@ const MonthView = props => {
|
|
|
1624
2132
|
const menuItems = createMemo(() => {
|
|
1625
2133
|
if (!hasMenu()) return [];
|
|
1626
2134
|
const range = selection() ?? {
|
|
1627
|
-
first:
|
|
1628
|
-
last:
|
|
2135
|
+
first: unselectedKey(),
|
|
2136
|
+
last: unselectedKey()
|
|
1629
2137
|
};
|
|
1630
2138
|
const own = props.owner.selectionMenu?.(rangeOf(range), {
|
|
1631
2139
|
quickCreate: create => {
|
|
@@ -1675,6 +2183,8 @@ const MonthView = props => {
|
|
|
1675
2183
|
cancelInteraction?.();
|
|
1676
2184
|
cancelInteraction = startCalendarPointerSession({
|
|
1677
2185
|
event: pointerEvent,
|
|
2186
|
+
scrollContainer: continuous() ? scroller : undefined,
|
|
2187
|
+
armAutoScroll: true,
|
|
1678
2188
|
resolve: (clientX, clientY) => {
|
|
1679
2189
|
const key = dayKeyAtPoint(clientX, clientY);
|
|
1680
2190
|
if (!key) return null;
|
|
@@ -1694,6 +2204,9 @@ const MonthView = props => {
|
|
|
1694
2204
|
},
|
|
1695
2205
|
onPreview: setMovePreview,
|
|
1696
2206
|
onCommit: next => {
|
|
2207
|
+
// The click that ends a long move, such as one that scrolled the view, must not open the entry.
|
|
2208
|
+
markDragged();
|
|
2209
|
+
suppressClickUntil = performance.now() + 400;
|
|
1697
2210
|
clearMove();
|
|
1698
2211
|
if (eventTimeChanged(event, next)) props.owner.onEventDrop?.(event, next);
|
|
1699
2212
|
},
|
|
@@ -1781,388 +2294,497 @@ const MonthView = props => {
|
|
|
1781
2294
|
if (linkedItem() === item.key) setLinkedItem("");
|
|
1782
2295
|
}
|
|
1783
2296
|
});
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
_$insert(_el$87, day);
|
|
1810
|
-
_$effect(() => _$setAttribute(_el$87, "data-weekend", index() > 4 ? "true" : undefined));
|
|
1811
|
-
return _el$87;
|
|
1812
|
-
})()
|
|
1813
|
-
}), _el$84, _co$22);
|
|
1814
|
-
_$insert(_el$78, _$createComponent(For, {
|
|
1815
|
-
get each() {
|
|
1816
|
-
return weeks();
|
|
1817
|
-
},
|
|
1818
|
-
children: (week, weekIndex) => {
|
|
1819
|
-
const fit = createMemo(() => fitMonthWeek(weekLayouts()[weekIndex()] ?? {
|
|
1820
|
-
bars: [],
|
|
1821
|
-
singles: []
|
|
1822
|
-
}, capacities()[weekIndex()] ?? MONTH_DEFAULT_LANES));
|
|
1823
|
-
const weekHref = () => viewHref(week[0].key, "week");
|
|
1824
|
-
const weekNumber = () => zonedWeekNumber(week[0].day, dateConfig());
|
|
1825
|
-
return (() => {
|
|
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, {
|
|
2297
|
+
const weekRow = (week, weekIndex) => {
|
|
2298
|
+
const layout = createMemo(() => layoutMonthWeek(week().map(entry => entry.key), items().map(item => ({
|
|
2299
|
+
item,
|
|
2300
|
+
firstKey: item.firstKey,
|
|
2301
|
+
lastKey: item.lastKey,
|
|
2302
|
+
bar: item.bar
|
|
2303
|
+
}))));
|
|
2304
|
+
// The continuous rows are all as high as the first, so they share its measured capacity.
|
|
2305
|
+
const capacity = () => capacities()[continuous() ? 0 : weekIndex()] ?? MONTH_DEFAULT_LANES;
|
|
2306
|
+
const fit = createMemo(() => fitMonthWeek(layout(), capacity()));
|
|
2307
|
+
const weekHref = () => viewHref(week()[0].key, "week");
|
|
2308
|
+
const weekNumber = () => zonedWeekNumber(week()[0].day, dateConfig());
|
|
2309
|
+
return (() => {
|
|
2310
|
+
var _el$77 = _$getNextElement(_tmpl$22),
|
|
2311
|
+
_el$79 = _el$77.firstChild,
|
|
2312
|
+
[_el$80, _co$21] = _$getNextMarker(_el$79.nextSibling),
|
|
2313
|
+
_el$81 = _el$80.nextSibling,
|
|
2314
|
+
[_el$82, _co$22] = _$getNextMarker(_el$81.nextSibling);
|
|
2315
|
+
_$insert(_el$77, _$createComponent(Show, {
|
|
2316
|
+
get when() {
|
|
2317
|
+
return props.owner.withWeekNumbers;
|
|
2318
|
+
},
|
|
2319
|
+
get children() {
|
|
2320
|
+
var _el$78 = _$getNextElement(_tmpl$21);
|
|
2321
|
+
_$insert(_el$78, _$createComponent(Show, {
|
|
1832
2322
|
get when() {
|
|
1833
|
-
return
|
|
2323
|
+
return weekHref();
|
|
1834
2324
|
},
|
|
1835
|
-
get
|
|
1836
|
-
|
|
1837
|
-
_$insert(_el$89, _$createComponent(Show, {
|
|
2325
|
+
get fallback() {
|
|
2326
|
+
return _$createComponent(Show, {
|
|
1838
2327
|
get when() {
|
|
1839
|
-
return
|
|
2328
|
+
return canOpenView("week");
|
|
1840
2329
|
},
|
|
1841
2330
|
get fallback() {
|
|
1842
|
-
return
|
|
1843
|
-
|
|
1844
|
-
|
|
2331
|
+
return weekNumber();
|
|
2332
|
+
},
|
|
2333
|
+
get children() {
|
|
2334
|
+
var _el$83 = _$getNextElement(_tmpl$23);
|
|
2335
|
+
_el$83.$$click = () => openView(week()[0].key, "week");
|
|
2336
|
+
_$insert(_el$83, weekNumber);
|
|
2337
|
+
_$effect(_p$ => {
|
|
2338
|
+
var _v$1 = calendarMessages().calendarOpenWeekNumber({
|
|
2339
|
+
week: weekNumber()
|
|
2340
|
+
}),
|
|
2341
|
+
_v$10 = calendarMessages().calendarOpenWeekNumber({
|
|
2342
|
+
week: weekNumber()
|
|
2343
|
+
});
|
|
2344
|
+
_v$1 !== _p$.e && _$setAttribute(_el$83, "title", _p$.e = _v$1);
|
|
2345
|
+
_v$10 !== _p$.t && _$setAttribute(_el$83, "aria-label", _p$.t = _v$10);
|
|
2346
|
+
return _p$;
|
|
2347
|
+
}, {
|
|
2348
|
+
e: undefined,
|
|
2349
|
+
t: undefined
|
|
2350
|
+
});
|
|
2351
|
+
_$runHydrationEvents();
|
|
2352
|
+
return _el$83;
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
},
|
|
2356
|
+
children: href => _$createComponent(CalendarNavigationLink, {
|
|
2357
|
+
get owner() {
|
|
2358
|
+
return props.owner;
|
|
2359
|
+
},
|
|
2360
|
+
get href() {
|
|
2361
|
+
return href();
|
|
2362
|
+
},
|
|
2363
|
+
get anchorProps() {
|
|
2364
|
+
return {
|
|
2365
|
+
class: "k2b-calendar-month__week-link",
|
|
2366
|
+
tabIndex: -1,
|
|
2367
|
+
title: calendarMessages().calendarOpenWeekNumber({
|
|
2368
|
+
week: weekNumber()
|
|
2369
|
+
}),
|
|
2370
|
+
"aria-label": calendarMessages().calendarOpenWeekNumber({
|
|
2371
|
+
week: weekNumber()
|
|
2372
|
+
})
|
|
2373
|
+
};
|
|
2374
|
+
},
|
|
2375
|
+
get children() {
|
|
2376
|
+
return weekNumber();
|
|
2377
|
+
}
|
|
2378
|
+
})
|
|
2379
|
+
}));
|
|
2380
|
+
return _el$78;
|
|
2381
|
+
}
|
|
2382
|
+
}), _el$80, _co$21);
|
|
2383
|
+
_$insert(_el$77, _$createComponent(For, {
|
|
2384
|
+
get each() {
|
|
2385
|
+
return week();
|
|
2386
|
+
},
|
|
2387
|
+
children: ({
|
|
2388
|
+
day,
|
|
2389
|
+
key
|
|
2390
|
+
}, column) => {
|
|
2391
|
+
const dayBadge = props.owner.dayBadges?.[key];
|
|
2392
|
+
const sameMonth = () => calendar.isSameMonth(day, continuous() ? parseKey(focusMonthKey()) : props.date, dateConfig());
|
|
2393
|
+
const label = dayLabel(day);
|
|
2394
|
+
const bars = createMemo(() => fit().bars.filter(bar => bar.startColumn === column()));
|
|
2395
|
+
const cell = () => fit().cells[column()] ?? {
|
|
2396
|
+
top: 0,
|
|
2397
|
+
shown: [],
|
|
2398
|
+
hidden: 0
|
|
2399
|
+
};
|
|
2400
|
+
return (() => {
|
|
2401
|
+
var _el$84 = _$getNextElement(_tmpl$25),
|
|
2402
|
+
_el$85 = _el$84.firstChild,
|
|
2403
|
+
_el$86 = _el$85.firstChild,
|
|
2404
|
+
_el$87 = _el$86.nextSibling,
|
|
2405
|
+
[_el$88, _co$23] = _$getNextMarker(_el$87.nextSibling),
|
|
2406
|
+
_el$89 = _el$85.nextSibling,
|
|
2407
|
+
_el$96 = _el$89.firstChild,
|
|
2408
|
+
[_el$97, _co$25] = _$getNextMarker(_el$96.nextSibling),
|
|
2409
|
+
_el$98 = _el$97.nextSibling,
|
|
2410
|
+
[_el$99, _co$26] = _$getNextMarker(_el$98.nextSibling),
|
|
2411
|
+
_el$100 = _el$99.nextSibling,
|
|
2412
|
+
[_el$101, _co$27] = _$getNextMarker(_el$100.nextSibling);
|
|
2413
|
+
_el$84.$$keydown = event => onCellKeyDown(event, key);
|
|
2414
|
+
_el$84.$$contextmenu = event => {
|
|
2415
|
+
// The pressed day takes the focus, so closing the menu with Escape returns there.
|
|
2416
|
+
menuKey = pressedKey(event, key);
|
|
2417
|
+
if (hasMenu()) focusCell(menuKey);
|
|
2418
|
+
};
|
|
2419
|
+
_el$84.$$pointerdown = event => onCellPointerDown(event, key);
|
|
2420
|
+
_el$84.$$dblclick = event => onCellDoubleClick(event, key);
|
|
2421
|
+
_el$84.$$click = event => onCellClick(event, key);
|
|
2422
|
+
_$use(element => {
|
|
2423
|
+
cells.set(key, element);
|
|
2424
|
+
onCleanup(() => {
|
|
2425
|
+
if (cells.get(key) === element) cells.delete(key);
|
|
2426
|
+
});
|
|
2427
|
+
}, _el$84);
|
|
2428
|
+
_$setAttribute(_el$84, "aria-label", label);
|
|
2429
|
+
_$setAttribute(_el$84, "data-calendar-day-key", key);
|
|
2430
|
+
_$insert(_el$86, (() => {
|
|
2431
|
+
var _c$ = _$memo(() => !!(continuous() && key.endsWith("-01")));
|
|
2432
|
+
return () => _c$() ? shortDayLabel(key).replace(/\.$/, "") : calendar.formatDayNumber(day, dateConfig());
|
|
2433
|
+
})());
|
|
2434
|
+
_$insert(_el$85, _$createComponent(Show, {
|
|
2435
|
+
when: dayBadge,
|
|
2436
|
+
children: badge => (() => {
|
|
2437
|
+
var _el$102 = _$getNextElement(_tmpl$19),
|
|
2438
|
+
_el$103 = _el$102.firstChild,
|
|
2439
|
+
[_el$104, _co$28] = _$getNextMarker(_el$103.nextSibling),
|
|
2440
|
+
_el$105 = _el$104.nextSibling,
|
|
2441
|
+
[_el$106, _co$29] = _$getNextMarker(_el$105.nextSibling);
|
|
2442
|
+
_$insert(_el$102, _$createComponent(Show, {
|
|
2443
|
+
get when() {
|
|
2444
|
+
return badge().icon;
|
|
2445
|
+
},
|
|
2446
|
+
children: icon => (() => {
|
|
2447
|
+
var _el$107 = _$getNextElement(_tmpl$3);
|
|
2448
|
+
_$effect(() => _$className(_el$107, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
2449
|
+
return _el$107;
|
|
2450
|
+
})()
|
|
2451
|
+
}), _el$104, _co$28);
|
|
2452
|
+
_$insert(_el$102, () => badge().label, _el$106, _co$29);
|
|
2453
|
+
return _el$102;
|
|
2454
|
+
})()
|
|
2455
|
+
}), _el$88, _co$23);
|
|
2456
|
+
_$use(element => {
|
|
2457
|
+
if (column() === 0) observeLanes(element, continuous() ? 0 : weekIndex());
|
|
2458
|
+
}, _el$89);
|
|
2459
|
+
_$insert(_el$89, _$createComponent(For, {
|
|
2460
|
+
get each() {
|
|
2461
|
+
return bars();
|
|
2462
|
+
},
|
|
2463
|
+
children: bar => {
|
|
2464
|
+
const span = bar.endColumn - bar.startColumn + 1;
|
|
2465
|
+
const startHint = () => {
|
|
2466
|
+
if (!bar.continuesBefore) return undefined;
|
|
2467
|
+
const hint = calendarMessages().calendarContinuesFrom(hintDate(bar.item.firstKey));
|
|
2468
|
+
return hintFits(bar.item.event.title, hint, span) ? hint : undefined;
|
|
2469
|
+
};
|
|
2470
|
+
const endHint = () => {
|
|
2471
|
+
if (!bar.continuesAfter) return undefined;
|
|
2472
|
+
const hint = calendarMessages().calendarContinuesUntil(hintDate(bar.item.lastKey));
|
|
2473
|
+
return hintFits(`${bar.item.event.title}${startHint() ?? ""}`, hint, span) ? hint : undefined;
|
|
2474
|
+
};
|
|
2475
|
+
return (() => {
|
|
2476
|
+
var _el$108 = _$getNextElement(_tmpl$26);
|
|
2477
|
+
_$spread(_el$108, _$mergeProps({
|
|
2478
|
+
get style() {
|
|
2479
|
+
return {
|
|
2480
|
+
"--k2b-calendar-span": String(span),
|
|
2481
|
+
"--k2b-calendar-row": String(bar.lane)
|
|
2482
|
+
};
|
|
1845
2483
|
},
|
|
1846
|
-
get
|
|
1847
|
-
return
|
|
2484
|
+
get ["data-linked"]() {
|
|
2485
|
+
return linkedItem() === bar.item.key && bar.item.firstKey !== bar.item.lastKey ? "true" : undefined;
|
|
1848
2486
|
},
|
|
1849
|
-
get
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
var _v$0 = calendarMessages().calendarOpenWeekNumber({
|
|
1855
|
-
week: weekNumber()
|
|
1856
|
-
}),
|
|
1857
|
-
_v$1 = calendarMessages().calendarOpenWeekNumber({
|
|
1858
|
-
week: weekNumber()
|
|
1859
|
-
});
|
|
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);
|
|
1862
|
-
return _p$;
|
|
1863
|
-
}, {
|
|
1864
|
-
e: undefined,
|
|
1865
|
-
t: undefined
|
|
1866
|
-
});
|
|
1867
|
-
_$runHydrationEvents();
|
|
1868
|
-
return _el$94;
|
|
2487
|
+
get ["data-continues-before"]() {
|
|
2488
|
+
return bar.continuesBefore ? "true" : undefined;
|
|
2489
|
+
},
|
|
2490
|
+
get ["data-continues-after"]() {
|
|
2491
|
+
return bar.continuesAfter ? "true" : undefined;
|
|
1869
2492
|
}
|
|
1870
|
-
});
|
|
1871
|
-
|
|
1872
|
-
|
|
2493
|
+
}, () => linkProps(bar.item)), false, true);
|
|
2494
|
+
_$insert(_el$108, _$createComponent(EventChip, {
|
|
2495
|
+
get event() {
|
|
2496
|
+
return bar.item.event;
|
|
2497
|
+
},
|
|
2498
|
+
get owner() {
|
|
2499
|
+
return props.owner;
|
|
2500
|
+
},
|
|
2501
|
+
get href() {
|
|
2502
|
+
return eventHref(props.owner, bar.item.event);
|
|
2503
|
+
},
|
|
2504
|
+
get label() {
|
|
2505
|
+
return itemLabel(bar.item);
|
|
2506
|
+
},
|
|
2507
|
+
compact: true,
|
|
2508
|
+
bar: true,
|
|
2509
|
+
get continuesBefore() {
|
|
2510
|
+
return bar.continuesBefore;
|
|
2511
|
+
},
|
|
2512
|
+
get continuesAfter() {
|
|
2513
|
+
return bar.continuesAfter;
|
|
2514
|
+
},
|
|
2515
|
+
get hintStart() {
|
|
2516
|
+
return startHint();
|
|
2517
|
+
},
|
|
2518
|
+
get hintEnd() {
|
|
2519
|
+
return endHint();
|
|
2520
|
+
},
|
|
2521
|
+
get moving() {
|
|
2522
|
+
return movingEventId() === bar.item.event.id;
|
|
2523
|
+
},
|
|
2524
|
+
get onMovePointerDown() {
|
|
2525
|
+
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, bar.item, markDragged) : undefined;
|
|
2526
|
+
}
|
|
2527
|
+
}));
|
|
2528
|
+
_$runHydrationEvents();
|
|
2529
|
+
return _el$108;
|
|
2530
|
+
})();
|
|
2531
|
+
}
|
|
2532
|
+
}), _el$97, _co$25);
|
|
2533
|
+
_$insert(_el$89, _$createComponent(For, {
|
|
2534
|
+
get each() {
|
|
2535
|
+
return cell().shown;
|
|
2536
|
+
},
|
|
2537
|
+
children: (item, index) => (() => {
|
|
2538
|
+
var _el$109 = _$getNextElement(_tmpl$27);
|
|
2539
|
+
_$insert(_el$109, _$createComponent(EventChip, {
|
|
2540
|
+
get event() {
|
|
2541
|
+
return item.event;
|
|
2542
|
+
},
|
|
1873
2543
|
get owner() {
|
|
1874
2544
|
return props.owner;
|
|
1875
2545
|
},
|
|
1876
2546
|
get href() {
|
|
1877
|
-
return
|
|
1878
|
-
},
|
|
1879
|
-
get anchorProps() {
|
|
1880
|
-
return {
|
|
1881
|
-
class: "k2b-calendar-month__week-link",
|
|
1882
|
-
tabIndex: -1,
|
|
1883
|
-
title: calendarMessages().calendarOpenWeekNumber({
|
|
1884
|
-
week: weekNumber()
|
|
1885
|
-
}),
|
|
1886
|
-
"aria-label": calendarMessages().calendarOpenWeekNumber({
|
|
1887
|
-
week: weekNumber()
|
|
1888
|
-
})
|
|
1889
|
-
};
|
|
2547
|
+
return eventHref(props.owner, item.event);
|
|
1890
2548
|
},
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
})
|
|
1895
|
-
}));
|
|
1896
|
-
return _el$89;
|
|
1897
|
-
}
|
|
1898
|
-
}), _el$91, _co$24);
|
|
1899
|
-
_$insert(_el$88, _$createComponent(For, {
|
|
1900
|
-
each: week,
|
|
1901
|
-
children: ({
|
|
1902
|
-
day,
|
|
1903
|
-
key
|
|
1904
|
-
}, column) => {
|
|
1905
|
-
const dayBadge = props.owner.dayBadges?.[key];
|
|
1906
|
-
const sameMonth = calendar.isSameMonth(day, props.date, dateConfig());
|
|
1907
|
-
const label = dayLabel(day);
|
|
1908
|
-
const bars = createMemo(() => fit().bars.filter(bar => bar.startColumn === column()));
|
|
1909
|
-
const cell = () => fit().cells[column()] ?? {
|
|
1910
|
-
top: 0,
|
|
1911
|
-
shown: [],
|
|
1912
|
-
hidden: 0
|
|
1913
|
-
};
|
|
1914
|
-
return (() => {
|
|
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 => {
|
|
1929
|
-
// The pressed day takes the focus, so closing the menu with Escape returns there.
|
|
1930
|
-
menuKey = pressedKey(event, key);
|
|
1931
|
-
if (hasMenu()) focusCell(menuKey);
|
|
1932
|
-
};
|
|
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, {
|
|
1943
|
-
when: dayBadge,
|
|
1944
|
-
children: badge => (() => {
|
|
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, {
|
|
1951
|
-
get when() {
|
|
1952
|
-
return badge().icon;
|
|
1953
|
-
},
|
|
1954
|
-
children: icon => (() => {
|
|
1955
|
-
var _el$118 = _$getNextElement(_tmpl$3);
|
|
1956
|
-
_$effect(() => _$className(_el$118, `k2b-calendar-month__badge-icon ti ti-${icon()}`));
|
|
1957
|
-
return _el$118;
|
|
1958
|
-
})()
|
|
1959
|
-
}), _el$115, _co$31);
|
|
1960
|
-
_$insert(_el$113, () => badge().label, _el$117, _co$32);
|
|
1961
|
-
return _el$113;
|
|
1962
|
-
})()
|
|
1963
|
-
}), _el$99, _co$26);
|
|
1964
|
-
_$use(element => {
|
|
1965
|
-
if (column() === 0) observeLanes(element, weekIndex());
|
|
1966
|
-
}, _el$100);
|
|
1967
|
-
_$insert(_el$100, _$createComponent(For, {
|
|
1968
|
-
get each() {
|
|
1969
|
-
return bars();
|
|
1970
|
-
},
|
|
1971
|
-
children: bar => {
|
|
1972
|
-
const span = bar.endColumn - bar.startColumn + 1;
|
|
1973
|
-
const startHint = () => {
|
|
1974
|
-
if (!bar.continuesBefore) return undefined;
|
|
1975
|
-
const hint = calendarMessages().calendarContinuesFrom(hintDate(bar.item.firstKey));
|
|
1976
|
-
return hintFits(bar.item.event.title, hint, span) ? hint : undefined;
|
|
1977
|
-
};
|
|
1978
|
-
const endHint = () => {
|
|
1979
|
-
if (!bar.continuesAfter) return undefined;
|
|
1980
|
-
const hint = calendarMessages().calendarContinuesUntil(hintDate(bar.item.lastKey));
|
|
1981
|
-
return hintFits(`${bar.item.event.title}${startHint() ?? ""}`, hint, span) ? hint : undefined;
|
|
1982
|
-
};
|
|
1983
|
-
return (() => {
|
|
1984
|
-
var _el$119 = _$getNextElement(_tmpl$28);
|
|
1985
|
-
_$spread(_el$119, _$mergeProps({
|
|
1986
|
-
get style() {
|
|
1987
|
-
return {
|
|
1988
|
-
"--k2b-calendar-span": String(span),
|
|
1989
|
-
"--k2b-calendar-row": String(bar.lane)
|
|
1990
|
-
};
|
|
1991
|
-
},
|
|
1992
|
-
get ["data-linked"]() {
|
|
1993
|
-
return linkedItem() === bar.item.key && bar.item.firstKey !== bar.item.lastKey ? "true" : undefined;
|
|
1994
|
-
},
|
|
1995
|
-
get ["data-continues-before"]() {
|
|
1996
|
-
return bar.continuesBefore ? "true" : undefined;
|
|
1997
|
-
},
|
|
1998
|
-
get ["data-continues-after"]() {
|
|
1999
|
-
return bar.continuesAfter ? "true" : undefined;
|
|
2000
|
-
}
|
|
2001
|
-
}, () => linkProps(bar.item)), false, true);
|
|
2002
|
-
_$insert(_el$119, _$createComponent(EventChip, {
|
|
2003
|
-
get event() {
|
|
2004
|
-
return bar.item.event;
|
|
2005
|
-
},
|
|
2006
|
-
get owner() {
|
|
2007
|
-
return props.owner;
|
|
2008
|
-
},
|
|
2009
|
-
get href() {
|
|
2010
|
-
return eventHref(props.owner, bar.item.event);
|
|
2011
|
-
},
|
|
2012
|
-
get label() {
|
|
2013
|
-
return itemLabel(bar.item);
|
|
2014
|
-
},
|
|
2015
|
-
compact: true,
|
|
2016
|
-
bar: true,
|
|
2017
|
-
get continuesBefore() {
|
|
2018
|
-
return bar.continuesBefore;
|
|
2019
|
-
},
|
|
2020
|
-
get continuesAfter() {
|
|
2021
|
-
return bar.continuesAfter;
|
|
2022
|
-
},
|
|
2023
|
-
get hintStart() {
|
|
2024
|
-
return startHint();
|
|
2025
|
-
},
|
|
2026
|
-
get hintEnd() {
|
|
2027
|
-
return endHint();
|
|
2028
|
-
},
|
|
2029
|
-
get moving() {
|
|
2030
|
-
return movingEventId() === bar.item.event.id;
|
|
2031
|
-
},
|
|
2032
|
-
get onMovePointerDown() {
|
|
2033
|
-
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, bar.item, markDragged) : undefined;
|
|
2034
|
-
}
|
|
2035
|
-
}));
|
|
2036
|
-
_$runHydrationEvents();
|
|
2037
|
-
return _el$119;
|
|
2038
|
-
})();
|
|
2039
|
-
}
|
|
2040
|
-
}), _el$108, _co$28);
|
|
2041
|
-
_$insert(_el$100, _$createComponent(For, {
|
|
2042
|
-
get each() {
|
|
2043
|
-
return cell().shown;
|
|
2549
|
+
compact: true,
|
|
2550
|
+
get leadingTime() {
|
|
2551
|
+
return leadingTime(item);
|
|
2044
2552
|
},
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
_$insert(_el$120, _$createComponent(EventChip, {
|
|
2048
|
-
get event() {
|
|
2049
|
-
return item.event;
|
|
2050
|
-
},
|
|
2051
|
-
get owner() {
|
|
2052
|
-
return props.owner;
|
|
2053
|
-
},
|
|
2054
|
-
get href() {
|
|
2055
|
-
return eventHref(props.owner, item.event);
|
|
2056
|
-
},
|
|
2057
|
-
compact: true,
|
|
2058
|
-
get leadingTime() {
|
|
2059
|
-
return leadingTime(item);
|
|
2060
|
-
},
|
|
2061
|
-
get moving() {
|
|
2062
|
-
return movingEventId() === item.event.id;
|
|
2063
|
-
},
|
|
2064
|
-
get onMovePointerDown() {
|
|
2065
|
-
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, item, markDragged) : undefined;
|
|
2066
|
-
}
|
|
2067
|
-
}));
|
|
2068
|
-
_$effect(_$p => _$setStyleProperty(_el$120, "--k2b-calendar-row", String(cell().top + index())));
|
|
2069
|
-
return _el$120;
|
|
2070
|
-
})()
|
|
2071
|
-
}), _el$110, _co$29);
|
|
2072
|
-
_$insert(_el$100, _$createComponent(Show, {
|
|
2073
|
-
get when() {
|
|
2074
|
-
return cell().hidden > 0;
|
|
2553
|
+
get moving() {
|
|
2554
|
+
return movingEventId() === item.event.id;
|
|
2075
2555
|
},
|
|
2076
|
-
get
|
|
2077
|
-
|
|
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 = () => {
|
|
2084
|
-
const current = popover();
|
|
2085
|
-
if (current?.kind === "day" && current.dayKey === key) closePopover(false);else openDayList(key);
|
|
2086
|
-
};
|
|
2087
|
-
_$insert(_el$102, () => calendarMessages().calendarMoreEvents({
|
|
2088
|
-
count: cell().hidden
|
|
2089
|
-
}));
|
|
2090
|
-
_$insert(_el$103, () => cell().hidden, _el$106, _co$27);
|
|
2091
|
-
_$effect(_p$ => {
|
|
2092
|
-
var _v$10 = String(cell().top + cell().shown.length),
|
|
2093
|
-
_v$11 = calendarMessages().calendarMoreEventsOn({
|
|
2094
|
-
count: cell().hidden,
|
|
2095
|
-
label
|
|
2096
|
-
}),
|
|
2097
|
-
_v$12 = (() => {
|
|
2098
|
-
const current = popover();
|
|
2099
|
-
return current?.kind === "day" && current.dayKey === key;
|
|
2100
|
-
})();
|
|
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);
|
|
2104
|
-
return _p$;
|
|
2105
|
-
}, {
|
|
2106
|
-
e: undefined,
|
|
2107
|
-
t: undefined,
|
|
2108
|
-
a: undefined
|
|
2109
|
-
});
|
|
2110
|
-
_$runHydrationEvents();
|
|
2111
|
-
return _el$101;
|
|
2556
|
+
get onMovePointerDown() {
|
|
2557
|
+
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startMove(pointerEvent, item, markDragged) : undefined;
|
|
2112
2558
|
}
|
|
2113
|
-
})
|
|
2559
|
+
}));
|
|
2560
|
+
_$effect(_$p => _$setStyleProperty(_el$109, "--k2b-calendar-row", String(cell().top + index())));
|
|
2561
|
+
return _el$109;
|
|
2562
|
+
})()
|
|
2563
|
+
}), _el$99, _co$26);
|
|
2564
|
+
_$insert(_el$89, _$createComponent(Show, {
|
|
2565
|
+
get when() {
|
|
2566
|
+
return cell().hidden > 0;
|
|
2567
|
+
},
|
|
2568
|
+
get children() {
|
|
2569
|
+
var _el$90 = _$getNextElement(_tmpl$24),
|
|
2570
|
+
_el$91 = _el$90.firstChild,
|
|
2571
|
+
_el$92 = _el$91.nextSibling,
|
|
2572
|
+
_el$93 = _el$92.firstChild,
|
|
2573
|
+
_el$94 = _el$93.nextSibling,
|
|
2574
|
+
[_el$95, _co$24] = _$getNextMarker(_el$94.nextSibling);
|
|
2575
|
+
_el$90.$$click = () => {
|
|
2576
|
+
const current = popover();
|
|
2577
|
+
if (current?.kind === "day" && current.dayKey === key) closePopover(false);else openDayList(key);
|
|
2578
|
+
};
|
|
2579
|
+
_$insert(_el$91, () => calendarMessages().calendarMoreEvents({
|
|
2580
|
+
count: cell().hidden
|
|
2581
|
+
}));
|
|
2582
|
+
_$insert(_el$92, () => cell().hidden, _el$95, _co$24);
|
|
2114
2583
|
_$effect(_p$ => {
|
|
2115
|
-
var _v$
|
|
2116
|
-
_v$
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
_v$
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
_v$
|
|
2125
|
-
_v$
|
|
2126
|
-
_v$
|
|
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);
|
|
2584
|
+
var _v$11 = String(cell().top + cell().shown.length),
|
|
2585
|
+
_v$12 = calendarMessages().calendarMoreEventsOn({
|
|
2586
|
+
count: cell().hidden,
|
|
2587
|
+
label
|
|
2588
|
+
}),
|
|
2589
|
+
_v$13 = (() => {
|
|
2590
|
+
const current = popover();
|
|
2591
|
+
return current?.kind === "day" && current.dayKey === key;
|
|
2592
|
+
})();
|
|
2593
|
+
_v$11 !== _p$.e && _$setStyleProperty(_el$90, "--k2b-calendar-row", _p$.e = _v$11);
|
|
2594
|
+
_v$12 !== _p$.t && _$setAttribute(_el$90, "aria-label", _p$.t = _v$12);
|
|
2595
|
+
_v$13 !== _p$.a && _$setAttribute(_el$90, "aria-expanded", _p$.a = _v$13);
|
|
2131
2596
|
return _p$;
|
|
2132
2597
|
}, {
|
|
2133
2598
|
e: undefined,
|
|
2134
2599
|
t: undefined,
|
|
2135
|
-
a: undefined
|
|
2136
|
-
o: undefined,
|
|
2137
|
-
i: undefined,
|
|
2138
|
-
n: undefined,
|
|
2139
|
-
s: undefined,
|
|
2140
|
-
h: undefined
|
|
2600
|
+
a: undefined
|
|
2141
2601
|
});
|
|
2142
2602
|
_$runHydrationEvents();
|
|
2143
|
-
return _el$
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2603
|
+
return _el$90;
|
|
2604
|
+
}
|
|
2605
|
+
}), _el$101, _co$27);
|
|
2606
|
+
_$effect(_p$ => {
|
|
2607
|
+
var _v$14 = rovingKey() === key ? 0 : -1,
|
|
2608
|
+
_v$15 = within(selection(), key) ? "true" : "false",
|
|
2609
|
+
_v$16 = key === todayKey() ? "date" : undefined,
|
|
2610
|
+
_v$17 = !sameMonth() ? "true" : undefined,
|
|
2611
|
+
_v$18 = continuous() && key.endsWith("-01") ? "true" : undefined,
|
|
2612
|
+
_v$19 = continuous() && Number(key.slice(8)) <= 7 ? "true" : undefined,
|
|
2613
|
+
_v$20 = column() > 4 ? "true" : undefined,
|
|
2614
|
+
_v$21 = key < todayKey() ? "true" : undefined,
|
|
2615
|
+
_v$22 = selectionPart(key),
|
|
2616
|
+
_v$23 = within(dropRange(), key) ? "true" : undefined,
|
|
2617
|
+
_v$24 = continuous() && pulseKey() === key ? "true" : undefined,
|
|
2618
|
+
_v$25 = key === todayKey() ? "true" : undefined,
|
|
2619
|
+
_v$26 = !sameMonth() ? "true" : undefined;
|
|
2620
|
+
_v$14 !== _p$.e && _$setAttribute(_el$84, "tabindex", _p$.e = _v$14);
|
|
2621
|
+
_v$15 !== _p$.t && _$setAttribute(_el$84, "aria-selected", _p$.t = _v$15);
|
|
2622
|
+
_v$16 !== _p$.a && _$setAttribute(_el$84, "aria-current", _p$.a = _v$16);
|
|
2623
|
+
_v$17 !== _p$.o && _$setAttribute(_el$84, "data-outside", _p$.o = _v$17);
|
|
2624
|
+
_v$18 !== _p$.i && _$setAttribute(_el$84, "data-month-first", _p$.i = _v$18);
|
|
2625
|
+
_v$19 !== _p$.n && _$setAttribute(_el$84, "data-month-top", _p$.n = _v$19);
|
|
2626
|
+
_v$20 !== _p$.s && _$setAttribute(_el$84, "data-weekend", _p$.s = _v$20);
|
|
2627
|
+
_v$21 !== _p$.h && _$setAttribute(_el$84, "data-past", _p$.h = _v$21);
|
|
2628
|
+
_v$22 !== _p$.r && _$setAttribute(_el$84, "data-selected", _p$.r = _v$22);
|
|
2629
|
+
_v$23 !== _p$.d && _$setAttribute(_el$84, "data-drop-preview", _p$.d = _v$23);
|
|
2630
|
+
_v$24 !== _p$.l && _$setAttribute(_el$86, "data-pulse", _p$.l = _v$24);
|
|
2631
|
+
_v$25 !== _p$.u && _$setAttribute(_el$86, "data-today", _p$.u = _v$25);
|
|
2632
|
+
_v$26 !== _p$.c && _$setAttribute(_el$86, "data-outside", _p$.c = _v$26);
|
|
2633
|
+
return _p$;
|
|
2634
|
+
}, {
|
|
2635
|
+
e: undefined,
|
|
2636
|
+
t: undefined,
|
|
2637
|
+
a: undefined,
|
|
2638
|
+
o: undefined,
|
|
2639
|
+
i: undefined,
|
|
2640
|
+
n: undefined,
|
|
2641
|
+
s: undefined,
|
|
2642
|
+
h: undefined,
|
|
2643
|
+
r: undefined,
|
|
2644
|
+
d: undefined,
|
|
2645
|
+
l: undefined,
|
|
2646
|
+
u: undefined,
|
|
2647
|
+
c: undefined
|
|
2648
|
+
});
|
|
2649
|
+
_$runHydrationEvents();
|
|
2650
|
+
return _el$84;
|
|
2651
|
+
})();
|
|
2652
|
+
}
|
|
2653
|
+
}), _el$82, _co$22);
|
|
2654
|
+
_$effect(_p$ => {
|
|
2655
|
+
var _v$7 = continuous() ? week()[0]?.key : undefined,
|
|
2656
|
+
_v$8 = continuous() ? weekIndex() + 2 : undefined,
|
|
2657
|
+
_v$9 = continuous() ? {
|
|
2658
|
+
"--k2b-calendar-week-index": String(weekIndex())
|
|
2659
|
+
} : undefined,
|
|
2660
|
+
_v$0 = props.owner.withWeekNumbers ? "true" : undefined;
|
|
2661
|
+
_v$7 !== _p$.e && _$setAttribute(_el$77, "data-week-key", _p$.e = _v$7);
|
|
2662
|
+
_v$8 !== _p$.t && _$setAttribute(_el$77, "aria-rowindex", _p$.t = _v$8);
|
|
2663
|
+
_p$.a = _$style(_el$77, _v$9, _p$.a);
|
|
2664
|
+
_v$0 !== _p$.o && _$setAttribute(_el$77, "data-week-numbers", _p$.o = _v$0);
|
|
2665
|
+
return _p$;
|
|
2666
|
+
}, {
|
|
2667
|
+
e: undefined,
|
|
2668
|
+
t: undefined,
|
|
2669
|
+
a: undefined,
|
|
2670
|
+
o: undefined
|
|
2671
|
+
});
|
|
2672
|
+
return _el$77;
|
|
2673
|
+
})();
|
|
2674
|
+
};
|
|
2675
|
+
const weekdayRow = () => (() => {
|
|
2676
|
+
var _el$110 = _$getNextElement(_tmpl$29),
|
|
2677
|
+
_el$112 = _el$110.firstChild,
|
|
2678
|
+
[_el$113, _co$30] = _$getNextMarker(_el$112.nextSibling),
|
|
2679
|
+
_el$114 = _el$113.nextSibling,
|
|
2680
|
+
[_el$115, _co$31] = _$getNextMarker(_el$114.nextSibling);
|
|
2681
|
+
var _ref$ = weekdayElement;
|
|
2682
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$110) : weekdayElement = _el$110;
|
|
2683
|
+
_$insert(_el$110, _$createComponent(Show, {
|
|
2684
|
+
get when() {
|
|
2685
|
+
return props.owner.withWeekNumbers;
|
|
2686
|
+
},
|
|
2687
|
+
get children() {
|
|
2688
|
+
var _el$111 = _$getNextElement(_tmpl$28);
|
|
2689
|
+
_$insert(_el$111, () => calendarMessages().weekShort);
|
|
2690
|
+
return _el$111;
|
|
2150
2691
|
}
|
|
2151
|
-
}), _el$
|
|
2692
|
+
}), _el$113, _co$30);
|
|
2693
|
+
_$insert(_el$110, _$createComponent(For, {
|
|
2694
|
+
get each() {
|
|
2695
|
+
return weekdays();
|
|
2696
|
+
},
|
|
2697
|
+
children: (day, index) => (() => {
|
|
2698
|
+
var _el$116 = _$getNextElement(_tmpl$28);
|
|
2699
|
+
_$insert(_el$116, day);
|
|
2700
|
+
_$effect(() => _$setAttribute(_el$116, "data-weekend", index() > 4 ? "true" : undefined));
|
|
2701
|
+
return _el$116;
|
|
2702
|
+
})()
|
|
2703
|
+
}), _el$115, _co$31);
|
|
2704
|
+
_$effect(() => _$setAttribute(_el$110, "data-week-numbers", props.owner.withWeekNumbers ? "true" : undefined));
|
|
2705
|
+
return _el$110;
|
|
2706
|
+
})();
|
|
2707
|
+
const grid = () => (() => {
|
|
2708
|
+
var _el$117 = _$getNextElement(_tmpl$30),
|
|
2709
|
+
_el$118 = _el$117.firstChild,
|
|
2710
|
+
[_el$119, _co$32] = _$getNextMarker(_el$118.nextSibling),
|
|
2711
|
+
_el$120 = _el$119.nextSibling,
|
|
2712
|
+
[_el$121, _co$33] = _$getNextMarker(_el$120.nextSibling);
|
|
2713
|
+
_$insert(_el$117, weekdayRow, _el$119, _co$32);
|
|
2714
|
+
_$insert(_el$117, _$createComponent(For, {
|
|
2715
|
+
get each() {
|
|
2716
|
+
return weeks();
|
|
2717
|
+
},
|
|
2718
|
+
children: (week, index) => weekRow(() => week, index)
|
|
2719
|
+
}), _el$121, _co$33);
|
|
2152
2720
|
_$effect(_p$ => {
|
|
2153
|
-
var _v$
|
|
2154
|
-
_v$
|
|
2155
|
-
|
|
2156
|
-
_v$
|
|
2157
|
-
|
|
2158
|
-
|
|
2721
|
+
var _v$27 = formatMonth(props.date, dateConfig()),
|
|
2722
|
+
_v$28 = `auto repeat(${weeks().length}, minmax(5rem, 1fr))`;
|
|
2723
|
+
_v$27 !== _p$.e && _$setAttribute(_el$117, "aria-label", _p$.e = _v$27);
|
|
2724
|
+
_v$28 !== _p$.t && _$setStyleProperty(_el$117, "grid-template-rows", _p$.t = _v$28);
|
|
2725
|
+
return _p$;
|
|
2726
|
+
}, {
|
|
2727
|
+
e: undefined,
|
|
2728
|
+
t: undefined
|
|
2729
|
+
});
|
|
2730
|
+
return _el$117;
|
|
2731
|
+
})();
|
|
2732
|
+
const continuousRow = key => {
|
|
2733
|
+
const days = createMemo(() => Array.from({
|
|
2734
|
+
length: 7
|
|
2735
|
+
}, (_, offset) => {
|
|
2736
|
+
const dayKey = addDayKeys(key, offset);
|
|
2737
|
+
return {
|
|
2738
|
+
day: parseKey(dayKey),
|
|
2739
|
+
key: dayKey
|
|
2740
|
+
};
|
|
2741
|
+
}));
|
|
2742
|
+
return weekRow(days, () => monthRowOf(trackWeeks(), key) ?? 0);
|
|
2743
|
+
};
|
|
2744
|
+
const continuousGrid = () => (() => {
|
|
2745
|
+
var _el$122 = _$getNextElement(_tmpl$31),
|
|
2746
|
+
_el$123 = _el$122.firstChild,
|
|
2747
|
+
_el$125 = _el$123.firstChild,
|
|
2748
|
+
[_el$126, _co$34] = _$getNextMarker(_el$125.nextSibling),
|
|
2749
|
+
_el$124 = _el$126.nextSibling,
|
|
2750
|
+
_el$127 = _el$123.nextSibling;
|
|
2751
|
+
_el$123.$$focusin = event => {
|
|
2752
|
+
const target = event.target;
|
|
2753
|
+
if (!(target instanceof Element)) return;
|
|
2754
|
+
const key = target.closest("[data-calendar-day-key]")?.getAttribute("data-calendar-day-key");
|
|
2755
|
+
if (key) setFocusedCellKey(key);
|
|
2756
|
+
};
|
|
2757
|
+
_el$123.$$pointerdown = cancelGlide;
|
|
2758
|
+
_el$123.addEventListener("wheel", cancelGlide);
|
|
2759
|
+
_el$123.addEventListener("scroll", onScroll);
|
|
2760
|
+
var _ref$2 = scroller;
|
|
2761
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$123) : scroller = _el$123;
|
|
2762
|
+
_$insert(_el$123, weekdayRow, _el$126, _co$34);
|
|
2763
|
+
_$insert(_el$124, _$createComponent(For, {
|
|
2764
|
+
get each() {
|
|
2765
|
+
return renderedWeeks();
|
|
2766
|
+
},
|
|
2767
|
+
children: continuousRow
|
|
2768
|
+
}));
|
|
2769
|
+
_$insert(_el$127, () => formatMonth(parseKey(focusMonthKey()), dateConfig()));
|
|
2770
|
+
_$effect(_p$ => {
|
|
2771
|
+
var _v$29 = formatMonth(parseKey(focusMonthKey()), dateConfig()),
|
|
2772
|
+
_v$30 = trackWeeks().length + 1,
|
|
2773
|
+
_v$31 = String(trackWeeks().length),
|
|
2774
|
+
_v$32 = labelShown() ? "true" : "false";
|
|
2775
|
+
_v$29 !== _p$.e && _$setAttribute(_el$123, "aria-label", _p$.e = _v$29);
|
|
2776
|
+
_v$30 !== _p$.t && _$setAttribute(_el$123, "aria-rowcount", _p$.t = _v$30);
|
|
2777
|
+
_v$31 !== _p$.a && _$setStyleProperty(_el$124, "--k2b-calendar-weeks", _p$.a = _v$31);
|
|
2778
|
+
_v$32 !== _p$.o && _$setAttribute(_el$127, "data-show", _p$.o = _v$32);
|
|
2159
2779
|
return _p$;
|
|
2160
2780
|
}, {
|
|
2161
2781
|
e: undefined,
|
|
2162
2782
|
t: undefined,
|
|
2163
|
-
a: undefined
|
|
2783
|
+
a: undefined,
|
|
2784
|
+
o: undefined
|
|
2164
2785
|
});
|
|
2165
|
-
|
|
2786
|
+
_$runHydrationEvents();
|
|
2787
|
+
return _el$122;
|
|
2166
2788
|
})();
|
|
2167
2789
|
const dayList = dayKey => {
|
|
2168
2790
|
const day = parseKey(dayKey);
|
|
@@ -2170,36 +2792,36 @@ const MonthView = props => {
|
|
|
2170
2792
|
// Read where it renders, so a refresh while the list is open updates it as it does the grid.
|
|
2171
2793
|
const entries = () => dayEntries(dayKey);
|
|
2172
2794
|
return (() => {
|
|
2173
|
-
var _el$
|
|
2174
|
-
_el$
|
|
2175
|
-
_el$
|
|
2176
|
-
[_el$
|
|
2177
|
-
_el$
|
|
2178
|
-
_el$
|
|
2179
|
-
[_el$
|
|
2180
|
-
_el$
|
|
2181
|
-
[_el$
|
|
2182
|
-
_$insert(_el$
|
|
2183
|
-
_$insert(_el$
|
|
2795
|
+
var _el$128 = _$getNextElement(_tmpl$34),
|
|
2796
|
+
_el$129 = _el$128.firstChild,
|
|
2797
|
+
_el$137 = _el$129.nextSibling,
|
|
2798
|
+
[_el$138, _co$37] = _$getNextMarker(_el$137.nextSibling),
|
|
2799
|
+
_el$131 = _el$138.nextSibling,
|
|
2800
|
+
_el$133 = _el$131.firstChild,
|
|
2801
|
+
[_el$134, _co$35] = _$getNextMarker(_el$133.nextSibling),
|
|
2802
|
+
_el$135 = _el$134.nextSibling,
|
|
2803
|
+
[_el$136, _co$36] = _$getNextMarker(_el$135.nextSibling);
|
|
2804
|
+
_$insert(_el$129, () => dayLabel(day));
|
|
2805
|
+
_$insert(_el$128, _$createComponent(Show, {
|
|
2184
2806
|
get when() {
|
|
2185
2807
|
return entries().length > 0;
|
|
2186
2808
|
},
|
|
2187
2809
|
get fallback() {
|
|
2188
2810
|
return (() => {
|
|
2189
|
-
var _el$
|
|
2190
|
-
_$insert(_el$
|
|
2191
|
-
return _el$
|
|
2811
|
+
var _el$139 = _$getNextElement(_tmpl$35);
|
|
2812
|
+
_$insert(_el$139, () => calendarMessages().calendarNothingPlanned);
|
|
2813
|
+
return _el$139;
|
|
2192
2814
|
})();
|
|
2193
2815
|
},
|
|
2194
2816
|
get children() {
|
|
2195
|
-
var _el$
|
|
2196
|
-
_$insert(_el$
|
|
2817
|
+
var _el$130 = _$getNextElement(_tmpl$32);
|
|
2818
|
+
_$insert(_el$130, _$createComponent(For, {
|
|
2197
2819
|
get each() {
|
|
2198
2820
|
return entries();
|
|
2199
2821
|
},
|
|
2200
2822
|
children: item => (() => {
|
|
2201
|
-
var _el$
|
|
2202
|
-
_$insert(_el$
|
|
2823
|
+
var _el$140 = _$getNextElement(_tmpl$36);
|
|
2824
|
+
_$insert(_el$140, _$createComponent(EventChip, {
|
|
2203
2825
|
get event() {
|
|
2204
2826
|
return item.event;
|
|
2205
2827
|
},
|
|
@@ -2220,13 +2842,13 @@ const MonthView = props => {
|
|
|
2220
2842
|
return leadingTime(item);
|
|
2221
2843
|
}
|
|
2222
2844
|
}));
|
|
2223
|
-
return _el$
|
|
2845
|
+
return _el$140;
|
|
2224
2846
|
})()
|
|
2225
2847
|
}));
|
|
2226
|
-
return _el$
|
|
2848
|
+
return _el$130;
|
|
2227
2849
|
}
|
|
2228
|
-
}), _el$
|
|
2229
|
-
_$insert(_el$
|
|
2850
|
+
}), _el$138, _co$37);
|
|
2851
|
+
_$insert(_el$131, _$createComponent(Show, {
|
|
2230
2852
|
when: href,
|
|
2231
2853
|
get fallback() {
|
|
2232
2854
|
return _$createComponent(Show, {
|
|
@@ -2240,7 +2862,7 @@ const MonthView = props => {
|
|
|
2240
2862
|
size: "sm",
|
|
2241
2863
|
onClick: () => openView(dayKey, "day"),
|
|
2242
2864
|
get children() {
|
|
2243
|
-
return [_$getNextElement(_tmpl$
|
|
2865
|
+
return [_$getNextElement(_tmpl$37), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2244
2866
|
}
|
|
2245
2867
|
});
|
|
2246
2868
|
}
|
|
@@ -2259,11 +2881,11 @@ const MonthView = props => {
|
|
|
2259
2881
|
"data-size": "sm"
|
|
2260
2882
|
},
|
|
2261
2883
|
get children() {
|
|
2262
|
-
return [_$getNextElement(_tmpl$
|
|
2884
|
+
return [_$getNextElement(_tmpl$37), _$memo(() => calendarMessages().calendarOpenDay)];
|
|
2263
2885
|
}
|
|
2264
2886
|
})
|
|
2265
|
-
}), _el$
|
|
2266
|
-
_$insert(_el$
|
|
2887
|
+
}), _el$134, _co$35);
|
|
2888
|
+
_$insert(_el$131, _$createComponent(Show, {
|
|
2267
2889
|
get when() {
|
|
2268
2890
|
return props.owner.renderQuickCreate;
|
|
2269
2891
|
},
|
|
@@ -2282,20 +2904,21 @@ const MonthView = props => {
|
|
|
2282
2904
|
});
|
|
2283
2905
|
},
|
|
2284
2906
|
get children() {
|
|
2285
|
-
return [_$getNextElement(_tmpl$
|
|
2907
|
+
return [_$getNextElement(_tmpl$33), _$memo(() => calendarMessages().calendarNewEvent)];
|
|
2286
2908
|
}
|
|
2287
2909
|
});
|
|
2288
2910
|
}
|
|
2289
|
-
}), _el$
|
|
2290
|
-
return _el$
|
|
2911
|
+
}), _el$136, _co$36);
|
|
2912
|
+
return _el$128;
|
|
2291
2913
|
})();
|
|
2292
2914
|
};
|
|
2915
|
+
const viewGrid = () => continuous() ? continuousGrid() : grid();
|
|
2293
2916
|
return [_$createComponent(Show, {
|
|
2294
2917
|
get when() {
|
|
2295
2918
|
return hasMenu();
|
|
2296
2919
|
},
|
|
2297
2920
|
get fallback() {
|
|
2298
|
-
return
|
|
2921
|
+
return viewGrid();
|
|
2299
2922
|
},
|
|
2300
2923
|
get children() {
|
|
2301
2924
|
return _$createComponent(GestureMenu, {
|
|
@@ -2309,22 +2932,22 @@ const MonthView = props => {
|
|
|
2309
2932
|
onOpen: onMenuOpen,
|
|
2310
2933
|
"class": "k2b-calendar-month-menu",
|
|
2311
2934
|
get children() {
|
|
2312
|
-
return
|
|
2935
|
+
return viewGrid();
|
|
2313
2936
|
}
|
|
2314
2937
|
});
|
|
2315
2938
|
}
|
|
2316
2939
|
}), (() => {
|
|
2317
|
-
var _el$
|
|
2318
|
-
_el$
|
|
2940
|
+
var _el$143 = _$getNextElement(_tmpl$38);
|
|
2941
|
+
_el$143.addEventListener("toggle", event => {
|
|
2319
2942
|
// A late close of the popover that another opening already replaced keeps the new one. Focus returns to the
|
|
2320
2943
|
// grid only from inside the popover, never from what a click outside it chose.
|
|
2321
2944
|
if (event.newState !== "closed" || !popover() || event.currentTarget.matches(":popover-open")) return;
|
|
2322
2945
|
closePopover(focusInPopover());
|
|
2323
2946
|
});
|
|
2324
|
-
_el$
|
|
2325
|
-
var _ref$ = popoverElement;
|
|
2326
|
-
typeof _ref$ === "function" ? _$use(_ref
|
|
2327
|
-
_$insert(_el$
|
|
2947
|
+
_el$143.$$focusin = () => setCreateActive(true);
|
|
2948
|
+
var _ref$3 = popoverElement;
|
|
2949
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$143) : popoverElement = _el$143;
|
|
2950
|
+
_$insert(_el$143, _$createComponent(Show, {
|
|
2328
2951
|
get when() {
|
|
2329
2952
|
return popover();
|
|
2330
2953
|
},
|
|
@@ -2337,16 +2960,16 @@ const MonthView = props => {
|
|
|
2337
2960
|
}) : dayList(value.dayKey)
|
|
2338
2961
|
}));
|
|
2339
2962
|
_$effect(_p$ => {
|
|
2340
|
-
var _v$
|
|
2963
|
+
var _v$33 = (() => {
|
|
2341
2964
|
const current = popover();
|
|
2342
2965
|
if (current?.kind === "day") return dayLabel(parseKey(current.dayKey));
|
|
2343
2966
|
return calendarMessages().calendarQuickCreate;
|
|
2344
2967
|
})(),
|
|
2345
|
-
_v$
|
|
2346
|
-
_v$
|
|
2347
|
-
_v$
|
|
2348
|
-
_v$
|
|
2349
|
-
_v$
|
|
2968
|
+
_v$34 = popover()?.kind,
|
|
2969
|
+
_v$35 = popover()?.kind === "create" && !createActive() ? "true" : undefined;
|
|
2970
|
+
_v$33 !== _p$.e && _$setAttribute(_el$143, "aria-label", _p$.e = _v$33);
|
|
2971
|
+
_v$34 !== _p$.t && _$setAttribute(_el$143, "data-kind", _p$.t = _v$34);
|
|
2972
|
+
_v$35 !== _p$.a && _$setAttribute(_el$143, "data-quiet", _p$.a = _v$35);
|
|
2350
2973
|
return _p$;
|
|
2351
2974
|
}, {
|
|
2352
2975
|
e: undefined,
|
|
@@ -2354,7 +2977,7 @@ const MonthView = props => {
|
|
|
2354
2977
|
a: undefined
|
|
2355
2978
|
});
|
|
2356
2979
|
_$runHydrationEvents();
|
|
2357
|
-
return _el$
|
|
2980
|
+
return _el$143;
|
|
2358
2981
|
})()];
|
|
2359
2982
|
};
|
|
2360
2983
|
const TimeGridView = props => {
|
|
@@ -2592,22 +3215,22 @@ const TimeGridView = props => {
|
|
|
2592
3215
|
});
|
|
2593
3216
|
});
|
|
2594
3217
|
return (() => {
|
|
2595
|
-
var _el$
|
|
2596
|
-
_el$
|
|
2597
|
-
_el$
|
|
2598
|
-
_el$
|
|
2599
|
-
[_el$
|
|
2600
|
-
_el$
|
|
2601
|
-
[_el$
|
|
2602
|
-
_el$
|
|
2603
|
-
_el$
|
|
2604
|
-
_el$
|
|
2605
|
-
_el$
|
|
2606
|
-
[_el$
|
|
2607
|
-
_el$
|
|
2608
|
-
var _ref$
|
|
2609
|
-
typeof _ref$
|
|
2610
|
-
_$insert(_el$
|
|
3218
|
+
var _el$144 = _$getNextElement(_tmpl$40),
|
|
3219
|
+
_el$145 = _el$144.firstChild,
|
|
3220
|
+
_el$146 = _el$145.firstChild,
|
|
3221
|
+
_el$147 = _el$146.nextSibling,
|
|
3222
|
+
[_el$148, _co$38] = _$getNextMarker(_el$147.nextSibling),
|
|
3223
|
+
_el$158 = _el$145.nextSibling,
|
|
3224
|
+
[_el$159, _co$41] = _$getNextMarker(_el$158.nextSibling),
|
|
3225
|
+
_el$153 = _el$159.nextSibling,
|
|
3226
|
+
_el$154 = _el$153.firstChild,
|
|
3227
|
+
_el$155 = _el$154.firstChild,
|
|
3228
|
+
_el$156 = _el$155.nextSibling,
|
|
3229
|
+
[_el$157, _co$40] = _$getNextMarker(_el$156.nextSibling);
|
|
3230
|
+
_el$145.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
3231
|
+
var _ref$4 = daysRow;
|
|
3232
|
+
typeof _ref$4 === "function" ? _$use(_ref$4, _el$145) : daysRow = _el$145;
|
|
3233
|
+
_$insert(_el$145, _$createComponent(For, {
|
|
2611
3234
|
get each() {
|
|
2612
3235
|
return props.days;
|
|
2613
3236
|
},
|
|
@@ -2626,50 +3249,50 @@ const TimeGridView = props => {
|
|
|
2626
3249
|
},
|
|
2627
3250
|
get children() {
|
|
2628
3251
|
return [(() => {
|
|
2629
|
-
var _el$
|
|
2630
|
-
_$insert(_el$
|
|
2631
|
-
_$effect(() => _$setAttribute(_el$
|
|
2632
|
-
return _el$
|
|
3252
|
+
var _el$160 = _$getNextElement(_tmpl$41);
|
|
3253
|
+
_$insert(_el$160, () => formatDay(day, dateConfig()));
|
|
3254
|
+
_$effect(() => _$setAttribute(_el$160, "data-today", today() ? "true" : undefined));
|
|
3255
|
+
return _el$160;
|
|
2633
3256
|
})(), _$createComponent(Show, {
|
|
2634
3257
|
when: dayBadge,
|
|
2635
3258
|
children: badge => (() => {
|
|
2636
|
-
var _el$
|
|
2637
|
-
_el$
|
|
2638
|
-
[_el$
|
|
2639
|
-
_el$
|
|
2640
|
-
[_el$
|
|
2641
|
-
_$insert(_el$
|
|
3259
|
+
var _el$161 = _$getNextElement(_tmpl$42),
|
|
3260
|
+
_el$162 = _el$161.firstChild,
|
|
3261
|
+
[_el$163, _co$42] = _$getNextMarker(_el$162.nextSibling),
|
|
3262
|
+
_el$164 = _el$163.nextSibling,
|
|
3263
|
+
[_el$165, _co$43] = _$getNextMarker(_el$164.nextSibling);
|
|
3264
|
+
_$insert(_el$161, _$createComponent(Show, {
|
|
2642
3265
|
get when() {
|
|
2643
3266
|
return badge().icon;
|
|
2644
3267
|
},
|
|
2645
3268
|
children: icon => (() => {
|
|
2646
|
-
var _el$
|
|
2647
|
-
_$effect(() => _$className(_el$
|
|
2648
|
-
return _el$
|
|
3269
|
+
var _el$166 = _$getNextElement(_tmpl$3);
|
|
3270
|
+
_$effect(() => _$className(_el$166, `k2b-calendar-time-grid__badge-icon ti ti-${icon()}`));
|
|
3271
|
+
return _el$166;
|
|
2649
3272
|
})()
|
|
2650
|
-
}), _el$
|
|
2651
|
-
_$insert(_el$
|
|
2652
|
-
return _el$
|
|
3273
|
+
}), _el$163, _co$42);
|
|
3274
|
+
_$insert(_el$161, () => badge().label, _el$165, _co$43);
|
|
3275
|
+
return _el$161;
|
|
2653
3276
|
})()
|
|
2654
3277
|
})];
|
|
2655
3278
|
}
|
|
2656
3279
|
});
|
|
2657
3280
|
}
|
|
2658
|
-
}), _el$
|
|
2659
|
-
_$insert(_el$
|
|
3281
|
+
}), _el$148, _co$38);
|
|
3282
|
+
_$insert(_el$144, _$createComponent(Show, {
|
|
2660
3283
|
get when() {
|
|
2661
3284
|
return !props.owner.hideAllDay;
|
|
2662
3285
|
},
|
|
2663
3286
|
get children() {
|
|
2664
|
-
var _el$
|
|
2665
|
-
_el$
|
|
2666
|
-
_el$
|
|
2667
|
-
[_el$
|
|
2668
|
-
_el$
|
|
2669
|
-
var _ref$
|
|
2670
|
-
typeof _ref$
|
|
2671
|
-
_$insert(_el$
|
|
2672
|
-
_$insert(_el$
|
|
3287
|
+
var _el$149 = _$getNextElement(_tmpl$39),
|
|
3288
|
+
_el$150 = _el$149.firstChild,
|
|
3289
|
+
_el$151 = _el$150.nextSibling,
|
|
3290
|
+
[_el$152, _co$39] = _$getNextMarker(_el$151.nextSibling);
|
|
3291
|
+
_el$149.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
3292
|
+
var _ref$5 = allDayRow;
|
|
3293
|
+
typeof _ref$5 === "function" ? _$use(_ref$5, _el$149) : allDayRow = _el$149;
|
|
3294
|
+
_$insert(_el$150, () => props.labels.allDay);
|
|
3295
|
+
_$insert(_el$149, _$createComponent(For, {
|
|
2673
3296
|
get each() {
|
|
2674
3297
|
return props.days;
|
|
2675
3298
|
},
|
|
@@ -2678,14 +3301,14 @@ const TimeGridView = props => {
|
|
|
2678
3301
|
const allDay = () => eventsByDay().get(dayKey)?.allDay ?? [];
|
|
2679
3302
|
const previewAllDay = previewEvents().filter(event => event.dayKey === dayKey && event.allDay);
|
|
2680
3303
|
return (() => {
|
|
2681
|
-
var _el$
|
|
2682
|
-
_el$
|
|
2683
|
-
_el$
|
|
2684
|
-
[_el$
|
|
2685
|
-
_el$
|
|
2686
|
-
[_el$
|
|
2687
|
-
_$setAttribute(_el$
|
|
2688
|
-
_$spread(_el$
|
|
3304
|
+
var _el$167 = _$getNextElement(_tmpl$43),
|
|
3305
|
+
_el$168 = _el$167.firstChild,
|
|
3306
|
+
_el$169 = _el$168.firstChild,
|
|
3307
|
+
[_el$170, _co$44] = _$getNextMarker(_el$169.nextSibling),
|
|
3308
|
+
_el$171 = _el$170.nextSibling,
|
|
3309
|
+
[_el$172, _co$45] = _$getNextMarker(_el$171.nextSibling);
|
|
3310
|
+
_$setAttribute(_el$167, "data-calendar-day-key", dayKey);
|
|
3311
|
+
_$spread(_el$167, _$mergeProps({
|
|
2689
3312
|
get ["data-drop-preview"]() {
|
|
2690
3313
|
return timePreview()?.allDay && calendar.formatDateKey(timePreview().start, dateConfig()) === dayKey ? "true" : undefined;
|
|
2691
3314
|
},
|
|
@@ -2700,15 +3323,15 @@ const TimeGridView = props => {
|
|
|
2700
3323
|
allDay: true
|
|
2701
3324
|
};
|
|
2702
3325
|
}, () => performance.now() < suppressSlotClickUntil)), false, true);
|
|
2703
|
-
_$insert(_el$
|
|
3326
|
+
_$insert(_el$168, _$createComponent(For, {
|
|
2704
3327
|
each: previewAllDay,
|
|
2705
3328
|
children: event => (() => {
|
|
2706
|
-
var _el$
|
|
2707
|
-
_$insert(_el$
|
|
2708
|
-
return _el$
|
|
3329
|
+
var _el$173 = _$getNextElement(_tmpl$16);
|
|
3330
|
+
_$insert(_el$173, () => event.title);
|
|
3331
|
+
return _el$173;
|
|
2709
3332
|
})()
|
|
2710
|
-
}), _el$
|
|
2711
|
-
_$insert(_el$
|
|
3333
|
+
}), _el$170, _co$44);
|
|
3334
|
+
_$insert(_el$168, _$createComponent(For, {
|
|
2712
3335
|
get each() {
|
|
2713
3336
|
return allDay();
|
|
2714
3337
|
},
|
|
@@ -2728,50 +3351,50 @@ const TimeGridView = props => {
|
|
|
2728
3351
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startAllDayMove(pointerEvent, event, markDragged) : undefined;
|
|
2729
3352
|
}
|
|
2730
3353
|
})
|
|
2731
|
-
}), _el$
|
|
3354
|
+
}), _el$172, _co$45);
|
|
2732
3355
|
_$runHydrationEvents();
|
|
2733
|
-
return _el$
|
|
3356
|
+
return _el$167;
|
|
2734
3357
|
})();
|
|
2735
3358
|
}
|
|
2736
|
-
}), _el$
|
|
3359
|
+
}), _el$152, _co$39);
|
|
2737
3360
|
_$effect(_p$ => {
|
|
2738
|
-
var _v$
|
|
2739
|
-
_v$
|
|
2740
|
-
_v$
|
|
2741
|
-
_v$
|
|
3361
|
+
var _v$36 = columnTemplate(),
|
|
3362
|
+
_v$37 = `${props.owner.allDayMaxHeightRem ?? 7}rem`;
|
|
3363
|
+
_v$36 !== _p$.e && _$setStyleProperty(_el$149, "grid-template-columns", _p$.e = _v$36);
|
|
3364
|
+
_v$37 !== _p$.t && _$setStyleProperty(_el$149, "max-height", _p$.t = _v$37);
|
|
2742
3365
|
return _p$;
|
|
2743
3366
|
}, {
|
|
2744
3367
|
e: undefined,
|
|
2745
3368
|
t: undefined
|
|
2746
3369
|
});
|
|
2747
|
-
return _el$
|
|
3370
|
+
return _el$149;
|
|
2748
3371
|
}
|
|
2749
|
-
}), _el$
|
|
2750
|
-
_el$
|
|
2751
|
-
var _ref$
|
|
2752
|
-
typeof _ref$
|
|
2753
|
-
var _ref$
|
|
2754
|
-
typeof _ref$
|
|
2755
|
-
var _ref$
|
|
2756
|
-
typeof _ref$
|
|
2757
|
-
_$insert(_el$
|
|
3372
|
+
}), _el$159, _co$41);
|
|
3373
|
+
_el$153.addEventListener("scroll", event => followColumns(event.currentTarget));
|
|
3374
|
+
var _ref$6 = scrollContainer;
|
|
3375
|
+
typeof _ref$6 === "function" ? _$use(_ref$6, _el$153) : scrollContainer = _el$153;
|
|
3376
|
+
var _ref$7 = timeGrid;
|
|
3377
|
+
typeof _ref$7 === "function" ? _$use(_ref$7, _el$154) : timeGrid = _el$154;
|
|
3378
|
+
var _ref$8 = timeGutter;
|
|
3379
|
+
typeof _ref$8 === "function" ? _$use(_ref$8, _el$155) : timeGutter = _el$155;
|
|
3380
|
+
_$insert(_el$155, _$createComponent(For, {
|
|
2758
3381
|
get each() {
|
|
2759
3382
|
return hours();
|
|
2760
3383
|
},
|
|
2761
3384
|
children: hour => (() => {
|
|
2762
|
-
var _el$
|
|
2763
|
-
_el$
|
|
2764
|
-
[_el$
|
|
2765
|
-
_el$
|
|
3385
|
+
var _el$174 = _$getNextElement(_tmpl$44),
|
|
3386
|
+
_el$176 = _el$174.firstChild,
|
|
3387
|
+
[_el$177, _co$46] = _$getNextMarker(_el$176.nextSibling),
|
|
3388
|
+
_el$175 = _el$177.nextSibling;
|
|
2766
3389
|
_$use(element => {
|
|
2767
3390
|
if (hour === businessStartHour()) defaultHourMarker = element;
|
|
2768
|
-
}, _el$
|
|
2769
|
-
_$insert(_el$
|
|
2770
|
-
_$effect(() => _$setAttribute(_el$
|
|
2771
|
-
return _el$
|
|
3391
|
+
}, _el$174);
|
|
3392
|
+
_$insert(_el$174, () => `${hour}`.padStart(2, "0"), _el$177, _co$46);
|
|
3393
|
+
_$effect(() => _$setAttribute(_el$174, "data-outside-business", hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined));
|
|
3394
|
+
return _el$174;
|
|
2772
3395
|
})()
|
|
2773
3396
|
}));
|
|
2774
|
-
_$insert(_el$
|
|
3397
|
+
_$insert(_el$154, _$createComponent(For, {
|
|
2775
3398
|
get each() {
|
|
2776
3399
|
return props.days;
|
|
2777
3400
|
},
|
|
@@ -2779,34 +3402,34 @@ const TimeGridView = props => {
|
|
|
2779
3402
|
const dayKey = calendar.formatDateKey(day, dateConfig());
|
|
2780
3403
|
const layouts = createMemo(() => timedEventLayouts(eventsByDay().get(dayKey)?.timed ?? []));
|
|
2781
3404
|
return (() => {
|
|
2782
|
-
var _el$
|
|
2783
|
-
_el$
|
|
2784
|
-
[_el$
|
|
2785
|
-
_el$
|
|
2786
|
-
[_el$
|
|
2787
|
-
_el$
|
|
2788
|
-
[_el$
|
|
2789
|
-
_el$
|
|
2790
|
-
[_el$
|
|
2791
|
-
_el$
|
|
2792
|
-
[_el$
|
|
2793
|
-
_$insert(_el$
|
|
3405
|
+
var _el$178 = _$getNextElement(_tmpl$46),
|
|
3406
|
+
_el$180 = _el$178.firstChild,
|
|
3407
|
+
[_el$181, _co$47] = _$getNextMarker(_el$180.nextSibling),
|
|
3408
|
+
_el$182 = _el$181.nextSibling,
|
|
3409
|
+
[_el$183, _co$48] = _$getNextMarker(_el$182.nextSibling),
|
|
3410
|
+
_el$184 = _el$183.nextSibling,
|
|
3411
|
+
[_el$185, _co$49] = _$getNextMarker(_el$184.nextSibling),
|
|
3412
|
+
_el$186 = _el$185.nextSibling,
|
|
3413
|
+
[_el$187, _co$50] = _$getNextMarker(_el$186.nextSibling),
|
|
3414
|
+
_el$188 = _el$187.nextSibling,
|
|
3415
|
+
[_el$189, _co$51] = _$getNextMarker(_el$188.nextSibling);
|
|
3416
|
+
_$insert(_el$178, _$createComponent(Show, {
|
|
2794
3417
|
get when() {
|
|
2795
3418
|
return currentTimeLine(day) !== null;
|
|
2796
3419
|
},
|
|
2797
3420
|
get children() {
|
|
2798
|
-
var _el$
|
|
2799
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
2800
|
-
return _el$
|
|
3421
|
+
var _el$179 = _$getNextElement(_tmpl$45);
|
|
3422
|
+
_$effect(_$p => _$setStyleProperty(_el$179, "top", `${currentTimeLine(day) ?? 0}%`));
|
|
3423
|
+
return _el$179;
|
|
2801
3424
|
}
|
|
2802
|
-
}), _el$
|
|
2803
|
-
_$insert(_el$
|
|
3425
|
+
}), _el$181, _co$47);
|
|
3426
|
+
_$insert(_el$178, _$createComponent(For, {
|
|
2804
3427
|
get each() {
|
|
2805
3428
|
return hours();
|
|
2806
3429
|
},
|
|
2807
3430
|
children: hour => (() => {
|
|
2808
|
-
var _el$
|
|
2809
|
-
_$spread(_el$
|
|
3431
|
+
var _el$190 = _$getNextElement(_tmpl$47);
|
|
3432
|
+
_$spread(_el$190, _$mergeProps({
|
|
2810
3433
|
get ["data-outside-business"]() {
|
|
2811
3434
|
return hour < businessStartHour() || hour > businessEndHour() ? "true" : undefined;
|
|
2812
3435
|
},
|
|
@@ -2824,10 +3447,10 @@ const TimeGridView = props => {
|
|
|
2824
3447
|
"onPointerDown": startRange
|
|
2825
3448
|
}), false, false);
|
|
2826
3449
|
_$runHydrationEvents();
|
|
2827
|
-
return _el$
|
|
3450
|
+
return _el$190;
|
|
2828
3451
|
})()
|
|
2829
|
-
}), _el$
|
|
2830
|
-
_$insert(_el$
|
|
3452
|
+
}), _el$183, _co$48);
|
|
3453
|
+
_$insert(_el$178, _$createComponent(For, {
|
|
2831
3454
|
get each() {
|
|
2832
3455
|
return previewEvents().filter(event => event.dayKey === dayKey && !event.allDay);
|
|
2833
3456
|
},
|
|
@@ -2835,44 +3458,44 @@ const TimeGridView = props => {
|
|
|
2835
3458
|
const layout = eventLayout(event);
|
|
2836
3459
|
const short = event.endDate.getTime() - event.startDate.getTime() < 60 * 60_000;
|
|
2837
3460
|
return (() => {
|
|
2838
|
-
var _el$
|
|
2839
|
-
_el$
|
|
2840
|
-
_el$
|
|
2841
|
-
[_el$
|
|
2842
|
-
_el$
|
|
2843
|
-
_el$
|
|
2844
|
-
[_el$
|
|
2845
|
-
_el$
|
|
2846
|
-
_el$
|
|
2847
|
-
[_el$
|
|
2848
|
-
_$setAttribute(_el$
|
|
2849
|
-
_$insert(_el$
|
|
3461
|
+
var _el$191 = _$getNextElement(_tmpl$49),
|
|
3462
|
+
_el$192 = _el$191.firstChild,
|
|
3463
|
+
_el$200 = _el$192.firstChild,
|
|
3464
|
+
[_el$201, _co$54] = _$getNextMarker(_el$200.nextSibling),
|
|
3465
|
+
_el$194 = _el$201.nextSibling,
|
|
3466
|
+
_el$196 = _el$194.firstChild,
|
|
3467
|
+
[_el$197, _co$52] = _$getNextMarker(_el$196.nextSibling),
|
|
3468
|
+
_el$195 = _el$197.nextSibling,
|
|
3469
|
+
_el$198 = _el$195.nextSibling,
|
|
3470
|
+
[_el$199, _co$53] = _$getNextMarker(_el$198.nextSibling);
|
|
3471
|
+
_$setAttribute(_el$191, "data-short", short ? "true" : undefined);
|
|
3472
|
+
_$insert(_el$192, _$createComponent(Show, {
|
|
2850
3473
|
get when() {
|
|
2851
3474
|
return event.title;
|
|
2852
3475
|
},
|
|
2853
3476
|
get children() {
|
|
2854
|
-
var _el$
|
|
2855
|
-
_$insert(_el$
|
|
2856
|
-
return _el$
|
|
3477
|
+
var _el$193 = _$getNextElement(_tmpl$48);
|
|
3478
|
+
_$insert(_el$193, () => event.title);
|
|
3479
|
+
return _el$193;
|
|
2857
3480
|
}
|
|
2858
|
-
}), _el$
|
|
2859
|
-
_$insert(_el$
|
|
2860
|
-
_$insert(_el$
|
|
3481
|
+
}), _el$201, _co$54);
|
|
3482
|
+
_$insert(_el$194, () => formatTime(event.startDate, dateConfig()), _el$197, _co$52);
|
|
3483
|
+
_$insert(_el$194, () => formatTime(event.endDate, dateConfig()), _el$199, _co$53);
|
|
2861
3484
|
_$effect(_p$ => {
|
|
2862
|
-
var _v$
|
|
2863
|
-
_v$
|
|
2864
|
-
_v$
|
|
2865
|
-
_v$
|
|
3485
|
+
var _v$42 = `${layout.top}%`,
|
|
3486
|
+
_v$43 = `${layout.height}%`;
|
|
3487
|
+
_v$42 !== _p$.e && _$setStyleProperty(_el$191, "top", _p$.e = _v$42);
|
|
3488
|
+
_v$43 !== _p$.t && _$setStyleProperty(_el$191, "height", _p$.t = _v$43);
|
|
2866
3489
|
return _p$;
|
|
2867
3490
|
}, {
|
|
2868
3491
|
e: undefined,
|
|
2869
3492
|
t: undefined
|
|
2870
3493
|
});
|
|
2871
|
-
return _el$
|
|
3494
|
+
return _el$191;
|
|
2872
3495
|
})();
|
|
2873
3496
|
}
|
|
2874
|
-
}), _el$
|
|
2875
|
-
_$insert(_el$
|
|
3497
|
+
}), _el$185, _co$49);
|
|
3498
|
+
_$insert(_el$178, _$createComponent(For, {
|
|
2876
3499
|
get each() {
|
|
2877
3500
|
return layouts();
|
|
2878
3501
|
},
|
|
@@ -2915,13 +3538,13 @@ const TimeGridView = props => {
|
|
|
2915
3538
|
});
|
|
2916
3539
|
};
|
|
2917
3540
|
return (() => {
|
|
2918
|
-
var _el$
|
|
2919
|
-
_el$
|
|
2920
|
-
_el$
|
|
2921
|
-
[_el$
|
|
2922
|
-
_el$
|
|
2923
|
-
[_el$
|
|
2924
|
-
_$insert(_el$
|
|
3541
|
+
var _el$202 = _$getNextElement(_tmpl$51),
|
|
3542
|
+
_el$203 = _el$202.firstChild,
|
|
3543
|
+
_el$205 = _el$203.firstChild,
|
|
3544
|
+
[_el$206, _co$55] = _$getNextMarker(_el$205.nextSibling),
|
|
3545
|
+
_el$207 = _el$206.nextSibling,
|
|
3546
|
+
[_el$208, _co$56] = _$getNextMarker(_el$207.nextSibling);
|
|
3547
|
+
_$insert(_el$203, _$createComponent(EventChip, {
|
|
2925
3548
|
event: event,
|
|
2926
3549
|
get owner() {
|
|
2927
3550
|
return props.owner;
|
|
@@ -2936,32 +3559,32 @@ const TimeGridView = props => {
|
|
|
2936
3559
|
get onMovePointerDown() {
|
|
2937
3560
|
return props.owner.onEventDrop ? (pointerEvent, markDragged) => startTimedMove(pointerEvent, event, markDragged) : undefined;
|
|
2938
3561
|
}
|
|
2939
|
-
}), _el$
|
|
2940
|
-
_$insert(_el$
|
|
3562
|
+
}), _el$206, _co$55);
|
|
3563
|
+
_$insert(_el$203, _$createComponent(Show, {
|
|
2941
3564
|
get when() {
|
|
2942
3565
|
return props.owner.onEventResize;
|
|
2943
3566
|
},
|
|
2944
3567
|
get children() {
|
|
2945
|
-
var _el$
|
|
2946
|
-
_el$
|
|
2947
|
-
_el$
|
|
2948
|
-
_$setAttribute(_el$
|
|
2949
|
-
_$effect(() => _$setAttribute(_el$
|
|
3568
|
+
var _el$204 = _$getNextElement(_tmpl$50);
|
|
3569
|
+
_el$204.addEventListener("dragstart", event => event.preventDefault());
|
|
3570
|
+
_el$204.$$pointerdown = resizeStart;
|
|
3571
|
+
_$setAttribute(_el$204, "draggable", false);
|
|
3572
|
+
_$effect(() => _$setAttribute(_el$204, "aria-label", calendarMessages().resizeEvent));
|
|
2950
3573
|
_$runHydrationEvents();
|
|
2951
|
-
return _el$
|
|
3574
|
+
return _el$204;
|
|
2952
3575
|
}
|
|
2953
|
-
}), _el$
|
|
3576
|
+
}), _el$208, _co$56);
|
|
2954
3577
|
_$effect(_p$ => {
|
|
2955
|
-
var _v$
|
|
2956
|
-
_v$
|
|
2957
|
-
_v$
|
|
2958
|
-
_v$
|
|
2959
|
-
_v$
|
|
2960
|
-
_v$
|
|
2961
|
-
_v$
|
|
2962
|
-
_v$
|
|
2963
|
-
_v$
|
|
2964
|
-
_v$
|
|
3578
|
+
var _v$44 = `${layout.top}%`,
|
|
3579
|
+
_v$45 = `${layout.height}%`,
|
|
3580
|
+
_v$46 = position.left,
|
|
3581
|
+
_v$47 = position.width,
|
|
3582
|
+
_v$48 = String(20 + layoutItem.lane);
|
|
3583
|
+
_v$44 !== _p$.e && _$setStyleProperty(_el$202, "top", _p$.e = _v$44);
|
|
3584
|
+
_v$45 !== _p$.t && _$setStyleProperty(_el$202, "height", _p$.t = _v$45);
|
|
3585
|
+
_v$46 !== _p$.a && _$setStyleProperty(_el$202, "left", _p$.a = _v$46);
|
|
3586
|
+
_v$47 !== _p$.o && _$setStyleProperty(_el$202, "width", _p$.o = _v$47);
|
|
3587
|
+
_v$48 !== _p$.i && _$setStyleProperty(_el$202, "z-index", _p$.i = _v$48);
|
|
2965
3588
|
return _p$;
|
|
2966
3589
|
}, {
|
|
2967
3590
|
e: undefined,
|
|
@@ -2970,11 +3593,11 @@ const TimeGridView = props => {
|
|
|
2970
3593
|
o: undefined,
|
|
2971
3594
|
i: undefined
|
|
2972
3595
|
});
|
|
2973
|
-
return _el$
|
|
3596
|
+
return _el$202;
|
|
2974
3597
|
})();
|
|
2975
3598
|
}
|
|
2976
|
-
}), _el$
|
|
2977
|
-
_$insert(_el$
|
|
3599
|
+
}), _el$187, _co$50);
|
|
3600
|
+
_$insert(_el$178, _$createComponent(For, {
|
|
2978
3601
|
get each() {
|
|
2979
3602
|
return overflowLayouts(layouts());
|
|
2980
3603
|
},
|
|
@@ -2983,27 +3606,27 @@ const TimeGridView = props => {
|
|
|
2983
3606
|
const key = `${dayKey}-${overflow.groupId}`;
|
|
2984
3607
|
const hiddenTitle = () => overflow.hiddenEvents.map(event => `${formatTime(event.startDate, dateConfig())} ${event.title}`).join("\n");
|
|
2985
3608
|
return [(() => {
|
|
2986
|
-
var _el$
|
|
2987
|
-
_el$
|
|
2988
|
-
_el$
|
|
2989
|
-
_el$
|
|
2990
|
-
[_el$
|
|
2991
|
-
_el$
|
|
3609
|
+
var _el$209 = _$getNextElement(_tmpl$52),
|
|
3610
|
+
_el$210 = _el$209.firstChild,
|
|
3611
|
+
_el$211 = _el$210.firstChild,
|
|
3612
|
+
_el$212 = _el$211.nextSibling,
|
|
3613
|
+
[_el$213, _co$57] = _$getNextMarker(_el$212.nextSibling);
|
|
3614
|
+
_el$209.$$click = event => {
|
|
2992
3615
|
event.stopPropagation();
|
|
2993
3616
|
setExpandedOverflow(expandedOverflow() === key ? "" : key);
|
|
2994
3617
|
};
|
|
2995
|
-
_$insert(_el$
|
|
3618
|
+
_$insert(_el$210, () => overflow.hiddenEvents.length, _el$213, _co$57);
|
|
2996
3619
|
_$effect(_p$ => {
|
|
2997
|
-
var _v$
|
|
2998
|
-
_v$
|
|
2999
|
-
_v$
|
|
3000
|
-
_v$
|
|
3620
|
+
var _v$49 = `${layout.top}%`,
|
|
3621
|
+
_v$50 = `${layout.height}%`,
|
|
3622
|
+
_v$51 = hiddenTitle(),
|
|
3623
|
+
_v$52 = calendarMessages().hiddenOverlappingEvents({
|
|
3001
3624
|
count: overflow.hiddenEvents.length
|
|
3002
3625
|
});
|
|
3003
|
-
_v$
|
|
3004
|
-
_v$
|
|
3005
|
-
_v$
|
|
3006
|
-
_v$
|
|
3626
|
+
_v$49 !== _p$.e && _$setStyleProperty(_el$209, "top", _p$.e = _v$49);
|
|
3627
|
+
_v$50 !== _p$.t && _$setStyleProperty(_el$209, "height", _p$.t = _v$50);
|
|
3628
|
+
_v$51 !== _p$.a && _$setAttribute(_el$209, "title", _p$.a = _v$51);
|
|
3629
|
+
_v$52 !== _p$.o && _$setAttribute(_el$209, "aria-label", _p$.o = _v$52);
|
|
3007
3630
|
return _p$;
|
|
3008
3631
|
}, {
|
|
3009
3632
|
e: undefined,
|
|
@@ -3012,24 +3635,24 @@ const TimeGridView = props => {
|
|
|
3012
3635
|
o: undefined
|
|
3013
3636
|
});
|
|
3014
3637
|
_$runHydrationEvents();
|
|
3015
|
-
return _el$
|
|
3638
|
+
return _el$209;
|
|
3016
3639
|
})(), _$createComponent(Show, {
|
|
3017
3640
|
get when() {
|
|
3018
3641
|
return expandedOverflow() === key;
|
|
3019
3642
|
},
|
|
3020
3643
|
get children() {
|
|
3021
|
-
var _el$
|
|
3022
|
-
_el$
|
|
3023
|
-
_el$
|
|
3024
|
-
[_el$
|
|
3025
|
-
_el$
|
|
3026
|
-
_el$
|
|
3027
|
-
[_el$
|
|
3028
|
-
_el$
|
|
3029
|
-
[_el$
|
|
3030
|
-
_$insert(_el$
|
|
3031
|
-
_$insert(_el$
|
|
3032
|
-
_$insert(_el$
|
|
3644
|
+
var _el$214 = _$getNextElement(_tmpl$53),
|
|
3645
|
+
_el$215 = _el$214.firstChild,
|
|
3646
|
+
_el$217 = _el$215.firstChild,
|
|
3647
|
+
[_el$218, _co$58] = _$getNextMarker(_el$217.nextSibling),
|
|
3648
|
+
_el$216 = _el$218.nextSibling,
|
|
3649
|
+
_el$219 = _el$216.nextSibling,
|
|
3650
|
+
[_el$220, _co$59] = _$getNextMarker(_el$219.nextSibling),
|
|
3651
|
+
_el$221 = _el$215.nextSibling,
|
|
3652
|
+
[_el$222, _co$60] = _$getNextMarker(_el$221.nextSibling);
|
|
3653
|
+
_$insert(_el$215, () => formatTime(overflow.groupStartDate, dateConfig()), _el$218, _co$58);
|
|
3654
|
+
_$insert(_el$215, () => formatTime(overflow.groupEndDate, dateConfig()), _el$220, _co$59);
|
|
3655
|
+
_$insert(_el$214, _$createComponent(For, {
|
|
3033
3656
|
get each() {
|
|
3034
3657
|
return overflow.hiddenEvents;
|
|
3035
3658
|
},
|
|
@@ -3043,27 +3666,27 @@ const TimeGridView = props => {
|
|
|
3043
3666
|
},
|
|
3044
3667
|
compact: true
|
|
3045
3668
|
})
|
|
3046
|
-
}), _el$
|
|
3047
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
3048
|
-
return _el$
|
|
3669
|
+
}), _el$222, _co$60);
|
|
3670
|
+
_$effect(_$p => _$setStyleProperty(_el$214, "top", `${layout.top}%`));
|
|
3671
|
+
return _el$214;
|
|
3049
3672
|
}
|
|
3050
3673
|
})];
|
|
3051
3674
|
}
|
|
3052
|
-
}), _el$
|
|
3053
|
-
_$effect(_$p => _$setStyleProperty(_el$
|
|
3054
|
-
return _el$
|
|
3675
|
+
}), _el$189, _co$51);
|
|
3676
|
+
_$effect(_$p => _$setStyleProperty(_el$178, "grid-template-rows", `repeat(${hours().length}, minmax(4rem, 1fr))`));
|
|
3677
|
+
return _el$178;
|
|
3055
3678
|
})();
|
|
3056
3679
|
}
|
|
3057
|
-
}), _el$
|
|
3680
|
+
}), _el$157, _co$40);
|
|
3058
3681
|
_$effect(_p$ => {
|
|
3059
|
-
var _v$
|
|
3060
|
-
_v$
|
|
3061
|
-
_v$
|
|
3062
|
-
_v$
|
|
3063
|
-
_v$
|
|
3064
|
-
_v$
|
|
3065
|
-
_v$
|
|
3066
|
-
_v$
|
|
3682
|
+
var _v$38 = isDayView() ? "day" : "week",
|
|
3683
|
+
_v$39 = columnTemplate(),
|
|
3684
|
+
_v$40 = columnTemplate(),
|
|
3685
|
+
_v$41 = `repeat(${hours().length}, minmax(4rem, 1fr))`;
|
|
3686
|
+
_v$38 !== _p$.e && _$setAttribute(_el$144, "data-view", _p$.e = _v$38);
|
|
3687
|
+
_v$39 !== _p$.t && _$setStyleProperty(_el$145, "grid-template-columns", _p$.t = _v$39);
|
|
3688
|
+
_v$40 !== _p$.a && _$setStyleProperty(_el$154, "grid-template-columns", _p$.a = _v$40);
|
|
3689
|
+
_v$41 !== _p$.o && _$setStyleProperty(_el$155, "grid-template-rows", _p$.o = _v$41);
|
|
3067
3690
|
return _p$;
|
|
3068
3691
|
}, {
|
|
3069
3692
|
e: undefined,
|
|
@@ -3071,7 +3694,7 @@ const TimeGridView = props => {
|
|
|
3071
3694
|
a: undefined,
|
|
3072
3695
|
o: undefined
|
|
3073
3696
|
});
|
|
3074
|
-
return _el$
|
|
3697
|
+
return _el$144;
|
|
3075
3698
|
})();
|
|
3076
3699
|
};
|
|
3077
3700
|
const YearView = props => {
|
|
@@ -3112,17 +3735,17 @@ const YearView = props => {
|
|
|
3112
3735
|
});
|
|
3113
3736
|
});
|
|
3114
3737
|
return (() => {
|
|
3115
|
-
var _el$
|
|
3116
|
-
_$insert(_el$
|
|
3738
|
+
var _el$223 = _$getNextElement(_tmpl$54);
|
|
3739
|
+
_$insert(_el$223, _$createComponent(For, {
|
|
3117
3740
|
get each() {
|
|
3118
3741
|
return months();
|
|
3119
3742
|
},
|
|
3120
3743
|
children: month => (() => {
|
|
3121
|
-
var _el$
|
|
3122
|
-
_el$
|
|
3123
|
-
_el$
|
|
3124
|
-
_$insert(_el$
|
|
3125
|
-
_$insert(_el$
|
|
3744
|
+
var _el$224 = _$getNextElement(_tmpl$55),
|
|
3745
|
+
_el$225 = _el$224.firstChild,
|
|
3746
|
+
_el$226 = _el$225.nextSibling;
|
|
3747
|
+
_$insert(_el$225, () => month.label);
|
|
3748
|
+
_$insert(_el$226, _$createComponent(For, {
|
|
3126
3749
|
get each() {
|
|
3127
3750
|
return month.days;
|
|
3128
3751
|
},
|
|
@@ -3146,32 +3769,32 @@ const YearView = props => {
|
|
|
3146
3769
|
return day.events[0];
|
|
3147
3770
|
},
|
|
3148
3771
|
children: event => (() => {
|
|
3149
|
-
var _el$
|
|
3772
|
+
var _el$227 = _$getNextElement(_tmpl$56);
|
|
3150
3773
|
_$effect(_p$ => {
|
|
3151
|
-
var _v$
|
|
3152
|
-
_v$
|
|
3153
|
-
_v$
|
|
3774
|
+
var _v$53 = event().colorHex ? undefined : event().color ?? "blue",
|
|
3775
|
+
_v$54 = day.isToday ? "true" : undefined,
|
|
3776
|
+
_v$55 = event().colorHex ? {
|
|
3154
3777
|
"background-color": day.isToday ? "white" : event().colorHex
|
|
3155
3778
|
} : undefined;
|
|
3156
|
-
_v$
|
|
3157
|
-
_v$
|
|
3158
|
-
_p$.a = _$style(_el$
|
|
3779
|
+
_v$53 !== _p$.e && _$setAttribute(_el$227, "data-color", _p$.e = _v$53);
|
|
3780
|
+
_v$54 !== _p$.t && _$setAttribute(_el$227, "data-today", _p$.t = _v$54);
|
|
3781
|
+
_p$.a = _$style(_el$227, _v$55, _p$.a);
|
|
3159
3782
|
return _p$;
|
|
3160
3783
|
}, {
|
|
3161
3784
|
e: undefined,
|
|
3162
3785
|
t: undefined,
|
|
3163
3786
|
a: undefined
|
|
3164
3787
|
});
|
|
3165
|
-
return _el$
|
|
3788
|
+
return _el$227;
|
|
3166
3789
|
})()
|
|
3167
3790
|
})];
|
|
3168
3791
|
}
|
|
3169
3792
|
})
|
|
3170
3793
|
}));
|
|
3171
|
-
return _el$
|
|
3794
|
+
return _el$224;
|
|
3172
3795
|
})()
|
|
3173
3796
|
}));
|
|
3174
|
-
return _el$
|
|
3797
|
+
return _el$223;
|
|
3175
3798
|
})();
|
|
3176
3799
|
};
|
|
3177
3800
|
const MobileMonthView = props => {
|
|
@@ -3179,14 +3802,14 @@ const MobileMonthView = props => {
|
|
|
3179
3802
|
const selectedDateKey = createMemo(() => calendar.formatDateKey(props.selectedDate, dateConfig()));
|
|
3180
3803
|
const selectedEvents = createMemo(() => props.events.filter(event => event.dayKey === selectedDateKey()));
|
|
3181
3804
|
return (() => {
|
|
3182
|
-
var _el$
|
|
3183
|
-
_el$
|
|
3184
|
-
[_el$
|
|
3185
|
-
_el$
|
|
3186
|
-
_el$
|
|
3187
|
-
_el$
|
|
3188
|
-
[_el$
|
|
3189
|
-
_$insert(_el$
|
|
3805
|
+
var _el$228 = _$getNextElement(_tmpl$58),
|
|
3806
|
+
_el$234 = _el$228.firstChild,
|
|
3807
|
+
[_el$235, _co$62] = _$getNextMarker(_el$234.nextSibling),
|
|
3808
|
+
_el$229 = _el$235.nextSibling,
|
|
3809
|
+
_el$230 = _el$229.firstChild,
|
|
3810
|
+
_el$232 = _el$230.nextSibling,
|
|
3811
|
+
[_el$233, _co$61] = _$getNextMarker(_el$232.nextSibling);
|
|
3812
|
+
_$insert(_el$228, _$createComponent(MonthPickerView, {
|
|
3190
3813
|
get owner() {
|
|
3191
3814
|
return {
|
|
3192
3815
|
...props.owner,
|
|
@@ -3206,27 +3829,27 @@ const MobileMonthView = props => {
|
|
|
3206
3829
|
return props.labels;
|
|
3207
3830
|
},
|
|
3208
3831
|
compact: true
|
|
3209
|
-
}), _el$
|
|
3210
|
-
_$insert(_el$
|
|
3832
|
+
}), _el$235, _co$62);
|
|
3833
|
+
_$insert(_el$230, () => props.selectedDate.toLocaleDateString(dateConfig().locale ?? "en", {
|
|
3211
3834
|
weekday: "long",
|
|
3212
3835
|
month: "long",
|
|
3213
3836
|
day: "numeric",
|
|
3214
3837
|
timeZone: dateConfig().timeZone
|
|
3215
3838
|
}));
|
|
3216
|
-
_$insert(_el$
|
|
3839
|
+
_$insert(_el$229, _$createComponent(Show, {
|
|
3217
3840
|
get when() {
|
|
3218
3841
|
return selectedEvents().length > 0;
|
|
3219
3842
|
},
|
|
3220
3843
|
get fallback() {
|
|
3221
3844
|
return (() => {
|
|
3222
|
-
var _el$
|
|
3223
|
-
_$insert(_el$
|
|
3224
|
-
return _el$
|
|
3845
|
+
var _el$236 = _$getNextElement(_tmpl$59);
|
|
3846
|
+
_$insert(_el$236, () => props.labels.noEvents);
|
|
3847
|
+
return _el$236;
|
|
3225
3848
|
})();
|
|
3226
3849
|
},
|
|
3227
3850
|
get children() {
|
|
3228
|
-
var _el$
|
|
3229
|
-
_$insert(_el$
|
|
3851
|
+
var _el$231 = _$getNextElement(_tmpl$57);
|
|
3852
|
+
_$insert(_el$231, _$createComponent(For, {
|
|
3230
3853
|
get each() {
|
|
3231
3854
|
return selectedEvents();
|
|
3232
3855
|
},
|
|
@@ -3240,16 +3863,16 @@ const MobileMonthView = props => {
|
|
|
3240
3863
|
}
|
|
3241
3864
|
})
|
|
3242
3865
|
}));
|
|
3243
|
-
return _el$
|
|
3866
|
+
return _el$231;
|
|
3244
3867
|
}
|
|
3245
|
-
}), _el$
|
|
3246
|
-
return _el$
|
|
3868
|
+
}), _el$233, _co$61);
|
|
3869
|
+
return _el$228;
|
|
3247
3870
|
})();
|
|
3248
3871
|
};
|
|
3249
3872
|
const CalendarBody = props => (() => {
|
|
3250
|
-
var _el$
|
|
3251
|
-
_$insert(_el$
|
|
3252
|
-
return _el$
|
|
3873
|
+
var _el$237 = _$getNextElement(_tmpl$60);
|
|
3874
|
+
_$insert(_el$237, () => props.children);
|
|
3875
|
+
return _el$237;
|
|
3253
3876
|
})();
|
|
3254
3877
|
const CalendarRoot = props => {
|
|
3255
3878
|
const messages = useUiMessages();
|
|
@@ -3304,24 +3927,26 @@ const CalendarRoot = props => {
|
|
|
3304
3927
|
// The day and week views with `dayHours` scroll through their days; the header and the commands ask them first.
|
|
3305
3928
|
const [timeView, setTimeView] = createSignal(null);
|
|
3306
3929
|
const [monthCreate, setMonthCreate] = createSignal(null);
|
|
3930
|
+
const monthView = () => monthCreate()?.continuous() ? monthCreate() : null;
|
|
3931
|
+
const scrollingView = () => timeView() ?? monthView();
|
|
3307
3932
|
const timeMode = () => Boolean(props.dayHours) && (view() === "day" || view() === "week");
|
|
3308
3933
|
const parseKey = key => calendar.parseCalendarDate(key, dateConfig());
|
|
3309
3934
|
/** The first shown day of a day or week view, or the selected day of the month view, for the other views. */
|
|
3310
3935
|
const shownDay = () => {
|
|
3311
3936
|
const first = timeView()?.visibleKeys().first;
|
|
3312
3937
|
if (first) return parseKey(first);
|
|
3313
|
-
return view() === "month" ? focusDay() : null;
|
|
3938
|
+
return view() === "month" ? focusDay() ?? monthView()?.focusDay() ?? null : null;
|
|
3314
3939
|
};
|
|
3315
3940
|
const go = (target, nextView) => {
|
|
3316
3941
|
const href = props.getDateHref?.(target, nextView);
|
|
3317
3942
|
if (href) followCalendarHref(owner, href);else openViewAt(props, target, nextView);
|
|
3318
3943
|
};
|
|
3319
3944
|
const step = direction => {
|
|
3320
|
-
if (
|
|
3321
|
-
go(adjacentCalendarDate(shownDay() ?? date(), view(), direction, dateConfig()), view());
|
|
3945
|
+
if (scrollingView()?.step(direction)) return;
|
|
3946
|
+
go(adjacentCalendarDate(monthView()?.stepFrom() ?? shownDay() ?? date(), view(), direction, dateConfig()), view());
|
|
3322
3947
|
};
|
|
3323
3948
|
const goToday = () => {
|
|
3324
|
-
if (
|
|
3949
|
+
if (scrollingView()?.today()) return;
|
|
3325
3950
|
go(calendar.today(dateConfig()), view());
|
|
3326
3951
|
};
|
|
3327
3952
|
const goView = nextView => {
|
|
@@ -3334,7 +3959,7 @@ const CalendarRoot = props => {
|
|
|
3334
3959
|
if (href) followCalendarHref(owner, href);else props.onViewChange?.(nextView);
|
|
3335
3960
|
};
|
|
3336
3961
|
const goToKey = key => {
|
|
3337
|
-
if (
|
|
3962
|
+
if (scrollingView()?.goTo(key)) return;
|
|
3338
3963
|
go(parseKey(key), view());
|
|
3339
3964
|
};
|
|
3340
3965
|
const openGoTo = () => void openCalendarGoTo({
|
|
@@ -3429,6 +4054,7 @@ const CalendarRoot = props => {
|
|
|
3429
4054
|
});
|
|
3430
4055
|
const headerNav = {
|
|
3431
4056
|
timeView,
|
|
4057
|
+
monthView,
|
|
3432
4058
|
commands: () => props.onCommandsChange ? allCommands() : [],
|
|
3433
4059
|
// The arrow keys page like J and K, so the list names them beside those keys.
|
|
3434
4060
|
openShortcuts: () => void openCalendarShortcuts(allCommands(), calendarMessages(), custom() ? {} : {
|
|
@@ -3475,14 +4101,14 @@ const CalendarRoot = props => {
|
|
|
3475
4101
|
register: setTimeView
|
|
3476
4102
|
});
|
|
3477
4103
|
return (() => {
|
|
3478
|
-
var _el$
|
|
3479
|
-
_el$
|
|
3480
|
-
[_el$
|
|
3481
|
-
_el$
|
|
3482
|
-
[_el$
|
|
3483
|
-
var _ref$
|
|
3484
|
-
typeof _ref$
|
|
3485
|
-
_$insert(_el$
|
|
4104
|
+
var _el$238 = _$getNextElement(_tmpl$61),
|
|
4105
|
+
_el$239 = _el$238.firstChild,
|
|
4106
|
+
[_el$240, _co$63] = _$getNextMarker(_el$239.nextSibling),
|
|
4107
|
+
_el$241 = _el$240.nextSibling,
|
|
4108
|
+
[_el$242, _co$64] = _$getNextMarker(_el$241.nextSibling);
|
|
4109
|
+
var _ref$9 = root;
|
|
4110
|
+
typeof _ref$9 === "function" ? _$use(_ref$9, _el$238) : root = _el$238;
|
|
4111
|
+
_$insert(_el$238, _$createComponent(CalendarHeader, {
|
|
3486
4112
|
get date() {
|
|
3487
4113
|
return date();
|
|
3488
4114
|
},
|
|
@@ -3494,11 +4120,11 @@ const CalendarRoot = props => {
|
|
|
3494
4120
|
},
|
|
3495
4121
|
owner: owner,
|
|
3496
4122
|
get focusDay() {
|
|
3497
|
-
return _$memo(() => view() === "month"
|
|
4123
|
+
return _$memo(() => !!(view() === "month" || timeView()))() ? shownDay() : null;
|
|
3498
4124
|
},
|
|
3499
4125
|
nav: headerNav
|
|
3500
|
-
}), _el$
|
|
3501
|
-
_$insert(_el$
|
|
4126
|
+
}), _el$240, _co$63);
|
|
4127
|
+
_$insert(_el$238, _$createComponent(Show, {
|
|
3502
4128
|
get when() {
|
|
3503
4129
|
return !custom();
|
|
3504
4130
|
},
|
|
@@ -3532,6 +4158,7 @@ const CalendarRoot = props => {
|
|
|
3532
4158
|
return mergedLabels();
|
|
3533
4159
|
},
|
|
3534
4160
|
onFocusDay: setFocusDay,
|
|
4161
|
+
goToDate: date => go(date, view()),
|
|
3535
4162
|
register: setMonthCreate
|
|
3536
4163
|
});
|
|
3537
4164
|
}
|
|
@@ -3635,18 +4262,18 @@ const CalendarRoot = props => {
|
|
|
3635
4262
|
}
|
|
3636
4263
|
});
|
|
3637
4264
|
}
|
|
3638
|
-
}), _el$
|
|
4265
|
+
}), _el$242, _co$64);
|
|
3639
4266
|
_$effect(_p$ => {
|
|
3640
|
-
var _v$
|
|
3641
|
-
_v$
|
|
3642
|
-
_v$
|
|
3643
|
-
_v$
|
|
4267
|
+
var _v$56 = `k2b-content-calendar ${props.class ?? ""}`,
|
|
4268
|
+
_v$57 = props.navigationPending ? "true" : undefined;
|
|
4269
|
+
_v$56 !== _p$.e && _$className(_el$238, _p$.e = _v$56);
|
|
4270
|
+
_v$57 !== _p$.t && _$setAttribute(_el$238, "aria-busy", _p$.t = _v$57);
|
|
3644
4271
|
return _p$;
|
|
3645
4272
|
}, {
|
|
3646
4273
|
e: undefined,
|
|
3647
4274
|
t: undefined
|
|
3648
4275
|
});
|
|
3649
|
-
return _el$
|
|
4276
|
+
return _el$238;
|
|
3650
4277
|
})();
|
|
3651
4278
|
};
|
|
3652
4279
|
|