@dotss/tictoccroc 0.0.22 → 0.0.24

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