@weekwise/react 0.1.0 → 0.1.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/dist/Calendar.types.d.ts +2 -0
- package/dist/components/drag-overlay/DragOverlay.d.ts +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +692 -685
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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, add as _, adjustScrollRect as v, applyMoveTransformModifiers as y, arrangeEventsByDay as b, arrangeMonthWeek as x, boundingDraggableContainerModifier as S, boundingResizableContainerModifier as C, buildEventMap as w, buildTimeRows as T, builtInMessages as E, cx as D, defaultCoordinates as O, emptyArray as k, formatMonthYear as
|
|
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, add as _, adjustScrollRect as v, applyMoveTransformModifiers as y, arrangeEventsByDay as b, arrangeMonthWeek as x, boundingDraggableContainerModifier as S, boundingResizableContainerModifier as C, buildEventMap as w, buildTimeRows as T, builtInMessages as E, cx as D, defaultCoordinates as O, emptyArray as k, formatMonthYear as ee, formatNowOffset as A, formatTimelineRange as j, fromDayMinutes as M, getCalendarSize as N, getClientRect as P, getEventTimeFrameFromInfo as F, getHiddenEvents as I, getMonthGrid as L, getMonthLaneCount as R, getNavigationTarget as z, getNowOffset as B, getRevealScrollTop as te, getScrollCoordinates as V, getScrollDirectionAndSpeed as ne, getScrollOffsets as H, getScrollableAncestors as re, getScrollableElement as ie, getTimeFrame as ae, getTimeStepEqualizerModifier as oe, getTimelineRange as se, getViewChangeTarget as ce, getViewHeading as le, getVisibleDays as ue, getWeekdayNames as de, getWindow as fe, isDevEnvironment as U, isHTMLElement as pe, isInViewPeriod as me, isNotNull as he, isPastDay as ge, match as _e, mergeCallbacks as ve, normalizeViewValue as ye, omit as be, resizeEventDays as xe, resizeEventRange as Se, resolveMessages as Ce, resolveMessages as we, round as Te, shallowEqual as Ee, splitIntoDays as De, subtract as Oe, toDayMinutes as ke, transferDay as Ae } from "@weekwise/core";
|
|
4
|
+
import { createDragAndDropApi as je } from "@weekwise/dnd";
|
|
5
|
+
import { DragAndDropContext as Me, useDragAndDrop as Ne } from "@weekwise/dnd/react";
|
|
6
|
+
import { autoUpdate as Pe, flip as Fe, offset as Ie, shift as Le, useFloating as Re } from "@floating-ui/react-dom";
|
|
7
|
+
import { Fragment as ze, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as Be } from "react-dom";
|
|
9
9
|
// src/date-localization/DateLocalizationContext.ts
|
|
10
|
-
var
|
|
11
|
-
|
|
10
|
+
var Ve = e(void 0);
|
|
11
|
+
U && (Ve.displayName = "DateLocalizationContext");
|
|
12
12
|
// src/date-localization/useDateUtils.ts
|
|
13
|
-
function
|
|
14
|
-
let e = r(
|
|
13
|
+
function He() {
|
|
14
|
+
let e = r(Ve);
|
|
15
15
|
if (!e) throw Error("DateLocalizationContext is required");
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function K() {
|
|
19
|
+
return He();
|
|
20
20
|
}
|
|
21
21
|
// src/date-localization/MessagesContext.ts
|
|
22
|
-
var
|
|
23
|
-
|
|
22
|
+
var Ue = e(void 0);
|
|
23
|
+
U && (Ue.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__ */
|
|
25
|
+
function We(e) {
|
|
26
|
+
let { adapter: t, messages: n, children: r } = e, i = c(() => typeof t == "function" ? new t() : t, [t]), a = c(() => we(i.locale, n), [i.locale, n]);
|
|
27
|
+
return /* @__PURE__ */ W(Ve.Provider, {
|
|
28
28
|
value: i,
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ W(Ue.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 Ge() {
|
|
37
|
+
let e = r(Ue), t = He();
|
|
38
|
+
return e ?? we(t.locale);
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var Ke = typeof window < "u" ? s : i;
|
|
41
41
|
// src/hooks/useResizeObserver.ts
|
|
42
|
-
function
|
|
42
|
+
function qe(e, t = !1) {
|
|
43
43
|
let n = u(e);
|
|
44
44
|
n.current = e;
|
|
45
45
|
let r = c(() => {
|
|
@@ -50,36 +50,36 @@ function Je(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 Je(e) {
|
|
54
|
+
let [t, n] = d("regular"), r = qe(([e]) => {
|
|
55
55
|
if (!e) return;
|
|
56
56
|
let t = e.borderBoxSize?.[0]?.inlineSize ?? e.contentRect.width;
|
|
57
|
-
n(
|
|
57
|
+
n(N(t));
|
|
58
58
|
});
|
|
59
|
-
return
|
|
59
|
+
return Ke(() => {
|
|
60
60
|
let t = e.current;
|
|
61
|
-
if (t) return n(
|
|
61
|
+
if (t) return n(N(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 Ye(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 Xe(e, t) {
|
|
71
|
+
let n = u(void 0), r = Ye(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 Ze(e) {
|
|
79
79
|
let [t] = d(() => e !== void 0);
|
|
80
80
|
return t;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Qe(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 $e(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
|
-
|
|
106
|
+
function $e(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 = Ze(t);
|
|
108
|
+
U && Qe(s, t, o, r);
|
|
109
109
|
let c = n((e) => {
|
|
110
110
|
s || a(e);
|
|
111
111
|
}, [s]);
|
|
@@ -116,19 +116,19 @@ function et(e) {
|
|
|
116
116
|
];
|
|
117
117
|
}
|
|
118
118
|
// src/hooks/useRefWithInit.ts
|
|
119
|
-
var
|
|
120
|
-
function
|
|
121
|
-
let n = u(
|
|
122
|
-
return n.current ===
|
|
119
|
+
var et = {};
|
|
120
|
+
function tt(e, t) {
|
|
121
|
+
let n = u(et);
|
|
122
|
+
return n.current === et && (n.current = e(t)), n;
|
|
123
123
|
}
|
|
124
124
|
// src/hooks/useEventCallback.utils.ts
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
125
|
+
function nt() {
|
|
126
|
+
if (U) throw Error("useEventCallback: Cannot call an event handler while rendering.");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function rt() {
|
|
129
129
|
let e = {
|
|
130
130
|
next: void 0,
|
|
131
|
-
callback:
|
|
131
|
+
callback: nt,
|
|
132
132
|
trampoline: (...t) => e.callback?.(...t),
|
|
133
133
|
effect: () => {
|
|
134
134
|
e.callback = e.next;
|
|
@@ -137,12 +137,12 @@ function it() {
|
|
|
137
137
|
return e;
|
|
138
138
|
}
|
|
139
139
|
// src/hooks/useEventCallback.ts
|
|
140
|
-
function
|
|
141
|
-
let t =
|
|
140
|
+
function q(e) {
|
|
141
|
+
let t = tt(rt).current;
|
|
142
142
|
return t.next = e, o(t.effect), t.trampoline;
|
|
143
143
|
}
|
|
144
144
|
// src/hooks/useGlobalListeners.ts
|
|
145
|
-
function
|
|
145
|
+
function it() {
|
|
146
146
|
let [e] = d(() => ({ current: /* @__PURE__ */ new Map() })), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r } = c(() => {
|
|
147
147
|
function t(t, n, r, i) {
|
|
148
148
|
let a = typeof i != "boolean" && i?.once ? (n) => {
|
|
@@ -177,22 +177,22 @@ function at() {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
// src/utils/mergeRefs.ts
|
|
180
|
-
var
|
|
180
|
+
var at = (e) => !e || typeof e == "function" ? e : (t) => {
|
|
181
181
|
e.current = t;
|
|
182
182
|
};
|
|
183
|
-
function
|
|
183
|
+
function ot(...e) {
|
|
184
184
|
return (t) => {
|
|
185
185
|
e.forEach((e) => {
|
|
186
|
-
|
|
186
|
+
at(e)?.(t);
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
// src/hooks/useMergedRefs.ts
|
|
191
|
-
function
|
|
192
|
-
return c(() =>
|
|
191
|
+
function st(...e) {
|
|
192
|
+
return c(() => ot(...e), e);
|
|
193
193
|
}
|
|
194
194
|
// src/hooks/useMove.ts
|
|
195
|
-
function
|
|
195
|
+
function ct(e) {
|
|
196
196
|
let [{ state: t }] = d(() => ({ state: {
|
|
197
197
|
activePointId: null,
|
|
198
198
|
clientX: 0,
|
|
@@ -202,7 +202,7 @@ function lt(e) {
|
|
|
202
202
|
isDistanceReached: !1
|
|
203
203
|
} })), n = u(e);
|
|
204
204
|
n.current = e;
|
|
205
|
-
let { addGlobalListener: r, removeGlobalListener: i } =
|
|
205
|
+
let { addGlobalListener: r, removeGlobalListener: i } = it();
|
|
206
206
|
return { listeners: c(() => {
|
|
207
207
|
let e = {}, a = (e) => {
|
|
208
208
|
"stopPropagation" in e && "preventDefault" in e && (e.stopPropagation(), e.preventDefault());
|
|
@@ -324,14 +324,14 @@ function lt(e) {
|
|
|
324
324
|
]) };
|
|
325
325
|
}
|
|
326
326
|
// src/hooks/usePrevious.ts
|
|
327
|
-
function
|
|
327
|
+
function lt(e) {
|
|
328
328
|
let t = u(void 0);
|
|
329
329
|
return i(() => {
|
|
330
330
|
t.current = e;
|
|
331
331
|
}, [e]), t.current;
|
|
332
332
|
}
|
|
333
333
|
// src/hooks/useScrollBarSize.ts
|
|
334
|
-
function
|
|
334
|
+
function ut() {
|
|
335
335
|
let e = null, n = 0, r = (t) => (n += 1, e === null && (e = document.createElement("div"), e.style.width = "99px", e.style.height = "99px", e.style.overflow = "scroll", e.style.position = "absolute", e.style.top = "-9999px", e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "presentation"), document.body.appendChild(e), window.addEventListener("resize", t)), {
|
|
336
336
|
element: e,
|
|
337
337
|
cleanup: () => {
|
|
@@ -343,7 +343,7 @@ function dt() {
|
|
|
343
343
|
height: 0,
|
|
344
344
|
width: 0
|
|
345
345
|
});
|
|
346
|
-
return
|
|
346
|
+
return Ke(() => {
|
|
347
347
|
let e = () => {
|
|
348
348
|
let e = i.offsetHeight - i.clientHeight, r = i.offsetWidth - i.clientWidth;
|
|
349
349
|
t(() => {
|
|
@@ -360,9 +360,9 @@ function dt() {
|
|
|
360
360
|
}, []), e;
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
var
|
|
363
|
+
var dt = ut();
|
|
364
364
|
// src/hooks/useStateRef.ts
|
|
365
|
-
function
|
|
365
|
+
function ft(e) {
|
|
366
366
|
let [t, r] = d(e), i = u(e);
|
|
367
367
|
return [
|
|
368
368
|
t,
|
|
@@ -373,8 +373,8 @@ function pt(e) {
|
|
|
373
373
|
];
|
|
374
374
|
}
|
|
375
375
|
// src/hooks/useTimeInterval.ts
|
|
376
|
-
function
|
|
377
|
-
let r = u(null), a =
|
|
376
|
+
function pt(e, t, n = !0) {
|
|
377
|
+
let r = u(null), a = Ye(e);
|
|
378
378
|
i(() => {
|
|
379
379
|
if (n) {
|
|
380
380
|
let e = /* @__PURE__ */ new Date(), n = t - (e.getMinutes() * 60 + e.getSeconds()) * 1e3 % t;
|
|
@@ -392,8 +392,8 @@ function mt(e, t, n = !0) {
|
|
|
392
392
|
]);
|
|
393
393
|
}
|
|
394
394
|
// src/hooks/useToday.ts
|
|
395
|
-
function
|
|
396
|
-
let { getToday: e, addDays: t, toMillis: n, fromMillis: r } =
|
|
395
|
+
function mt() {
|
|
396
|
+
let { getToday: e, addDays: t, toMillis: n, fromMillis: r } = K(), [a, o] = d(() => n(e()));
|
|
397
397
|
return i(() => {
|
|
398
398
|
let i = n(t(r(a), 1)), s = Math.max(i - Date.now(), 0) + 1e3, c = setTimeout(() => o(n(e())), s);
|
|
399
399
|
return () => clearTimeout(c);
|
|
@@ -406,35 +406,35 @@ function ht() {
|
|
|
406
406
|
]), a;
|
|
407
407
|
}
|
|
408
408
|
// src/contexts/CalendarContext.ts
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
function
|
|
412
|
-
let e = r(
|
|
409
|
+
var ht = e(void 0);
|
|
410
|
+
U && (ht.displayName = "CalendarContext");
|
|
411
|
+
function J() {
|
|
412
|
+
let e = r(ht);
|
|
413
413
|
if (!e) throw Error("CalendarContext is required");
|
|
414
414
|
return e;
|
|
415
415
|
}
|
|
416
416
|
// src/contexts/ThemeSourceContext.ts
|
|
417
|
-
var
|
|
418
|
-
|
|
417
|
+
var gt = e(null);
|
|
418
|
+
U && (gt.displayName = "ThemeSourceContext");
|
|
419
419
|
// src/hooks/useCalendarValue.ts
|
|
420
|
-
function
|
|
421
|
-
let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] =
|
|
420
|
+
function _t(e) {
|
|
421
|
+
let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] = $e({
|
|
422
422
|
controlled: t,
|
|
423
423
|
default: r,
|
|
424
424
|
initialState: "week"
|
|
425
|
-
}), m = n((e, t) =>
|
|
425
|
+
}), m = n((e, t) => ye(c, e, t, a), [c, a]), [h, g] = $e({
|
|
426
426
|
controlled: o,
|
|
427
427
|
default: s,
|
|
428
428
|
initialState: m(f)
|
|
429
|
-
}), _ =
|
|
429
|
+
}), _ = q((e, t) => {
|
|
430
430
|
g(e), d?.(e, t);
|
|
431
|
-
}), v =
|
|
431
|
+
}), v = q(ve((e) => {
|
|
432
432
|
p(e);
|
|
433
|
-
}, l)), y =
|
|
433
|
+
}, l)), y = Ye(h), b = u(f), x = u(a), S = u(c);
|
|
434
434
|
return i(() => {
|
|
435
|
-
let e = b.current, t = x.current !== a, n = S.current, r = n === c ? y.current :
|
|
435
|
+
let e = b.current, t = x.current !== a, n = S.current, r = n === c ? y.current : Ae(n, c, y.current);
|
|
436
436
|
b.current = f, x.current = a, S.current = c;
|
|
437
|
-
let i = e === f && !t ? m(f, r) :
|
|
437
|
+
let i = e === f && !t ? m(f, r) : ce(c, e, f, r, a);
|
|
438
438
|
_(i, f);
|
|
439
439
|
}, [
|
|
440
440
|
m,
|
|
@@ -451,35 +451,35 @@ function vt(e) {
|
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
453
|
// src/hooks/useNavigation.ts
|
|
454
|
-
function
|
|
454
|
+
function vt(e) {
|
|
455
455
|
let { dateUtils: t, view: n, viewValue: r, changeViewValue: i, startWeek: a } = e, o = (e, r) => () => i(z(t, n, e, r, a), n);
|
|
456
456
|
return {
|
|
457
|
-
goForward:
|
|
458
|
-
goBackward:
|
|
459
|
-
goToday:
|
|
457
|
+
goForward: q(o(r, 1)),
|
|
458
|
+
goBackward: q(o(r, -1)),
|
|
459
|
+
goToday: q(o(t.getToday(), 0))
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
462
|
// src/icons/chevron.tsx
|
|
463
|
-
function
|
|
464
|
-
return /* @__PURE__ */
|
|
463
|
+
function yt(e) {
|
|
464
|
+
return /* @__PURE__ */ W("svg", {
|
|
465
465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
466
466
|
fill: "none",
|
|
467
467
|
height: "12",
|
|
468
468
|
viewBox: "0 0 13 12",
|
|
469
469
|
width: "13",
|
|
470
470
|
...e,
|
|
471
|
-
children: /* @__PURE__ */
|
|
471
|
+
children: /* @__PURE__ */ W("path", {
|
|
472
472
|
d: "M1.77498 2.29504L6.35498 6.87504L10.945 2.29504L12.355 3.70504L6.35498 9.70504L0.35498 3.70504L1.77498 2.29504Z",
|
|
473
473
|
fill: "currentColor"
|
|
474
474
|
})
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
// src/portal/Portal.tsx
|
|
478
|
-
var
|
|
479
|
-
function
|
|
480
|
-
return f(xt, St
|
|
478
|
+
var bt = () => () => {}, xt = () => !0, St = () => !1;
|
|
479
|
+
function Ct() {
|
|
480
|
+
return f(bt, xt, St);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function wt(e) {
|
|
483
483
|
let t = { display: "contents" };
|
|
484
484
|
if (!e) return t;
|
|
485
485
|
let n = getComputedStyle(e);
|
|
@@ -489,14 +489,14 @@ function Tt(e) {
|
|
|
489
489
|
}
|
|
490
490
|
return t;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
let n =
|
|
494
|
-
return n ? t ?
|
|
495
|
-
style:
|
|
492
|
+
function Tt({ children: e, container: t }) {
|
|
493
|
+
let n = Ct(), i = r(gt);
|
|
494
|
+
return n ? t ? Be(e, t) : Be(/* @__PURE__ */ W("div", {
|
|
495
|
+
style: wt(i?.current),
|
|
496
496
|
children: e
|
|
497
497
|
}), document.body) : null;
|
|
498
498
|
}
|
|
499
|
-
var
|
|
499
|
+
var Y = {
|
|
500
500
|
root: "_root_1aojr_1",
|
|
501
501
|
root__toggle: "_root__toggle_1aojr_6",
|
|
502
502
|
root__toggleLabel: "_root__toggleLabel_1aojr_30",
|
|
@@ -517,15 +517,15 @@ var J = {
|
|
|
517
517
|
popover__day_today: "_popover__day_today_1aojr_162"
|
|
518
518
|
};
|
|
519
519
|
// src/components/date-navigator/DateNavigator.tsx
|
|
520
|
-
function
|
|
521
|
-
let { view: s, viewValue: l, changeViewValue: f, startWeek: p } =
|
|
520
|
+
function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, className: a, ...o }) {
|
|
521
|
+
let { view: s, viewValue: l, changeViewValue: f, startWeek: p } = J(), m = K(), h = Ge(), { getStartOfWeek: g, getStartOfMonth: _, addMonths: v } = m, [y, b] = d(!1), [x, S] = d(() => _(l)), C = u(null), { refs: w, floatingStyles: T } = Re({
|
|
522
522
|
placement: "bottom",
|
|
523
523
|
middleware: [
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
Ie(6),
|
|
525
|
+
Fe({ padding: 8 }),
|
|
526
|
+
Le({ padding: 8 })
|
|
527
527
|
],
|
|
528
|
-
whileElementsMounted:
|
|
528
|
+
whileElementsMounted: Pe
|
|
529
529
|
});
|
|
530
530
|
i(() => {
|
|
531
531
|
y && S(_(l));
|
|
@@ -541,82 +541,82 @@ function Dt({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
|
|
|
541
541
|
};
|
|
542
542
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
543
543
|
}, [y, w.floating]);
|
|
544
|
-
let E = c(() => e ? e(l, s) :
|
|
544
|
+
let E = c(() => e ? e(l, s) : le(m, s, l, p), [
|
|
545
545
|
m,
|
|
546
546
|
e,
|
|
547
547
|
p,
|
|
548
548
|
s,
|
|
549
549
|
l
|
|
550
|
-
]), O = c(() =>
|
|
550
|
+
]), O = c(() => L(m, x, p), [
|
|
551
551
|
m,
|
|
552
552
|
x,
|
|
553
553
|
p
|
|
554
554
|
]), k = (e) => {
|
|
555
555
|
n?.(e), b((e) => !e);
|
|
556
|
-
},
|
|
556
|
+
}, A = (e) => {
|
|
557
557
|
r?.(e), e.key === "Escape" && b(!1);
|
|
558
|
-
},
|
|
558
|
+
}, j = (e) => {
|
|
559
559
|
f(s === "week" ? g(e, p) : e, s), b(!1);
|
|
560
560
|
};
|
|
561
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ G("div", {
|
|
562
562
|
ref: C,
|
|
563
|
-
className:
|
|
564
|
-
children: [/* @__PURE__ */
|
|
563
|
+
className: Y.root,
|
|
564
|
+
children: [/* @__PURE__ */ G("button", {
|
|
565
565
|
type: t,
|
|
566
566
|
"aria-label": h.chooseDate,
|
|
567
567
|
"aria-expanded": y,
|
|
568
568
|
"aria-haspopup": "dialog",
|
|
569
569
|
...o,
|
|
570
570
|
onClick: k,
|
|
571
|
-
onKeyDown:
|
|
571
|
+
onKeyDown: A,
|
|
572
572
|
ref: w.setReference,
|
|
573
|
-
className: D(a,
|
|
574
|
-
children: [/* @__PURE__ */
|
|
575
|
-
className:
|
|
573
|
+
className: D(a, Y.root__toggle),
|
|
574
|
+
children: [/* @__PURE__ */ W("span", {
|
|
575
|
+
className: Y.root__toggleLabel,
|
|
576
576
|
children: E
|
|
577
|
-
}), /* @__PURE__ */
|
|
578
|
-
}), y && /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ W(yt, { className: D(Y.root__toggleIcon, { [Y.root__toggleIcon_open]: y }) })]
|
|
578
|
+
}), y && /* @__PURE__ */ W(Tt, { children: /* @__PURE__ */ G("div", {
|
|
579
579
|
ref: w.setFloating,
|
|
580
580
|
style: T,
|
|
581
581
|
role: "dialog",
|
|
582
582
|
"aria-label": h.chooseDate,
|
|
583
|
-
className:
|
|
584
|
-
children: [/* @__PURE__ */
|
|
585
|
-
className:
|
|
583
|
+
className: Y.popover,
|
|
584
|
+
children: [/* @__PURE__ */ G("div", {
|
|
585
|
+
className: Y.popover__header,
|
|
586
586
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ W("button", {
|
|
588
588
|
type: "button",
|
|
589
589
|
"aria-label": h.previousMonth,
|
|
590
590
|
onClick: () => S((e) => v(e, -1)),
|
|
591
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */ W(yt, { className: Y.popover__navBackward })
|
|
592
592
|
}),
|
|
593
|
-
/* @__PURE__ */
|
|
594
|
-
className:
|
|
595
|
-
children:
|
|
593
|
+
/* @__PURE__ */ W("div", {
|
|
594
|
+
className: Y.popover__title,
|
|
595
|
+
children: ee(m, x)
|
|
596
596
|
}),
|
|
597
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ W("button", {
|
|
598
598
|
type: "button",
|
|
599
599
|
"aria-label": h.nextMonth,
|
|
600
600
|
onClick: () => S((e) => v(e, 1)),
|
|
601
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ W(yt, { className: Y.popover__navForward })
|
|
602
602
|
})
|
|
603
603
|
]
|
|
604
|
-
}), /* @__PURE__ */
|
|
605
|
-
className:
|
|
606
|
-
children: [O.slice(0, 7).map((e) => /* @__PURE__ */
|
|
607
|
-
className:
|
|
604
|
+
}), /* @__PURE__ */ G("div", {
|
|
605
|
+
className: Y.popover__grid,
|
|
606
|
+
children: [O.slice(0, 7).map((e) => /* @__PURE__ */ W("div", {
|
|
607
|
+
className: Y.popover__weekday,
|
|
608
608
|
children: m.weekDayShortName(m.getWeekDay(e))
|
|
609
609
|
}, m.getWeekDay(e))), O.map((e, t) => {
|
|
610
|
-
let n = m.getMonths(e) !== m.getMonths(x), r = m.isToday(e), i = s !== "month" &&
|
|
611
|
-
return /* @__PURE__ */
|
|
610
|
+
let n = m.getMonths(e) !== m.getMonths(x), r = m.isToday(e), i = s !== "month" && me(m, s, l, e), a = i && (s === "day" || t % 7 == 0), o = i && (s === "day" || t % 7 == 6);
|
|
611
|
+
return /* @__PURE__ */ W("button", {
|
|
612
612
|
type: "button",
|
|
613
|
-
onClick: () =>
|
|
614
|
-
className: D(
|
|
615
|
-
[
|
|
616
|
-
[
|
|
617
|
-
[
|
|
618
|
-
[
|
|
619
|
-
[
|
|
613
|
+
onClick: () => j(e),
|
|
614
|
+
className: D(Y.popover__day, {
|
|
615
|
+
[Y.popover__day_outside]: n,
|
|
616
|
+
[Y.popover__day_today]: r,
|
|
617
|
+
[Y.popover__day_selected]: i,
|
|
618
|
+
[Y.popover__day_rangeStart]: a,
|
|
619
|
+
[Y.popover__day_rangeEnd]: o
|
|
620
620
|
}),
|
|
621
621
|
children: m.getMonthDay(e)
|
|
622
622
|
}, m.toMillis(e));
|
|
@@ -625,30 +625,30 @@ function Dt({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
|
|
|
625
625
|
}) })]
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
|
-
var
|
|
628
|
+
var Dt = {
|
|
629
629
|
root: "_root_l1csz_1",
|
|
630
630
|
root__icon: "_root__icon_l1csz_21",
|
|
631
631
|
root__icon_forward: "_root__icon_forward_l1csz_25",
|
|
632
632
|
root__icon_backward: "_root__icon_backward_l1csz_29"
|
|
633
633
|
};
|
|
634
634
|
// src/components/nav-btn/NavBtn.tsx
|
|
635
|
-
function
|
|
636
|
-
let { goForward: o, goBackward: s } =
|
|
635
|
+
function Ot({ direction: e = "forward", type: t = "button", onClick: n, className: r, children: i, ...a }) {
|
|
636
|
+
let { goForward: o, goBackward: s } = J(), c = Ge(), l = q(ve(n, () => {
|
|
637
637
|
e === "forward" ? o() : e === "backward" && s();
|
|
638
638
|
}));
|
|
639
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ W("button", {
|
|
640
640
|
type: t,
|
|
641
641
|
"aria-label": e === "forward" ? c.next : c.previous,
|
|
642
642
|
...a,
|
|
643
643
|
onClick: l,
|
|
644
|
-
className: D(r,
|
|
645
|
-
children: i ?? /* @__PURE__ */
|
|
646
|
-
[
|
|
647
|
-
[
|
|
644
|
+
className: D(r, Dt.root),
|
|
645
|
+
children: i ?? /* @__PURE__ */ W(yt, { className: D(Dt.root__icon, {
|
|
646
|
+
[Dt.root__icon_backward]: e === "backward",
|
|
647
|
+
[Dt.root__icon_forward]: e === "forward"
|
|
648
648
|
}) })
|
|
649
649
|
});
|
|
650
650
|
}
|
|
651
|
-
var
|
|
651
|
+
var kt = {
|
|
652
652
|
root: "_root_1n590_1",
|
|
653
653
|
root__icon: "_root__icon_1n590_25",
|
|
654
654
|
root__icon_open: "_root__icon_open_1n590_32",
|
|
@@ -656,20 +656,20 @@ var At = {
|
|
|
656
656
|
list__option: "_list__option_1n590_48",
|
|
657
657
|
list__option_active: "_list__option_active_1n590_67",
|
|
658
658
|
list__check: "_list__check_1n590_75"
|
|
659
|
-
},
|
|
659
|
+
}, At = [
|
|
660
660
|
"day",
|
|
661
661
|
"week",
|
|
662
662
|
"month"
|
|
663
663
|
];
|
|
664
|
-
function
|
|
665
|
-
let { view: t, changeView: n } =
|
|
664
|
+
function jt({ className: e }) {
|
|
665
|
+
let { view: t, changeView: n } = J(), r = Ge(), { addGlobalListener: o, removeGlobalListener: s } = it(), c = a(), [l, f] = d(!1), [p, m] = d(t), h = u(/* @__PURE__ */ new Map()), { refs: g, floatingStyles: _ } = Re({
|
|
666
666
|
placement: "bottom-end",
|
|
667
667
|
middleware: [
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
668
|
+
Ie(6),
|
|
669
|
+
Fe({ padding: 8 }),
|
|
670
|
+
Le({ padding: 8 })
|
|
671
671
|
],
|
|
672
|
-
whileElementsMounted:
|
|
672
|
+
whileElementsMounted: Pe
|
|
673
673
|
}), v = (e) => {
|
|
674
674
|
f(!1);
|
|
675
675
|
let t = g.reference.current;
|
|
@@ -698,43 +698,43 @@ function Mt({ className: e }) {
|
|
|
698
698
|
let x = (e) => {
|
|
699
699
|
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), y());
|
|
700
700
|
}, S = (e) => {
|
|
701
|
-
let t =
|
|
702
|
-
e.preventDefault(), m(
|
|
701
|
+
let t = At.indexOf(p), n = (t) => {
|
|
702
|
+
e.preventDefault(), m(At[(t + At.length) % At.length] ?? p);
|
|
703
703
|
};
|
|
704
704
|
switch (e.key) {
|
|
705
705
|
case "ArrowDown": return n(t + 1);
|
|
706
706
|
case "ArrowUp": return n(t - 1);
|
|
707
707
|
case "Home": return n(0);
|
|
708
|
-
case "End": return n(
|
|
708
|
+
case "End": return n(At.length - 1);
|
|
709
709
|
case "Enter":
|
|
710
710
|
case " ": return e.preventDefault(), b(p);
|
|
711
711
|
case "Escape": return e.preventDefault(), v(!0);
|
|
712
712
|
case "Tab": return v(!1);
|
|
713
713
|
}
|
|
714
714
|
}, C = `${c}-list`;
|
|
715
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ G(ze, { children: [/* @__PURE__ */ G("button", {
|
|
716
716
|
ref: g.setReference,
|
|
717
717
|
type: "button",
|
|
718
718
|
"aria-haspopup": "listbox",
|
|
719
719
|
"aria-expanded": l,
|
|
720
720
|
"aria-controls": l ? C : void 0,
|
|
721
721
|
"aria-label": `${r.chooseView}: ${r[t]}`,
|
|
722
|
-
className: D(e,
|
|
722
|
+
className: D(e, kt.root),
|
|
723
723
|
onClick: () => l ? v(!1) : y(),
|
|
724
724
|
onKeyDown: x,
|
|
725
|
-
children: [r[t], /* @__PURE__ */
|
|
725
|
+
children: [r[t], /* @__PURE__ */ W(yt, {
|
|
726
726
|
"aria-hidden": "true",
|
|
727
|
-
className: D(
|
|
727
|
+
className: D(kt.root__icon, { [kt.root__icon_open]: l })
|
|
728
728
|
})]
|
|
729
|
-
}), l && /* @__PURE__ */
|
|
729
|
+
}), l && /* @__PURE__ */ W(Tt, { children: /* @__PURE__ */ W("div", {
|
|
730
730
|
ref: g.setFloating,
|
|
731
731
|
id: C,
|
|
732
732
|
role: "listbox",
|
|
733
733
|
"aria-label": r.chooseView,
|
|
734
734
|
style: _,
|
|
735
|
-
className:
|
|
735
|
+
className: kt.list,
|
|
736
736
|
onKeyDown: S,
|
|
737
|
-
children:
|
|
737
|
+
children: At.map((e) => /* @__PURE__ */ G("div", {
|
|
738
738
|
ref: (t) => {
|
|
739
739
|
t ? h.current.set(e, t) : h.current.delete(e);
|
|
740
740
|
},
|
|
@@ -742,16 +742,16 @@ function Mt({ className: e }) {
|
|
|
742
742
|
role: "option",
|
|
743
743
|
tabIndex: -1,
|
|
744
744
|
"aria-selected": e === t,
|
|
745
|
-
className: D(
|
|
745
|
+
className: D(kt.list__option, { [kt.list__option_active]: e === p }),
|
|
746
746
|
onClick: () => b(e),
|
|
747
747
|
onPointerMove: () => m(e),
|
|
748
|
-
children: [r[e], e === t && /* @__PURE__ */
|
|
748
|
+
children: [r[e], e === t && /* @__PURE__ */ W("svg", {
|
|
749
749
|
"aria-hidden": "true",
|
|
750
|
-
className:
|
|
750
|
+
className: kt.list__check,
|
|
751
751
|
viewBox: "0 0 16 16",
|
|
752
752
|
width: "14",
|
|
753
753
|
height: "14",
|
|
754
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ W("path", {
|
|
755
755
|
d: "M3 8.5 6.5 12 13 4.5",
|
|
756
756
|
fill: "none",
|
|
757
757
|
stroke: "currentColor",
|
|
@@ -763,7 +763,7 @@ function Mt({ className: e }) {
|
|
|
763
763
|
}, e))
|
|
764
764
|
}) })] });
|
|
765
765
|
}
|
|
766
|
-
var
|
|
766
|
+
var X = {
|
|
767
767
|
root: "_root_1lvdm_1",
|
|
768
768
|
root__navigationPane: "_root__navigationPane_1lvdm_12",
|
|
769
769
|
root__viewList: "_root__viewList_1lvdm_13",
|
|
@@ -774,79 +774,79 @@ var Y = {
|
|
|
774
774
|
root__viewSelect: "_root__viewSelect_1lvdm_89"
|
|
775
775
|
};
|
|
776
776
|
// src/components/calendar-toolbar/CalendarToolbar.tsx
|
|
777
|
-
function
|
|
778
|
-
let { goToday: t, changeView: n, view: r } =
|
|
777
|
+
function Mt(e) {
|
|
778
|
+
let { goToday: t, changeView: n, view: r } = J(), i = Ge(), a = e, o = {
|
|
779
779
|
day: {
|
|
780
780
|
type: "button",
|
|
781
781
|
"aria-selected": r === "day",
|
|
782
|
-
onClick:
|
|
783
|
-
className: D(
|
|
782
|
+
onClick: ve(void 0, () => n("day")),
|
|
783
|
+
className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "day" }),
|
|
784
784
|
children: i.day
|
|
785
785
|
},
|
|
786
786
|
week: {
|
|
787
787
|
type: "button",
|
|
788
788
|
"aria-selected": r === "week",
|
|
789
|
-
onClick:
|
|
790
|
-
className: D(
|
|
789
|
+
onClick: ve(void 0, () => n("week")),
|
|
790
|
+
className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "week" }),
|
|
791
791
|
children: i.week
|
|
792
792
|
},
|
|
793
793
|
month: {
|
|
794
794
|
type: "button",
|
|
795
795
|
"aria-selected": r === "month",
|
|
796
|
-
onClick:
|
|
797
|
-
className: D(
|
|
796
|
+
onClick: ve(void 0, () => n("month")),
|
|
797
|
+
className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "month" }),
|
|
798
798
|
children: i.month
|
|
799
799
|
}
|
|
800
800
|
}, s = {
|
|
801
801
|
type: "button",
|
|
802
|
-
onClick:
|
|
803
|
-
className:
|
|
802
|
+
onClick: q(t),
|
|
803
|
+
className: X.root__today,
|
|
804
804
|
children: i.today
|
|
805
805
|
};
|
|
806
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ G("div", {
|
|
807
807
|
...a,
|
|
808
|
-
className: D(a.className,
|
|
808
|
+
className: D(a.className, X.root),
|
|
809
809
|
children: [
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
className:
|
|
810
|
+
/* @__PURE__ */ W(Et, {}),
|
|
811
|
+
/* @__PURE__ */ G("div", {
|
|
812
|
+
className: X.root__navigationPane,
|
|
813
813
|
role: "group",
|
|
814
814
|
children: [
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ W(Ot, { direction: "backward" }),
|
|
816
|
+
/* @__PURE__ */ W("button", { ...s }),
|
|
817
|
+
/* @__PURE__ */ W(Ot, { direction: "forward" })
|
|
818
818
|
]
|
|
819
819
|
}),
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
className:
|
|
820
|
+
/* @__PURE__ */ G("div", {
|
|
821
|
+
className: X.root__viewList,
|
|
822
822
|
children: [
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ W("button", { ...o.day }),
|
|
824
|
+
/* @__PURE__ */ W("button", { ...o.week }),
|
|
825
|
+
/* @__PURE__ */ W("button", { ...o.month })
|
|
826
826
|
]
|
|
827
827
|
}),
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
className:
|
|
830
|
-
children: /* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ W("div", {
|
|
829
|
+
className: X.root__viewSelect,
|
|
830
|
+
children: /* @__PURE__ */ W(jt, {})
|
|
831
831
|
})
|
|
832
832
|
]
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
835
|
// src/contexts/CalendarViewportContext.ts
|
|
836
|
-
var
|
|
837
|
-
|
|
838
|
-
function
|
|
839
|
-
let e = r(
|
|
836
|
+
var Nt = e(void 0);
|
|
837
|
+
U && (Nt.displayName = "CalendarViewportContext");
|
|
838
|
+
function Pt() {
|
|
839
|
+
let e = r(Nt);
|
|
840
840
|
if (!e) throw Error("CalendarViewportContext is required");
|
|
841
841
|
return e;
|
|
842
842
|
}
|
|
843
|
-
var
|
|
843
|
+
var Ft = { root: "_root_i43d6_1" };
|
|
844
844
|
// src/components/pointer-popover/PointerPopover.tsx
|
|
845
|
-
function
|
|
846
|
-
return /* @__PURE__ */
|
|
845
|
+
function It({ coordinates: e, className: t, style: n, ...r }) {
|
|
846
|
+
return /* @__PURE__ */ W("span", {
|
|
847
847
|
tabIndex: -1,
|
|
848
848
|
...r,
|
|
849
|
-
className: D(t,
|
|
849
|
+
className: D(t, Ft.root),
|
|
850
850
|
style: {
|
|
851
851
|
...n,
|
|
852
852
|
...e ? {
|
|
@@ -856,18 +856,18 @@ function Lt({ coordinates: e, className: t, style: n, ...r }) {
|
|
|
856
856
|
}
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
|
-
var
|
|
859
|
+
var Lt = {
|
|
860
860
|
root: "_root_mqfwg_1",
|
|
861
861
|
root_isDragging: "_root_isDragging_mqfwg_11",
|
|
862
862
|
root_isReturning: "_root_isReturning_mqfwg_20",
|
|
863
863
|
"ww-drag-return": "_ww-drag-return_mqfwg_36",
|
|
864
864
|
root_isBlocked: "_root_isBlocked_mqfwg_33"
|
|
865
|
-
},
|
|
865
|
+
}, Rt = {
|
|
866
866
|
isStart: !0,
|
|
867
867
|
isEnd: !0
|
|
868
868
|
};
|
|
869
|
-
function
|
|
870
|
-
let { eventMap:
|
|
869
|
+
function zt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
|
|
870
|
+
let { eventMap: r, eventRenderer: i, pointerPreviewRenderer: a, view: o } = J(), { viewportRef: s } = Pt(), { isDragging: l, canDrop: f, dropData: p, eventItem: m, source: h, x: g, y: _, ...v } = Ne(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
|
|
871
871
|
let i = [...n.dropTargets.values()].shift(), a = [...e.dragTargets.values()].shift();
|
|
872
872
|
return {
|
|
873
873
|
...t.transform,
|
|
@@ -879,20 +879,20 @@ function Bt({ showPreview: e = !0, ...t }) {
|
|
|
879
879
|
x: e.x,
|
|
880
880
|
y: e.y
|
|
881
881
|
};
|
|
882
|
-
}),
|
|
883
|
-
if (!
|
|
884
|
-
let { key: e } = JSON.parse(
|
|
885
|
-
return
|
|
886
|
-
}, [
|
|
887
|
-
if (
|
|
888
|
-
if (!
|
|
889
|
-
|
|
882
|
+
}), y = c(() => {
|
|
883
|
+
if (!m) return null;
|
|
884
|
+
let { key: e } = JSON.parse(m.event);
|
|
885
|
+
return r.get(e)?.value ?? null;
|
|
886
|
+
}, [m, r]), b = u(null), [x, S] = d(null);
|
|
887
|
+
if (Ke(() => {
|
|
888
|
+
if (!l || p) {
|
|
889
|
+
b.current = l ? v : null, S(null);
|
|
890
890
|
return;
|
|
891
891
|
}
|
|
892
|
-
let e =
|
|
893
|
-
if (
|
|
894
|
-
let n =
|
|
895
|
-
|
|
892
|
+
let e = b.current, t = s.current;
|
|
893
|
+
if (x || !e || !h || !t) return;
|
|
894
|
+
let n = h.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
895
|
+
S({
|
|
896
896
|
container: t,
|
|
897
897
|
style: {
|
|
898
898
|
left: n.left - r.left,
|
|
@@ -905,47 +905,47 @@ function Bt({ showPreview: e = !0, ...t }) {
|
|
|
905
905
|
"--ww-return-height": `${e.height}px`
|
|
906
906
|
}
|
|
907
907
|
});
|
|
908
|
-
}), !
|
|
909
|
-
if (!
|
|
910
|
-
container:
|
|
911
|
-
children: /* @__PURE__ */
|
|
912
|
-
...
|
|
913
|
-
className: D(
|
|
914
|
-
style:
|
|
915
|
-
children:
|
|
908
|
+
}), !l) return null;
|
|
909
|
+
if (!p) return x ? /* @__PURE__ */ W(Tt, {
|
|
910
|
+
container: x.container,
|
|
911
|
+
children: /* @__PURE__ */ W("div", {
|
|
912
|
+
...n,
|
|
913
|
+
className: D(n.className, Lt.root, Lt.root_isReturning),
|
|
914
|
+
style: x.style,
|
|
915
|
+
children: y == null ? null : i.current?.(y, o, Rt)
|
|
916
916
|
})
|
|
917
917
|
}) : null;
|
|
918
|
-
let
|
|
919
|
-
return /* @__PURE__ */
|
|
920
|
-
container:
|
|
921
|
-
children: [/* @__PURE__ */
|
|
922
|
-
...
|
|
923
|
-
className: D(
|
|
924
|
-
[
|
|
925
|
-
[
|
|
918
|
+
let C = !f;
|
|
919
|
+
return /* @__PURE__ */ G(Tt, {
|
|
920
|
+
container: s.current,
|
|
921
|
+
children: [/* @__PURE__ */ W("div", {
|
|
922
|
+
...n,
|
|
923
|
+
className: D(n.className, Lt.root, {
|
|
924
|
+
[Lt.root_isDragging]: l,
|
|
925
|
+
[Lt.root_isBlocked]: C
|
|
926
926
|
}),
|
|
927
|
-
style: { ...
|
|
928
|
-
children:
|
|
929
|
-
}), e && !
|
|
927
|
+
style: { ...v },
|
|
928
|
+
children: y == null ? null : i.current?.(y, o, Rt)
|
|
929
|
+
}), e && !C && /* @__PURE__ */ W(It, {
|
|
930
930
|
coordinates: {
|
|
931
|
-
x:
|
|
932
|
-
y:
|
|
931
|
+
x: g,
|
|
932
|
+
y: _
|
|
933
933
|
},
|
|
934
|
-
children:
|
|
934
|
+
children: p ? a.current?.(p.date, Math.round(v.top / t), Math.round(v.height / t)) : null
|
|
935
935
|
})]
|
|
936
936
|
});
|
|
937
937
|
}
|
|
938
938
|
// src/components/month-view/MonthView.utils.ts
|
|
939
|
-
function
|
|
939
|
+
function Bt(e, t) {
|
|
940
940
|
return {
|
|
941
941
|
...t,
|
|
942
942
|
...e
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Vt(e) {
|
|
946
946
|
return Array.from({ length: Math.ceil(e.length / 7) }, (t, n) => e.slice(n * 7, n * 7 + 7));
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function Ht(e, t, n) {
|
|
949
949
|
let r = e?.querySelectorAll("[data-day-index]") ?? [], i = -1, a = 1e400;
|
|
950
950
|
for (let e of r) {
|
|
951
951
|
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);
|
|
@@ -953,7 +953,7 @@ function Ut(e, t, n) {
|
|
|
953
953
|
}
|
|
954
954
|
return i;
|
|
955
955
|
}
|
|
956
|
-
var
|
|
956
|
+
var Z = {
|
|
957
957
|
root: "_root_diwsf_1",
|
|
958
958
|
root__head: "_root__head_diwsf_10",
|
|
959
959
|
root__weekday: "_root__weekday_diwsf_20",
|
|
@@ -978,8 +978,8 @@ var X = {
|
|
|
978
978
|
root__more: "_root__more_diwsf_228"
|
|
979
979
|
};
|
|
980
980
|
// src/components/month-view/MonthViewDay.tsx
|
|
981
|
-
function
|
|
982
|
-
let { ref: t, targetDate: n, children: r, onDoubleClick: a, ...o } = e, { onEventChange: s, onEventCreate: c, getIsDayDisabled: l, disabled: d, eventMap: f } =
|
|
981
|
+
function Ut(e) {
|
|
982
|
+
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 } = Ne(({ registerDropTarget: e, isOver: t }) => ({
|
|
983
983
|
register: e,
|
|
984
984
|
isOver: t(_.current)
|
|
985
985
|
}));
|
|
@@ -993,7 +993,7 @@ function Wt(e) {
|
|
|
993
993
|
return JSON.parse(t);
|
|
994
994
|
})), r = t && f.get(t.key);
|
|
995
995
|
if (!r) return;
|
|
996
|
-
let i = p.fromMillis(t.day ?? t.date), a =
|
|
996
|
+
let i = p.fromMillis(t.day ?? t.date), a = ke(p, i, n) / 1440;
|
|
997
997
|
a !== 0 && s(r.key, p.addDays(p.getStartOfDay(r.date), a), {
|
|
998
998
|
from: m(r.date) * 60 + h(r.date),
|
|
999
999
|
duration: r.duration
|
|
@@ -1012,24 +1012,24 @@ function Wt(e) {
|
|
|
1012
1012
|
v,
|
|
1013
1013
|
n
|
|
1014
1014
|
]);
|
|
1015
|
-
let b =
|
|
1015
|
+
let b = q((e) => {
|
|
1016
1016
|
if (a?.(e), e.defaultPrevented || d || l && l(n)) return;
|
|
1017
1017
|
let t = g();
|
|
1018
1018
|
c(n, {
|
|
1019
1019
|
from: m(t) * 60 + h(t),
|
|
1020
1020
|
duration: 60
|
|
1021
1021
|
});
|
|
1022
|
-
}), x =
|
|
1023
|
-
return /* @__PURE__ */
|
|
1022
|
+
}), x = st(_, t);
|
|
1023
|
+
return /* @__PURE__ */ W("div", {
|
|
1024
1024
|
...o,
|
|
1025
1025
|
ref: x,
|
|
1026
1026
|
onDoubleClick: b,
|
|
1027
|
-
className: D(o.className,
|
|
1027
|
+
className: D(o.className, Z.root__day, { [Z.root__day_isOver]: y }),
|
|
1028
1028
|
children: r
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
1031
|
// src/hooks/useInterval.ts
|
|
1032
|
-
function
|
|
1032
|
+
function Wt() {
|
|
1033
1033
|
let e = u(null);
|
|
1034
1034
|
return [n((t, n) => {
|
|
1035
1035
|
e.current = setInterval(t, n);
|
|
@@ -1038,7 +1038,7 @@ function Gt() {
|
|
|
1038
1038
|
}, [])];
|
|
1039
1039
|
}
|
|
1040
1040
|
// src/hooks/useScrollIntent.ts
|
|
1041
|
-
var
|
|
1041
|
+
var Gt = {
|
|
1042
1042
|
x: {
|
|
1043
1043
|
[-1]: !1,
|
|
1044
1044
|
1: !1
|
|
@@ -1048,10 +1048,10 @@ var Kt = {
|
|
|
1048
1048
|
1: !1
|
|
1049
1049
|
}
|
|
1050
1050
|
};
|
|
1051
|
-
function
|
|
1052
|
-
let n =
|
|
1053
|
-
return
|
|
1054
|
-
if (t || !n || !r) return
|
|
1051
|
+
function Kt({ delta: e, disabled: t }) {
|
|
1052
|
+
let n = lt(e);
|
|
1053
|
+
return Xe((r) => {
|
|
1054
|
+
if (t || !n || !r) return Gt;
|
|
1055
1055
|
let i = {
|
|
1056
1056
|
x: Math.sign(e.x - n.x),
|
|
1057
1057
|
y: Math.sign(e.y - n.y)
|
|
@@ -1073,8 +1073,8 @@ function qt({ delta: e, disabled: t }) {
|
|
|
1073
1073
|
]);
|
|
1074
1074
|
}
|
|
1075
1075
|
// src/hooks/useAutoScroller.ts
|
|
1076
|
-
function
|
|
1077
|
-
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] =
|
|
1076
|
+
function qt(e) {
|
|
1077
|
+
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] = Wt(), y = Kt({
|
|
1078
1078
|
delta: f,
|
|
1079
1079
|
disabled: !o
|
|
1080
1080
|
}), b = u({
|
|
@@ -1115,7 +1115,7 @@ function Jt(e) {
|
|
|
1115
1115
|
if (!i || a?.(i) === !1) continue;
|
|
1116
1116
|
let e = n[r];
|
|
1117
1117
|
if (!e) continue;
|
|
1118
|
-
let { direction: o, speed: c } =
|
|
1118
|
+
let { direction: o, speed: c } = ne(i, e, w, t, p);
|
|
1119
1119
|
for (let e of ["x", "y"]) y[e][o[e]] || (c[e] = 0, o[e] = 0);
|
|
1120
1120
|
if (c.x > 0 || c.y > 0) {
|
|
1121
1121
|
v(), _(T, s), S.current = i, b.current = c, x.current = o;
|
|
@@ -1148,7 +1148,7 @@ function Jt(e) {
|
|
|
1148
1148
|
]);
|
|
1149
1149
|
}
|
|
1150
1150
|
// src/hooks/useMutationObserver.ts
|
|
1151
|
-
function
|
|
1151
|
+
function Jt(e, t = !1) {
|
|
1152
1152
|
let n = u(e);
|
|
1153
1153
|
n.current = e;
|
|
1154
1154
|
let r = c(() => {
|
|
@@ -1159,17 +1159,17 @@ function Yt(e, t = !1) {
|
|
|
1159
1159
|
return i(() => () => r?.disconnect(), [r]), r;
|
|
1160
1160
|
}
|
|
1161
1161
|
// src/hooks/useRect.ts
|
|
1162
|
-
function
|
|
1163
|
-
let [r, i] = l(s, null), a =
|
|
1162
|
+
function Yt(e, t = P, n) {
|
|
1163
|
+
let [r, i] = l(s, null), a = Jt((t) => {
|
|
1164
1164
|
if (e) for (let n of t) {
|
|
1165
1165
|
let { type: t, target: r } = n;
|
|
1166
|
-
if (t === "childList" &&
|
|
1166
|
+
if (t === "childList" && pe(r) && r.contains(e)) {
|
|
1167
1167
|
i();
|
|
1168
1168
|
break;
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
}), o =
|
|
1172
|
-
return
|
|
1171
|
+
}), o = qe(i);
|
|
1172
|
+
return Ke(() => {
|
|
1173
1173
|
i(), e ? (o?.observe(e), a?.observe(document.body, {
|
|
1174
1174
|
childList: !0,
|
|
1175
1175
|
subtree: !0
|
|
@@ -1183,28 +1183,28 @@ function Xt(e, t = F, n) {
|
|
|
1183
1183
|
if (!e) return null;
|
|
1184
1184
|
if (e.isConnected === !1) return r ?? n ?? null;
|
|
1185
1185
|
let i = t(e);
|
|
1186
|
-
return
|
|
1186
|
+
return Ee(i, r) ? r : i;
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
// src/hooks/useScrollableAncestors.ts
|
|
1190
|
-
var
|
|
1191
|
-
function
|
|
1192
|
-
let n = u(e), r = c(() => e ?
|
|
1190
|
+
var Xt = [];
|
|
1191
|
+
function Zt(e, t) {
|
|
1192
|
+
let n = u(e), r = c(() => e ? re(e, t) : Xt, [e, t]);
|
|
1193
1193
|
return i(() => {
|
|
1194
1194
|
n.current = e;
|
|
1195
1195
|
}, [e]), r;
|
|
1196
1196
|
}
|
|
1197
1197
|
// src/hooks/useScrollableAncestorsRects.ts
|
|
1198
|
-
var
|
|
1199
|
-
function
|
|
1200
|
-
let [n, r] = l(a,
|
|
1201
|
-
return e.length > 0 && n ===
|
|
1198
|
+
var Qt = [];
|
|
1199
|
+
function $t(e, t = P) {
|
|
1200
|
+
let [n, r] = l(a, Qt), i = qe(r);
|
|
1201
|
+
return e.length > 0 && n === Qt && r(), Ke(() => {
|
|
1202
1202
|
e.length ? e.forEach((e) => i?.observe(e)) : (i?.disconnect(), r());
|
|
1203
1203
|
}, [e, i]), n;
|
|
1204
1204
|
function a() {
|
|
1205
1205
|
return e.length ? e.map((e) => {
|
|
1206
1206
|
if (e === document.scrollingElement) {
|
|
1207
|
-
let t =
|
|
1207
|
+
let t = fe(e), n = t.innerWidth, r = t.innerHeight;
|
|
1208
1208
|
return {
|
|
1209
1209
|
top: 0,
|
|
1210
1210
|
left: 0,
|
|
@@ -1215,23 +1215,23 @@ function en(e, t = F) {
|
|
|
1215
1215
|
};
|
|
1216
1216
|
}
|
|
1217
1217
|
return new h(t(e), e);
|
|
1218
|
-
}) :
|
|
1218
|
+
}) : Qt;
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
// src/hooks/useScrollOffsets.ts
|
|
1222
|
-
function
|
|
1222
|
+
function en(e) {
|
|
1223
1223
|
let [t, r] = d(null), a = u(e), o = n((e) => {
|
|
1224
|
-
let t =
|
|
1225
|
-
t && r((e) => e ? (e.set(t,
|
|
1224
|
+
let t = ie(e.target);
|
|
1225
|
+
t && r((e) => e ? (e.set(t, V(t)), new Map(e)) : null);
|
|
1226
1226
|
}, []);
|
|
1227
1227
|
return i(() => {
|
|
1228
1228
|
let t = a.current;
|
|
1229
1229
|
if (e !== t) {
|
|
1230
1230
|
n(t);
|
|
1231
1231
|
let i = e.map((e) => {
|
|
1232
|
-
let t =
|
|
1233
|
-
return t ? (t.addEventListener("scroll", o, { passive: !0 }), [t,
|
|
1234
|
-
}).filter((e) =>
|
|
1232
|
+
let t = ie(e);
|
|
1233
|
+
return t ? (t.addEventListener("scroll", o, { passive: !0 }), [t, V(t)]) : null;
|
|
1234
|
+
}).filter((e) => he(e));
|
|
1235
1235
|
r(i.length ? new Map(i) : null), a.current = e;
|
|
1236
1236
|
}
|
|
1237
1237
|
return () => {
|
|
@@ -1239,24 +1239,24 @@ function tn(e) {
|
|
|
1239
1239
|
};
|
|
1240
1240
|
function n(e) {
|
|
1241
1241
|
e.forEach((e) => {
|
|
1242
|
-
let t =
|
|
1242
|
+
let t = ie(e);
|
|
1243
1243
|
t && t.removeEventListener("scroll", o);
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
|
-
}, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => _(e, t), O) :
|
|
1246
|
+
}, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => _(e, t), O) : H(e) : O, [e, t]);
|
|
1247
1247
|
}
|
|
1248
1248
|
// src/hooks/useScrollOffsetsDelta.ts
|
|
1249
|
-
function
|
|
1249
|
+
function tn(e, t = k) {
|
|
1250
1250
|
let n = u(null);
|
|
1251
1251
|
return i(() => {
|
|
1252
1252
|
n.current = null;
|
|
1253
1253
|
}, t), i(() => {
|
|
1254
1254
|
let t = e !== O;
|
|
1255
1255
|
t && !n.current && (n.current = e), !t && n.current && (n.current = null);
|
|
1256
|
-
}, [e]), n.current ?
|
|
1256
|
+
}, [e]), n.current ? Oe(e, n.current) : O;
|
|
1257
1257
|
}
|
|
1258
1258
|
// src/hooks/useMoveTransform.ts
|
|
1259
|
-
var
|
|
1259
|
+
var nn = {
|
|
1260
1260
|
Start: "start",
|
|
1261
1261
|
Move: "move",
|
|
1262
1262
|
Stop: "stop"
|
|
@@ -1277,7 +1277,7 @@ var Z = {
|
|
|
1277
1277
|
context: null
|
|
1278
1278
|
};
|
|
1279
1279
|
function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
|
|
1280
|
-
let [i, a] = l(on, rn), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u =
|
|
1280
|
+
let [i, a] = l(on, rn), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = Yt(i.isActive ? o : null), d = Yt(i.isActive ? s : null), f = Zt(i.isActive ? o : null), p = $t(f), m = tn(en(f)), h = c(() => {
|
|
1281
1281
|
let e = (e) => (t, n) => {
|
|
1282
1282
|
a({
|
|
1283
1283
|
type: e,
|
|
@@ -1286,12 +1286,12 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
|
|
|
1286
1286
|
});
|
|
1287
1287
|
};
|
|
1288
1288
|
return {
|
|
1289
|
-
start: e(
|
|
1290
|
-
move: e(
|
|
1291
|
-
stop: e(
|
|
1289
|
+
start: e(nn.Start),
|
|
1290
|
+
move: e(nn.Move),
|
|
1291
|
+
stop: e(nn.Stop)
|
|
1292
1292
|
};
|
|
1293
1293
|
}, []), g = _(i.initialTranslate, i.translate);
|
|
1294
|
-
|
|
1294
|
+
qt({
|
|
1295
1295
|
delta: i.translate,
|
|
1296
1296
|
enabled: e && i.isActive,
|
|
1297
1297
|
activeNodeRect: u,
|
|
@@ -1335,16 +1335,16 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
|
|
|
1335
1335
|
}
|
|
1336
1336
|
function on(e, t) {
|
|
1337
1337
|
let n = {
|
|
1338
|
-
[
|
|
1338
|
+
[nn.Start]: (e, { coordinates: t, context: n }) => ({
|
|
1339
1339
|
...e,
|
|
1340
1340
|
isActive: !0,
|
|
1341
|
-
currentAction:
|
|
1341
|
+
currentAction: nn.Start,
|
|
1342
1342
|
initialTranslate: { ...t },
|
|
1343
1343
|
context: n
|
|
1344
1344
|
}),
|
|
1345
|
-
[
|
|
1345
|
+
[nn.Move]: (e, { coordinates: t }) => ({
|
|
1346
1346
|
...e,
|
|
1347
|
-
currentAction:
|
|
1347
|
+
currentAction: nn.Move,
|
|
1348
1348
|
translate: {
|
|
1349
1349
|
x: t.x - e.initialTranslate.x,
|
|
1350
1350
|
y: t.y - e.initialTranslate.y
|
|
@@ -1354,17 +1354,17 @@ function on(e, t) {
|
|
|
1354
1354
|
y: t.y - (e.translate.y + e.initialTranslate.y)
|
|
1355
1355
|
}
|
|
1356
1356
|
}),
|
|
1357
|
-
[
|
|
1357
|
+
[nn.Stop]: () => ({
|
|
1358
1358
|
...rn,
|
|
1359
|
-
currentAction:
|
|
1359
|
+
currentAction: nn.Stop
|
|
1360
1360
|
})
|
|
1361
1361
|
};
|
|
1362
|
-
return
|
|
1362
|
+
return _e(t.type, n, e, t);
|
|
1363
1363
|
}
|
|
1364
1364
|
// src/components/month-view/MonthViewEvent.tsx
|
|
1365
1365
|
var sn = 6;
|
|
1366
1366
|
function cn(e) {
|
|
1367
|
-
let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } =
|
|
1367
|
+
let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } = J(), m = K(), { viewportRef: h } = Pt(), g = u(null), _ = u(null), { attributes: v, isDragging: y, overElement: b, register: x, setOverlayTransform: S } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
|
|
1368
1368
|
let a = i(g.current), [o] = a ? [...n.dropTargets].pop() ?? [null] : [null];
|
|
1369
1369
|
return {
|
|
1370
1370
|
attributes: t.attributes,
|
|
@@ -1373,7 +1373,7 @@ function cn(e) {
|
|
|
1373
1373
|
register: e,
|
|
1374
1374
|
setOverlayTransform: r
|
|
1375
1375
|
};
|
|
1376
|
-
}), C =
|
|
1376
|
+
}), C = Yt(y ? b : null), [{ transform: w, context: T }, E] = an({
|
|
1377
1377
|
autoScrollEnabled: !1,
|
|
1378
1378
|
activeNode: () => g.current,
|
|
1379
1379
|
containerNode: () => h.current,
|
|
@@ -1383,13 +1383,13 @@ function cn(e) {
|
|
|
1383
1383
|
let a = e.top + r.y, o = C.top + p.header, s = C.top + C.height - e.height;
|
|
1384
1384
|
return n.top = Math.max(o, Math.min(a, s)) - t.top, n;
|
|
1385
1385
|
}]
|
|
1386
|
-
}), O =
|
|
1386
|
+
}), O = q((e) => {
|
|
1387
1387
|
T === "overlay" && S(e);
|
|
1388
1388
|
});
|
|
1389
1389
|
i(() => {
|
|
1390
1390
|
O(w);
|
|
1391
1391
|
}, [O, ...Object.values(w)]);
|
|
1392
|
-
let k =
|
|
1392
|
+
let k = q(() => {
|
|
1393
1393
|
let e = _.current ?? r[n.column], t = {
|
|
1394
1394
|
...n,
|
|
1395
1395
|
date: m.toMillis(n.date),
|
|
@@ -1428,66 +1428,66 @@ function cn(e) {
|
|
|
1428
1428
|
k,
|
|
1429
1429
|
x
|
|
1430
1430
|
]);
|
|
1431
|
-
let
|
|
1431
|
+
let ee = (e) => {
|
|
1432
1432
|
e.stopPropagation();
|
|
1433
1433
|
let t = e.currentTarget.parentElement;
|
|
1434
1434
|
if (!t) return;
|
|
1435
1435
|
let i = t.getBoundingClientRect(), a = Math.floor((e.clientX - i.left) / i.width * r.length), o = Math.min(Math.max(a, n.column), n.column + n.span - 1);
|
|
1436
1436
|
_.current = r[o] ?? null;
|
|
1437
|
-
},
|
|
1437
|
+
}, A = (e) => ({
|
|
1438
1438
|
onMoveStart: () => (o?.start(n.key, e), !0),
|
|
1439
1439
|
onMove: (e) => o?.move(e.clientX, e.clientY),
|
|
1440
1440
|
onMoveEnd: () => o?.end()
|
|
1441
|
-
}), { listeners:
|
|
1441
|
+
}), { listeners: j } = ct(A("start")), { listeners: M } = ct(A("end")), N = st(g, t), P = n.span > 1 || !n.isStart || !n.isEnd, F = Bt({
|
|
1442
1442
|
"--ww-column": n.column + 1,
|
|
1443
1443
|
"--ww-span": n.span,
|
|
1444
1444
|
"--ww-row": n.lane + 2
|
|
1445
1445
|
}, d.style);
|
|
1446
|
-
return /* @__PURE__ */
|
|
1446
|
+
return /* @__PURE__ */ G("div", {
|
|
1447
1447
|
...d,
|
|
1448
1448
|
...c ? null : v,
|
|
1449
|
-
ref:
|
|
1450
|
-
style:
|
|
1449
|
+
ref: N,
|
|
1450
|
+
style: F,
|
|
1451
1451
|
"data-key": String(n.key),
|
|
1452
1452
|
"data-continues-before": n.isStart ? void 0 : "",
|
|
1453
1453
|
"data-continues-after": n.isEnd ? void 0 : "",
|
|
1454
|
-
onPointerDown:
|
|
1454
|
+
onPointerDown: ee,
|
|
1455
1455
|
onDoubleClick: (e) => e.stopPropagation(),
|
|
1456
|
-
className: D(d.className,
|
|
1457
|
-
[
|
|
1458
|
-
[
|
|
1459
|
-
[
|
|
1460
|
-
[
|
|
1461
|
-
[
|
|
1456
|
+
className: D(d.className, Z.root__event, {
|
|
1457
|
+
[Z.root__event_span]: P,
|
|
1458
|
+
[Z.root__event_continuesBefore]: !n.isStart,
|
|
1459
|
+
[Z.root__event_continuesAfter]: !n.isEnd,
|
|
1460
|
+
[Z.root__event_isDragging]: y,
|
|
1461
|
+
[Z.root__event_isResizeSource]: s
|
|
1462
1462
|
}),
|
|
1463
1463
|
children: [
|
|
1464
1464
|
l,
|
|
1465
|
-
a && n.isStart && /* @__PURE__ */
|
|
1466
|
-
...
|
|
1465
|
+
a && n.isStart && /* @__PURE__ */ W("div", {
|
|
1466
|
+
...j,
|
|
1467
1467
|
"data-edge": "start",
|
|
1468
|
-
className: D(
|
|
1468
|
+
className: D(Z.root__resize, Z.root__resizeStart)
|
|
1469
1469
|
}),
|
|
1470
|
-
a && n.isEnd && /* @__PURE__ */
|
|
1471
|
-
...
|
|
1470
|
+
a && n.isEnd && /* @__PURE__ */ W("div", {
|
|
1471
|
+
...M,
|
|
1472
1472
|
"data-edge": "end",
|
|
1473
|
-
className: D(
|
|
1473
|
+
className: D(Z.root__resize, Z.root__resizeEnd)
|
|
1474
1474
|
})
|
|
1475
1475
|
]
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
1478
|
// src/components/month-view/MonthViewEventPreview.tsx
|
|
1479
1479
|
function ln({ bar: e, children: t }) {
|
|
1480
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ W("div", {
|
|
1481
1481
|
"aria-hidden": "true",
|
|
1482
1482
|
"data-key": String(e.key),
|
|
1483
1483
|
"data-continues-before": e.isStart ? void 0 : "",
|
|
1484
1484
|
"data-continues-after": e.isEnd ? void 0 : "",
|
|
1485
|
-
className: D(
|
|
1486
|
-
[
|
|
1487
|
-
[
|
|
1488
|
-
[
|
|
1485
|
+
className: D(Z.root__event, Z.root__event_isResizing, {
|
|
1486
|
+
[Z.root__event_span]: e.span > 1 || !e.isStart || !e.isEnd,
|
|
1487
|
+
[Z.root__event_continuesBefore]: !e.isStart,
|
|
1488
|
+
[Z.root__event_continuesAfter]: !e.isEnd
|
|
1489
1489
|
}),
|
|
1490
|
-
style:
|
|
1490
|
+
style: Bt({
|
|
1491
1491
|
"--ww-column": e.column + 1,
|
|
1492
1492
|
"--ww-span": e.span,
|
|
1493
1493
|
"--ww-row": e.lane + 2
|
|
@@ -1497,10 +1497,10 @@ function ln({ bar: e, children: t }) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
// src/components/month-view/MonthViewWeek.tsx
|
|
1499
1499
|
function un(e) {
|
|
1500
|
-
let { days: t, firstDayIndex: n, layout: r, sourceBars: i, lanes: a, resizingKey: o, resize: s } = e, { viewValue: c, eventRenderer: l, view: u, disabled: d } =
|
|
1500
|
+
let { days: t, firstDayIndex: n, layout: r, sourceBars: i, lanes: a, resizingKey: o, resize: s } = e, { viewValue: c, eventRenderer: l, view: u, disabled: d } = J(), { getMonthDay: f, isSameMonth: p, isToday: m, toMillis: h } = K(), g = Ge(), _ = o !== void 0, v = (e) => l.current?.(e.value, u, {
|
|
1501
1501
|
isStart: e.isStart,
|
|
1502
1502
|
isEnd: e.isEnd
|
|
1503
|
-
}), y = (e, n = !1) => /* @__PURE__ */
|
|
1503
|
+
}), y = (e, n = !1) => /* @__PURE__ */ W(cn, {
|
|
1504
1504
|
eventData: e,
|
|
1505
1505
|
weekDays: t,
|
|
1506
1506
|
resizable: !d,
|
|
@@ -1509,27 +1509,27 @@ function un(e) {
|
|
|
1509
1509
|
isAnyResizing: _,
|
|
1510
1510
|
children: v(e)
|
|
1511
1511
|
}, e.key);
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
className:
|
|
1512
|
+
return /* @__PURE__ */ G("div", {
|
|
1513
|
+
className: Z.root__week,
|
|
1514
1514
|
children: [
|
|
1515
|
-
t.map((e, t) => /* @__PURE__ */
|
|
1515
|
+
t.map((e, t) => /* @__PURE__ */ W(Ut, {
|
|
1516
1516
|
targetDate: e,
|
|
1517
1517
|
"data-day-index": n + t,
|
|
1518
1518
|
"data-is-outside": !p(e, c) || void 0,
|
|
1519
1519
|
"data-is-today": m(e) ? !0 : void 0,
|
|
1520
|
-
style:
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1522
|
-
className:
|
|
1520
|
+
style: Bt({ "--ww-column": t + 1 }),
|
|
1521
|
+
children: /* @__PURE__ */ W("span", {
|
|
1522
|
+
className: Z.root__dayNumber,
|
|
1523
1523
|
children: f(e)
|
|
1524
1524
|
})
|
|
1525
1525
|
}, h(e))),
|
|
1526
|
-
[...r.bars.map((e) => e.key === o ? /* @__PURE__ */
|
|
1526
|
+
[...r.bars.map((e) => e.key === o ? /* @__PURE__ */ W(ln, {
|
|
1527
1527
|
bar: e,
|
|
1528
1528
|
children: v(e)
|
|
1529
1529
|
}, `preview-${e.key}`) : y(e)), ...i.map((e) => y(e, !0))],
|
|
1530
|
-
t.map((e, t) => r.hidden[t] > 0 && /* @__PURE__ */
|
|
1531
|
-
className:
|
|
1532
|
-
style:
|
|
1530
|
+
t.map((e, t) => r.hidden[t] > 0 && /* @__PURE__ */ W("span", {
|
|
1531
|
+
className: Z.root__more,
|
|
1532
|
+
style: Bt({
|
|
1533
1533
|
"--ww-column": t + 1,
|
|
1534
1534
|
"--ww-row": a + 2
|
|
1535
1535
|
}),
|
|
@@ -1542,9 +1542,9 @@ function un(e) {
|
|
|
1542
1542
|
function dn(e, t) {
|
|
1543
1543
|
let [n, r] = d(t), i = () => {
|
|
1544
1544
|
let n = e.current?.firstElementChild;
|
|
1545
|
-
n?.clientHeight && r(
|
|
1546
|
-
}, a =
|
|
1547
|
-
return
|
|
1545
|
+
n?.clientHeight && r(R(n.clientHeight, t));
|
|
1546
|
+
}, a = qe(i);
|
|
1547
|
+
return Ke(() => {
|
|
1548
1548
|
i();
|
|
1549
1549
|
let t = e.current?.firstElementChild;
|
|
1550
1550
|
return t && a?.observe(t), () => {
|
|
@@ -1554,22 +1554,22 @@ function dn(e, t) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
// src/components/month-view/useMonthResize.ts
|
|
1556
1556
|
function fn(e) {
|
|
1557
|
-
let { days: t, viewportRef: n, dateUtils: r, eventMap: i, disabled: a, getIsDayDisabled: o, onEventChange: s } = e, [l, u, d] =
|
|
1557
|
+
let { days: t, viewportRef: n, dateUtils: r, eventMap: i, disabled: a, getIsDayDisabled: o, onEventChange: s } = e, [l, u, d] = ft(null), { addGlobalListener: f, removeAllGlobalListeners: p } = it(), m = q((e = !0) => {
|
|
1558
1558
|
let t = d.current;
|
|
1559
1559
|
t && (p(), u(null), e && t.result && s(t.key, t.result.date, t.result.info));
|
|
1560
|
-
}), h =
|
|
1560
|
+
}), h = q((e) => {
|
|
1561
1561
|
e.key === "Escape" && m(!1);
|
|
1562
|
-
}), g =
|
|
1562
|
+
}), g = q((e, t) => {
|
|
1563
1563
|
a || d.current || (u({
|
|
1564
1564
|
key: e,
|
|
1565
1565
|
edge: t,
|
|
1566
1566
|
result: null
|
|
1567
1567
|
}), f(document, "keydown", h, !0));
|
|
1568
|
-
}), _ =
|
|
1569
|
-
let s = d.current, c = s && i.get(s.key), l = t[
|
|
1568
|
+
}), _ = q((e, a) => {
|
|
1569
|
+
let s = d.current, c = s && i.get(s.key), l = t[Ht(n.current, e, a)];
|
|
1570
1570
|
s && c && l && !o?.(l) && u({
|
|
1571
1571
|
...s,
|
|
1572
|
-
result:
|
|
1572
|
+
result: xe(r, c, s.edge, l)
|
|
1573
1573
|
});
|
|
1574
1574
|
}), v = c(() => ({
|
|
1575
1575
|
start: g,
|
|
@@ -1582,7 +1582,7 @@ function fn(e) {
|
|
|
1582
1582
|
]), y = c(() => {
|
|
1583
1583
|
let e = l?.result && i.get(l.key);
|
|
1584
1584
|
if (!l?.result || !e) return i;
|
|
1585
|
-
let [t] =
|
|
1585
|
+
let [t] = F(r, l.result.date, l.result.info);
|
|
1586
1586
|
return new Map(i).set(l.key, {
|
|
1587
1587
|
...e,
|
|
1588
1588
|
date: t,
|
|
@@ -1602,13 +1602,13 @@ function fn(e) {
|
|
|
1602
1602
|
// src/components/month-view/MonthView.tsx
|
|
1603
1603
|
var pn = [];
|
|
1604
1604
|
function mn(e) {
|
|
1605
|
-
let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } =
|
|
1606
|
-
|
|
1607
|
-
let p = u(null), m = c(() =>
|
|
1605
|
+
let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } = J(), f = K();
|
|
1606
|
+
mt();
|
|
1607
|
+
let p = u(null), m = c(() => L(f, i, o), [
|
|
1608
1608
|
f,
|
|
1609
1609
|
o,
|
|
1610
1610
|
i
|
|
1611
|
-
]), h = c(() =>
|
|
1611
|
+
]), h = c(() => Vt(m), [m]), g = c(() => de(f, o), [f, o]), _ = fn({
|
|
1612
1612
|
days: m,
|
|
1613
1613
|
viewportRef: p,
|
|
1614
1614
|
dateUtils: f,
|
|
@@ -1629,24 +1629,24 @@ function mn(e) {
|
|
|
1629
1629
|
_.eventMap,
|
|
1630
1630
|
h
|
|
1631
1631
|
]), S = c(() => ({ viewportRef: p }), []);
|
|
1632
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ G(Nt.Provider, {
|
|
1633
1633
|
value: S,
|
|
1634
|
-
children: [/* @__PURE__ */
|
|
1634
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1635
1635
|
...r,
|
|
1636
|
-
className: D(t,
|
|
1637
|
-
style:
|
|
1638
|
-
children: [/* @__PURE__ */
|
|
1639
|
-
className:
|
|
1640
|
-
children: g.map((e) => /* @__PURE__ */
|
|
1641
|
-
className:
|
|
1636
|
+
className: D(t, Z.root, { [Z.root_isResizing]: _.resizingKey !== void 0 }),
|
|
1637
|
+
style: Bt({ "--ww-month-lanes": v }, n),
|
|
1638
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1639
|
+
className: Z.root__head,
|
|
1640
|
+
children: g.map((e) => /* @__PURE__ */ W("div", {
|
|
1641
|
+
className: Z.root__weekday,
|
|
1642
1642
|
children: e
|
|
1643
1643
|
}, e))
|
|
1644
|
-
}), /* @__PURE__ */
|
|
1645
|
-
className:
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1644
|
+
}), /* @__PURE__ */ W("div", {
|
|
1645
|
+
className: Z.root__body,
|
|
1646
|
+
children: /* @__PURE__ */ W("div", {
|
|
1647
1647
|
ref: p,
|
|
1648
|
-
className:
|
|
1649
|
-
children: h.map((e, t) => /* @__PURE__ */
|
|
1648
|
+
className: Z.root__viewport,
|
|
1649
|
+
children: h.map((e, t) => /* @__PURE__ */ W(un, {
|
|
1650
1650
|
days: e,
|
|
1651
1651
|
firstDayIndex: t * 7,
|
|
1652
1652
|
layout: b[t],
|
|
@@ -1657,8 +1657,8 @@ function mn(e) {
|
|
|
1657
1657
|
}, f.toMillis(e[0])))
|
|
1658
1658
|
})
|
|
1659
1659
|
})]
|
|
1660
|
-
}), /* @__PURE__ */
|
|
1661
|
-
className:
|
|
1660
|
+
}), /* @__PURE__ */ W(zt, {
|
|
1661
|
+
className: Z.root__dragOverlay,
|
|
1662
1662
|
showPreview: !1
|
|
1663
1663
|
})]
|
|
1664
1664
|
});
|
|
@@ -1677,7 +1677,7 @@ function gn(e) {
|
|
|
1677
1677
|
let n = t.getBoundingClientRect(), r = e < n.left ? n.left - e : e > n.right ? e - n.right : 0;
|
|
1678
1678
|
r < b && (b = r, y = Number(t.dataset.dayIndex));
|
|
1679
1679
|
});
|
|
1680
|
-
let x =
|
|
1680
|
+
let x = Se({
|
|
1681
1681
|
start: i.original[0],
|
|
1682
1682
|
end: i.original[1]
|
|
1683
1683
|
}, i.edge, y, v, {
|
|
@@ -1687,10 +1687,10 @@ function gn(e) {
|
|
|
1687
1687
|
crossDays: !l || o.hourMin <= 0 && o.hourMax >= 24,
|
|
1688
1688
|
getFrame: (e) => {
|
|
1689
1689
|
if (!l) return [0, _];
|
|
1690
|
-
let [n, r] =
|
|
1690
|
+
let [n, r] = ae(a, t[e], o);
|
|
1691
1691
|
return [Math.ceil(n / s) * s, Math.min(Math.ceil(r / s) * s, _)];
|
|
1692
1692
|
},
|
|
1693
|
-
canEditDay: (e) => !u && !d?.(t[e]) && !(l &&
|
|
1693
|
+
canEditDay: (e) => !u && !d?.(t[e]) && !(l && ge(a, t[e]))
|
|
1694
1694
|
});
|
|
1695
1695
|
x && (i.range = x), p({
|
|
1696
1696
|
key: i.key,
|
|
@@ -1711,7 +1711,7 @@ function gn(e) {
|
|
|
1711
1711
|
start(e, n, r, i) {
|
|
1712
1712
|
let o = h.current.eventMap.get(e);
|
|
1713
1713
|
if (!o || !t[0]) return;
|
|
1714
|
-
let s =
|
|
1714
|
+
let s = ke(a, t[0], o.date), c = [s, s + o.duration];
|
|
1715
1715
|
m.current = {
|
|
1716
1716
|
key: e,
|
|
1717
1717
|
edge: n,
|
|
@@ -1734,7 +1734,7 @@ function gn(e) {
|
|
|
1734
1734
|
let [n, r] = e.range;
|
|
1735
1735
|
if (n === e.original[0] && r === e.original[1]) return;
|
|
1736
1736
|
let i = Math.floor(n / hn);
|
|
1737
|
-
h.current.onEventChange(e.key,
|
|
1737
|
+
h.current.onEventChange(e.key, M(a, t[0], i * hn), {
|
|
1738
1738
|
from: n - i * hn,
|
|
1739
1739
|
duration: r - n
|
|
1740
1740
|
});
|
|
@@ -1758,7 +1758,7 @@ function gn(e) {
|
|
|
1758
1758
|
previewOf: (e) => {
|
|
1759
1759
|
let n = Math.floor(e[0] / hn);
|
|
1760
1760
|
return {
|
|
1761
|
-
date:
|
|
1761
|
+
date: M(a, t[0], n * hn),
|
|
1762
1762
|
top: e[0] - n * hn - g,
|
|
1763
1763
|
duration: e[1] - e[0]
|
|
1764
1764
|
};
|
|
@@ -1767,7 +1767,7 @@ function gn(e) {
|
|
|
1767
1767
|
}
|
|
1768
1768
|
// src/contexts/DayWeekViewContext.ts
|
|
1769
1769
|
var _n = e(void 0);
|
|
1770
|
-
|
|
1770
|
+
U && (_n.displayName = "DayWeekViewContext");
|
|
1771
1771
|
function vn() {
|
|
1772
1772
|
let e = r(_n);
|
|
1773
1773
|
if (!e) throw Error("DayWeekViewContext is required");
|
|
@@ -1775,12 +1775,12 @@ function vn() {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
// src/hooks/useTimeOffset.ts
|
|
1777
1777
|
function yn(e = !0, t = 6e4) {
|
|
1778
|
-
let { hideMinMaxTime: n, hourMin: r, hourMax: i } =
|
|
1778
|
+
let { hideMinMaxTime: n, hourMin: r, hourMax: i } = J(), a = K(), o = () => B(a, {
|
|
1779
1779
|
hourMin: r,
|
|
1780
1780
|
hourMax: i,
|
|
1781
1781
|
hideMinMaxTime: n
|
|
1782
1782
|
}), [s, c] = d([0, !0]);
|
|
1783
|
-
return
|
|
1783
|
+
return pt(() => c(o()), t, e), s;
|
|
1784
1784
|
}
|
|
1785
1785
|
var bn = {
|
|
1786
1786
|
root: "_root_6z2c5_1",
|
|
@@ -1794,204 +1794,209 @@ var bn = {
|
|
|
1794
1794
|
};
|
|
1795
1795
|
// src/components/day-week-drawer/DayWeekDrawer.tsx
|
|
1796
1796
|
function xn(e) {
|
|
1797
|
-
let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } =
|
|
1797
|
+
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 } = vn(), { hideMinMaxTime: _, preventOutBoundsChanges: v, timeStep: y, hourMin: b, hourMax: x, disabled: S } = p, w = K(), { isBefore: T, isToday: E } = w, O = y * g, k = (e) => Sn(e, g, y), ee = (e) => h(e).map((e) => e * g), j = u(null), M = u(null), { register: N, getTransform: P } = Ne(({ registerDropTarget: e, getTransform: t }) => ({
|
|
1798
1798
|
register: e,
|
|
1799
1799
|
getTransform: t
|
|
1800
|
-
})),
|
|
1801
|
-
let e =
|
|
1800
|
+
})), F = mt(), I = c(() => {
|
|
1801
|
+
let e = E(n);
|
|
1802
1802
|
return {
|
|
1803
1803
|
isToday: e,
|
|
1804
|
-
isPast:
|
|
1804
|
+
isPast: T(n) && !e
|
|
1805
1805
|
};
|
|
1806
1806
|
}, [
|
|
1807
|
-
w,
|
|
1808
1807
|
T,
|
|
1808
|
+
E,
|
|
1809
1809
|
n,
|
|
1810
|
-
|
|
1811
|
-
]), [{ isActive:
|
|
1812
|
-
activeNode:
|
|
1813
|
-
containerNode:
|
|
1810
|
+
F
|
|
1811
|
+
]), [{ isActive: L, transform: R }, z, { scrollAdjustmentActiveNodeRect: B }] = an({
|
|
1812
|
+
activeNode: j.current,
|
|
1813
|
+
containerNode: j.current?.parentElement,
|
|
1814
1814
|
modifiers: [
|
|
1815
1815
|
function({ activeNodeRect: e, initialTranslate: t, translate: n, transform: r }) {
|
|
1816
1816
|
if (!e) return r;
|
|
1817
1817
|
let i = t.y - e.top;
|
|
1818
|
-
r.x = r.left + t.x, r.y = r.top + t.y, r.top = Math.floor(i /
|
|
1818
|
+
r.x = r.left + t.x, r.y = r.top + t.y, r.top = Math.floor(i / O) * O, r.height = O, r.left = 0, r.width = e.width;
|
|
1819
1819
|
let a;
|
|
1820
|
-
return n.y > 0 ? (a =
|
|
1820
|
+
return n.y > 0 ? (a = O - i % O, r.height = Math.ceil((r.height + n.y - a) / O) * O) : (a = i % O, r.height = Math.ceil((r.height - n.y - a) / O) * O, r.top -= r.height - O), r.height = Math.max(r.height, O), r;
|
|
1821
1821
|
},
|
|
1822
1822
|
function({ transform: e }) {
|
|
1823
|
-
if (!
|
|
1824
|
-
let [t, r] = h(n).map((e) => Math.ceil(e /
|
|
1825
|
-
return e.top < t && (e.height = Math.max(e.height - (t - e.top),
|
|
1823
|
+
if (!v) return e;
|
|
1824
|
+
let [t, r] = h(n).map((e) => Math.ceil(e / y) * O);
|
|
1825
|
+
return e.top < t && (e.height = Math.max(e.height - (t - e.top), O), e.top = t), e.height + e.top >= r && (e.height = Math.max(r - e.top, O)), e;
|
|
1826
1826
|
},
|
|
1827
1827
|
C,
|
|
1828
|
-
|
|
1828
|
+
oe(O)
|
|
1829
1829
|
]
|
|
1830
|
-
}), [
|
|
1830
|
+
}), [te, V] = yn(I.isToday);
|
|
1831
1831
|
i(() => {
|
|
1832
|
-
let e =
|
|
1833
|
-
if (e) return
|
|
1832
|
+
let e = j.current;
|
|
1833
|
+
if (e) return N(e, {
|
|
1834
1834
|
data: { date: n },
|
|
1835
1835
|
onDrop: async (e) => {
|
|
1836
1836
|
let [t] = await Promise.all(e.items.filter((e) => e.kind === "text" && e.types.has("event") && "getText" in e).map(async (e) => {
|
|
1837
1837
|
let t = await e.getText("event");
|
|
1838
1838
|
return JSON.parse(t);
|
|
1839
|
-
})), r =
|
|
1840
|
-
if (
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1839
|
+
})), r = P(), i = Sn(r.top, g, y), a = Sn(r.height, g, y), s = _ ? b * 60 : 0, c = f.get(t.key), l = c ? ke(w, c.date, c.date) : 0;
|
|
1840
|
+
if (c && l + c.duration > 1440) {
|
|
1841
|
+
if (v && (b > 0 || x < 24)) {
|
|
1842
|
+
z.stop({
|
|
1843
1843
|
x: e.x,
|
|
1844
1844
|
y: e.y
|
|
1845
1845
|
});
|
|
1846
1846
|
return;
|
|
1847
1847
|
}
|
|
1848
|
-
let
|
|
1849
|
-
o(t.key,
|
|
1848
|
+
let r = w.getStartOfDay(w.fromMillis(t.date)), a = ke(w, c.date, r) + s + t.start - l, u = s + i - a, d = Math.floor(u / 1440);
|
|
1849
|
+
o(t.key, w.addDays(n, d), {
|
|
1850
1850
|
from: u - d * 24 * 60,
|
|
1851
|
-
duration:
|
|
1851
|
+
duration: c.duration
|
|
1852
1852
|
});
|
|
1853
|
-
} else
|
|
1854
|
-
from:
|
|
1855
|
-
duration:
|
|
1853
|
+
} else _ ? o(t.key, n, {
|
|
1854
|
+
from: i + b * 60,
|
|
1855
|
+
duration: a
|
|
1856
1856
|
}) : o(t.key, n, {
|
|
1857
|
-
from:
|
|
1858
|
-
duration:
|
|
1857
|
+
from: i,
|
|
1858
|
+
duration: a
|
|
1859
1859
|
});
|
|
1860
|
-
|
|
1860
|
+
z.stop({
|
|
1861
1861
|
x: e.x,
|
|
1862
1862
|
y: e.y
|
|
1863
1863
|
});
|
|
1864
1864
|
},
|
|
1865
1865
|
getDropOperationForPoint: (e, t) => {
|
|
1866
|
-
if (
|
|
1867
|
-
let { isPast: r, isToday: i } =
|
|
1868
|
-
if (
|
|
1866
|
+
if (S || !e.has("event") || l && l(n)) return "cancel";
|
|
1867
|
+
let { isPast: r, isToday: i } = I;
|
|
1868
|
+
if (v) {
|
|
1869
1869
|
if (!i && r) return "cancel";
|
|
1870
|
-
let [e, t] = h(n), a =
|
|
1870
|
+
let [e, t] = h(n).map((e) => e * g), a = P();
|
|
1871
1871
|
if (a.y < e || a.y > t || i && a.height > t - e) return "cancel";
|
|
1872
1872
|
}
|
|
1873
1873
|
return t[0];
|
|
1874
1874
|
}
|
|
1875
1875
|
});
|
|
1876
1876
|
}, [
|
|
1877
|
-
|
|
1877
|
+
z,
|
|
1878
|
+
w,
|
|
1878
1879
|
S,
|
|
1879
|
-
x,
|
|
1880
1880
|
f,
|
|
1881
1881
|
l,
|
|
1882
1882
|
h,
|
|
1883
|
-
|
|
1884
|
-
|
|
1883
|
+
P,
|
|
1884
|
+
_,
|
|
1885
|
+
x,
|
|
1885
1886
|
b,
|
|
1886
|
-
y,
|
|
1887
1887
|
o,
|
|
1888
|
-
|
|
1889
|
-
|
|
1888
|
+
v,
|
|
1889
|
+
g,
|
|
1890
|
+
N,
|
|
1890
1891
|
n,
|
|
1891
|
-
|
|
1892
|
+
y,
|
|
1893
|
+
I
|
|
1892
1894
|
]);
|
|
1893
|
-
let { listeners:
|
|
1894
|
-
distance: Math.max(Math.min(5,
|
|
1895
|
+
let { listeners: ne } = ct({
|
|
1896
|
+
distance: Math.max(Math.min(5, y), 1),
|
|
1895
1897
|
onMoveStart: (e) => {
|
|
1896
|
-
if (!
|
|
1897
|
-
if (
|
|
1898
|
-
let { isToday: e, isPast: t } =
|
|
1898
|
+
if (!S) {
|
|
1899
|
+
if (v) {
|
|
1900
|
+
let { isToday: e, isPast: t } = I;
|
|
1899
1901
|
if (t && !e) return !1;
|
|
1900
1902
|
}
|
|
1901
|
-
|
|
1903
|
+
z.start({
|
|
1902
1904
|
x: e.clientX,
|
|
1903
1905
|
y: e.clientY
|
|
1904
1906
|
});
|
|
1905
1907
|
}
|
|
1906
1908
|
},
|
|
1907
1909
|
onMove: (e) => {
|
|
1908
|
-
if (
|
|
1910
|
+
if (L) z.move({
|
|
1909
1911
|
x: e.clientX,
|
|
1910
1912
|
y: e.clientY
|
|
1911
1913
|
});
|
|
1912
|
-
else if (
|
|
1913
|
-
if (
|
|
1914
|
-
let [t, r] =
|
|
1914
|
+
else if (B) {
|
|
1915
|
+
if (v) {
|
|
1916
|
+
let [t, r] = ee(n), i = e.clientY - B.top;
|
|
1915
1917
|
if (i < t || i > r) {
|
|
1916
|
-
|
|
1918
|
+
z.stop({
|
|
1917
1919
|
x: e.clientX,
|
|
1918
1920
|
y: e.clientY
|
|
1919
1921
|
});
|
|
1920
1922
|
return;
|
|
1921
1923
|
}
|
|
1922
1924
|
}
|
|
1923
|
-
|
|
1925
|
+
L || z.move({
|
|
1924
1926
|
x: e.clientX,
|
|
1925
1927
|
y: e.clientY
|
|
1926
1928
|
});
|
|
1927
1929
|
}
|
|
1928
1930
|
},
|
|
1929
1931
|
onMoveEnd: (e) => {
|
|
1930
|
-
|
|
1932
|
+
z.stop({
|
|
1931
1933
|
x: e.clientX,
|
|
1932
1934
|
y: e.clientY
|
|
1933
|
-
}),
|
|
1934
|
-
from:
|
|
1935
|
-
duration:
|
|
1935
|
+
}), L && (_ ? s(n, {
|
|
1936
|
+
from: k(R.top) + b * 60,
|
|
1937
|
+
duration: k(R.height)
|
|
1936
1938
|
}) : s(n, {
|
|
1937
|
-
from:
|
|
1938
|
-
duration:
|
|
1939
|
+
from: k(R.top),
|
|
1940
|
+
duration: k(R.height)
|
|
1939
1941
|
}));
|
|
1940
1942
|
}
|
|
1941
|
-
}),
|
|
1942
|
-
hourMin:
|
|
1943
|
-
hideMinMaxTime:
|
|
1944
|
-
}),
|
|
1945
|
-
return /* @__PURE__ */
|
|
1943
|
+
}), H = st(j, t), re = A(w, te, {
|
|
1944
|
+
hourMin: b,
|
|
1945
|
+
hideMinMaxTime: _
|
|
1946
|
+
}), ie = () => d.current?.(n, k(R.top), k(R.height));
|
|
1947
|
+
return /* @__PURE__ */ G("div", {
|
|
1946
1948
|
...a,
|
|
1947
|
-
...
|
|
1948
|
-
ref:
|
|
1949
|
+
...ne,
|
|
1950
|
+
ref: H,
|
|
1949
1951
|
className: D(a.className, bn.root, {
|
|
1950
|
-
[bn.root_timeLimit]:
|
|
1951
|
-
[bn.root_isToday]:
|
|
1952
|
-
[bn.root_isPast]:
|
|
1953
|
-
[bn.root_offLimits]:
|
|
1952
|
+
[bn.root_timeLimit]: v,
|
|
1953
|
+
[bn.root_isToday]: I.isToday,
|
|
1954
|
+
[bn.root_isPast]: I.isPast,
|
|
1955
|
+
[bn.root_offLimits]: V
|
|
1954
1956
|
}),
|
|
1955
1957
|
style: {
|
|
1956
1958
|
...a.style,
|
|
1957
|
-
"--offset":
|
|
1959
|
+
"--offset": te
|
|
1958
1960
|
},
|
|
1959
1961
|
children: [
|
|
1960
|
-
|
|
1962
|
+
I.isToday && !V && /* @__PURE__ */ W(Tt, {
|
|
1961
1963
|
container: m.current,
|
|
1962
|
-
children: /* @__PURE__ */
|
|
1964
|
+
children: /* @__PURE__ */ W("span", {
|
|
1963
1965
|
tabIndex: -1,
|
|
1964
1966
|
className: bn.root__timeLine,
|
|
1965
|
-
"data-now":
|
|
1966
|
-
style: { "--offset":
|
|
1967
|
+
"data-now": re,
|
|
1968
|
+
style: { "--offset": te }
|
|
1967
1969
|
})
|
|
1968
1970
|
}),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
ref:
|
|
1971
|
+
/* @__PURE__ */ W("div", {
|
|
1972
|
+
ref: M,
|
|
1971
1973
|
className: bn.root__container,
|
|
1972
1974
|
children: r
|
|
1973
1975
|
}),
|
|
1974
|
-
|
|
1976
|
+
L && /* @__PURE__ */ G(ze, { children: [/* @__PURE__ */ W("div", {
|
|
1975
1977
|
className: bn.root__spotlight,
|
|
1976
|
-
style:
|
|
1977
|
-
}), /* @__PURE__ */
|
|
1978
|
+
style: R ? { ...R } : void 0
|
|
1979
|
+
}), /* @__PURE__ */ W(It, {
|
|
1978
1980
|
coordinates: {
|
|
1979
|
-
x:
|
|
1980
|
-
y:
|
|
1981
|
+
x: R.x,
|
|
1982
|
+
y: R.y
|
|
1981
1983
|
},
|
|
1982
|
-
children:
|
|
1984
|
+
children: ie()
|
|
1983
1985
|
})] })
|
|
1984
1986
|
]
|
|
1985
1987
|
});
|
|
1986
1988
|
}
|
|
1989
|
+
function Sn(e, t, n) {
|
|
1990
|
+
return Math.round(e / t / n) * n;
|
|
1991
|
+
}
|
|
1987
1992
|
// src/hooks/useAbsEventRect.ts
|
|
1988
|
-
function
|
|
1993
|
+
function Cn(e, t) {
|
|
1989
1994
|
let [n, r] = d(null);
|
|
1990
|
-
return
|
|
1995
|
+
return Ke(() => {
|
|
1991
1996
|
let n = e.current, i = e.current?.parentElement;
|
|
1992
1997
|
if (n && i) {
|
|
1993
|
-
let { height: e, width: a, ...o } =
|
|
1994
|
-
r(
|
|
1998
|
+
let { height: e, width: a, ...o } = P(n), { left: s, top: c } = Oe(o, P(i));
|
|
1999
|
+
r(Te(t, {
|
|
1995
2000
|
height: e,
|
|
1996
2001
|
width: a,
|
|
1997
2002
|
x: s,
|
|
@@ -2001,9 +2006,9 @@ function Sn(e, t) {
|
|
|
2001
2006
|
}, [e, ...Object.values(t)]), n;
|
|
2002
2007
|
}
|
|
2003
2008
|
// src/hooks/useCanResizeEvent.ts
|
|
2004
|
-
function
|
|
2005
|
-
let [n, r] = d(!0), { preventOutBoundsChanges: i } =
|
|
2006
|
-
return
|
|
2009
|
+
function wn(e, t) {
|
|
2010
|
+
let [n, r] = d(!0), { preventOutBoundsChanges: i } = J(), { isBefore: a, isToday: o } = K(), { getTimeFrame: s } = vn();
|
|
2011
|
+
return Ke(() => {
|
|
2007
2012
|
if (t && i) {
|
|
2008
2013
|
if (a(e) && !o(e)) r(!1);
|
|
2009
2014
|
else if (o(e)) {
|
|
@@ -2033,8 +2038,8 @@ var Q = {
|
|
|
2033
2038
|
root_isResizeSource: "_root_isResizeSource_1qnpq_108"
|
|
2034
2039
|
};
|
|
2035
2040
|
// src/components/day-week-event/DayWeekEvent.tsx
|
|
2036
|
-
function
|
|
2037
|
-
let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } =
|
|
2041
|
+
function Tn(e) {
|
|
2042
|
+
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 } = vn(), x = l * v, S = Cn(p, n.rect), C = wn(o.get(n.key)?.date ?? n.date, S), { attributes: w, isDragging: T, overElement: E, overData: O, register: k, setOverlayTransform: ee } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
|
|
2038
2043
|
let a = i(p.current), [o, s] = a ? [...n.dropTargets].pop() ?? [null, null] : [null, null];
|
|
2039
2044
|
return {
|
|
2040
2045
|
attributes: t.attributes,
|
|
@@ -2044,70 +2049,70 @@ function wn(e) {
|
|
|
2044
2049
|
register: e,
|
|
2045
2050
|
setOverlayTransform: r
|
|
2046
2051
|
};
|
|
2047
|
-
}),
|
|
2048
|
-
autoScrollEnabled: !
|
|
2052
|
+
}), A = Yt(T ? E : null), [{ isActive: j, transform: M, context: N }, P] = an({
|
|
2053
|
+
autoScrollEnabled: !T,
|
|
2049
2054
|
activeNode: (e) => e === "overlay" ? p.current : e === "top" ? m.current : h.current,
|
|
2050
2055
|
containerNode: (e) => e === "overlay" ? g.current : p.current?.parentElement?.parentElement ?? null,
|
|
2051
2056
|
modifiers: [
|
|
2052
2057
|
function({ activeNodeRect: e, containerNodeRect: t, context: n, transform: r, translate: i, initialTranslate: a }) {
|
|
2053
|
-
if (n !== "overlay" || !t || !e || !
|
|
2054
|
-
r.x = i.x + a.x - t.left, r.y = i.y + a.y - t.top, r.left =
|
|
2058
|
+
if (n !== "overlay" || !t || !e || !A) return r;
|
|
2059
|
+
r.x = i.x + a.x - t.left, r.y = i.y + a.y - t.top, r.left = A.left - t.left, r.width = A.width, r.top = e.top - t.top, r.height = e.height;
|
|
2055
2060
|
let o;
|
|
2056
|
-
return i.y > 0 ? (o =
|
|
2061
|
+
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;
|
|
2057
2062
|
},
|
|
2058
2063
|
function({ transform: e, context: t }) {
|
|
2059
|
-
if (!d || t !== "overlay" || !
|
|
2060
|
-
let [n, r] = _(
|
|
2064
|
+
if (!d || t !== "overlay" || !O) return e;
|
|
2065
|
+
let [n, r] = _(O.date).map((e) => Math.ceil(e / l) * x);
|
|
2061
2066
|
return e.top < n && (e.top = n), e.top + e.height > r && (e.top = r - e.height), e;
|
|
2062
2067
|
},
|
|
2063
|
-
|
|
2068
|
+
En(x)
|
|
2064
2069
|
]
|
|
2065
|
-
}),
|
|
2066
|
-
|
|
2070
|
+
}), F = ve(() => y.end(), (e) => {
|
|
2071
|
+
P.stop({
|
|
2067
2072
|
x: e.clientX,
|
|
2068
2073
|
y: e.clientY
|
|
2069
2074
|
});
|
|
2070
|
-
}),
|
|
2071
|
-
onMoveStart: (t) => (
|
|
2075
|
+
}), I = (e) => ({
|
|
2076
|
+
onMoveStart: (t) => (P.start({
|
|
2072
2077
|
x: t.clientX,
|
|
2073
2078
|
y: t.clientY
|
|
2074
|
-
}, e),
|
|
2079
|
+
}, e), y.start(n.key, e, t.clientX, t.clientY), !0),
|
|
2075
2080
|
onMove: (e) => {
|
|
2076
|
-
|
|
2081
|
+
P.move({
|
|
2077
2082
|
x: e.clientX,
|
|
2078
2083
|
y: e.clientY
|
|
2079
|
-
}),
|
|
2084
|
+
}), y.move(e.clientX, e.clientY);
|
|
2080
2085
|
},
|
|
2081
|
-
onMoveEnd:
|
|
2082
|
-
}), { listeners:
|
|
2083
|
-
|
|
2086
|
+
onMoveEnd: F
|
|
2087
|
+
}), { listeners: L } = ct(I("bottom")), { listeners: R } = ct(I("top")), z = st(p, t), B = j && T && N === "overlay", te = b?.key === n.key, V = q((e) => {
|
|
2088
|
+
N === "overlay" && ee(e);
|
|
2084
2089
|
});
|
|
2085
2090
|
i(() => {
|
|
2086
|
-
|
|
2087
|
-
}, [
|
|
2091
|
+
V(M);
|
|
2092
|
+
}, [V, ...Object.values(M)]), i(() => {
|
|
2088
2093
|
if (!p.current) return;
|
|
2089
2094
|
let e = {
|
|
2090
|
-
...
|
|
2095
|
+
...be(n, "rect"),
|
|
2091
2096
|
date: c.toMillis(n.date)
|
|
2092
2097
|
}, t = [{ event: JSON.stringify(e) }];
|
|
2093
|
-
return
|
|
2098
|
+
return k(p.current, {
|
|
2094
2099
|
getItems() {
|
|
2095
2100
|
return t;
|
|
2096
2101
|
},
|
|
2097
2102
|
onDragStart(e) {
|
|
2098
|
-
|
|
2103
|
+
P.start({
|
|
2099
2104
|
x: e.x,
|
|
2100
2105
|
y: e.y
|
|
2101
2106
|
}, "overlay");
|
|
2102
2107
|
},
|
|
2103
2108
|
onDragMove(e) {
|
|
2104
|
-
|
|
2109
|
+
P.move({
|
|
2105
2110
|
x: e.x,
|
|
2106
2111
|
y: e.y
|
|
2107
2112
|
});
|
|
2108
2113
|
},
|
|
2109
2114
|
onDragEnd(e) {
|
|
2110
|
-
|
|
2115
|
+
P.stop({
|
|
2111
2116
|
x: e.x,
|
|
2112
2117
|
y: e.y
|
|
2113
2118
|
});
|
|
@@ -2117,60 +2122,60 @@ function wn(e) {
|
|
|
2117
2122
|
}
|
|
2118
2123
|
});
|
|
2119
2124
|
}, [
|
|
2120
|
-
|
|
2125
|
+
P,
|
|
2121
2126
|
n,
|
|
2122
|
-
|
|
2127
|
+
k
|
|
2123
2128
|
]);
|
|
2124
|
-
let
|
|
2125
|
-
[Q.root_isDragging]:
|
|
2126
|
-
[Q.root_isResizeSource]:
|
|
2129
|
+
let ne = D(a.className, Q.root, {
|
|
2130
|
+
[Q.root_isDragging]: B,
|
|
2131
|
+
[Q.root_isResizeSource]: te,
|
|
2127
2132
|
[Q.root_isDisabled]: f
|
|
2128
|
-
}),
|
|
2133
|
+
}), H = {
|
|
2129
2134
|
...a.style,
|
|
2130
2135
|
top: `${n.rect.y}%`,
|
|
2131
2136
|
left: `${n.rect.x}%`,
|
|
2132
2137
|
width: `${n.rect.width}%`,
|
|
2133
2138
|
height: `${n.rect.height}%`
|
|
2134
|
-
}, re =
|
|
2135
|
-
return /* @__PURE__ */
|
|
2139
|
+
}, re = q(ve(a.onPointerDown, (e) => e.stopPropagation()));
|
|
2140
|
+
return /* @__PURE__ */ W(ze, { children: /* @__PURE__ */ G("div", {
|
|
2136
2141
|
...a,
|
|
2137
|
-
...
|
|
2138
|
-
ref:
|
|
2139
|
-
className:
|
|
2140
|
-
style:
|
|
2142
|
+
...w,
|
|
2143
|
+
ref: z,
|
|
2144
|
+
className: ne,
|
|
2145
|
+
style: H,
|
|
2141
2146
|
onPointerDown: re,
|
|
2142
2147
|
"data-continues-before": n.isStart ? void 0 : "",
|
|
2143
2148
|
"data-continues-after": n.isEnd ? void 0 : "",
|
|
2144
2149
|
children: [
|
|
2145
|
-
|
|
2146
|
-
...
|
|
2150
|
+
C && n.isStart && /* @__PURE__ */ W("div", {
|
|
2151
|
+
...R,
|
|
2147
2152
|
ref: m,
|
|
2148
2153
|
className: Q.root__resizeTop
|
|
2149
2154
|
}),
|
|
2150
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ W("div", {
|
|
2151
2156
|
role: "button",
|
|
2152
2157
|
tabIndex: 0,
|
|
2153
2158
|
className: Q.root__container,
|
|
2154
2159
|
children: r
|
|
2155
2160
|
}),
|
|
2156
|
-
|
|
2157
|
-
...
|
|
2161
|
+
C && n.isEnd && /* @__PURE__ */ W("div", {
|
|
2162
|
+
...L,
|
|
2158
2163
|
ref: h,
|
|
2159
2164
|
className: Q.root__resizeBottom
|
|
2160
2165
|
})
|
|
2161
2166
|
]
|
|
2162
2167
|
}) });
|
|
2163
2168
|
}
|
|
2164
|
-
function
|
|
2169
|
+
function En(e) {
|
|
2165
2170
|
return (t) => {
|
|
2166
|
-
let n = [
|
|
2171
|
+
let n = [oe(e)];
|
|
2167
2172
|
return t.context === "overlay" && n.push(S), y(n, t);
|
|
2168
2173
|
};
|
|
2169
2174
|
}
|
|
2170
2175
|
// src/components/day-week-event/DayWeekEventPreview.tsx
|
|
2171
|
-
function
|
|
2176
|
+
function Dn({ part: e, timelineMinutes: t, children: n }) {
|
|
2172
2177
|
let r = (e) => `${e / t * 100}%`;
|
|
2173
|
-
return /* @__PURE__ */
|
|
2178
|
+
return /* @__PURE__ */ W("div", {
|
|
2174
2179
|
"aria-hidden": "true",
|
|
2175
2180
|
className: `${Q.root} ${Q.root_isResizing} ${Q.root_isPreview}`,
|
|
2176
2181
|
"data-continues-before": e.isStart ? void 0 : "",
|
|
@@ -2181,7 +2186,7 @@ function En({ part: e, timelineMinutes: t, children: n }) {
|
|
|
2181
2186
|
left: 0,
|
|
2182
2187
|
width: "100%"
|
|
2183
2188
|
},
|
|
2184
|
-
children: /* @__PURE__ */
|
|
2189
|
+
children: /* @__PURE__ */ W("div", {
|
|
2185
2190
|
className: Q.root__container,
|
|
2186
2191
|
children: n
|
|
2187
2192
|
})
|
|
@@ -2210,8 +2215,8 @@ var $ = {
|
|
|
2210
2215
|
root__hiddenEventsIcon: "_root__hiddenEventsIcon_1140w_251"
|
|
2211
2216
|
};
|
|
2212
2217
|
// src/components/day-week-view/HiddenEvents.tsx
|
|
2213
|
-
function
|
|
2214
|
-
let { hourMin: r, hideMinMaxTime: a, size: o } =
|
|
2218
|
+
function On({ scrollerRef: e, columns: t, rowHeight: n }) {
|
|
2219
|
+
let { hourMin: r, hideMinMaxTime: a, size: o } = J(), s = K(), l = Ge(), { addGlobalListener: u, removeGlobalListener: f } = it(), [p, m] = d(null), h = n / 60, g = q(() => {
|
|
2215
2220
|
let t = e.current;
|
|
2216
2221
|
if (!t) return;
|
|
2217
2222
|
let n = {
|
|
@@ -2219,7 +2224,7 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
|
|
|
2219
2224
|
height: t.clientHeight
|
|
2220
2225
|
};
|
|
2221
2226
|
m((e) => e?.top === n.top && e.height === n.height ? e : n);
|
|
2222
|
-
}), _ =
|
|
2227
|
+
}), _ = qe(g);
|
|
2223
2228
|
i(() => {
|
|
2224
2229
|
let t = e.current;
|
|
2225
2230
|
if (t) return g(), u(t, "scroll", g, { passive: !0 }), _?.observe(t), () => {
|
|
@@ -2236,7 +2241,7 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
|
|
|
2236
2241
|
n,
|
|
2237
2242
|
t
|
|
2238
2243
|
]);
|
|
2239
|
-
let v = c(() => p && p.height > 0 ? t.map((e) =>
|
|
2244
|
+
let v = c(() => p && p.height > 0 ? t.map((e) => I(e, h, p.top, p.height)) : null, [
|
|
2240
2245
|
t,
|
|
2241
2246
|
h,
|
|
2242
2247
|
p
|
|
@@ -2248,34 +2253,34 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
|
|
|
2248
2253
|
}), b = (e, t) => {
|
|
2249
2254
|
let [n] = e;
|
|
2250
2255
|
if (!n) return null;
|
|
2251
|
-
let i = e.length === 1 && o !== "narrow" ?
|
|
2256
|
+
let i = e.length === 1 && o !== "narrow" ? A(s, n.start, {
|
|
2252
2257
|
hourMin: r,
|
|
2253
2258
|
hideMinMaxTime: a
|
|
2254
2259
|
}) : e.length;
|
|
2255
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ G("button", {
|
|
2256
2261
|
type: "button",
|
|
2257
2262
|
className: $.root__hiddenEvents,
|
|
2258
2263
|
"data-direction": t,
|
|
2259
2264
|
"aria-label": t === "above" ? l.earlier(e.length) : l.later(e.length),
|
|
2260
2265
|
onClick: () => y(n),
|
|
2261
|
-
children: [/* @__PURE__ */
|
|
2266
|
+
children: [/* @__PURE__ */ W(yt, {
|
|
2262
2267
|
"aria-hidden": "true",
|
|
2263
2268
|
className: $.root__hiddenEventsIcon
|
|
2264
2269
|
}), i]
|
|
2265
2270
|
});
|
|
2266
2271
|
};
|
|
2267
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ G("div", {
|
|
2268
2273
|
className: $.root__hiddenEventsLayer,
|
|
2269
|
-
children: [/* @__PURE__ */
|
|
2274
|
+
children: [/* @__PURE__ */ W("div", {}), v.map(({ above: e, below: t }, n) => /* @__PURE__ */ G("div", {
|
|
2270
2275
|
className: $.root__hiddenEventsColumn,
|
|
2271
2276
|
children: [b(e, "above"), b(t, "below")]
|
|
2272
2277
|
}, n))]
|
|
2273
2278
|
});
|
|
2274
2279
|
}
|
|
2275
2280
|
// src/components/day-week-view/useTimeColumnWidth.ts
|
|
2276
|
-
function
|
|
2281
|
+
function kn(e, t, n) {
|
|
2277
2282
|
let [r, i] = d();
|
|
2278
|
-
return
|
|
2283
|
+
return Ke(() => {
|
|
2279
2284
|
let t = !1, r = () => {
|
|
2280
2285
|
let r = e.current;
|
|
2281
2286
|
if (t || !r) return;
|
|
@@ -2299,13 +2304,13 @@ function On(e, t, n) {
|
|
|
2299
2304
|
]), r;
|
|
2300
2305
|
}
|
|
2301
2306
|
// src/components/day-week-view/DayWeekView.tsx
|
|
2302
|
-
var
|
|
2307
|
+
var An = {
|
|
2303
2308
|
regular: 64,
|
|
2304
2309
|
compact: 44,
|
|
2305
2310
|
narrow: 40
|
|
2306
2311
|
};
|
|
2307
|
-
function
|
|
2308
|
-
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: x } =
|
|
2312
|
+
function jn({ rowHeight: e, ...t }) {
|
|
2313
|
+
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: x } = J(), S = K(), C = Ge(), { getMonthDay: w, getWeekDay: E, isToday: O, weekDayShortName: k } = S, ee = mt(), A = e ?? m[h], j = u(null), M = u(null), N = c(() => T(S, f, {
|
|
2309
2314
|
hourMin: i,
|
|
2310
2315
|
hourMax: a,
|
|
2311
2316
|
hideMinMaxTime: g
|
|
@@ -2316,11 +2321,11 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2316
2321
|
a,
|
|
2317
2322
|
g,
|
|
2318
2323
|
l
|
|
2319
|
-
]),
|
|
2324
|
+
]), P = kn(j, c(() => N.map(({ time: e }) => e), [N]), An[h]), F = c(() => ue(S, o, r), [
|
|
2320
2325
|
S,
|
|
2321
2326
|
o,
|
|
2322
2327
|
r
|
|
2323
|
-
]),
|
|
2328
|
+
]), I = c(() => ({
|
|
2324
2329
|
hourMin: i,
|
|
2325
2330
|
hourMax: a,
|
|
2326
2331
|
hideMinMaxTime: g
|
|
@@ -2328,28 +2333,28 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2328
2333
|
i,
|
|
2329
2334
|
a,
|
|
2330
2335
|
g
|
|
2331
|
-
]),
|
|
2336
|
+
]), L = c(() => b(s, S, N.length * 60, F, I), [
|
|
2332
2337
|
s,
|
|
2333
2338
|
S,
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
]),
|
|
2338
|
-
days:
|
|
2339
|
-
viewportRef:
|
|
2339
|
+
N.length,
|
|
2340
|
+
F,
|
|
2341
|
+
I
|
|
2342
|
+
]), R = c(() => L.map(({ events: e }) => e), [L]), { state: z, actions: B, previewOf: te } = gn({
|
|
2343
|
+
days: F,
|
|
2344
|
+
viewportRef: j,
|
|
2340
2345
|
dateUtils: S,
|
|
2341
|
-
bounds:
|
|
2346
|
+
bounds: I,
|
|
2342
2347
|
timeStep: f,
|
|
2343
2348
|
preventOutBoundsChanges: l,
|
|
2344
2349
|
disabled: _,
|
|
2345
2350
|
getIsDayDisabled: v,
|
|
2346
2351
|
eventMap: s,
|
|
2347
2352
|
onEventChange: y
|
|
2348
|
-
}),
|
|
2353
|
+
}), V = c(() => z ? De(z.range[0], z.range[1], F.length, I) : [], [
|
|
2349
2354
|
z,
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
]),
|
|
2355
|
+
F.length,
|
|
2356
|
+
I
|
|
2357
|
+
]), ne = z ? s.get(z.key)?.value : void 0, H = n((e) => ae(S, e, {
|
|
2353
2358
|
hourMin: i,
|
|
2354
2359
|
hourMax: a,
|
|
2355
2360
|
hideMinMaxTime: g
|
|
@@ -2358,8 +2363,8 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2358
2363
|
g,
|
|
2359
2364
|
a,
|
|
2360
2365
|
i
|
|
2361
|
-
]),
|
|
2362
|
-
let n = E(e), r = O(e), i =
|
|
2366
|
+
]), re = c(() => F.map((e, t) => {
|
|
2367
|
+
let n = E(e), r = O(e), i = L[t]?.events ?? [];
|
|
2363
2368
|
return {
|
|
2364
2369
|
attributes: r ? { "data-is-today": !0 } : void 0,
|
|
2365
2370
|
events: i,
|
|
@@ -2370,25 +2375,27 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2370
2375
|
weekDayNumber: n
|
|
2371
2376
|
};
|
|
2372
2377
|
}), [
|
|
2373
|
-
|
|
2378
|
+
ee,
|
|
2374
2379
|
S,
|
|
2375
|
-
|
|
2376
|
-
|
|
2380
|
+
F,
|
|
2381
|
+
L,
|
|
2377
2382
|
w,
|
|
2378
2383
|
E,
|
|
2379
2384
|
O,
|
|
2380
2385
|
k
|
|
2381
|
-
]),
|
|
2382
|
-
viewportRef:
|
|
2383
|
-
getTimeFrame:
|
|
2386
|
+
]), ie = dt(), oe = t, se = $.root__head, ce = $.root__body, le = $.root__viewport, de = $.root__column, fe = $.root__headerCell, U = $.root__headerCellDay, pe = $.root__row, me = $.root__rowHeadTime, he = $.root__timeStep, ge = st(j), _e = c(() => ({
|
|
2387
|
+
viewportRef: j,
|
|
2388
|
+
getTimeFrame: H,
|
|
2389
|
+
pxPerMinute: A / 60,
|
|
2384
2390
|
resize: B,
|
|
2385
2391
|
resizing: z
|
|
2386
2392
|
}), [
|
|
2387
|
-
|
|
2388
|
-
|
|
2393
|
+
j,
|
|
2394
|
+
H,
|
|
2395
|
+
A,
|
|
2389
2396
|
B,
|
|
2390
2397
|
z
|
|
2391
|
-
]),
|
|
2398
|
+
]), ve = c(() => ({ viewportRef: j }), [j]), ye = (e, t) => /* @__PURE__ */ W(Tn, {
|
|
2392
2399
|
"data-idx": t,
|
|
2393
2400
|
eventData: e,
|
|
2394
2401
|
children: d.current?.(e.value, o, {
|
|
@@ -2396,74 +2403,74 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2396
2403
|
isEnd: e.isEnd
|
|
2397
2404
|
})
|
|
2398
2405
|
}, e.key);
|
|
2399
|
-
return /* @__PURE__ */
|
|
2400
|
-
value:
|
|
2401
|
-
children: /* @__PURE__ */
|
|
2402
|
-
value:
|
|
2403
|
-
children: /* @__PURE__ */
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
...
|
|
2406
|
-
className: D(
|
|
2406
|
+
return /* @__PURE__ */ W(_n.Provider, {
|
|
2407
|
+
value: _e,
|
|
2408
|
+
children: /* @__PURE__ */ W(Nt.Provider, {
|
|
2409
|
+
value: ve,
|
|
2410
|
+
children: /* @__PURE__ */ G(ze, { children: [
|
|
2411
|
+
/* @__PURE__ */ G("div", {
|
|
2412
|
+
...oe,
|
|
2413
|
+
className: D(oe.className, $.root, { [$.root_scrollable]: p }),
|
|
2407
2414
|
style: {
|
|
2408
|
-
...
|
|
2409
|
-
"--calendar-column-count":
|
|
2410
|
-
"--scrollbar-width":
|
|
2411
|
-
"--scrollbar-height":
|
|
2412
|
-
...
|
|
2415
|
+
...oe.style,
|
|
2416
|
+
"--calendar-column-count": re.length,
|
|
2417
|
+
"--scrollbar-width": ie.width,
|
|
2418
|
+
"--scrollbar-height": ie.height,
|
|
2419
|
+
...P !== void 0 && { "--ww-time-column": `${P}px` }
|
|
2413
2420
|
},
|
|
2414
|
-
children: [/* @__PURE__ */
|
|
2415
|
-
className:
|
|
2416
|
-
children: [/* @__PURE__ */
|
|
2417
|
-
className:
|
|
2421
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2422
|
+
className: se,
|
|
2423
|
+
children: [/* @__PURE__ */ W("div", { className: fe }), re.map((e) => /* @__PURE__ */ G("div", {
|
|
2424
|
+
className: fe,
|
|
2418
2425
|
...e.attributes,
|
|
2419
|
-
children: [/* @__PURE__ */
|
|
2420
|
-
className:
|
|
2426
|
+
children: [/* @__PURE__ */ W("span", {
|
|
2427
|
+
className: U,
|
|
2421
2428
|
children: e.day
|
|
2422
|
-
}), /* @__PURE__ */
|
|
2429
|
+
}), /* @__PURE__ */ G("span", {
|
|
2423
2430
|
className: $.root__headerCellLabel,
|
|
2424
|
-
children: [/* @__PURE__ */
|
|
2431
|
+
children: [/* @__PURE__ */ W("span", {
|
|
2425
2432
|
className: $.root__headerCellName,
|
|
2426
2433
|
children: e.weekDayName
|
|
2427
|
-
}), e.isToday && /* @__PURE__ */
|
|
2434
|
+
}), e.isToday && /* @__PURE__ */ W("span", {
|
|
2428
2435
|
className: $.root__headerCellToday,
|
|
2429
2436
|
children: C.today
|
|
2430
2437
|
})]
|
|
2431
2438
|
})]
|
|
2432
2439
|
}, e.weekDayNumber))]
|
|
2433
|
-
}), /* @__PURE__ */
|
|
2440
|
+
}), /* @__PURE__ */ G("div", {
|
|
2434
2441
|
className: $.root__main,
|
|
2435
|
-
children: [/* @__PURE__ */
|
|
2436
|
-
ref:
|
|
2437
|
-
className:
|
|
2438
|
-
children: /* @__PURE__ */
|
|
2439
|
-
ref:
|
|
2440
|
-
className:
|
|
2441
|
-
style: { height:
|
|
2442
|
-
children: [/* @__PURE__ */
|
|
2443
|
-
className:
|
|
2444
|
-
children:
|
|
2445
|
-
className:
|
|
2442
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2443
|
+
ref: M,
|
|
2444
|
+
className: ce,
|
|
2445
|
+
children: /* @__PURE__ */ G("div", {
|
|
2446
|
+
ref: ge,
|
|
2447
|
+
className: le,
|
|
2448
|
+
style: { height: N.length * A },
|
|
2449
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2450
|
+
className: de,
|
|
2451
|
+
children: N.map(({ time: e, value: t, steps: n }, r) => /* @__PURE__ */ G("div", {
|
|
2452
|
+
className: pe,
|
|
2446
2453
|
style: {
|
|
2447
|
-
height:
|
|
2448
|
-
"--translateY": r *
|
|
2454
|
+
height: A,
|
|
2455
|
+
"--translateY": r * A,
|
|
2449
2456
|
"--calendar-rows-count": n.length
|
|
2450
2457
|
},
|
|
2451
|
-
children: [/* @__PURE__ */
|
|
2452
|
-
className:
|
|
2458
|
+
children: [/* @__PURE__ */ W("time", {
|
|
2459
|
+
className: me,
|
|
2453
2460
|
children: e
|
|
2454
|
-
}), n.map(([e, , t]) => /* @__PURE__ */
|
|
2461
|
+
}), n.map(([e, , t]) => /* @__PURE__ */ W("div", { className: D(he, { [$.root__timeStep_overTime]: t }) }, e))]
|
|
2455
2462
|
}, t))
|
|
2456
|
-
}),
|
|
2457
|
-
className:
|
|
2463
|
+
}), re.map((e, t) => /* @__PURE__ */ W("div", {
|
|
2464
|
+
className: de,
|
|
2458
2465
|
"data-day-index": t,
|
|
2459
2466
|
...e.attributes,
|
|
2460
|
-
children: /* @__PURE__ */
|
|
2467
|
+
children: /* @__PURE__ */ G(xn, {
|
|
2461
2468
|
id: `${e.weekDayNumber}`,
|
|
2462
2469
|
targetDate: e.targetDate,
|
|
2463
|
-
children: [e.events.map((e, t) =>
|
|
2470
|
+
children: [e.events.map((e, t) => ye(e, t)), V.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ W(Dn, {
|
|
2464
2471
|
part: e,
|
|
2465
|
-
timelineMinutes:
|
|
2466
|
-
children:
|
|
2472
|
+
timelineMinutes: N.length * 60,
|
|
2473
|
+
children: ne === void 0 ? null : d.current?.(ne, o, {
|
|
2467
2474
|
isStart: e.isStart,
|
|
2468
2475
|
isEnd: e.isEnd
|
|
2469
2476
|
})
|
|
@@ -2471,15 +2478,15 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2471
2478
|
})
|
|
2472
2479
|
}, e.weekDayNumber))]
|
|
2473
2480
|
})
|
|
2474
|
-
}), p && /* @__PURE__ */
|
|
2475
|
-
scrollerRef:
|
|
2476
|
-
columns:
|
|
2477
|
-
rowHeight:
|
|
2481
|
+
}), p && /* @__PURE__ */ W(On, {
|
|
2482
|
+
scrollerRef: M,
|
|
2483
|
+
columns: R,
|
|
2484
|
+
rowHeight: A
|
|
2478
2485
|
})]
|
|
2479
2486
|
})]
|
|
2480
2487
|
}),
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
z && !z.blocked && /* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ W(zt, { pxPerMinute: A / 60 }),
|
|
2489
|
+
z && !z.blocked && /* @__PURE__ */ W(It, {
|
|
2483
2490
|
coordinates: {
|
|
2484
2491
|
x: z.x,
|
|
2485
2492
|
y: z.y
|
|
@@ -2493,141 +2500,141 @@ function An({ rowHeight: e, ...t }) {
|
|
|
2493
2500
|
})
|
|
2494
2501
|
});
|
|
2495
2502
|
}
|
|
2496
|
-
var
|
|
2503
|
+
var Mn = {
|
|
2497
2504
|
root: "_root_1jr3p_2",
|
|
2498
2505
|
root__head: "_root__head_1jr3p_22",
|
|
2499
2506
|
root__body: "_root__body_1jr3p_26",
|
|
2500
2507
|
root__body_readonly: "_root__body_readonly_1jr3p_35"
|
|
2501
2508
|
};
|
|
2502
2509
|
// src/Calendar.tsx
|
|
2503
|
-
function
|
|
2504
|
-
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: _, getIsDayDisabled: v, pointerPreviewFormat: y, scrollable: b = !1, view: x, defaultView: S, viewValue: C, defaultViewValue: T, onChangeView: E, onChangeViewValue: O, ...k } = e, { hourMax:
|
|
2510
|
+
function Nn(e) {
|
|
2511
|
+
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: _, getIsDayDisabled: v, pointerPreviewFormat: y, scrollable: b = !1, view: x, defaultView: S, viewValue: C, defaultViewValue: T, onChangeView: E, onChangeViewValue: O, ...k } = e, { hourMax: ee, hourMin: A } = {
|
|
2505
2512
|
hourMin: 0,
|
|
2506
2513
|
hourMax: 24,
|
|
2507
2514
|
...o
|
|
2508
|
-
},
|
|
2515
|
+
}, M = Ye({
|
|
2509
2516
|
eventTimeFrameResolver: g,
|
|
2510
2517
|
eventKeyResolver: _
|
|
2511
|
-
}),
|
|
2518
|
+
}), N = K(), P = s ?? N.weekStartsOn, I = u(null), L = st(I, t), { viewValue: R, changeViewValue: z, view: B, changeView: te } = _t({
|
|
2512
2519
|
view: x,
|
|
2513
2520
|
defaultView: S,
|
|
2514
2521
|
viewValue: C,
|
|
2515
2522
|
defaultViewValue: T,
|
|
2516
2523
|
onChangeView: E,
|
|
2517
2524
|
onChangeViewValue: O,
|
|
2518
|
-
dateUtils:
|
|
2519
|
-
startWeek:
|
|
2520
|
-
}),
|
|
2521
|
-
hourMin:
|
|
2525
|
+
dateUtils: N,
|
|
2526
|
+
startWeek: P
|
|
2527
|
+
}), V = Je(I), ne = tt(je).current, H = c(() => w(d, M.current, N, {
|
|
2528
|
+
hourMin: A,
|
|
2522
2529
|
hideMinMaxTime: a
|
|
2523
2530
|
}), [
|
|
2524
|
-
|
|
2531
|
+
N,
|
|
2525
2532
|
a,
|
|
2526
|
-
|
|
2533
|
+
A,
|
|
2527
2534
|
d,
|
|
2528
|
-
|
|
2529
|
-
]), { goBackward:
|
|
2535
|
+
M
|
|
2536
|
+
]), { goBackward: re, goForward: ie, goToday: ae } = vt({
|
|
2530
2537
|
changeViewValue: z,
|
|
2531
|
-
dateUtils:
|
|
2532
|
-
startWeek:
|
|
2538
|
+
dateUtils: N,
|
|
2539
|
+
startWeek: P,
|
|
2533
2540
|
view: B,
|
|
2534
|
-
viewValue:
|
|
2535
|
-
}),
|
|
2536
|
-
let r =
|
|
2537
|
-
r && p?.(r.value, ...
|
|
2538
|
-
}),
|
|
2539
|
-
f?.(...
|
|
2540
|
-
}),
|
|
2541
|
-
let t =
|
|
2541
|
+
viewValue: R
|
|
2542
|
+
}), oe = q((e, t, n) => {
|
|
2543
|
+
let r = H.get(e);
|
|
2544
|
+
r && p?.(r.value, ...F(N, t, n));
|
|
2545
|
+
}), ce = q((e, t) => {
|
|
2546
|
+
f?.(...F(N, e, t));
|
|
2547
|
+
}), le = q((e) => {
|
|
2548
|
+
let t = H.get(e);
|
|
2542
2549
|
t && h?.(t.value);
|
|
2543
|
-
}),
|
|
2544
|
-
let t =
|
|
2550
|
+
}), ue = q((e) => {
|
|
2551
|
+
let t = H.get(e);
|
|
2545
2552
|
t && m?.(t.value);
|
|
2546
|
-
}),
|
|
2547
|
-
let [r, i] =
|
|
2548
|
-
hourMin:
|
|
2553
|
+
}), de = Ye((e, t, n) => {
|
|
2554
|
+
let [r, i] = se(N, e, t, n, {
|
|
2555
|
+
hourMin: A,
|
|
2549
2556
|
hideMinMaxTime: a
|
|
2550
2557
|
});
|
|
2551
|
-
return y ? y(r, i) :
|
|
2552
|
-
}),
|
|
2558
|
+
return y ? y(r, i) : j(N, r, i);
|
|
2559
|
+
}), fe = Ye(r);
|
|
2553
2560
|
i(() => {
|
|
2554
|
-
if (
|
|
2555
|
-
}, [
|
|
2556
|
-
let
|
|
2561
|
+
if (I.current) return ne.getState().registerRootElement(I.current);
|
|
2562
|
+
}, [ne]);
|
|
2563
|
+
let U = {
|
|
2557
2564
|
...k,
|
|
2558
|
-
ref:
|
|
2559
|
-
},
|
|
2565
|
+
ref: L
|
|
2566
|
+
}, pe = c(() => ({
|
|
2560
2567
|
disabled: n,
|
|
2561
2568
|
getIsDayDisabled: v,
|
|
2562
2569
|
preventOutBoundsChanges: !!o,
|
|
2563
2570
|
changeView: te,
|
|
2564
2571
|
changeViewValue: z,
|
|
2565
|
-
eventMap:
|
|
2566
|
-
goBackward:
|
|
2567
|
-
goForward:
|
|
2568
|
-
goToday:
|
|
2572
|
+
eventMap: H,
|
|
2573
|
+
goBackward: re,
|
|
2574
|
+
goForward: ie,
|
|
2575
|
+
goToday: ae,
|
|
2569
2576
|
hideMinMaxTime: a,
|
|
2570
|
-
hourMax:
|
|
2571
|
-
hourMin:
|
|
2577
|
+
hourMax: ee,
|
|
2578
|
+
hourMin: A,
|
|
2572
2579
|
timeStep: l,
|
|
2573
2580
|
scrollable: b,
|
|
2574
|
-
size:
|
|
2575
|
-
startWeek:
|
|
2581
|
+
size: V,
|
|
2582
|
+
startWeek: P,
|
|
2576
2583
|
view: B,
|
|
2577
|
-
viewValue:
|
|
2578
|
-
onEventCreate:
|
|
2579
|
-
onEventChange:
|
|
2580
|
-
onEventDelete:
|
|
2581
|
-
onEventEdit:
|
|
2582
|
-
eventRenderer:
|
|
2583
|
-
pointerPreviewRenderer:
|
|
2584
|
+
viewValue: R,
|
|
2585
|
+
onEventCreate: ce,
|
|
2586
|
+
onEventChange: oe,
|
|
2587
|
+
onEventDelete: ue,
|
|
2588
|
+
onEventEdit: le,
|
|
2589
|
+
eventRenderer: fe,
|
|
2590
|
+
pointerPreviewRenderer: de
|
|
2584
2591
|
}), [
|
|
2585
2592
|
n,
|
|
2586
|
-
|
|
2593
|
+
de,
|
|
2587
2594
|
v,
|
|
2588
2595
|
te,
|
|
2589
2596
|
z,
|
|
2597
|
+
H,
|
|
2598
|
+
re,
|
|
2590
2599
|
ie,
|
|
2591
2600
|
ae,
|
|
2592
|
-
oe,
|
|
2593
|
-
se,
|
|
2594
2601
|
a,
|
|
2602
|
+
ee,
|
|
2595
2603
|
A,
|
|
2596
|
-
j,
|
|
2597
2604
|
b,
|
|
2598
|
-
|
|
2599
|
-
|
|
2605
|
+
V,
|
|
2606
|
+
P,
|
|
2600
2607
|
l,
|
|
2601
2608
|
B,
|
|
2602
|
-
|
|
2603
|
-
ue,
|
|
2609
|
+
R,
|
|
2604
2610
|
ce,
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2611
|
+
oe,
|
|
2612
|
+
ue,
|
|
2613
|
+
le,
|
|
2614
|
+
fe
|
|
2608
2615
|
]);
|
|
2609
|
-
return /* @__PURE__ */
|
|
2610
|
-
...
|
|
2611
|
-
className: D(
|
|
2612
|
-
"data-ww-size":
|
|
2613
|
-
children: /* @__PURE__ */
|
|
2614
|
-
value:
|
|
2615
|
-
children: /* @__PURE__ */
|
|
2616
|
-
value:
|
|
2617
|
-
children: /* @__PURE__ */
|
|
2618
|
-
value:
|
|
2619
|
-
children: [/* @__PURE__ */
|
|
2620
|
-
className:
|
|
2621
|
-
children: /* @__PURE__ */
|
|
2622
|
-
}), /* @__PURE__ */
|
|
2623
|
-
className:
|
|
2624
|
-
children:
|
|
2616
|
+
return /* @__PURE__ */ W("div", {
|
|
2617
|
+
...U,
|
|
2618
|
+
className: D(U.className, Mn.root),
|
|
2619
|
+
"data-ww-size": V === "regular" ? void 0 : V,
|
|
2620
|
+
children: /* @__PURE__ */ W(ht.Provider, {
|
|
2621
|
+
value: pe,
|
|
2622
|
+
children: /* @__PURE__ */ W(Me.Provider, {
|
|
2623
|
+
value: ne,
|
|
2624
|
+
children: /* @__PURE__ */ G(gt.Provider, {
|
|
2625
|
+
value: I,
|
|
2626
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2627
|
+
className: Mn.root__head,
|
|
2628
|
+
children: /* @__PURE__ */ W(Mt, {})
|
|
2629
|
+
}), /* @__PURE__ */ W("div", {
|
|
2630
|
+
className: Mn.root__body,
|
|
2631
|
+
children: W(B === "month" ? mn : jn, {})
|
|
2625
2632
|
})]
|
|
2626
2633
|
})
|
|
2627
2634
|
})
|
|
2628
2635
|
})
|
|
2629
2636
|
});
|
|
2630
2637
|
}
|
|
2631
|
-
export {
|
|
2638
|
+
export { Nn as Calendar, Nn as default, Ve as DateLocalizationContext, We as DateLocalizationProvider, Ue as MessagesContext, E as builtInMessages, Ce as resolveMessages, He as useDateUtils, Ge as useMessages };
|
|
2632
2639
|
|
|
2633
2640
|
//# sourceMappingURL=index.js.map
|