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