@weekwise/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -9
- package/dist/Calendar.d.ts +4 -3
- package/dist/Calendar.js +20 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.module.css.js +11 -0
- package/dist/Calendar.module.css.js.map +1 -0
- package/dist/Calendar.types.d.ts +34 -6
- package/dist/CalendarBase.d.ts +8 -0
- package/dist/CalendarBase.js +161 -0
- package/dist/CalendarBase.js.map +1 -0
- package/dist/components/calendar-toolbar/CalendarToolbar.js +51 -0
- package/dist/components/calendar-toolbar/CalendarToolbar.js.map +1 -0
- package/dist/components/calendar-toolbar/CalendarToolbar.module.css.js +15 -0
- package/dist/components/calendar-toolbar/CalendarToolbar.module.css.js.map +1 -0
- package/dist/components/date-navigator/DateNavigator.js +129 -0
- package/dist/components/date-navigator/DateNavigator.js.map +1 -0
- package/dist/components/date-navigator/DateNavigator.module.css.js +25 -0
- package/dist/components/date-navigator/DateNavigator.module.css.js.map +1 -0
- package/dist/components/day-week-drawer/DayWeekDrawer.js +227 -0
- package/dist/components/day-week-drawer/DayWeekDrawer.js.map +1 -0
- package/dist/components/day-week-drawer/DayWeekDrawer.module.css.js +15 -0
- package/dist/components/day-week-drawer/DayWeekDrawer.module.css.js.map +1 -0
- package/dist/components/day-week-event/DayWeekEvent.js +154 -0
- package/dist/components/day-week-event/DayWeekEvent.js.map +1 -0
- package/dist/components/day-week-event/DayWeekEvent.module.css.js +17 -0
- package/dist/components/day-week-event/DayWeekEvent.module.css.js.map +1 -0
- package/dist/components/day-week-event/DayWeekEventPreview.js +26 -0
- package/dist/components/day-week-event/DayWeekEventPreview.js.map +1 -0
- package/dist/components/day-week-view/DayWeekView.js +226 -0
- package/dist/components/day-week-view/DayWeekView.js.map +1 -0
- package/dist/components/day-week-view/DayWeekView.module.css.js +27 -0
- package/dist/components/day-week-view/DayWeekView.module.css.js.map +1 -0
- package/dist/components/day-week-view/HiddenEvents.js +78 -0
- package/dist/components/day-week-view/HiddenEvents.js.map +1 -0
- package/dist/components/day-week-view/useTimeColumnWidth.js +34 -0
- package/dist/components/day-week-view/useTimeColumnWidth.js.map +1 -0
- package/dist/components/drag-overlay/DragOverlay.js +98 -0
- package/dist/components/drag-overlay/DragOverlay.js.map +1 -0
- package/dist/components/drag-overlay/DragOverlay.module.css.js +12 -0
- package/dist/components/drag-overlay/DragOverlay.module.css.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/month-view/MonthView.d.ts +8 -2
- package/dist/components/month-view/MonthView.js +105 -0
- package/dist/components/month-view/MonthView.js.map +1 -0
- package/dist/components/month-view/MonthView.module.css.js +30 -0
- package/dist/components/month-view/MonthView.module.css.js.map +1 -0
- package/dist/components/month-view/MonthView.utils.js +14 -0
- package/dist/components/month-view/MonthView.utils.js.map +1 -0
- package/dist/components/month-view/MonthViewDay.d.ts +2 -0
- package/dist/components/month-view/MonthViewDay.js +75 -0
- package/dist/components/month-view/MonthViewDay.js.map +1 -0
- package/dist/components/month-view/MonthViewEvent.js +132 -0
- package/dist/components/month-view/MonthViewEvent.js.map +1 -0
- package/dist/components/month-view/MonthViewEventPreview.js +28 -0
- package/dist/components/month-view/MonthViewEventPreview.js.map +1 -0
- package/dist/components/month-view/MonthViewWeek.d.ts +5 -0
- package/dist/components/month-view/MonthViewWeek.js +67 -0
- package/dist/components/month-view/MonthViewWeek.js.map +1 -0
- package/dist/components/month-view/useMonthLanes.js +22 -0
- package/dist/components/month-view/useMonthLanes.js.map +1 -0
- package/dist/components/month-view/useMonthResize.js +57 -0
- package/dist/components/month-view/useMonthResize.js.map +1 -0
- package/dist/components/nav-btn/NavBtn.js +28 -0
- package/dist/components/nav-btn/NavBtn.js.map +1 -0
- package/dist/components/nav-btn/NavBtn.module.css.js +11 -0
- package/dist/components/nav-btn/NavBtn.module.css.js.map +1 -0
- package/dist/components/pointer-popover/PointerPopover.js +22 -0
- package/dist/components/pointer-popover/PointerPopover.js.map +1 -0
- package/dist/components/pointer-popover/PointerPopover.module.css.js +6 -0
- package/dist/components/pointer-popover/PointerPopover.module.css.js.map +1 -0
- package/dist/components/timeline-view/TimelineView.d.ts +6 -0
- package/dist/components/timeline-view/TimelineView.js +10 -0
- package/dist/components/timeline-view/TimelineView.js.map +1 -0
- package/dist/components/timeline-view/index.d.ts +1 -0
- package/dist/components/view-select/ViewSelect.d.ts +1 -1
- package/dist/components/view-select/ViewSelect.js +117 -0
- package/dist/components/view-select/ViewSelect.js.map +1 -0
- package/dist/components/view-select/ViewSelect.module.css.js +14 -0
- package/dist/components/view-select/ViewSelect.module.css.js.map +1 -0
- package/dist/contexts/CalendarContext.js +14 -0
- package/dist/contexts/CalendarContext.js.map +1 -0
- package/dist/contexts/CalendarViewportContext.js +14 -0
- package/dist/contexts/CalendarViewportContext.js.map +1 -0
- package/dist/contexts/DayWeekDrawerContext.js +14 -0
- package/dist/contexts/DayWeekDrawerContext.js.map +1 -0
- package/dist/contexts/DayWeekViewContext.js +14 -0
- package/dist/contexts/DayWeekViewContext.js.map +1 -0
- package/dist/contexts/ThemeSourceContext.js +9 -0
- package/dist/contexts/ThemeSourceContext.js.map +1 -0
- package/dist/date-localization/DateLocalizationContext.js +9 -0
- package/dist/date-localization/DateLocalizationContext.js.map +1 -0
- package/dist/date-localization/DateLocalizationProvider.js +20 -0
- package/dist/date-localization/DateLocalizationProvider.js.map +1 -0
- package/dist/date-localization/MessagesContext.js +9 -0
- package/dist/date-localization/MessagesContext.js.map +1 -0
- package/dist/date-localization/useDateUtils.js +15 -0
- package/dist/date-localization/useDateUtils.js.map +1 -0
- package/dist/date-localization/useMessages.js +13 -0
- package/dist/date-localization/useMessages.js.map +1 -0
- package/dist/hooks/useAbsEventRect.js +27 -0
- package/dist/hooks/useAbsEventRect.js.map +1 -0
- package/dist/hooks/useAutoScroller.js +83 -0
- package/dist/hooks/useAutoScroller.js.map +1 -0
- package/dist/hooks/useCalendarSize.js +20 -0
- package/dist/hooks/useCalendarSize.js.map +1 -0
- package/dist/hooks/useCalendarValue.d.ts +1 -1
- package/dist/hooks/useCalendarValue.js +51 -0
- package/dist/hooks/useCalendarValue.js.map +1 -0
- package/dist/hooks/useCanResizeEvent.js +29 -0
- package/dist/hooks/useCanResizeEvent.js.map +1 -0
- package/dist/hooks/useComputed.js +14 -0
- package/dist/hooks/useComputed.js.map +1 -0
- package/dist/hooks/useControlled.js +20 -0
- package/dist/hooks/useControlled.js.map +1 -0
- package/dist/hooks/useControlled.utils.js +33 -0
- package/dist/hooks/useControlled.utils.js.map +1 -0
- package/dist/hooks/useCurrentRef.js +10 -0
- package/dist/hooks/useCurrentRef.js.map +1 -0
- package/dist/hooks/useDocumentCursor.js +13 -0
- package/dist/hooks/useDocumentCursor.js.map +1 -0
- package/dist/hooks/useEventCallback.js +12 -0
- package/dist/hooks/useEventCallback.js.map +1 -0
- package/dist/hooks/useEventCallback.utils.js +20 -0
- package/dist/hooks/useEventCallback.utils.js.map +1 -0
- package/dist/hooks/useEventResize.js +106 -0
- package/dist/hooks/useEventResize.js.map +1 -0
- package/dist/hooks/useGlobalListeners.js +40 -0
- package/dist/hooks/useGlobalListeners.js.map +1 -0
- package/dist/hooks/useInterval.js +14 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/hooks/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/hooks/useItemsLayout.js +53 -0
- package/dist/hooks/useItemsLayout.js.map +1 -0
- package/dist/hooks/useMergedRefs.js +10 -0
- package/dist/hooks/useMergedRefs.js.map +1 -0
- package/dist/hooks/useMove.js +180 -0
- package/dist/hooks/useMove.js.map +1 -0
- package/dist/hooks/useMoveTransform.js +118 -0
- package/dist/hooks/useMoveTransform.js.map +1 -0
- package/dist/hooks/useMutationObserver.js +16 -0
- package/dist/hooks/useMutationObserver.js.map +1 -0
- package/dist/hooks/useNavigation.js +15 -0
- package/dist/hooks/useNavigation.js.map +1 -0
- package/dist/hooks/usePrevious.js +12 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useRect.js +37 -0
- package/dist/hooks/useRect.js.map +1 -0
- package/dist/hooks/useRefList.js +21 -0
- package/dist/hooks/useRefList.js.map +1 -0
- package/dist/hooks/useRefWithInit.js +11 -0
- package/dist/hooks/useRefWithInit.js.map +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/hooks/useResizeObserver.js.map +1 -0
- package/dist/hooks/useScrollBarSize.js +37 -0
- package/dist/hooks/useScrollBarSize.js.map +1 -0
- package/dist/hooks/useScrollIntent.js +41 -0
- package/dist/hooks/useScrollIntent.js.map +1 -0
- package/dist/hooks/useScrollOffsets.js +33 -0
- package/dist/hooks/useScrollOffsets.js.map +1 -0
- package/dist/hooks/useScrollOffsetsDelta.js +16 -0
- package/dist/hooks/useScrollOffsetsDelta.js.map +1 -0
- package/dist/hooks/useScrollableAncestors.js +14 -0
- package/dist/hooks/useScrollableAncestors.js.map +1 -0
- package/dist/hooks/useScrollableAncestorsRects.js +32 -0
- package/dist/hooks/useScrollableAncestorsRects.js.map +1 -0
- package/dist/hooks/useStateRef.js +16 -0
- package/dist/hooks/useStateRef.js.map +1 -0
- package/dist/hooks/useTimeInterval.js +25 -0
- package/dist/hooks/useTimeInterval.js.map +1 -0
- package/dist/hooks/useTimeOffset.js +24 -0
- package/dist/hooks/useTimeOffset.js.map +1 -0
- package/dist/hooks/useToday.js +26 -0
- package/dist/hooks/useToday.js.map +1 -0
- package/dist/icons/chevron.js +20 -0
- package/dist/icons/chevron.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -2798
- package/dist/portal/Portal.js +31 -0
- package/dist/portal/Portal.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/utils/mergeRefs.js +15 -0
- package/dist/utils/mergeRefs.js.map +1 -0
- package/dist/views/dayView.d.ts +4 -0
- package/dist/views/dayView.js +13 -0
- package/dist/views/dayView.js.map +1 -0
- package/dist/views/index.d.ts +4 -0
- package/dist/views/monthView.d.ts +9 -0
- package/dist/views/monthView.js +20 -0
- package/dist/views/monthView.js.map +1 -0
- package/dist/views/types.d.ts +30 -0
- package/dist/views/weekView.d.ts +4 -0
- package/dist/views/weekView.js +13 -0
- package/dist/views/weekView.js.map +1 -0
- package/package.json +7 -7
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2799 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let e = r(He);
|
|
15
|
-
if (!e) throw Error("DateLocalizationContext is required");
|
|
16
|
-
return e;
|
|
17
|
-
}
|
|
18
|
-
function K() {
|
|
19
|
-
return Ue();
|
|
20
|
-
}
|
|
21
|
-
// src/date-localization/MessagesContext.ts
|
|
22
|
-
var We = e(void 0);
|
|
23
|
-
U && (We.displayName = "MessagesContext");
|
|
24
|
-
// src/date-localization/DateLocalizationProvider.tsx
|
|
25
|
-
function Ge(e) {
|
|
26
|
-
let { adapter: t, messages: n, children: r } = e, i = c(() => typeof t == "function" ? new t() : t, [t]), a = c(() => Te(i.locale, n), [i.locale, n]);
|
|
27
|
-
return /* @__PURE__ */ W(He.Provider, {
|
|
28
|
-
value: i,
|
|
29
|
-
children: /* @__PURE__ */ W(We.Provider, {
|
|
30
|
-
value: a,
|
|
31
|
-
children: r
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
// src/date-localization/useMessages.ts
|
|
36
|
-
function Ke() {
|
|
37
|
-
let e = r(We), t = Ue();
|
|
38
|
-
return e ?? Te(t.locale);
|
|
39
|
-
}
|
|
40
|
-
var qe = typeof window < "u" ? s : i;
|
|
41
|
-
// src/hooks/useResizeObserver.ts
|
|
42
|
-
function Je(e, t = !1) {
|
|
43
|
-
let n = u(e);
|
|
44
|
-
n.current = e;
|
|
45
|
-
let r = c(() => {
|
|
46
|
-
if (t || typeof window > "u" || window.ResizeObserver === void 0) return;
|
|
47
|
-
let { current: e } = n, { ResizeObserver: r } = window;
|
|
48
|
-
return new r(e);
|
|
49
|
-
}, [t]);
|
|
50
|
-
return i(() => () => r?.disconnect(), [r]), r;
|
|
51
|
-
}
|
|
52
|
-
// src/hooks/useCalendarSize.ts
|
|
53
|
-
function Ye(e) {
|
|
54
|
-
let [t, n] = d("regular"), r = Je(([e]) => {
|
|
55
|
-
if (!e) return;
|
|
56
|
-
let t = e.borderBoxSize?.[0]?.inlineSize ?? e.contentRect.width;
|
|
57
|
-
n(P(t));
|
|
58
|
-
});
|
|
59
|
-
return qe(() => {
|
|
60
|
-
let t = e.current;
|
|
61
|
-
if (t) return n(P(t.getBoundingClientRect().width)), r?.observe(t), () => r?.unobserve(t);
|
|
62
|
-
}, [r, e]), t;
|
|
63
|
-
}
|
|
64
|
-
// src/hooks/useCurrentRef.ts
|
|
65
|
-
function Xe(e) {
|
|
66
|
-
let t = u(e);
|
|
67
|
-
return t.current = e, t;
|
|
68
|
-
}
|
|
69
|
-
// src/hooks/useComputed.ts
|
|
70
|
-
function Ze(e, t) {
|
|
71
|
-
let n = u(void 0), r = Xe(e);
|
|
72
|
-
return c(() => {
|
|
73
|
-
let e = r.current(n.current);
|
|
74
|
-
return n.current = e, e;
|
|
75
|
-
}, t);
|
|
76
|
-
}
|
|
77
|
-
// src/hooks/useControlled.utils.ts
|
|
78
|
-
function Qe(e) {
|
|
79
|
-
let [t] = d(() => e !== void 0);
|
|
80
|
-
return t;
|
|
81
|
-
}
|
|
82
|
-
function $e(e, t, n, r) {
|
|
83
|
-
let a = u(/* @__PURE__ */ Error());
|
|
84
|
-
i(() => {
|
|
85
|
-
if (e !== (t !== void 0)) throw Error(`
|
|
86
|
-
[useControlled]:
|
|
87
|
-
A component is changing ${e ? "a controlled value to be uncontrolled" : "an uncontrolled value to be controlled"}. This is likely caused by the value changing from ${e ? "defined to an undefined" : "undefined to a defined"} value, which should not happen.
|
|
88
|
-
Decide between using a controlled or uncontrolled input element for the lifetime of the component.
|
|
89
|
-
More info: https://reactjs.org/link/controlled-components
|
|
90
|
-
${a.current.stack}
|
|
91
|
-
`);
|
|
92
|
-
}, [e, t]), i(() => {
|
|
93
|
-
if (!e && n !== r) throw Error(`
|
|
94
|
-
[useControlled]:
|
|
95
|
-
A component is changing the default state of an uncontrolled value after being initialized.
|
|
96
|
-
To suppress this warning opt to use a controlled value.
|
|
97
|
-
More info: https://reactjs.org/link/controlled-components
|
|
98
|
-
${a.current.stack}`);
|
|
99
|
-
}, [
|
|
100
|
-
r,
|
|
101
|
-
n,
|
|
102
|
-
e
|
|
103
|
-
]);
|
|
104
|
-
}
|
|
105
|
-
// src/hooks/useControlled.ts
|
|
106
|
-
function et(e) {
|
|
107
|
-
let { controlled: t, default: r } = e, [i, a] = d(() => r === void 0 && "initialState" in e && e.initialState !== void 0 ? e.initialState : r), [o] = d(r), s = Qe(t);
|
|
108
|
-
U && $e(s, t, o, r);
|
|
109
|
-
let c = n((e) => {
|
|
110
|
-
s || a(e);
|
|
111
|
-
}, [s]);
|
|
112
|
-
return [
|
|
113
|
-
s ? t : i,
|
|
114
|
-
c,
|
|
115
|
-
s
|
|
116
|
-
];
|
|
117
|
-
}
|
|
118
|
-
// src/hooks/useDocumentCursor.ts
|
|
119
|
-
function tt(e) {
|
|
120
|
-
i(() => {
|
|
121
|
-
if (!e) return;
|
|
122
|
-
let t = `ww-cursor-${e}`, n = document.documentElement;
|
|
123
|
-
return n.classList.add(t), () => n.classList.remove(t);
|
|
124
|
-
}, [e]);
|
|
125
|
-
}
|
|
126
|
-
// src/hooks/useRefWithInit.ts
|
|
127
|
-
var nt = {};
|
|
128
|
-
function rt(e, t) {
|
|
129
|
-
let n = u(nt);
|
|
130
|
-
return n.current === nt && (n.current = e(t)), n;
|
|
131
|
-
}
|
|
132
|
-
// src/hooks/useEventCallback.utils.ts
|
|
133
|
-
function it() {
|
|
134
|
-
if (U) throw Error("useEventCallback: Cannot call an event handler while rendering.");
|
|
135
|
-
}
|
|
136
|
-
function at() {
|
|
137
|
-
let e = {
|
|
138
|
-
next: void 0,
|
|
139
|
-
callback: it,
|
|
140
|
-
trampoline: (...t) => e.callback?.(...t),
|
|
141
|
-
effect: () => {
|
|
142
|
-
e.callback = e.next;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
return e;
|
|
146
|
-
}
|
|
147
|
-
// src/hooks/useEventCallback.ts
|
|
148
|
-
function q(e) {
|
|
149
|
-
let t = rt(at).current;
|
|
150
|
-
return t.next = e, o(t.effect), t.trampoline;
|
|
151
|
-
}
|
|
152
|
-
// src/hooks/useGlobalListeners.ts
|
|
153
|
-
function ot() {
|
|
154
|
-
let [e] = d(() => ({ current: /* @__PURE__ */ new Map() })), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r } = c(() => {
|
|
155
|
-
function t(t, n, r, i) {
|
|
156
|
-
let a = typeof i != "boolean" && i?.once ? (n) => {
|
|
157
|
-
e.current.delete(r), t instanceof Document ? r.call(t, n) : r(n);
|
|
158
|
-
} : r;
|
|
159
|
-
t.addEventListener(n, r, i), e.current.set(r, {
|
|
160
|
-
type: n,
|
|
161
|
-
target: t,
|
|
162
|
-
fn: a,
|
|
163
|
-
options: i
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function n(t, n, r, i) {
|
|
167
|
-
let a = e.current.get(r)?.fn || r;
|
|
168
|
-
t.removeEventListener(n, a, i), e.current.delete(r);
|
|
169
|
-
}
|
|
170
|
-
function r() {
|
|
171
|
-
e.current.forEach(({ target: e, type: t, options: r }, i) => {
|
|
172
|
-
n(e, t, i, r);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
addGlobalListener: t,
|
|
177
|
-
removeGlobalListener: n,
|
|
178
|
-
removeAllGlobalListeners: r
|
|
179
|
-
};
|
|
180
|
-
}, [e]);
|
|
181
|
-
return i(() => r, [r]), {
|
|
182
|
-
addGlobalListener: t,
|
|
183
|
-
removeGlobalListener: n,
|
|
184
|
-
removeAllGlobalListeners: r
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
// src/hooks/useItemsLayout.ts
|
|
188
|
-
function st(e, t) {
|
|
189
|
-
let n = rt(ct, {
|
|
190
|
-
containerRef: e,
|
|
191
|
-
itemsRef: t
|
|
192
|
-
}).current;
|
|
193
|
-
return i(() => n.release, [n]), n;
|
|
194
|
-
}
|
|
195
|
-
function ct({ containerRef: e, itemsRef: t }) {
|
|
196
|
-
let n = null, r = [], i = null;
|
|
197
|
-
function a() {
|
|
198
|
-
let i = e.current;
|
|
199
|
-
if (!i) return !1;
|
|
200
|
-
let a = new h(F(i), i);
|
|
201
|
-
return n = a, r = t.current.map((e) => {
|
|
202
|
-
if (!e) return null;
|
|
203
|
-
let { left: t, top: n, right: r, bottom: i } = e.getBoundingClientRect();
|
|
204
|
-
return {
|
|
205
|
-
left: t - a.left,
|
|
206
|
-
top: n - a.top,
|
|
207
|
-
right: r - a.left,
|
|
208
|
-
bottom: i - a.top
|
|
209
|
-
};
|
|
210
|
-
}), !0;
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
measure() {
|
|
214
|
-
return a() ? (typeof ResizeObserver < "u" && e.current && (i ??= new ResizeObserver(() => {
|
|
215
|
-
n && a();
|
|
216
|
-
}), i.observe(e.current)), !0) : !1;
|
|
217
|
-
},
|
|
218
|
-
release() {
|
|
219
|
-
i?.disconnect(), n = null, r = [];
|
|
220
|
-
},
|
|
221
|
-
container: () => n,
|
|
222
|
-
nearestIndex(e, t, i = "xy") {
|
|
223
|
-
if (!n) return -1;
|
|
224
|
-
let a = e - n.left, o = t - n.top, s = -1, c = 1e400;
|
|
225
|
-
return r.forEach((e, t) => {
|
|
226
|
-
if (!e) return;
|
|
227
|
-
let n = a < e.left ? e.left - a : a >= e.right ? a - e.right : 0, r = i === "x" ? 0 : o < e.top ? e.top - o : o >= e.bottom ? o - e.bottom : 0, l = Math.hypot(n, r);
|
|
228
|
-
l < c && (c = l, s = t);
|
|
229
|
-
}), s;
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
// src/utils/mergeRefs.ts
|
|
234
|
-
var lt = (e) => !e || typeof e == "function" ? e : (t) => {
|
|
235
|
-
e.current = t;
|
|
236
|
-
};
|
|
237
|
-
function ut(...e) {
|
|
238
|
-
return (t) => {
|
|
239
|
-
e.forEach((e) => {
|
|
240
|
-
lt(e)?.(t);
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
// src/hooks/useMergedRefs.ts
|
|
245
|
-
function dt(...e) {
|
|
246
|
-
return c(() => ut(...e), e);
|
|
247
|
-
}
|
|
248
|
-
// src/hooks/useMove.ts
|
|
249
|
-
function ft(e) {
|
|
250
|
-
let [{ state: t }] = d(() => ({ state: {
|
|
251
|
-
activePointId: null,
|
|
252
|
-
clientX: 0,
|
|
253
|
-
clientY: 0,
|
|
254
|
-
initialClientX: 0,
|
|
255
|
-
initialClientY: 0,
|
|
256
|
-
isDistanceReached: !1,
|
|
257
|
-
holdTimer: null,
|
|
258
|
-
isTouchActive: !1
|
|
259
|
-
} })), n = u(e);
|
|
260
|
-
n.current = e;
|
|
261
|
-
let { addGlobalListener: r, removeGlobalListener: a } = ot();
|
|
262
|
-
i(() => () => ht(t), [t]);
|
|
263
|
-
let { listeners: o, ref: s } = c(() => {
|
|
264
|
-
let e = {}, i = (e) => {
|
|
265
|
-
"stopPropagation" in e && "preventDefault" in e && (e.stopPropagation(), e.preventDefault());
|
|
266
|
-
}, o = (e, r) => {
|
|
267
|
-
let { current: { distance: i = 0, ...a } } = n, { clientX: o, clientY: s } = e, { clientX: c, clientY: l } = t;
|
|
268
|
-
t.clientX = o, t.clientY = s, r !== void 0 && (t.activePointId = r);
|
|
269
|
-
let u = (e) => ({
|
|
270
|
-
shiftKey: e.shiftKey,
|
|
271
|
-
metaKey: e.metaKey,
|
|
272
|
-
ctrlKey: e.ctrlKey,
|
|
273
|
-
altKey: e.altKey,
|
|
274
|
-
clientX: o,
|
|
275
|
-
clientY: s
|
|
276
|
-
});
|
|
277
|
-
return {
|
|
278
|
-
start(e, n) {
|
|
279
|
-
return t.initialClientX = o, t.initialClientY = s, t.isDistanceReached = i === 0, a.onMoveStart({
|
|
280
|
-
type: "movestart",
|
|
281
|
-
pointerType: e,
|
|
282
|
-
...u(n)
|
|
283
|
-
});
|
|
284
|
-
},
|
|
285
|
-
move(e, n, r, d) {
|
|
286
|
-
let f = o - t.initialClientX, p = s - t.initialClientY;
|
|
287
|
-
!t.isDistanceReached && f ** 2 + p ** 2 >= i ** 2 && (t.isDistanceReached = !0), t.isDistanceReached && a.onMove({
|
|
288
|
-
type: "move",
|
|
289
|
-
pointerType: e,
|
|
290
|
-
deltaX: r ?? o - c,
|
|
291
|
-
deltaY: d ?? s - l,
|
|
292
|
-
initialDeltaX: f,
|
|
293
|
-
initialDeltaY: p,
|
|
294
|
-
...u(n)
|
|
295
|
-
});
|
|
296
|
-
},
|
|
297
|
-
end(e, t) {
|
|
298
|
-
a.onMoveEnd({
|
|
299
|
-
type: "moveend",
|
|
300
|
-
pointerType: e,
|
|
301
|
-
...u(t)
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
if (typeof PointerEvent > "u") {
|
|
307
|
-
let n = (e) => {
|
|
308
|
-
e.button === 0 && o(e).move("mouse", e);
|
|
309
|
-
}, s = (e) => {
|
|
310
|
-
e.button === 0 && o(e).end("mouse", e);
|
|
311
|
-
};
|
|
312
|
-
e.onMouseDown = (e) => {
|
|
313
|
-
e.button === 0 && (o(e).start("mouse", e) === !1 ? o(e, null) : (r(window, "mousemove", n, !1), r(window, "mouseup", s, !1), i(e)));
|
|
314
|
-
};
|
|
315
|
-
let c = (e) => {
|
|
316
|
-
let n = [...e.changedTouches].findIndex(({ identifier: e }) => e === t.activePointId);
|
|
317
|
-
if (n >= 0) {
|
|
318
|
-
let t = e.changedTouches[n];
|
|
319
|
-
o(t).move("touch", e);
|
|
320
|
-
}
|
|
321
|
-
}, l = (e) => {
|
|
322
|
-
let n = [...e.changedTouches].findIndex(({ identifier: e }) => e === t.activePointId);
|
|
323
|
-
n >= 0 && (o(e.changedTouches[n], null).end("touch", e), a(window, "touchmove", c, !1), a(window, "touchend", l), a(window, "touchcancel", l));
|
|
324
|
-
};
|
|
325
|
-
e.onTouchStart = (e) => {
|
|
326
|
-
if (e.changedTouches.length === 0 || t.activePointId !== null) return;
|
|
327
|
-
let n = e.changedTouches[0];
|
|
328
|
-
o(n, n.identifier).start("touch", e) === !1 ? o(n, null) : (r(window, "touchmove", c, !1), r(window, "touchend", l, !1), r(window, "touchcancel", l, !1), i(e));
|
|
329
|
-
};
|
|
330
|
-
} else {
|
|
331
|
-
let s = () => {
|
|
332
|
-
a(window, "pointermove", l, !1), a(window, "pointerup", u, !1), a(window, "pointercancel", u, !1);
|
|
333
|
-
}, c = () => {
|
|
334
|
-
ht(t), s(), o(t, null);
|
|
335
|
-
}, l = (e) => {
|
|
336
|
-
if (e.pointerId !== t.activePointId) return;
|
|
337
|
-
if (t.holdTimer !== null) {
|
|
338
|
-
let n = e.clientX - t.initialClientX, r = e.clientY - t.initialClientY;
|
|
339
|
-
n ** 2 + r ** 2 > mt ** 2 ? c() : o(e);
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
let n = e.pointerType || "mouse";
|
|
343
|
-
o(e).move(n, e);
|
|
344
|
-
}, u = (e) => {
|
|
345
|
-
if (e.pointerId !== t.activePointId) return;
|
|
346
|
-
if (t.holdTimer !== null) {
|
|
347
|
-
c();
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
let n = e.pointerType || "mouse";
|
|
351
|
-
t.isTouchActive = !1, o(e, null).end(n, e), s();
|
|
352
|
-
}, d = (e, n) => o(t).start(e, n) !== !1 && (t.isTouchActive = e === "touch", !0);
|
|
353
|
-
e.onPointerDown = (e) => {
|
|
354
|
-
if (e.button !== 0 || t.activePointId !== null) return;
|
|
355
|
-
let a = e.pointerType || "mouse", { touchDelay: s = 0 } = n.current;
|
|
356
|
-
if (o(e, e.pointerId), a === "touch" && s > 0) {
|
|
357
|
-
t.initialClientX = e.clientX, t.initialClientY = e.clientY;
|
|
358
|
-
let n = e.nativeEvent;
|
|
359
|
-
t.holdTimer = setTimeout(() => {
|
|
360
|
-
t.holdTimer = null, d(a, n) ? "vibrate" in navigator && navigator.vibrate(pt) : c();
|
|
361
|
-
}, s);
|
|
362
|
-
} else if (!d(a, e)) {
|
|
363
|
-
o(e, null);
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
r(window, "pointermove", l, !1), r(window, "pointerup", u, !1), r(window, "pointercancel", u, !1), i(e);
|
|
367
|
-
}, e.onContextMenu = (e) => {
|
|
368
|
-
(t.holdTimer !== null || t.isTouchActive) && e.preventDefault();
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
let s = (e, t, n) => {
|
|
372
|
-
let { start: r, move: i, end: a } = o({
|
|
373
|
-
clientX: 0,
|
|
374
|
-
clientY: 0
|
|
375
|
-
});
|
|
376
|
-
r("keyboard", e) ? (i("keyboard", e, t, n), a("keyboard", e)) : o({
|
|
377
|
-
clientX: 0,
|
|
378
|
-
clientY: 0
|
|
379
|
-
}, null);
|
|
380
|
-
};
|
|
381
|
-
e.onKeyDown = (e) => {
|
|
382
|
-
switch (e.key) {
|
|
383
|
-
case "Left":
|
|
384
|
-
case "ArrowLeft":
|
|
385
|
-
i(e), s(e, -1, 0);
|
|
386
|
-
break;
|
|
387
|
-
case "Right":
|
|
388
|
-
case "ArrowRight":
|
|
389
|
-
i(e), s(e, 1, 0);
|
|
390
|
-
break;
|
|
391
|
-
case "Up":
|
|
392
|
-
case "ArrowUp":
|
|
393
|
-
i(e), s(e, 0, -1);
|
|
394
|
-
break;
|
|
395
|
-
case "Down":
|
|
396
|
-
case "ArrowDown": i(e), s(e, 0, 1);
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
let c = (e) => {
|
|
400
|
-
t.isTouchActive && e.cancelable && e.preventDefault();
|
|
401
|
-
}, l = { target: null };
|
|
402
|
-
return {
|
|
403
|
-
listeners: e,
|
|
404
|
-
ref: (e) => {
|
|
405
|
-
l.target && a(l.target, "touchmove", c), l.target = e, e && r(e, "touchmove", c, { passive: !1 });
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
}, [
|
|
409
|
-
r,
|
|
410
|
-
a,
|
|
411
|
-
t
|
|
412
|
-
]);
|
|
413
|
-
return {
|
|
414
|
-
listeners: o,
|
|
415
|
-
ref: s
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
var pt = 10, mt = 10;
|
|
419
|
-
function ht(e) {
|
|
420
|
-
e.holdTimer !== null && (clearTimeout(e.holdTimer), e.holdTimer = null);
|
|
421
|
-
}
|
|
422
|
-
// src/hooks/usePrevious.ts
|
|
423
|
-
function gt(e) {
|
|
424
|
-
let t = u(void 0);
|
|
425
|
-
return i(() => {
|
|
426
|
-
t.current = e;
|
|
427
|
-
}, [e]), t.current;
|
|
428
|
-
}
|
|
429
|
-
// src/hooks/useRefList.ts
|
|
430
|
-
function _t() {
|
|
431
|
-
return rt(vt).current;
|
|
432
|
-
}
|
|
433
|
-
function vt() {
|
|
434
|
-
let e = [], t = /* @__PURE__ */ new Map();
|
|
435
|
-
return {
|
|
436
|
-
elements: { current: e },
|
|
437
|
-
refAt(n) {
|
|
438
|
-
let r = t.get(n);
|
|
439
|
-
return r || (r = (t) => {
|
|
440
|
-
e[n] = t;
|
|
441
|
-
}, t.set(n, r)), r;
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
// src/hooks/useScrollBarSize.ts
|
|
446
|
-
function yt() {
|
|
447
|
-
let e = null, n = 0, r = (t) => (n += 1, e === null && (e = document.createElement("div"), e.style.width = "99px", e.style.height = "99px", e.style.overflow = "scroll", e.style.position = "absolute", e.style.top = "-9999px", e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "presentation"), document.body.appendChild(e), window.addEventListener("resize", t)), {
|
|
448
|
-
element: e,
|
|
449
|
-
cleanup: () => {
|
|
450
|
-
e && --n <= 0 && (document.body.removeChild(e), window.removeEventListener("resize", t), e = null, n = 0);
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
return function() {
|
|
454
|
-
let [e, n] = d({
|
|
455
|
-
height: 0,
|
|
456
|
-
width: 0
|
|
457
|
-
});
|
|
458
|
-
return qe(() => {
|
|
459
|
-
let e = () => {
|
|
460
|
-
let e = i.offsetHeight - i.clientHeight, r = i.offsetWidth - i.clientWidth;
|
|
461
|
-
t(() => {
|
|
462
|
-
n((t) => {
|
|
463
|
-
let { height: n, width: i } = t;
|
|
464
|
-
return n !== e || i !== r ? {
|
|
465
|
-
height: e,
|
|
466
|
-
width: r
|
|
467
|
-
} : t;
|
|
468
|
-
});
|
|
469
|
-
});
|
|
470
|
-
}, { element: i, cleanup: a } = r(e);
|
|
471
|
-
return e(), a;
|
|
472
|
-
}, []), e;
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
var bt = yt();
|
|
476
|
-
// src/hooks/useStateRef.ts
|
|
477
|
-
function xt(e) {
|
|
478
|
-
let [t, r] = d(e), i = u(e);
|
|
479
|
-
return [
|
|
480
|
-
t,
|
|
481
|
-
n((e) => {
|
|
482
|
-
i.current = e, r(e);
|
|
483
|
-
}, []),
|
|
484
|
-
i
|
|
485
|
-
];
|
|
486
|
-
}
|
|
487
|
-
// src/hooks/useTimeInterval.ts
|
|
488
|
-
function St(e, t, n = !0) {
|
|
489
|
-
let r = u(null), a = Xe(e);
|
|
490
|
-
i(() => {
|
|
491
|
-
if (n) {
|
|
492
|
-
let e = /* @__PURE__ */ new Date(), n = t - (e.getMinutes() * 60 + e.getSeconds()) * 1e3 % t;
|
|
493
|
-
r.current = setTimeout(() => {
|
|
494
|
-
a.current(), r.current = setInterval(a.current, t);
|
|
495
|
-
}, n), a.current();
|
|
496
|
-
}
|
|
497
|
-
return () => {
|
|
498
|
-
r.current && clearTimeout(r.current);
|
|
499
|
-
};
|
|
500
|
-
}, [
|
|
501
|
-
a,
|
|
502
|
-
t,
|
|
503
|
-
n
|
|
504
|
-
]);
|
|
505
|
-
}
|
|
506
|
-
// src/hooks/useToday.ts
|
|
507
|
-
var Ct = (e) => e.toMillis(e.getToday());
|
|
508
|
-
function wt() {
|
|
509
|
-
let e = K(), [t, n] = d(() => ({
|
|
510
|
-
dateUtils: e,
|
|
511
|
-
today: Ct(e)
|
|
512
|
-
})), r = t;
|
|
513
|
-
t.dateUtils !== e && (r = {
|
|
514
|
-
dateUtils: e,
|
|
515
|
-
today: Ct(e)
|
|
516
|
-
}, n(r));
|
|
517
|
-
let { today: a } = r;
|
|
518
|
-
return i(() => {
|
|
519
|
-
let t = e.toMillis(e.addDays(e.fromMillis(a), 1)), r = Math.max(t - Date.now(), 0) + 1e3, i = setTimeout(() => n({
|
|
520
|
-
dateUtils: e,
|
|
521
|
-
today: Ct(e)
|
|
522
|
-
}), r);
|
|
523
|
-
return () => clearTimeout(i);
|
|
524
|
-
}, [e, a]), a;
|
|
525
|
-
}
|
|
526
|
-
// src/contexts/CalendarContext.ts
|
|
527
|
-
var Tt = e(void 0);
|
|
528
|
-
U && (Tt.displayName = "CalendarContext");
|
|
529
|
-
function J() {
|
|
530
|
-
let e = r(Tt);
|
|
531
|
-
if (!e) throw Error("CalendarContext is required");
|
|
532
|
-
return e;
|
|
533
|
-
}
|
|
534
|
-
// src/contexts/ThemeSourceContext.ts
|
|
535
|
-
var Et = e(null);
|
|
536
|
-
U && (Et.displayName = "ThemeSourceContext");
|
|
537
|
-
// src/hooks/useCalendarValue.ts
|
|
538
|
-
function Dt(e) {
|
|
539
|
-
let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] = et({
|
|
540
|
-
controlled: t,
|
|
541
|
-
default: r,
|
|
542
|
-
initialState: "week"
|
|
543
|
-
}), m = n((e, t) => be(c, e, t, a), [c, a]), [h, g] = et({
|
|
544
|
-
controlled: o,
|
|
545
|
-
default: s,
|
|
546
|
-
initialState: m(f)
|
|
547
|
-
}), _ = q((e, t) => {
|
|
548
|
-
g(e), d?.(e, t);
|
|
549
|
-
}), v = q(ye((e) => {
|
|
550
|
-
p(e);
|
|
551
|
-
}, l)), y = Xe(h), b = u(f), x = u(a), S = u(c);
|
|
552
|
-
return i(() => {
|
|
553
|
-
let e = b.current, t = x.current !== a, n = S.current, r = n === c ? y.current : je(n, c, y.current);
|
|
554
|
-
b.current = f, x.current = a, S.current = c;
|
|
555
|
-
let i = e === f && !t ? m(f, r) : le(c, e, f, r, a);
|
|
556
|
-
_(i, f);
|
|
557
|
-
}, [
|
|
558
|
-
m,
|
|
559
|
-
_,
|
|
560
|
-
f,
|
|
561
|
-
y,
|
|
562
|
-
c,
|
|
563
|
-
a
|
|
564
|
-
]), {
|
|
565
|
-
view: f,
|
|
566
|
-
viewValue: h,
|
|
567
|
-
changeViewValue: _,
|
|
568
|
-
changeView: v
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
// src/hooks/useNavigation.ts
|
|
572
|
-
function Ot(e) {
|
|
573
|
-
let { dateUtils: t, view: n, viewValue: r, changeViewValue: i, startWeek: a } = e, o = (e, r) => () => i(B(t, n, e, r, a), n);
|
|
574
|
-
return {
|
|
575
|
-
goForward: q(o(r, 1)),
|
|
576
|
-
goBackward: q(o(r, -1)),
|
|
577
|
-
goToday: q(o(t.getToday(), 0))
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
// src/icons/chevron.tsx
|
|
581
|
-
function kt(e) {
|
|
582
|
-
return /* @__PURE__ */ W("svg", {
|
|
583
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
584
|
-
fill: "none",
|
|
585
|
-
height: "12",
|
|
586
|
-
viewBox: "0 0 13 12",
|
|
587
|
-
width: "13",
|
|
588
|
-
...e,
|
|
589
|
-
children: /* @__PURE__ */ W("path", {
|
|
590
|
-
d: "M1.77498 2.29504L6.35498 6.87504L10.945 2.29504L12.355 3.70504L6.35498 9.70504L0.35498 3.70504L1.77498 2.29504Z",
|
|
591
|
-
fill: "currentColor"
|
|
592
|
-
})
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
// src/portal/Portal.tsx
|
|
596
|
-
var At = () => () => {}, jt = () => !0, Mt = () => !1;
|
|
597
|
-
function Nt() {
|
|
598
|
-
return f(At, jt, Mt);
|
|
599
|
-
}
|
|
600
|
-
function Pt(e) {
|
|
601
|
-
let t = { display: "contents" };
|
|
602
|
-
if (!e) return t;
|
|
603
|
-
let n = getComputedStyle(e);
|
|
604
|
-
for (let e of g) {
|
|
605
|
-
let r = n.getPropertyValue(e).trim();
|
|
606
|
-
r && (t[e === "font-family" ? "fontFamily" : e] = r);
|
|
607
|
-
}
|
|
608
|
-
return t;
|
|
609
|
-
}
|
|
610
|
-
function Ft({ children: e, container: t }) {
|
|
611
|
-
let n = Nt(), i = r(Et);
|
|
612
|
-
return n ? t ? Ve(e, t) : Ve(/* @__PURE__ */ W("div", {
|
|
613
|
-
style: Pt(i?.current),
|
|
614
|
-
children: e
|
|
615
|
-
}), document.body) : null;
|
|
616
|
-
}
|
|
617
|
-
var Y = {
|
|
618
|
-
root: "_root_39am3_1",
|
|
619
|
-
root__toggle: "_root__toggle_39am3_6",
|
|
620
|
-
root__toggleLabel: "_root__toggleLabel_39am3_30",
|
|
621
|
-
root__toggleIcon: "_root__toggleIcon_39am3_37",
|
|
622
|
-
root__toggleIcon_open: "_root__toggleIcon_open_39am3_43",
|
|
623
|
-
popover: "_popover_39am3_47",
|
|
624
|
-
popover__header: "_popover__header_39am3_73",
|
|
625
|
-
popover__title: "_popover__title_39am3_95",
|
|
626
|
-
popover__navBackward: "_popover__navBackward_39am3_100",
|
|
627
|
-
popover__navForward: "_popover__navForward_39am3_104",
|
|
628
|
-
popover__grid: "_popover__grid_39am3_108",
|
|
629
|
-
popover__weekday: "_popover__weekday_39am3_114",
|
|
630
|
-
popover__day: "_popover__day_39am3_124",
|
|
631
|
-
popover__day_outside: "_popover__day_outside_39am3_142",
|
|
632
|
-
popover__day_selected: "_popover__day_selected_39am3_147",
|
|
633
|
-
popover__day_rangeStart: "_popover__day_rangeStart_39am3_154",
|
|
634
|
-
popover__day_rangeEnd: "_popover__day_rangeEnd_39am3_159",
|
|
635
|
-
popover__day_today: "_popover__day_today_39am3_164"
|
|
636
|
-
};
|
|
637
|
-
// src/components/date-navigator/DateNavigator.tsx
|
|
638
|
-
function It({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, className: a, ...o }) {
|
|
639
|
-
let { view: s, viewValue: l, changeViewValue: f, startWeek: p } = J(), m = K(), h = Ke(), { getStartOfWeek: g, getStartOfMonth: _, addMonths: v } = m, [y, b] = d(!1), [x, S] = d(() => _(l)), C = u(null), { addGlobalListener: w, removeGlobalListener: T } = ot(), { refs: E, floatingStyles: D } = ze({
|
|
640
|
-
placement: "bottom",
|
|
641
|
-
middleware: [
|
|
642
|
-
Le(6),
|
|
643
|
-
Ie({ padding: 8 }),
|
|
644
|
-
Re({ padding: 8 })
|
|
645
|
-
],
|
|
646
|
-
whileElementsMounted: Fe
|
|
647
|
-
});
|
|
648
|
-
i(() => {
|
|
649
|
-
y && S(_(l));
|
|
650
|
-
}, [
|
|
651
|
-
y,
|
|
652
|
-
_,
|
|
653
|
-
l
|
|
654
|
-
]), i(() => {
|
|
655
|
-
if (!y) return;
|
|
656
|
-
let e = (e) => {
|
|
657
|
-
let t = e.target;
|
|
658
|
-
C.current?.contains(t) || E.floating.current?.contains(t) || b(!1);
|
|
659
|
-
};
|
|
660
|
-
return w(document, "pointerdown", e), () => T(document, "pointerdown", e);
|
|
661
|
-
}, [
|
|
662
|
-
w,
|
|
663
|
-
y,
|
|
664
|
-
E.floating,
|
|
665
|
-
T
|
|
666
|
-
]);
|
|
667
|
-
let k = c(() => e ? e(l, s) : ue(m, s, l, p), [
|
|
668
|
-
m,
|
|
669
|
-
e,
|
|
670
|
-
p,
|
|
671
|
-
s,
|
|
672
|
-
l
|
|
673
|
-
]), A = c(() => R(m, x, p), [
|
|
674
|
-
m,
|
|
675
|
-
x,
|
|
676
|
-
p
|
|
677
|
-
]), M = (e) => {
|
|
678
|
-
n?.(e), b((e) => !e);
|
|
679
|
-
}, N = (e) => {
|
|
680
|
-
r?.(e), e.key === "Escape" && b(!1);
|
|
681
|
-
}, ee = (e) => {
|
|
682
|
-
f(s === "week" ? g(e, p) : e, s), b(!1);
|
|
683
|
-
};
|
|
684
|
-
return /* @__PURE__ */ G("div", {
|
|
685
|
-
ref: C,
|
|
686
|
-
className: Y.root,
|
|
687
|
-
children: [/* @__PURE__ */ G("button", {
|
|
688
|
-
type: t,
|
|
689
|
-
"aria-label": h.chooseDate,
|
|
690
|
-
"aria-expanded": y,
|
|
691
|
-
"aria-haspopup": "dialog",
|
|
692
|
-
...o,
|
|
693
|
-
onClick: M,
|
|
694
|
-
onKeyDown: N,
|
|
695
|
-
ref: E.setReference,
|
|
696
|
-
className: O(a, Y.root__toggle),
|
|
697
|
-
children: [/* @__PURE__ */ W("span", {
|
|
698
|
-
className: Y.root__toggleLabel,
|
|
699
|
-
children: k
|
|
700
|
-
}), /* @__PURE__ */ W(kt, { className: O(Y.root__toggleIcon, { [Y.root__toggleIcon_open]: y }) })]
|
|
701
|
-
}), y && /* @__PURE__ */ W(Ft, { children: /* @__PURE__ */ G("div", {
|
|
702
|
-
ref: E.setFloating,
|
|
703
|
-
style: D,
|
|
704
|
-
role: "dialog",
|
|
705
|
-
"aria-label": h.chooseDate,
|
|
706
|
-
className: Y.popover,
|
|
707
|
-
children: [/* @__PURE__ */ G("div", {
|
|
708
|
-
className: Y.popover__header,
|
|
709
|
-
children: [
|
|
710
|
-
/* @__PURE__ */ W("button", {
|
|
711
|
-
type: "button",
|
|
712
|
-
"aria-label": h.previousMonth,
|
|
713
|
-
onClick: () => S((e) => v(e, -1)),
|
|
714
|
-
children: /* @__PURE__ */ W(kt, { className: Y.popover__navBackward })
|
|
715
|
-
}),
|
|
716
|
-
/* @__PURE__ */ W("div", {
|
|
717
|
-
className: Y.popover__title,
|
|
718
|
-
children: j(m, x)
|
|
719
|
-
}),
|
|
720
|
-
/* @__PURE__ */ W("button", {
|
|
721
|
-
type: "button",
|
|
722
|
-
"aria-label": h.nextMonth,
|
|
723
|
-
onClick: () => S((e) => v(e, 1)),
|
|
724
|
-
children: /* @__PURE__ */ W(kt, { className: Y.popover__navForward })
|
|
725
|
-
})
|
|
726
|
-
]
|
|
727
|
-
}), /* @__PURE__ */ G("div", {
|
|
728
|
-
className: Y.popover__grid,
|
|
729
|
-
children: [A.slice(0, 7).map((e) => /* @__PURE__ */ W("div", {
|
|
730
|
-
className: Y.popover__weekday,
|
|
731
|
-
children: m.weekDayShortName(m.getWeekDay(e))
|
|
732
|
-
}, m.getWeekDay(e))), A.map((e, t) => {
|
|
733
|
-
let n = m.getMonths(e) !== m.getMonths(x), r = m.isToday(e), i = s !== "month" && he(m, s, l, e), a = i && (s === "day" || t % 7 == 0), o = i && (s === "day" || t % 7 == 6);
|
|
734
|
-
return /* @__PURE__ */ W("button", {
|
|
735
|
-
type: "button",
|
|
736
|
-
onClick: () => ee(e),
|
|
737
|
-
className: O(Y.popover__day, {
|
|
738
|
-
[Y.popover__day_outside]: n,
|
|
739
|
-
[Y.popover__day_today]: r,
|
|
740
|
-
[Y.popover__day_selected]: i,
|
|
741
|
-
[Y.popover__day_rangeStart]: a,
|
|
742
|
-
[Y.popover__day_rangeEnd]: o
|
|
743
|
-
}),
|
|
744
|
-
children: m.getMonthDay(e)
|
|
745
|
-
}, m.toMillis(e));
|
|
746
|
-
})]
|
|
747
|
-
})]
|
|
748
|
-
}) })]
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
var Lt = {
|
|
752
|
-
root: "_root_uo171_1",
|
|
753
|
-
root__icon: "_root__icon_uo171_23",
|
|
754
|
-
root__icon_forward: "_root__icon_forward_uo171_27",
|
|
755
|
-
root__icon_backward: "_root__icon_backward_uo171_31"
|
|
756
|
-
};
|
|
757
|
-
// src/components/nav-btn/NavBtn.tsx
|
|
758
|
-
function Rt({ direction: e = "forward", type: t = "button", onClick: n, className: r, children: i, ...a }) {
|
|
759
|
-
let { goForward: o, goBackward: s } = J(), c = Ke(), l = q(ye(n, () => {
|
|
760
|
-
e === "forward" ? o() : e === "backward" && s();
|
|
761
|
-
}));
|
|
762
|
-
return /* @__PURE__ */ W("button", {
|
|
763
|
-
type: t,
|
|
764
|
-
"aria-label": e === "forward" ? c.next : c.previous,
|
|
765
|
-
...a,
|
|
766
|
-
onClick: l,
|
|
767
|
-
className: O(r, Lt.root),
|
|
768
|
-
children: i ?? /* @__PURE__ */ W(kt, { className: O(Lt.root__icon, {
|
|
769
|
-
[Lt.root__icon_backward]: e === "backward",
|
|
770
|
-
[Lt.root__icon_forward]: e === "forward"
|
|
771
|
-
}) })
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
var zt = {
|
|
775
|
-
root: "_root_5dy7b_1",
|
|
776
|
-
root__icon: "_root__icon_5dy7b_27",
|
|
777
|
-
root__icon_open: "_root__icon_open_5dy7b_34",
|
|
778
|
-
list: "_list_5dy7b_38",
|
|
779
|
-
list__option: "_list__option_5dy7b_52",
|
|
780
|
-
list__option_active: "_list__option_active_5dy7b_72",
|
|
781
|
-
list__check: "_list__check_5dy7b_80"
|
|
782
|
-
}, Bt = [
|
|
783
|
-
"day",
|
|
784
|
-
"week",
|
|
785
|
-
"month"
|
|
786
|
-
];
|
|
787
|
-
function Vt({ className: e }) {
|
|
788
|
-
let { view: t, changeView: n } = J(), r = Ke(), { addGlobalListener: o, removeGlobalListener: s } = ot(), c = a(), [l, f] = d(!1), [p, m] = d(t), h = u(/* @__PURE__ */ new Map()), { refs: g, floatingStyles: _ } = ze({
|
|
789
|
-
placement: "bottom-end",
|
|
790
|
-
middleware: [
|
|
791
|
-
Le(6),
|
|
792
|
-
Ie({ padding: 8 }),
|
|
793
|
-
Re({ padding: 8 })
|
|
794
|
-
],
|
|
795
|
-
whileElementsMounted: Fe
|
|
796
|
-
}), v = (e) => {
|
|
797
|
-
f(!1);
|
|
798
|
-
let t = g.reference.current;
|
|
799
|
-
e && t instanceof HTMLElement && t.focus();
|
|
800
|
-
}, y = (e = t) => {
|
|
801
|
-
m(e), f(!0);
|
|
802
|
-
}, b = (e) => {
|
|
803
|
-
v(!0), n(e);
|
|
804
|
-
};
|
|
805
|
-
i(() => {
|
|
806
|
-
l && h.current.get(p)?.focus();
|
|
807
|
-
}, [l, p]), i(() => {
|
|
808
|
-
if (!l) return;
|
|
809
|
-
let e = (e) => {
|
|
810
|
-
let t = e.target, n = g.reference.current;
|
|
811
|
-
n instanceof Node && n.contains(t) || g.floating.current?.contains(t) || f(!1);
|
|
812
|
-
};
|
|
813
|
-
return o(document, "pointerdown", e), () => s(document, "pointerdown", e);
|
|
814
|
-
}, [
|
|
815
|
-
o,
|
|
816
|
-
l,
|
|
817
|
-
g.floating,
|
|
818
|
-
g.reference,
|
|
819
|
-
s
|
|
820
|
-
]);
|
|
821
|
-
let x = (e) => {
|
|
822
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), y());
|
|
823
|
-
}, S = (e) => {
|
|
824
|
-
let t = Bt.indexOf(p), n = (t) => {
|
|
825
|
-
e.preventDefault(), m(Bt[(t + Bt.length) % Bt.length] ?? p);
|
|
826
|
-
};
|
|
827
|
-
switch (e.key) {
|
|
828
|
-
case "ArrowDown": return n(t + 1);
|
|
829
|
-
case "ArrowUp": return n(t - 1);
|
|
830
|
-
case "Home": return n(0);
|
|
831
|
-
case "End": return n(Bt.length - 1);
|
|
832
|
-
case "Enter":
|
|
833
|
-
case " ": return e.preventDefault(), b(p);
|
|
834
|
-
case "Escape": return e.preventDefault(), v(!0);
|
|
835
|
-
case "Tab": return v(!1);
|
|
836
|
-
}
|
|
837
|
-
}, C = `${c}-list`;
|
|
838
|
-
return /* @__PURE__ */ G(Be, { children: [/* @__PURE__ */ G("button", {
|
|
839
|
-
ref: g.setReference,
|
|
840
|
-
type: "button",
|
|
841
|
-
"aria-haspopup": "listbox",
|
|
842
|
-
"aria-expanded": l,
|
|
843
|
-
"aria-controls": l ? C : void 0,
|
|
844
|
-
"aria-label": `${r.chooseView}: ${r[t]}`,
|
|
845
|
-
className: O(e, zt.root),
|
|
846
|
-
onClick: () => l ? v(!1) : y(),
|
|
847
|
-
onKeyDown: x,
|
|
848
|
-
children: [r[t], /* @__PURE__ */ W(kt, {
|
|
849
|
-
"aria-hidden": "true",
|
|
850
|
-
className: O(zt.root__icon, { [zt.root__icon_open]: l })
|
|
851
|
-
})]
|
|
852
|
-
}), l && /* @__PURE__ */ W(Ft, { children: /* @__PURE__ */ W("div", {
|
|
853
|
-
ref: g.setFloating,
|
|
854
|
-
id: C,
|
|
855
|
-
role: "listbox",
|
|
856
|
-
"aria-label": r.chooseView,
|
|
857
|
-
style: _,
|
|
858
|
-
className: zt.list,
|
|
859
|
-
onKeyDown: S,
|
|
860
|
-
children: Bt.map((e) => /* @__PURE__ */ G("div", {
|
|
861
|
-
ref: (t) => {
|
|
862
|
-
t ? h.current.set(e, t) : h.current.delete(e);
|
|
863
|
-
},
|
|
864
|
-
id: `${c}-${e}`,
|
|
865
|
-
role: "option",
|
|
866
|
-
tabIndex: -1,
|
|
867
|
-
"aria-selected": e === t,
|
|
868
|
-
className: O(zt.list__option, { [zt.list__option_active]: e === p }),
|
|
869
|
-
onClick: () => b(e),
|
|
870
|
-
onPointerMove: () => m(e),
|
|
871
|
-
children: [r[e], e === t && /* @__PURE__ */ W("svg", {
|
|
872
|
-
"aria-hidden": "true",
|
|
873
|
-
className: zt.list__check,
|
|
874
|
-
viewBox: "0 0 16 16",
|
|
875
|
-
width: "14",
|
|
876
|
-
height: "14",
|
|
877
|
-
children: /* @__PURE__ */ W("path", {
|
|
878
|
-
d: "M3 8.5 6.5 12 13 4.5",
|
|
879
|
-
fill: "none",
|
|
880
|
-
stroke: "currentColor",
|
|
881
|
-
strokeWidth: "2",
|
|
882
|
-
strokeLinecap: "round",
|
|
883
|
-
strokeLinejoin: "round"
|
|
884
|
-
})
|
|
885
|
-
})]
|
|
886
|
-
}, e))
|
|
887
|
-
}) })] });
|
|
888
|
-
}
|
|
889
|
-
var X = {
|
|
890
|
-
root: "_root_1gqqu_1",
|
|
891
|
-
root__navigationPane: "_root__navigationPane_1gqqu_12",
|
|
892
|
-
root__viewList: "_root__viewList_1gqqu_13",
|
|
893
|
-
root__today: "_root__today_1gqqu_28",
|
|
894
|
-
root__viewTab: "_root__viewTab_1gqqu_57",
|
|
895
|
-
root__viewTab_isActive: "_root__viewTab_isActive_1gqqu_79",
|
|
896
|
-
root__viewTab_disabled: "_root__viewTab_disabled_1gqqu_87",
|
|
897
|
-
root__viewSelect: "_root__viewSelect_1gqqu_93"
|
|
898
|
-
};
|
|
899
|
-
// src/components/calendar-toolbar/CalendarToolbar.tsx
|
|
900
|
-
function Ht(e) {
|
|
901
|
-
let { goToday: t, changeView: n, view: r } = J(), i = Ke(), a = e, o = {
|
|
902
|
-
day: {
|
|
903
|
-
type: "button",
|
|
904
|
-
"aria-selected": r === "day",
|
|
905
|
-
onClick: ye(void 0, () => n("day")),
|
|
906
|
-
className: O(X.root__viewTab, { [X.root__viewTab_isActive]: r === "day" }),
|
|
907
|
-
children: i.day
|
|
908
|
-
},
|
|
909
|
-
week: {
|
|
910
|
-
type: "button",
|
|
911
|
-
"aria-selected": r === "week",
|
|
912
|
-
onClick: ye(void 0, () => n("week")),
|
|
913
|
-
className: O(X.root__viewTab, { [X.root__viewTab_isActive]: r === "week" }),
|
|
914
|
-
children: i.week
|
|
915
|
-
},
|
|
916
|
-
month: {
|
|
917
|
-
type: "button",
|
|
918
|
-
"aria-selected": r === "month",
|
|
919
|
-
onClick: ye(void 0, () => n("month")),
|
|
920
|
-
className: O(X.root__viewTab, { [X.root__viewTab_isActive]: r === "month" }),
|
|
921
|
-
children: i.month
|
|
922
|
-
}
|
|
923
|
-
}, s = {
|
|
924
|
-
type: "button",
|
|
925
|
-
onClick: q(t),
|
|
926
|
-
className: X.root__today,
|
|
927
|
-
children: i.today
|
|
928
|
-
};
|
|
929
|
-
return /* @__PURE__ */ G("div", {
|
|
930
|
-
...a,
|
|
931
|
-
className: O(a.className, X.root),
|
|
932
|
-
children: [
|
|
933
|
-
/* @__PURE__ */ W(It, {}),
|
|
934
|
-
/* @__PURE__ */ G("div", {
|
|
935
|
-
className: X.root__navigationPane,
|
|
936
|
-
role: "group",
|
|
937
|
-
children: [
|
|
938
|
-
/* @__PURE__ */ W(Rt, { direction: "backward" }),
|
|
939
|
-
/* @__PURE__ */ W("button", { ...s }),
|
|
940
|
-
/* @__PURE__ */ W(Rt, { direction: "forward" })
|
|
941
|
-
]
|
|
942
|
-
}),
|
|
943
|
-
/* @__PURE__ */ G("div", {
|
|
944
|
-
className: X.root__viewList,
|
|
945
|
-
children: [
|
|
946
|
-
/* @__PURE__ */ W("button", { ...o.day }),
|
|
947
|
-
/* @__PURE__ */ W("button", { ...o.week }),
|
|
948
|
-
/* @__PURE__ */ W("button", { ...o.month })
|
|
949
|
-
]
|
|
950
|
-
}),
|
|
951
|
-
/* @__PURE__ */ W("div", {
|
|
952
|
-
className: X.root__viewSelect,
|
|
953
|
-
children: /* @__PURE__ */ W(Vt, {})
|
|
954
|
-
})
|
|
955
|
-
]
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
// src/contexts/CalendarViewportContext.ts
|
|
959
|
-
var Ut = e(void 0);
|
|
960
|
-
U && (Ut.displayName = "CalendarViewportContext");
|
|
961
|
-
function Wt() {
|
|
962
|
-
let e = r(Ut);
|
|
963
|
-
if (!e) throw Error("CalendarViewportContext is required");
|
|
964
|
-
return e;
|
|
965
|
-
}
|
|
966
|
-
var Gt = { root: "_root_1pvvm_1" };
|
|
967
|
-
// src/components/pointer-popover/PointerPopover.tsx
|
|
968
|
-
function Kt({ coordinates: e, className: t, style: n, ...r }) {
|
|
969
|
-
return /* @__PURE__ */ W("span", {
|
|
970
|
-
tabIndex: -1,
|
|
971
|
-
...r,
|
|
972
|
-
className: O(t, Gt.root),
|
|
973
|
-
style: {
|
|
974
|
-
...n,
|
|
975
|
-
...e ? {
|
|
976
|
-
top: `calc(${e.y}px + 20px)`,
|
|
977
|
-
left: `calc(${e.x}px + 20px)`
|
|
978
|
-
} : null
|
|
979
|
-
}
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
var qt = {
|
|
983
|
-
root: "_root_ssdmn_1",
|
|
984
|
-
root_isDragging: "_root_isDragging_ssdmn_14",
|
|
985
|
-
root_isReturning: "_root_isReturning_ssdmn_23",
|
|
986
|
-
"ww-drag-return": "_ww-drag-return_ssdmn_39",
|
|
987
|
-
root_isBlocked: "_root_isBlocked_ssdmn_36"
|
|
988
|
-
}, Jt = {
|
|
989
|
-
isStart: !0,
|
|
990
|
-
isEnd: !0
|
|
991
|
-
};
|
|
992
|
-
function Yt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
|
|
993
|
-
let { eventMap: r, eventRenderer: i, pointerPreviewRenderer: a, view: o } = J(), { viewportRef: s } = Wt(), { isDragging: l, canDrop: f, dropData: p, eventItem: m, source: h, x: g, y: _, ...v } = Pe(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
|
|
994
|
-
let i = [...n.dropTargets.values()].shift(), a = [...e.dragTargets.values()].shift();
|
|
995
|
-
return {
|
|
996
|
-
...t.transform,
|
|
997
|
-
source: [...e.dragTargets.keys()].shift() ?? null,
|
|
998
|
-
canDrop: r(),
|
|
999
|
-
dropData: i,
|
|
1000
|
-
eventItem: a ? a.filter((e) => e.event)[0] : null,
|
|
1001
|
-
isDragging: e.isDragging,
|
|
1002
|
-
x: e.x,
|
|
1003
|
-
y: e.y
|
|
1004
|
-
};
|
|
1005
|
-
}), y = c(() => {
|
|
1006
|
-
if (!m) return null;
|
|
1007
|
-
let { key: e } = JSON.parse(m.event);
|
|
1008
|
-
return r.get(e)?.value ?? null;
|
|
1009
|
-
}, [m, r]), b = u(null), x = u(!1), [S, C] = d(!1), [w, T] = d(null);
|
|
1010
|
-
if (qe(() => {
|
|
1011
|
-
if (l) {
|
|
1012
|
-
x.current = f, p && h && (b.current = {
|
|
1013
|
-
transform: v,
|
|
1014
|
-
source: h,
|
|
1015
|
-
eventValue: y
|
|
1016
|
-
}, C(!0), T(null));
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
C(!1);
|
|
1020
|
-
let e = b.current;
|
|
1021
|
-
b.current = null;
|
|
1022
|
-
let t = s.current;
|
|
1023
|
-
if (!e || x.current || !t || !e.source.isConnected) return;
|
|
1024
|
-
let { transform: n } = e, r = e.source.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
1025
|
-
T({
|
|
1026
|
-
container: t,
|
|
1027
|
-
eventValue: e.eventValue,
|
|
1028
|
-
style: {
|
|
1029
|
-
left: r.left - i.left,
|
|
1030
|
-
top: r.top - i.top,
|
|
1031
|
-
width: r.width,
|
|
1032
|
-
height: r.height,
|
|
1033
|
-
"--ww-return-left": `${n.left}px`,
|
|
1034
|
-
"--ww-return-top": `${n.top}px`,
|
|
1035
|
-
"--ww-return-width": `${n.width}px`,
|
|
1036
|
-
"--ww-return-height": `${n.height}px`
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
}), tt(l ? f ? "grabbing" : "not-allowed" : null), !l) return w ? /* @__PURE__ */ W(Ft, {
|
|
1040
|
-
container: w.container,
|
|
1041
|
-
children: /* @__PURE__ */ W("div", {
|
|
1042
|
-
...n,
|
|
1043
|
-
className: O(n.className, qt.root, qt.root_isReturning),
|
|
1044
|
-
style: w.style,
|
|
1045
|
-
onAnimationEnd: () => T(null),
|
|
1046
|
-
children: w.eventValue == null ? null : i.current?.(w.eventValue, o, Jt)
|
|
1047
|
-
})
|
|
1048
|
-
}) : null;
|
|
1049
|
-
if (!S) return null;
|
|
1050
|
-
let E = !f;
|
|
1051
|
-
return /* @__PURE__ */ G(Ft, {
|
|
1052
|
-
container: s.current,
|
|
1053
|
-
children: [/* @__PURE__ */ W("div", {
|
|
1054
|
-
...n,
|
|
1055
|
-
className: O(n.className, qt.root, {
|
|
1056
|
-
[qt.root_isDragging]: l,
|
|
1057
|
-
[qt.root_isBlocked]: E
|
|
1058
|
-
}),
|
|
1059
|
-
style: { ...v },
|
|
1060
|
-
children: y == null ? null : i.current?.(y, o, Jt)
|
|
1061
|
-
}), e && !E && /* @__PURE__ */ W(Kt, {
|
|
1062
|
-
coordinates: {
|
|
1063
|
-
x: g,
|
|
1064
|
-
y: _
|
|
1065
|
-
},
|
|
1066
|
-
children: p ? a.current?.(p.date, Math.round(v.top / t), Math.round(v.height / t)) : null
|
|
1067
|
-
})]
|
|
1068
|
-
});
|
|
1069
|
-
}
|
|
1070
|
-
// src/components/month-view/MonthView.utils.ts
|
|
1071
|
-
function Xt(e, t) {
|
|
1072
|
-
return {
|
|
1073
|
-
...t,
|
|
1074
|
-
...e
|
|
1075
|
-
};
|
|
1076
|
-
}
|
|
1077
|
-
function Zt(e) {
|
|
1078
|
-
return Array.from({ length: Math.ceil(e.length / 7) }, (t, n) => e.slice(n * 7, n * 7 + 7));
|
|
1079
|
-
}
|
|
1080
|
-
var Z = {
|
|
1081
|
-
root: "_root_1mb26_1",
|
|
1082
|
-
root__head: "_root__head_1mb26_11",
|
|
1083
|
-
root__weekday: "_root__weekday_1mb26_21",
|
|
1084
|
-
root__body: "_root__body_1mb26_31",
|
|
1085
|
-
root__viewport: "_root__viewport_1mb26_37",
|
|
1086
|
-
root__week: "_root__week_1mb26_21",
|
|
1087
|
-
root__day: "_root__day_1mb26_62",
|
|
1088
|
-
root__day_isOver: "_root__day_isOver_1mb26_86",
|
|
1089
|
-
root__dayNumber: "_root__dayNumber_1mb26_100",
|
|
1090
|
-
root__event: "_root__event_1mb26_122",
|
|
1091
|
-
root__event_span: "_root__event_span_1mb26_155",
|
|
1092
|
-
root__event_continuesBefore: "_root__event_continuesBefore_1mb26_161",
|
|
1093
|
-
root__event_continuesAfter: "_root__event_continuesAfter_1mb26_167",
|
|
1094
|
-
root__event_isResizing: "_root__event_isResizing_1mb26_173",
|
|
1095
|
-
root__event_isResizeSource: "_root__event_isResizeSource_1mb26_177",
|
|
1096
|
-
root__resize: "_root__resize_1mb26_182",
|
|
1097
|
-
root__resizeStart: "_root__resizeStart_1mb26_192",
|
|
1098
|
-
root__resizeEnd: "_root__resizeEnd_1mb26_196",
|
|
1099
|
-
root_isResizing: "_root_isResizing_1mb26_200",
|
|
1100
|
-
root__event_isDragging: "_root__event_isDragging_1mb26_205",
|
|
1101
|
-
root__dragOverlay: "_root__dragOverlay_1mb26_210",
|
|
1102
|
-
root__more: "_root__more_1mb26_235"
|
|
1103
|
-
};
|
|
1104
|
-
// src/components/month-view/MonthViewDay.tsx
|
|
1105
|
-
function Qt(e) {
|
|
1106
|
-
let { ref: t, targetDate: n, children: r, onDoubleClick: a, ...o } = e, { onEventChange: s, onEventCreate: c, getIsDayDisabled: l, disabled: d, eventMap: f } = J(), p = K(), { getHours: m, getMinutes: h, getNow: g } = p, _ = u(null), { register: v, isOver: y } = Pe(({ registerDropTarget: e, isOver: t }) => ({
|
|
1107
|
-
register: e,
|
|
1108
|
-
isOver: t(_.current)
|
|
1109
|
-
}));
|
|
1110
|
-
i(() => {
|
|
1111
|
-
let e = _.current;
|
|
1112
|
-
if (e) return v(e, {
|
|
1113
|
-
data: { date: n },
|
|
1114
|
-
onDrop: async (e) => {
|
|
1115
|
-
let [t] = await Promise.all(e.items.filter((e) => e.kind === "text" && e.types.has("event") && "getText" in e).map(async (e) => {
|
|
1116
|
-
let t = await e.getText("event");
|
|
1117
|
-
return JSON.parse(t);
|
|
1118
|
-
})), r = t && f.get(t.key);
|
|
1119
|
-
if (!r) return;
|
|
1120
|
-
let i = p.fromMillis(t.day ?? t.date), a = Ae(p, i, n) / 1440;
|
|
1121
|
-
a !== 0 && s(r.key, p.addDays(p.getStartOfDay(r.date), a), {
|
|
1122
|
-
from: m(r.date) * 60 + h(r.date),
|
|
1123
|
-
duration: r.duration
|
|
1124
|
-
});
|
|
1125
|
-
},
|
|
1126
|
-
getDropOperationForPoint: (e, t) => d || !e.has("event") || l && l(n) ? "cancel" : t[0]
|
|
1127
|
-
});
|
|
1128
|
-
}, [
|
|
1129
|
-
p,
|
|
1130
|
-
d,
|
|
1131
|
-
f,
|
|
1132
|
-
m,
|
|
1133
|
-
l,
|
|
1134
|
-
h,
|
|
1135
|
-
s,
|
|
1136
|
-
v,
|
|
1137
|
-
n
|
|
1138
|
-
]);
|
|
1139
|
-
let b = q((e) => {
|
|
1140
|
-
if (a?.(e), e.defaultPrevented || d || l && l(n)) return;
|
|
1141
|
-
let t = g();
|
|
1142
|
-
c(n, {
|
|
1143
|
-
from: m(t) * 60 + h(t),
|
|
1144
|
-
duration: 60
|
|
1145
|
-
});
|
|
1146
|
-
}), x = dt(_, t);
|
|
1147
|
-
return /* @__PURE__ */ W("div", {
|
|
1148
|
-
...o,
|
|
1149
|
-
ref: x,
|
|
1150
|
-
onDoubleClick: b,
|
|
1151
|
-
className: O(o.className, Z.root__day, { [Z.root__day_isOver]: y }),
|
|
1152
|
-
children: r
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
|
-
// src/hooks/useInterval.ts
|
|
1156
|
-
function $t() {
|
|
1157
|
-
let e = u(null);
|
|
1158
|
-
return [n((t, n) => {
|
|
1159
|
-
e.current = setInterval(t, n);
|
|
1160
|
-
}, []), n(() => {
|
|
1161
|
-
e.current !== null && (clearInterval(e.current), e.current = null);
|
|
1162
|
-
}, [])];
|
|
1163
|
-
}
|
|
1164
|
-
// src/hooks/useScrollIntent.ts
|
|
1165
|
-
var en = {
|
|
1166
|
-
x: {
|
|
1167
|
-
[-1]: !1,
|
|
1168
|
-
1: !1
|
|
1169
|
-
},
|
|
1170
|
-
y: {
|
|
1171
|
-
[-1]: !1,
|
|
1172
|
-
1: !1
|
|
1173
|
-
}
|
|
1174
|
-
};
|
|
1175
|
-
function tn({ delta: e, disabled: t }) {
|
|
1176
|
-
let n = gt(e);
|
|
1177
|
-
return Ze((r) => {
|
|
1178
|
-
if (t || !n || !r) return en;
|
|
1179
|
-
let i = {
|
|
1180
|
-
x: Math.sign(e.x - n.x),
|
|
1181
|
-
y: Math.sign(e.y - n.y)
|
|
1182
|
-
};
|
|
1183
|
-
return {
|
|
1184
|
-
x: {
|
|
1185
|
-
[-1]: r.x[-1] || i.x === -1,
|
|
1186
|
-
1: r.x[1] || i.x === 1
|
|
1187
|
-
},
|
|
1188
|
-
y: {
|
|
1189
|
-
[-1]: r.y[-1] || i.y === -1,
|
|
1190
|
-
1: r.y[1] || i.y === 1
|
|
1191
|
-
}
|
|
1192
|
-
};
|
|
1193
|
-
}, [
|
|
1194
|
-
t,
|
|
1195
|
-
e,
|
|
1196
|
-
n
|
|
1197
|
-
]);
|
|
1198
|
-
}
|
|
1199
|
-
// src/hooks/useAutoScroller.ts
|
|
1200
|
-
function nn(e) {
|
|
1201
|
-
let { acceleration: t, activator: r = 0, canScroll: a, enabled: o, interval: s = 5, pointerCoordinates: l, order: d = 0, delta: f, threshold: p, activeNodeRect: m, scrollableAncestors: h, scrollableAncestorsRects: g } = e, [_, v] = $t(), y = tn({
|
|
1202
|
-
delta: f,
|
|
1203
|
-
disabled: !o
|
|
1204
|
-
}), b = u({
|
|
1205
|
-
x: 0,
|
|
1206
|
-
y: 0
|
|
1207
|
-
}), x = u({
|
|
1208
|
-
x: 0,
|
|
1209
|
-
y: 0
|
|
1210
|
-
}), S = u(null), C = c(() => d === 0 ? [[...h].reverse(), [...g].reverse()] : [[...h], [...g]], [
|
|
1211
|
-
d,
|
|
1212
|
-
h,
|
|
1213
|
-
g
|
|
1214
|
-
]), w = c(() => {
|
|
1215
|
-
switch (r) {
|
|
1216
|
-
case 0: return l ? {
|
|
1217
|
-
top: l.y,
|
|
1218
|
-
bottom: l.y,
|
|
1219
|
-
left: l.x,
|
|
1220
|
-
right: l.x
|
|
1221
|
-
} : null;
|
|
1222
|
-
case 1: return m;
|
|
1223
|
-
}
|
|
1224
|
-
}, [
|
|
1225
|
-
r,
|
|
1226
|
-
m,
|
|
1227
|
-
l
|
|
1228
|
-
]), T = n(() => {
|
|
1229
|
-
let e = S.current;
|
|
1230
|
-
if (!e) return;
|
|
1231
|
-
let t = b.current.x * x.current.x, n = b.current.y * x.current.y;
|
|
1232
|
-
e.scrollBy(t, n);
|
|
1233
|
-
}, []);
|
|
1234
|
-
i(() => {
|
|
1235
|
-
let [e, n] = C;
|
|
1236
|
-
if (!o || !e.length || !w) v();
|
|
1237
|
-
else {
|
|
1238
|
-
for (let [r, i] of e.entries()) {
|
|
1239
|
-
if (!i || a?.(i) === !1) continue;
|
|
1240
|
-
let e = n[r];
|
|
1241
|
-
if (!e) continue;
|
|
1242
|
-
let { direction: o, speed: c } = ne(i, e, w, t, p);
|
|
1243
|
-
for (let e of ["x", "y"]) y[e][o[e]] || (c[e] = 0, o[e] = 0);
|
|
1244
|
-
if (c.x > 0 || c.y > 0) {
|
|
1245
|
-
v(), _(T, s), S.current = i, b.current = c, x.current = o;
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
b.current = {
|
|
1250
|
-
x: 0,
|
|
1251
|
-
y: 0
|
|
1252
|
-
}, x.current = {
|
|
1253
|
-
x: 0,
|
|
1254
|
-
y: 0
|
|
1255
|
-
}, v();
|
|
1256
|
-
}
|
|
1257
|
-
}, [
|
|
1258
|
-
t,
|
|
1259
|
-
T,
|
|
1260
|
-
a,
|
|
1261
|
-
o,
|
|
1262
|
-
s,
|
|
1263
|
-
w,
|
|
1264
|
-
h,
|
|
1265
|
-
C,
|
|
1266
|
-
p,
|
|
1267
|
-
v,
|
|
1268
|
-
_,
|
|
1269
|
-
...Object.entries(w || {}),
|
|
1270
|
-
...Object.entries(y),
|
|
1271
|
-
...Object.entries(p || {})
|
|
1272
|
-
]);
|
|
1273
|
-
}
|
|
1274
|
-
// src/hooks/useMutationObserver.ts
|
|
1275
|
-
function rn(e, t = !1) {
|
|
1276
|
-
let n = u(e);
|
|
1277
|
-
n.current = e;
|
|
1278
|
-
let r = c(() => {
|
|
1279
|
-
if (t || typeof window > "u" || window.MutationObserver === void 0) return;
|
|
1280
|
-
let { MutationObserver: e } = window, { current: r } = n;
|
|
1281
|
-
return new e(r);
|
|
1282
|
-
}, [t]);
|
|
1283
|
-
return i(() => () => r?.disconnect(), [r]), r;
|
|
1284
|
-
}
|
|
1285
|
-
// src/hooks/useRect.ts
|
|
1286
|
-
function an(e, t = F, n) {
|
|
1287
|
-
let [r, i] = l(s, null), a = rn((t) => {
|
|
1288
|
-
if (e) for (let n of t) {
|
|
1289
|
-
let { type: t, target: r } = n;
|
|
1290
|
-
if (t === "childList" && me(r) && r.contains(e)) {
|
|
1291
|
-
i();
|
|
1292
|
-
break;
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}), o = Je(i);
|
|
1296
|
-
return qe(() => {
|
|
1297
|
-
i(), e ? (o?.observe(e), a?.observe(document.body, {
|
|
1298
|
-
childList: !0,
|
|
1299
|
-
subtree: !0
|
|
1300
|
-
})) : (o?.disconnect(), a?.disconnect());
|
|
1301
|
-
}, [
|
|
1302
|
-
e,
|
|
1303
|
-
a,
|
|
1304
|
-
o
|
|
1305
|
-
]), r;
|
|
1306
|
-
function s(r) {
|
|
1307
|
-
if (!e) return null;
|
|
1308
|
-
if (!e.isConnected) return r ?? n ?? null;
|
|
1309
|
-
let i = t(e);
|
|
1310
|
-
return De(i, r) ? r : i;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
// src/hooks/useScrollableAncestors.ts
|
|
1314
|
-
var on = [];
|
|
1315
|
-
function sn(e, t) {
|
|
1316
|
-
let n = u(e), r = c(() => e ? ie(e, t) : on, [e, t]);
|
|
1317
|
-
return i(() => {
|
|
1318
|
-
n.current = e;
|
|
1319
|
-
}, [e]), r;
|
|
1320
|
-
}
|
|
1321
|
-
// src/hooks/useScrollableAncestorsRects.ts
|
|
1322
|
-
var cn = [];
|
|
1323
|
-
function ln(e, t = F) {
|
|
1324
|
-
let [n, r] = l(a, cn), i = Je(r);
|
|
1325
|
-
return e.length > 0 && n === cn && r(), qe(() => {
|
|
1326
|
-
e.length ? e.forEach((e) => i?.observe(e)) : (i?.disconnect(), r());
|
|
1327
|
-
}, [e, i]), n;
|
|
1328
|
-
function a() {
|
|
1329
|
-
return e.length ? e.map((e) => {
|
|
1330
|
-
if (e === document.scrollingElement) {
|
|
1331
|
-
let t = pe(e), n = t.innerWidth, r = t.innerHeight;
|
|
1332
|
-
return {
|
|
1333
|
-
top: 0,
|
|
1334
|
-
left: 0,
|
|
1335
|
-
right: n,
|
|
1336
|
-
bottom: r,
|
|
1337
|
-
width: n,
|
|
1338
|
-
height: r
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
|
-
return new h(t(e), e);
|
|
1342
|
-
}) : cn;
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
// src/hooks/useScrollOffsets.ts
|
|
1346
|
-
function un(e) {
|
|
1347
|
-
let [t, r] = d(null), a = u(e), o = n((e) => {
|
|
1348
|
-
let t = ae(e.target);
|
|
1349
|
-
t && r((e) => e ? (e.set(t, H(t)), new Map(e)) : null);
|
|
1350
|
-
}, []);
|
|
1351
|
-
return i(() => {
|
|
1352
|
-
let t = a.current;
|
|
1353
|
-
if (e !== t) {
|
|
1354
|
-
n(t);
|
|
1355
|
-
let i = e.map((e) => {
|
|
1356
|
-
let t = ae(e);
|
|
1357
|
-
return t ? (t.addEventListener("scroll", o, { passive: !0 }), [t, H(t)]) : null;
|
|
1358
|
-
}).filter((e) => ge(e));
|
|
1359
|
-
r(i.length ? new Map(i) : null), a.current = e;
|
|
1360
|
-
}
|
|
1361
|
-
return () => {
|
|
1362
|
-
n(e), n(t);
|
|
1363
|
-
};
|
|
1364
|
-
function n(e) {
|
|
1365
|
-
e.forEach((e) => {
|
|
1366
|
-
let t = ae(e);
|
|
1367
|
-
t && t.removeEventListener("scroll", o);
|
|
1368
|
-
});
|
|
1369
|
-
}
|
|
1370
|
-
}, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => v(e, t), k) : re(e) : k, [e, t]);
|
|
1371
|
-
}
|
|
1372
|
-
// src/hooks/useScrollOffsetsDelta.ts
|
|
1373
|
-
function dn(e, t = A) {
|
|
1374
|
-
let n = u(null);
|
|
1375
|
-
return i(() => {
|
|
1376
|
-
n.current = null;
|
|
1377
|
-
}, t), i(() => {
|
|
1378
|
-
let t = e !== k;
|
|
1379
|
-
t && !n.current && (n.current = e), !t && n.current && (n.current = null);
|
|
1380
|
-
}, [e]), n.current ? ke(e, n.current) : k;
|
|
1381
|
-
}
|
|
1382
|
-
// src/hooks/useMoveTransform.ts
|
|
1383
|
-
var fn = {
|
|
1384
|
-
Start: "start",
|
|
1385
|
-
Move: "move",
|
|
1386
|
-
Stop: "stop"
|
|
1387
|
-
}, pn = {
|
|
1388
|
-
isActive: !1,
|
|
1389
|
-
initialTranslate: {
|
|
1390
|
-
x: 0,
|
|
1391
|
-
y: 0
|
|
1392
|
-
},
|
|
1393
|
-
translate: {
|
|
1394
|
-
x: 0,
|
|
1395
|
-
y: 0
|
|
1396
|
-
},
|
|
1397
|
-
delta: {
|
|
1398
|
-
x: 0,
|
|
1399
|
-
y: 0
|
|
1400
|
-
},
|
|
1401
|
-
context: null
|
|
1402
|
-
};
|
|
1403
|
-
function mn({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
|
|
1404
|
-
let [i, a] = l(hn, pn), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = an(i.isActive ? o : null), d = an(i.isActive ? s : null), f = sn(i.isActive ? o : null), p = ln(f), m = dn(un(f)), h = c(() => {
|
|
1405
|
-
let e = (e) => (t, n) => {
|
|
1406
|
-
a({
|
|
1407
|
-
type: e,
|
|
1408
|
-
coordinates: t,
|
|
1409
|
-
context: n
|
|
1410
|
-
});
|
|
1411
|
-
};
|
|
1412
|
-
return {
|
|
1413
|
-
start: e(fn.Start),
|
|
1414
|
-
move: e(fn.Move),
|
|
1415
|
-
stop: e(fn.Stop)
|
|
1416
|
-
};
|
|
1417
|
-
}, []), g = v(i.initialTranslate, i.translate);
|
|
1418
|
-
nn({
|
|
1419
|
-
delta: i.translate,
|
|
1420
|
-
enabled: e && i.isActive,
|
|
1421
|
-
activeNodeRect: u,
|
|
1422
|
-
pointerCoordinates: g,
|
|
1423
|
-
scrollableAncestors: f,
|
|
1424
|
-
scrollableAncestorsRects: p
|
|
1425
|
-
});
|
|
1426
|
-
let _ = v(i.translate, m), x = y(u, m), S = y(d, m), C = b(t, {
|
|
1427
|
-
delta: i.delta,
|
|
1428
|
-
transform: {
|
|
1429
|
-
...i.translate,
|
|
1430
|
-
left: i.translate.x,
|
|
1431
|
-
top: i.translate.y,
|
|
1432
|
-
height: u?.height || 0,
|
|
1433
|
-
width: u?.width || 0
|
|
1434
|
-
},
|
|
1435
|
-
context: i.context,
|
|
1436
|
-
activeNodeRect: u,
|
|
1437
|
-
containerNodeRect: d,
|
|
1438
|
-
translate: _,
|
|
1439
|
-
initialTranslate: i.initialTranslate
|
|
1440
|
-
});
|
|
1441
|
-
return [
|
|
1442
|
-
{
|
|
1443
|
-
context: i.context,
|
|
1444
|
-
isActive: i.currentAction === "move",
|
|
1445
|
-
transform: C,
|
|
1446
|
-
translate: i.translate,
|
|
1447
|
-
initialTranslate: i.initialTranslate,
|
|
1448
|
-
containerNodeRect: d,
|
|
1449
|
-
activeNodeRect: u,
|
|
1450
|
-
delta: i.delta
|
|
1451
|
-
},
|
|
1452
|
-
h,
|
|
1453
|
-
{
|
|
1454
|
-
pointerCoordinates: g,
|
|
1455
|
-
scrollAdjustmentActiveNodeRect: x,
|
|
1456
|
-
scrollAdjustmentContainerNodeRect: S
|
|
1457
|
-
}
|
|
1458
|
-
];
|
|
1459
|
-
}
|
|
1460
|
-
function hn(e, t) {
|
|
1461
|
-
let n = {
|
|
1462
|
-
[fn.Start]: (e, { coordinates: t, context: n }) => ({
|
|
1463
|
-
...e,
|
|
1464
|
-
isActive: !0,
|
|
1465
|
-
currentAction: fn.Start,
|
|
1466
|
-
initialTranslate: { ...t },
|
|
1467
|
-
context: n
|
|
1468
|
-
}),
|
|
1469
|
-
[fn.Move]: (e, { coordinates: t }) => ({
|
|
1470
|
-
...e,
|
|
1471
|
-
currentAction: fn.Move,
|
|
1472
|
-
translate: {
|
|
1473
|
-
x: t.x - e.initialTranslate.x,
|
|
1474
|
-
y: t.y - e.initialTranslate.y
|
|
1475
|
-
},
|
|
1476
|
-
delta: {
|
|
1477
|
-
x: t.x - (e.translate.x + e.initialTranslate.x),
|
|
1478
|
-
y: t.y - (e.translate.y + e.initialTranslate.y)
|
|
1479
|
-
}
|
|
1480
|
-
}),
|
|
1481
|
-
[fn.Stop]: () => ({
|
|
1482
|
-
...pn,
|
|
1483
|
-
currentAction: fn.Stop
|
|
1484
|
-
})
|
|
1485
|
-
};
|
|
1486
|
-
return ve(t.type, n, e, t);
|
|
1487
|
-
}
|
|
1488
|
-
// src/components/month-view/MonthViewEvent.tsx
|
|
1489
|
-
var gn = 6;
|
|
1490
|
-
function _n(e) {
|
|
1491
|
-
let { ref: t, eventData: n, weekDays: r, weekRef: a, resizable: o = !1, resize: s, isResizeSource: c = !1, isAnyResizing: l = !1, children: d, ...f } = e, { disabled: m } = J(), h = K(), { viewportRef: g } = Wt(), _ = u(null), v = u(null), { attributes: y, isDragging: b, overElement: x, register: S, setOverlayTransform: C } = Pe(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
|
|
1492
|
-
let a = i(_.current), [o] = a ? [...n.dropTargets].pop() ?? [null] : [null];
|
|
1493
|
-
return {
|
|
1494
|
-
attributes: t.attributes,
|
|
1495
|
-
isDragging: a,
|
|
1496
|
-
overElement: o,
|
|
1497
|
-
register: e,
|
|
1498
|
-
setOverlayTransform: r
|
|
1499
|
-
};
|
|
1500
|
-
}), w = an(b ? x : null), [{ transform: T, context: E }, D] = mn({
|
|
1501
|
-
autoScrollEnabled: !1,
|
|
1502
|
-
activeNode: () => _.current,
|
|
1503
|
-
containerNode: () => g.current,
|
|
1504
|
-
modifiers: [function({ activeNodeRect: e, containerNodeRect: t, transform: n, translate: r, initialTranslate: i }) {
|
|
1505
|
-
if (!t || !e || !w) return n;
|
|
1506
|
-
n.x = r.x + i.x - t.left, n.y = r.y + i.y - t.top, n.left = w.left - t.left + gn, n.width = w.width - 12, n.height = e.height;
|
|
1507
|
-
let a = e.top + r.y, o = w.top + p.header, s = w.top + w.height - e.height;
|
|
1508
|
-
return n.top = Math.max(o, Math.min(a, s)) - t.top, n;
|
|
1509
|
-
}]
|
|
1510
|
-
}), k = q((e) => {
|
|
1511
|
-
E === "overlay" && x && C(e);
|
|
1512
|
-
});
|
|
1513
|
-
i(() => {
|
|
1514
|
-
k(T);
|
|
1515
|
-
}, [k, ...Object.values(T)]);
|
|
1516
|
-
let A = q(() => {
|
|
1517
|
-
let e = v.current ?? r[n.column], t = {
|
|
1518
|
-
...n,
|
|
1519
|
-
date: h.toMillis(n.date),
|
|
1520
|
-
day: e && h.toMillis(e)
|
|
1521
|
-
};
|
|
1522
|
-
return [{ event: JSON.stringify(t) }];
|
|
1523
|
-
});
|
|
1524
|
-
i(() => {
|
|
1525
|
-
if (_.current && !m) return S(_.current, {
|
|
1526
|
-
getItems: A,
|
|
1527
|
-
onDragStart(e) {
|
|
1528
|
-
D.start({
|
|
1529
|
-
x: e.x,
|
|
1530
|
-
y: e.y
|
|
1531
|
-
}, "overlay");
|
|
1532
|
-
},
|
|
1533
|
-
onDragMove(e) {
|
|
1534
|
-
D.move({
|
|
1535
|
-
x: e.x,
|
|
1536
|
-
y: e.y
|
|
1537
|
-
});
|
|
1538
|
-
},
|
|
1539
|
-
onDragEnd(e) {
|
|
1540
|
-
D.stop({
|
|
1541
|
-
x: e.x,
|
|
1542
|
-
y: e.y
|
|
1543
|
-
});
|
|
1544
|
-
},
|
|
1545
|
-
getAllowedDropOperations() {
|
|
1546
|
-
return ["move"];
|
|
1547
|
-
}
|
|
1548
|
-
});
|
|
1549
|
-
}, [
|
|
1550
|
-
D,
|
|
1551
|
-
m,
|
|
1552
|
-
A,
|
|
1553
|
-
S
|
|
1554
|
-
]);
|
|
1555
|
-
let j = (e) => {
|
|
1556
|
-
e.stopPropagation();
|
|
1557
|
-
let t = a.current;
|
|
1558
|
-
if (!t) return;
|
|
1559
|
-
let i = t.getBoundingClientRect(), o = Math.floor((e.clientX - i.left) / i.width * r.length), s = Math.min(Math.max(o, n.column), n.column + n.span - 1);
|
|
1560
|
-
v.current = r[s] ?? null;
|
|
1561
|
-
}, M = (e) => ({
|
|
1562
|
-
onMoveStart: () => (s?.start(n.key, e), !0),
|
|
1563
|
-
onMove: (e) => s?.move(e.clientX, e.clientY),
|
|
1564
|
-
onMoveEnd: () => s?.end()
|
|
1565
|
-
}), { listeners: N } = ft(M("start")), { listeners: ee } = ft(M("end")), P = dt(_, t), F = n.span > 1 || !n.isStart || !n.isEnd, I = Xt({
|
|
1566
|
-
"--ww-column": n.column + 1,
|
|
1567
|
-
"--ww-span": n.span,
|
|
1568
|
-
"--ww-row": n.lane + 2
|
|
1569
|
-
}, f.style);
|
|
1570
|
-
return /* @__PURE__ */ G("div", {
|
|
1571
|
-
...f,
|
|
1572
|
-
...l ? null : y,
|
|
1573
|
-
ref: P,
|
|
1574
|
-
style: I,
|
|
1575
|
-
"data-key": String(n.key),
|
|
1576
|
-
"data-continues-before": n.isStart ? void 0 : "",
|
|
1577
|
-
"data-continues-after": n.isEnd ? void 0 : "",
|
|
1578
|
-
onPointerDown: j,
|
|
1579
|
-
onDoubleClick: (e) => e.stopPropagation(),
|
|
1580
|
-
className: O(f.className, Z.root__event, {
|
|
1581
|
-
[Z.root__event_span]: F,
|
|
1582
|
-
[Z.root__event_continuesBefore]: !n.isStart,
|
|
1583
|
-
[Z.root__event_continuesAfter]: !n.isEnd,
|
|
1584
|
-
[Z.root__event_isDragging]: b,
|
|
1585
|
-
[Z.root__event_isResizeSource]: c
|
|
1586
|
-
}),
|
|
1587
|
-
children: [
|
|
1588
|
-
d,
|
|
1589
|
-
o && n.isStart && /* @__PURE__ */ W("div", {
|
|
1590
|
-
...N,
|
|
1591
|
-
"data-edge": "start",
|
|
1592
|
-
className: O(Z.root__resize, Z.root__resizeStart)
|
|
1593
|
-
}),
|
|
1594
|
-
o && n.isEnd && /* @__PURE__ */ W("div", {
|
|
1595
|
-
...ee,
|
|
1596
|
-
"data-edge": "end",
|
|
1597
|
-
className: O(Z.root__resize, Z.root__resizeEnd)
|
|
1598
|
-
})
|
|
1599
|
-
]
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
// src/components/month-view/MonthViewEventPreview.tsx
|
|
1603
|
-
function vn({ bar: e, children: t }) {
|
|
1604
|
-
return /* @__PURE__ */ W("div", {
|
|
1605
|
-
"aria-hidden": "true",
|
|
1606
|
-
"data-key": String(e.key),
|
|
1607
|
-
"data-continues-before": e.isStart ? void 0 : "",
|
|
1608
|
-
"data-continues-after": e.isEnd ? void 0 : "",
|
|
1609
|
-
className: O(Z.root__event, Z.root__event_isResizing, {
|
|
1610
|
-
[Z.root__event_span]: e.span > 1 || !e.isStart || !e.isEnd,
|
|
1611
|
-
[Z.root__event_continuesBefore]: !e.isStart,
|
|
1612
|
-
[Z.root__event_continuesAfter]: !e.isEnd
|
|
1613
|
-
}),
|
|
1614
|
-
style: Xt({
|
|
1615
|
-
"--ww-column": e.column + 1,
|
|
1616
|
-
"--ww-span": e.span,
|
|
1617
|
-
"--ww-row": e.lane + 2
|
|
1618
|
-
}),
|
|
1619
|
-
children: t
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
// src/components/month-view/MonthViewWeek.tsx
|
|
1623
|
-
function yn(e) {
|
|
1624
|
-
let { days: t, firstDayIndex: n, cellRef: r, layout: i, sourceBars: a, lanes: o, resizingKey: s, resize: c } = e, l = u(null), { viewValue: d, eventRenderer: f, view: p, disabled: m } = J(), { getMonthDay: h, isSameMonth: g, isToday: _, toMillis: v } = K(), y = Ke(), b = s !== void 0, x = (e) => f.current?.(e.value, p, {
|
|
1625
|
-
isStart: e.isStart,
|
|
1626
|
-
isEnd: e.isEnd
|
|
1627
|
-
}), S = (e, n = !1) => /* @__PURE__ */ W(_n, {
|
|
1628
|
-
eventData: e,
|
|
1629
|
-
weekDays: t,
|
|
1630
|
-
weekRef: l,
|
|
1631
|
-
resizable: !m,
|
|
1632
|
-
resize: c,
|
|
1633
|
-
isResizeSource: n,
|
|
1634
|
-
isAnyResizing: b,
|
|
1635
|
-
children: x(e)
|
|
1636
|
-
}, e.key);
|
|
1637
|
-
return /* @__PURE__ */ G("div", {
|
|
1638
|
-
ref: l,
|
|
1639
|
-
className: Z.root__week,
|
|
1640
|
-
children: [
|
|
1641
|
-
t.map((e, t) => /* @__PURE__ */ W(Qt, {
|
|
1642
|
-
ref: r(n + t),
|
|
1643
|
-
targetDate: e,
|
|
1644
|
-
"data-day-index": n + t,
|
|
1645
|
-
"data-is-outside": !g(e, d) || void 0,
|
|
1646
|
-
"data-is-today": _(e) ? !0 : void 0,
|
|
1647
|
-
style: Xt({ "--ww-column": t + 1 }),
|
|
1648
|
-
children: /* @__PURE__ */ W("span", {
|
|
1649
|
-
className: Z.root__dayNumber,
|
|
1650
|
-
children: h(e)
|
|
1651
|
-
})
|
|
1652
|
-
}, v(e))),
|
|
1653
|
-
[...i.bars.map((e) => e.key === s ? /* @__PURE__ */ W(vn, {
|
|
1654
|
-
bar: e,
|
|
1655
|
-
children: x(e)
|
|
1656
|
-
}, `preview-${e.key}`) : S(e)), ...a.map((e) => S(e, !0))],
|
|
1657
|
-
t.map((e, t) => i.hidden[t] > 0 && /* @__PURE__ */ W("span", {
|
|
1658
|
-
className: Z.root__more,
|
|
1659
|
-
style: Xt({
|
|
1660
|
-
"--ww-column": t + 1,
|
|
1661
|
-
"--ww-row": o + 2
|
|
1662
|
-
}),
|
|
1663
|
-
children: y.more(i.hidden[t])
|
|
1664
|
-
}, `more-${v(e)}`))
|
|
1665
|
-
]
|
|
1666
|
-
});
|
|
1667
|
-
}
|
|
1668
|
-
// src/components/month-view/useMonthLanes.ts
|
|
1669
|
-
function bn(e, t) {
|
|
1670
|
-
let [n, r] = d(t), i = () => {
|
|
1671
|
-
let n = e.current?.firstElementChild;
|
|
1672
|
-
n?.clientHeight && r(z(n.clientHeight, t));
|
|
1673
|
-
}, a = Je(i);
|
|
1674
|
-
return qe(() => {
|
|
1675
|
-
i();
|
|
1676
|
-
let t = e.current?.firstElementChild;
|
|
1677
|
-
return t && a?.observe(t), () => {
|
|
1678
|
-
t && a?.unobserve(t);
|
|
1679
|
-
};
|
|
1680
|
-
}, [a, t]), n;
|
|
1681
|
-
}
|
|
1682
|
-
// src/components/month-view/useMonthResize.ts
|
|
1683
|
-
function xn(e) {
|
|
1684
|
-
let { days: t, viewportRef: n, cellsRef: r, dateUtils: i, eventMap: a, disabled: o, getIsDayDisabled: s, onEventChange: l } = e, [u, d, f] = xt(null), { addGlobalListener: p, removeAllGlobalListeners: m } = ot(), h = st(n, r), g = q((e = !0) => {
|
|
1685
|
-
let t = f.current;
|
|
1686
|
-
t && (m(), h.release(), d(null), e && t.result && l(t.key, t.result.date, t.result.info));
|
|
1687
|
-
}), _ = q((e) => {
|
|
1688
|
-
e.key === "Escape" && g(!1);
|
|
1689
|
-
}), v = q((e, t) => {
|
|
1690
|
-
o || f.current || (h.measure(), d({
|
|
1691
|
-
key: e,
|
|
1692
|
-
edge: t,
|
|
1693
|
-
result: null
|
|
1694
|
-
}), p(document, "keydown", _, !0));
|
|
1695
|
-
}), y = q((e, n) => {
|
|
1696
|
-
let r = f.current, o = r && a.get(r.key), c = t[h.nearestIndex(e, n)];
|
|
1697
|
-
r && o && c && !s?.(c) && d({
|
|
1698
|
-
...r,
|
|
1699
|
-
result: Se(i, o, r.edge, c)
|
|
1700
|
-
});
|
|
1701
|
-
}), b = c(() => ({
|
|
1702
|
-
start: v,
|
|
1703
|
-
move: y,
|
|
1704
|
-
end: g
|
|
1705
|
-
}), [
|
|
1706
|
-
g,
|
|
1707
|
-
y,
|
|
1708
|
-
v
|
|
1709
|
-
]), x = c(() => {
|
|
1710
|
-
let e = u?.result && a.get(u.key);
|
|
1711
|
-
if (!u?.result || !e) return a;
|
|
1712
|
-
let [t] = I(i, u.result.date, u.result.info);
|
|
1713
|
-
return new Map(a).set(u.key, {
|
|
1714
|
-
...e,
|
|
1715
|
-
date: t,
|
|
1716
|
-
duration: u.result.info.duration
|
|
1717
|
-
});
|
|
1718
|
-
}, [
|
|
1719
|
-
i,
|
|
1720
|
-
a,
|
|
1721
|
-
u
|
|
1722
|
-
]);
|
|
1723
|
-
return {
|
|
1724
|
-
resizingKey: u?.key,
|
|
1725
|
-
actions: b,
|
|
1726
|
-
eventMap: x
|
|
1727
|
-
};
|
|
1728
|
-
}
|
|
1729
|
-
// src/components/month-view/MonthView.tsx
|
|
1730
|
-
var Sn = [];
|
|
1731
|
-
function Cn(e) {
|
|
1732
|
-
let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } = J(), f = K();
|
|
1733
|
-
wt();
|
|
1734
|
-
let p = u(null), m = _t(), h = c(() => R(f, i, o), [
|
|
1735
|
-
f,
|
|
1736
|
-
o,
|
|
1737
|
-
i
|
|
1738
|
-
]), g = c(() => Zt(h), [h]), _ = c(() => fe(f, o), [f, o]), v = xn({
|
|
1739
|
-
days: h,
|
|
1740
|
-
viewportRef: p,
|
|
1741
|
-
cellsRef: m.elements,
|
|
1742
|
-
dateUtils: f,
|
|
1743
|
-
eventMap: a,
|
|
1744
|
-
disabled: s,
|
|
1745
|
-
getIsDayDisabled: l,
|
|
1746
|
-
onEventChange: d
|
|
1747
|
-
}), y = bn(p, 3), b = c(() => g.map((e) => S(a, f, e, y)), [
|
|
1748
|
-
f,
|
|
1749
|
-
a,
|
|
1750
|
-
y,
|
|
1751
|
-
g
|
|
1752
|
-
]), x = c(() => v.eventMap === a ? b : g.map((e) => S(v.eventMap, f, e, y)), [
|
|
1753
|
-
f,
|
|
1754
|
-
a,
|
|
1755
|
-
y,
|
|
1756
|
-
b,
|
|
1757
|
-
v.eventMap,
|
|
1758
|
-
g
|
|
1759
|
-
]), C = c(() => ({ viewportRef: p }), []);
|
|
1760
|
-
return /* @__PURE__ */ G(Ut.Provider, {
|
|
1761
|
-
value: C,
|
|
1762
|
-
children: [/* @__PURE__ */ G("div", {
|
|
1763
|
-
...r,
|
|
1764
|
-
className: O(t, Z.root, { [Z.root_isResizing]: v.resizingKey !== void 0 }),
|
|
1765
|
-
style: Xt({ "--ww-month-lanes": y }, n),
|
|
1766
|
-
children: [/* @__PURE__ */ W("div", {
|
|
1767
|
-
className: Z.root__head,
|
|
1768
|
-
children: _.map((e) => /* @__PURE__ */ W("div", {
|
|
1769
|
-
className: Z.root__weekday,
|
|
1770
|
-
children: e
|
|
1771
|
-
}, e))
|
|
1772
|
-
}), /* @__PURE__ */ W("div", {
|
|
1773
|
-
className: Z.root__body,
|
|
1774
|
-
children: /* @__PURE__ */ W("div", {
|
|
1775
|
-
ref: p,
|
|
1776
|
-
className: Z.root__viewport,
|
|
1777
|
-
children: g.map((e, t) => /* @__PURE__ */ W(yn, {
|
|
1778
|
-
days: e,
|
|
1779
|
-
firstDayIndex: t * 7,
|
|
1780
|
-
cellRef: m.refAt,
|
|
1781
|
-
layout: x[t],
|
|
1782
|
-
sourceBars: v.resizingKey === void 0 ? Sn : b[t].bars.filter((e) => e.key === v.resizingKey),
|
|
1783
|
-
lanes: y,
|
|
1784
|
-
resizingKey: v.resizingKey,
|
|
1785
|
-
resize: v.actions
|
|
1786
|
-
}, f.toMillis(e[0])))
|
|
1787
|
-
})
|
|
1788
|
-
})]
|
|
1789
|
-
}), /* @__PURE__ */ W(Yt, {
|
|
1790
|
-
className: Z.root__dragOverlay,
|
|
1791
|
-
showPreview: !1
|
|
1792
|
-
})]
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
// src/hooks/useEventResize.ts
|
|
1796
|
-
var wn = 1440;
|
|
1797
|
-
function Tn(e) {
|
|
1798
|
-
let { days: t, viewportRef: r, columnsRef: i, dateUtils: a, bounds: o, timeStep: s, preventOutBoundsChanges: l } = e, [f, p] = d(null), m = u(null), { addGlobalListener: h, removeGlobalListener: g } = ot(), _ = st(r, i), v = u(e);
|
|
1799
|
-
v.current = e;
|
|
1800
|
-
let y = o.hideMinMaxTime ? o.hourMin * 60 : 0, b = o.hideMinMaxTime ? (o.hourMax - o.hourMin) * 60 : wn, x = n((e, n) => {
|
|
1801
|
-
let r = m.current, i = _.container();
|
|
1802
|
-
if (!r || !i) return;
|
|
1803
|
-
r.x = e, r.y = n;
|
|
1804
|
-
let { disabled: c, getIsDayDisabled: u } = v.current, d = ((e) => Math.round(e / s) * s)(Math.min(Math.max((n - i.top) / i.height * b, 0), b)), f = Math.max(_.nearestIndex(e, n, "x"), 0), h = Ce({
|
|
1805
|
-
start: r.original[0],
|
|
1806
|
-
end: r.original[1]
|
|
1807
|
-
}, r.edge, f, d, {
|
|
1808
|
-
dayCount: t.length,
|
|
1809
|
-
bounds: o,
|
|
1810
|
-
timeStep: s,
|
|
1811
|
-
crossDays: !l || o.hourMin <= 0 && o.hourMax >= 24,
|
|
1812
|
-
getFrame: (e) => {
|
|
1813
|
-
if (!l) return [0, b];
|
|
1814
|
-
let [n, r] = oe(a, t[e], o);
|
|
1815
|
-
return [Math.ceil(n / s) * s, Math.min(Math.ceil(r / s) * s, b)];
|
|
1816
|
-
},
|
|
1817
|
-
canEditDay: (e) => !c && !u?.(t[e]) && !(l && _e(a, t[e]))
|
|
1818
|
-
});
|
|
1819
|
-
h && (r.range = h), p({
|
|
1820
|
-
key: r.key,
|
|
1821
|
-
range: r.range,
|
|
1822
|
-
x: e,
|
|
1823
|
-
y: n,
|
|
1824
|
-
blocked: !h
|
|
1825
|
-
});
|
|
1826
|
-
}, [
|
|
1827
|
-
o,
|
|
1828
|
-
a,
|
|
1829
|
-
t,
|
|
1830
|
-
_,
|
|
1831
|
-
l,
|
|
1832
|
-
s,
|
|
1833
|
-
b
|
|
1834
|
-
]), S = q(() => {
|
|
1835
|
-
let e = m.current;
|
|
1836
|
-
e && x(e.x, e.y);
|
|
1837
|
-
}), C = c(() => ({
|
|
1838
|
-
start(e, n, r, i) {
|
|
1839
|
-
let o = v.current.eventMap.get(e);
|
|
1840
|
-
if (!o || !t[0] || !_.measure()) return;
|
|
1841
|
-
let s = Ae(a, t[0], o.date), c = [s, s + o.duration];
|
|
1842
|
-
m.current = {
|
|
1843
|
-
key: e,
|
|
1844
|
-
edge: n,
|
|
1845
|
-
original: c,
|
|
1846
|
-
range: c,
|
|
1847
|
-
x: r,
|
|
1848
|
-
y: i
|
|
1849
|
-
}, h(document, "scroll", S, !0), p({
|
|
1850
|
-
key: e,
|
|
1851
|
-
range: c,
|
|
1852
|
-
x: r,
|
|
1853
|
-
y: i,
|
|
1854
|
-
blocked: !1
|
|
1855
|
-
});
|
|
1856
|
-
},
|
|
1857
|
-
move: x,
|
|
1858
|
-
end() {
|
|
1859
|
-
let e = m.current;
|
|
1860
|
-
if (m.current = null, g(document, "scroll", S, !0), _.release(), p(null), !e) return;
|
|
1861
|
-
let [n, r] = e.range;
|
|
1862
|
-
if (n === e.original[0] && r === e.original[1]) return;
|
|
1863
|
-
let i = Math.floor(n / wn);
|
|
1864
|
-
v.current.onEventChange(e.key, ee(a, t[0], i * wn), {
|
|
1865
|
-
from: n - i * wn,
|
|
1866
|
-
duration: r - n
|
|
1867
|
-
});
|
|
1868
|
-
}
|
|
1869
|
-
}), [
|
|
1870
|
-
h,
|
|
1871
|
-
a,
|
|
1872
|
-
t,
|
|
1873
|
-
S,
|
|
1874
|
-
_,
|
|
1875
|
-
g,
|
|
1876
|
-
x
|
|
1877
|
-
]);
|
|
1878
|
-
return tt(f?.blocked ? "not-allowed" : null), {
|
|
1879
|
-
state: f,
|
|
1880
|
-
actions: C,
|
|
1881
|
-
previewOf: (e) => {
|
|
1882
|
-
let n = Math.floor(e[0] / wn);
|
|
1883
|
-
return {
|
|
1884
|
-
date: ee(a, t[0], n * wn),
|
|
1885
|
-
top: e[0] - n * wn - y,
|
|
1886
|
-
duration: e[1] - e[0]
|
|
1887
|
-
};
|
|
1888
|
-
}
|
|
1889
|
-
};
|
|
1890
|
-
}
|
|
1891
|
-
// src/contexts/DayWeekViewContext.ts
|
|
1892
|
-
var En = e(void 0);
|
|
1893
|
-
U && (En.displayName = "DayWeekViewContext");
|
|
1894
|
-
function Dn() {
|
|
1895
|
-
let e = r(En);
|
|
1896
|
-
if (!e) throw Error("DayWeekViewContext is required");
|
|
1897
|
-
return e;
|
|
1898
|
-
}
|
|
1899
|
-
// src/contexts/DayWeekDrawerContext.ts
|
|
1900
|
-
var On = e(void 0);
|
|
1901
|
-
U && (On.displayName = "DayWeekDrawerContext");
|
|
1902
|
-
function kn() {
|
|
1903
|
-
let e = r(On);
|
|
1904
|
-
if (!e) throw Error("DayWeekDrawerContext is required: render the event inside a DayWeekDrawer");
|
|
1905
|
-
return e;
|
|
1906
|
-
}
|
|
1907
|
-
// src/hooks/useTimeOffset.ts
|
|
1908
|
-
function An(e = !0, t = 6e4) {
|
|
1909
|
-
let { hideMinMaxTime: n, hourMin: r, hourMax: i } = J(), a = K(), [o, s] = d(null);
|
|
1910
|
-
return St(() => s(Date.now()), t, e), c(() => o === null ? [0, !0] : V(a, {
|
|
1911
|
-
hourMin: r,
|
|
1912
|
-
hourMax: i,
|
|
1913
|
-
hideMinMaxTime: n
|
|
1914
|
-
}), [
|
|
1915
|
-
o,
|
|
1916
|
-
a,
|
|
1917
|
-
r,
|
|
1918
|
-
i,
|
|
1919
|
-
n
|
|
1920
|
-
]);
|
|
1921
|
-
}
|
|
1922
|
-
var jn = {
|
|
1923
|
-
root: "_root_1d4hh_1",
|
|
1924
|
-
root_timeLimit: "_root_timeLimit_1d4hh_12",
|
|
1925
|
-
root_isToday: "_root_isToday_1d4hh_12",
|
|
1926
|
-
root_isPast: "_root_isPast_1d4hh_22",
|
|
1927
|
-
root__container: "_root__container_1d4hh_40",
|
|
1928
|
-
root__spotlight: "_root__spotlight_1d4hh_61",
|
|
1929
|
-
root__timeLine: "_root__timeLine_1d4hh_71",
|
|
1930
|
-
root_offLimits: "_root_offLimits_1d4hh_125"
|
|
1931
|
-
};
|
|
1932
|
-
// src/components/day-week-drawer/DayWeekDrawer.tsx
|
|
1933
|
-
function Mn(e) {
|
|
1934
|
-
let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } = J(), { viewportRef: m, getTimeFrame: h, pxPerMinute: g } = Dn(), { hideMinMaxTime: v, preventOutBoundsChanges: y, timeStep: b, hourMin: x, hourMax: S, disabled: C } = p, T = K(), { isBefore: E, isToday: D } = T, k = b * g, A = (e) => Nn(e, g, b), j = (e) => h(e).map((e) => e * g), N = u(null), ee = u(null), { register: P, getTransform: F } = Pe(({ registerDropTarget: e, getTransform: t }) => ({
|
|
1935
|
-
register: e,
|
|
1936
|
-
getTransform: t
|
|
1937
|
-
})), I = wt(), L = c(() => {
|
|
1938
|
-
let e = D(n);
|
|
1939
|
-
return {
|
|
1940
|
-
isToday: e,
|
|
1941
|
-
isPast: E(n) && !e
|
|
1942
|
-
};
|
|
1943
|
-
}, [
|
|
1944
|
-
E,
|
|
1945
|
-
D,
|
|
1946
|
-
n,
|
|
1947
|
-
I
|
|
1948
|
-
]), [{ isActive: R, transform: z }, B, { scrollAdjustmentActiveNodeRect: V }] = mn({
|
|
1949
|
-
activeNode: N.current,
|
|
1950
|
-
containerNode: N.current,
|
|
1951
|
-
modifiers: [
|
|
1952
|
-
function({ activeNodeRect: e, initialTranslate: t, translate: n, transform: r }) {
|
|
1953
|
-
if (!e) return r;
|
|
1954
|
-
let i = t.y - e.top;
|
|
1955
|
-
r.x = r.left + t.x, r.y = r.top + t.y, r.top = Math.floor(i / k) * k, r.height = k, r.left = 0, r.width = e.width;
|
|
1956
|
-
let a;
|
|
1957
|
-
return n.y > 0 ? (a = k - i % k, r.height = Math.ceil((r.height + n.y - a) / k) * k) : (a = i % k, r.height = Math.ceil((r.height - n.y - a) / k) * k, r.top -= r.height - k), r.height = Math.max(r.height, k), r;
|
|
1958
|
-
},
|
|
1959
|
-
function({ transform: e }) {
|
|
1960
|
-
if (!y) return e;
|
|
1961
|
-
let [t, r] = h(n).map((e) => Math.ceil(e / b) * k);
|
|
1962
|
-
return e.top < t && (e.height = Math.max(e.height - (t - e.top), k), e.top = t), e.height + e.top >= r && (e.height = Math.max(r - e.top, k)), e;
|
|
1963
|
-
},
|
|
1964
|
-
w,
|
|
1965
|
-
se(k)
|
|
1966
|
-
]
|
|
1967
|
-
}), [te, H] = An(L.isToday);
|
|
1968
|
-
i(() => {
|
|
1969
|
-
let e = N.current;
|
|
1970
|
-
if (e) return P(e, {
|
|
1971
|
-
data: { date: n },
|
|
1972
|
-
onDrop: async (e) => {
|
|
1973
|
-
let [t] = await Promise.all(e.items.filter((e) => e.kind === "text" && e.types.has("event") && "getText" in e).map(async (e) => {
|
|
1974
|
-
let t = await e.getText("event");
|
|
1975
|
-
return JSON.parse(t);
|
|
1976
|
-
})), r = F(), i = Nn(r.top, g, b), a = Nn(r.height, g, b), s = v ? x * 60 : 0, c = f.get(t.key), l = c ? Ae(T, c.date, c.date) : 0;
|
|
1977
|
-
if (c && l + c.duration > 1440) {
|
|
1978
|
-
if (y && (x > 0 || S < 24)) {
|
|
1979
|
-
B.stop({
|
|
1980
|
-
x: e.x,
|
|
1981
|
-
y: e.y
|
|
1982
|
-
});
|
|
1983
|
-
return;
|
|
1984
|
-
}
|
|
1985
|
-
let r = T.getStartOfDay(T.fromMillis(t.date)), a = Ae(T, c.date, r) + s + t.start - l, u = s + i - a, d = Math.floor(u / 1440);
|
|
1986
|
-
o(t.key, T.addDays(n, d), {
|
|
1987
|
-
from: u - d * 24 * 60,
|
|
1988
|
-
duration: c.duration
|
|
1989
|
-
});
|
|
1990
|
-
} else v ? o(t.key, n, {
|
|
1991
|
-
from: i + x * 60,
|
|
1992
|
-
duration: a
|
|
1993
|
-
}) : o(t.key, n, {
|
|
1994
|
-
from: i,
|
|
1995
|
-
duration: a
|
|
1996
|
-
});
|
|
1997
|
-
B.stop({
|
|
1998
|
-
x: e.x,
|
|
1999
|
-
y: e.y
|
|
2000
|
-
});
|
|
2001
|
-
},
|
|
2002
|
-
getDropOperationForPoint: (e, t) => {
|
|
2003
|
-
if (C || !e.has("event") || l && l(n)) return "cancel";
|
|
2004
|
-
let { isPast: r, isToday: i } = L;
|
|
2005
|
-
if (y) {
|
|
2006
|
-
if (!i && r) return "cancel";
|
|
2007
|
-
let [e, t] = h(n).map((e) => e * g), a = F();
|
|
2008
|
-
if (a.y < e || a.y > t || i && a.height > t - e) return "cancel";
|
|
2009
|
-
}
|
|
2010
|
-
return t[0];
|
|
2011
|
-
}
|
|
2012
|
-
});
|
|
2013
|
-
}, [
|
|
2014
|
-
B,
|
|
2015
|
-
T,
|
|
2016
|
-
C,
|
|
2017
|
-
f,
|
|
2018
|
-
l,
|
|
2019
|
-
h,
|
|
2020
|
-
F,
|
|
2021
|
-
v,
|
|
2022
|
-
S,
|
|
2023
|
-
x,
|
|
2024
|
-
o,
|
|
2025
|
-
y,
|
|
2026
|
-
g,
|
|
2027
|
-
P,
|
|
2028
|
-
n,
|
|
2029
|
-
b,
|
|
2030
|
-
L
|
|
2031
|
-
]);
|
|
2032
|
-
let { listeners: ne, ref: re } = ft({
|
|
2033
|
-
distance: Math.max(Math.min(5, b), 1),
|
|
2034
|
-
touchDelay: _,
|
|
2035
|
-
onMoveStart: (e) => {
|
|
2036
|
-
if (!C) {
|
|
2037
|
-
if (y) {
|
|
2038
|
-
let { isToday: e, isPast: t } = L;
|
|
2039
|
-
if (t && !e) return !1;
|
|
2040
|
-
}
|
|
2041
|
-
B.start({
|
|
2042
|
-
x: e.clientX,
|
|
2043
|
-
y: e.clientY
|
|
2044
|
-
}), e.pointerType === "touch" && B.move({
|
|
2045
|
-
x: e.clientX,
|
|
2046
|
-
y: e.clientY
|
|
2047
|
-
});
|
|
2048
|
-
}
|
|
2049
|
-
},
|
|
2050
|
-
onMove: (e) => {
|
|
2051
|
-
if (R) B.move({
|
|
2052
|
-
x: e.clientX,
|
|
2053
|
-
y: e.clientY
|
|
2054
|
-
});
|
|
2055
|
-
else if (V) {
|
|
2056
|
-
if (y) {
|
|
2057
|
-
let [t, r] = j(n), i = e.clientY - V.top;
|
|
2058
|
-
if (i < t || i > r) {
|
|
2059
|
-
B.stop({
|
|
2060
|
-
x: e.clientX,
|
|
2061
|
-
y: e.clientY
|
|
2062
|
-
});
|
|
2063
|
-
return;
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
R || B.move({
|
|
2067
|
-
x: e.clientX,
|
|
2068
|
-
y: e.clientY
|
|
2069
|
-
});
|
|
2070
|
-
}
|
|
2071
|
-
},
|
|
2072
|
-
onMoveEnd: (e) => {
|
|
2073
|
-
B.stop({
|
|
2074
|
-
x: e.clientX,
|
|
2075
|
-
y: e.clientY
|
|
2076
|
-
}), R && (v ? s(n, {
|
|
2077
|
-
from: A(z.top) + x * 60,
|
|
2078
|
-
duration: A(z.height)
|
|
2079
|
-
}) : s(n, {
|
|
2080
|
-
from: A(z.top),
|
|
2081
|
-
duration: A(z.height)
|
|
2082
|
-
}));
|
|
2083
|
-
}
|
|
2084
|
-
}), ie = c(() => ({
|
|
2085
|
-
drawerRef: N,
|
|
2086
|
-
containerRef: ee
|
|
2087
|
-
}), []), ae = dt(N, re, t), oe = M(T, te, {
|
|
2088
|
-
hourMin: x,
|
|
2089
|
-
hideMinMaxTime: v
|
|
2090
|
-
}), ce = () => d.current?.(n, A(z.top), A(z.height));
|
|
2091
|
-
return /* @__PURE__ */ G("div", {
|
|
2092
|
-
...a,
|
|
2093
|
-
...ne,
|
|
2094
|
-
ref: ae,
|
|
2095
|
-
className: O(a.className, jn.root, {
|
|
2096
|
-
[jn.root_timeLimit]: y,
|
|
2097
|
-
[jn.root_isToday]: L.isToday,
|
|
2098
|
-
[jn.root_isPast]: L.isPast,
|
|
2099
|
-
[jn.root_offLimits]: H
|
|
2100
|
-
}),
|
|
2101
|
-
style: {
|
|
2102
|
-
...a.style,
|
|
2103
|
-
"--offset": te * g
|
|
2104
|
-
},
|
|
2105
|
-
children: [
|
|
2106
|
-
L.isToday && !H && /* @__PURE__ */ W(Ft, {
|
|
2107
|
-
container: m.current,
|
|
2108
|
-
children: /* @__PURE__ */ W("span", {
|
|
2109
|
-
tabIndex: -1,
|
|
2110
|
-
className: jn.root__timeLine,
|
|
2111
|
-
"data-now": oe,
|
|
2112
|
-
style: { "--offset": te * g }
|
|
2113
|
-
})
|
|
2114
|
-
}),
|
|
2115
|
-
/* @__PURE__ */ W("div", {
|
|
2116
|
-
ref: ee,
|
|
2117
|
-
className: jn.root__container,
|
|
2118
|
-
children: /* @__PURE__ */ W(On.Provider, {
|
|
2119
|
-
value: ie,
|
|
2120
|
-
children: r
|
|
2121
|
-
})
|
|
2122
|
-
}),
|
|
2123
|
-
R && /* @__PURE__ */ G(Be, { children: [/* @__PURE__ */ W("div", {
|
|
2124
|
-
className: jn.root__spotlight,
|
|
2125
|
-
style: z ? { ...z } : void 0
|
|
2126
|
-
}), /* @__PURE__ */ W(Kt, {
|
|
2127
|
-
coordinates: {
|
|
2128
|
-
x: z.x,
|
|
2129
|
-
y: z.y
|
|
2130
|
-
},
|
|
2131
|
-
children: ce()
|
|
2132
|
-
})] })
|
|
2133
|
-
]
|
|
2134
|
-
});
|
|
2135
|
-
}
|
|
2136
|
-
function Nn(e, t, n) {
|
|
2137
|
-
return Math.round(e / t / n) * n;
|
|
2138
|
-
}
|
|
2139
|
-
// src/hooks/useAbsEventRect.ts
|
|
2140
|
-
function Pn(e, t, n) {
|
|
2141
|
-
let [r, i] = d(null);
|
|
2142
|
-
return qe(() => {
|
|
2143
|
-
let r = e.current, a = t.current;
|
|
2144
|
-
if (r && a) {
|
|
2145
|
-
let { height: e, width: t, ...o } = F(r), { left: s, top: c } = ke(o, F(a));
|
|
2146
|
-
i(Ee(n, {
|
|
2147
|
-
height: e,
|
|
2148
|
-
width: t,
|
|
2149
|
-
x: s,
|
|
2150
|
-
y: c
|
|
2151
|
-
}));
|
|
2152
|
-
}
|
|
2153
|
-
}, [
|
|
2154
|
-
e,
|
|
2155
|
-
t,
|
|
2156
|
-
...Object.values(n)
|
|
2157
|
-
]), r;
|
|
2158
|
-
}
|
|
2159
|
-
// src/hooks/useCanResizeEvent.ts
|
|
2160
|
-
function Fn(e, t) {
|
|
2161
|
-
let [n, r] = d(!0), { preventOutBoundsChanges: i } = J(), { isBefore: a, isToday: o } = K(), { getTimeFrame: s } = Dn();
|
|
2162
|
-
return qe(() => {
|
|
2163
|
-
if (t && i) {
|
|
2164
|
-
if (a(e) && !o(e)) r(!1);
|
|
2165
|
-
else if (o(e)) {
|
|
2166
|
-
let { height: n, y: i } = t, a = n + i, [o, c] = s(e);
|
|
2167
|
-
r(a > o && i < c);
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
}, [
|
|
2171
|
-
e,
|
|
2172
|
-
t,
|
|
2173
|
-
s,
|
|
2174
|
-
i,
|
|
2175
|
-
a,
|
|
2176
|
-
o
|
|
2177
|
-
]), n;
|
|
2178
|
-
}
|
|
2179
|
-
var Q = {
|
|
2180
|
-
root: "_root_1g6ad_1",
|
|
2181
|
-
root_isDragging: "_root_isDragging_1g6ad_12",
|
|
2182
|
-
root__resizeTop: "_root__resizeTop_1g6ad_12",
|
|
2183
|
-
root__resizeBottom: "_root__resizeBottom_1g6ad_14",
|
|
2184
|
-
root_isResizing: "_root_isResizing_1g6ad_16",
|
|
2185
|
-
root_isDisabled: "_root_isDisabled_1g6ad_43",
|
|
2186
|
-
root__container: "_root__container_1g6ad_59",
|
|
2187
|
-
root__dragPreview: "_root__dragPreview_1g6ad_108",
|
|
2188
|
-
root_isPreview: "_root_isPreview_1g6ad_114",
|
|
2189
|
-
root_isResizeSource: "_root_isResizeSource_1g6ad_119"
|
|
2190
|
-
};
|
|
2191
|
-
// src/components/day-week-event/DayWeekEvent.tsx
|
|
2192
|
-
function In(e) {
|
|
2193
|
-
let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } = J(), c = K(), { timeStep: l, preventOutBoundsChanges: d, disabled: f } = s, p = u(null), m = u(null), h = u(null), { viewportRef: g, getTimeFrame: _, pxPerMinute: v, resize: y, resizing: b } = Dn(), x = l * v, { drawerRef: S, containerRef: C } = kn(), w = Pn(p, C, n.rect), T = Fn(o.get(n.key)?.date ?? n.date, w), { attributes: E, isDragging: D, overElement: k, overData: A, register: j, setOverlayTransform: M } = Pe(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
|
|
2194
|
-
let a = i(p.current), [o, s] = a ? [...n.dropTargets].pop() ?? [null, null] : [null, null];
|
|
2195
|
-
return {
|
|
2196
|
-
attributes: t.attributes,
|
|
2197
|
-
overElement: o,
|
|
2198
|
-
overData: s,
|
|
2199
|
-
isDragging: a,
|
|
2200
|
-
register: e,
|
|
2201
|
-
setOverlayTransform: r
|
|
2202
|
-
};
|
|
2203
|
-
}), N = an(D ? k : null), [{ isActive: ee, transform: P, context: F }, I] = mn({
|
|
2204
|
-
activeNode: (e) => e === "overlay" ? p.current : e === "top" ? m.current : h.current,
|
|
2205
|
-
containerNode: (e) => e === "overlay" ? g.current : S.current,
|
|
2206
|
-
modifiers: [
|
|
2207
|
-
function({ activeNodeRect: e, containerNodeRect: t, context: n, transform: r, translate: i, initialTranslate: a }) {
|
|
2208
|
-
if (n !== "overlay" || !t || !e || !N) return r;
|
|
2209
|
-
r.x = i.x + a.x - t.left, r.y = i.y + a.y - t.top, r.left = N.left - t.left, r.width = N.width, r.top = e.top - t.top, r.height = e.height;
|
|
2210
|
-
let o;
|
|
2211
|
-
return i.y > 0 ? (o = x - (a.y - e.top) % x, r.top += Math.ceil((i.y - o) / x) * x) : (o = (a.y - e.top) % x, r.top += Math.floor((i.y + o) / x) * x), r;
|
|
2212
|
-
},
|
|
2213
|
-
function({ transform: e, context: t }) {
|
|
2214
|
-
if (!d || t !== "overlay" || !A) return e;
|
|
2215
|
-
let [n, r] = _(A.date).map((e) => Math.ceil(e / l) * x);
|
|
2216
|
-
return e.top < n && (e.top = n), e.top + e.height > r && (e.top = r - e.height), e;
|
|
2217
|
-
},
|
|
2218
|
-
Ln(x)
|
|
2219
|
-
]
|
|
2220
|
-
}), L = ye(() => y.end(), (e) => {
|
|
2221
|
-
I.stop({
|
|
2222
|
-
x: e.clientX,
|
|
2223
|
-
y: e.clientY
|
|
2224
|
-
});
|
|
2225
|
-
}), R = (e) => ({
|
|
2226
|
-
onMoveStart: (t) => (I.start({
|
|
2227
|
-
x: t.clientX,
|
|
2228
|
-
y: t.clientY
|
|
2229
|
-
}, e), y.start(n.key, e, t.clientX, t.clientY), !0),
|
|
2230
|
-
onMove: (e) => {
|
|
2231
|
-
I.move({
|
|
2232
|
-
x: e.clientX,
|
|
2233
|
-
y: e.clientY
|
|
2234
|
-
}), y.move(e.clientX, e.clientY);
|
|
2235
|
-
},
|
|
2236
|
-
onMoveEnd: L
|
|
2237
|
-
}), { listeners: z } = ft(R("bottom")), { listeners: B } = ft(R("top")), V = dt(p, t), te = ee && D && F === "overlay", H = b?.key === n.key, ne = q((e) => {
|
|
2238
|
-
F === "overlay" && k && M(e);
|
|
2239
|
-
});
|
|
2240
|
-
i(() => {
|
|
2241
|
-
ne(P);
|
|
2242
|
-
}, [ne, ...Object.values(P)]), i(() => {
|
|
2243
|
-
if (!p.current) return;
|
|
2244
|
-
let e = {
|
|
2245
|
-
...xe(n, "rect"),
|
|
2246
|
-
date: c.toMillis(n.date)
|
|
2247
|
-
}, t = [{ event: JSON.stringify(e) }];
|
|
2248
|
-
return j(p.current, {
|
|
2249
|
-
getItems() {
|
|
2250
|
-
return t;
|
|
2251
|
-
},
|
|
2252
|
-
onDragStart(e) {
|
|
2253
|
-
I.start({
|
|
2254
|
-
x: e.x,
|
|
2255
|
-
y: e.y
|
|
2256
|
-
}, "overlay");
|
|
2257
|
-
},
|
|
2258
|
-
onDragMove(e) {
|
|
2259
|
-
I.move({
|
|
2260
|
-
x: e.x,
|
|
2261
|
-
y: e.y
|
|
2262
|
-
});
|
|
2263
|
-
},
|
|
2264
|
-
onDragEnd(e) {
|
|
2265
|
-
I.stop({
|
|
2266
|
-
x: e.x,
|
|
2267
|
-
y: e.y
|
|
2268
|
-
});
|
|
2269
|
-
},
|
|
2270
|
-
getAllowedDropOperations() {
|
|
2271
|
-
return ["move"];
|
|
2272
|
-
}
|
|
2273
|
-
});
|
|
2274
|
-
}, [
|
|
2275
|
-
I,
|
|
2276
|
-
n,
|
|
2277
|
-
j
|
|
2278
|
-
]);
|
|
2279
|
-
let re = O(a.className, Q.root, {
|
|
2280
|
-
[Q.root_isDragging]: te,
|
|
2281
|
-
[Q.root_isResizeSource]: H,
|
|
2282
|
-
[Q.root_isDisabled]: f
|
|
2283
|
-
}), ie = {
|
|
2284
|
-
...a.style,
|
|
2285
|
-
top: `${n.rect.y}%`,
|
|
2286
|
-
left: `${n.rect.x}%`,
|
|
2287
|
-
width: `${n.rect.width}%`,
|
|
2288
|
-
height: `${n.rect.height}%`
|
|
2289
|
-
}, ae = q(ye(a.onPointerDown, (e) => e.stopPropagation()));
|
|
2290
|
-
return /* @__PURE__ */ W(Be, { children: /* @__PURE__ */ G("div", {
|
|
2291
|
-
...a,
|
|
2292
|
-
...E,
|
|
2293
|
-
ref: V,
|
|
2294
|
-
className: re,
|
|
2295
|
-
style: ie,
|
|
2296
|
-
onPointerDown: ae,
|
|
2297
|
-
"data-continues-before": n.isStart ? void 0 : "",
|
|
2298
|
-
"data-continues-after": n.isEnd ? void 0 : "",
|
|
2299
|
-
children: [
|
|
2300
|
-
T && n.isStart && /* @__PURE__ */ W("div", {
|
|
2301
|
-
...B,
|
|
2302
|
-
ref: m,
|
|
2303
|
-
className: Q.root__resizeTop
|
|
2304
|
-
}),
|
|
2305
|
-
/* @__PURE__ */ W("div", {
|
|
2306
|
-
role: "button",
|
|
2307
|
-
tabIndex: 0,
|
|
2308
|
-
className: Q.root__container,
|
|
2309
|
-
children: r
|
|
2310
|
-
}),
|
|
2311
|
-
T && n.isEnd && /* @__PURE__ */ W("div", {
|
|
2312
|
-
...z,
|
|
2313
|
-
ref: h,
|
|
2314
|
-
className: Q.root__resizeBottom
|
|
2315
|
-
})
|
|
2316
|
-
]
|
|
2317
|
-
}) });
|
|
2318
|
-
}
|
|
2319
|
-
function Ln(e) {
|
|
2320
|
-
return (t) => {
|
|
2321
|
-
let n = [se(e)];
|
|
2322
|
-
return t.context === "overlay" && n.push(C), b(n, t);
|
|
2323
|
-
};
|
|
2324
|
-
}
|
|
2325
|
-
// src/components/day-week-event/DayWeekEventPreview.tsx
|
|
2326
|
-
function Rn({ part: e, timelineMinutes: t, children: n }) {
|
|
2327
|
-
let r = (e) => `${e / t * 100}%`;
|
|
2328
|
-
return /* @__PURE__ */ W("div", {
|
|
2329
|
-
"aria-hidden": "true",
|
|
2330
|
-
className: `${Q.root} ${Q.root_isResizing} ${Q.root_isPreview}`,
|
|
2331
|
-
"data-continues-before": e.isStart ? void 0 : "",
|
|
2332
|
-
"data-continues-after": e.isEnd ? void 0 : "",
|
|
2333
|
-
style: {
|
|
2334
|
-
top: r(e.start),
|
|
2335
|
-
height: r(e.duration),
|
|
2336
|
-
left: 0,
|
|
2337
|
-
width: "100%"
|
|
2338
|
-
},
|
|
2339
|
-
children: /* @__PURE__ */ W("div", {
|
|
2340
|
-
className: Q.root__container,
|
|
2341
|
-
children: n
|
|
2342
|
-
})
|
|
2343
|
-
});
|
|
2344
|
-
}
|
|
2345
|
-
var $ = {
|
|
2346
|
-
root: "_root_143fq_1",
|
|
2347
|
-
root_scrollable: "_root_scrollable_143fq_11",
|
|
2348
|
-
root__body: "_root__body_143fq_11",
|
|
2349
|
-
root__head: "_root__head_143fq_15",
|
|
2350
|
-
root__main: "_root__main_143fq_33",
|
|
2351
|
-
root__viewport: "_root__viewport_143fq_47",
|
|
2352
|
-
root__column: "_root__column_143fq_58",
|
|
2353
|
-
root__headerCell: "_root__headerCell_143fq_83",
|
|
2354
|
-
root__headerCellDay: "_root__headerCellDay_143fq_110",
|
|
2355
|
-
root__headerCellLabel: "_root__headerCellLabel_143fq_117",
|
|
2356
|
-
root__headerCellName: "_root__headerCellName_143fq_124",
|
|
2357
|
-
root__headerCellToday: "_root__headerCellToday_143fq_131",
|
|
2358
|
-
root__row: "_root__row_143fq_146",
|
|
2359
|
-
root__timeStep: "_root__timeStep_143fq_168",
|
|
2360
|
-
root__timeStep_overTime: "_root__timeStep_overTime_143fq_180",
|
|
2361
|
-
root__rowHeadTime: "_root__rowHeadTime_143fq_184",
|
|
2362
|
-
root__hiddenEventsLayer: "_root__hiddenEventsLayer_143fq_200",
|
|
2363
|
-
root__hiddenEventsColumn: "_root__hiddenEventsColumn_143fq_216",
|
|
2364
|
-
root__hiddenEvents: "_root__hiddenEvents_143fq_200",
|
|
2365
|
-
root__hiddenEventsIcon: "_root__hiddenEventsIcon_143fq_265"
|
|
2366
|
-
};
|
|
2367
|
-
// src/components/day-week-view/HiddenEvents.tsx
|
|
2368
|
-
function zn({ scrollerRef: e, columns: t, rowHeight: n }) {
|
|
2369
|
-
let { hourMin: r, hideMinMaxTime: a, size: o } = J(), s = K(), l = Ke(), { addGlobalListener: u, removeGlobalListener: f } = ot(), [p, m] = d(null), h = n / 60, g = q(() => {
|
|
2370
|
-
let t = e.current;
|
|
2371
|
-
if (!t) return;
|
|
2372
|
-
let n = {
|
|
2373
|
-
top: t.scrollTop,
|
|
2374
|
-
height: t.clientHeight
|
|
2375
|
-
};
|
|
2376
|
-
m((e) => e?.top === n.top && e.height === n.height ? e : n);
|
|
2377
|
-
}), _ = Je(g);
|
|
2378
|
-
i(() => {
|
|
2379
|
-
let t = e.current;
|
|
2380
|
-
if (t) return g(), u(t, "scroll", g, { passive: !0 }), _?.observe(t), () => {
|
|
2381
|
-
f(t, "scroll", g), _?.unobserve(t);
|
|
2382
|
-
};
|
|
2383
|
-
}, [
|
|
2384
|
-
u,
|
|
2385
|
-
g,
|
|
2386
|
-
f,
|
|
2387
|
-
_,
|
|
2388
|
-
e
|
|
2389
|
-
]), i(g, [
|
|
2390
|
-
g,
|
|
2391
|
-
n,
|
|
2392
|
-
t
|
|
2393
|
-
]);
|
|
2394
|
-
let v = c(() => p && p.height > 0 ? t.map((e) => L(e, h, p.top, p.height)) : null, [
|
|
2395
|
-
t,
|
|
2396
|
-
h,
|
|
2397
|
-
p
|
|
2398
|
-
]);
|
|
2399
|
-
if (!v || !p) return null;
|
|
2400
|
-
let y = (t) => e.current?.scrollTo({
|
|
2401
|
-
top: te(t, h, p.top, p.height),
|
|
2402
|
-
behavior: "smooth"
|
|
2403
|
-
}), b = (e, t) => {
|
|
2404
|
-
let [n] = e;
|
|
2405
|
-
if (!n) return null;
|
|
2406
|
-
let i = e.length === 1 && o !== "narrow" ? M(s, n.start, {
|
|
2407
|
-
hourMin: r,
|
|
2408
|
-
hideMinMaxTime: a
|
|
2409
|
-
}) : e.length;
|
|
2410
|
-
return /* @__PURE__ */ G("button", {
|
|
2411
|
-
type: "button",
|
|
2412
|
-
className: $.root__hiddenEvents,
|
|
2413
|
-
"data-direction": t,
|
|
2414
|
-
"aria-label": t === "above" ? l.earlier(e.length) : l.later(e.length),
|
|
2415
|
-
onClick: () => y(n),
|
|
2416
|
-
children: [/* @__PURE__ */ W(kt, {
|
|
2417
|
-
"aria-hidden": "true",
|
|
2418
|
-
className: $.root__hiddenEventsIcon
|
|
2419
|
-
}), i]
|
|
2420
|
-
});
|
|
2421
|
-
};
|
|
2422
|
-
return /* @__PURE__ */ G("div", {
|
|
2423
|
-
className: $.root__hiddenEventsLayer,
|
|
2424
|
-
children: [/* @__PURE__ */ W("div", {}), v.map(({ above: e, below: t }, n) => /* @__PURE__ */ G("div", {
|
|
2425
|
-
className: $.root__hiddenEventsColumn,
|
|
2426
|
-
children: [b(e, "above"), b(t, "below")]
|
|
2427
|
-
}, n))]
|
|
2428
|
-
});
|
|
2429
|
-
}
|
|
2430
|
-
// src/components/day-week-view/useTimeColumnWidth.ts
|
|
2431
|
-
function Bn(e, t, n, r) {
|
|
2432
|
-
let [i, a] = d();
|
|
2433
|
-
return qe(() => {
|
|
2434
|
-
let n = !1, i = () => {
|
|
2435
|
-
let i = e.current;
|
|
2436
|
-
if (n || !i) return;
|
|
2437
|
-
let o = 0, s = document.createRange();
|
|
2438
|
-
if (typeof s.getBoundingClientRect != "function") return;
|
|
2439
|
-
for (let e of t.current) {
|
|
2440
|
-
if (!e) continue;
|
|
2441
|
-
s.selectNodeContents(e);
|
|
2442
|
-
let t = getComputedStyle(e), n = s.getBoundingClientRect().width;
|
|
2443
|
-
o = Math.max(o, n + parseFloat(t.paddingLeft) + parseFloat(t.paddingRight));
|
|
2444
|
-
}
|
|
2445
|
-
let c = i.parentElement ?? document.body, l = parseFloat(getComputedStyle(c).getPropertyValue("--ww-time-column"));
|
|
2446
|
-
a(o > (Number.isNaN(l) ? r : l) ? Math.ceil(o) : void 0);
|
|
2447
|
-
};
|
|
2448
|
-
return i(), document.fonts?.ready.then(i), () => {
|
|
2449
|
-
n = !0;
|
|
2450
|
-
};
|
|
2451
|
-
}, [
|
|
2452
|
-
r,
|
|
2453
|
-
n.join("|"),
|
|
2454
|
-
t,
|
|
2455
|
-
e
|
|
2456
|
-
]), i;
|
|
2457
|
-
}
|
|
2458
|
-
// src/components/day-week-view/DayWeekView.tsx
|
|
2459
|
-
var Vn = {
|
|
2460
|
-
regular: 64,
|
|
2461
|
-
compact: 44,
|
|
2462
|
-
narrow: 40
|
|
2463
|
-
};
|
|
2464
|
-
function Hn({ rowHeight: e, ...t }) {
|
|
2465
|
-
let { viewValue: r, hourMin: i, hourMax: a, view: o, eventMap: s, preventOutBoundsChanges: l, eventRenderer: d, timeStep: f, scrollable: p, size: h, hideMinMaxTime: g, disabled: _, getIsDayDisabled: v, onEventChange: y, pointerPreviewRenderer: b } = J(), S = K(), C = Ke(), { getMonthDay: w, getWeekDay: T, isToday: D, weekDayShortName: k } = S, A = wt(), j = e ?? m[h], M = u(null), N = u(null), ee = u(null), P = _t(), F = c(() => E(S, f, {
|
|
2466
|
-
hourMin: i,
|
|
2467
|
-
hourMax: a,
|
|
2468
|
-
hideMinMaxTime: g
|
|
2469
|
-
}, l), [
|
|
2470
|
-
S,
|
|
2471
|
-
f,
|
|
2472
|
-
i,
|
|
2473
|
-
a,
|
|
2474
|
-
g,
|
|
2475
|
-
l
|
|
2476
|
-
]), I = c(() => F.map(({ time: e }) => e), [F]), L = _t(), R = Bn(M, L.elements, I, Vn[h]), z = c(() => de(S, o, r), [
|
|
2477
|
-
S,
|
|
2478
|
-
o,
|
|
2479
|
-
r
|
|
2480
|
-
]), B = c(() => ({
|
|
2481
|
-
hourMin: i,
|
|
2482
|
-
hourMax: a,
|
|
2483
|
-
hideMinMaxTime: g
|
|
2484
|
-
}), [
|
|
2485
|
-
i,
|
|
2486
|
-
a,
|
|
2487
|
-
g
|
|
2488
|
-
]), V = c(() => x(s, S, F.length * 60, z, B), [
|
|
2489
|
-
s,
|
|
2490
|
-
S,
|
|
2491
|
-
F.length,
|
|
2492
|
-
z,
|
|
2493
|
-
B
|
|
2494
|
-
]), te = c(() => V.map(({ events: e }) => e), [V]), { state: H, actions: ne, previewOf: re } = Tn({
|
|
2495
|
-
days: z,
|
|
2496
|
-
viewportRef: N,
|
|
2497
|
-
columnsRef: P.elements,
|
|
2498
|
-
dateUtils: S,
|
|
2499
|
-
bounds: B,
|
|
2500
|
-
timeStep: f,
|
|
2501
|
-
preventOutBoundsChanges: l,
|
|
2502
|
-
disabled: _,
|
|
2503
|
-
getIsDayDisabled: v,
|
|
2504
|
-
eventMap: s,
|
|
2505
|
-
onEventChange: y
|
|
2506
|
-
}), ie = c(() => H ? Oe(H.range[0], H.range[1], z.length, B) : [], [
|
|
2507
|
-
H,
|
|
2508
|
-
z.length,
|
|
2509
|
-
B
|
|
2510
|
-
]), ae = H ? s.get(H.key)?.value : void 0, se = n((e) => oe(S, e, {
|
|
2511
|
-
hourMin: i,
|
|
2512
|
-
hourMax: a,
|
|
2513
|
-
hideMinMaxTime: g
|
|
2514
|
-
}), [
|
|
2515
|
-
S,
|
|
2516
|
-
g,
|
|
2517
|
-
a,
|
|
2518
|
-
i
|
|
2519
|
-
]), ce = c(() => z.map((e, t) => {
|
|
2520
|
-
let n = T(e), r = D(e), i = V[t]?.events ?? [];
|
|
2521
|
-
return {
|
|
2522
|
-
attributes: r ? { "data-is-today": !0 } : void 0,
|
|
2523
|
-
events: i,
|
|
2524
|
-
day: w(e),
|
|
2525
|
-
isToday: r,
|
|
2526
|
-
targetDate: e,
|
|
2527
|
-
weekDayName: k(n),
|
|
2528
|
-
weekDayNumber: n
|
|
2529
|
-
};
|
|
2530
|
-
}), [
|
|
2531
|
-
A,
|
|
2532
|
-
S,
|
|
2533
|
-
z,
|
|
2534
|
-
V,
|
|
2535
|
-
w,
|
|
2536
|
-
T,
|
|
2537
|
-
D,
|
|
2538
|
-
k
|
|
2539
|
-
]), le = bt(), ue = t, fe = $.root__head, pe = $.root__body, U = $.root__viewport, me = $.root__column, he = $.root__headerCell, ge = $.root__headerCellDay, _e = $.root__row, ve = $.root__rowHeadTime, ye = $.root__timeStep, be = dt(N), xe = c(() => ({
|
|
2540
|
-
viewportRef: N,
|
|
2541
|
-
getTimeFrame: se,
|
|
2542
|
-
pxPerMinute: j / 60,
|
|
2543
|
-
resize: ne,
|
|
2544
|
-
resizing: H
|
|
2545
|
-
}), [
|
|
2546
|
-
N,
|
|
2547
|
-
se,
|
|
2548
|
-
j,
|
|
2549
|
-
ne,
|
|
2550
|
-
H
|
|
2551
|
-
]), Se = c(() => ({ viewportRef: N }), [N]), Ce = (e, t) => /* @__PURE__ */ W(In, {
|
|
2552
|
-
"data-idx": t,
|
|
2553
|
-
eventData: e,
|
|
2554
|
-
children: d.current?.(e.value, o, {
|
|
2555
|
-
isStart: e.isStart,
|
|
2556
|
-
isEnd: e.isEnd
|
|
2557
|
-
})
|
|
2558
|
-
}, e.key);
|
|
2559
|
-
return /* @__PURE__ */ W(En.Provider, {
|
|
2560
|
-
value: xe,
|
|
2561
|
-
children: /* @__PURE__ */ W(Ut.Provider, {
|
|
2562
|
-
value: Se,
|
|
2563
|
-
children: /* @__PURE__ */ G(Be, { children: [
|
|
2564
|
-
/* @__PURE__ */ G("div", {
|
|
2565
|
-
...ue,
|
|
2566
|
-
ref: M,
|
|
2567
|
-
className: O(ue.className, $.root, { [$.root_scrollable]: p }),
|
|
2568
|
-
style: {
|
|
2569
|
-
...ue.style,
|
|
2570
|
-
"--calendar-column-count": ce.length,
|
|
2571
|
-
"--scrollbar-width": le.width,
|
|
2572
|
-
"--scrollbar-height": le.height,
|
|
2573
|
-
...R !== void 0 && { "--ww-time-column": `${R}px` }
|
|
2574
|
-
},
|
|
2575
|
-
children: [/* @__PURE__ */ G("div", {
|
|
2576
|
-
className: fe,
|
|
2577
|
-
children: [/* @__PURE__ */ W("div", { className: he }), ce.map((e) => /* @__PURE__ */ G("div", {
|
|
2578
|
-
className: he,
|
|
2579
|
-
...e.attributes,
|
|
2580
|
-
children: [/* @__PURE__ */ W("span", {
|
|
2581
|
-
className: ge,
|
|
2582
|
-
children: e.day
|
|
2583
|
-
}), /* @__PURE__ */ G("span", {
|
|
2584
|
-
className: $.root__headerCellLabel,
|
|
2585
|
-
children: [/* @__PURE__ */ W("span", {
|
|
2586
|
-
className: $.root__headerCellName,
|
|
2587
|
-
children: e.weekDayName
|
|
2588
|
-
}), e.isToday && /* @__PURE__ */ W("span", {
|
|
2589
|
-
className: $.root__headerCellToday,
|
|
2590
|
-
children: C.today
|
|
2591
|
-
})]
|
|
2592
|
-
})]
|
|
2593
|
-
}, e.weekDayNumber))]
|
|
2594
|
-
}), /* @__PURE__ */ G("div", {
|
|
2595
|
-
className: $.root__main,
|
|
2596
|
-
children: [/* @__PURE__ */ W("div", {
|
|
2597
|
-
ref: ee,
|
|
2598
|
-
className: pe,
|
|
2599
|
-
children: /* @__PURE__ */ G("div", {
|
|
2600
|
-
ref: be,
|
|
2601
|
-
className: U,
|
|
2602
|
-
style: { height: F.length * j },
|
|
2603
|
-
children: [/* @__PURE__ */ W("div", {
|
|
2604
|
-
className: me,
|
|
2605
|
-
children: F.map(({ time: e, value: t, steps: n }, r) => /* @__PURE__ */ G("div", {
|
|
2606
|
-
className: _e,
|
|
2607
|
-
style: {
|
|
2608
|
-
height: j,
|
|
2609
|
-
"--translateY": r * j,
|
|
2610
|
-
"--calendar-rows-count": n.length
|
|
2611
|
-
},
|
|
2612
|
-
children: [/* @__PURE__ */ W("time", {
|
|
2613
|
-
ref: L.refAt(r),
|
|
2614
|
-
className: ve,
|
|
2615
|
-
children: e
|
|
2616
|
-
}), n.map(([e, , t]) => /* @__PURE__ */ W("div", { className: O(ye, { [$.root__timeStep_overTime]: t }) }, e))]
|
|
2617
|
-
}, t))
|
|
2618
|
-
}), ce.map((e, t) => /* @__PURE__ */ W("div", {
|
|
2619
|
-
ref: P.refAt(t),
|
|
2620
|
-
className: me,
|
|
2621
|
-
"data-day-index": t,
|
|
2622
|
-
...e.attributes,
|
|
2623
|
-
children: /* @__PURE__ */ G(Mn, {
|
|
2624
|
-
id: `${e.weekDayNumber}`,
|
|
2625
|
-
targetDate: e.targetDate,
|
|
2626
|
-
children: [e.events.map((e, t) => Ce(e, t)), ie.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ W(Rn, {
|
|
2627
|
-
part: e,
|
|
2628
|
-
timelineMinutes: F.length * 60,
|
|
2629
|
-
children: ae === void 0 ? null : d.current?.(ae, o, {
|
|
2630
|
-
isStart: e.isStart,
|
|
2631
|
-
isEnd: e.isEnd
|
|
2632
|
-
})
|
|
2633
|
-
}, "resize"))]
|
|
2634
|
-
})
|
|
2635
|
-
}, e.weekDayNumber))]
|
|
2636
|
-
})
|
|
2637
|
-
}), p && /* @__PURE__ */ W(zn, {
|
|
2638
|
-
scrollerRef: ee,
|
|
2639
|
-
columns: te,
|
|
2640
|
-
rowHeight: j
|
|
2641
|
-
})]
|
|
2642
|
-
})]
|
|
2643
|
-
}),
|
|
2644
|
-
/* @__PURE__ */ W(Yt, { pxPerMinute: j / 60 }),
|
|
2645
|
-
H && !H.blocked && /* @__PURE__ */ W(Kt, {
|
|
2646
|
-
coordinates: {
|
|
2647
|
-
x: H.x,
|
|
2648
|
-
y: H.y
|
|
2649
|
-
},
|
|
2650
|
-
children: (() => {
|
|
2651
|
-
let { date: e, top: t, duration: n } = re(H.range);
|
|
2652
|
-
return b.current?.(e, t, n);
|
|
2653
|
-
})()
|
|
2654
|
-
})
|
|
2655
|
-
] })
|
|
2656
|
-
})
|
|
2657
|
-
});
|
|
2658
|
-
}
|
|
2659
|
-
var Un = {
|
|
2660
|
-
root: "_root_szob5_2",
|
|
2661
|
-
root__head: "_root__head_szob5_22",
|
|
2662
|
-
root__body: "_root__body_szob5_26",
|
|
2663
|
-
root__body_readonly: "_root__body_readonly_szob5_37"
|
|
2664
|
-
};
|
|
2665
|
-
// src/Calendar.tsx
|
|
2666
|
-
function Wn(e) {
|
|
2667
|
-
let { ref: t, disabled: n = !1, children: r, hideMinMaxTime: a = !1, timeFrame: o, startWeek: s, timeStep: l = 15, items: d, onEventCreate: f, onEventChange: p, onEventDelete: m, onEventEdit: h, eventTimeFrameResolver: g, eventKeyResolver: v, getIsDayDisabled: y, pointerPreviewFormat: b, scrollable: x = !1, view: S, defaultView: C, viewValue: w, defaultViewValue: E, onChangeView: D, onChangeViewValue: k, ...A } = e, { hourMax: j, hourMin: M } = {
|
|
2668
|
-
hourMin: 0,
|
|
2669
|
-
hourMax: 24,
|
|
2670
|
-
...o
|
|
2671
|
-
}, ee = Xe({
|
|
2672
|
-
eventTimeFrameResolver: g,
|
|
2673
|
-
eventKeyResolver: v
|
|
2674
|
-
}), P = K(), F = s ?? P.weekStartsOn, L = u(null), R = dt(L, t), { viewValue: z, changeViewValue: B, view: V, changeView: te } = Dt({
|
|
2675
|
-
view: S,
|
|
2676
|
-
defaultView: C,
|
|
2677
|
-
viewValue: w,
|
|
2678
|
-
defaultViewValue: E,
|
|
2679
|
-
onChangeView: D,
|
|
2680
|
-
onChangeViewValue: k,
|
|
2681
|
-
dateUtils: P,
|
|
2682
|
-
startWeek: F
|
|
2683
|
-
}), H = Ye(L), ne = rt(() => Me({
|
|
2684
|
-
input: "pointer",
|
|
2685
|
-
touchDelay: _
|
|
2686
|
-
})).current, re = c(() => T(d, ee.current, P, {
|
|
2687
|
-
hourMin: M,
|
|
2688
|
-
hideMinMaxTime: a
|
|
2689
|
-
}), [
|
|
2690
|
-
P,
|
|
2691
|
-
a,
|
|
2692
|
-
M,
|
|
2693
|
-
d,
|
|
2694
|
-
ee
|
|
2695
|
-
]), { goBackward: ie, goForward: ae, goToday: oe } = Ot({
|
|
2696
|
-
changeViewValue: B,
|
|
2697
|
-
dateUtils: P,
|
|
2698
|
-
startWeek: F,
|
|
2699
|
-
view: V,
|
|
2700
|
-
viewValue: z
|
|
2701
|
-
}), se = q((e, t, n) => {
|
|
2702
|
-
let r = re.get(e);
|
|
2703
|
-
r && p?.(r.value, ...I(P, t, n));
|
|
2704
|
-
}), le = q((e, t) => {
|
|
2705
|
-
f?.(...I(P, e, t));
|
|
2706
|
-
}), ue = q((e) => {
|
|
2707
|
-
let t = re.get(e);
|
|
2708
|
-
t && h?.(t.value);
|
|
2709
|
-
}), de = q((e) => {
|
|
2710
|
-
let t = re.get(e);
|
|
2711
|
-
t && m?.(t.value);
|
|
2712
|
-
}), fe = Xe((e, t, n) => {
|
|
2713
|
-
let [r, i] = ce(P, e, t, n, {
|
|
2714
|
-
hourMin: M,
|
|
2715
|
-
hideMinMaxTime: a
|
|
2716
|
-
});
|
|
2717
|
-
return b ? b(r, i) : N(P, r, i);
|
|
2718
|
-
}), pe = Xe(r);
|
|
2719
|
-
i(() => {
|
|
2720
|
-
if (L.current) return ne.getState().registerRootElement(L.current);
|
|
2721
|
-
}, [ne]);
|
|
2722
|
-
let U = {
|
|
2723
|
-
...A,
|
|
2724
|
-
ref: R
|
|
2725
|
-
}, me = c(() => ({
|
|
2726
|
-
disabled: n,
|
|
2727
|
-
getIsDayDisabled: y,
|
|
2728
|
-
preventOutBoundsChanges: !!o,
|
|
2729
|
-
changeView: te,
|
|
2730
|
-
changeViewValue: B,
|
|
2731
|
-
eventMap: re,
|
|
2732
|
-
goBackward: ie,
|
|
2733
|
-
goForward: ae,
|
|
2734
|
-
goToday: oe,
|
|
2735
|
-
hideMinMaxTime: a,
|
|
2736
|
-
hourMax: j,
|
|
2737
|
-
hourMin: M,
|
|
2738
|
-
timeStep: l,
|
|
2739
|
-
scrollable: x,
|
|
2740
|
-
size: H,
|
|
2741
|
-
startWeek: F,
|
|
2742
|
-
view: V,
|
|
2743
|
-
viewValue: z,
|
|
2744
|
-
onEventCreate: le,
|
|
2745
|
-
onEventChange: se,
|
|
2746
|
-
onEventDelete: de,
|
|
2747
|
-
onEventEdit: ue,
|
|
2748
|
-
eventRenderer: pe,
|
|
2749
|
-
pointerPreviewRenderer: fe
|
|
2750
|
-
}), [
|
|
2751
|
-
n,
|
|
2752
|
-
fe,
|
|
2753
|
-
y,
|
|
2754
|
-
te,
|
|
2755
|
-
B,
|
|
2756
|
-
re,
|
|
2757
|
-
ie,
|
|
2758
|
-
ae,
|
|
2759
|
-
oe,
|
|
2760
|
-
a,
|
|
2761
|
-
j,
|
|
2762
|
-
M,
|
|
2763
|
-
x,
|
|
2764
|
-
H,
|
|
2765
|
-
F,
|
|
2766
|
-
l,
|
|
2767
|
-
V,
|
|
2768
|
-
z,
|
|
2769
|
-
le,
|
|
2770
|
-
se,
|
|
2771
|
-
de,
|
|
2772
|
-
ue,
|
|
2773
|
-
pe
|
|
2774
|
-
]);
|
|
2775
|
-
return /* @__PURE__ */ W("div", {
|
|
2776
|
-
...U,
|
|
2777
|
-
className: O(U.className, Un.root),
|
|
2778
|
-
"data-ww-size": H === "regular" ? void 0 : H,
|
|
2779
|
-
children: /* @__PURE__ */ W(Tt.Provider, {
|
|
2780
|
-
value: me,
|
|
2781
|
-
children: /* @__PURE__ */ W(Ne.Provider, {
|
|
2782
|
-
value: ne,
|
|
2783
|
-
children: /* @__PURE__ */ G(Et.Provider, {
|
|
2784
|
-
value: L,
|
|
2785
|
-
children: [/* @__PURE__ */ W("div", {
|
|
2786
|
-
className: Un.root__head,
|
|
2787
|
-
children: /* @__PURE__ */ W(Ht, {})
|
|
2788
|
-
}), /* @__PURE__ */ W("div", {
|
|
2789
|
-
className: Un.root__body,
|
|
2790
|
-
children: W(V === "month" ? Cn : Hn, {})
|
|
2791
|
-
})]
|
|
2792
|
-
})
|
|
2793
|
-
})
|
|
2794
|
-
})
|
|
2795
|
-
});
|
|
2796
|
-
}
|
|
2797
|
-
export { Wn as Calendar, Wn as default, He as DateLocalizationContext, Ge as DateLocalizationProvider, We as MessagesContext, D as builtInMessages, we as resolveMessages, Ue as useDateUtils, Ke as useMessages };
|
|
2798
|
-
|
|
2799
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import e from "./Calendar.js";
|
|
3
|
+
import t from "./CalendarBase.js";
|
|
4
|
+
import { dayView as n } from "./views/dayView.js";
|
|
5
|
+
import { monthView as r } from "./views/monthView.js";
|
|
6
|
+
import { weekView as i } from "./views/weekView.js";
|
|
7
|
+
import a from "./date-localization/DateLocalizationContext.js";
|
|
8
|
+
import o from "./date-localization/DateLocalizationProvider.js";
|
|
9
|
+
import s from "./date-localization/MessagesContext.js";
|
|
10
|
+
import c from "./date-localization/useDateUtils.js";
|
|
11
|
+
import l from "./date-localization/useMessages.js";
|
|
12
|
+
import { builtInMessages as u, resolveMessages as d } from "@weekwise/core";
|
|
13
|
+
export { e as Calendar, t as CalendarBase, a as DateLocalizationContext, o as DateLocalizationProvider, s as MessagesContext, u as builtInMessages, n as dayView, e as default, r as monthView, d as resolveMessages, c as useDateUtils, l as useMessages, i as weekView };
|