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