@lit-material/calendar 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +161 -2
- package/custom-elements.json +2109 -0
- package/dist/calendar-format.d.ts +64 -0
- package/dist/calendar-format.d.ts.map +1 -0
- package/dist/calendar-format.js +67 -0
- package/dist/calendar-format.js.map +1 -0
- package/dist/calendar-styles.d.ts +2 -0
- package/dist/calendar-styles.d.ts.map +1 -0
- package/dist/calendar-styles.js +463 -0
- package/dist/calendar-styles.js.map +1 -0
- package/dist/calendar-utils.d.ts +120 -0
- package/dist/calendar-utils.d.ts.map +1 -0
- package/dist/calendar-utils.js +222 -0
- package/dist/calendar-utils.js.map +1 -0
- package/dist/calendar.d.ts +180 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +1076 -0
- package/dist/calendar.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +10 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +19 -0
- package/dist/react.js.map +1 -0
- package/dist/sbom.cdx.json +310 -0
- package/dist/vscode.html-custom-data.json +54 -0
- package/dist/web-types.json +168 -0
- package/package.json +97 -3
- package/types/jsx.d.ts +21 -0
- package/types/vue.d.ts +17 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar math and event layout, with no DOM. All times are in the runtime's local time zone: a `Date`
|
|
3
|
+
* is shown at its local wall-clock time, and ISO strings without an offset are read as local time.
|
|
4
|
+
* Date-only strings (`"2026-06-15"`) are parsed by hand, never through `new Date(str)` (which reads
|
|
5
|
+
* them as UTC midnight and shifts them a day in negative-offset zones).
|
|
6
|
+
*/
|
|
7
|
+
export interface CalendarDate {
|
|
8
|
+
year: number;
|
|
9
|
+
month: number;
|
|
10
|
+
day: number;
|
|
11
|
+
}
|
|
12
|
+
/** An event as the app passes it in. Extra fields are kept and handed back in event details. */
|
|
13
|
+
export interface CalendarEvent {
|
|
14
|
+
id: string | number;
|
|
15
|
+
title: string;
|
|
16
|
+
/** A `Date`, or an ISO string: `"2026-06-15"` (a day), `"2026-06-15T09:30"` (local time), or with an offset. */
|
|
17
|
+
start: string | Date;
|
|
18
|
+
/** Exclusive. Missing (or not after `start`): one hour for a timed event, one day for an all-day one. */
|
|
19
|
+
end?: string | Date;
|
|
20
|
+
/** Shown in the all-day row. Default: `true` when `start` is a date-only string, else `false`. */
|
|
21
|
+
allDay?: boolean;
|
|
22
|
+
/** Any CSS colour, used as the chip's accent. */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** `false` keeps this event from being dragged, resized or moved with the keyboard. */
|
|
25
|
+
editable?: boolean;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
/** An event with its times resolved to `Date`s. */
|
|
29
|
+
export interface NormalizedEvent {
|
|
30
|
+
source: CalendarEvent;
|
|
31
|
+
key: string;
|
|
32
|
+
title: string;
|
|
33
|
+
start: Date;
|
|
34
|
+
end: Date;
|
|
35
|
+
allDay: boolean;
|
|
36
|
+
color?: string;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const MINUTE = 60000;
|
|
40
|
+
export declare const DAY_MINUTES: number;
|
|
41
|
+
export declare function parseISODate(iso: string | undefined | null): CalendarDate | undefined;
|
|
42
|
+
export declare function formatISODate(date: CalendarDate): string;
|
|
43
|
+
export declare function toDate(date: CalendarDate, minutes?: number): Date;
|
|
44
|
+
export declare function fromDate(date: Date): CalendarDate;
|
|
45
|
+
export declare function today(): CalendarDate;
|
|
46
|
+
export declare function compareDate(a: CalendarDate, b: CalendarDate): number;
|
|
47
|
+
export declare const sameDate: (a: CalendarDate, b: CalendarDate) => boolean;
|
|
48
|
+
export declare function addDays(date: CalendarDate, delta: number): CalendarDate;
|
|
49
|
+
/** The same day `delta` months away, clamped to the target month's length (Jan 31 + 1 month = Feb 28). */
|
|
50
|
+
export declare function addMonths(date: CalendarDate, delta: number): CalendarDate;
|
|
51
|
+
/** Whole days from `a` to `b` (calendar days, so DST changes don't matter). */
|
|
52
|
+
export declare function daysBetween(a: CalendarDate, b: CalendarDate): number;
|
|
53
|
+
export declare function startOfWeek(date: CalendarDate, firstDayOfWeek: number): CalendarDate;
|
|
54
|
+
/** Minutes since local midnight of `day` (can be negative, or past 1440). Wall-clock, so DST days still have 24 hours of rows. */
|
|
55
|
+
export declare function minutesInto(day: CalendarDate, date: Date): number;
|
|
56
|
+
/**
|
|
57
|
+
* The first day of the week for `lang` (0 = Sunday, 1 = Monday, ...), from `Intl.Locale` week info where the
|
|
58
|
+
* runtime has it, else CLDR's first day for the language's likely region (Monday for most), else Sunday.
|
|
59
|
+
*/
|
|
60
|
+
export declare function localeFirstDayOfWeek(lang: string): number;
|
|
61
|
+
/** CLDR's first day of the week for a region (0 = Sunday, 1 = Monday, ...), for runtimes without `Intl.Locale` week info. */
|
|
62
|
+
export declare function regionFirstDayOfWeek(region: string): number;
|
|
63
|
+
/** Reads an event time: a `Date`, a date-only string (local midnight), a local date-time string, or any string `Date` parses. */
|
|
64
|
+
export declare function parseTime(value: string | Date | undefined): {
|
|
65
|
+
date: Date;
|
|
66
|
+
dateOnly: boolean;
|
|
67
|
+
} | undefined;
|
|
68
|
+
/** Resolves the app's events; ones without a readable `start` are dropped. */
|
|
69
|
+
export declare function normalizeEvents(events: readonly CalendarEvent[] | null | undefined, readonly?: boolean): NormalizedEvent[];
|
|
70
|
+
/** The last day an event covers (its end is exclusive, so an event ending at midnight doesn't reach that day). */
|
|
71
|
+
export declare function lastDay(event: {
|
|
72
|
+
start: Date;
|
|
73
|
+
end: Date;
|
|
74
|
+
}): CalendarDate;
|
|
75
|
+
/** Whether an event covers any part of `day`. */
|
|
76
|
+
export declare function coversDay(event: {
|
|
77
|
+
start: Date;
|
|
78
|
+
end: Date;
|
|
79
|
+
}, day: CalendarDate): boolean;
|
|
80
|
+
export interface TimedSegment<T> {
|
|
81
|
+
item: T;
|
|
82
|
+
/** Minutes from the day's midnight, clipped to the day. */
|
|
83
|
+
top: number;
|
|
84
|
+
bottom: number;
|
|
85
|
+
/** Whether the event started before this day / goes on past it. */
|
|
86
|
+
continuesBefore: boolean;
|
|
87
|
+
continuesAfter: boolean;
|
|
88
|
+
column: number;
|
|
89
|
+
columns: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The part of each timed event that falls on `day`, laid out in side-by-side columns where they overlap:
|
|
93
|
+
* each cluster of transitively overlapping events gets as many equal columns as it needs at its busiest,
|
|
94
|
+
* and every event the first column free at its start. Events shorter than `minLength` minutes are laid out
|
|
95
|
+
* as if they were that long, so they stay visible and don't overprint.
|
|
96
|
+
*/
|
|
97
|
+
export declare function layoutDay<T extends {
|
|
98
|
+
start: Date;
|
|
99
|
+
end: Date;
|
|
100
|
+
}>(items: readonly T[], day: CalendarDate, minLength?: number): TimedSegment<T>[];
|
|
101
|
+
export interface SpanSegment<T> {
|
|
102
|
+
item: T;
|
|
103
|
+
/** First and last column (0-based day index within the row) the event covers. */
|
|
104
|
+
startColumn: number;
|
|
105
|
+
endColumn: number;
|
|
106
|
+
lane: number;
|
|
107
|
+
continuesBefore: boolean;
|
|
108
|
+
continuesAfter: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Lays events out as bars across a row of `days` consecutive days (a month-view week or the all-day row):
|
|
112
|
+
* each covering event becomes one bar, and bars are stacked in the first lane that's free over their whole
|
|
113
|
+
* span, longer bars first.
|
|
114
|
+
*/
|
|
115
|
+
export declare function layoutSpans<T extends {
|
|
116
|
+
start: Date;
|
|
117
|
+
end: Date;
|
|
118
|
+
allDay?: boolean;
|
|
119
|
+
}>(items: readonly T[], first: CalendarDate, days: number): SpanSegment<T>[];
|
|
120
|
+
//# sourceMappingURL=calendar-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,CA8B5J"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar math and event layout, with no DOM. All times are in the runtime's local time zone: a `Date`
|
|
3
|
+
* is shown at its local wall-clock time, and ISO strings without an offset are read as local time.
|
|
4
|
+
* Date-only strings (`"2026-06-15"`) are parsed by hand, never through `new Date(str)` (which reads
|
|
5
|
+
* them as UTC midnight and shifts them a day in negative-offset zones).
|
|
6
|
+
*/
|
|
7
|
+
const DATE_ONLY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
8
|
+
const LOCAL_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;
|
|
9
|
+
export const MINUTE = 60_000;
|
|
10
|
+
export const DAY_MINUTES = 24 * 60;
|
|
11
|
+
export function parseISODate(iso) {
|
|
12
|
+
const match = iso ? DATE_ONLY.exec(iso) : null;
|
|
13
|
+
if (!match)
|
|
14
|
+
return undefined;
|
|
15
|
+
return { year: Number(match[1]), month: Number(match[2]) - 1, day: Number(match[3]) };
|
|
16
|
+
}
|
|
17
|
+
export function formatISODate(date) {
|
|
18
|
+
return `${String(date.year).padStart(4, "0")}-${String(date.month + 1).padStart(2, "0")}-${String(date.day).padStart(2, "0")}`;
|
|
19
|
+
}
|
|
20
|
+
export function toDate(date, minutes = 0) {
|
|
21
|
+
return new Date(date.year, date.month, date.day, 0, minutes);
|
|
22
|
+
}
|
|
23
|
+
export function fromDate(date) {
|
|
24
|
+
return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
|
|
25
|
+
}
|
|
26
|
+
export function today() {
|
|
27
|
+
return fromDate(new Date());
|
|
28
|
+
}
|
|
29
|
+
export function compareDate(a, b) {
|
|
30
|
+
return a.year - b.year || a.month - b.month || a.day - b.day;
|
|
31
|
+
}
|
|
32
|
+
export const sameDate = (a, b) => compareDate(a, b) === 0;
|
|
33
|
+
export function addDays(date, delta) {
|
|
34
|
+
return fromDate(new Date(date.year, date.month, date.day + delta));
|
|
35
|
+
}
|
|
36
|
+
/** The same day `delta` months away, clamped to the target month's length (Jan 31 + 1 month = Feb 28). */
|
|
37
|
+
export function addMonths(date, delta) {
|
|
38
|
+
const first = new Date(date.year, date.month + delta, 1);
|
|
39
|
+
const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();
|
|
40
|
+
return { year: first.getFullYear(), month: first.getMonth(), day: Math.min(date.day, last) };
|
|
41
|
+
}
|
|
42
|
+
/** Whole days from `a` to `b` (calendar days, so DST changes don't matter). */
|
|
43
|
+
export function daysBetween(a, b) {
|
|
44
|
+
return Math.round((Date.UTC(b.year, b.month, b.day) - Date.UTC(a.year, a.month, a.day)) / 86_400_000);
|
|
45
|
+
}
|
|
46
|
+
export function startOfWeek(date, firstDayOfWeek) {
|
|
47
|
+
const weekday = new Date(date.year, date.month, date.day).getDay();
|
|
48
|
+
return addDays(date, -((weekday - firstDayOfWeek + 7) % 7));
|
|
49
|
+
}
|
|
50
|
+
/** Minutes since local midnight of `day` (can be negative, or past 1440). Wall-clock, so DST days still have 24 hours of rows. */
|
|
51
|
+
export function minutesInto(day, date) {
|
|
52
|
+
return daysBetween(day, fromDate(date)) * DAY_MINUTES + date.getHours() * 60 + date.getMinutes();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The first day of the week for `lang` (0 = Sunday, 1 = Monday, ...), from `Intl.Locale` week info where the
|
|
56
|
+
* runtime has it, else CLDR's first day for the language's likely region (Monday for most), else Sunday.
|
|
57
|
+
*/
|
|
58
|
+
export function localeFirstDayOfWeek(lang) {
|
|
59
|
+
try {
|
|
60
|
+
const locale = new Intl.Locale(lang);
|
|
61
|
+
const info = locale.getWeekInfo?.() ?? locale.weekInfo;
|
|
62
|
+
if (info && typeof info.firstDay === "number")
|
|
63
|
+
return info.firstDay % 7;
|
|
64
|
+
// No week info (Firefox): CLDR's first day for the language's likely region.
|
|
65
|
+
const region = locale.maximize().region;
|
|
66
|
+
if (region)
|
|
67
|
+
return regionFirstDayOfWeek(region);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// invalid language tag: fall through
|
|
71
|
+
}
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
/** CLDR's first day of the week for a region (0 = Sunday, 1 = Monday, ...), for runtimes without `Intl.Locale` week info. */
|
|
75
|
+
export function regionFirstDayOfWeek(region) {
|
|
76
|
+
if (SUNDAY_FIRST.includes(region))
|
|
77
|
+
return 0;
|
|
78
|
+
if (SATURDAY_FIRST.includes(region))
|
|
79
|
+
return 6;
|
|
80
|
+
return region === "MV" ? 5 : 1;
|
|
81
|
+
}
|
|
82
|
+
// CLDR weekData firstDay; every other region starts on Monday.
|
|
83
|
+
const SUNDAY_FIRST = "AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN IS JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW".split(" ");
|
|
84
|
+
const SATURDAY_FIRST = "AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY".split(" ");
|
|
85
|
+
/** Reads an event time: a `Date`, a date-only string (local midnight), a local date-time string, or any string `Date` parses. */
|
|
86
|
+
export function parseTime(value) {
|
|
87
|
+
if (value instanceof Date)
|
|
88
|
+
return Number.isNaN(value.getTime()) ? undefined : { date: value, dateOnly: false };
|
|
89
|
+
if (typeof value !== "string" || !value)
|
|
90
|
+
return undefined;
|
|
91
|
+
const day = parseISODate(value);
|
|
92
|
+
if (day)
|
|
93
|
+
return { date: toDate(day), dateOnly: true };
|
|
94
|
+
const local = LOCAL_DATE_TIME.exec(value);
|
|
95
|
+
const date = local
|
|
96
|
+
? new Date(+local[1], +local[2] - 1, +local[3], +local[4], +local[5], +(local[6] ?? 0), +(local[7] ?? 0))
|
|
97
|
+
: new Date(value);
|
|
98
|
+
return Number.isNaN(date.getTime()) ? undefined : { date, dateOnly: false };
|
|
99
|
+
}
|
|
100
|
+
/** Resolves the app's events; ones without a readable `start` are dropped. */
|
|
101
|
+
export function normalizeEvents(events, readonly = false) {
|
|
102
|
+
const out = [];
|
|
103
|
+
for (const source of Array.isArray(events) ? events : []) {
|
|
104
|
+
if (!source || typeof source !== "object")
|
|
105
|
+
continue;
|
|
106
|
+
const start = parseTime(source.start);
|
|
107
|
+
if (!start)
|
|
108
|
+
continue;
|
|
109
|
+
const allDay = source.allDay ?? start.dateOnly;
|
|
110
|
+
let startDate = start.date;
|
|
111
|
+
if (allDay)
|
|
112
|
+
startDate = toDate(fromDate(startDate));
|
|
113
|
+
let end = parseTime(source.end)?.date;
|
|
114
|
+
if (allDay && end) {
|
|
115
|
+
// An all-day end that isn't at midnight still covers that day.
|
|
116
|
+
const endDay = fromDate(end);
|
|
117
|
+
end = end.getHours() || end.getMinutes() ? toDate(addDays(endDay, 1)) : toDate(endDay);
|
|
118
|
+
}
|
|
119
|
+
if (!end || end.getTime() <= startDate.getTime()) {
|
|
120
|
+
end = allDay ? toDate(addDays(fromDate(startDate), 1)) : new Date(startDate.getTime() + 60 * MINUTE);
|
|
121
|
+
}
|
|
122
|
+
out.push({
|
|
123
|
+
source,
|
|
124
|
+
key: String(source.id),
|
|
125
|
+
title: typeof source.title === "string" ? source.title : String(source.title ?? ""),
|
|
126
|
+
start: startDate,
|
|
127
|
+
end,
|
|
128
|
+
allDay,
|
|
129
|
+
color: typeof source.color === "string" ? source.color : undefined,
|
|
130
|
+
editable: !readonly && source.editable !== false,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return out.sort((a, b) => a.start.getTime() - b.start.getTime() || b.end.getTime() - a.end.getTime());
|
|
134
|
+
}
|
|
135
|
+
/** The last day an event covers (its end is exclusive, so an event ending at midnight doesn't reach that day). */
|
|
136
|
+
export function lastDay(event) {
|
|
137
|
+
const end = new Date(event.end.getTime() - 1);
|
|
138
|
+
return end.getTime() < event.start.getTime() ? fromDate(event.start) : fromDate(end);
|
|
139
|
+
}
|
|
140
|
+
/** Whether an event covers any part of `day`. */
|
|
141
|
+
export function coversDay(event, day) {
|
|
142
|
+
return compareDate(fromDate(event.start), day) <= 0 && compareDate(lastDay(event), day) >= 0;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The part of each timed event that falls on `day`, laid out in side-by-side columns where they overlap:
|
|
146
|
+
* each cluster of transitively overlapping events gets as many equal columns as it needs at its busiest,
|
|
147
|
+
* and every event the first column free at its start. Events shorter than `minLength` minutes are laid out
|
|
148
|
+
* as if they were that long, so they stay visible and don't overprint.
|
|
149
|
+
*/
|
|
150
|
+
export function layoutDay(items, day, minLength = 15) {
|
|
151
|
+
const segments = [];
|
|
152
|
+
for (const item of items) {
|
|
153
|
+
const start = minutesInto(day, item.start);
|
|
154
|
+
const end = minutesInto(day, item.end);
|
|
155
|
+
if (end <= 0 || start >= DAY_MINUTES)
|
|
156
|
+
continue;
|
|
157
|
+
const top = Math.max(0, start);
|
|
158
|
+
const bottom = Math.min(DAY_MINUTES, Math.max(end, Math.min(DAY_MINUTES, top + minLength)));
|
|
159
|
+
segments.push({ item, top, bottom, continuesBefore: start < 0, continuesAfter: end > DAY_MINUTES, column: 0, columns: 1 });
|
|
160
|
+
}
|
|
161
|
+
segments.sort((a, b) => a.top - b.top || b.bottom - a.bottom);
|
|
162
|
+
let cluster = [];
|
|
163
|
+
let columnEnds = [];
|
|
164
|
+
let clusterEnd = -1;
|
|
165
|
+
const close = () => {
|
|
166
|
+
for (const s of cluster)
|
|
167
|
+
s.columns = columnEnds.length;
|
|
168
|
+
cluster = [];
|
|
169
|
+
columnEnds = [];
|
|
170
|
+
};
|
|
171
|
+
for (const segment of segments) {
|
|
172
|
+
if (segment.top >= clusterEnd)
|
|
173
|
+
close();
|
|
174
|
+
let column = columnEnds.findIndex((end) => end <= segment.top);
|
|
175
|
+
if (column === -1)
|
|
176
|
+
column = columnEnds.push(segment.bottom) - 1;
|
|
177
|
+
else
|
|
178
|
+
columnEnds[column] = segment.bottom;
|
|
179
|
+
segment.column = column;
|
|
180
|
+
cluster.push(segment);
|
|
181
|
+
clusterEnd = Math.max(clusterEnd, segment.bottom);
|
|
182
|
+
}
|
|
183
|
+
close();
|
|
184
|
+
return segments;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Lays events out as bars across a row of `days` consecutive days (a month-view week or the all-day row):
|
|
188
|
+
* each covering event becomes one bar, and bars are stacked in the first lane that's free over their whole
|
|
189
|
+
* span, longer bars first.
|
|
190
|
+
*/
|
|
191
|
+
export function layoutSpans(items, first, days) {
|
|
192
|
+
const segments = [];
|
|
193
|
+
for (const item of items) {
|
|
194
|
+
const from = daysBetween(first, fromDate(item.start));
|
|
195
|
+
const to = daysBetween(first, lastDay(item));
|
|
196
|
+
if (to < 0 || from >= days)
|
|
197
|
+
continue;
|
|
198
|
+
segments.push({
|
|
199
|
+
item,
|
|
200
|
+
startColumn: Math.max(0, from),
|
|
201
|
+
endColumn: Math.min(days - 1, to),
|
|
202
|
+
lane: 0,
|
|
203
|
+
continuesBefore: from < 0,
|
|
204
|
+
continuesAfter: to >= days,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
segments.sort((a, b) => a.startColumn - b.startColumn ||
|
|
208
|
+
b.endColumn - b.startColumn - (a.endColumn - a.startColumn) ||
|
|
209
|
+
Number(b.item.allDay ?? false) - Number(a.item.allDay ?? false) ||
|
|
210
|
+
a.item.start.getTime() - b.item.start.getTime());
|
|
211
|
+
const laneEnds = [];
|
|
212
|
+
for (const segment of segments) {
|
|
213
|
+
let lane = laneEnds.findIndex((end) => end < segment.startColumn);
|
|
214
|
+
if (lane === -1)
|
|
215
|
+
lane = laneEnds.push(segment.endColumn) - 1;
|
|
216
|
+
else
|
|
217
|
+
laneEnds[lane] = segment.endColumn;
|
|
218
|
+
segment.lane = lane;
|
|
219
|
+
}
|
|
220
|
+
return segments;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=calendar-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-utils.js","sourceRoot":"","sources":["../src/calendar-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqCH,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAC9C,MAAM,eAAe,GAAG,2EAA2E,CAAC;AACpG,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,CAAC;AAEnC,MAAM,UAAU,YAAY,CAAC,GAA8B;IACzD,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAkB;IAC9C,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACjI,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAkB,EAAE,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0,0 +1,180 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
|
+
import "@lit-material/segmented-button";
|
|
3
|
+
import { type CalendarEvent } from "./calendar-utils.js";
|
|
4
|
+
export type CalendarView = "month" | "week" | "day" | "agenda";
|
|
5
|
+
export type { CalendarEvent } from "./calendar-utils.js";
|
|
6
|
+
/** `slot-click`: an empty day, all-day cell or time range was activated. `end` is exclusive. */
|
|
7
|
+
export interface SlotClickDetail {
|
|
8
|
+
start: Date;
|
|
9
|
+
end: Date;
|
|
10
|
+
allDay: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** `event-click`: the app's own event object. */
|
|
13
|
+
export interface EventClickDetail {
|
|
14
|
+
event: CalendarEvent;
|
|
15
|
+
}
|
|
16
|
+
/** `event-change`: where the user wants an event to be. `end` is exclusive (midnight after the last day for all-day events). */
|
|
17
|
+
export interface EventChangeDetail {
|
|
18
|
+
event: CalendarEvent;
|
|
19
|
+
start: Date;
|
|
20
|
+
end: Date;
|
|
21
|
+
allDay: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** `navigate`: the view or the period on screen changed. `end` is exclusive. */
|
|
24
|
+
export interface NavigateDetail {
|
|
25
|
+
view: CalendarView;
|
|
26
|
+
date: string;
|
|
27
|
+
start: Date;
|
|
28
|
+
end: Date;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Material Design 3 styled calendar and scheduler: a month grid, week and day time grids, and an agenda
|
|
32
|
+
* list, with a toolbar (previous / today / next, the period's title, and a view switch).
|
|
33
|
+
*
|
|
34
|
+
* Events are controlled: the element never moves an event itself. Dragging, resizing or Alt+arrow keys
|
|
35
|
+
* fire a cancelable `event-change` with the new times; update `events` to accept it.
|
|
36
|
+
*
|
|
37
|
+
* Times are in the browser's (or server's) local time zone. ISO strings without an offset are read as
|
|
38
|
+
* local wall-clock time; date-only strings are local days. `slot-click` and `event-change` hand back
|
|
39
|
+
* local `Date`s.
|
|
40
|
+
*
|
|
41
|
+
* The month view is an ARIA grid of days. The week and day views are one ARIA grid too: a header row of
|
|
42
|
+
* days, an "All day" row, then a row per time slot, each with a time row header. One cell is in the tab
|
|
43
|
+
* order (arrow keys move it); Tab goes on to the events in that cell, each a button named by its title
|
|
44
|
+
* and time.
|
|
45
|
+
*
|
|
46
|
+
* @element lit-material-calendar
|
|
47
|
+
*
|
|
48
|
+
* @fires event-click - `detail: { event }` when an event is clicked or activated with Enter/Space.
|
|
49
|
+
* @fires slot-click - `detail: { start, end, allDay }` when an empty day, all-day cell or time slot is
|
|
50
|
+
* clicked or activated, or a time range is dragged out (pointer) or extended with Shift+arrows.
|
|
51
|
+
* @fires event-change - Cancelable. `detail: { event, start, end, allDay }` when an event is dragged,
|
|
52
|
+
* resized or moved with the keyboard. The app updates `events`.
|
|
53
|
+
* @fires navigate - `detail: { view, date, start, end }` when the toolbar, keyboard or a "+N more" link
|
|
54
|
+
* changes the view or the period shown.
|
|
55
|
+
*
|
|
56
|
+
* @csspart toolbar - The row with the navigation buttons, title and view switch.
|
|
57
|
+
* @csspart title - The period's title.
|
|
58
|
+
* @csspart views - The view switch (a segmented button group).
|
|
59
|
+
* @csspart grid - The month grid or the time grid.
|
|
60
|
+
* @csspart agenda - The agenda list.
|
|
61
|
+
* @csspart event - Each event chip.
|
|
62
|
+
*
|
|
63
|
+
* @cssprop --lit-material-calendar-slot-height - Height of one time slot in the week and day views. Default 24px.
|
|
64
|
+
* @cssprop --lit-material-calendar-height - Maximum height of the scrolling time grid. Default 640px.
|
|
65
|
+
*/
|
|
66
|
+
export declare class LitMaterialCalendar extends LitElement {
|
|
67
|
+
static styles: import("lit").CSSResult;
|
|
68
|
+
/** Which view is shown. */
|
|
69
|
+
view: CalendarView;
|
|
70
|
+
/** The day in focus, as an ISO `"YYYY-MM-DD"` string; the view shows the month, week or day around it. Default: today. */
|
|
71
|
+
date?: string;
|
|
72
|
+
/** The events: `{ id, title, start, end?, allDay?, color?, editable?, ...data }`. Property or JSON attribute. */
|
|
73
|
+
events: CalendarEvent[];
|
|
74
|
+
/** 0 = Sunday, 1 = Monday, ... Default: the first day of the week in the element's language, else Sunday. */
|
|
75
|
+
firstDayOfWeek?: number;
|
|
76
|
+
/** Minutes per row of the week and day views; also the step for keyboard moves. */
|
|
77
|
+
slotMinutes: number;
|
|
78
|
+
/** The hour the week and day views scroll to when they open. */
|
|
79
|
+
scrollToHour: number;
|
|
80
|
+
/** Event rows per day in the month view before "+N more". */
|
|
81
|
+
dayMaxEvents: number;
|
|
82
|
+
/** Days the agenda view lists, from `date`. */
|
|
83
|
+
agendaDays: number;
|
|
84
|
+
/** No dragging, resizing or keyboard moves (clicks still fire). */
|
|
85
|
+
readonly: boolean;
|
|
86
|
+
/** Slot in focus in the time grid (`-1`: the all-day row). */
|
|
87
|
+
private focusSlot;
|
|
88
|
+
private selection;
|
|
89
|
+
private preview;
|
|
90
|
+
private agendaIndex;
|
|
91
|
+
private announcement;
|
|
92
|
+
/** The current time, for the line in the time grid. Unset on the server and in the first (hydrating) render, so a page rendered earlier still hydrates. */
|
|
93
|
+
private now?;
|
|
94
|
+
private readonly localize;
|
|
95
|
+
private normalized;
|
|
96
|
+
private byKey;
|
|
97
|
+
private focusAfterUpdate;
|
|
98
|
+
private pendingEventFocus;
|
|
99
|
+
private drag;
|
|
100
|
+
private suppressClick;
|
|
101
|
+
private scrolledView;
|
|
102
|
+
private timer?;
|
|
103
|
+
connectedCallback(): void;
|
|
104
|
+
private startClock;
|
|
105
|
+
disconnectedCallback(): void;
|
|
106
|
+
private get slotLength();
|
|
107
|
+
private get slotCount();
|
|
108
|
+
private get anchor();
|
|
109
|
+
private get weekStart();
|
|
110
|
+
private get agendaLength();
|
|
111
|
+
/** The first day shown and how many days, for a view around `anchor`. */
|
|
112
|
+
private rangeOf;
|
|
113
|
+
/** The first and (exclusive) last instant on screen. */
|
|
114
|
+
get visibleRange(): {
|
|
115
|
+
start: Date;
|
|
116
|
+
end: Date;
|
|
117
|
+
};
|
|
118
|
+
private inPeriod;
|
|
119
|
+
private get timeGrid();
|
|
120
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
121
|
+
private defaultSlot;
|
|
122
|
+
protected updated(): void;
|
|
123
|
+
private scrollToDefaultHour;
|
|
124
|
+
/** After an `event-change` the app accepted: focus and announce the event where it is now. */
|
|
125
|
+
private followMovedEvent;
|
|
126
|
+
/** Shows the next month, week, day or agenda period. */
|
|
127
|
+
next(): void;
|
|
128
|
+
/** Shows the previous period. */
|
|
129
|
+
previous(): void;
|
|
130
|
+
/** Shows the period with today in it. */
|
|
131
|
+
goToToday(): void;
|
|
132
|
+
private step;
|
|
133
|
+
/** Moves the focused day, firing `navigate` when the period on screen changes. */
|
|
134
|
+
private setDate;
|
|
135
|
+
private periodTitle;
|
|
136
|
+
private eventTime;
|
|
137
|
+
private eventLabel;
|
|
138
|
+
private dayLabel;
|
|
139
|
+
private navLabel;
|
|
140
|
+
private viewLabel;
|
|
141
|
+
render(): TemplateResult<1>;
|
|
142
|
+
private renderToolbar;
|
|
143
|
+
/** The events to lay out, with a drag preview in place of the event being dragged. */
|
|
144
|
+
private get displayed();
|
|
145
|
+
private renderChip;
|
|
146
|
+
private renderMonth;
|
|
147
|
+
private renderTimeGrid;
|
|
148
|
+
private agendaItems;
|
|
149
|
+
private renderAgenda;
|
|
150
|
+
private readonly handleToday;
|
|
151
|
+
private readonly handlePrevious;
|
|
152
|
+
private readonly handleNext;
|
|
153
|
+
private readonly handleViewChange;
|
|
154
|
+
private cellInfo;
|
|
155
|
+
private slotTimes;
|
|
156
|
+
private emitSlot;
|
|
157
|
+
private emitEventClick;
|
|
158
|
+
private readonly handleGridClick;
|
|
159
|
+
/** Focus that lands on a cell (a click, or a chip's cell) makes it the roving tab stop. */
|
|
160
|
+
private readonly handleFocusIn;
|
|
161
|
+
private focusCellLater;
|
|
162
|
+
private readonly handleGridKeydown;
|
|
163
|
+
/** Alt+arrows move an event, Alt+Shift+arrows change its end. Returns whether the key was handled. */
|
|
164
|
+
private handleEventKeydown;
|
|
165
|
+
private requestChange;
|
|
166
|
+
private cellAt;
|
|
167
|
+
private readonly handlePointerDown;
|
|
168
|
+
private readonly handlePointerMove;
|
|
169
|
+
private readonly handlePointerUp;
|
|
170
|
+
private readonly handlePointerCancel;
|
|
171
|
+
private endDrag;
|
|
172
|
+
private readonly handleAgendaClick;
|
|
173
|
+
private readonly handleAgendaKeydown;
|
|
174
|
+
}
|
|
175
|
+
declare global {
|
|
176
|
+
interface HTMLElementTagNameMap {
|
|
177
|
+
"lit-material-calendar": LitMaterialCalendar;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAgB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIzG,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,aAAa,EAsBnB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,gIAAgI;AAChI,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,gFAAgF;AAChF,MAAM,WA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