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