@k2b/ui 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/content/Calendar.js +1086 -1049
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +1187 -0
- package/dist/browser/content/CalendarDayView.js.map +1 -0
- package/dist/browser/content/CalendarWeekView.js +1571 -0
- package/dist/browser/content/CalendarWeekView.js.map +1 -0
- package/dist/browser/content/ChartExplorer.js +174 -82
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartFilterControls.js +90 -33
- package/dist/browser/content/ChartFilterControls.js.map +1 -1
- package/dist/browser/content/DataTable.js +199 -171
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +98 -0
- package/dist/browser/content/calendar-day-scroll.js.map +1 -0
- package/dist/browser/content/calendar-days.js +408 -0
- package/dist/browser/content/calendar-days.js.map +1 -0
- package/dist/browser/content/calendar-dialogs.js +236 -0
- package/dist/browser/content/calendar-dialogs.js.map +1 -0
- package/dist/browser/content/calendar-messages.js +210 -2
- package/dist/browser/content/calendar-messages.js.map +1 -1
- package/dist/browser/content/calendar-pointer.js +15 -3
- package/dist/browser/content/calendar-pointer.js.map +1 -1
- package/dist/browser/content/calendar-shared.js +328 -0
- package/dist/browser/content/calendar-shared.js.map +1 -0
- package/dist/browser/content/calendar-time-view.js +1649 -0
- package/dist/browser/content/calendar-time-view.js.map +1 -0
- package/dist/browser/content/chart-messages.js +10 -0
- package/dist/browser/content/chart-messages.js.map +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +0 -1
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +123 -97
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/PageTitle.js +4 -1
- package/dist/browser/layout/PageTitle.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +164 -86
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +18 -6
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/content/Calendar.js +524 -335
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +800 -0
- package/dist/ssr/content/CalendarDayView.js.map +1 -0
- package/dist/ssr/content/CalendarWeekView.js +1069 -0
- package/dist/ssr/content/CalendarWeekView.js.map +1 -0
- package/dist/ssr/content/ChartExplorer.js +93 -34
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartFilterControls.js +49 -7
- package/dist/ssr/content/ChartFilterControls.js.map +1 -1
- package/dist/ssr/content/DataTable.js +69 -51
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +98 -0
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -0
- package/dist/ssr/content/calendar-days.js +408 -0
- package/dist/ssr/content/calendar-days.js.map +1 -0
- package/dist/ssr/content/calendar-dialogs.js +159 -0
- package/dist/ssr/content/calendar-dialogs.js.map +1 -0
- package/dist/ssr/content/calendar-messages.js +210 -2
- package/dist/ssr/content/calendar-messages.js.map +1 -1
- package/dist/ssr/content/calendar-pointer.js +15 -3
- package/dist/ssr/content/calendar-pointer.js.map +1 -1
- package/dist/ssr/content/calendar-shared.js +261 -0
- package/dist/ssr/content/calendar-shared.js.map +1 -0
- package/dist/ssr/content/calendar-time-view.js +1306 -0
- package/dist/ssr/content/calendar-time-view.js.map +1 -0
- package/dist/ssr/content/chart-messages.js +10 -0
- package/dist/ssr/content/chart-messages.js.map +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +38 -29
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/PageTitle.js +4 -1
- package/dist/ssr/layout/PageTitle.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +164 -86
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +2 -2
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/content/Calendar.d.ts +91 -0
- package/dist/types/content/CalendarDayView.d.ts +7 -0
- package/dist/types/content/CalendarWeekView.d.ts +7 -0
- package/dist/types/content/ChartExplorer.d.ts +36 -1
- package/dist/types/content/ChartFilterControls.d.ts +6 -1
- package/dist/types/content/DataTable.d.ts +5 -0
- package/dist/types/content/calendar-day-scroll.d.ts +42 -0
- package/dist/types/content/calendar-days.d.ts +192 -0
- package/dist/types/content/calendar-dialogs.d.ts +22 -0
- package/dist/types/content/calendar-messages.d.ts +99 -0
- package/dist/types/content/calendar-pointer.d.ts +9 -0
- package/dist/types/content/calendar-shared.d.ts +69 -0
- package/dist/types/content/calendar-time-view.d.ts +252 -0
- package/dist/types/content/chart-messages.d.ts +5 -0
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/layout/AppWorkspace.d.ts +25 -3
- package/dist/types/layout/PageTitle.d.ts +2 -1
- package/dist/types/layout/app-workspace-controller.d.ts +9 -1
- package/dist/types/surfaces/StatCell.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { template as _$template } from "solid-js/web";
|
|
2
|
+
import { delegateEvents as _$delegateEvents } from "solid-js/web";
|
|
3
|
+
import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
|
|
4
|
+
import { memo as _$memo } from "solid-js/web";
|
|
5
|
+
import { setProperty as _$setProperty } from "solid-js/web";
|
|
6
|
+
import { effect as _$effect } from "solid-js/web";
|
|
7
|
+
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
8
|
+
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
9
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
10
|
+
import { insert as _$insert } from "solid-js/web";
|
|
11
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
12
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<div class=k2b-dialog__panel><!$><!/><div class=k2b-dialog__body><dl class=k2b-calendar-shortcuts></dl><p class=k2b-calendar-shortcuts__note>`),
|
|
13
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<dt><!$><!/><!$><!/>`),
|
|
14
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<dd>`),
|
|
15
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<kbd class=k2b-calendar-shortcuts__key>`),
|
|
16
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<span class=k2b-calendar-shortcuts__or>/`),
|
|
17
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<form class=k2b-dialog__panel><!$><!/><div class="k2b-dialog__body k2b-calendar-goto"><input class=k2b-calendar-goto__input type=text autocomplete=off aria-describedby=k2b-calendar-goto-hint><p class=k2b-calendar-goto__preview id=k2b-calendar-goto-hint aria-live=polite></p></div><footer class=k2b-dialog__actions><button type=submit class=k2b-button data-variant=primary data-size=sm>`);
|
|
18
|
+
import { createSignal, For, Show } from "solid-js";
|
|
19
|
+
import { dialogCore } from "../feedback/dialog-core";
|
|
20
|
+
import { DialogHeader } from "../feedback/prompts";
|
|
21
|
+
import { addDayKeys } from "./calendar-days";
|
|
22
|
+
const isMac = () => typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform);
|
|
23
|
+
|
|
24
|
+
/** The keys of a shortcut as the reader presses them, such as ["⇧", "N"] or ["Shift", "N"]. */
|
|
25
|
+
export const shortcutKeys = shortcut => {
|
|
26
|
+
const mac = isMac();
|
|
27
|
+
const names = {
|
|
28
|
+
shift: mac ? "⇧" : "Shift",
|
|
29
|
+
alt: mac ? "⌥" : "Alt",
|
|
30
|
+
ctrl: mac ? "⌃" : "Ctrl",
|
|
31
|
+
meta: mac ? "⌘" : "Meta",
|
|
32
|
+
mod: mac ? "⌘" : "Ctrl",
|
|
33
|
+
arrowup: "↑",
|
|
34
|
+
arrowdown: "↓",
|
|
35
|
+
arrowleft: "←",
|
|
36
|
+
arrowright: "→"
|
|
37
|
+
};
|
|
38
|
+
return shortcut.split("+").map(part => names[part.toLowerCase()] ?? (part.length === 1 ? part.toUpperCase() : part));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The calendar's shortcuts: the same list the host registers for its dispatcher and its help. `alternatives` names
|
|
43
|
+
* other keys the calendar itself handles for a command, such as the arrow keys that page like J and K.
|
|
44
|
+
*/
|
|
45
|
+
export const openCalendarShortcuts = (commands, messages, alternatives = {}) => dialogCore.open(close => (() => {
|
|
46
|
+
var _el$ = _$getNextElement(_tmpl$),
|
|
47
|
+
_el$5 = _el$.firstChild,
|
|
48
|
+
[_el$6, _co$] = _$getNextMarker(_el$5.nextSibling),
|
|
49
|
+
_el$2 = _el$6.nextSibling,
|
|
50
|
+
_el$3 = _el$2.firstChild,
|
|
51
|
+
_el$4 = _el$3.nextSibling;
|
|
52
|
+
_$insert(_el$, _$createComponent(DialogHeader, {
|
|
53
|
+
get title() {
|
|
54
|
+
return messages.calendarShortcuts;
|
|
55
|
+
},
|
|
56
|
+
icon: "ti ti-keyboard",
|
|
57
|
+
close: () => close()
|
|
58
|
+
}), _el$6, _co$);
|
|
59
|
+
_$insert(_el$3, _$createComponent(For, {
|
|
60
|
+
get each() {
|
|
61
|
+
return commands.filter(command => command.shortcut);
|
|
62
|
+
},
|
|
63
|
+
children: command => [(() => {
|
|
64
|
+
var _el$7 = _$getNextElement(_tmpl$2),
|
|
65
|
+
_el$8 = _el$7.firstChild,
|
|
66
|
+
[_el$9, _co$2] = _$getNextMarker(_el$8.nextSibling),
|
|
67
|
+
_el$0 = _el$9.nextSibling,
|
|
68
|
+
[_el$1, _co$3] = _$getNextMarker(_el$0.nextSibling);
|
|
69
|
+
_$insert(_el$7, _$createComponent(For, {
|
|
70
|
+
get each() {
|
|
71
|
+
return shortcutKeys(command.shortcut);
|
|
72
|
+
},
|
|
73
|
+
children: key => (() => {
|
|
74
|
+
var _el$11 = _$getNextElement(_tmpl$4);
|
|
75
|
+
_$insert(_el$11, key);
|
|
76
|
+
return _el$11;
|
|
77
|
+
})()
|
|
78
|
+
}), _el$9, _co$2);
|
|
79
|
+
_$insert(_el$7, _$createComponent(Show, {
|
|
80
|
+
get when() {
|
|
81
|
+
return alternatives[command.id];
|
|
82
|
+
},
|
|
83
|
+
children: other => [_$getNextElement(_tmpl$5), _$createComponent(For, {
|
|
84
|
+
get each() {
|
|
85
|
+
return shortcutKeys(other());
|
|
86
|
+
},
|
|
87
|
+
children: key => (() => {
|
|
88
|
+
var _el$13 = _$getNextElement(_tmpl$4);
|
|
89
|
+
_$insert(_el$13, key);
|
|
90
|
+
return _el$13;
|
|
91
|
+
})()
|
|
92
|
+
})]
|
|
93
|
+
}), _el$1, _co$3);
|
|
94
|
+
return _el$7;
|
|
95
|
+
})(), (() => {
|
|
96
|
+
var _el$10 = _$getNextElement(_tmpl$3);
|
|
97
|
+
_$insert(_el$10, () => command.label);
|
|
98
|
+
return _el$10;
|
|
99
|
+
})()]
|
|
100
|
+
}));
|
|
101
|
+
_$insert(_el$4, () => messages.calendarShortcutsNote);
|
|
102
|
+
return _el$;
|
|
103
|
+
})(), {
|
|
104
|
+
panelClassName: "k2b-dialog k2b-dialog--small",
|
|
105
|
+
ariaLabel: messages.calendarShortcuts
|
|
106
|
+
});
|
|
107
|
+
const pad = value => String(value).padStart(2, "0");
|
|
108
|
+
const validKey = (year, month, day) => {
|
|
109
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
110
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day ? `${year}-${pad(month)}-${pad(day)}` : null;
|
|
111
|
+
};
|
|
112
|
+
/** The Monday of an ISO week of a year. */
|
|
113
|
+
const isoWeekStart = (year, week) => {
|
|
114
|
+
const january4 = new Date(Date.UTC(year, 0, 4));
|
|
115
|
+
const monday = new Date(january4.getTime() - ((january4.getUTCDay() || 7) - 1) * 86_400_000);
|
|
116
|
+
return addDayKeys(monday.toISOString().slice(0, 10), (week - 1) * 7);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Reads German and English dates, weekdays, months, week numbers, today, and tomorrow for Go to. Weekdays include
|
|
121
|
+
* today unless preceded by next; a month alone uses the next year if it has passed. A date without a year is this
|
|
122
|
+
* year's. Names ignore case and accents and allow a trailing dot. Returns a `YYYY-MM-DD` key or `null`.
|
|
123
|
+
*/
|
|
124
|
+
export const parseGoTo = (text, today) => {
|
|
125
|
+
const value = text.trim().toLowerCase();
|
|
126
|
+
if (!value) return null;
|
|
127
|
+
const year = Number(today.slice(0, 4));
|
|
128
|
+
if (/^(heute|today)$/.test(value)) return today;
|
|
129
|
+
if (/^(morgen|tomorrow)$/.test(value)) return addDayKeys(today, 1);
|
|
130
|
+
const fullYear = raw => raw ? raw.length === 2 ? 2000 + Number(raw) : Number(raw) : year;
|
|
131
|
+
let match = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(value);
|
|
132
|
+
if (match) return validKey(Number(match[1]), Number(match[2]), Number(match[3]));
|
|
133
|
+
match = /^(\d{1,2})\.(\d{1,2})\.?(\d{2}|\d{4})?$/.exec(value);
|
|
134
|
+
if (match) return validKey(fullYear(match[3]), Number(match[2]), Number(match[1]));
|
|
135
|
+
match = /^(\d{1,2})\/(\d{1,2})(?:\/(\d{2}|\d{4}))?$/.exec(value);
|
|
136
|
+
if (match) return validKey(fullYear(match[3]), Number(match[1]), Number(match[2]));
|
|
137
|
+
match = /^(?:kw|w|week|woche)\s*(\d{1,2})(?:\s*\/?\s*(\d{4}))?$/.exec(value);
|
|
138
|
+
if (match) {
|
|
139
|
+
const week = Number(match[1]);
|
|
140
|
+
return week >= 1 && week <= 53 ? isoWeekStart(match[2] ? Number(match[2]) : year, week) : null;
|
|
141
|
+
}
|
|
142
|
+
const named = value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\.$/, "").trim();
|
|
143
|
+
const weekdays = ["montag mo monday mon", "dienstag di tuesday tue tues", "mittwoch mi wednesday wed", "donnerstag do thursday thu thur thurs", "freitag fr friday fri", "samstag sa saturday sat", "sonntag so sunday sun"];
|
|
144
|
+
match = /^(?:(am|on|nachste|nachsten|nachster|naechsten|kommende|kommenden|next)\s+)?([a-z]+)$/.exec(named);
|
|
145
|
+
if (match) {
|
|
146
|
+
const name = match[2];
|
|
147
|
+
const weekday = weekdays.findIndex(names => names.split(" ").includes(name ?? ""));
|
|
148
|
+
if (weekday >= 0) {
|
|
149
|
+
const date = new Date(Date.UTC(year, Number(today.slice(5, 7)) - 1, Number(today.slice(8, 10))));
|
|
150
|
+
const todayWeekday = (date.getUTCDay() + 6) % 7;
|
|
151
|
+
let diff = (weekday - todayWeekday + 7) % 7;
|
|
152
|
+
if (match[1] && match[1] !== "am" && match[1] !== "on" && diff === 0) diff = 7;
|
|
153
|
+
return addDayKeys(today, diff);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const months = ["januar jan january", "februar feb february", "marz maerz mar mrz march", "april apr", "mai may", "juni jun june", "juli jul july", "august aug", "september sep sept", "oktober okt october oct", "november nov", "dezember dez december dec"];
|
|
157
|
+
const monthOf = name => months.findIndex(names => names.split(" ").includes(name ?? "")) + 1;
|
|
158
|
+
match = /^(\d{1,2})\.?\s+([a-z]+)\.?(?:\s+(\d{4}))?$/.exec(named);
|
|
159
|
+
if (match) return validKey(fullYear(match[3]), monthOf(match[2]), Number(match[1]));
|
|
160
|
+
match = /^([a-z]+)\.?\s+(\d{1,2})(?:,?\s+(\d{4}))?$/.exec(named);
|
|
161
|
+
if (match) return validKey(fullYear(match[3]), monthOf(match[1]), Number(match[2]));
|
|
162
|
+
match = /^([a-z]+)\.?(?:\s+(\d{4}))?$/.exec(named);
|
|
163
|
+
if (match) {
|
|
164
|
+
const month = monthOf(match[1]);
|
|
165
|
+
const monthYear = match[2] ? Number(match[2]) : year + (month < Number(today.slice(5, 7)) ? 1 : 0);
|
|
166
|
+
return validKey(monthYear, month, 1);
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/** Go to: a field that reads a date or a week number and names the day it found before the reader goes there. */
|
|
172
|
+
export const openCalendarGoTo = props => dialogCore.open(close => {
|
|
173
|
+
const [text, setText] = createSignal("");
|
|
174
|
+
const result = () => parseGoTo(text(), props.today);
|
|
175
|
+
return (() => {
|
|
176
|
+
var _el$14 = _$getNextElement(_tmpl$6),
|
|
177
|
+
_el$20 = _el$14.firstChild,
|
|
178
|
+
[_el$21, _co$4] = _$getNextMarker(_el$20.nextSibling),
|
|
179
|
+
_el$15 = _el$21.nextSibling,
|
|
180
|
+
_el$16 = _el$15.firstChild,
|
|
181
|
+
_el$17 = _el$16.nextSibling,
|
|
182
|
+
_el$18 = _el$15.nextSibling,
|
|
183
|
+
_el$19 = _el$18.firstChild;
|
|
184
|
+
_el$14.addEventListener("submit", event => {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
const key = result();
|
|
187
|
+
if (key) close(key);
|
|
188
|
+
});
|
|
189
|
+
_$insert(_el$14, _$createComponent(DialogHeader, {
|
|
190
|
+
get title() {
|
|
191
|
+
return props.messages.calendarCommandGoTo;
|
|
192
|
+
},
|
|
193
|
+
icon: "ti ti-calendar-search",
|
|
194
|
+
close: () => close()
|
|
195
|
+
}), _el$21, _co$4);
|
|
196
|
+
_el$16.$$input = event => setText(event.currentTarget.value);
|
|
197
|
+
_$setAttribute(_el$16, "spellcheck", false);
|
|
198
|
+
_$insert(_el$17, _$createComponent(Show, {
|
|
199
|
+
get when() {
|
|
200
|
+
return result();
|
|
201
|
+
},
|
|
202
|
+
get fallback() {
|
|
203
|
+
return _$memo(() => !!text().trim())() ? props.messages.calendarGoToUnknown : props.messages.calendarGoToHint;
|
|
204
|
+
},
|
|
205
|
+
children: key => `→ ${props.describe(key())}`
|
|
206
|
+
}));
|
|
207
|
+
_$insert(_el$19, () => props.messages.calendarGoToGo);
|
|
208
|
+
_$effect(_p$ => {
|
|
209
|
+
var _v$ = props.messages.calendarCommandGoTo,
|
|
210
|
+
_v$2 = props.messages.calendarGoToPlaceholder,
|
|
211
|
+
_v$3 = result() ? "true" : undefined,
|
|
212
|
+
_v$4 = !result();
|
|
213
|
+
_v$ !== _p$.e && _$setAttribute(_el$16, "aria-label", _p$.e = _v$);
|
|
214
|
+
_v$2 !== _p$.t && _$setAttribute(_el$16, "placeholder", _p$.t = _v$2);
|
|
215
|
+
_v$3 !== _p$.a && _$setAttribute(_el$17, "data-ok", _p$.a = _v$3);
|
|
216
|
+
_v$4 !== _p$.o && _$setProperty(_el$19, "disabled", _p$.o = _v$4);
|
|
217
|
+
return _p$;
|
|
218
|
+
}, {
|
|
219
|
+
e: undefined,
|
|
220
|
+
t: undefined,
|
|
221
|
+
a: undefined,
|
|
222
|
+
o: undefined
|
|
223
|
+
});
|
|
224
|
+
_$effect(() => _$setProperty(_el$16, "value", text()));
|
|
225
|
+
_$runHydrationEvents();
|
|
226
|
+
return _el$14;
|
|
227
|
+
})();
|
|
228
|
+
}, {
|
|
229
|
+
panelClassName: "k2b-dialog k2b-dialog--small",
|
|
230
|
+
ariaLabel: props.messages.calendarCommandGoTo,
|
|
231
|
+
initialFocus: "first-input"
|
|
232
|
+
}).then(key => {
|
|
233
|
+
if (key) props.onGo(key);
|
|
234
|
+
});
|
|
235
|
+
_$delegateEvents(["input"]);
|
|
236
|
+
//# sourceMappingURL=calendar-dialogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["content/calendar-dialogs.tsx"],"sourcesContent":["import { createSignal, For, Show } from \"solid-js\";\nimport { dialogCore } from \"../feedback/dialog-core\";\nimport { DialogHeader } from \"../feedback/prompts\";\nimport type { CalendarCommand } from \"./Calendar\";\nimport { addDayKeys } from \"./calendar-days\";\nimport type { CalendarMessages } from \"./calendar-messages\";\n\nconst isMac = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform);\n\n/** The keys of a shortcut as the reader presses them, such as [\"⇧\", \"N\"] or [\"Shift\", \"N\"]. */\nexport const shortcutKeys = (shortcut: string): string[] => {\n const mac = isMac();\n const names: Record<string, string> = {\n shift: mac ? \"⇧\" : \"Shift\",\n alt: mac ? \"⌥\" : \"Alt\",\n ctrl: mac ? \"⌃\" : \"Ctrl\",\n meta: mac ? \"⌘\" : \"Meta\",\n mod: mac ? \"⌘\" : \"Ctrl\",\n arrowup: \"↑\",\n arrowdown: \"↓\",\n arrowleft: \"←\",\n arrowright: \"→\",\n };\n return shortcut.split(\"+\").map((part) => names[part.toLowerCase()] ?? (part.length === 1 ? part.toUpperCase() : part));\n};\n\n/**\n * The calendar's shortcuts: the same list the host registers for its dispatcher and its help. `alternatives` names\n * other keys the calendar itself handles for a command, such as the arrow keys that page like J and K.\n */\nexport const openCalendarShortcuts = (\n commands: readonly CalendarCommand[],\n messages: CalendarMessages,\n alternatives: Readonly<Record<string, string>> = {},\n) =>\n dialogCore.open<void>(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={messages.calendarShortcuts} icon=\"ti ti-keyboard\" close={() => close()} />\n <div class=\"k2b-dialog__body\">\n <dl class=\"k2b-calendar-shortcuts\">\n <For each={commands.filter((command) => command.shortcut)}>\n {(command) => (\n <>\n <dt>\n <For each={shortcutKeys(command.shortcut!)}>{(key) => <kbd class=\"k2b-calendar-shortcuts__key\">{key}</kbd>}</For>\n <Show when={alternatives[command.id]}>\n {(other) => (\n <>\n <span class=\"k2b-calendar-shortcuts__or\">/</span>\n <For each={shortcutKeys(other())}>{(key) => <kbd class=\"k2b-calendar-shortcuts__key\">{key}</kbd>}</For>\n </>\n )}\n </Show>\n </dt>\n <dd>{command.label}</dd>\n </>\n )}\n </For>\n </dl>\n <p class=\"k2b-calendar-shortcuts__note\">{messages.calendarShortcutsNote}</p>\n </div>\n </div>\n ),\n { panelClassName: \"k2b-dialog k2b-dialog--small\", ariaLabel: messages.calendarShortcuts },\n );\n\nconst pad = (value: number) => String(value).padStart(2, \"0\");\nconst validKey = (year: number, month: number, day: number) => {\n const date = new Date(Date.UTC(year, month - 1, day));\n return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day\n ? `${year}-${pad(month)}-${pad(day)}`\n : null;\n};\n/** The Monday of an ISO week of a year. */\nconst isoWeekStart = (year: number, week: number) => {\n const january4 = new Date(Date.UTC(year, 0, 4));\n const monday = new Date(january4.getTime() - ((january4.getUTCDay() || 7) - 1) * 86_400_000);\n return addDayKeys(monday.toISOString().slice(0, 10), (week - 1) * 7);\n};\n\n/**\n * Reads German and English dates, weekdays, months, week numbers, today, and tomorrow for Go to. Weekdays include\n * today unless preceded by next; a month alone uses the next year if it has passed. A date without a year is this\n * year's. Names ignore case and accents and allow a trailing dot. Returns a `YYYY-MM-DD` key or `null`.\n */\nexport const parseGoTo = (text: string, today: string): string | null => {\n const value = text.trim().toLowerCase();\n if (!value) return null;\n const year = Number(today.slice(0, 4));\n if (/^(heute|today)$/.test(value)) return today;\n if (/^(morgen|tomorrow)$/.test(value)) return addDayKeys(today, 1);\n const fullYear = (raw: string | undefined) => (raw ? (raw.length === 2 ? 2000 + Number(raw) : Number(raw)) : year);\n let match = /^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/.exec(value);\n if (match) return validKey(Number(match[1]), Number(match[2]), Number(match[3]));\n match = /^(\\d{1,2})\\.(\\d{1,2})\\.?(\\d{2}|\\d{4})?$/.exec(value);\n if (match) return validKey(fullYear(match[3]), Number(match[2]), Number(match[1]));\n match = /^(\\d{1,2})\\/(\\d{1,2})(?:\\/(\\d{2}|\\d{4}))?$/.exec(value);\n if (match) return validKey(fullYear(match[3]), Number(match[1]), Number(match[2]));\n match = /^(?:kw|w|week|woche)\\s*(\\d{1,2})(?:\\s*\\/?\\s*(\\d{4}))?$/.exec(value);\n if (match) {\n const week = Number(match[1]);\n return week >= 1 && week <= 53 ? isoWeekStart(match[2] ? Number(match[2]) : year, week) : null;\n }\n const named = value\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\.$/, \"\")\n .trim();\n const weekdays = [\n \"montag mo monday mon\",\n \"dienstag di tuesday tue tues\",\n \"mittwoch mi wednesday wed\",\n \"donnerstag do thursday thu thur thurs\",\n \"freitag fr friday fri\",\n \"samstag sa saturday sat\",\n \"sonntag so sunday sun\",\n ];\n match = /^(?:(am|on|nachste|nachsten|nachster|naechsten|kommende|kommenden|next)\\s+)?([a-z]+)$/.exec(named);\n if (match) {\n const name = match[2];\n const weekday = weekdays.findIndex((names) => names.split(\" \").includes(name ?? \"\"));\n if (weekday >= 0) {\n const date = new Date(Date.UTC(year, Number(today.slice(5, 7)) - 1, Number(today.slice(8, 10))));\n const todayWeekday = (date.getUTCDay() + 6) % 7;\n let diff = (weekday - todayWeekday + 7) % 7;\n if (match[1] && match[1] !== \"am\" && match[1] !== \"on\" && diff === 0) diff = 7;\n return addDayKeys(today, diff);\n }\n }\n const months = [\n \"januar jan january\",\n \"februar feb february\",\n \"marz maerz mar mrz march\",\n \"april apr\",\n \"mai may\",\n \"juni jun june\",\n \"juli jul july\",\n \"august aug\",\n \"september sep sept\",\n \"oktober okt october oct\",\n \"november nov\",\n \"dezember dez december dec\",\n ];\n const monthOf = (name: string | undefined) => months.findIndex((names) => names.split(\" \").includes(name ?? \"\")) + 1;\n match = /^(\\d{1,2})\\.?\\s+([a-z]+)\\.?(?:\\s+(\\d{4}))?$/.exec(named);\n if (match) return validKey(fullYear(match[3]), monthOf(match[2]), Number(match[1]));\n match = /^([a-z]+)\\.?\\s+(\\d{1,2})(?:,?\\s+(\\d{4}))?$/.exec(named);\n if (match) return validKey(fullYear(match[3]), monthOf(match[1]), Number(match[2]));\n match = /^([a-z]+)\\.?(?:\\s+(\\d{4}))?$/.exec(named);\n if (match) {\n const month = monthOf(match[1]);\n const monthYear = match[2] ? Number(match[2]) : year + (month < Number(today.slice(5, 7)) ? 1 : 0);\n return validKey(monthYear, month, 1);\n }\n return null;\n};\n\n/** Go to: a field that reads a date or a week number and names the day it found before the reader goes there. */\nexport const openCalendarGoTo = (props: {\n messages: CalendarMessages;\n today: string;\n describe: (key: string) => string;\n onGo: (key: string) => void;\n}) =>\n dialogCore\n .open<string>(\n (close) => {\n const [text, setText] = createSignal(\"\");\n const result = () => parseGoTo(text(), props.today);\n return (\n <form\n class=\"k2b-dialog__panel\"\n onSubmit={(event) => {\n event.preventDefault();\n const key = result();\n if (key) close(key);\n }}\n >\n <DialogHeader title={props.messages.calendarCommandGoTo} icon=\"ti ti-calendar-search\" close={() => close()} />\n <div class=\"k2b-dialog__body k2b-calendar-goto\">\n <input\n class=\"k2b-calendar-goto__input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck={false}\n aria-label={props.messages.calendarCommandGoTo}\n aria-describedby=\"k2b-calendar-goto-hint\"\n placeholder={props.messages.calendarGoToPlaceholder}\n value={text()}\n onInput={(event) => setText(event.currentTarget.value)}\n />\n <p class=\"k2b-calendar-goto__preview\" id=\"k2b-calendar-goto-hint\" aria-live=\"polite\" data-ok={result() ? \"true\" : undefined}>\n <Show when={result()} fallback={text().trim() ? props.messages.calendarGoToUnknown : props.messages.calendarGoToHint}>\n {(key) => `→ ${props.describe(key())}`}\n </Show>\n </p>\n </div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"submit\" class=\"k2b-button\" data-variant=\"primary\" data-size=\"sm\" disabled={!result()}>\n {props.messages.calendarGoToGo}\n </button>\n </footer>\n </form>\n );\n },\n { panelClassName: \"k2b-dialog k2b-dialog--small\", ariaLabel: props.messages.calendarCommandGoTo, initialFocus: \"first-input\" },\n )\n .then((key) => {\n if (key) props.onGo(key);\n });\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,GAAG,EAAE,IAAI,QAAQ,UAAU;AAClD,SA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AAA;MAAA;MAAA;IAAA;IAAA,8CAVzF,IAAI,CAAC,CAAC;IAAA;IAAA;EAAA;AAgBvB,CAAC,EACD;EAAE,cAAc,EAAE,8BAA8B;EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,mBAAmB;EAAE,YAAY,EAAE;AAAc,CAC/H,CAAC,CACA,IAAI,CAAE,GAAG,IAAK;EACb,IAAI,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1B,CAAC,CAAC;AAAC","ignoreList":[]}
|
|
@@ -57,7 +57,111 @@ const calendarMessages = i18n.define({
|
|
|
57
57
|
calendarContinuesUntil: ({
|
|
58
58
|
day,
|
|
59
59
|
month
|
|
60
|
-
}) => `until ${month ? `${month} ` : ""}${day}
|
|
60
|
+
}) => `until ${month ? `${month} ` : ""}${day}`,
|
|
61
|
+
calendarDuration: ({
|
|
62
|
+
minutes
|
|
63
|
+
}) => {
|
|
64
|
+
if (minutes < 60) return `${minutes} min`;
|
|
65
|
+
const hours = Math.floor(minutes / 60);
|
|
66
|
+
const rest = minutes % 60;
|
|
67
|
+
return `${hours} hr${rest ? ` ${rest} min` : hours === 1 ? "" : "s"}`;
|
|
68
|
+
},
|
|
69
|
+
calendarFree: ({
|
|
70
|
+
duration
|
|
71
|
+
}) => `${duration} free`,
|
|
72
|
+
calendarCreateAt: ({
|
|
73
|
+
start,
|
|
74
|
+
end
|
|
75
|
+
}) => `Create event ${start}–${end}`,
|
|
76
|
+
calendarFreeAction: ({
|
|
77
|
+
duration,
|
|
78
|
+
from,
|
|
79
|
+
to,
|
|
80
|
+
start,
|
|
81
|
+
end
|
|
82
|
+
}) => `${duration} free, ${from} to ${to}. Create event ${start}–${end}`,
|
|
83
|
+
calendarRemaining: ({
|
|
84
|
+
duration
|
|
85
|
+
}) => `${duration} left`,
|
|
86
|
+
calendarSoon: ({
|
|
87
|
+
title,
|
|
88
|
+
duration
|
|
89
|
+
}) => `${title} in ${duration}`,
|
|
90
|
+
calendarNight: ({
|
|
91
|
+
from,
|
|
92
|
+
to
|
|
93
|
+
}) => `Night · ${from} → ${to}`,
|
|
94
|
+
calendarNightHours: ({
|
|
95
|
+
from,
|
|
96
|
+
to
|
|
97
|
+
}) => `Night · ${from}–${to}`,
|
|
98
|
+
calendarFoldNight: "Fold",
|
|
99
|
+
calendarOpenNight: "Open the night",
|
|
100
|
+
calendarFoldNights: "Fold the nights",
|
|
101
|
+
calendarOpenNights: ({
|
|
102
|
+
from,
|
|
103
|
+
to
|
|
104
|
+
}) => `Open the nights, ${from} to ${to}`,
|
|
105
|
+
calendarUntil: ({
|
|
106
|
+
time
|
|
107
|
+
}) => `until ${time}`,
|
|
108
|
+
calendarNothingPlannedShort: "Nothing planned",
|
|
109
|
+
calendarUnfoldDays: ({
|
|
110
|
+
count
|
|
111
|
+
}) => count === 1 ? "Show day" : "Show days",
|
|
112
|
+
calendarDayCount: ({
|
|
113
|
+
count
|
|
114
|
+
}) => `${count} days`,
|
|
115
|
+
calendarDaySummary: ({
|
|
116
|
+
events,
|
|
117
|
+
tasks
|
|
118
|
+
}) => [events ? `${events} ${events === 1 ? "event" : "events"}` : "", tasks ? `${tasks} ${tasks === 1 ? "to-do" : "to-dos"}` : ""].filter(Boolean).join(" · "),
|
|
119
|
+
calendarMoreDays: "More days load as you scroll …",
|
|
120
|
+
calendarAllDayRow: "all day",
|
|
121
|
+
calendarAllDayRowShort: "all day",
|
|
122
|
+
calendarAllDayAndDue: "All day and due",
|
|
123
|
+
calendarDone: ({
|
|
124
|
+
title
|
|
125
|
+
}) => `Done: ${title}`,
|
|
126
|
+
calendarAllDone: "All done for today",
|
|
127
|
+
calendarAllDoneShort: "All done",
|
|
128
|
+
calendarDue: ({
|
|
129
|
+
time
|
|
130
|
+
}) => `due ${time}`,
|
|
131
|
+
calendarFits: "fits",
|
|
132
|
+
calendarTooShort: ({
|
|
133
|
+
duration
|
|
134
|
+
}) => `${duration} too short`,
|
|
135
|
+
calendarOverlaps: ({
|
|
136
|
+
title
|
|
137
|
+
}) => `overlaps “${title}”`,
|
|
138
|
+
calendarWeekNumber: ({
|
|
139
|
+
week
|
|
140
|
+
}) => `W ${week}`,
|
|
141
|
+
calendarWeek: "Week",
|
|
142
|
+
calendarDays: "Days",
|
|
143
|
+
calendarKeyboardHelp: "Arrow keys move between days, events, and free time. Enter opens or creates, Space checks off.",
|
|
144
|
+
calendarDayKeyboardHelp: "Tab moves through the events and free time of each day. Enter opens or creates, Space checks off.",
|
|
145
|
+
calendarShortcuts: "Keyboard shortcuts",
|
|
146
|
+
calendarShortcutsNote: "Shortcuts work anywhere on this page, except while you type in a text field or a dialog is open.",
|
|
147
|
+
calendarCommandToday: "Today",
|
|
148
|
+
calendarCommandTodayDescription: "Show today in the calendar",
|
|
149
|
+
calendarCommandNext: "Next",
|
|
150
|
+
calendarCommandNextDescription: "Show the next day, week, month, or year",
|
|
151
|
+
calendarCommandPrevious: "Previous",
|
|
152
|
+
calendarCommandPreviousDescription: "Show the previous day, week, month, or year",
|
|
153
|
+
calendarCommandView: ({
|
|
154
|
+
view
|
|
155
|
+
}) => `${view} view`,
|
|
156
|
+
calendarCommandViewDescription: ({
|
|
157
|
+
view
|
|
158
|
+
}) => `Switch the calendar to the ${view.toLowerCase()} view`,
|
|
159
|
+
calendarCommandGoTo: "Go to",
|
|
160
|
+
calendarCommandGoToDescription: "Jump to a date or a week number",
|
|
161
|
+
calendarGoToPlaceholder: "Date, such as 3/15, Friday, March, or W 12",
|
|
162
|
+
calendarGoToHint: "Enter a date, a weekday, a month, or a week number.",
|
|
163
|
+
calendarGoToUnknown: "Not recognized.",
|
|
164
|
+
calendarGoToGo: "Go"
|
|
61
165
|
},
|
|
62
166
|
de: {
|
|
63
167
|
calendarView: "Kalenderansicht",
|
|
@@ -108,7 +212,111 @@ const calendarMessages = i18n.define({
|
|
|
108
212
|
calendarContinuesUntil: ({
|
|
109
213
|
day,
|
|
110
214
|
month
|
|
111
|
-
}) => `bis ${day}.${month ? ` ${month}` : ""}
|
|
215
|
+
}) => `bis ${day}.${month ? ` ${month}` : ""}`,
|
|
216
|
+
calendarDuration: ({
|
|
217
|
+
minutes
|
|
218
|
+
}) => {
|
|
219
|
+
if (minutes < 60) return `${minutes} Min`;
|
|
220
|
+
const hours = Math.floor(minutes / 60);
|
|
221
|
+
const rest = minutes % 60;
|
|
222
|
+
return rest ? `${hours} Std. ${rest}` : `${hours} Std.`;
|
|
223
|
+
},
|
|
224
|
+
calendarFree: ({
|
|
225
|
+
duration
|
|
226
|
+
}) => `${duration} frei`,
|
|
227
|
+
calendarCreateAt: ({
|
|
228
|
+
start,
|
|
229
|
+
end
|
|
230
|
+
}) => `Termin ${start}–${end} anlegen`,
|
|
231
|
+
calendarFreeAction: ({
|
|
232
|
+
duration,
|
|
233
|
+
from,
|
|
234
|
+
to,
|
|
235
|
+
start,
|
|
236
|
+
end
|
|
237
|
+
}) => `${duration} frei, ${from} bis ${to}. Termin ${start}–${end} anlegen`,
|
|
238
|
+
calendarRemaining: ({
|
|
239
|
+
duration
|
|
240
|
+
}) => `noch ${duration}`,
|
|
241
|
+
calendarSoon: ({
|
|
242
|
+
title,
|
|
243
|
+
duration
|
|
244
|
+
}) => `${title} in ${duration}`,
|
|
245
|
+
calendarNight: ({
|
|
246
|
+
from,
|
|
247
|
+
to
|
|
248
|
+
}) => `Nacht · ${from} → ${to}`,
|
|
249
|
+
calendarNightHours: ({
|
|
250
|
+
from,
|
|
251
|
+
to
|
|
252
|
+
}) => `Nacht · ${from}–${to}`,
|
|
253
|
+
calendarFoldNight: "einklappen",
|
|
254
|
+
calendarOpenNight: "Nacht ausklappen",
|
|
255
|
+
calendarFoldNights: "Nächte einklappen",
|
|
256
|
+
calendarOpenNights: ({
|
|
257
|
+
from,
|
|
258
|
+
to
|
|
259
|
+
}) => `Nächte ausklappen, ${from}–${to} Uhr`,
|
|
260
|
+
calendarUntil: ({
|
|
261
|
+
time
|
|
262
|
+
}) => `bis ${time}`,
|
|
263
|
+
calendarNothingPlannedShort: "Nichts geplant",
|
|
264
|
+
calendarUnfoldDays: ({
|
|
265
|
+
count
|
|
266
|
+
}) => count === 1 ? "Tag aufklappen" : "Tage aufklappen",
|
|
267
|
+
calendarDayCount: ({
|
|
268
|
+
count
|
|
269
|
+
}) => `${count} Tage`,
|
|
270
|
+
calendarDaySummary: ({
|
|
271
|
+
events,
|
|
272
|
+
tasks
|
|
273
|
+
}) => [events ? `${events} ${events === 1 ? "Termin" : "Termine"}` : "", tasks ? `${tasks} ${tasks === 1 ? "To-do" : "To-dos"}` : ""].filter(Boolean).join(" · "),
|
|
274
|
+
calendarMoreDays: "Weitere Tage laden beim Scrollen …",
|
|
275
|
+
calendarAllDayRow: "ganztägig",
|
|
276
|
+
calendarAllDayRowShort: "ganzt.",
|
|
277
|
+
calendarAllDayAndDue: "Ganztägig und fällig",
|
|
278
|
+
calendarDone: ({
|
|
279
|
+
title
|
|
280
|
+
}) => `Erledigt: ${title}`,
|
|
281
|
+
calendarAllDone: "Alles für heute erledigt",
|
|
282
|
+
calendarAllDoneShort: "Alles erledigt",
|
|
283
|
+
calendarDue: ({
|
|
284
|
+
time
|
|
285
|
+
}) => `fällig ${time}`,
|
|
286
|
+
calendarFits: "passt",
|
|
287
|
+
calendarTooShort: ({
|
|
288
|
+
duration
|
|
289
|
+
}) => `${duration} zu kurz`,
|
|
290
|
+
calendarOverlaps: ({
|
|
291
|
+
title
|
|
292
|
+
}) => `überschneidet „${title}“`,
|
|
293
|
+
calendarWeekNumber: ({
|
|
294
|
+
week
|
|
295
|
+
}) => `KW ${week}`,
|
|
296
|
+
calendarWeek: "Woche",
|
|
297
|
+
calendarDays: "Tage",
|
|
298
|
+
calendarKeyboardHelp: "Pfeiltasten wechseln zwischen Tagen, Terminen und freier Zeit. Enter öffnet oder legt an, Leertaste hakt ab.",
|
|
299
|
+
calendarDayKeyboardHelp: "Tab wechselt zwischen den Terminen und der freien Zeit jedes Tages. Enter öffnet oder legt an, Leertaste hakt ab.",
|
|
300
|
+
calendarShortcuts: "Tastenkürzel",
|
|
301
|
+
calendarShortcutsNote: "Kürzel wirken überall auf dieser Seite, nur nicht beim Tippen in einem Eingabefeld oder bei offenem Dialog.",
|
|
302
|
+
calendarCommandToday: "Heute",
|
|
303
|
+
calendarCommandTodayDescription: "Im Kalender heute zeigen",
|
|
304
|
+
calendarCommandNext: "Weiter",
|
|
305
|
+
calendarCommandNextDescription: "Nächsten Tag, nächste Woche, nächsten Monat oder nächstes Jahr zeigen",
|
|
306
|
+
calendarCommandPrevious: "Zurück",
|
|
307
|
+
calendarCommandPreviousDescription: "Vorigen Tag, vorige Woche, vorigen Monat oder voriges Jahr zeigen",
|
|
308
|
+
calendarCommandView: ({
|
|
309
|
+
view
|
|
310
|
+
}) => `Ansicht ${view}`,
|
|
311
|
+
calendarCommandViewDescription: ({
|
|
312
|
+
view
|
|
313
|
+
}) => `Den Kalender als ${view} zeigen`,
|
|
314
|
+
calendarCommandGoTo: "Gehe zu",
|
|
315
|
+
calendarCommandGoToDescription: "Zu einem Datum oder einer Kalenderwoche springen",
|
|
316
|
+
calendarGoToPlaceholder: "Datum, z. B. 15.3., Freitag, März oder KW 12",
|
|
317
|
+
calendarGoToHint: "Datum, Wochentag, Monat oder Kalenderwoche eingeben.",
|
|
318
|
+
calendarGoToUnknown: "Nicht erkannt.",
|
|
319
|
+
calendarGoToGo: "Springen"
|
|
112
320
|
}
|
|
113
321
|
}
|
|
114
322
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/calendar-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/**\n * The calendar's own strings. They live beside the calendar instead of in the shared catalog, so applications that\n * never render a calendar do not ship them.\n */\nconst calendarMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n calendarView: \"Calendar view\",\n openDate: ({ label }: { label: string }) => `Open ${label}`,\n createEventOn: ({ label }: { label: string }) => `Create event on ${label}`,\n hiddenOverlappingEvents: ({ count }: { count: number }) => `${count} hidden overlapping events`,\n calendarEventTime: ({ title, start, end }: { title: string; start: string; end: string }) => `${title}, ${start} to ${end}`,\n weekShort: \"Wk\",\n noEvents: \"No events\",\n moveEvent: \"Move event\",\n resizeEvent: \"Resize event\",\n calendarMoreEvents: ({ count }: { count: number }) => `+${count} more`,\n calendarMoreEventsOn: ({ count, label }: { count: number; label: string }) => `${count} more on ${label}`,\n calendarSelectionActions: \"Actions for the selected days\",\n calendarQuickCreate: \"New entry\",\n calendarSelectedDays: ({ start, end, count }: { start: string; end: string; count: number }) => `${start} – ${end} · ${count} days`,\n calendarOpenDay: \"Open day\",\n calendarOpenWeek: \"Open week\",\n calendarOpenWeekNumber: ({ week }: { week: number }) => `Week ${week}, open week`,\n calendarClearSelection: \"Clear selection\",\n calendarNewEvent: \"New event\",\n calendarNothingPlanned: \"Nothing planned.\",\n calendarContinuesFrom: ({ day, month }: { day: number; month?: string }) => `from ${month ? `${month} ` : \"\"}${day}`,\n calendarContinuesUntil: ({ day, month }: { day: number; month?: string }) => `until ${month ? `${month} ` : \"\"}${day}`,\n },\n de: {\n calendarView: \"Kalenderansicht\",\n openDate: ({ label }) => `${label} öffnen`,\n createEventOn: ({ label }) => `Termin am ${label} erstellen`,\n hiddenOverlappingEvents: ({ count }) => `${count} ausgeblendete überlappende Termine`,\n calendarEventTime: ({ title, start, end }) => `${title}, ${start} bis ${end}`,\n weekShort: \"KW\",\n noEvents: \"Keine Termine\",\n moveEvent: \"Termin verschieben\",\n resizeEvent: \"Termindauer ändern\",\n calendarMoreEvents: ({ count }) => `+${count} weitere`,\n calendarMoreEventsOn: ({ count, label }) => `${count} weitere am ${label}`,\n calendarSelectionActions: \"Aktionen für die ausgewählten Tage\",\n calendarQuickCreate: \"Neuer Eintrag\",\n calendarSelectedDays: ({ start, end, count }) => `${start} – ${end} · ${count} Tage`,\n calendarOpenDay: \"Tag öffnen\",\n calendarOpenWeek: \"Woche öffnen\",\n calendarOpenWeekNumber: ({ week }) => `KW ${week}, Woche öffnen`,\n calendarClearSelection: \"Auswahl aufheben\",\n calendarNewEvent: \"Neuer Termin\",\n calendarNothingPlanned: \"Nichts geplant.\",\n calendarContinuesFrom: ({ day, month }) => `seit ${day}.${month ? ` ${month}` : \"\"}`,\n calendarContinuesUntil: ({ day, month }) => `bis ${day}.${month ? ` ${month}` : \"\"}`,\n },\n },\n});\n\nexport type CalendarMessages = ReturnType<(typeof calendarMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale, like the rest of @k2b/ui. */\nexport const useCalendarMessages = (): (() => CalendarMessages) => {\n const locale = useLocale();\n return () => calendarMessages.resolve([locale()]).t;\n};\n\nexport const checkCalendarMessages = () => calendarMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,YAAY,EAAE,eAAe;MAC7B,QAAQ,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,QAAQ,KAAK,EAAE;MAC3D,aAAa,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,mBAAmB,KAAK,EAAE;MAC3E,uBAAuB,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,GAAG,KAAK,4BAA4B;MAC/F,iBAAiB,EAAE,CAAC;QAAE,KAAK;QAAE,KAAK;QAAE;MAAmD,CAAC,KAAK,GAAG,KAAK,KAAK,KAAK,OAAO,GAAG,EAAE;MAC3H,SAAS,EAAE,IAAI;MACf,QAAQ,EAAE,WAAW;MACrB,SAAS,EAAE,YAAY;MACvB,WAAW,EAAE,cAAc;MAC3B,kBAAkB,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,IAAI,KAAK,OAAO;MACtE,oBAAoB,EAAE,CAAC;QAAE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AK,IAAI,KAAK,UAAU;MACtD,oBAAoB,EAAE,CAAC;QAAE,KAAK;QAAE;MAAM,CAAC,KAAK,GAAG,KAAK,eAAe,KAAK,EAAE;MAC1E,wBAAwB,EAAE,oCAAoC;MAC9D,mBAAmB,EAAE,eAAe;MACpC,oBAAoB,EAAE,CAAC;QAAE,KAAK;QAAE,GAAG;QAAE;MAAM,CAAC,KAAK,GAAG,KAAK,MAAM,GAAG,MAAM,KAAK,OAAO;MACpF,eAAe,EAAE,YAAY;MAC7B,gBAAgB,EAAE,cAAc;MAChC,sBAAsB,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,MAAM,IAAI,gBAAgB;MAChE,sBAAsB,EAAE,kBAAkB;MAC1C,gBAAgB,EAAE,cAAc;MAChC,sBAAsB,EAAE,iBAAiB;MACzC,qBAAqB,EAAE,CAAC;QAAE,GAAG;QAAE;MAAM,CAAC,KAAK,QAAQ,GAAG,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,GAAG,EAAE,EAAE;MACpF,sBAAsB,EAAE,CAAC;QAAE,GAAG;QAAE;MAAM,CAAC,KAAK,OAAO,GAAG,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,GAAG,EAAE;IACpF;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/calendar-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/**\n * The calendar's own strings. They live beside the calendar instead of in the shared catalog, so applications that\n * never render a calendar do not ship them.\n */\nconst calendarMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n calendarView: \"Calendar view\",\n openDate: ({ label }: { label: string }) => `Open ${label}`,\n createEventOn: ({ label }: { label: string }) => `Create event on ${label}`,\n hiddenOverlappingEvents: ({ count }: { count: number }) => `${count} hidden overlapping events`,\n calendarEventTime: ({ title, start, end }: { title: string; start: string; end: string }) => `${title}, ${start} to ${end}`,\n weekShort: \"Wk\",\n noEvents: \"No events\",\n moveEvent: \"Move event\",\n resizeEvent: \"Resize event\",\n calendarMoreEvents: ({ count }: { count: number }) => `+${count} more`,\n calendarMoreEventsOn: ({ count, label }: { count: number; label: string }) => `${count} more on ${label}`,\n calendarSelectionActions: \"Actions for the selected days\",\n calendarQuickCreate: \"New entry\",\n calendarSelectedDays: ({ start, end, count }: { start: string; end: string; count: number }) => `${start} – ${end} · ${count} days`,\n calendarOpenDay: \"Open day\",\n calendarOpenWeek: \"Open week\",\n calendarOpenWeekNumber: ({ week }: { week: number }) => `Week ${week}, open week`,\n calendarClearSelection: \"Clear selection\",\n calendarNewEvent: \"New event\",\n calendarNothingPlanned: \"Nothing planned.\",\n calendarContinuesFrom: ({ day, month }: { day: number; month?: string }) => `from ${month ? `${month} ` : \"\"}${day}`,\n calendarContinuesUntil: ({ day, month }: { day: number; month?: string }) => `until ${month ? `${month} ` : \"\"}${day}`,\n calendarDuration: ({ minutes }: { minutes: number }) => {\n if (minutes < 60) return `${minutes} min`;\n const hours = Math.floor(minutes / 60);\n const rest = minutes % 60;\n return `${hours} hr${rest ? ` ${rest} min` : hours === 1 ? \"\" : \"s\"}`;\n },\n calendarFree: ({ duration }: { duration: string }) => `${duration} free`,\n calendarCreateAt: ({ start, end }: { start: string; end: string }) => `Create event ${start}–${end}`,\n calendarFreeAction: ({\n duration,\n from,\n to,\n start,\n end,\n }: {\n duration: string;\n from: string;\n to: string;\n start: string;\n end: string;\n }) => `${duration} free, ${from} to ${to}. Create event ${start}–${end}`,\n calendarRemaining: ({ duration }: { duration: string }) => `${duration} left`,\n calendarSoon: ({ title, duration }: { title: string; duration: string }) => `${title} in ${duration}`,\n calendarNight: ({ from, to }: { from: string; to: string }) => `Night · ${from} → ${to}`,\n calendarNightHours: ({ from, to }: { from: string; to: string }) => `Night · ${from}–${to}`,\n calendarFoldNight: \"Fold\",\n calendarOpenNight: \"Open the night\",\n calendarFoldNights: \"Fold the nights\",\n calendarOpenNights: ({ from, to }: { from: string; to: string }) => `Open the nights, ${from} to ${to}`,\n calendarUntil: ({ time }: { time: string }) => `until ${time}`,\n calendarNothingPlannedShort: \"Nothing planned\",\n calendarUnfoldDays: ({ count }: { count: number }): string => (count === 1 ? \"Show day\" : \"Show days\"),\n calendarDayCount: ({ count }: { count: number }) => `${count} days`,\n calendarDaySummary: ({ events, tasks }: { events: number; tasks: number }) =>\n [events ? `${events} ${events === 1 ? \"event\" : \"events\"}` : \"\", tasks ? `${tasks} ${tasks === 1 ? \"to-do\" : \"to-dos\"}` : \"\"]\n .filter(Boolean)\n .join(\" · \"),\n calendarMoreDays: \"More days load as you scroll …\",\n calendarAllDayRow: \"all day\",\n calendarAllDayRowShort: \"all day\",\n calendarAllDayAndDue: \"All day and due\",\n calendarDone: ({ title }: { title: string }) => `Done: ${title}`,\n calendarAllDone: \"All done for today\",\n calendarAllDoneShort: \"All done\",\n calendarDue: ({ time }: { time: string }) => `due ${time}`,\n calendarFits: \"fits\",\n calendarTooShort: ({ duration }: { duration: string }) => `${duration} too short`,\n calendarOverlaps: ({ title }: { title: string }) => `overlaps “${title}”`,\n calendarWeekNumber: ({ week }: { week: number }) => `W ${week}`,\n calendarWeek: \"Week\",\n calendarDays: \"Days\",\n calendarKeyboardHelp: \"Arrow keys move between days, events, and free time. Enter opens or creates, Space checks off.\",\n calendarDayKeyboardHelp: \"Tab moves through the events and free time of each day. Enter opens or creates, Space checks off.\",\n calendarShortcuts: \"Keyboard shortcuts\",\n calendarShortcutsNote: \"Shortcuts work anywhere on this page, except while you type in a text field or a dialog is open.\",\n calendarCommandToday: \"Today\",\n calendarCommandTodayDescription: \"Show today in the calendar\",\n calendarCommandNext: \"Next\",\n calendarCommandNextDescription: \"Show the next day, week, month, or year\",\n calendarCommandPrevious: \"Previous\",\n calendarCommandPreviousDescription: \"Show the previous day, week, month, or year\",\n calendarCommandView: ({ view }: { view: string }) => `${view} view`,\n calendarCommandViewDescription: ({ view }: { view: string }) => `Switch the calendar to the ${view.toLowerCase()} view`,\n calendarCommandGoTo: \"Go to\",\n calendarCommandGoToDescription: \"Jump to a date or a week number\",\n calendarGoToPlaceholder: \"Date, such as 3/15, Friday, March, or W 12\",\n calendarGoToHint: \"Enter a date, a weekday, a month, or a week number.\",\n calendarGoToUnknown: \"Not recognized.\",\n calendarGoToGo: \"Go\",\n },\n de: {\n calendarView: \"Kalenderansicht\",\n openDate: ({ label }) => `${label} öffnen`,\n createEventOn: ({ label }) => `Termin am ${label} erstellen`,\n hiddenOverlappingEvents: ({ count }) => `${count} ausgeblendete überlappende Termine`,\n calendarEventTime: ({ title, start, end }) => `${title}, ${start} bis ${end}`,\n weekShort: \"KW\",\n noEvents: \"Keine Termine\",\n moveEvent: \"Termin verschieben\",\n resizeEvent: \"Termindauer ändern\",\n calendarMoreEvents: ({ count }) => `+${count} weitere`,\n calendarMoreEventsOn: ({ count, label }) => `${count} weitere am ${label}`,\n calendarSelectionActions: \"Aktionen für die ausgewählten Tage\",\n calendarQuickCreate: \"Neuer Eintrag\",\n calendarSelectedDays: ({ start, end, count }) => `${start} – ${end} · ${count} Tage`,\n calendarOpenDay: \"Tag öffnen\",\n calendarOpenWeek: \"Woche öffnen\",\n calendarOpenWeekNumber: ({ week }) => `KW ${week}, Woche öffnen`,\n calendarClearSelection: \"Auswahl aufheben\",\n calendarNewEvent: \"Neuer Termin\",\n calendarNothingPlanned: \"Nichts geplant.\",\n calendarContinuesFrom: ({ day, month }) => `seit ${day}.${month ? ` ${month}` : \"\"}`,\n calendarContinuesUntil: ({ day, month }) => `bis ${day}.${month ? ` ${month}` : \"\"}`,\n calendarDuration: ({ minutes }) => {\n if (minutes < 60) return `${minutes} Min`;\n const hours = Math.floor(minutes / 60);\n const rest = minutes % 60;\n return rest ? `${hours} Std. ${rest}` : `${hours} Std.`;\n },\n calendarFree: ({ duration }) => `${duration} frei`,\n calendarCreateAt: ({ start, end }) => `Termin ${start}–${end} anlegen`,\n calendarFreeAction: ({ duration, from, to, start, end }) => `${duration} frei, ${from} bis ${to}. Termin ${start}–${end} anlegen`,\n calendarRemaining: ({ duration }) => `noch ${duration}`,\n calendarSoon: ({ title, duration }) => `${title} in ${duration}`,\n calendarNight: ({ from, to }) => `Nacht · ${from} → ${to}`,\n calendarNightHours: ({ from, to }) => `Nacht · ${from}–${to}`,\n calendarFoldNight: \"einklappen\",\n calendarOpenNight: \"Nacht ausklappen\",\n calendarFoldNights: \"Nächte einklappen\",\n calendarOpenNights: ({ from, to }) => `Nächte ausklappen, ${from}–${to} Uhr`,\n calendarUntil: ({ time }) => `bis ${time}`,\n calendarNothingPlannedShort: \"Nichts geplant\",\n calendarUnfoldDays: ({ count }) => (count === 1 ? \"Tag aufklappen\" : \"Tage aufklappen\"),\n calendarDayCount: ({ count }) => `${count} Tage`,\n calendarDaySummary: ({ events, tasks }) =>\n [events ? `${events} ${events === 1 ? \"Termin\" : \"Termine\"}` : \"\", tasks ? `${tasks} ${tasks === 1 ? \"To-do\" : \"To-dos\"}` : \"\"]\n .filter(Boolean)\n .join(\" · \"),\n calendarMoreDays: \"Weitere Tage laden beim Scrollen …\",\n calendarAllDayRow: \"ganztägig\",\n calendarAllDayRowShort: \"ganzt.\",\n calendarAllDayAndDue: \"Ganztägig und fällig\",\n calendarDone: ({ title }) => `Erledigt: ${title}`,\n calendarAllDone: \"Alles für heute erledigt\",\n calendarAllDoneShort: \"Alles erledigt\",\n calendarDue: ({ time }) => `fällig ${time}`,\n calendarFits: \"passt\",\n calendarTooShort: ({ duration }) => `${duration} zu kurz`,\n calendarOverlaps: ({ title }) => `überschneidet „${title}“`,\n calendarWeekNumber: ({ week }) => `KW ${week}`,\n calendarWeek: \"Woche\",\n calendarDays: \"Tage\",\n calendarKeyboardHelp: \"Pfeiltasten wechseln zwischen Tagen, Terminen und freier Zeit. Enter öffnet oder legt an, Leertaste hakt ab.\",\n calendarDayKeyboardHelp:\n \"Tab wechselt zwischen den Terminen und der freien Zeit jedes Tages. Enter öffnet oder legt an, Leertaste hakt ab.\",\n calendarShortcuts: \"Tastenkürzel\",\n calendarShortcutsNote: \"Kürzel wirken überall auf dieser Seite, nur nicht beim Tippen in einem Eingabefeld oder bei offenem Dialog.\",\n calendarCommandToday: \"Heute\",\n calendarCommandTodayDescription: \"Im Kalender heute zeigen\",\n calendarCommandNext: \"Weiter\",\n calendarCommandNextDescription: \"Nächsten Tag, nächste Woche, nächsten Monat oder nächstes Jahr zeigen\",\n calendarCommandPrevious: \"Zurück\",\n calendarCommandPreviousDescription: \"Vorigen Tag, vorige Woche, vorigen Monat oder voriges Jahr zeigen\",\n calendarCommandView: ({ view }) => `Ansicht ${view}`,\n calendarCommandViewDescription: ({ view }) => `Den Kalender als ${view} zeigen`,\n calendarCommandGoTo: \"Gehe zu\",\n calendarCommandGoToDescription: \"Zu einem Datum oder einer Kalenderwoche springen\",\n calendarGoToPlaceholder: \"Datum, z. B. 15.3., Freitag, März oder KW 12\",\n calendarGoToHint: \"Datum, Wochentag, Monat oder Kalenderwoche eingeben.\",\n calendarGoToUnknown: \"Nicht erkannt.\",\n calendarGoToGo: \"Springen\",\n },\n },\n});\n\nexport type CalendarMessages = ReturnType<(typeof calendarMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale, like the rest of @k2b/ui. */\nexport const useCalendarMessages = (): (() => CalendarMessages) => {\n const locale = useLocale();\n return () => calendarMessages.resolve([locale()]).t;\n};\n\nexport const checkCalendarMessages = () => calendarMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AAC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AAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -38,6 +38,7 @@ export const startCalendarPointerSession = options => {
|
|
|
38
38
|
let latest = null;
|
|
39
39
|
let scrollFrame = 0;
|
|
40
40
|
let releaseTextSelection = null;
|
|
41
|
+
let armed = !options.armAutoScroll;
|
|
41
42
|
const preview = () => {
|
|
42
43
|
const value = options.resolve(clientX, clientY);
|
|
43
44
|
if (value === null) return;
|
|
@@ -48,7 +49,9 @@ export const startCalendarPointerSession = options => {
|
|
|
48
49
|
scrollFrame = 0;
|
|
49
50
|
if (!active || !options.scrollContainer) return;
|
|
50
51
|
const rect = options.scrollContainer.getBoundingClientRect();
|
|
51
|
-
const
|
|
52
|
+
const inside = clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
|
|
53
|
+
if (!armed && inside && clientY > rect.top + 56 && clientY < rect.bottom - 56) armed = true;
|
|
54
|
+
const speed = armed && (inside || !options.armAutoScroll) ? calendarAutoScrollSpeed(clientY, rect.top, rect.bottom) : 0;
|
|
52
55
|
if (speed !== 0) {
|
|
53
56
|
const before = options.scrollContainer.scrollTop;
|
|
54
57
|
options.scrollContainer.scrollTop += speed;
|
|
@@ -80,7 +83,11 @@ export const startCalendarPointerSession = options => {
|
|
|
80
83
|
if (finished) return;
|
|
81
84
|
finished = true;
|
|
82
85
|
cleanup();
|
|
83
|
-
|
|
86
|
+
try {
|
|
87
|
+
if (active) options.onCancel?.();
|
|
88
|
+
} finally {
|
|
89
|
+
options.onEnd?.();
|
|
90
|
+
}
|
|
84
91
|
}
|
|
85
92
|
function onMove(event) {
|
|
86
93
|
if (finished || event.pointerId !== pointerId) return;
|
|
@@ -89,13 +96,18 @@ export const startCalendarPointerSession = options => {
|
|
|
89
96
|
if (!active && Math.hypot(clientX - startX, clientY - startY) >= threshold) activate();
|
|
90
97
|
if (!active) return;
|
|
91
98
|
event.preventDefault();
|
|
99
|
+
options.onMove?.(clientX, clientY);
|
|
92
100
|
preview();
|
|
93
101
|
}
|
|
94
102
|
function onUp(event) {
|
|
95
103
|
if (finished || event.pointerId !== pointerId) return;
|
|
96
104
|
finished = true;
|
|
97
105
|
cleanup();
|
|
98
|
-
|
|
106
|
+
try {
|
|
107
|
+
if (active && latest !== null) options.onCommit(latest);else if (active) options.onCancel?.();
|
|
108
|
+
} finally {
|
|
109
|
+
options.onEnd?.();
|
|
110
|
+
}
|
|
99
111
|
}
|
|
100
112
|
function onKeyDown(event) {
|
|
101
113
|
if (event.key !== "Escape") return;
|