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