@slotted/react 0.1.0-beta.15 → 0.1.0-beta.16
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/{action-sheet-Klu-YxIk.js → action-sheet-dNnB26br.js} +20 -20
- package/dist/action-sheet.js +1 -1
- package/dist/{attachment-DKKiNUKe.js → attachment-C1wBuup6.js} +2 -0
- package/dist/attachment.js +1 -1
- package/dist/calendar-wqDIW4Z8.js +469 -0
- package/dist/calendar.js +1 -1
- package/dist/{column-manager-e234Ey_u.js → column-manager-C8fN_mDy.js} +6 -6
- package/dist/column-manager.js +1 -1
- package/dist/dashboard-grid-ByThIV_n.js +1066 -0
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-B5feiNsE.js → data-grid-aHlR2FHu.js} +4 -4
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-CUvUS2AX.js → data-list-Cu6LtnDX.js} +1 -1
- package/dist/data-list.js +1 -1
- package/dist/{date-picker-Dys-z9mZ.js → date-picker-B5V8NZCT.js} +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/{date-range-picker-Cu95hHyO.js → date-range-picker-B89Q973N.js} +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-picker-B7eWKoN3.js → datetime-picker-Cx6Z52Ka.js} +1 -1
- package/dist/datetime-picker.js +1 -1
- package/dist/{datetime-range-picker-Cm42pY3M.js → datetime-range-picker-DYshAlgq.js} +1 -1
- package/dist/datetime-range-picker.js +1 -1
- package/dist/docs/calendar.json +19 -1
- package/dist/docs/calendar.md +3 -1
- package/dist/docs/dashboard-grid.json +26 -4
- package/dist/docs/dashboard-grid.md +5 -2
- package/dist/docs/drawer.json +13 -4
- package/dist/docs/drawer.md +5 -4
- package/dist/docs/link.json +16 -0
- package/dist/docs/link.md +3 -1
- package/dist/docs/list-item.json +10 -2
- package/dist/docs/list-item.md +20 -13
- package/dist/docs/markdown.json +7 -0
- package/dist/docs/markdown.md +1 -0
- package/dist/docs/message-scroller.json +1 -1
- package/dist/docs/prompt-composer.json +9 -2
- package/dist/docs/prompt-composer.md +3 -1
- package/dist/{drawer-CFpBsLG6.js → drawer-Du1aC1px.js} +17 -4
- package/dist/drawer.js +2 -2
- package/dist/{event-calendar-liaKOKOH.js → event-calendar-CEIyV-fW.js} +520 -520
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-vJzwcDZj.js → filter-bar-BHzy0o7n.js} +8 -8
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-BIB7sRCl.js → import-export-center-BX1Bhj8c.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +124 -124
- package/dist/{link-rGL3Lr2t.js → link-YvD_Wov8.js} +23 -22
- package/dist/link.js +1 -1
- package/dist/list-item-2z75VYyp.js +160 -0
- package/dist/list-item.js +1 -1
- package/dist/markdown-gfrgwq6-.js +311 -0
- package/dist/markdown.js +1 -1
- package/dist/{prompt-composer-BDOi4rVK.js → prompt-composer-C57BzYrn.js} +109 -77
- package/dist/prompt-composer.js +2 -2
- package/dist/styles/action-sheet.css +1 -1
- package/dist/styles/calendar.css +3 -1
- package/dist/styles/chart.css +1 -1
- package/dist/styles/column-manager.css +1 -1
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/dashboard-grid.css +3 -1
- package/dist/styles/data-grid.css +1 -1
- package/dist/styles/date-picker.css +3 -1
- package/dist/styles/date-range-picker.css +3 -1
- package/dist/styles/datetime-picker.css +3 -1
- package/dist/styles/datetime-range-picker.css +3 -1
- package/dist/styles/detail-panel.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/event-calendar.css +1 -1
- package/dist/styles/filter-bar.css +4 -2
- package/dist/styles/import-export-center.css +2 -2
- package/dist/styles/index.css +11 -11
- package/dist/styles/link.css +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/message.css +1 -1
- package/dist/styles/prompt-composer.css +1 -1
- package/dist/styles/section.css +1 -1
- package/dist/styles/stat-card.css +1 -1
- package/dist/styles/table.css +2 -2
- package/dist/styles/upload.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table-_xX87qua.js → table-BHuKvsgJ.js} +4 -4
- package/dist/table.js +1 -1
- package/dist/types/calendar/calendar.d.ts +2 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/calendar.types.d.ts +11 -0
- package/dist/types/calendar/calendar.types.d.ts.map +1 -1
- package/dist/types/calendar/index.d.ts +1 -1
- package/dist/types/calendar/index.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.d.ts +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.types.d.ts +23 -3
- package/dist/types/dashboard-grid/dashboard-grid.types.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
- package/dist/types/dashboard-grid/index.d.ts +1 -1
- package/dist/types/dashboard-grid/index.d.ts.map +1 -1
- package/dist/types/drawer/drawer-parts.d.ts +3 -1
- package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
- package/dist/types/drawer/drawer.types.d.ts +2 -0
- package/dist/types/drawer/drawer.types.d.ts.map +1 -1
- package/dist/types/drawer/index.d.ts +2 -2
- package/dist/types/drawer/index.d.ts.map +1 -1
- package/dist/types/link/index.d.ts +1 -1
- package/dist/types/link/index.d.ts.map +1 -1
- package/dist/types/link/link.d.ts +1 -1
- package/dist/types/link/link.d.ts.map +1 -1
- package/dist/types/link/link.types.d.ts +7 -0
- package/dist/types/link/link.types.d.ts.map +1 -1
- package/dist/types/list-item/list-item-content.d.ts +3 -3
- package/dist/types/list-item/list-item-content.d.ts.map +1 -1
- package/dist/types/list-item/list-item-nesting.d.ts +15 -0
- package/dist/types/list-item/list-item-nesting.d.ts.map +1 -0
- package/dist/types/list-item/list-item-parts.d.ts +3 -3
- package/dist/types/list-item/list-item-parts.d.ts.map +1 -1
- package/dist/types/markdown/markdown.d.ts +1 -1
- package/dist/types/markdown/markdown.d.ts.map +1 -1
- package/dist/types/markdown/markdown.types.d.ts +6 -1
- package/dist/types/markdown/markdown.types.d.ts.map +1 -1
- package/dist/types/prompt-composer/index.d.ts +2 -2
- package/dist/types/prompt-composer/index.d.ts.map +1 -1
- package/dist/types/prompt-composer/prompt-composer.d.ts +8 -1
- package/dist/types/prompt-composer/prompt-composer.d.ts.map +1 -1
- package/dist/types/prompt-composer/prompt-composer.types.d.ts +7 -1
- package/dist/types/prompt-composer/prompt-composer.types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/calendar-DZx00W81.js +0 -457
- package/dist/dashboard-grid-B9-_lwn6.js +0 -1048
- package/dist/list-item-CHaJYl5r.js +0 -125
- package/dist/markdown-B_lMpWz0.js +0 -306
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { n as e, r as t } from "./i18n-D7xXDd8-.js";
|
|
2
2
|
import { n, t as r } from "./icon-D04-_QFA.js";
|
|
3
3
|
import { _ as i, n as a, r as o, t as s } from "./menu-parts-BDdCTmko.js";
|
|
4
|
-
import {
|
|
4
|
+
import { c, d as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./drawer-Du1aC1px.js";
|
|
5
5
|
import { n as g } from "./progress-indicator-D0acshNn.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { a as _, c as v, f as ee, i as te, l as ne, o as re, p as ie, r as ae, u as oe } from "./popover-BfEn2wdZ.js";
|
|
8
8
|
import { n as se, r as y, t as ce } from "./context-menu-BxbGq4bu.js";
|
|
9
9
|
import { a as le, t as ue } from "./segmented-control-B1U-s58C.js";
|
|
10
10
|
import { keyedProps as de, selectorKeyProps as fe, withSelectorKey as pe } from "@slotted/core/selector-key";
|
|
11
|
-
import { createContext as me, createElement as he, useCallback as b, useContext as ge, useEffect as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { eventCalendarMessages as
|
|
14
|
-
import { COMPACT_BELOW as
|
|
15
|
-
import { getLiveAnnouncer as
|
|
16
|
-
import { addDays as
|
|
17
|
-
import { calendarColor as
|
|
11
|
+
import { createContext as me, createElement as he, useCallback as b, useContext as ge, useEffect as _e, useId as ve, useImperativeHandle as ye, useLayoutEffect as be, useMemo as xe, useRef as x, useState as S } from "react";
|
|
12
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
13
|
+
import { eventCalendarMessages as Se } from "@slotted/core/i18n";
|
|
14
|
+
import { COMPACT_BELOW as Ce, createWidthGate as we } from "@slotted/core/measure";
|
|
15
|
+
import { getLiveAnnouncer as Te } from "@slotted/core/live-announcer";
|
|
16
|
+
import { addDays as Ee, compareDate as De, compareDateTime as Oe, createDateFormat as ke, daysBetween as Ae, isPlainDateTime as E, isSameDate as D, isoWeekNumber as je, nowDateTimeIn as Me, plainDateTime as Ne, secondsOfDay as Pe, timeOfSeconds as Fe, toISODate as O, todayIn as Ie } from "@slotted/core/date";
|
|
17
|
+
import { calendarColor as Le, contextSlot as Re, formatHour as ze, formatOccurrence as Be, formatTime as Ve, formatTimeRange as He, isMultiDay as Ue, isWorkingDay as We, layoutColumn as Ge, layoutRow as Ke, listDayParts as qe, listDays as Je, moveDate as Ye, movePlacement as Xe, nextAllowedPlacement as Ze, occurrenceTimes as Qe, occurrenceWhen as $e, occurrencesIn as et, occurrencesOn as tt, offHoursOn as nt, offsetChangeOn as rt, overflowByDay as it, placeOccurrence as at, placementOf as ot, resizePlacement as st, slotMinutes as ct, stepView as lt, viewRange as ut, viewTitle as dt, withPlacement as ft, zoneLabel as pt } from "@slotted/core/event-calendar";
|
|
18
18
|
//#region src/event-calendar/event-calendar-context.ts
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
let e = ge(
|
|
19
|
+
var mt = me(null);
|
|
20
|
+
function k() {
|
|
21
|
+
let e = ge(mt);
|
|
22
22
|
if (e === null) throw Error("An event calendar part has to be inside EventCalendar.");
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/event-calendar/event-calendar-defaults.tsx
|
|
27
|
-
var
|
|
27
|
+
var ht = {
|
|
28
28
|
compact: "list",
|
|
29
29
|
dayHours: [0, 24],
|
|
30
30
|
firstDayOfWeek: void 0,
|
|
@@ -44,31 +44,31 @@ var mt = {
|
|
|
44
44
|
timeZone: void 0,
|
|
45
45
|
weekends: "shown",
|
|
46
46
|
weekNumbers: !1
|
|
47
|
-
},
|
|
48
|
-
function
|
|
49
|
-
return ge(
|
|
47
|
+
}, gt = me(ht);
|
|
48
|
+
function _t() {
|
|
49
|
+
return ge(gt);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let n = { ...
|
|
51
|
+
function vt({ children: e, ...t }) {
|
|
52
|
+
let n = { ..._t() };
|
|
53
53
|
for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = r);
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ w(gt.Provider, {
|
|
55
55
|
value: n,
|
|
56
56
|
children: e
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/event-calendar/event-calendar-event.tsx
|
|
61
|
-
function
|
|
61
|
+
function yt(e, t, n) {
|
|
62
62
|
if (t.allDay) return e.t("allDay");
|
|
63
63
|
let r = {
|
|
64
64
|
locale: e.locale,
|
|
65
65
|
hourCycle: e.hourCycle
|
|
66
|
-
}, { start: i, end: a } =
|
|
67
|
-
return i !== null && a !== null ?
|
|
66
|
+
}, { start: i, end: a } = Qe(t, n);
|
|
67
|
+
return i !== null && a !== null ? He(i, a, r) : i === null ? a === null ? e.t("allDay") : e.t("until", { time: Ve(a, r) }) : e.t("from", { time: Ve(i, r) });
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function bt(e, t, n) {
|
|
70
70
|
let r = [
|
|
71
|
-
|
|
71
|
+
Be(t, {
|
|
72
72
|
locale: e.locale,
|
|
73
73
|
hourCycle: e.hourCycle
|
|
74
74
|
}),
|
|
@@ -81,22 +81,22 @@ function yt(e, t, n) {
|
|
|
81
81
|
].filter((e) => e !== void 0 && e !== "");
|
|
82
82
|
return `, ${new Intl.ListFormat(e.locale, { type: "unit" }).format(r)}`;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
let p =
|
|
84
|
+
function xt({ clippedEnd: e, clippedStart: t, continuesAfter: i, continuesBefore: a, date: o, inGrid: s, layout: c, occurrence: l, short: u, style: d, withLocation: f }) {
|
|
85
|
+
let p = k(), { event: m } = l, h = l.key, g = p.openKey === h, _ = p.colorOf(m.calendar), v = c === "bar", ee = b((e) => p.registerEvent(h, e), [h, p.registerEvent]), te = c !== "bar" || !l.allDay, ne = c === "lane" || v && !l.allDay ? Ve(l.start.time, {
|
|
86
86
|
locale: p.locale,
|
|
87
87
|
hourCycle: p.hourCycle
|
|
88
|
-
}) :
|
|
89
|
-
te && !(v && l.allDay) ? /* @__PURE__ */
|
|
88
|
+
}) : yt(p, l, o), re = /* @__PURE__ */ T(C, { children: [
|
|
89
|
+
te && !(v && l.allDay) ? /* @__PURE__ */ w("span", {
|
|
90
90
|
"data-part": "event-time",
|
|
91
91
|
"data-part-event-time": "",
|
|
92
92
|
children: ne
|
|
93
93
|
}) : null,
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ w("span", {
|
|
95
95
|
"data-part": "event-title",
|
|
96
96
|
"data-part-event-title": "",
|
|
97
97
|
children: m.title
|
|
98
98
|
}),
|
|
99
|
-
f && m.location ? /* @__PURE__ */
|
|
99
|
+
f && m.location ? /* @__PURE__ */ w("span", {
|
|
100
100
|
"data-part": "event-location",
|
|
101
101
|
"data-part-event-location": "",
|
|
102
102
|
children: m.location
|
|
@@ -118,7 +118,7 @@ function bt({ clippedEnd: e, clippedStart: t, continuesAfter: i, continuesBefore
|
|
|
118
118
|
"data-color": _ === null ? void 0 : String(_),
|
|
119
119
|
"data-status": m.status === void 0 || m.status === "confirmed" ? void 0 : m.status,
|
|
120
120
|
"data-open": g ? "" : void 0,
|
|
121
|
-
"data-past": p.now !== null &&
|
|
121
|
+
"data-past": p.now !== null && Oe(l.end, p.now) <= 0 ? "" : void 0,
|
|
122
122
|
"data-continues-before": a ? "" : void 0,
|
|
123
123
|
"data-continues-after": i ? "" : void 0,
|
|
124
124
|
"data-clipped-start": t ? "" : void 0,
|
|
@@ -126,26 +126,26 @@ function bt({ clippedEnd: e, clippedStart: t, continuesAfter: i, continuesBefore
|
|
|
126
126
|
"data-short": u ? "" : void 0,
|
|
127
127
|
tabIndex: s ? -1 : void 0,
|
|
128
128
|
style: d
|
|
129
|
-
}, se = ae && s && (c === "block" ? e !== !0 && i !== !0 : c === "bar" && i !== !0), y = (e) => /* @__PURE__ */
|
|
129
|
+
}, se = ae && s && (c === "block" ? e !== !0 && i !== !0 : c === "bar" && i !== !0), y = (e) => /* @__PURE__ */ w(r, {
|
|
130
130
|
"data-edge": e,
|
|
131
131
|
size: "sm",
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
-
}), ce = /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ w(n, { name: "chevron-right" })
|
|
133
|
+
}), ce = /* @__PURE__ */ T(C, { children: [
|
|
134
134
|
c === "bar" && a === !0 ? y("start") : null,
|
|
135
135
|
ie,
|
|
136
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ w("span", {
|
|
137
137
|
"data-part": "event-meta",
|
|
138
138
|
"data-part-event-meta": "",
|
|
139
|
-
children:
|
|
139
|
+
children: bt(p, l, a === !0)
|
|
140
140
|
}),
|
|
141
141
|
c === "bar" && i === !0 ? y("end") : null,
|
|
142
|
-
se ? /* @__PURE__ */
|
|
142
|
+
se ? /* @__PURE__ */ w("span", {
|
|
143
143
|
"aria-hidden": "true",
|
|
144
144
|
"data-part": "resize-handle",
|
|
145
145
|
"data-part-resize-handle": ""
|
|
146
146
|
}) : null
|
|
147
147
|
] });
|
|
148
|
-
if (m.href !== void 0) return /* @__PURE__ */
|
|
148
|
+
if (m.href !== void 0) return /* @__PURE__ */ w("a", {
|
|
149
149
|
...oe,
|
|
150
150
|
href: m.href,
|
|
151
151
|
ref: ee,
|
|
@@ -154,7 +154,7 @@ function bt({ clippedEnd: e, clippedStart: t, continuesAfter: i, continuesBefore
|
|
|
154
154
|
let le = (e) => (t) => {
|
|
155
155
|
p.activate(l, t.currentTarget, e, t);
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ w("button", {
|
|
158
158
|
...oe,
|
|
159
159
|
"aria-expanded": p.hostsDetail || p.openKey !== null ? g : void 0,
|
|
160
160
|
"aria-haspopup": p.hostsDetail ? "dialog" : void 0,
|
|
@@ -166,49 +166,49 @@ function bt({ clippedEnd: e, clippedStart: t, continuesAfter: i, continuesBefore
|
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region src/event-calendar/event-calendar-list.tsx
|
|
169
|
-
function
|
|
170
|
-
let i =
|
|
171
|
-
return a.length === 0 ? /* @__PURE__ */
|
|
169
|
+
function St({ days: e, empty: t, emptyText: n, occurrences: r }) {
|
|
170
|
+
let i = k(), a = Je(r, e), o = `h${Math.min(6, i.headingLevel + 1)}`;
|
|
171
|
+
return a.length === 0 ? /* @__PURE__ */ w("div", {
|
|
172
172
|
"data-part": "list",
|
|
173
173
|
"data-part-list": "",
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ T("div", {
|
|
175
175
|
"data-part": "empty",
|
|
176
176
|
"data-part-empty": "",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ w("p", { children: n }), t]
|
|
178
178
|
})
|
|
179
|
-
}) : /* @__PURE__ */
|
|
179
|
+
}) : /* @__PURE__ */ w("div", {
|
|
180
180
|
"data-part": "list",
|
|
181
181
|
"data-part-list": "",
|
|
182
182
|
children: a.map((e) => {
|
|
183
|
-
let t =
|
|
184
|
-
return /* @__PURE__ */
|
|
183
|
+
let t = O(e.date), n = `${i.id}-list-${t}`, r = qe(e.date, i.locale);
|
|
184
|
+
return /* @__PURE__ */ T("section", {
|
|
185
185
|
"aria-labelledby": n,
|
|
186
186
|
"data-date": t,
|
|
187
187
|
"data-part": "list-day",
|
|
188
188
|
"data-part-list-day": "",
|
|
189
|
-
"data-today": i.today !== null &&
|
|
189
|
+
"data-today": i.today !== null && D(e.date, i.today) ? "" : void 0,
|
|
190
190
|
children: [he(o, {
|
|
191
191
|
"aria-label": r.label,
|
|
192
192
|
"data-part": "list-day-heading",
|
|
193
193
|
...fe("part", "list-day-heading"),
|
|
194
194
|
id: n
|
|
195
|
-
}, /* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
195
|
+
}, /* @__PURE__ */ T(C, { children: [
|
|
196
|
+
/* @__PURE__ */ w("span", {
|
|
197
197
|
"data-part": "list-weekday",
|
|
198
198
|
"data-part-list-weekday": "",
|
|
199
199
|
children: r.weekday
|
|
200
200
|
}),
|
|
201
201
|
" ",
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ w("span", {
|
|
203
203
|
"data-part": "list-date",
|
|
204
204
|
"data-part-list-date": "",
|
|
205
205
|
children: r.date
|
|
206
206
|
})
|
|
207
|
-
] })), /* @__PURE__ */
|
|
207
|
+
] })), /* @__PURE__ */ w("ul", {
|
|
208
208
|
"data-part": "list-events",
|
|
209
209
|
"data-part-list-events": "",
|
|
210
210
|
role: "list",
|
|
211
|
-
children: e.occurrences.map((t) => /* @__PURE__ */
|
|
211
|
+
children: e.occurrences.map((t) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ w(xt, {
|
|
212
212
|
date: e.date,
|
|
213
213
|
inGrid: !1,
|
|
214
214
|
layout: "list",
|
|
@@ -222,18 +222,18 @@ function xt({ days: e, empty: t, emptyText: n, occurrences: r }) {
|
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/event-calendar/event-calendar-month.tsx
|
|
225
|
-
function
|
|
226
|
-
if (e === null ||
|
|
225
|
+
function Ct(e, t, n) {
|
|
226
|
+
if (e === null || E(e.start) || !n) return !1;
|
|
227
227
|
let { start: r, end: i } = e;
|
|
228
|
-
return
|
|
228
|
+
return De(t, r) >= 0 && De(t, i) <= 0;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function wt(e, t, n) {
|
|
231
231
|
return new Intl.DateTimeFormat(e.locale, {
|
|
232
232
|
timeZone: "UTC",
|
|
233
233
|
weekday: n
|
|
234
234
|
}).format(new Date(Date.UTC(t.year, t.month - 1, t.day)));
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function A(e, t) {
|
|
237
237
|
return new Intl.DateTimeFormat(e.locale, {
|
|
238
238
|
timeZone: "UTC",
|
|
239
239
|
weekday: "long",
|
|
@@ -241,64 +241,64 @@ function j(e, t) {
|
|
|
241
241
|
day: "numeric"
|
|
242
242
|
}).format(new Date(Date.UTC(t.year, t.month - 1, t.day)));
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
let i =
|
|
246
|
-
return /* @__PURE__ */
|
|
244
|
+
function Tt({ anchorMonth: e, occurrences: t, titleId: n, weeks: r }) {
|
|
245
|
+
let i = k(), a = r[0] ?? [], o = i.pendingSelection ?? i.selection;
|
|
246
|
+
return /* @__PURE__ */ T("table", {
|
|
247
247
|
"aria-labelledby": n,
|
|
248
248
|
"data-part": "month",
|
|
249
249
|
"data-part-month": "",
|
|
250
250
|
role: "grid",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", {
|
|
252
252
|
"data-part": "weekdays",
|
|
253
253
|
"data-part-weekdays": "",
|
|
254
|
-
children: [i.weekNumbers ? /* @__PURE__ */
|
|
254
|
+
children: [i.weekNumbers ? /* @__PURE__ */ w("th", {
|
|
255
255
|
"data-part": "week-number-header",
|
|
256
256
|
"data-part-week-number-header": "",
|
|
257
257
|
scope: "col",
|
|
258
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ w("span", {
|
|
259
259
|
"data-ui": "visually-hidden",
|
|
260
260
|
"data-ui-visually-hidden": "",
|
|
261
261
|
children: i.t("weekNumber")
|
|
262
262
|
})
|
|
263
|
-
}) : null, a.map((e) => /* @__PURE__ */
|
|
264
|
-
abbr:
|
|
263
|
+
}) : null, a.map((e) => /* @__PURE__ */ w("th", {
|
|
264
|
+
abbr: wt(i, e, "long"),
|
|
265
265
|
"data-part": "weekday",
|
|
266
266
|
"data-part-weekday": "",
|
|
267
267
|
scope: "col",
|
|
268
|
-
children:
|
|
269
|
-
},
|
|
270
|
-
}) }), /* @__PURE__ */
|
|
271
|
-
let { segments: r } =
|
|
272
|
-
return /* @__PURE__ */
|
|
268
|
+
children: wt(i, e, "short")
|
|
269
|
+
}, O(e)))]
|
|
270
|
+
}) }), /* @__PURE__ */ w("tbody", { children: r.map((n) => {
|
|
271
|
+
let { segments: r } = Ke(t, n, {}), a = it(r, n.length, i.maxEvents), s = n[0];
|
|
272
|
+
return /* @__PURE__ */ T("tr", {
|
|
273
273
|
"data-part": "week",
|
|
274
274
|
"data-part-week": "",
|
|
275
275
|
style: { "--slotted-event-calendar-lanes": i.maxEvents },
|
|
276
|
-
children: [i.weekNumbers ? /* @__PURE__ */
|
|
276
|
+
children: [i.weekNumbers ? /* @__PURE__ */ w("th", {
|
|
277
277
|
"data-part": "week-number",
|
|
278
278
|
"data-part-week-number": "",
|
|
279
279
|
scope: "row",
|
|
280
|
-
children:
|
|
280
|
+
children: je(s)
|
|
281
281
|
}) : null, n.map((n, s) => {
|
|
282
|
-
let c =
|
|
283
|
-
return /* @__PURE__ */
|
|
282
|
+
let c = O(n), l = `${i.id}-day-${c}`, u = `${l}-count`, d = r.filter((e) => e.start === s && e.lane < i.maxEvents), f = r.filter((e) => e.start < s && e.start + e.span > s && e.lane < i.maxEvents), p = tt(t, n).length, m = Ct(o, n, !0), h = i.renderDayContent?.(n, { view: "month" }), g = a[s] ?? 0;
|
|
283
|
+
return /* @__PURE__ */ T("td", {
|
|
284
284
|
"aria-labelledby": `${l} ${u}`,
|
|
285
285
|
"aria-selected": i.selectionMode === "range" ? m : void 0,
|
|
286
286
|
"data-date": c,
|
|
287
|
-
"data-non-working":
|
|
287
|
+
"data-non-working": We(n, i.workingHours) ? void 0 : "",
|
|
288
288
|
"data-outside-month": n.month === e ? void 0 : "",
|
|
289
289
|
"data-part": "day",
|
|
290
290
|
"data-part-day": "",
|
|
291
291
|
"data-row": "day",
|
|
292
292
|
"data-selected": m ? "" : void 0,
|
|
293
|
-
"data-today": i.today !== null &&
|
|
293
|
+
"data-today": i.today !== null && D(n, i.today) ? "" : void 0,
|
|
294
294
|
role: "gridcell",
|
|
295
|
-
tabIndex:
|
|
296
|
-
children: [/* @__PURE__ */
|
|
295
|
+
tabIndex: D(n, i.date) ? 0 : -1,
|
|
296
|
+
children: [/* @__PURE__ */ T("div", {
|
|
297
297
|
"data-part": "day-header",
|
|
298
298
|
"data-part-day-header": "",
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
"aria-label":
|
|
300
|
+
/* @__PURE__ */ w("button", {
|
|
301
|
+
"aria-label": A(i, n),
|
|
302
302
|
"aria-haspopup": i.narrow ? "dialog" : void 0,
|
|
303
303
|
"data-part": "day-number",
|
|
304
304
|
"data-part-day-number": "",
|
|
@@ -308,25 +308,25 @@ function wt({ anchorMonth: e, occurrences: t, titleId: n, weeks: r }) {
|
|
|
308
308
|
type: "button",
|
|
309
309
|
children: n.day
|
|
310
310
|
}),
|
|
311
|
-
h == null ? null : /* @__PURE__ */
|
|
311
|
+
h == null ? null : /* @__PURE__ */ w("div", {
|
|
312
312
|
"data-part": "day-content",
|
|
313
313
|
"data-part-day-content": "",
|
|
314
314
|
children: h
|
|
315
315
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ w("span", {
|
|
317
317
|
"data-ui": "visually-hidden",
|
|
318
318
|
"data-ui-visually-hidden": "",
|
|
319
319
|
id: u,
|
|
320
320
|
children: i.t("events", { count: p })
|
|
321
321
|
})
|
|
322
322
|
]
|
|
323
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ T("div", {
|
|
324
324
|
"data-part": "day-events",
|
|
325
325
|
"data-part-day-events": "",
|
|
326
326
|
children: [
|
|
327
327
|
d.map((e) => {
|
|
328
|
-
let t = e.occurrence.allDay ||
|
|
329
|
-
return /* @__PURE__ */
|
|
328
|
+
let t = e.occurrence.allDay || Ue(e.occurrence);
|
|
329
|
+
return /* @__PURE__ */ w(xt, {
|
|
330
330
|
continuesAfter: e.continuesAfter,
|
|
331
331
|
continuesBefore: e.continuesBefore,
|
|
332
332
|
date: n,
|
|
@@ -339,12 +339,12 @@ function wt({ anchorMonth: e, occurrences: t, titleId: n, weeks: r }) {
|
|
|
339
339
|
}
|
|
340
340
|
}, e.occurrence.key);
|
|
341
341
|
}),
|
|
342
|
-
f.map((e) => /* @__PURE__ */
|
|
342
|
+
f.map((e) => /* @__PURE__ */ w("span", {
|
|
343
343
|
"data-part": "continuation",
|
|
344
344
|
"data-part-continuation": "",
|
|
345
345
|
children: i.t("titleContinues", { title: e.occurrence.event.title })
|
|
346
346
|
}, e.occurrence.key)),
|
|
347
|
-
g > 0 ? /* @__PURE__ */
|
|
347
|
+
g > 0 ? /* @__PURE__ */ T("button", {
|
|
348
348
|
"aria-expanded": i.moreDate === c,
|
|
349
349
|
"aria-haspopup": "dialog",
|
|
350
350
|
"aria-label": i.t("moreEvents", { count: g }),
|
|
@@ -353,29 +353,29 @@ function wt({ anchorMonth: e, occurrences: t, titleId: n, weeks: r }) {
|
|
|
353
353
|
onClick: (e) => i.openMore(n, e.currentTarget),
|
|
354
354
|
tabIndex: -1,
|
|
355
355
|
type: "button",
|
|
356
|
-
children: [`+${g}`, /* @__PURE__ */
|
|
356
|
+
children: [`+${g}`, /* @__PURE__ */ w("span", { children: i.t("more") })]
|
|
357
357
|
}) : null
|
|
358
358
|
]
|
|
359
359
|
})]
|
|
360
360
|
}, c);
|
|
361
361
|
})]
|
|
362
|
-
},
|
|
362
|
+
}, O(s));
|
|
363
363
|
}) })]
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
//#endregion
|
|
367
367
|
//#region src/event-calendar/event-calendar-time-grid.tsx
|
|
368
|
-
var
|
|
369
|
-
function
|
|
368
|
+
var Et = 64, Dt = 45, Ot = 20, kt = (e) => Pe(e.time) / 60;
|
|
369
|
+
function At(e, t) {
|
|
370
370
|
return {
|
|
371
371
|
direction: e.minutes > 0 ? "forward" : "back",
|
|
372
372
|
hours: Math.abs(e.minutes) / 60,
|
|
373
|
-
at:
|
|
373
|
+
at: Ve(e.at, t)
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
let i =
|
|
378
|
-
|
|
376
|
+
function jt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
377
|
+
let i = k(), [a, o] = i.dayHours, s = x(null), [c, l] = S(null);
|
|
378
|
+
be(() => {
|
|
379
379
|
let e = s.current?.querySelector("[data-part='column']");
|
|
380
380
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
381
381
|
let t = () => l(e.getBoundingClientRect().width || null);
|
|
@@ -383,13 +383,13 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
383
383
|
let n = new ResizeObserver(t);
|
|
384
384
|
return n.observe(e), () => n.disconnect();
|
|
385
385
|
}, [e.length]);
|
|
386
|
-
let u = c === null ? i.maxColumns : Math.max(1, Math.min(i.maxColumns, Math.floor(c /
|
|
386
|
+
let u = c === null ? i.maxColumns : Math.max(1, Math.min(i.maxColumns, Math.floor(c / Et))), d = b((e) => {
|
|
387
387
|
s.current = e, typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
388
|
-
}, [n]), { segments: f, lanes: p } =
|
|
388
|
+
}, [n]), { segments: f, lanes: p } = Ke(t, e, { allDayOnly: !0 }), m = i.pendingSelection ?? i.selection, h = {
|
|
389
389
|
locale: i.locale,
|
|
390
390
|
hourCycle: i.hourCycle
|
|
391
|
-
}, g = e[0], _ = (e) =>
|
|
392
|
-
return /* @__PURE__ */
|
|
391
|
+
}, g = e[0], _ = (e) => D(e, i.date), v = (e) => i.today !== null && D(e, i.today), ee = Array.from({ length: Math.max(0, o - a) }, (e, t) => a + t);
|
|
392
|
+
return /* @__PURE__ */ T("div", {
|
|
393
393
|
"aria-labelledby": r,
|
|
394
394
|
"data-part": "time-grid",
|
|
395
395
|
"data-part-time-grid": "",
|
|
@@ -398,23 +398,23 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
398
398
|
"--slotted-event-calendar-days": e.length,
|
|
399
399
|
"--slotted-event-calendar-slot": i.slotDuration
|
|
400
400
|
},
|
|
401
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ T("div", {
|
|
402
402
|
"data-part": "time-head",
|
|
403
403
|
"data-part-time-head": "",
|
|
404
404
|
role: "rowgroup",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ T("div", {
|
|
406
406
|
"data-part": "columns",
|
|
407
407
|
"data-part-columns": "",
|
|
408
408
|
role: "row",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ w("div", {
|
|
410
410
|
"data-part": "zone",
|
|
411
411
|
"data-part-zone": "",
|
|
412
412
|
role: "columnheader",
|
|
413
|
-
children:
|
|
413
|
+
children: pt(g, i.timeZone, i.locale)
|
|
414
414
|
}), e.map((e) => {
|
|
415
|
-
let t =
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
-
"data-date":
|
|
415
|
+
let t = rt(e, i.timeZone), n = i.renderDayContent?.(e, { view: i.view });
|
|
416
|
+
return /* @__PURE__ */ T("div", {
|
|
417
|
+
"data-date": O(e),
|
|
418
418
|
"data-offset-change": t === null ? void 0 : "",
|
|
419
419
|
"data-part": "column-header",
|
|
420
420
|
"data-part-column-header": "",
|
|
@@ -423,7 +423,7 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
423
423
|
role: "columnheader",
|
|
424
424
|
tabIndex: i.row === "header" && _(e) ? 0 : -1,
|
|
425
425
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ w("span", {
|
|
427
427
|
"aria-hidden": "true",
|
|
428
428
|
"data-part": "weekday",
|
|
429
429
|
"data-part-weekday": "",
|
|
@@ -432,8 +432,8 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
432
432
|
weekday: "short"
|
|
433
433
|
}).format(new Date(Date.UTC(e.year, e.month - 1, e.day)))
|
|
434
434
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
"aria-label":
|
|
435
|
+
/* @__PURE__ */ w("button", {
|
|
436
|
+
"aria-label": A(i, e),
|
|
437
437
|
"data-part": "day-number",
|
|
438
438
|
"data-part-day-number": "",
|
|
439
439
|
onClick: (t) => i.drill(e, t.detail === 0 ? "keyboard" : "pointer", t),
|
|
@@ -441,37 +441,37 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
441
441
|
type: "button",
|
|
442
442
|
children: e.day
|
|
443
443
|
}),
|
|
444
|
-
n == null ? null : /* @__PURE__ */
|
|
444
|
+
n == null ? null : /* @__PURE__ */ w("div", {
|
|
445
445
|
"data-part": "day-content",
|
|
446
446
|
"data-part-day-content": "",
|
|
447
447
|
children: n
|
|
448
448
|
}),
|
|
449
|
-
t === null ? null : /* @__PURE__ */
|
|
450
|
-
"aria-label": i.t("offsetChange",
|
|
449
|
+
t === null ? null : /* @__PURE__ */ w("span", {
|
|
450
|
+
"aria-label": i.t("offsetChange", At(t, h)),
|
|
451
451
|
"data-part": "offset-change",
|
|
452
452
|
"data-part-offset-change": "",
|
|
453
453
|
role: "note",
|
|
454
|
-
children: i.t("offsetChangeShort",
|
|
454
|
+
children: i.t("offsetChangeShort", At(t, h))
|
|
455
455
|
})
|
|
456
456
|
]
|
|
457
|
-
},
|
|
457
|
+
}, O(e));
|
|
458
458
|
})]
|
|
459
|
-
}), /* @__PURE__ */
|
|
459
|
+
}), /* @__PURE__ */ T("div", {
|
|
460
460
|
"data-part": "all-day-row",
|
|
461
461
|
"data-part-all-day-row": "",
|
|
462
462
|
role: "row",
|
|
463
463
|
style: { "--slotted-event-calendar-lanes": Math.max(1, p) },
|
|
464
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ w("div", {
|
|
465
465
|
"data-part": "all-day-label",
|
|
466
466
|
"data-part-all-day-label": "",
|
|
467
467
|
role: "rowheader",
|
|
468
468
|
children: i.t("allDay")
|
|
469
469
|
}), e.map((e, t) => {
|
|
470
|
-
let n = f.filter((e) => e.start === t), r = f.filter((e) => e.start < t && e.start + e.span > t), a =
|
|
471
|
-
return /* @__PURE__ */
|
|
470
|
+
let n = f.filter((e) => e.start === t), r = f.filter((e) => e.start < t && e.start + e.span > t), a = Ct(m, e, !0);
|
|
471
|
+
return /* @__PURE__ */ T("div", {
|
|
472
472
|
"aria-selected": i.selectionMode === "range" ? a : void 0,
|
|
473
|
-
"data-date":
|
|
474
|
-
"data-non-working":
|
|
473
|
+
"data-date": O(e),
|
|
474
|
+
"data-non-working": We(e, i.workingHours) ? void 0 : "",
|
|
475
475
|
"data-part": "all-day-cell",
|
|
476
476
|
"data-part-all-day-cell": "",
|
|
477
477
|
"data-row": "all-day",
|
|
@@ -479,7 +479,7 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
479
479
|
"data-today": v(e) ? "" : void 0,
|
|
480
480
|
role: "gridcell",
|
|
481
481
|
tabIndex: i.row === "all-day" && _(e) ? 0 : -1,
|
|
482
|
-
children: [n.map((t) => /* @__PURE__ */
|
|
482
|
+
children: [n.map((t) => /* @__PURE__ */ w(xt, {
|
|
483
483
|
continuesAfter: t.continuesAfter,
|
|
484
484
|
continuesBefore: t.continuesBefore,
|
|
485
485
|
date: e,
|
|
@@ -490,47 +490,47 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
490
490
|
"--slotted-event-lane": t.lane + 1,
|
|
491
491
|
"--slotted-event-span": t.span
|
|
492
492
|
}
|
|
493
|
-
}, t.occurrence.key)), r.map((e) => /* @__PURE__ */
|
|
493
|
+
}, t.occurrence.key)), r.map((e) => /* @__PURE__ */ w("span", {
|
|
494
494
|
"data-part": "continuation",
|
|
495
495
|
"data-part-continuation": "",
|
|
496
496
|
children: i.t("titleContinues", { title: e.occurrence.event.title })
|
|
497
497
|
}, e.occurrence.key))]
|
|
498
|
-
},
|
|
498
|
+
}, O(e));
|
|
499
499
|
})]
|
|
500
500
|
})]
|
|
501
|
-
}), /* @__PURE__ */
|
|
501
|
+
}), /* @__PURE__ */ w("div", {
|
|
502
502
|
"data-part": "scroller",
|
|
503
503
|
"data-part-scroller": "",
|
|
504
504
|
ref: d,
|
|
505
505
|
role: "rowgroup",
|
|
506
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ T("div", {
|
|
507
507
|
"data-part": "time-row",
|
|
508
508
|
"data-part-time-row": "",
|
|
509
509
|
role: "row",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ T("div", {
|
|
511
511
|
"data-part": "gutter",
|
|
512
512
|
"data-part-gutter": "",
|
|
513
513
|
role: "rowheader",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ w("span", {
|
|
515
515
|
"data-ui": "visually-hidden",
|
|
516
516
|
"data-ui-visually-hidden": "",
|
|
517
517
|
children: i.t("timed")
|
|
518
|
-
}), ee.map((e) => /* @__PURE__ */
|
|
518
|
+
}), ee.map((e) => /* @__PURE__ */ w("span", {
|
|
519
519
|
"aria-hidden": "true",
|
|
520
520
|
"data-part": "hour",
|
|
521
521
|
"data-part-hour": "",
|
|
522
|
-
children:
|
|
522
|
+
children: ze(e, h)
|
|
523
523
|
}, e))]
|
|
524
524
|
}), e.map((e) => {
|
|
525
|
-
let { items: n, more: r } =
|
|
525
|
+
let { items: n, more: r } = Ge(t, e, {
|
|
526
526
|
startHour: a,
|
|
527
527
|
endHour: o,
|
|
528
528
|
maxColumns: u,
|
|
529
|
-
minLength:
|
|
530
|
-
}), s =
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
"data-date":
|
|
533
|
-
"data-non-working":
|
|
529
|
+
minLength: Ot
|
|
530
|
+
}), s = rt(e, i.timeZone), c = i.now !== null && D(i.now.date, e) ? kt(i.now) : null, l = m !== null && E(m.start) && D(m.start.date, e) ? m : null;
|
|
531
|
+
return /* @__PURE__ */ T("div", {
|
|
532
|
+
"data-date": O(e),
|
|
533
|
+
"data-non-working": We(e, i.workingHours) ? void 0 : "",
|
|
534
534
|
"data-part": "column",
|
|
535
535
|
"data-part-column": "",
|
|
536
536
|
"data-row": "timed",
|
|
@@ -538,10 +538,10 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
538
538
|
role: "gridcell",
|
|
539
539
|
tabIndex: i.row === "timed" && _(e) ? 0 : -1,
|
|
540
540
|
children: [
|
|
541
|
-
|
|
541
|
+
nt(e, i.workingHours, {
|
|
542
542
|
startHour: a,
|
|
543
543
|
endHour: o
|
|
544
|
-
}).map((e) => /* @__PURE__ */
|
|
544
|
+
}).map((e) => /* @__PURE__ */ w("div", {
|
|
545
545
|
"aria-hidden": "true",
|
|
546
546
|
"data-part": "off-hours",
|
|
547
547
|
"data-part-off-hours": "",
|
|
@@ -550,23 +550,23 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
550
550
|
"--slotted-event-length": e.length
|
|
551
551
|
}
|
|
552
552
|
}, e.start)),
|
|
553
|
-
s === null ? null : /* @__PURE__ */
|
|
553
|
+
s === null ? null : /* @__PURE__ */ w("div", {
|
|
554
554
|
"aria-hidden": "true",
|
|
555
555
|
"data-part": "offset-line",
|
|
556
556
|
"data-part-offset-line": "",
|
|
557
557
|
style: { "--slotted-event-start": s.at.hour * 60 + s.at.minute - a * 60 }
|
|
558
558
|
}),
|
|
559
|
-
l === null ? null : /* @__PURE__ */
|
|
559
|
+
l === null ? null : /* @__PURE__ */ w("div", {
|
|
560
560
|
"aria-hidden": "true",
|
|
561
561
|
"data-part": "selection",
|
|
562
562
|
"data-part-selection": "",
|
|
563
563
|
style: {
|
|
564
|
-
"--slotted-event-start":
|
|
565
|
-
"--slotted-event-length": (
|
|
564
|
+
"--slotted-event-start": kt(l.start) - a * 60,
|
|
565
|
+
"--slotted-event-length": (D(l.end.date, e) ? kt(l.end) : 1440) - kt(l.start)
|
|
566
566
|
},
|
|
567
|
-
children:
|
|
567
|
+
children: He(l.start.time, l.end.time, h)
|
|
568
568
|
}),
|
|
569
|
-
n.map((t) => /* @__PURE__ */
|
|
569
|
+
n.map((t) => /* @__PURE__ */ w(xt, {
|
|
570
570
|
clippedEnd: t.clippedEnd,
|
|
571
571
|
clippedStart: t.clippedStart,
|
|
572
572
|
continuesAfter: t.continuesAfter,
|
|
@@ -575,7 +575,7 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
575
575
|
inGrid: !0,
|
|
576
576
|
layout: "block",
|
|
577
577
|
occurrence: t.occurrence,
|
|
578
|
-
short: t.length <
|
|
578
|
+
short: t.length < Dt,
|
|
579
579
|
style: {
|
|
580
580
|
"--slotted-event-start": t.start,
|
|
581
581
|
"--slotted-event-length": t.length,
|
|
@@ -583,10 +583,10 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
583
583
|
"--slotted-event-columns": t.columns,
|
|
584
584
|
"--slotted-event-span": t.span
|
|
585
585
|
},
|
|
586
|
-
withLocation: t.length >=
|
|
586
|
+
withLocation: t.length >= Dt
|
|
587
587
|
}, t.occurrence.key)),
|
|
588
|
-
r.map((t) => /* @__PURE__ */
|
|
589
|
-
"aria-expanded": i.moreDate ===
|
|
588
|
+
r.map((t) => /* @__PURE__ */ T("button", {
|
|
589
|
+
"aria-expanded": i.moreDate === O(e),
|
|
590
590
|
"aria-haspopup": "dialog",
|
|
591
591
|
"aria-label": i.t("moreEvents", { count: t.occurrences.length }),
|
|
592
592
|
"data-overlay": t.overlay ? "" : void 0,
|
|
@@ -602,16 +602,16 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
602
602
|
},
|
|
603
603
|
tabIndex: -1,
|
|
604
604
|
type: "button",
|
|
605
|
-
children: [`+${t.occurrences.length}`, /* @__PURE__ */
|
|
605
|
+
children: [`+${t.occurrences.length}`, /* @__PURE__ */ w("span", { children: i.t("more") })]
|
|
606
606
|
}, t.start)),
|
|
607
|
-
c === null || c < a * 60 || c > o * 60 ? null : /* @__PURE__ */
|
|
607
|
+
c === null || c < a * 60 || c > o * 60 ? null : /* @__PURE__ */ w("div", {
|
|
608
608
|
"aria-hidden": "true",
|
|
609
609
|
"data-part": "now",
|
|
610
610
|
"data-part-now": "",
|
|
611
611
|
style: { "--slotted-event-start": c - a * 60 }
|
|
612
612
|
})
|
|
613
613
|
]
|
|
614
|
-
},
|
|
614
|
+
}, O(e));
|
|
615
615
|
})]
|
|
616
616
|
})
|
|
617
617
|
})]
|
|
@@ -619,13 +619,13 @@ function kt({ days: e, occurrences: t, scrollerRef: n, titleId: r }) {
|
|
|
619
619
|
}
|
|
620
620
|
//#endregion
|
|
621
621
|
//#region src/event-calendar/event-calendar.tsx
|
|
622
|
-
var
|
|
622
|
+
var Mt = [
|
|
623
623
|
"month",
|
|
624
624
|
"week",
|
|
625
625
|
"day",
|
|
626
626
|
"list"
|
|
627
|
-
],
|
|
628
|
-
function
|
|
627
|
+
], Nt = "[data-part='day-number'], [data-part='event'], [data-part='more']", Pt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]);
|
|
628
|
+
function Ft(e, t, n, r) {
|
|
629
629
|
for (let i of e?.querySelectorAll(`[data-row='${t}'][data-date]`) ?? []) {
|
|
630
630
|
let e = i.getBoundingClientRect();
|
|
631
631
|
if (n >= e.left && n < e.right && (t !== "day" || r >= e.top && r < e.bottom)) {
|
|
@@ -639,17 +639,17 @@ function Nt(e, t, n, r) {
|
|
|
639
639
|
}
|
|
640
640
|
return null;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
return e === null || t === null ? e === t :
|
|
642
|
+
function It(e, t) {
|
|
643
|
+
return e === null || t === null ? e === t : E(e.start) === E(t.start) ? E(e.start) ? Oe(e.start, t.start) === 0 && Oe(e.end, t.end) === 0 : De(e.start, t.start) === 0 && De(e.end, t.end) === 0 : !1;
|
|
644
644
|
}
|
|
645
|
-
var
|
|
645
|
+
var Lt = (e, t) => De(e, t) <= 0 ? {
|
|
646
646
|
start: e,
|
|
647
647
|
end: t
|
|
648
648
|
} : {
|
|
649
649
|
start: t,
|
|
650
650
|
end: e
|
|
651
|
-
},
|
|
652
|
-
function
|
|
651
|
+
}, j = (e, t) => t >= 1440 ? Ne(Ee(e, 1), Fe(0)) : Ne(e, Fe(Math.max(0, t) * 60));
|
|
652
|
+
function M(e, t, n, r, i, a) {
|
|
653
653
|
if (n(e, t)) return !1;
|
|
654
654
|
let o = !1;
|
|
655
655
|
return a?.(t, {
|
|
@@ -665,200 +665,200 @@ function P(e, t, n, r, i, a) {
|
|
|
665
665
|
}
|
|
666
666
|
}), !o;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
return /* @__PURE__ */
|
|
668
|
+
function Rt({ when: e }) {
|
|
669
|
+
return /* @__PURE__ */ T(C, { children: [e.day === null ? null : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T("span", {
|
|
670
670
|
"data-part": "detail-day",
|
|
671
671
|
"data-part-detail-day": "",
|
|
672
672
|
children: [e.day, ","]
|
|
673
|
-
}), " "] }), /* @__PURE__ */
|
|
673
|
+
}), " "] }), /* @__PURE__ */ w("span", {
|
|
674
674
|
"data-part": "detail-range",
|
|
675
675
|
"data-part-detail-range": "",
|
|
676
676
|
children: e.range
|
|
677
677
|
})] });
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function zt({ handle: e }) {
|
|
680
680
|
return e.current = y(), null;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Bt({ element: e }) {
|
|
683
683
|
let t = ie();
|
|
684
|
-
return
|
|
684
|
+
return be(() => {
|
|
685
685
|
t.setAnchorNode(e);
|
|
686
686
|
}, [e, t.setAnchorNode]), null;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
let
|
|
690
|
-
firstDayOfWeek:
|
|
691
|
-
locale:
|
|
692
|
-
firstDayOfWeek:
|
|
688
|
+
function Vt({ actions: ie, calendars: y = [], className: me, compact: ge, date: Ee, dayHours: De, defaultDate: Oe, now: je, defaultOpenEvent: Ne, defaultSelection: Fe, defaultView: ze, defaultVisibleCalendars: Ve, editable: Ue = !1, empty: We, error: Ge, events: Ke, filter: qe, firstDayOfWeek: Je, fixedWeeks: Qe, header: nt = !0, hourCycle: rt, level: it = 2, listRange: pt, loading: k = !1, loadingDelay: ht, loadingMinDuration: gt, locale: vt, maxColumns: yt, maxEvents: bt, messages: Ct, onDateChange: wt, onEventChange: Et, canDrop: Dt, onOpenEventChange: Ot, onRangeChange: kt, onSelectionChange: At, onViewChange: Vt, onVisibleCalendarsChange: Ht, openEvent: Ut, ref: Wt, render: Gt, renderDayContent: Kt, renderEvent: qt, renderContextMenu: Jt, renderEventDetail: Yt, scrollTime: Xt, selection: Zt, selectionMode: Qt = "none", slotDuration: $t, style: en, timeZone: tn, view: nn, views: rn = Mt, visibleCalendars: an, weekends: on, weekNumbers: sn, workingHours: cn = [], ...ln }) {
|
|
689
|
+
let N = _t(), un = ve(), dn = `${un}-title`, fn = e(), P = t(Se, Ct), F = vt ?? fn, pn = tn ?? N.timeZone, mn = rt ?? N.hourCycle, hn = on ?? N.weekends, gn = De ?? N.dayHours, I = ct($t ?? N.slotDuration), _n = Xt ?? N.scrollTime, vn = Math.max(1, bt ?? N.maxEvents), yn = Math.max(2, yt ?? N.maxColumns), bn = ge ?? N.compact, xn = pt ?? N.listRange, Sn = {
|
|
690
|
+
firstDayOfWeek: xe(() => ke({
|
|
691
|
+
locale: F,
|
|
692
|
+
firstDayOfWeek: Je ?? N.firstDayOfWeek
|
|
693
693
|
}).firstDayOfWeek, [
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
694
|
+
N.firstDayOfWeek,
|
|
695
|
+
Je,
|
|
696
|
+
F
|
|
697
697
|
]),
|
|
698
|
-
weekends:
|
|
699
|
-
fixedWeeks:
|
|
700
|
-
listRange:
|
|
701
|
-
},
|
|
702
|
-
|
|
703
|
-
if (!
|
|
698
|
+
weekends: hn,
|
|
699
|
+
fixedWeeks: Qe ?? N.fixedWeeks,
|
|
700
|
+
listRange: xn
|
|
701
|
+
}, L = x(null), R = x(null), Cn = x(null), [wn, Tn] = S(null), En = je === void 0;
|
|
702
|
+
_e(() => {
|
|
703
|
+
if (!En) return;
|
|
704
704
|
let e, t = () => {
|
|
705
|
-
|
|
705
|
+
Tn(Me(pn)), e = setTimeout(t, 6e4 - Date.now() % 6e4);
|
|
706
706
|
};
|
|
707
707
|
return t(), () => clearTimeout(e);
|
|
708
|
-
}, [
|
|
709
|
-
let
|
|
710
|
-
let r =
|
|
711
|
-
return r &&
|
|
712
|
-
}, [
|
|
713
|
-
V,
|
|
714
|
-
Te,
|
|
715
|
-
Ct
|
|
716
|
-
]), zn = b((e, t, n) => {
|
|
717
|
-
let r = P(H, e, Object.is, t, n, zt);
|
|
718
|
-
return r && en === void 0 && An(e), r;
|
|
708
|
+
}, [pn, En]);
|
|
709
|
+
let Dn = je ?? wn, On = Dn?.date ?? null, [kn, An] = S(() => Oe ?? Ie(pn)), z = Ee ?? kn, [jn, Mn] = S(ze ?? rn[0] ?? "month"), B = nn ?? jn, Nn = xe(() => y.map((e) => e.key), [y]), [Pn, Fn] = S(Ve ?? null), V = an ?? Pn ?? Nn, [In, Ln] = S(Fe ?? null), H = Zt === void 0 ? In : Zt, [Rn, zn] = S(Ne ?? null), U = Ut === void 0 ? Rn : Ut, W = b((e, t, n) => {
|
|
710
|
+
let r = M(z, e, D, t, n, wt);
|
|
711
|
+
return r && Ee === void 0 && An(e), r;
|
|
719
712
|
}, [
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
713
|
+
z,
|
|
714
|
+
Ee,
|
|
715
|
+
wt
|
|
723
716
|
]), Bn = b((e, t, n) => {
|
|
724
|
-
let r =
|
|
725
|
-
return r && nn === void 0 &&
|
|
717
|
+
let r = M(B, e, Object.is, t, n, Vt);
|
|
718
|
+
return r && nn === void 0 && Mn(e), r;
|
|
726
719
|
}, [
|
|
727
|
-
|
|
728
|
-
|
|
720
|
+
B,
|
|
721
|
+
Vt,
|
|
729
722
|
nn
|
|
730
723
|
]), Vn = b((e, t, n) => {
|
|
731
|
-
let r =
|
|
732
|
-
return r &&
|
|
724
|
+
let r = M(V, e, Pt, t, n, Ht);
|
|
725
|
+
return r && an === void 0 && Fn(e), r;
|
|
733
726
|
}, [
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
727
|
+
Ht,
|
|
728
|
+
V,
|
|
729
|
+
an
|
|
737
730
|
]), Hn = b((e, t, n) => {
|
|
738
|
-
let r =
|
|
739
|
-
return r &&
|
|
731
|
+
let r = M(H, e, It, t, n, At);
|
|
732
|
+
return r && Zt === void 0 && Ln(e), r;
|
|
740
733
|
}, [
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
]),
|
|
745
|
-
|
|
746
|
-
|
|
734
|
+
H,
|
|
735
|
+
At,
|
|
736
|
+
Zt
|
|
737
|
+
]), Un = b((e, t, n) => {
|
|
738
|
+
let r = M(U, e, Object.is, t, n, Ot);
|
|
739
|
+
return r && Ut === void 0 && zn(e), r;
|
|
740
|
+
}, [
|
|
741
|
+
U,
|
|
742
|
+
Ot,
|
|
743
|
+
Ut
|
|
744
|
+
]), [Wn, Gn] = S(!1), Kn = x(null), qn = x(null), [Jn, Yn] = S(null);
|
|
745
|
+
_e(() => {
|
|
746
|
+
let e = L.current;
|
|
747
747
|
if (e === null) return;
|
|
748
|
-
let t =
|
|
749
|
-
at:
|
|
750
|
-
onChange:
|
|
748
|
+
let t = we(e, {
|
|
749
|
+
at: Ce,
|
|
750
|
+
onChange: Gn
|
|
751
751
|
});
|
|
752
|
-
return
|
|
752
|
+
return Gn(t.narrow()), () => t.destroy();
|
|
753
753
|
}, []);
|
|
754
|
-
let
|
|
755
|
-
...
|
|
756
|
-
listRange:
|
|
757
|
-
}) :
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
Ge,
|
|
754
|
+
let Xn = B === "list" || Wn && bn === "list" && (B === "month" || B === "week") ? "list" : "grid", G = Xn === "list" && B !== "list" ? ut("list", z, {
|
|
755
|
+
...Sn,
|
|
756
|
+
listRange: B === "month" ? "month" : "week"
|
|
757
|
+
}) : ut(B, z, Sn), Zn = O(G.start), Qn = O(G.end), $n = xe(() => new Intl.Collator(F), [F]), K = xe(() => et(Ke, G.start, G.end, { collator: $n }).filter((e) => (e.event.calendar === void 0 || !Nn.includes(e.event.calendar) || V.includes(e.event.calendar)) && (qe === void 0 || qe(e))), [
|
|
758
|
+
Nn,
|
|
759
|
+
$n,
|
|
761
760
|
Ke,
|
|
761
|
+
qe,
|
|
762
|
+
Qn,
|
|
762
763
|
Zn,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
e !== null && (rr.current = null, z.current?.querySelector(`[data-part='event'][data-key='${CSS.escape(e)}']`)?.focus());
|
|
764
|
+
V
|
|
765
|
+
]), er = b((e) => typeof Ue == "function" ? Ue(e) : Ue, [Ue]), [tr, nr] = S(null), rr = xe(() => tr === null ? K : ft(K, tr.key, tr.placement), [tr, K]), ir = x(null);
|
|
766
|
+
be(() => {
|
|
767
|
+
let e = ir.current;
|
|
768
|
+
e !== null && (ir.current = null, L.current?.querySelector(`[data-part='event'][data-key='${CSS.escape(e)}']`)?.focus());
|
|
769
769
|
});
|
|
770
|
-
let
|
|
770
|
+
let ar = b((e, t, n) => ({
|
|
771
771
|
key: e.key,
|
|
772
772
|
event: e.event,
|
|
773
773
|
occurrence: e.start.date,
|
|
774
774
|
recurring: e.recurring,
|
|
775
775
|
kind: n,
|
|
776
|
-
...
|
|
777
|
-
}), []),
|
|
778
|
-
let a = (t) =>
|
|
779
|
-
return o &&
|
|
776
|
+
...at(t)
|
|
777
|
+
}), []), or = b((e, t, n) => Dt === void 0 || Dt(ar(e, t, n)), [Dt, ar]), sr = b((e, t, n, r, i) => {
|
|
778
|
+
let a = (t) => ar(e, t, n), o = M(a(ot(e)), a(t), (e, t) => JSON.stringify([e.start, e.end]) === JSON.stringify([t.start, t.end]), r, i, Et);
|
|
779
|
+
return o && Te().announce(`${e.event.title}, ${Be({
|
|
780
780
|
...e,
|
|
781
781
|
start: t.start,
|
|
782
782
|
end: t.end
|
|
783
783
|
}, {
|
|
784
|
-
locale:
|
|
785
|
-
hourCycle:
|
|
784
|
+
locale: F,
|
|
785
|
+
hourCycle: mn
|
|
786
786
|
})}`), o;
|
|
787
787
|
}, [
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
]),
|
|
793
|
-
locale:
|
|
794
|
-
listRange:
|
|
795
|
-
}),
|
|
796
|
-
|
|
797
|
-
let e = `${
|
|
798
|
-
|
|
799
|
-
start:
|
|
800
|
-
end:
|
|
801
|
-
view:
|
|
788
|
+
ar,
|
|
789
|
+
Et,
|
|
790
|
+
mn,
|
|
791
|
+
F
|
|
792
|
+
]), cr = dt(B, G, z, {
|
|
793
|
+
locale: F,
|
|
794
|
+
listRange: B === "list" ? xn : void 0
|
|
795
|
+
}), lr = x(null);
|
|
796
|
+
_e(() => {
|
|
797
|
+
let e = `${Zn}/${Qn}/${B}`;
|
|
798
|
+
lr.current !== e && (lr.current = e, kt?.({
|
|
799
|
+
start: G.start,
|
|
800
|
+
end: G.end,
|
|
801
|
+
view: B
|
|
802
802
|
}));
|
|
803
803
|
}, [
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
B,
|
|
805
|
+
kt,
|
|
806
|
+
Qn,
|
|
807
|
+
Zn
|
|
808
808
|
]);
|
|
809
|
-
let [
|
|
810
|
-
|
|
811
|
-
let e =
|
|
812
|
-
e !== null && (
|
|
809
|
+
let [ur, dr] = S("timed"), q = x(null);
|
|
810
|
+
be(() => {
|
|
811
|
+
let e = q.current;
|
|
812
|
+
e !== null && (q.current = null, R.current?.querySelector(`[data-row='${e.row}'][data-date='${e.date}']`)?.focus());
|
|
813
813
|
});
|
|
814
|
-
let
|
|
815
|
-
t === null ?
|
|
816
|
-
}, []), [
|
|
817
|
-
let r = e.getBoundingClientRect(), i = (Q - Z) * 60, a = Z * 60 + (t - r.top) / Math.max(1, r.height) * i, o = Math[n](a /
|
|
814
|
+
let fr = x(/* @__PURE__ */ new Map()), pr = b((e, t) => {
|
|
815
|
+
t === null ? fr.current.delete(e) : fr.current.set(e, t);
|
|
816
|
+
}, []), [J, mr] = S(null), [hr, gr] = S(null), Y = xe(() => U === null ? null : K.find((e) => e.key === U) ?? null, [U, K]), _r = Yt !== void 0, [vr, X] = S(null), yr = x(null), [Z, Q] = gn, br = (e, t, n) => {
|
|
817
|
+
let r = e.getBoundingClientRect(), i = (Q - Z) * 60, a = Z * 60 + (t - r.top) / Math.max(1, r.height) * i, o = Math[n](a / I) * I;
|
|
818
818
|
return Math.min(Q * 60, Math.max(Z * 60, o));
|
|
819
819
|
}, xr = b((e) => {
|
|
820
820
|
let t = {
|
|
821
|
-
locale:
|
|
822
|
-
hourCycle:
|
|
821
|
+
locale: F,
|
|
822
|
+
hourCycle: mn
|
|
823
823
|
};
|
|
824
|
-
return
|
|
825
|
-
}, [
|
|
826
|
-
|
|
827
|
-
if (
|
|
824
|
+
return E(e.start) ? `${A({ locale: F }, e.start.date)}, ${He(e.start.time, e.end.time, t)}` : D(e.start, e.end) ? A({ locale: F }, e.start) : `${A({ locale: F }, e.start)} – ${A({ locale: F }, e.end)}`;
|
|
825
|
+
}, [mn, F]), Sr = b((e) => Te().announce(P("selected", { text: xr(e) })), [xr, P]);
|
|
826
|
+
_e(() => {
|
|
827
|
+
if (vr === null) return;
|
|
828
828
|
let e = (e) => {
|
|
829
829
|
let t = yr.current;
|
|
830
830
|
if (t === null) return;
|
|
831
831
|
if (t.kind === "hours") {
|
|
832
|
-
let n = br(t.column, e.clientY, "floor"), r = Math.min(t.anchor, n), i = Math.max(t.anchor, n) +
|
|
833
|
-
|
|
834
|
-
start:
|
|
835
|
-
end:
|
|
832
|
+
let n = br(t.column, e.clientY, "floor"), r = Math.min(t.anchor, n), i = Math.max(t.anchor, n) + I;
|
|
833
|
+
X({
|
|
834
|
+
start: j(t.date, r),
|
|
835
|
+
end: j(t.date, Math.min(i, Q * 60))
|
|
836
836
|
});
|
|
837
837
|
return;
|
|
838
838
|
}
|
|
839
|
-
let n =
|
|
840
|
-
n !== null &&
|
|
839
|
+
let n = Ft(L.current, "day", e.clientX, e.clientY) ?? Ft(L.current, "all-day", e.clientX, e.clientY);
|
|
840
|
+
n !== null && X(Lt(t.anchor, n));
|
|
841
841
|
}, t = (e) => {
|
|
842
|
-
let t =
|
|
843
|
-
yr.current = null,
|
|
842
|
+
let t = vr;
|
|
843
|
+
yr.current = null, X(null), t !== null && Hn(t, "pointer", e) && Sr(t);
|
|
844
844
|
}, n = (e) => {
|
|
845
|
-
e.key === "Escape" && (yr.current = null,
|
|
845
|
+
e.key === "Escape" && (yr.current = null, X(null));
|
|
846
846
|
};
|
|
847
847
|
return document.addEventListener("pointermove", e), document.addEventListener("pointerup", t), document.addEventListener("keydown", n, !0), () => {
|
|
848
848
|
document.removeEventListener("pointermove", e), document.removeEventListener("pointerup", t), document.removeEventListener("keydown", n, !0);
|
|
849
849
|
};
|
|
850
850
|
});
|
|
851
|
-
let Cr =
|
|
851
|
+
let Cr = x(null), wr = x(!1), Tr = (e) => {
|
|
852
852
|
let t = e.target, n = t.closest("[data-part='event'][data-editable]"), r = n?.closest("[data-row]"), i = n?.dataset.key, a = r?.dataset.date;
|
|
853
853
|
if (n == null || r == null) return !1;
|
|
854
|
-
let o =
|
|
854
|
+
let o = K.find((e) => e.key === i);
|
|
855
855
|
if (o === void 0 || a === void 0) return !1;
|
|
856
856
|
let s = r.dataset.row ?? "", [c, l, u] = a.split("-").map(Number);
|
|
857
857
|
Cr.current = {
|
|
858
858
|
occurrence: o,
|
|
859
859
|
kind: t.closest("[data-part='resize-handle']") ? "resize" : "move",
|
|
860
860
|
row: s,
|
|
861
|
-
date:
|
|
861
|
+
date: Ft(L.current, s, e.clientX, e.clientY) ?? {
|
|
862
862
|
year: c,
|
|
863
863
|
month: l,
|
|
864
864
|
day: u
|
|
@@ -867,31 +867,31 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
867
867
|
x: e.clientX,
|
|
868
868
|
y: e.clientY,
|
|
869
869
|
started: !1,
|
|
870
|
-
placement:
|
|
870
|
+
placement: ot(o),
|
|
871
871
|
invalid: !1
|
|
872
872
|
};
|
|
873
873
|
let d = () => Math.max(1, r.getBoundingClientRect().height / Math.max(1, Q - Z)), f = (e) => {
|
|
874
874
|
let t = Cr.current;
|
|
875
875
|
if (t === null || !t.started && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 4) return;
|
|
876
876
|
t.started = !0;
|
|
877
|
-
let n =
|
|
878
|
-
days: n === null ? 0 :
|
|
879
|
-
minutes: t.row === "timed" ? Math.round((e.clientY - t.y) / d() * (60 /
|
|
877
|
+
let n = Ft(L.current, t.row, e.clientX, e.clientY), r = {
|
|
878
|
+
days: n === null ? 0 : Ae(t.date, n),
|
|
879
|
+
minutes: t.row === "timed" ? Math.round((e.clientY - t.y) / d() * (60 / I)) * I : 0
|
|
880
880
|
};
|
|
881
|
-
t.placement = t.kind === "move" ?
|
|
881
|
+
t.placement = t.kind === "move" ? Xe(ot(t.occurrence), r) : st(ot(t.occurrence), r, I), t.invalid = !or(t.occurrence, t.placement, t.kind), nr({
|
|
882
882
|
key: t.occurrence.key,
|
|
883
883
|
placement: t.placement,
|
|
884
884
|
invalid: t.invalid
|
|
885
885
|
});
|
|
886
886
|
}, p = (e, t) => {
|
|
887
887
|
let n = Cr.current;
|
|
888
|
-
Cr.current = null, document.removeEventListener("pointermove", f), document.removeEventListener("pointerup", m), document.removeEventListener("keydown", h, !0),
|
|
888
|
+
Cr.current = null, document.removeEventListener("pointermove", f), document.removeEventListener("pointerup", m), document.removeEventListener("keydown", h, !0), nr(null), n !== null && n.started && (wr.current = !0, t && !n.invalid && sr(n.occurrence, n.placement, n.kind, "pointer", e));
|
|
889
889
|
}, m = (e) => p(e, !0), h = (e) => {
|
|
890
890
|
e.key === "Escape" && Cr.current?.started === !0 && (e.stopPropagation(), p(e, !1));
|
|
891
891
|
};
|
|
892
892
|
return document.addEventListener("pointermove", f), document.addEventListener("pointerup", m), document.addEventListener("keydown", h, !0), !0;
|
|
893
893
|
}, Er = (e) => {
|
|
894
|
-
if (e.button !== 0 || Tr(e) ||
|
|
894
|
+
if (e.button !== 0 || Tr(e) || Qt !== "range") return;
|
|
895
895
|
let t = e.target;
|
|
896
896
|
if (t.closest("button, a, input")) return;
|
|
897
897
|
let n = t.closest("[data-row]"), r = n?.dataset.date;
|
|
@@ -908,24 +908,24 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
908
908
|
date: s,
|
|
909
909
|
anchor: t,
|
|
910
910
|
column: n
|
|
911
|
-
},
|
|
912
|
-
start:
|
|
913
|
-
end:
|
|
911
|
+
}, X({
|
|
912
|
+
start: j(s, t),
|
|
913
|
+
end: j(s, Math.min(t + I, Q * 60))
|
|
914
914
|
});
|
|
915
915
|
} else if (n.dataset.row === "day" || n.dataset.row === "all-day") yr.current = {
|
|
916
916
|
kind: "days",
|
|
917
917
|
anchor: s
|
|
918
|
-
},
|
|
918
|
+
}, X({
|
|
919
919
|
start: s,
|
|
920
920
|
end: s
|
|
921
921
|
});
|
|
922
922
|
else return;
|
|
923
923
|
e.preventDefault();
|
|
924
|
-
}, [$, Dr] =
|
|
924
|
+
}, [$, Dr] = S(null), Or = x(null), kr = x(null), Ar = (e, t) => {
|
|
925
925
|
Or.current = null;
|
|
926
|
-
let n =
|
|
927
|
-
if (
|
|
928
|
-
let r = e.closest("[data-part='event'][data-key]"), i = r === null ? void 0 :
|
|
926
|
+
let n = R.current;
|
|
927
|
+
if (Jt === void 0 || !(e instanceof Element) || n === null || !n.contains(e)) return null;
|
|
928
|
+
let r = e.closest("[data-part='event'][data-key]"), i = r === null ? void 0 : K.find((e) => e.key === r.dataset.key), a;
|
|
929
929
|
if (r !== null && i !== void 0) a = {
|
|
930
930
|
target: {
|
|
931
931
|
kind: "event",
|
|
@@ -936,7 +936,7 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
936
936
|
else {
|
|
937
937
|
let r = e.closest("[data-date]"), i = r?.dataset.date;
|
|
938
938
|
if (r == null || i === void 0) return null;
|
|
939
|
-
let [o, s, c] = i.split("-").map(Number), l = r.dataset.row === "timed", u =
|
|
939
|
+
let [o, s, c] = i.split("-").map(Number), l = r.dataset.row === "timed", u = Re({
|
|
940
940
|
date: {
|
|
941
941
|
year: o,
|
|
942
942
|
month: s,
|
|
@@ -944,8 +944,8 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
944
944
|
},
|
|
945
945
|
minute: l && t !== null ? br(r, t, "floor") : null,
|
|
946
946
|
timed: l,
|
|
947
|
-
held:
|
|
948
|
-
slot:
|
|
947
|
+
held: vr ?? H,
|
|
948
|
+
slot: I,
|
|
949
949
|
endMinute: Q * 60
|
|
950
950
|
}), d = l && t === null ? r.querySelector("[data-part='selection']") ?? n.querySelector(`[data-part='column-header'][data-date='${i}']`) ?? r : r;
|
|
951
951
|
a = {
|
|
@@ -956,25 +956,25 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
956
956
|
element: d
|
|
957
957
|
};
|
|
958
958
|
}
|
|
959
|
-
let o =
|
|
959
|
+
let o = Jt(a.target);
|
|
960
960
|
return o == null || o === !1 ? null : (Or.current = a, a);
|
|
961
|
-
}, jr = $ === null ? void 0 : $.target.kind === "event" ? $.target.occurrence.event.title : xr($.target.slot), Mr =
|
|
962
|
-
if (
|
|
963
|
-
date:
|
|
961
|
+
}, jr = $ === null ? void 0 : $.target.kind === "event" ? $.target.occurrence.event.title : xr($.target.slot), Mr = x(null), Nr = (e, t, n) => {
|
|
962
|
+
if (q.current = {
|
|
963
|
+
date: O(e),
|
|
964
964
|
row: t
|
|
965
|
-
},
|
|
966
|
-
|
|
965
|
+
}, D(e, z)) {
|
|
966
|
+
R.current?.querySelector(`[data-row='${t}'][data-date='${O(e)}']`)?.focus(), q.current = null;
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
|
-
|
|
969
|
+
W(e, "keyboard", n);
|
|
970
970
|
}, Pr = (e) => {
|
|
971
971
|
let t = e.target, n = t.closest("[data-row]");
|
|
972
|
-
if (n === null || !
|
|
972
|
+
if (n === null || !R.current?.contains(n) || n.dataset.row === void 0) return;
|
|
973
973
|
let r = n.dataset.row;
|
|
974
974
|
if (t !== n) {
|
|
975
975
|
let i = t.closest("[data-part='event'][data-editable]");
|
|
976
976
|
if (i !== null && e.altKey && e.key.startsWith("Arrow")) {
|
|
977
|
-
let t =
|
|
977
|
+
let t = K.find((e) => e.key === i.dataset.key);
|
|
978
978
|
if (t === void 0) return;
|
|
979
979
|
e.preventDefault();
|
|
980
980
|
let a = getComputedStyle(n).direction === "rtl", o = e.key === "ArrowLeft" || e.key === "ArrowRight", s = (e.key === "ArrowRight" ? !a : e.key === "ArrowLeft" ? a : e.key === "ArrowDown") ? 1 : -1, c = o ? {
|
|
@@ -982,22 +982,22 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
982
982
|
minutes: 0
|
|
983
983
|
} : r === "timed" ? {
|
|
984
984
|
days: 0,
|
|
985
|
-
minutes: s *
|
|
985
|
+
minutes: s * I
|
|
986
986
|
} : {
|
|
987
987
|
days: r === "day" ? s * 7 : 0,
|
|
988
988
|
minutes: 0
|
|
989
989
|
};
|
|
990
990
|
if (c.days === 0 && c.minutes === 0) return;
|
|
991
|
-
let l = e.shiftKey ? "resize" : "move", u =
|
|
992
|
-
slot:
|
|
993
|
-
hours:
|
|
994
|
-
allowed: (e) =>
|
|
991
|
+
let l = e.shiftKey ? "resize" : "move", u = Ze(ot(t), c, l, {
|
|
992
|
+
slot: I,
|
|
993
|
+
hours: gn,
|
|
994
|
+
allowed: (e) => or(t, e, l)
|
|
995
995
|
});
|
|
996
996
|
if (u === null) {
|
|
997
|
-
|
|
997
|
+
Te().announce(P("dropInvalid", { title: t.event.title }));
|
|
998
998
|
return;
|
|
999
999
|
}
|
|
1000
|
-
|
|
1000
|
+
ir.current = t.key, sr(t, u, l, "keyboard", e);
|
|
1001
1001
|
return;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (e.key === "Escape" || e.key === "F2") {
|
|
@@ -1005,7 +1005,7 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
1007
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
1008
|
-
let r = [...n.querySelectorAll(
|
|
1008
|
+
let r = [...n.querySelectorAll(Nt)], i = r[r.indexOf(t.closest(Nt) ?? t) + (e.key === "ArrowDown" ? 1 : -1)];
|
|
1009
1009
|
e.preventDefault(), i?.focus();
|
|
1010
1010
|
}
|
|
1011
1011
|
return;
|
|
@@ -1020,15 +1020,15 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1020
1020
|
ArrowUp: a ? "up" : void 0,
|
|
1021
1021
|
ArrowDown: a ? "down" : void 0
|
|
1022
1022
|
};
|
|
1023
|
-
if (r === "timed" && e.shiftKey && (e.key === "ArrowDown" || e.key === "ArrowUp") &&
|
|
1023
|
+
if (r === "timed" && e.shiftKey && (e.key === "ArrowDown" || e.key === "ArrowUp") && Qt === "range") {
|
|
1024
1024
|
e.preventDefault();
|
|
1025
|
-
let t =
|
|
1026
|
-
if (t === null || !
|
|
1027
|
-
let n =
|
|
1025
|
+
let t = H;
|
|
1026
|
+
if (t === null || !E(t.start) || !D(t.start.date, z)) return;
|
|
1027
|
+
let n = Pe(t.start.time) / 60, r = t.end, i = D(r.date, z) ? Pe(r.time) / 60 : 1440, a = Math.min(Q * 60, Math.max(n + I, i + (e.key === "ArrowDown" ? 1 : -1) * I)), o = {
|
|
1028
1028
|
start: t.start,
|
|
1029
|
-
end:
|
|
1029
|
+
end: j(z, a)
|
|
1030
1030
|
};
|
|
1031
|
-
|
|
1031
|
+
Hn(o, "keyboard", e) && Sr(o);
|
|
1032
1032
|
return;
|
|
1033
1033
|
}
|
|
1034
1034
|
if (!a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
@@ -1039,8 +1039,8 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1039
1039
|
"timed"
|
|
1040
1040
|
], n = t[t.indexOf(r) + (e.key === "ArrowDown" ? 1 : -1)];
|
|
1041
1041
|
if (n === void 0) return;
|
|
1042
|
-
|
|
1043
|
-
date:
|
|
1042
|
+
dr(n), q.current = {
|
|
1043
|
+
date: O(z),
|
|
1044
1044
|
row: n
|
|
1045
1045
|
};
|
|
1046
1046
|
return;
|
|
@@ -1048,50 +1048,50 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1048
1048
|
let s = o[e.key];
|
|
1049
1049
|
if (s !== void 0) {
|
|
1050
1050
|
e.preventDefault();
|
|
1051
|
-
let t =
|
|
1052
|
-
if (e.shiftKey &&
|
|
1053
|
-
let n = Mr.current ??
|
|
1051
|
+
let t = Ye(B, z, s, Sn);
|
|
1052
|
+
if (e.shiftKey && Qt === "range" && e.key.startsWith("Arrow") && r !== "timed") {
|
|
1053
|
+
let n = Mr.current ?? z;
|
|
1054
1054
|
Mr.current = n;
|
|
1055
|
-
let r =
|
|
1056
|
-
|
|
1055
|
+
let r = Lt(n, t);
|
|
1056
|
+
Hn(r, "keyboard", e) && Sr(r);
|
|
1057
1057
|
} else e.shiftKey || (Mr.current = null);
|
|
1058
1058
|
Nr(t, r, e);
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
1061
|
if (e.key === "Enter" || e.key === "F2") {
|
|
1062
|
-
let t = n.querySelector(
|
|
1062
|
+
let t = n.querySelector(Nt);
|
|
1063
1063
|
if (t === null) return;
|
|
1064
1064
|
e.preventDefault(), t.focus();
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
|
-
if (e.key === " " &&
|
|
1068
|
-
e.preventDefault(), Mr.current =
|
|
1067
|
+
if (e.key === " " && Qt === "range") {
|
|
1068
|
+
e.preventDefault(), Mr.current = z;
|
|
1069
1069
|
let t = r === "timed" ? (() => {
|
|
1070
|
-
let e = Math.min(Math.max(
|
|
1070
|
+
let e = Math.min(Math.max(Pe(_n) / 60, Z * 60), Q * 60 - I);
|
|
1071
1071
|
return {
|
|
1072
|
-
start:
|
|
1073
|
-
end:
|
|
1072
|
+
start: j(z, e),
|
|
1073
|
+
end: j(z, e + I)
|
|
1074
1074
|
};
|
|
1075
1075
|
})() : {
|
|
1076
|
-
start:
|
|
1077
|
-
end:
|
|
1076
|
+
start: z,
|
|
1077
|
+
end: z
|
|
1078
1078
|
};
|
|
1079
|
-
|
|
1079
|
+
Hn(t, "keyboard", e) && Sr(t);
|
|
1080
1080
|
return;
|
|
1081
1081
|
}
|
|
1082
|
-
e.key === "Escape" &&
|
|
1082
|
+
e.key === "Escape" && H !== null && (e.preventDefault(), Hn(null, "escape", e));
|
|
1083
1083
|
}, Fr = b((e) => {
|
|
1084
|
-
let t =
|
|
1084
|
+
let t = Cn.current, n = t?.querySelector("[data-part='column']");
|
|
1085
1085
|
if (t == null || n == null) return;
|
|
1086
1086
|
let r = n.getBoundingClientRect().height / Math.max(1, Q - Z), i = t.querySelector("[data-part='hour']"), a = i === null ? 0 : parseFloat(getComputedStyle(i).lineHeight) / 2 || 0;
|
|
1087
|
-
t.scrollTop = Math.max(0, (
|
|
1087
|
+
t.scrollTop = Math.max(0, (Pe(e) / 3600 - Z) * r - a);
|
|
1088
1088
|
}, [Q, Z]);
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
}, [
|
|
1092
|
-
let Ir =
|
|
1093
|
-
|
|
1094
|
-
if (
|
|
1089
|
+
be(() => {
|
|
1090
|
+
Xn === "grid" && (B === "week" || B === "day") && Fr(_n);
|
|
1091
|
+
}, [B, Xn]);
|
|
1092
|
+
let Ir = ht ?? N.loadingDelay, Lr = gt ?? N.loadingMinDuration, [Rr, zr] = S(k);
|
|
1093
|
+
_e(() => {
|
|
1094
|
+
if (k) {
|
|
1095
1095
|
zr(!0);
|
|
1096
1096
|
return;
|
|
1097
1097
|
}
|
|
@@ -1100,175 +1100,175 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1100
1100
|
}, [
|
|
1101
1101
|
Ir,
|
|
1102
1102
|
Lr,
|
|
1103
|
-
|
|
1103
|
+
k
|
|
1104
1104
|
]);
|
|
1105
|
-
let Br =
|
|
1106
|
-
|
|
1107
|
-
if (!
|
|
1108
|
-
let e = setTimeout(() =>
|
|
1105
|
+
let Br = P("loading");
|
|
1106
|
+
_e(() => {
|
|
1107
|
+
if (!k) return;
|
|
1108
|
+
let e = setTimeout(() => Te().announce(Br), Ir);
|
|
1109
1109
|
return () => clearTimeout(e);
|
|
1110
1110
|
}, [
|
|
1111
1111
|
Ir,
|
|
1112
|
-
|
|
1112
|
+
k,
|
|
1113
1113
|
Br
|
|
1114
|
-
]),
|
|
1114
|
+
]), ye(Wt, () => ({
|
|
1115
1115
|
get element() {
|
|
1116
|
-
return
|
|
1116
|
+
return L.current;
|
|
1117
1117
|
},
|
|
1118
1118
|
focus() {
|
|
1119
|
-
(
|
|
1119
|
+
(R.current?.querySelector("[data-row][tabindex='0']") ?? R.current?.querySelector("[data-part='event']"))?.focus();
|
|
1120
1120
|
},
|
|
1121
1121
|
focusDate(e) {
|
|
1122
|
-
if (
|
|
1123
|
-
date:
|
|
1124
|
-
row:
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1122
|
+
if (q.current = {
|
|
1123
|
+
date: O(e),
|
|
1124
|
+
row: B === "month" ? "day" : ur
|
|
1125
|
+
}, D(e, z)) {
|
|
1126
|
+
R.current?.querySelector(`[data-row='${q.current.row}'][data-date='${O(e)}']`)?.focus(), q.current = null;
|
|
1127
1127
|
return;
|
|
1128
1128
|
}
|
|
1129
|
-
|
|
1129
|
+
W(e, "programmatic");
|
|
1130
1130
|
},
|
|
1131
1131
|
focusEvent(e) {
|
|
1132
|
-
let t =
|
|
1132
|
+
let t = fr.current.get(e);
|
|
1133
1133
|
return t === void 0 || !t.isConnected ? !1 : (t.focus(), !0);
|
|
1134
1134
|
},
|
|
1135
1135
|
scrollToTime: Fr
|
|
1136
1136
|
}), [
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1137
|
+
z,
|
|
1138
|
+
B,
|
|
1139
|
+
W,
|
|
1140
|
+
ur,
|
|
1141
1141
|
Fr
|
|
1142
1142
|
]);
|
|
1143
1143
|
let Vr = {
|
|
1144
|
-
id:
|
|
1145
|
-
t:
|
|
1146
|
-
locale:
|
|
1147
|
-
hourCycle:
|
|
1148
|
-
timeZone:
|
|
1149
|
-
view:
|
|
1150
|
-
date:
|
|
1151
|
-
today:
|
|
1152
|
-
now:
|
|
1144
|
+
id: un,
|
|
1145
|
+
t: P,
|
|
1146
|
+
locale: F,
|
|
1147
|
+
hourCycle: mn,
|
|
1148
|
+
timeZone: pn,
|
|
1149
|
+
view: B,
|
|
1150
|
+
date: z,
|
|
1151
|
+
today: On,
|
|
1152
|
+
now: Dn,
|
|
1153
1153
|
calendars: y,
|
|
1154
|
-
openKey:
|
|
1155
|
-
hostsDetail:
|
|
1156
|
-
selection:
|
|
1157
|
-
pendingSelection:
|
|
1158
|
-
selectionMode:
|
|
1159
|
-
narrow:
|
|
1160
|
-
weekNumbers:
|
|
1161
|
-
maxEvents:
|
|
1162
|
-
maxColumns:
|
|
1163
|
-
slotDuration:
|
|
1164
|
-
dayHours:
|
|
1165
|
-
workingHours:
|
|
1166
|
-
row:
|
|
1167
|
-
moreDate:
|
|
1168
|
-
headingLevel:
|
|
1169
|
-
renderEvent:
|
|
1170
|
-
canEdit:
|
|
1171
|
-
draggingKey:
|
|
1172
|
-
dropInvalid:
|
|
1154
|
+
openKey: U,
|
|
1155
|
+
hostsDetail: _r,
|
|
1156
|
+
selection: H,
|
|
1157
|
+
pendingSelection: vr ?? ($?.target.kind === "slot" ? $.target.slot : null),
|
|
1158
|
+
selectionMode: Qt,
|
|
1159
|
+
narrow: Wn,
|
|
1160
|
+
weekNumbers: sn ?? N.weekNumbers,
|
|
1161
|
+
maxEvents: vn,
|
|
1162
|
+
maxColumns: yn,
|
|
1163
|
+
slotDuration: I,
|
|
1164
|
+
dayHours: gn,
|
|
1165
|
+
workingHours: cn,
|
|
1166
|
+
row: B === "month" ? "timed" : ur,
|
|
1167
|
+
moreDate: J === null ? null : O(J.date),
|
|
1168
|
+
headingLevel: it,
|
|
1169
|
+
renderEvent: qt,
|
|
1170
|
+
canEdit: er,
|
|
1171
|
+
draggingKey: tr?.key ?? null,
|
|
1172
|
+
dropInvalid: tr?.invalid ?? !1,
|
|
1173
1173
|
contextKey: $?.target.kind === "event" ? $.target.occurrence.key : null,
|
|
1174
|
-
renderDayContent:
|
|
1174
|
+
renderDayContent: Kt,
|
|
1175
1175
|
activate(e, t, n, r) {
|
|
1176
|
-
|
|
1176
|
+
gr(t), mr(null), Un(U === e.key ? null : e.key, n, r);
|
|
1177
1177
|
},
|
|
1178
1178
|
drill(e, t, n) {
|
|
1179
|
-
if (
|
|
1179
|
+
if (Wn && B === "month" && Xn === "grid") {
|
|
1180
1180
|
let t = n.currentTarget;
|
|
1181
|
-
|
|
1181
|
+
mr((n) => n !== null && D(n.date, e) ? null : {
|
|
1182
1182
|
date: e,
|
|
1183
1183
|
element: t
|
|
1184
1184
|
});
|
|
1185
1185
|
return;
|
|
1186
1186
|
}
|
|
1187
|
-
|
|
1187
|
+
Bn("day", t, n), W(e, t, n);
|
|
1188
1188
|
},
|
|
1189
1189
|
openMore(e, t) {
|
|
1190
|
-
|
|
1190
|
+
mr((n) => n !== null && D(n.date, e) ? null : {
|
|
1191
1191
|
date: e,
|
|
1192
1192
|
element: t
|
|
1193
1193
|
});
|
|
1194
1194
|
},
|
|
1195
|
-
registerEvent:
|
|
1195
|
+
registerEvent: pr,
|
|
1196
1196
|
calendarLabel: (e) => y.find((t) => t.key === e)?.label,
|
|
1197
|
-
colorOf: (e) =>
|
|
1198
|
-
}, Hr = he(`h${
|
|
1197
|
+
colorOf: (e) => Le(e, y)
|
|
1198
|
+
}, Hr = he(`h${it}`, {
|
|
1199
1199
|
"aria-live": "polite",
|
|
1200
1200
|
"data-part": "title",
|
|
1201
1201
|
...fe("part", "title"),
|
|
1202
|
-
id:
|
|
1203
|
-
},
|
|
1202
|
+
id: dn
|
|
1203
|
+
}, cr), Ur = nt ? /* @__PURE__ */ T("div", {
|
|
1204
1204
|
"data-part": "header",
|
|
1205
1205
|
"data-part-header": "",
|
|
1206
1206
|
children: [
|
|
1207
1207
|
Hr,
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
"aria-label":
|
|
1208
|
+
/* @__PURE__ */ T("div", {
|
|
1209
|
+
"aria-label": P("navigation"),
|
|
1210
1210
|
"data-part": "navigation",
|
|
1211
1211
|
"data-part-navigation": "",
|
|
1212
1212
|
role: "group",
|
|
1213
1213
|
children: [
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
"aria-label":
|
|
1214
|
+
/* @__PURE__ */ w("button", {
|
|
1215
|
+
"aria-label": P(`previous.${B}`),
|
|
1216
1216
|
"data-part": "previous",
|
|
1217
1217
|
"data-part-previous": "",
|
|
1218
|
-
onClick: (e) =>
|
|
1218
|
+
onClick: (e) => W(lt(B, z, -1, Sn), e.detail === 0 ? "keyboard" : "pointer", e),
|
|
1219
1219
|
type: "button",
|
|
1220
|
-
children: /* @__PURE__ */
|
|
1220
|
+
children: /* @__PURE__ */ w(r, { children: /* @__PURE__ */ w(n, { name: "chevron-right" }) })
|
|
1221
1221
|
}),
|
|
1222
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ w("button", {
|
|
1223
1223
|
"data-part": "today",
|
|
1224
1224
|
"data-part-today": "",
|
|
1225
|
-
onClick: (e) =>
|
|
1225
|
+
onClick: (e) => W(On ?? Ie(pn), e.detail === 0 ? "keyboard" : "pointer", e),
|
|
1226
1226
|
type: "button",
|
|
1227
|
-
children:
|
|
1227
|
+
children: P("today")
|
|
1228
1228
|
}),
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
"aria-label":
|
|
1229
|
+
/* @__PURE__ */ w("button", {
|
|
1230
|
+
"aria-label": P(`next.${B}`),
|
|
1231
1231
|
"data-part": "next",
|
|
1232
1232
|
"data-part-next": "",
|
|
1233
|
-
onClick: (e) =>
|
|
1233
|
+
onClick: (e) => W(lt(B, z, 1, Sn), e.detail === 0 ? "keyboard" : "pointer", e),
|
|
1234
1234
|
type: "button",
|
|
1235
|
-
children: /* @__PURE__ */
|
|
1235
|
+
children: /* @__PURE__ */ w(r, { children: /* @__PURE__ */ w(n, { name: "chevron-right" }) })
|
|
1236
1236
|
})
|
|
1237
1237
|
]
|
|
1238
1238
|
}),
|
|
1239
|
-
|
|
1239
|
+
rn.length > 1 ? /* @__PURE__ */ w("div", {
|
|
1240
1240
|
"data-part": "views",
|
|
1241
1241
|
"data-part-views": "",
|
|
1242
|
-
children: /* @__PURE__ */
|
|
1243
|
-
"aria-label":
|
|
1242
|
+
children: /* @__PURE__ */ w(ue, {
|
|
1243
|
+
"aria-label": P("views"),
|
|
1244
1244
|
fullWidth: !0,
|
|
1245
|
-
onValueChange: (e, t) =>
|
|
1246
|
-
value:
|
|
1247
|
-
children:
|
|
1245
|
+
onValueChange: (e, t) => Bn(e, t.reason, t.source),
|
|
1246
|
+
value: B,
|
|
1247
|
+
children: rn.map((e) => /* @__PURE__ */ w(le, {
|
|
1248
1248
|
value: e,
|
|
1249
|
-
children:
|
|
1249
|
+
children: P(`view.${e}`)
|
|
1250
1250
|
}, e))
|
|
1251
1251
|
})
|
|
1252
1252
|
}) : null,
|
|
1253
|
-
y.length > 1 ? /* @__PURE__ */
|
|
1253
|
+
y.length > 1 ? /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(a, { render: (e) => /* @__PURE__ */ T("button", {
|
|
1254
1254
|
...pe(e, "part", "filter"),
|
|
1255
1255
|
type: "button",
|
|
1256
1256
|
children: [
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ w(r, { children: /* @__PURE__ */ w(n, { name: "funnel" }) }),
|
|
1258
|
+
/* @__PURE__ */ w("span", { children: P("calendars") }),
|
|
1259
|
+
/* @__PURE__ */ w(r, { children: /* @__PURE__ */ w(n, { name: "chevron-down" }) })
|
|
1260
1260
|
]
|
|
1261
|
-
}) }), /* @__PURE__ */
|
|
1262
|
-
let t =
|
|
1263
|
-
return /* @__PURE__ */
|
|
1264
|
-
checked:
|
|
1265
|
-
onCheckedChange: (t, n) =>
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1261
|
+
}) }), /* @__PURE__ */ w(s, { children: y.map((e) => {
|
|
1262
|
+
let t = Le(e.key, y);
|
|
1263
|
+
return /* @__PURE__ */ T(o, {
|
|
1264
|
+
checked: V.includes(e.key),
|
|
1265
|
+
onCheckedChange: (t, n) => Vn(t ? Nn.filter((t) => t === e.key || V.includes(t)) : V.filter((t) => t !== e.key), n.reason, n.source),
|
|
1266
|
+
children: [/* @__PURE__ */ w("svg", {
|
|
1267
1267
|
"aria-hidden": "true",
|
|
1268
1268
|
height: "10",
|
|
1269
1269
|
viewBox: "0 0 14 10",
|
|
1270
1270
|
width: "14",
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1271
|
+
children: /* @__PURE__ */ w("circle", {
|
|
1272
1272
|
cx: "5",
|
|
1273
1273
|
cy: "5",
|
|
1274
1274
|
r: "4",
|
|
@@ -1277,58 +1277,58 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1277
1277
|
}), e.label]
|
|
1278
1278
|
}, e.key);
|
|
1279
1279
|
}) })] }) : null,
|
|
1280
|
-
ie == null ? null : /* @__PURE__ */
|
|
1280
|
+
ie == null ? null : /* @__PURE__ */ w("div", {
|
|
1281
1281
|
"data-part": "actions",
|
|
1282
1282
|
"data-part-actions": "",
|
|
1283
1283
|
children: ie
|
|
1284
1284
|
})
|
|
1285
1285
|
]
|
|
1286
|
-
}) : null, Wr =
|
|
1287
|
-
/* @__PURE__ */
|
|
1286
|
+
}) : null, Wr = B === "month" ? "month" : B === "day" ? "day" : "week", Gr = /* @__PURE__ */ T(C, { children: [
|
|
1287
|
+
/* @__PURE__ */ w("div", {
|
|
1288
1288
|
"data-part": "loader",
|
|
1289
1289
|
"data-part-loader": "",
|
|
1290
|
-
children: Rr ? /* @__PURE__ */
|
|
1290
|
+
children: Rr ? /* @__PURE__ */ w(g, {
|
|
1291
1291
|
delay: Ir,
|
|
1292
1292
|
hideLabel: !0,
|
|
1293
|
-
label:
|
|
1294
|
-
loading:
|
|
1293
|
+
label: P("loading"),
|
|
1294
|
+
loading: k,
|
|
1295
1295
|
minDuration: Lr,
|
|
1296
1296
|
onWithdraw: () => zr(!1),
|
|
1297
1297
|
size: "sm"
|
|
1298
1298
|
}) : null
|
|
1299
1299
|
}),
|
|
1300
|
-
|
|
1300
|
+
Ge == null ? null : /* @__PURE__ */ w("div", {
|
|
1301
1301
|
"data-part": "error",
|
|
1302
1302
|
"data-part-error": "",
|
|
1303
|
-
children:
|
|
1303
|
+
children: Ge
|
|
1304
1304
|
}),
|
|
1305
|
-
|
|
1306
|
-
days:
|
|
1307
|
-
empty:
|
|
1308
|
-
emptyText:
|
|
1309
|
-
occurrences:
|
|
1310
|
-
}) :
|
|
1311
|
-
anchorMonth:
|
|
1312
|
-
occurrences:
|
|
1313
|
-
titleId:
|
|
1314
|
-
weeks:
|
|
1315
|
-
}) : /* @__PURE__ */
|
|
1316
|
-
days:
|
|
1317
|
-
occurrences:
|
|
1318
|
-
scrollerRef:
|
|
1319
|
-
titleId:
|
|
1305
|
+
Xn === "list" ? /* @__PURE__ */ w(St, {
|
|
1306
|
+
days: G.days,
|
|
1307
|
+
empty: We,
|
|
1308
|
+
emptyText: P(`empty.${Wr}`),
|
|
1309
|
+
occurrences: rr
|
|
1310
|
+
}) : B === "month" ? /* @__PURE__ */ w(Tt, {
|
|
1311
|
+
anchorMonth: z.month,
|
|
1312
|
+
occurrences: rr,
|
|
1313
|
+
titleId: dn,
|
|
1314
|
+
weeks: G.weeks
|
|
1315
|
+
}) : /* @__PURE__ */ w(jt, {
|
|
1316
|
+
days: G.days,
|
|
1317
|
+
occurrences: rr,
|
|
1318
|
+
scrollerRef: Cn,
|
|
1319
|
+
titleId: dn
|
|
1320
1320
|
})
|
|
1321
1321
|
] }), Kr = {
|
|
1322
|
-
"aria-busy":
|
|
1322
|
+
"aria-busy": k ? !0 : void 0,
|
|
1323
1323
|
"data-part": "body",
|
|
1324
1324
|
...fe("part", "body"),
|
|
1325
1325
|
onKeyDown: Pr,
|
|
1326
1326
|
onPointerDown: Er
|
|
1327
|
-
}, qr =
|
|
1327
|
+
}, qr = Jt === void 0 ? /* @__PURE__ */ w("div", {
|
|
1328
1328
|
...Kr,
|
|
1329
|
-
ref:
|
|
1329
|
+
ref: R,
|
|
1330
1330
|
children: Gr
|
|
1331
|
-
}) : /* @__PURE__ */
|
|
1331
|
+
}) : /* @__PURE__ */ T(ce, {
|
|
1332
1332
|
onOpenChange: (e, t) => {
|
|
1333
1333
|
if (!e) {
|
|
1334
1334
|
Dr(null);
|
|
@@ -1342,8 +1342,8 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1342
1342
|
Dr(n), t.reason === "keyboard" && kr.current?.setAnchor(n.element);
|
|
1343
1343
|
},
|
|
1344
1344
|
children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ w(zt, { handle: kr }),
|
|
1346
|
+
/* @__PURE__ */ w(se, { render: (e) => /* @__PURE__ */ w("div", {
|
|
1347
1347
|
...de({
|
|
1348
1348
|
...e,
|
|
1349
1349
|
...Kr
|
|
@@ -1361,100 +1361,100 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1361
1361
|
t.pointerType !== "mouse" && Ar(t.target, t.clientY), Er(t), e.onPointerDown?.(t);
|
|
1362
1362
|
},
|
|
1363
1363
|
ref: (t) => {
|
|
1364
|
-
|
|
1364
|
+
R.current = t, e.ref?.(t);
|
|
1365
1365
|
},
|
|
1366
1366
|
children: Gr
|
|
1367
1367
|
}) }),
|
|
1368
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ w(s, {
|
|
1369
1369
|
"aria-label": jr,
|
|
1370
|
-
children: $ === null ? null :
|
|
1370
|
+
children: $ === null ? null : Jt($.target)
|
|
1371
1371
|
})
|
|
1372
1372
|
]
|
|
1373
|
-
}), Jr =
|
|
1374
|
-
"aria-label":
|
|
1373
|
+
}), Jr = J === null ? [] : tt(K, J.date), Yr = J === null ? null : A(Vr, J.date), Xr = J === null ? null : /* @__PURE__ */ w("ul", {
|
|
1374
|
+
"aria-label": P("dayEvents", { day: Yr ?? "" }),
|
|
1375
1375
|
"data-layout": "stacked",
|
|
1376
1376
|
"data-part": "list-events",
|
|
1377
1377
|
"data-part-list-events": "",
|
|
1378
1378
|
role: "list",
|
|
1379
|
-
children: Jr.map((e) => /* @__PURE__ */
|
|
1380
|
-
date:
|
|
1379
|
+
children: Jr.map((e) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ w(xt, {
|
|
1380
|
+
date: J.date,
|
|
1381
1381
|
inGrid: !1,
|
|
1382
1382
|
layout: "list",
|
|
1383
1383
|
occurrence: e,
|
|
1384
1384
|
withLocation: !0
|
|
1385
1385
|
}) }, e.key))
|
|
1386
|
-
}), Zr = (
|
|
1387
|
-
hourCycle:
|
|
1388
|
-
locale:
|
|
1389
|
-
}) }), $r =
|
|
1390
|
-
|
|
1391
|
-
let ei =
|
|
1392
|
-
container:
|
|
1393
|
-
finalFocus:
|
|
1386
|
+
}), Zr = (U !== null && fr.current.get(U)?.isConnected ? fr.current.get(U) : hr) ?? null, Qr = Y === null ? null : /* @__PURE__ */ w(Rt, { when: $e(Y, {
|
|
1387
|
+
hourCycle: mn,
|
|
1388
|
+
locale: F
|
|
1389
|
+
}) }), $r = Y === null ? null : Yt?.(Y, { close: () => Un(null, "programmatic") });
|
|
1390
|
+
Kn.current = J?.element ?? null, qn.current = Zr;
|
|
1391
|
+
let ei = Wn ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(l, {
|
|
1392
|
+
container: Jn,
|
|
1393
|
+
finalFocus: Kn,
|
|
1394
1394
|
onOpenChange: (e) => {
|
|
1395
|
-
e ||
|
|
1395
|
+
e || mr(null);
|
|
1396
1396
|
},
|
|
1397
|
-
open:
|
|
1397
|
+
open: J !== null,
|
|
1398
1398
|
side: "bottom",
|
|
1399
|
-
children: /* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1399
|
+
children: /* @__PURE__ */ T(h, { children: [
|
|
1400
|
+
/* @__PURE__ */ w(c, {}),
|
|
1401
|
+
/* @__PURE__ */ T(p, { children: [/* @__PURE__ */ w(d, { children: Yr }), /* @__PURE__ */ w(m, {})] }),
|
|
1402
|
+
/* @__PURE__ */ w(f, { children: Xr })
|
|
1403
1403
|
] })
|
|
1404
|
-
}),
|
|
1405
|
-
container:
|
|
1406
|
-
finalFocus:
|
|
1404
|
+
}), _r ? /* @__PURE__ */ w(l, {
|
|
1405
|
+
container: Jn,
|
|
1406
|
+
finalFocus: qn,
|
|
1407
1407
|
onOpenChange: (e, t) => {
|
|
1408
|
-
e ||
|
|
1408
|
+
e || Un(null, t.reason, t.source);
|
|
1409
1409
|
},
|
|
1410
|
-
open:
|
|
1410
|
+
open: Y !== null,
|
|
1411
1411
|
side: "bottom",
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
1417
|
-
/* @__PURE__ */
|
|
1412
|
+
children: /* @__PURE__ */ T(h, { children: [
|
|
1413
|
+
/* @__PURE__ */ w(c, {}),
|
|
1414
|
+
/* @__PURE__ */ T(p, { children: [
|
|
1415
|
+
/* @__PURE__ */ w(d, { children: Y?.event.title }),
|
|
1416
|
+
/* @__PURE__ */ w(u, { children: Qr }),
|
|
1417
|
+
/* @__PURE__ */ w(m, {})
|
|
1418
1418
|
] }),
|
|
1419
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ w(f, { children: $r })
|
|
1420
1420
|
] })
|
|
1421
|
-
}) : null] }) : /* @__PURE__ */
|
|
1421
|
+
}) : null] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(ee, {
|
|
1422
1422
|
onOpenChange: (e) => {
|
|
1423
|
-
e ||
|
|
1423
|
+
e || mr(null);
|
|
1424
1424
|
},
|
|
1425
|
-
open:
|
|
1425
|
+
open: J !== null,
|
|
1426
1426
|
portal: !1,
|
|
1427
|
-
children: [/* @__PURE__ */
|
|
1428
|
-
}),
|
|
1429
|
-
finalFocus:
|
|
1427
|
+
children: [/* @__PURE__ */ w(Bt, { element: J?.element ?? null }), /* @__PURE__ */ w(ne, { children: /* @__PURE__ */ w(_, { children: J === null ? null : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(v, { children: [/* @__PURE__ */ w(oe, { children: Yr }), /* @__PURE__ */ w(te, {})] }), /* @__PURE__ */ w(ae, { children: Xr })] }) }) })]
|
|
1428
|
+
}), _r ? /* @__PURE__ */ T(ee, {
|
|
1429
|
+
finalFocus: hr ?? void 0,
|
|
1430
1430
|
onOpenChange: (e, t) => {
|
|
1431
|
-
e ||
|
|
1431
|
+
e || Un(null, t.reason, t.source);
|
|
1432
1432
|
},
|
|
1433
|
-
open:
|
|
1433
|
+
open: Y !== null,
|
|
1434
1434
|
portal: !1,
|
|
1435
1435
|
size: "lg",
|
|
1436
|
-
children: [/* @__PURE__ */
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
/* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
] }), /* @__PURE__ */
|
|
1436
|
+
children: [/* @__PURE__ */ w(Bt, { element: Zr }), /* @__PURE__ */ w(ne, { children: /* @__PURE__ */ w(_, { children: Y === null ? null : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(v, { children: [
|
|
1437
|
+
/* @__PURE__ */ w(oe, { children: Y.event.title }),
|
|
1438
|
+
/* @__PURE__ */ w(re, { children: Qr }),
|
|
1439
|
+
/* @__PURE__ */ w(te, {})
|
|
1440
|
+
] }), /* @__PURE__ */ w(ae, { children: $r })] }) }) })]
|
|
1441
1441
|
}) : null] }), ti = de({
|
|
1442
|
-
...
|
|
1442
|
+
...ln,
|
|
1443
1443
|
className: me,
|
|
1444
|
-
"data-layout":
|
|
1445
|
-
"data-loading":
|
|
1444
|
+
"data-layout": Xn,
|
|
1445
|
+
"data-loading": k ? "" : void 0,
|
|
1446
1446
|
"data-part": "root",
|
|
1447
|
-
"data-slot-duration": String(
|
|
1447
|
+
"data-slot-duration": String(I),
|
|
1448
1448
|
"data-ui": "event-calendar",
|
|
1449
|
-
"data-view":
|
|
1449
|
+
"data-view": B,
|
|
1450
1450
|
onClickCapture: (e) => {
|
|
1451
|
-
|
|
1451
|
+
ln.onClickCapture?.(e), wr.current && (wr.current = !1, e.preventDefault(), e.stopPropagation());
|
|
1452
1452
|
},
|
|
1453
1453
|
ref: (e) => {
|
|
1454
|
-
|
|
1454
|
+
L.current = e, e !== Jn && Yn(e);
|
|
1455
1455
|
},
|
|
1456
|
-
style:
|
|
1457
|
-
children: /* @__PURE__ */
|
|
1456
|
+
style: en,
|
|
1457
|
+
children: /* @__PURE__ */ T(mt.Provider, {
|
|
1458
1458
|
value: Vr,
|
|
1459
1459
|
children: [
|
|
1460
1460
|
Ur,
|
|
@@ -1463,7 +1463,7 @@ function zt({ actions: ie, calendars: y = [], className: me, compact: ge, date:
|
|
|
1463
1463
|
]
|
|
1464
1464
|
})
|
|
1465
1465
|
});
|
|
1466
|
-
return
|
|
1466
|
+
return Gt === void 0 ? /* @__PURE__ */ w("div", { ...ti }) : Gt(ti);
|
|
1467
1467
|
}
|
|
1468
1468
|
//#endregion
|
|
1469
|
-
export {
|
|
1469
|
+
export { _t as i, ht as n, vt as r, Vt as t };
|