@dotss/tictoccroc 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +54 -0
- package/dist/shared/components/Calendar/Calendar.d.ts +10 -0
- package/dist/shared/components/Calendar/Calendar.mjs +80 -0
- package/dist/shared/components/Calendar/index.d.ts +2 -0
- package/dist/shared/components/Calendar/index.mjs +4 -0
- package/dist/shared/components/Carousel/Carousel.d.ts +16 -0
- package/dist/shared/components/Carousel/Carousel.mjs +205 -0
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.d.ts +4 -0
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +8 -0
- package/dist/shared/components/Carousel/CarouselSlide/index.d.ts +3 -0
- package/dist/shared/components/Carousel/CarouselSlide/index.mjs +4 -0
- package/dist/shared/components/Carousel/index.d.ts +4 -0
- package/dist/shared/components/Carousel/index.mjs +6 -0
- package/dist/shared/components/Image/Image.d.ts +20 -0
- package/dist/shared/components/Image/Image.mjs +181 -0
- package/dist/shared/components/Image/index.d.ts +3 -0
- package/dist/shared/components/Image/index.mjs +4 -0
- package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.d.ts +8 -0
- package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.mjs +50 -0
- package/dist/shared/components/ImageZoomDialog/ImageBlock/index.d.ts +2 -0
- package/dist/shared/components/ImageZoomDialog/ImageBlock/index.mjs +4 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.d.ts +16 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.mjs +344 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.d.ts +3 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs +23 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/index.d.ts +2 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/index.mjs +4 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.d.ts +3 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs +28 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/index.d.ts +2 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/index.mjs +4 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.d.ts +3 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs +22 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/index.d.ts +2 -0
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/index.mjs +4 -0
- package/dist/shared/components/ImageZoomDialog/index.d.ts +6 -0
- package/dist/shared/components/ImageZoomDialog/index.mjs +10 -0
- package/dist/shared/components/Roller/Roller.d.ts +9 -0
- package/dist/shared/components/Roller/Roller.mjs +122 -0
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.d.ts +4 -0
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +8 -0
- package/dist/shared/components/Roller/RollerBlock/index.d.ts +3 -0
- package/dist/shared/components/Roller/RollerBlock/index.mjs +4 -0
- package/dist/shared/components/Roller/index.d.ts +4 -0
- package/dist/shared/components/Roller/index.mjs +6 -0
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.d.ts +7 -0
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +31 -0
- package/dist/shared/components/Scheduler/ScheduleBlock/index.d.ts +3 -0
- package/dist/shared/components/Scheduler/ScheduleBlock/index.mjs +4 -0
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.d.ts +9 -0
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +36 -0
- package/dist/shared/components/Scheduler/ScheduleEvent/index.d.ts +3 -0
- package/dist/shared/components/Scheduler/ScheduleEvent/index.mjs +4 -0
- package/dist/shared/components/Scheduler/Scheduler.d.ts +15 -0
- package/dist/shared/components/Scheduler/Scheduler.mjs +552 -0
- package/dist/shared/components/Scheduler/Scheduler.utils.d.ts +32 -0
- package/dist/shared/components/Scheduler/Scheduler.utils.mjs +92 -0
- package/dist/shared/components/Scheduler/index.d.ts +6 -0
- package/dist/shared/components/Scheduler/index.mjs +10 -0
- package/dist/shared/components/Swiper/Swiper.d.ts +25 -0
- package/dist/shared/components/Swiper/Swiper.mjs +274 -0
- package/dist/shared/components/Swiper/Swiper.utils.d.ts +13 -0
- package/dist/shared/components/Swiper/Swiper.utils.mjs +25 -0
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.d.ts +4 -0
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +19 -0
- package/dist/shared/components/Swiper/SwiperBlock/index.d.ts +3 -0
- package/dist/shared/components/Swiper/SwiperBlock/index.mjs +4 -0
- package/dist/shared/components/Swiper/index.d.ts +4 -0
- package/dist/shared/components/Swiper/index.mjs +6 -0
- package/dist/shared/components/TimePicker/TimePicker.d.ts +23 -0
- package/dist/shared/components/TimePicker/TimePicker.mjs +122 -0
- package/dist/shared/components/TimePicker/index.d.ts +3 -0
- package/dist/shared/components/TimePicker/index.mjs +4 -0
- package/dist/shared/components/index.d.ts +7 -0
- package/dist/shared/components/index.mjs +30 -0
- package/dist/shared/hooks/index.d.ts +1 -0
- package/dist/shared/hooks/index.mjs +4 -0
- package/dist/shared/hooks/useIsomorphicLayoutEffect/index.d.ts +2 -0
- package/dist/shared/hooks/useIsomorphicLayoutEffect/index.mjs +4 -0
- package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +6 -0
- package/dist/shared/utils/birthDateToAge/birthDateToAge.d.ts +1 -0
- package/dist/shared/utils/birthDateToAge/birthDateToAge.mjs +11 -0
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.d.ts +1 -0
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +12 -0
- package/dist/shared/utils/birthDateToAge/index.d.ts +2 -0
- package/dist/shared/utils/birthDateToAge/index.mjs +4 -0
- package/dist/shared/utils/getDateRange/getDateRange.d.ts +11 -0
- package/dist/shared/utils/getDateRange/getDateRange.mjs +21 -0
- package/dist/shared/utils/getDateRange/getDateRange.test.d.ts +1 -0
- package/dist/shared/utils/getDateRange/getDateRange.test.mjs +61 -0
- package/dist/shared/utils/getDateRange/index.d.ts +2 -0
- package/dist/shared/utils/getDateRange/index.mjs +4 -0
- package/dist/shared/utils/getImageUrl/getImageUrl.d.ts +3 -0
- package/dist/shared/utils/getImageUrl/getImageUrl.mjs +17 -0
- package/dist/shared/utils/getImageUrl/getImageUrl.test.d.ts +1 -0
- package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +28 -0
- package/dist/shared/utils/getImageUrl/index.d.ts +3 -0
- package/dist/shared/utils/getImageUrl/index.mjs +6 -0
- package/dist/shared/utils/getTimeRange/getTimeRange.d.ts +12 -0
- package/dist/shared/utils/getTimeRange/getTimeRange.mjs +22 -0
- package/dist/shared/utils/getTimeRange/getTimeRange.test.d.ts +1 -0
- package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +76 -0
- package/dist/shared/utils/getTimeRange/index.d.ts +2 -0
- package/dist/shared/utils/getTimeRange/index.mjs +4 -0
- package/dist/shared/utils/getVimeoId/getVimeoId.d.ts +1 -0
- package/dist/shared/utils/getVimeoId/getVimeoId.mjs +12 -0
- package/dist/shared/utils/getVimeoId/getVimeoId.test.d.ts +1 -0
- package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +15 -0
- package/dist/shared/utils/getVimeoId/index.d.ts +2 -0
- package/dist/shared/utils/getVimeoId/index.mjs +4 -0
- package/dist/shared/utils/index.d.ts +11 -0
- package/dist/shared/utils/index.mjs +24 -0
- package/dist/shared/utils/isAndroid/index.d.ts +2 -0
- package/dist/shared/utils/isAndroid/index.mjs +4 -0
- package/dist/shared/utils/isAndroid/isAndroid.d.ts +1 -0
- package/dist/shared/utils/isAndroid/isAndroid.mjs +6 -0
- package/dist/shared/utils/isAndroid/isAndroid.test.d.ts +1 -0
- package/dist/shared/utils/isAndroid/isAndroid.test.mjs +13 -0
- package/dist/shared/utils/isApp/index.d.ts +2 -0
- package/dist/shared/utils/isApp/index.mjs +4 -0
- package/dist/shared/utils/isApp/isApp.d.ts +1 -0
- package/dist/shared/utils/isApp/isApp.mjs +6 -0
- package/dist/shared/utils/isApp/isApp.test.d.ts +1 -0
- package/dist/shared/utils/isApp/isApp.test.mjs +23 -0
- package/dist/shared/utils/isDesktop/index.d.ts +2 -0
- package/dist/shared/utils/isDesktop/index.mjs +4 -0
- package/dist/shared/utils/isDesktop/isDesktop.d.ts +1 -0
- package/dist/shared/utils/isDesktop/isDesktop.mjs +16 -0
- package/dist/shared/utils/isDesktop/isDesktop.test.d.ts +1 -0
- package/dist/shared/utils/isDesktop/isDesktop.test.mjs +11 -0
- package/dist/shared/utils/isServer/index.d.ts +2 -0
- package/dist/shared/utils/isServer/index.mjs +4 -0
- package/dist/shared/utils/isServer/isServer.d.ts +1 -0
- package/dist/shared/utils/isServer/isServer.mjs +6 -0
- package/dist/shared/utils/isServer/isServer.test.d.ts +1 -0
- package/dist/shared/utils/isServer/isServer.test.mjs +13 -0
- package/dist/shared/utils/objectToQueryString/index.d.ts +2 -0
- package/dist/shared/utils/objectToQueryString/index.mjs +4 -0
- package/dist/shared/utils/objectToQueryString/objectToQueryString.d.ts +1 -0
- package/dist/shared/utils/objectToQueryString/objectToQueryString.mjs +9 -0
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.d.ts +1 -0
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +11 -0
- package/dist/shared/utils/parseQueryString/index.d.ts +2 -0
- package/dist/shared/utils/parseQueryString/index.mjs +4 -0
- package/dist/shared/utils/parseQueryString/parseQueryString.d.ts +4 -0
- package/dist/shared/utils/parseQueryString/parseQueryString.mjs +6 -0
- package/dist/shared/utils/parseQueryString/parseQueryString.test.d.ts +1 -0
- package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +16 -0
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.d.ts +2 -0
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +8 -0
- package/dist/teacher/profile/components/ProfileSummary/index.d.ts +2 -0
- package/dist/teacher/profile/components/ProfileSummary/index.mjs +4 -0
- package/package.json +100 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
import { jsxs as D, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as X, useRef as u, Children as be, isValidElement as ye, useEffect as j, cloneElement as le } from "react";
|
|
3
|
+
import { Flexbox as h, Box as ue, Typography as B } from "@thedotscorp/ui";
|
|
4
|
+
import $e from "@thedotscorp/ui/core/useTheme";
|
|
5
|
+
import w from "dayjs";
|
|
6
|
+
import ke from "./ScheduleEvent/ScheduleEvent.mjs";
|
|
7
|
+
import { generateWeek as Q, getDayScheduleEvents as Se, resolvePositionedScheduleEventsForDate as Ee, getMinutesFromMidnight as de } from "./Scheduler.utils.mjs";
|
|
8
|
+
const A = Array.from({ length: 34 }).map((Z, N) => {
|
|
9
|
+
const b = Math.floor((N + 14) / 2) % 24, E = (N + 14) % 2 === 0 ? "00" : "30", M = w().hour(b).minute(parseInt(E)), R = w(), K = R.hour(), y = R.minute(), F = K === b && (y < 30 && E === "00" || y >= 30 && E === "30");
|
|
10
|
+
return {
|
|
11
|
+
time: M.format("HH:mm"),
|
|
12
|
+
label: M.format("A h시 m분"),
|
|
13
|
+
isCurrentTime: F
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
function Ce({
|
|
17
|
+
children: Z,
|
|
18
|
+
date: N = w(),
|
|
19
|
+
legend: b,
|
|
20
|
+
containerRef: E,
|
|
21
|
+
renderScheduleBlock: M,
|
|
22
|
+
onDateChange: R,
|
|
23
|
+
...K
|
|
24
|
+
}) {
|
|
25
|
+
const {
|
|
26
|
+
palette: { grey: y }
|
|
27
|
+
} = $e(), [F, x] = X(N.startOf("week")), [H, fe] = X(20), [T, g] = X(0), [Y, $] = X(0), [me, he] = X(""), O = u(null), pe = u(null), G = u(null), ee = u(0), te = u(0), z = u(!1), I = u(!1), C = u(!1), W = u(0), re = u(0), ne = u(0), oe = u(0), V = u(!1), L = u(null), P = u(0), U = u(0), k = u(0), p = u(null), _ = be.toArray(Z).filter(ye).map((e) => {
|
|
28
|
+
if (e.type === ke) {
|
|
29
|
+
const { startDate: n, endDate: a } = e.props;
|
|
30
|
+
return {
|
|
31
|
+
startDate: n,
|
|
32
|
+
endDate: a,
|
|
33
|
+
children: e
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}).filter(Boolean), ae = [
|
|
38
|
+
Q(F.subtract(1, "week"), _),
|
|
39
|
+
Q(F, _),
|
|
40
|
+
Q(F.add(1, "week"), _)
|
|
41
|
+
], se = (e, n) => (a) => {
|
|
42
|
+
const o = Number(a.currentTarget.dataset.row), i = Number(a.currentTarget.dataset.col);
|
|
43
|
+
g(o), $(i), he(`${e.format("dddd")} ${e.format("D")}일 ${n}`);
|
|
44
|
+
}, ie = (e) => {
|
|
45
|
+
var v, S;
|
|
46
|
+
const n = Number(e.currentTarget.dataset.row), a = Number(e.currentTarget.dataset.col);
|
|
47
|
+
let o = n, i = a;
|
|
48
|
+
switch (e.key) {
|
|
49
|
+
case "ArrowUp": {
|
|
50
|
+
e.preventDefault(), n === 0 && (a - 1 < 0 ? (x((t) => t.add(-1, "week")), g(A.length - 1), $(6), k.current = requestAnimationFrame(() => {
|
|
51
|
+
var t, r;
|
|
52
|
+
(r = (t = p.current) == null ? void 0 : t.querySelector(
|
|
53
|
+
`[data-row="${A.length - 1}"][data-col="6"][data-week="1"]`
|
|
54
|
+
)) == null || r.focus();
|
|
55
|
+
})) : (g(A.length - 1), $(a - 1), k.current = requestAnimationFrame(() => {
|
|
56
|
+
var t, r;
|
|
57
|
+
(r = (t = p.current) == null ? void 0 : t.querySelector(
|
|
58
|
+
`[data-row="${A.length - 1}"][data-col="${a - 1}"][data-week="1"]`
|
|
59
|
+
)) == null || r.focus();
|
|
60
|
+
}))), o = Math.max(n - 1, 0);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case "ArrowDown": {
|
|
64
|
+
if (e.preventDefault(), n === A.length - 1) {
|
|
65
|
+
a + 1 > 6 ? (x((t) => t.add(1, "week")), g(0), $(0), k.current = requestAnimationFrame(() => {
|
|
66
|
+
var t, r;
|
|
67
|
+
(r = (t = p.current) == null ? void 0 : t.querySelector('[data-row="0"][data-col="0"][data-week="1"]')) == null || r.focus();
|
|
68
|
+
})) : (g(0), $(i + 1), k.current = requestAnimationFrame(() => {
|
|
69
|
+
var t, r;
|
|
70
|
+
(r = (t = p.current) == null ? void 0 : t.querySelector(
|
|
71
|
+
`[data-row="0"][data-col="${i + 1}"][data-week="1"]`
|
|
72
|
+
)) == null || r.focus();
|
|
73
|
+
}));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
o = Math.min(n + 1, A.length - 1);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
case "ArrowLeft": {
|
|
80
|
+
if (e.preventDefault(), a === 0) {
|
|
81
|
+
x((s) => s.add(-1, "week")), g(o), $(6), k.current = requestAnimationFrame(() => {
|
|
82
|
+
var s, t;
|
|
83
|
+
(t = (s = p.current) == null ? void 0 : s.querySelector(`[data-row="${o}"][data-col="6"][data-week="1"]`)) == null || t.focus();
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
i = Math.max(a - 1, 0);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "ArrowRight": {
|
|
91
|
+
if (e.preventDefault(), a === 6) {
|
|
92
|
+
x((s) => s.add(1, "week")), g(o), $(0), k.current = requestAnimationFrame(() => {
|
|
93
|
+
var s, t;
|
|
94
|
+
(t = (s = p.current) == null ? void 0 : s.querySelector(`[data-row="${o}"][data-col="0"][data-week="1"]`)) == null || t.focus();
|
|
95
|
+
});
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
i = Math.min(a + 1, 6);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case " ":
|
|
102
|
+
e.preventDefault(), e.currentTarget.click();
|
|
103
|
+
break;
|
|
104
|
+
case "Enter":
|
|
105
|
+
e.preventDefault(), e.currentTarget.click();
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
g(o), $(i), (S = (v = p.current) == null ? void 0 : v.querySelector(`[data-row="${o}"][data-col="${i}"][data-week="1"]`)) == null || S.focus();
|
|
109
|
+
}, ve = (e) => (n) => {
|
|
110
|
+
var i, v, S, d, s, t;
|
|
111
|
+
const a = n.currentTarget.dataset.startDate, o = n.currentTarget.dataset.endDate;
|
|
112
|
+
if (!(!a || !o)) {
|
|
113
|
+
switch (n.key) {
|
|
114
|
+
case " ":
|
|
115
|
+
n.preventDefault(), n.currentTarget.click();
|
|
116
|
+
break;
|
|
117
|
+
case "Enter":
|
|
118
|
+
n.preventDefault(), n.currentTarget.click();
|
|
119
|
+
break;
|
|
120
|
+
case "ArrowUp": {
|
|
121
|
+
n.preventDefault();
|
|
122
|
+
const r = n.currentTarget.previousElementSibling, l = !!(r != null && r.getAttribute("data-is-event"));
|
|
123
|
+
if (r && l)
|
|
124
|
+
r.focus(), g(T - 1);
|
|
125
|
+
else {
|
|
126
|
+
const c = (i = n.currentTarget.parentElement) == null ? void 0 : i.querySelector(
|
|
127
|
+
`[data-time="${w(a).add(-30, "minute").format("HH:mm")}"]`
|
|
128
|
+
);
|
|
129
|
+
c == null || c.focus();
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case "ArrowLeft": {
|
|
134
|
+
n.preventDefault();
|
|
135
|
+
const r = n.currentTarget.previousElementSibling, l = !!(r != null && r.getAttribute("data-is-event"));
|
|
136
|
+
if (r && l)
|
|
137
|
+
r.focus();
|
|
138
|
+
else {
|
|
139
|
+
if (Y === 0) {
|
|
140
|
+
x((f) => f.add(-1, "week")), g(0), $(6), k.current = requestAnimationFrame(() => {
|
|
141
|
+
var f, q;
|
|
142
|
+
(q = (f = p.current) == null ? void 0 : f.querySelector('[data-row="0"][data-col="6"][data-week="1"]')) == null || q.focus();
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
(S = (v = p.current) == null ? void 0 : v.querySelector(
|
|
147
|
+
`[data-row="${T}"][data-col="${Y - 1}"][data-week="1"]`
|
|
148
|
+
)) == null || S.focus();
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case "ArrowRight": {
|
|
153
|
+
n.preventDefault();
|
|
154
|
+
const r = n.currentTarget.nextElementSibling, l = !!(r != null && r.getAttribute("data-is-event"));
|
|
155
|
+
if (r && l)
|
|
156
|
+
r.focus();
|
|
157
|
+
else {
|
|
158
|
+
if (Y === 6) {
|
|
159
|
+
x((f) => f.add(1, "week")), g(0), $(0), k.current = requestAnimationFrame(() => {
|
|
160
|
+
var f, q;
|
|
161
|
+
(q = (f = p.current) == null ? void 0 : f.querySelector('[data-row="0"][data-col="0"][data-week="1"]')) == null || q.focus();
|
|
162
|
+
});
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
(s = (d = p.current) == null ? void 0 : d.querySelector(
|
|
166
|
+
`[data-row="${T}"][data-col="${Y + 1}"][data-week="1"]`
|
|
167
|
+
)) == null || s.focus();
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
case "ArrowDown":
|
|
172
|
+
{
|
|
173
|
+
n.preventDefault();
|
|
174
|
+
const r = n.currentTarget.nextElementSibling, l = !!(r != null && r.getAttribute("data-is-event"));
|
|
175
|
+
if (r && l)
|
|
176
|
+
r.focus(), g(T + 1);
|
|
177
|
+
else {
|
|
178
|
+
const c = (t = n.currentTarget.parentElement) == null ? void 0 : t.querySelector(
|
|
179
|
+
`[data-time="${w(o).format("HH:mm")}"]`
|
|
180
|
+
);
|
|
181
|
+
c == null || c.focus();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
e == null || e(n);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return j(() => {
|
|
190
|
+
const e = () => {
|
|
191
|
+
var n;
|
|
192
|
+
if (E != null && E.current && G.current) {
|
|
193
|
+
const a = E.current.offsetHeight, o = G.current.offsetHeight, i = ((n = pe.current) == null ? void 0 : n.offsetHeight) ?? 0, v = (a - o - i) / A.length;
|
|
194
|
+
fe(v < 20 ? 20 : v);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return e(), window.addEventListener("resize", e), () => {
|
|
198
|
+
window.removeEventListener("resize", e);
|
|
199
|
+
};
|
|
200
|
+
}, [E, b]), j(() => {
|
|
201
|
+
const e = O.current;
|
|
202
|
+
if (!e) return;
|
|
203
|
+
const n = () => {
|
|
204
|
+
re.current = e.offsetWidth;
|
|
205
|
+
};
|
|
206
|
+
n();
|
|
207
|
+
const a = (t, r) => {
|
|
208
|
+
C.current || (L.current && (e.removeEventListener("transitionend", L.current), L.current = null), ee.current = t, te.current = r, V.current = !1, z.current = !0, W.current = 0);
|
|
209
|
+
}, o = (t, r, l) => {
|
|
210
|
+
if (!z.current) return;
|
|
211
|
+
const c = t - ee.current, f = r - te.current;
|
|
212
|
+
if (W.current = c, !V.current && (ne.current = Math.abs(c), oe.current = Math.abs(f), V.current = !0, oe.current > ne.current)) {
|
|
213
|
+
z.current = !1;
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
l.cancelable && l.preventDefault(), e.style.transition = "none", e.style.transform = `translate3d(${W.current}px, 0, 0)`, e.style.cursor = "grabbing";
|
|
217
|
+
}, i = () => {
|
|
218
|
+
if (e.style.cursor = "grab", !z.current) return;
|
|
219
|
+
z.current = !1, I.current = !1, C.current = !0;
|
|
220
|
+
const t = W.current, r = re.current, l = r * 0.2;
|
|
221
|
+
e.style.transition = "transform 300ms cubic-bezier(0.25, 1, 0.5, 1)", t > l ? (e.style.transform = `translate3d(${r}px, 0, 0)`, L.current = (c) => {
|
|
222
|
+
c.propertyName === "transform" && (P.current = requestAnimationFrame(() => {
|
|
223
|
+
x((f) => f.add(-1, "week")), U.current = requestAnimationFrame(() => {
|
|
224
|
+
e.style.transition = "none", e.style.transform = "translate3d(0, 0, 0)", I.current = !0, C.current = !1;
|
|
225
|
+
});
|
|
226
|
+
}));
|
|
227
|
+
}, e.addEventListener("transitionend", L.current)) : t < -l ? (e.style.transform = `translate3d(-${r}px, 0, 0)`, L.current = (c) => {
|
|
228
|
+
c.propertyName === "transform" && (P.current = requestAnimationFrame(() => {
|
|
229
|
+
x((f) => f.add(1, "week")), U.current = requestAnimationFrame(() => {
|
|
230
|
+
e.style.transition = "none", e.style.transform = "translate3d(0, 0, 0)", I.current = !0, C.current = !1;
|
|
231
|
+
});
|
|
232
|
+
}));
|
|
233
|
+
}, e.addEventListener("transitionend", L.current)) : (C.current = !1, I.current = !0, e.style.transform = "translate3d(0, 0, 0)");
|
|
234
|
+
}, v = (t) => a(t.touches[0].clientX, t.touches[0].clientY), S = (t) => o(t.touches[0].clientX, t.touches[0].clientY, t), d = (t) => a(t.clientX, t.clientY), s = (t) => o(t.clientX, t.clientY, t);
|
|
235
|
+
return window.addEventListener("resize", n), e.addEventListener("touchstart", v), e.addEventListener("touchmove", S), e.addEventListener("touchend", i), e.addEventListener("touchcancel", i), e.addEventListener("mousedown", d), e.addEventListener("mousemove", s), e.addEventListener("mouseup", i), e.addEventListener("mouseleave", i), () => {
|
|
236
|
+
window.removeEventListener("resize", n), e.removeEventListener("touchstart", v), e.removeEventListener("touchmove", S), e.removeEventListener("touchend", i), e.removeEventListener("touchcancel", i), e.removeEventListener("mousedown", d), e.removeEventListener("mousemove", s), e.removeEventListener("mouseup", i), e.removeEventListener("mouseleave", i), L.current && e.removeEventListener("transitionend", L.current);
|
|
237
|
+
};
|
|
238
|
+
}, []), j(() => {
|
|
239
|
+
const e = p.current, n = (a) => {
|
|
240
|
+
C.current && !I.current && a.stopPropagation();
|
|
241
|
+
};
|
|
242
|
+
return e == null || e.addEventListener("click", n), () => {
|
|
243
|
+
e == null || e.removeEventListener("click", n);
|
|
244
|
+
};
|
|
245
|
+
}, []), j(() => {
|
|
246
|
+
R == null || R(F);
|
|
247
|
+
}, [F, R]), j(() => () => {
|
|
248
|
+
P.current && cancelAnimationFrame(P.current), U.current && cancelAnimationFrame(U.current), k.current && cancelAnimationFrame(k.current);
|
|
249
|
+
}, []), /* @__PURE__ */ D(h, { tag: "section", flex: 1, flexDirection: "column", "aria-label": "일정 안내", ...K, children: [
|
|
250
|
+
b && (b == null ? void 0 : b.length) > 0 && /* @__PURE__ */ m(
|
|
251
|
+
h,
|
|
252
|
+
{
|
|
253
|
+
justifyContent: "flex-end",
|
|
254
|
+
alignItems: "center",
|
|
255
|
+
gap: 3,
|
|
256
|
+
pl: 4,
|
|
257
|
+
pr: 4,
|
|
258
|
+
role: "group",
|
|
259
|
+
"aria-label": "일정 종류 안내",
|
|
260
|
+
children: b == null ? void 0 : b.map(({ text: e, color: n }) => /* @__PURE__ */ D(h, { alignItems: "center", gap: 1, children: [
|
|
261
|
+
/* @__PURE__ */ m(
|
|
262
|
+
ue,
|
|
263
|
+
{
|
|
264
|
+
"aria-hidden": !0,
|
|
265
|
+
inlineCSS: {
|
|
266
|
+
width: 14,
|
|
267
|
+
height: 14,
|
|
268
|
+
border: `1px solid ${y[30]}`,
|
|
269
|
+
borderRadius: 4,
|
|
270
|
+
backgroundColor: n
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ m(B, { variant: "c3R", color: "grey.70", children: e })
|
|
275
|
+
] }, `legend-${e}-${n}`))
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ D(
|
|
279
|
+
h,
|
|
280
|
+
{
|
|
281
|
+
ref: G,
|
|
282
|
+
alignItems: "center",
|
|
283
|
+
pt: 1,
|
|
284
|
+
pb: 2,
|
|
285
|
+
role: "row",
|
|
286
|
+
inlineCSS: {
|
|
287
|
+
position: "sticky",
|
|
288
|
+
top: 0,
|
|
289
|
+
zIndex: 2,
|
|
290
|
+
borderBottom: `1px solid ${y[20]}`,
|
|
291
|
+
backgroundColor: y.white
|
|
292
|
+
},
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ D(
|
|
295
|
+
B,
|
|
296
|
+
{
|
|
297
|
+
variant: "h4B",
|
|
298
|
+
textAlign: "center",
|
|
299
|
+
inlineCSS: {
|
|
300
|
+
width: 48
|
|
301
|
+
},
|
|
302
|
+
children: [
|
|
303
|
+
F.month() + 1,
|
|
304
|
+
"월"
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ m(h, { alignItems: "center", flexGrow: 1, children: ae[1].days.map((e) => /* @__PURE__ */ D(
|
|
309
|
+
h,
|
|
310
|
+
{
|
|
311
|
+
flexDirection: "column",
|
|
312
|
+
alignItems: "center",
|
|
313
|
+
flex: 1,
|
|
314
|
+
role: "columnheader",
|
|
315
|
+
"aria-label": `${e.format("dddd")} (${e.format("D")}일)`,
|
|
316
|
+
children: [
|
|
317
|
+
/* @__PURE__ */ m(B, { variant: "c3R", color: e.day() === 0 ? "pink.90" : void 0, children: e.format("ddd") }),
|
|
318
|
+
/* @__PURE__ */ m(B, { variant: "c3M", color: e.day() === 0 ? "pink.100" : void 0, children: e.format("D") })
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
e.day()
|
|
322
|
+
)) })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ D(h, { flex: 1, children: [
|
|
327
|
+
/* @__PURE__ */ D(
|
|
328
|
+
h,
|
|
329
|
+
{
|
|
330
|
+
flexDirection: "column",
|
|
331
|
+
inlineCSS: {
|
|
332
|
+
position: "sticky",
|
|
333
|
+
left: 0,
|
|
334
|
+
maxHeight: "fit-content",
|
|
335
|
+
backgroundColor: y.white,
|
|
336
|
+
zIndex: 1
|
|
337
|
+
},
|
|
338
|
+
children: [
|
|
339
|
+
A.map(({ time: e, label: n, isCurrentTime: a }) => /* @__PURE__ */ m(
|
|
340
|
+
h,
|
|
341
|
+
{
|
|
342
|
+
justifyContent: "center",
|
|
343
|
+
alignItems: "flex-start",
|
|
344
|
+
role: "rowheader",
|
|
345
|
+
"aria-label": n,
|
|
346
|
+
"aria-current": a ? "time" : void 0,
|
|
347
|
+
style: {
|
|
348
|
+
width: 48,
|
|
349
|
+
minHeight: H,
|
|
350
|
+
zIndex: 1
|
|
351
|
+
},
|
|
352
|
+
children: /* @__PURE__ */ m(
|
|
353
|
+
B,
|
|
354
|
+
{
|
|
355
|
+
variant: "c3M",
|
|
356
|
+
color: "grey.70",
|
|
357
|
+
style: {
|
|
358
|
+
visibility: e.split(":")[1] === "30" ? "hidden" : "visible"
|
|
359
|
+
},
|
|
360
|
+
children: e
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
},
|
|
364
|
+
e
|
|
365
|
+
)),
|
|
366
|
+
/* @__PURE__ */ m(
|
|
367
|
+
h,
|
|
368
|
+
{
|
|
369
|
+
"aria-hidden": !0,
|
|
370
|
+
inlineCSS: {
|
|
371
|
+
position: "absolute",
|
|
372
|
+
top: 0,
|
|
373
|
+
right: -8,
|
|
374
|
+
width: 8,
|
|
375
|
+
height: "100%",
|
|
376
|
+
background: "linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.00) 104.17%)",
|
|
377
|
+
zIndex: 1
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ m(
|
|
385
|
+
h,
|
|
386
|
+
{
|
|
387
|
+
flex: 1,
|
|
388
|
+
ref: p,
|
|
389
|
+
role: "grid",
|
|
390
|
+
"aria-label": "주간 일정",
|
|
391
|
+
inlineCSS: { position: "relative", overflow: "hidden", cursor: "grab" },
|
|
392
|
+
children: /* @__PURE__ */ m(
|
|
393
|
+
h,
|
|
394
|
+
{
|
|
395
|
+
ref: O,
|
|
396
|
+
alignItems: "flex-start",
|
|
397
|
+
justifyContent: "center",
|
|
398
|
+
flex: 1,
|
|
399
|
+
inlineCSS: {
|
|
400
|
+
transform: "translate3d(0, 0, 0)"
|
|
401
|
+
},
|
|
402
|
+
children: ae.map(({ days: e, scheduleEvents: n }, a) => /* @__PURE__ */ m(
|
|
403
|
+
h,
|
|
404
|
+
{
|
|
405
|
+
role: "rowgroup",
|
|
406
|
+
"aria-hidden": a !== 1,
|
|
407
|
+
style: {
|
|
408
|
+
display: "grid",
|
|
409
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
410
|
+
minWidth: "100%"
|
|
411
|
+
},
|
|
412
|
+
children: e.map((o, i) => {
|
|
413
|
+
const v = Se(n, o), S = Ee(
|
|
414
|
+
v,
|
|
415
|
+
o
|
|
416
|
+
);
|
|
417
|
+
return /* @__PURE__ */ m(
|
|
418
|
+
h,
|
|
419
|
+
{
|
|
420
|
+
role: "row",
|
|
421
|
+
"aria-label": `${o.format("dddd")} ${o.format("D")}일`,
|
|
422
|
+
style: {
|
|
423
|
+
borderLeft: `1px solid ${y[20]}`
|
|
424
|
+
},
|
|
425
|
+
children: /* @__PURE__ */ D(
|
|
426
|
+
h,
|
|
427
|
+
{
|
|
428
|
+
style: {
|
|
429
|
+
display: "grid",
|
|
430
|
+
position: "relative",
|
|
431
|
+
flex: 1
|
|
432
|
+
},
|
|
433
|
+
children: [
|
|
434
|
+
A.map(({ time: d, label: s, isCurrentTime: t }, r) => {
|
|
435
|
+
const l = a === 1 && r === T && i === Y;
|
|
436
|
+
if (typeof M == "function") {
|
|
437
|
+
const c = M(
|
|
438
|
+
o.format("YYYY-MM-DD"),
|
|
439
|
+
d
|
|
440
|
+
);
|
|
441
|
+
return le(c, {
|
|
442
|
+
key: `schedule-block-${o}-${r}-${i}-${d}`,
|
|
443
|
+
onKeyDown: ie,
|
|
444
|
+
onFocus: se(o, s),
|
|
445
|
+
role: "gridcell",
|
|
446
|
+
"data-row": r,
|
|
447
|
+
"data-col": i,
|
|
448
|
+
"data-week": a,
|
|
449
|
+
"data-time": d,
|
|
450
|
+
"aria-current": t ? "time" : void 0,
|
|
451
|
+
tabIndex: l ? 0 : -1,
|
|
452
|
+
"aria-label": `${o.format("dddd")} ${o.format("D")}일 ${s}`,
|
|
453
|
+
...c.props,
|
|
454
|
+
style: {
|
|
455
|
+
...c.props.style,
|
|
456
|
+
borderTop: r > 0 ? `1px solid ${y[20]}` : void 0,
|
|
457
|
+
minHeight: H,
|
|
458
|
+
zIndex: 0
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
return /* @__PURE__ */ m(
|
|
463
|
+
ue,
|
|
464
|
+
{
|
|
465
|
+
onKeyDown: ie,
|
|
466
|
+
onFocus: se(o, s),
|
|
467
|
+
role: "gridcell",
|
|
468
|
+
"data-row": r,
|
|
469
|
+
"data-col": i,
|
|
470
|
+
"data-week": a,
|
|
471
|
+
"data-time": d,
|
|
472
|
+
"aria-current": t ? "time" : void 0,
|
|
473
|
+
tabIndex: l ? 0 : -1,
|
|
474
|
+
"aria-label": `${o.format("dddd")} ${o.format("D")}일 ${s}`,
|
|
475
|
+
style: {
|
|
476
|
+
borderTop: r > 0 ? `1px solid ${y[20]}` : void 0,
|
|
477
|
+
minHeight: H,
|
|
478
|
+
zIndex: 0
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
`schedule-block-${o}-${r}-${i}-${d}`
|
|
482
|
+
);
|
|
483
|
+
}),
|
|
484
|
+
S.map(
|
|
485
|
+
({ children: d, startDate: s, endDate: t, totalColumns: r, columnIndex: l }) => {
|
|
486
|
+
const c = de(s), f = de(t), q = (c - 7 * 60) / 30 * H, we = (f - c) / 30 * H, ce = 100 / r, ge = l * ce, J = d;
|
|
487
|
+
return /* @__PURE__ */ m(
|
|
488
|
+
h,
|
|
489
|
+
{
|
|
490
|
+
style: {
|
|
491
|
+
position: "absolute",
|
|
492
|
+
top: `${q + 1}px`,
|
|
493
|
+
left: `${ge}%`,
|
|
494
|
+
width: `${ce}%`,
|
|
495
|
+
height: `${we - 1}px`,
|
|
496
|
+
zIndex: 1
|
|
497
|
+
},
|
|
498
|
+
children: le(J, {
|
|
499
|
+
role: "button",
|
|
500
|
+
tabIndex: a === 1 ? 0 : -1,
|
|
501
|
+
onKeyDown: ve(J.props.onKeyDown),
|
|
502
|
+
"data-start-date": s,
|
|
503
|
+
"data-start-time": w(s).format("HH:mm"),
|
|
504
|
+
"data-end-date": t,
|
|
505
|
+
"data-end-time": w(t).format("HH:mm"),
|
|
506
|
+
"data-is-event": !0,
|
|
507
|
+
"aria-label": `${w(s).format("dddd")} ${w(s).format("D")}일 ${w(s).format("A h시")}부터 ${w(t).format("dddd")} ${w(t).format("D")}일 ${w(t).format("A h시")}까지의 일정`,
|
|
508
|
+
...J.props
|
|
509
|
+
})
|
|
510
|
+
},
|
|
511
|
+
`${s}-${t}-${l}-${r}`
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
)
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
)
|
|
518
|
+
},
|
|
519
|
+
o.toISOString()
|
|
520
|
+
);
|
|
521
|
+
})
|
|
522
|
+
},
|
|
523
|
+
e[0].format("YYYY-MM-DD")
|
|
524
|
+
))
|
|
525
|
+
}
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
)
|
|
529
|
+
] }),
|
|
530
|
+
/* @__PURE__ */ m(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
role: "status",
|
|
534
|
+
style: {
|
|
535
|
+
position: "absolute",
|
|
536
|
+
width: 1,
|
|
537
|
+
height: 1,
|
|
538
|
+
margin: -1,
|
|
539
|
+
border: 0,
|
|
540
|
+
padding: 0,
|
|
541
|
+
overflow: "hidden",
|
|
542
|
+
clip: "rect(0 0 0 0)",
|
|
543
|
+
clipPath: "inset(50%)"
|
|
544
|
+
},
|
|
545
|
+
children: me
|
|
546
|
+
}
|
|
547
|
+
)
|
|
548
|
+
] });
|
|
549
|
+
}
|
|
550
|
+
export {
|
|
551
|
+
Ce as default
|
|
552
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { ScheduleEventProps } from './ScheduleEvent/ScheduleEvent';
|
|
3
|
+
export interface ScheduleEventWithRange extends ScheduleEventProps {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PositionedScheduleEvent extends ScheduleEventWithRange {
|
|
8
|
+
columnIndex: number;
|
|
9
|
+
totalColumns: number;
|
|
10
|
+
}
|
|
11
|
+
export interface InternalScheduleEvent extends ScheduleEventWithRange {
|
|
12
|
+
_start: number;
|
|
13
|
+
_end: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function generateWeek(weekStartDate: Dayjs, scheduleEvents?: ScheduleEventProps[]): {
|
|
16
|
+
days: Dayjs[];
|
|
17
|
+
scheduleEvents: ScheduleEventWithRange[];
|
|
18
|
+
};
|
|
19
|
+
export declare function getDayScheduleEvents(scheduleEvents: ScheduleEventWithRange[], date: Dayjs): ScheduleEventWithRange[];
|
|
20
|
+
export declare function resolvePositionedScheduleEventsForDate(scheduleEvents: ScheduleEventWithRange[], date: Dayjs): PositionedScheduleEvent[];
|
|
21
|
+
export declare function assignColumnsToGroup(group: InternalScheduleEvent[]): PositionedScheduleEvent[];
|
|
22
|
+
export declare function getMinutesFromMidnight(date: string): number;
|
|
23
|
+
export declare function getAvailableDateRange(startDate: string | Date | Dayjs, endDate: string | Date | Dayjs, schedules: {
|
|
24
|
+
startTime: number;
|
|
25
|
+
endTime: number;
|
|
26
|
+
weekDay: string | number;
|
|
27
|
+
oneDayDate: string | null;
|
|
28
|
+
}[]): {
|
|
29
|
+
id: string;
|
|
30
|
+
startDate: string;
|
|
31
|
+
endDate: string;
|
|
32
|
+
}[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import s from "dayjs";
|
|
2
|
+
import g from "../../utils/getDateRange/getDateRange.mjs";
|
|
3
|
+
import v from "../../utils/getTimeRange/getTimeRange.mjs";
|
|
4
|
+
function S(a, n = []) {
|
|
5
|
+
const r = Array.from({ length: 7 }, (e, u) => a.add(u, "day")), o = a, i = a.add(6, "day").endOf("day"), d = n.map((e) => {
|
|
6
|
+
const u = s(e.startDate), t = s(e.endDate).endOf("day"), l = u.isBefore(o) ? o : u, h = t.isAfter(i) ? i : t, c = l.diff(o, "day"), p = h.diff(l, "day") + 1;
|
|
7
|
+
return {
|
|
8
|
+
...e,
|
|
9
|
+
start: c,
|
|
10
|
+
end: c + p - 1
|
|
11
|
+
};
|
|
12
|
+
}).filter((e) => e.start <= 6 && e.end >= 0);
|
|
13
|
+
return { days: r.map((e) => e), scheduleEvents: d };
|
|
14
|
+
}
|
|
15
|
+
function M(a, n) {
|
|
16
|
+
return a.filter(
|
|
17
|
+
(r) => s(r.startDate).isBefore(n.endOf("day")) && s(r.endDate).isAfter(n.startOf("day"))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function _(a, n) {
|
|
21
|
+
const r = n.startOf("day"), o = n.endOf("day"), d = [...a.filter(
|
|
22
|
+
(t) => s(t.startDate).isBefore(o) && s(t.endDate).isAfter(r)
|
|
23
|
+
).map((t) => ({
|
|
24
|
+
...t,
|
|
25
|
+
_start: Math.max(
|
|
26
|
+
s(t.startDate).minute() + s(t.startDate).hour() * 60,
|
|
27
|
+
r.minute() + r.hour() * 60
|
|
28
|
+
),
|
|
29
|
+
_end: Math.min(
|
|
30
|
+
s(t.endDate).minute() + s(t.endDate).hour() * 60,
|
|
31
|
+
o.minute() + o.hour() * 60
|
|
32
|
+
)
|
|
33
|
+
}))].sort((t, l) => t._start - l._start), f = [];
|
|
34
|
+
let e = [], u = -1;
|
|
35
|
+
for (const t of d)
|
|
36
|
+
e.length === 0 || t._start < u ? (e.push(t), u = Math.max(u, t._end)) : (f.push(...m(e)), e = [t], u = t._end);
|
|
37
|
+
return e.length > 0 && f.push(...m(e)), f;
|
|
38
|
+
}
|
|
39
|
+
function m(a) {
|
|
40
|
+
const n = [], r = [];
|
|
41
|
+
for (const i of a) {
|
|
42
|
+
let d = !1;
|
|
43
|
+
for (let f = 0; f < n.length; f++) {
|
|
44
|
+
const e = n[f];
|
|
45
|
+
if (!e.some(
|
|
46
|
+
(t) => !(t._end <= t._start || t._end <= t._start)
|
|
47
|
+
)) {
|
|
48
|
+
e.push(i), r.push({
|
|
49
|
+
...i,
|
|
50
|
+
columnIndex: f,
|
|
51
|
+
totalColumns: 0
|
|
52
|
+
}), d = !0;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
d || (n.push([i]), r.push({
|
|
57
|
+
...i,
|
|
58
|
+
columnIndex: n.length - 1,
|
|
59
|
+
totalColumns: 0
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
const o = n.length;
|
|
63
|
+
return r.forEach((i) => i.totalColumns = o), r;
|
|
64
|
+
}
|
|
65
|
+
function Y(a) {
|
|
66
|
+
const n = s(a);
|
|
67
|
+
return n.hour() * 60 + n.minute();
|
|
68
|
+
}
|
|
69
|
+
function C(a, n, r) {
|
|
70
|
+
return g(a, n).flatMap(({ value: o }, i) => {
|
|
71
|
+
const f = r.filter(({ weekDay: t }) => String(t) === o.getDay().toString()).filter(({ oneDayDate: t }) => t ? s(t).isSame(o, "date") : !0).flatMap(
|
|
72
|
+
({ startTime: t, endTime: l }) => v(Number(t), Number(l), {
|
|
73
|
+
pairs: !0
|
|
74
|
+
})
|
|
75
|
+
), e = 2, u = [];
|
|
76
|
+
for (let t = 0; t < f.length; t += e)
|
|
77
|
+
u.push(f.slice(t, t + e));
|
|
78
|
+
return u.map(([{ value: t }, { value: l }]) => ({
|
|
79
|
+
id: `${i}-${t}-${l}`,
|
|
80
|
+
startDate: s(o).hour(Math.floor(t)).minute(t % 1 * 60).format("YYYY-MM-DD HH:mm"),
|
|
81
|
+
endDate: s(o).hour(Math.floor(l)).minute(l % 1 * 60).format("YYYY-MM-DD HH:mm")
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
m as assignColumnsToGroup,
|
|
87
|
+
S as generateWeek,
|
|
88
|
+
C as getAvailableDateRange,
|
|
89
|
+
M as getDayScheduleEvents,
|
|
90
|
+
Y as getMinutesFromMidnight,
|
|
91
|
+
_ as resolvePositionedScheduleEventsForDate
|
|
92
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as Scheduler, SchedulerProps } from './Scheduler';
|
|
2
|
+
export { default as ScheduleEvent, type ScheduleEventProps } from './ScheduleEvent';
|
|
3
|
+
export { default as ScheduleBlock, type ScheduleBlockProps } from './ScheduleBlock';
|
|
4
|
+
export { getAvailableDateRange } from './Scheduler.utils';
|
|
5
|
+
export type { SchedulerProps };
|
|
6
|
+
export default Scheduler;
|