@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,10 @@
|
|
|
1
|
+
import t from "./Scheduler.mjs";
|
|
2
|
+
import { default as r } from "./ScheduleEvent/ScheduleEvent.mjs";
|
|
3
|
+
import { default as f } from "./ScheduleBlock/ScheduleBlock.mjs";
|
|
4
|
+
import { getAvailableDateRange as u } from "./Scheduler.utils.mjs";
|
|
5
|
+
export {
|
|
6
|
+
f as ScheduleBlock,
|
|
7
|
+
r as ScheduleEvent,
|
|
8
|
+
t as default,
|
|
9
|
+
u as getAvailableDateRange
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FlexboxProps } from 'node_modules/@thedotscorp/ui/Flexbox/Flexbox';
|
|
3
|
+
export interface SwiperPaginationProps {
|
|
4
|
+
page: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SwipeEvent {
|
|
9
|
+
isFirstPage: boolean;
|
|
10
|
+
isLastPage: boolean;
|
|
11
|
+
prevPage: number;
|
|
12
|
+
currentPage: number;
|
|
13
|
+
nextPage: number;
|
|
14
|
+
lastPage: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SwiperProps extends FlexboxProps {
|
|
17
|
+
initialPage?: number;
|
|
18
|
+
onSwipe?: (e: SwipeEvent) => void;
|
|
19
|
+
onSwiping?: (e: SwipeEvent) => void;
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
disableSwipe?: boolean;
|
|
22
|
+
renderPagination?: (props: SwiperPaginationProps) => ReactNode;
|
|
23
|
+
}
|
|
24
|
+
declare function Swiper({ children, initialPage, onSwipe, onSwiping, loop, disableSwipe, renderPagination, inlineCSS, ...props }: SwiperProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default Swiper;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { jsxs as _, jsx as ar } from "react/jsx-runtime";
|
|
2
|
+
import { useState as K, useRef as f, Children as P, isValidElement as z, useEffect as k, cloneElement as G } from "react";
|
|
3
|
+
import { Flexbox as I } from "@thedotscorp/ui";
|
|
4
|
+
import { createSwipeEvent as b } from "./Swiper.utils.mjs";
|
|
5
|
+
import U from "./SwiperBlock/SwiperBlock.mjs";
|
|
6
|
+
function hr({
|
|
7
|
+
children: q,
|
|
8
|
+
initialPage: R = 0,
|
|
9
|
+
onSwipe: u,
|
|
10
|
+
onSwiping: x,
|
|
11
|
+
loop: g = !1,
|
|
12
|
+
disableSwipe: O = !1,
|
|
13
|
+
renderPagination: B,
|
|
14
|
+
inlineCSS: S,
|
|
15
|
+
...w
|
|
16
|
+
}) {
|
|
17
|
+
const [L, C] = K(R), [c, rr] = K(0), t = f(null), X = f(0), W = f(0), H = f(0), Y = f(0), o = f(!1), d = f(!0), N = f(""), n = f(R), J = f(!1), i = f(null), E = P.count(q), h = P.toArray(q).filter(z).filter((r) => r.type === U), $ = E > 1 && !O, tr = P.toArray(h == null ? void 0 : h[0]).filter(z).filter((r) => r.type === U), er = P.toArray(h == null ? void 0 : h[(h == null ? void 0 : h.length) - 1]).filter(z).filter((r) => r.type === U), Q = (r, e, l) => {
|
|
18
|
+
!t.current || !$ || (N.current = t.current.style.transform, W.current = r, X.current = r + t.current.offsetWidth * (l + 1), H.current = e);
|
|
19
|
+
}, M = (r, e, l) => {
|
|
20
|
+
if (!t.current || !$ || !o.current || !d.current)
|
|
21
|
+
return;
|
|
22
|
+
d.current = !1, t.current.style.transition = "transform 0.2s", t.current.style.cursor = "grab", i.current && (t.current.removeEventListener("transitionend", i.current), i.current = null);
|
|
23
|
+
const a = e || L, s = l || X.current - t.current.offsetWidth * (a + 1) - r, y = t.current.offsetWidth * 0.1;
|
|
24
|
+
if (Math.abs(s) < y && !e) {
|
|
25
|
+
t.current.style.transform = N.current, o.current = !1, d.current = !0, u == null || u(
|
|
26
|
+
b({
|
|
27
|
+
realPage: n.current,
|
|
28
|
+
totalPages: c,
|
|
29
|
+
lastPage: n.current,
|
|
30
|
+
isLoop: !1
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const D = s <= -y && a - 1 < 0, A = s >= y && a + 1 === c, F = s >= y && a + 1 < c, j = s <= -y && a - 1 >= 0;
|
|
36
|
+
if (D) {
|
|
37
|
+
n.current = c - 1, u == null || u(
|
|
38
|
+
b({ realPage: n.current, totalPages: c, lastPage: 0, isLoop: !0 })
|
|
39
|
+
), t.current.style.transform = "translate3d(0, 0, 0)", i.current = (T) => {
|
|
40
|
+
var m, v, p;
|
|
41
|
+
if (T.propertyName === "transform") {
|
|
42
|
+
if (!t.current) return;
|
|
43
|
+
t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${c}), 0, 0)`, C(c - 1), o.current = !1, d.current = !0, (p = (v = (m = t.current) == null ? void 0 : m.children) == null ? void 0 : v[c]) == null || p.focus();
|
|
44
|
+
}
|
|
45
|
+
}, t.current.addEventListener("transitionend", i.current);
|
|
46
|
+
return;
|
|
47
|
+
} else if (A) {
|
|
48
|
+
n.current = 0, u == null || u(
|
|
49
|
+
b({
|
|
50
|
+
realPage: n.current,
|
|
51
|
+
totalPages: c,
|
|
52
|
+
lastPage: c - 1,
|
|
53
|
+
isLoop: !0
|
|
54
|
+
})
|
|
55
|
+
), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`, i.current = (T) => {
|
|
56
|
+
var m, v, p;
|
|
57
|
+
if (T.propertyName === "transform") {
|
|
58
|
+
if (!t.current) return;
|
|
59
|
+
t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", C(0), o.current = !1, d.current = !0, (p = (v = (m = t.current) == null ? void 0 : m.children) == null ? void 0 : v[1]) == null || p.focus();
|
|
60
|
+
}
|
|
61
|
+
}, t.current.addEventListener("transitionend", i.current);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
F ? (n.current = a + 1, u == null || u(
|
|
65
|
+
b({
|
|
66
|
+
realPage: n.current,
|
|
67
|
+
totalPages: c,
|
|
68
|
+
lastPage: a,
|
|
69
|
+
isLoop: !0
|
|
70
|
+
})
|
|
71
|
+
), C(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`) : j ? (n.current = a - 1, u == null || u(
|
|
72
|
+
b({
|
|
73
|
+
realPage: n.current,
|
|
74
|
+
totalPages: c,
|
|
75
|
+
lastPage: a,
|
|
76
|
+
isLoop: !1
|
|
77
|
+
})
|
|
78
|
+
), C(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a}), 0, 0)`) : (u == null || u(
|
|
79
|
+
b({
|
|
80
|
+
realPage: n.current,
|
|
81
|
+
totalPages: c,
|
|
82
|
+
lastPage: n.current,
|
|
83
|
+
isLoop: !1
|
|
84
|
+
})
|
|
85
|
+
), t.current.style.transform = N.current), i.current = (T) => {
|
|
86
|
+
var m;
|
|
87
|
+
if (T.propertyName === "transform") {
|
|
88
|
+
o.current = !1, d.current = !0;
|
|
89
|
+
const v = Array.from(((m = t.current) == null ? void 0 : m.children) ?? []).find(
|
|
90
|
+
(p) => p.getAttribute("aria-current") === "page"
|
|
91
|
+
);
|
|
92
|
+
v && v.focus();
|
|
93
|
+
}
|
|
94
|
+
}, t.current.addEventListener("transitionend", i.current);
|
|
95
|
+
}, nr = (r) => {
|
|
96
|
+
o.current = !0, Q(r.clientX, r.clientY, n.current);
|
|
97
|
+
}, V = (r) => M(r.clientX), cr = (r) => {
|
|
98
|
+
Q(r.touches[0].clientX, r.touches[0].clientY, n.current);
|
|
99
|
+
}, Z = (r) => M(r.changedTouches[0].clientX), sr = (r) => {
|
|
100
|
+
o.current = !0;
|
|
101
|
+
const e = r - 1;
|
|
102
|
+
C(e <= 0 ? 0 : e), M(0, r);
|
|
103
|
+
}, ur = (r) => (e) => {
|
|
104
|
+
var l, a;
|
|
105
|
+
switch (e.key) {
|
|
106
|
+
case "ArrowRight": {
|
|
107
|
+
if (e.preventDefault(), o.current || !d.current) return;
|
|
108
|
+
const s = n.current === c - 1;
|
|
109
|
+
if (!g && s)
|
|
110
|
+
return;
|
|
111
|
+
o.current = !0, M(0, n.current, (((l = t.current) == null ? void 0 : l.offsetWidth) ?? 0) * 0.1);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case "ArrowLeft": {
|
|
115
|
+
if (e.preventDefault(), o.current || !d.current) return;
|
|
116
|
+
const s = n.current === 0;
|
|
117
|
+
if (!g && s)
|
|
118
|
+
return;
|
|
119
|
+
o.current = !0, M(0, n.current, -((((a = t.current) == null ? void 0 : a.offsetWidth) ?? 0) * 0.1));
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case "Enter": {
|
|
123
|
+
e.preventDefault(), e.currentTarget.click();
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case " ": {
|
|
127
|
+
e.preventDefault(), e.currentTarget.click();
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
r == null || r(e);
|
|
132
|
+
};
|
|
133
|
+
return k(() => {
|
|
134
|
+
const r = t.current, e = (s, y, D) => {
|
|
135
|
+
if (!t.current || !$ || !d.current) return;
|
|
136
|
+
Y.current = s - X.current;
|
|
137
|
+
const A = 5;
|
|
138
|
+
if (o.current = o.current || Math.abs(Y.current) > A && Math.abs(y - H.current) < A, o.current) {
|
|
139
|
+
const F = W.current < s, j = W.current > s;
|
|
140
|
+
if (!g && F && n.current === 0) {
|
|
141
|
+
o.current = !1;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!g && j && n.current === c - 1) {
|
|
145
|
+
o.current = !1;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
D.cancelable && D.preventDefault(), x == null || x(
|
|
149
|
+
b({
|
|
150
|
+
realPage: n.current,
|
|
151
|
+
totalPages: c,
|
|
152
|
+
lastPage: n.current,
|
|
153
|
+
isLoop: !1
|
|
154
|
+
})
|
|
155
|
+
), t.current.style.transition = "none", t.current.style.cursor = "grabbing", t.current.style.transform = `translate3d(${Y.current}px, 0, 0)`;
|
|
156
|
+
}
|
|
157
|
+
}, l = (s) => {
|
|
158
|
+
o.current && e(s.clientX, s.clientY, s);
|
|
159
|
+
}, a = (s) => e(s.touches[0].clientX, s.touches[0].clientY, s);
|
|
160
|
+
return r && (r.addEventListener("mousemove", l), r.addEventListener("touchmove", a)), () => {
|
|
161
|
+
r && (r.removeEventListener("mousemove", l), r.removeEventListener("touchmove", a));
|
|
162
|
+
};
|
|
163
|
+
}, [$, x, g, c]), k(() => {
|
|
164
|
+
const r = t.current, e = (l) => {
|
|
165
|
+
d.current || l.stopPropagation();
|
|
166
|
+
};
|
|
167
|
+
return r == null || r.addEventListener("click", e), () => {
|
|
168
|
+
r == null || r.removeEventListener("click", e);
|
|
169
|
+
};
|
|
170
|
+
}, []), k(() => {
|
|
171
|
+
const r = t.current;
|
|
172
|
+
return () => {
|
|
173
|
+
i.current && r && (r.removeEventListener("transitionend", i.current), i.current = null);
|
|
174
|
+
};
|
|
175
|
+
}, []), k(() => {
|
|
176
|
+
rr(E);
|
|
177
|
+
}, [E]), k(() => {
|
|
178
|
+
t.current && !J.current && (J.current = !0, t.current.style.transform = `translate3d(calc(-100% * ${E < R + 1 ? E : R + 1}), 0, 0)`);
|
|
179
|
+
}, [R, E]), /* @__PURE__ */ _(
|
|
180
|
+
I,
|
|
181
|
+
{
|
|
182
|
+
flexGrow: 1,
|
|
183
|
+
role: "group",
|
|
184
|
+
"aria-roledescription": "carousel",
|
|
185
|
+
"aria-label": "슬라이더",
|
|
186
|
+
...w,
|
|
187
|
+
inlineCSS: {
|
|
188
|
+
width: "100%",
|
|
189
|
+
position: "relative",
|
|
190
|
+
...S
|
|
191
|
+
},
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ _(
|
|
194
|
+
I,
|
|
195
|
+
{
|
|
196
|
+
ref: t,
|
|
197
|
+
flexGrow: 1,
|
|
198
|
+
onMouseDown: nr,
|
|
199
|
+
onMouseUp: V,
|
|
200
|
+
onMouseLeave: V,
|
|
201
|
+
onTouchStart: cr,
|
|
202
|
+
onTouchEnd: Z,
|
|
203
|
+
onTouchCancel: Z,
|
|
204
|
+
inlineCSS: {
|
|
205
|
+
"& > div:first-of-type": {
|
|
206
|
+
visibility: g ? "visible" : "hidden"
|
|
207
|
+
},
|
|
208
|
+
"& > div:last-of-type": {
|
|
209
|
+
visibility: g ? "visible" : "hidden"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
style: {
|
|
213
|
+
transition: "transform 0.2s",
|
|
214
|
+
transform: "translate3d(-100%, 0, 0)",
|
|
215
|
+
cursor: "grab"
|
|
216
|
+
},
|
|
217
|
+
children: [
|
|
218
|
+
P.map(
|
|
219
|
+
er,
|
|
220
|
+
(r) => G(r, {
|
|
221
|
+
"aria-hidden": !0
|
|
222
|
+
})
|
|
223
|
+
),
|
|
224
|
+
h.map(
|
|
225
|
+
(r, e) => G(r, {
|
|
226
|
+
role: "group",
|
|
227
|
+
tabIndex: e === L ? 0 : -1,
|
|
228
|
+
onKeyDown: ur(r.props.onKeyDown),
|
|
229
|
+
"aria-roledescription": "slide",
|
|
230
|
+
"aria-hidden": e !== L,
|
|
231
|
+
"aria-current": e === L ? "page" : void 0,
|
|
232
|
+
"aria-label": `${c}개 중 ${e + 1}번째 슬라이드`,
|
|
233
|
+
"aria-posinset": e + 1,
|
|
234
|
+
"aria-setsize": c,
|
|
235
|
+
...r.props
|
|
236
|
+
})
|
|
237
|
+
),
|
|
238
|
+
P.map(
|
|
239
|
+
tr,
|
|
240
|
+
(r) => G(r, {
|
|
241
|
+
"aria-hidden": !0
|
|
242
|
+
})
|
|
243
|
+
)
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
typeof B == "function" && B({ page: L, totalPages: c, onChange: sr }),
|
|
248
|
+
/* @__PURE__ */ ar(
|
|
249
|
+
I,
|
|
250
|
+
{
|
|
251
|
+
role: "status",
|
|
252
|
+
inlineCSS: {
|
|
253
|
+
position: "absolute",
|
|
254
|
+
top: 0,
|
|
255
|
+
left: 0,
|
|
256
|
+
width: "1px",
|
|
257
|
+
height: "1px",
|
|
258
|
+
padding: 0,
|
|
259
|
+
margin: "-1px",
|
|
260
|
+
overflow: "hidden",
|
|
261
|
+
clip: "rect(0, 0, 0, 0)",
|
|
262
|
+
whiteSpace: "nowrap",
|
|
263
|
+
border: 0
|
|
264
|
+
},
|
|
265
|
+
children: `${c}개 중 ${L + 1}번째 슬라이드`
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
export {
|
|
273
|
+
hr as default
|
|
274
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function createSwipeEvent({ realPage, totalPages, lastPage, isLoop }: {
|
|
2
|
+
realPage: number;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
lastPage: number;
|
|
5
|
+
isLoop: boolean;
|
|
6
|
+
}): {
|
|
7
|
+
isFirstPage: boolean;
|
|
8
|
+
isLastPage: boolean;
|
|
9
|
+
prevPage: number;
|
|
10
|
+
currentPage: number;
|
|
11
|
+
nextPage: number;
|
|
12
|
+
lastPage: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function p({
|
|
2
|
+
realPage: i,
|
|
3
|
+
totalPages: n,
|
|
4
|
+
lastPage: u,
|
|
5
|
+
isLoop: c
|
|
6
|
+
}) {
|
|
7
|
+
return c ? {
|
|
8
|
+
isFirstPage: i === 0,
|
|
9
|
+
isLastPage: i === n - 1,
|
|
10
|
+
prevPage: i - 2 < 0 ? 0 : i - 2,
|
|
11
|
+
currentPage: i,
|
|
12
|
+
nextPage: i + 2 >= n ? n - 1 : i + 2,
|
|
13
|
+
lastPage: u
|
|
14
|
+
} : {
|
|
15
|
+
isFirstPage: i === 0,
|
|
16
|
+
isLastPage: i === n - 1,
|
|
17
|
+
prevPage: i - 1 < 0 ? 0 : i - 1,
|
|
18
|
+
currentPage: i,
|
|
19
|
+
nextPage: i + 1 >= n ? n - 1 : i + 1,
|
|
20
|
+
lastPage: u
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
p as createSwipeEvent
|
|
25
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FlexboxProps } from 'node_modules/@thedotscorp/ui/Flexbox/Flexbox';
|
|
2
|
+
export type SwiperBlockProps = FlexboxProps;
|
|
3
|
+
declare function SwiperBlock({ children, ...props }: SwiperBlockProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default SwiperBlock;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "@thedotscorp/ui/Flexbox";
|
|
3
|
+
function r({ children: n, ...i }) {
|
|
4
|
+
return /* @__PURE__ */ t(
|
|
5
|
+
e,
|
|
6
|
+
{
|
|
7
|
+
...i,
|
|
8
|
+
inlineCSS: {
|
|
9
|
+
minWidth: "100%",
|
|
10
|
+
transform: "translate3d(0, 0, 0)",
|
|
11
|
+
...i == null ? void 0 : i.inlineCSS
|
|
12
|
+
},
|
|
13
|
+
children: n
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
r as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ChainPicker } from '@thedotscorp/ui';
|
|
3
|
+
import { FlexboxProps } from 'node_modules/@thedotscorp/ui/Flexbox/Flexbox';
|
|
4
|
+
export interface TimePickerItem {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TimePickerProps extends Omit<FlexboxProps, 'onChange'> {
|
|
9
|
+
onChange: (startTime: number, endTime: number) => void;
|
|
10
|
+
onChangeStartTime?: (startTime: number) => void;
|
|
11
|
+
onChangeEndTime?: (endTime: number) => void;
|
|
12
|
+
startTime?: number;
|
|
13
|
+
endTime?: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
range?: [number, number];
|
|
16
|
+
startTimeChainPickerProps?: Omit<Parameters<typeof ChainPicker>[0], 'column' | 'value' | 'onChange' | 'renderLabel'>;
|
|
17
|
+
endTimeChainPickerProps?: Omit<Parameters<typeof ChainPicker>[0], 'column' | 'value' | 'onChange' | 'renderLabel'>;
|
|
18
|
+
timePickerHighlightProps?: HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
renderStartTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
|
|
20
|
+
renderEndTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const TimePicker: import('react').ForwardRefExoticComponent<Omit<TimePickerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default TimePicker;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsxs as R, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as O, useState as j, useRef as w, useEffect as r } from "react";
|
|
3
|
+
import { ChainPicker as I, Typography as S, Flexbox as Q } from "@thedotscorp/ui";
|
|
4
|
+
import z from "@emotion/styled";
|
|
5
|
+
import b from "../../utils/getTimeRange/getTimeRange.mjs";
|
|
6
|
+
const U = z.div`
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
gap: ${({ theme: { spacing: o } }) => o.content(7)}px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
padding: ${({ theme: { spacing: o } }) => o.content(2)}px 0;
|
|
14
|
+
`, V = z.div`
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 54px;
|
|
18
|
+
background: ${({ theme: o }) => o.palette.background.primary};
|
|
19
|
+
border-radius: 12px;
|
|
20
|
+
`, k = O(function({
|
|
21
|
+
onChange: F,
|
|
22
|
+
onChangeStartTime: p,
|
|
23
|
+
onChangeEndTime: s,
|
|
24
|
+
startTime: l = 9,
|
|
25
|
+
endTime: n = 12,
|
|
26
|
+
range: t = [0, 24],
|
|
27
|
+
step: i = 1,
|
|
28
|
+
startTimeChainPickerProps: m,
|
|
29
|
+
endTimeChainPickerProps: f,
|
|
30
|
+
timePickerHighlightProps: H,
|
|
31
|
+
renderStartTimeLabel: N,
|
|
32
|
+
renderEndTimeLabel: q,
|
|
33
|
+
inlineCSS: A,
|
|
34
|
+
...B
|
|
35
|
+
}, D) {
|
|
36
|
+
const [a, y] = j(l), [u, x] = j(n), E = w(
|
|
37
|
+
b(0, 24, { minTime: t[0], maxTime: t[1] - i })
|
|
38
|
+
), d = w(
|
|
39
|
+
b(0, 24, { minTime: l + i, maxTime: t[1] })
|
|
40
|
+
), $ = (e, h) => {
|
|
41
|
+
const [v, M] = e.label.split(":").map(Number), K = v >= 12, g = v % 12 || 12, L = K ? "오후" : "오전";
|
|
42
|
+
return /* @__PURE__ */ R(
|
|
43
|
+
Q,
|
|
44
|
+
{
|
|
45
|
+
gap: 1,
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
"aria-label": `${L} ${g}시 ${M}분`,
|
|
49
|
+
inlineCSS: { width: "82px" },
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ c(S, { tag: "span", variant: h ? "h5M" : "b5M", children: L }),
|
|
52
|
+
/* @__PURE__ */ c(S, { tag: "span", variant: h ? "h2M" : "h4M", children: `${g}:${M.toString().padStart(2, "0")}` })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}, G = (e) => {
|
|
57
|
+
y(e), d.current = b(0, 24, {
|
|
58
|
+
minTime: e + i > t[1] ? t[1] : e + i,
|
|
59
|
+
maxTime: t[1]
|
|
60
|
+
}), e >= n - 0.5 && x(d.current[0].value);
|
|
61
|
+
}, J = (e) => {
|
|
62
|
+
x(e);
|
|
63
|
+
};
|
|
64
|
+
return r(() => {
|
|
65
|
+
d.current = b(0, 24, {
|
|
66
|
+
minTime: l + i > t[1] ? t[1] : l + i,
|
|
67
|
+
maxTime: t[1]
|
|
68
|
+
});
|
|
69
|
+
}, [l, n, t, i]), r(() => {
|
|
70
|
+
y(l);
|
|
71
|
+
}, [l]), r(() => {
|
|
72
|
+
l >= n - 0.5 ? x(d.current[0].value) : x(n);
|
|
73
|
+
}, [l, n]), r(() => {
|
|
74
|
+
F(a, u);
|
|
75
|
+
}, [a, u]), r(() => {
|
|
76
|
+
p == null || p(a);
|
|
77
|
+
}, [a]), r(() => {
|
|
78
|
+
s == null || s(u);
|
|
79
|
+
}, [u]), /* @__PURE__ */ R(U, { ref: D, css: A, role: "group", "aria-label": "시간 선택", ...B, children: [
|
|
80
|
+
/* @__PURE__ */ c(V, { ...H, "aria-hidden": !0 }),
|
|
81
|
+
/* @__PURE__ */ c(
|
|
82
|
+
I,
|
|
83
|
+
{
|
|
84
|
+
column: E.current,
|
|
85
|
+
value: l,
|
|
86
|
+
onChange: G,
|
|
87
|
+
renderLabel: N || $,
|
|
88
|
+
"aria-label": "시작 시간 선택",
|
|
89
|
+
inlineCSS: {
|
|
90
|
+
"& > li": {
|
|
91
|
+
padding: 0
|
|
92
|
+
},
|
|
93
|
+
...m == null ? void 0 : m.inlineCSS
|
|
94
|
+
},
|
|
95
|
+
...m
|
|
96
|
+
},
|
|
97
|
+
`start-time-${a}`
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ c(S, { variant: "h5M", color: "grey.50", "aria-hidden": !0, inlineCSS: { zIndex: 1 }, children: "부터" }),
|
|
100
|
+
/* @__PURE__ */ c(
|
|
101
|
+
I,
|
|
102
|
+
{
|
|
103
|
+
column: d.current,
|
|
104
|
+
value: n,
|
|
105
|
+
onChange: J,
|
|
106
|
+
renderLabel: q || $,
|
|
107
|
+
"aria-label": "종료 시간 선택",
|
|
108
|
+
inlineCSS: {
|
|
109
|
+
"& > li": {
|
|
110
|
+
padding: 0
|
|
111
|
+
},
|
|
112
|
+
...f == null ? void 0 : f.inlineCSS
|
|
113
|
+
},
|
|
114
|
+
...f
|
|
115
|
+
},
|
|
116
|
+
`end-time-${u}`
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
});
|
|
120
|
+
export {
|
|
121
|
+
k as default
|
|
122
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./Scheduler/Scheduler.mjs";
|
|
2
|
+
import { default as s } from "./Scheduler/ScheduleEvent/ScheduleEvent.mjs";
|
|
3
|
+
import { default as g } from "./Scheduler/ScheduleBlock/ScheduleBlock.mjs";
|
|
4
|
+
import { getAvailableDateRange as n } from "./Scheduler/Scheduler.utils.mjs";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react";
|
|
7
|
+
import "@thedotscorp/ui/core/useTheme";
|
|
8
|
+
import "@thedotscorp/ui/Dialog";
|
|
9
|
+
import "@thedotscorp/ui/Flexbox";
|
|
10
|
+
import "@thedotscorp/ui/Typography";
|
|
11
|
+
import "./Image/Image.mjs";
|
|
12
|
+
import "@thedotscorp/ui";
|
|
13
|
+
import { default as S } from "./Swiper/SwiperBlock/SwiperBlock.mjs";
|
|
14
|
+
import { default as B } from "./ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs";
|
|
15
|
+
import { default as Z } from "./ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs";
|
|
16
|
+
import { default as h } from "./ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs";
|
|
17
|
+
import { default as C } from "./Carousel/CarouselSlide/CarouselSlide.mjs";
|
|
18
|
+
import "./TimePicker/TimePicker.mjs";
|
|
19
|
+
import { default as w } from "./Roller/RollerBlock/RollerBlock.mjs";
|
|
20
|
+
export {
|
|
21
|
+
C as CarouselSlide,
|
|
22
|
+
B as ImageZoomDialogContent,
|
|
23
|
+
Z as ImageZoomDialogFooter,
|
|
24
|
+
h as ImageZoomDialogToolbar,
|
|
25
|
+
w as RollerBlock,
|
|
26
|
+
g as ScheduleBlock,
|
|
27
|
+
s as ScheduleEvent,
|
|
28
|
+
S as SwiperBlock,
|
|
29
|
+
n as getAvailableDateRange
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertBirthDateToAge(birthDate: string): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import a from "dayjs";
|
|
2
|
+
function f(i) {
|
|
3
|
+
const e = a(), r = a(i);
|
|
4
|
+
if (!r.isValid() || r.isAfter(e)) return 0;
|
|
5
|
+
let t = e.year() - r.year();
|
|
6
|
+
const s = r.format("MM-DD") === "02-29" ? a(`${e.year()}-03-01`) : r.add(t, "years");
|
|
7
|
+
return e.isBefore(s, "days") && (t -= 1), t;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
f as default
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from "dayjs";
|
|
2
|
+
import { describe as d, expect as t } from "vitest";
|
|
3
|
+
import o from "./birthDateToAge.mjs";
|
|
4
|
+
d("convertBirthDateToAge", (r) => {
|
|
5
|
+
r("만 나이를 반환한다.", () => {
|
|
6
|
+
const a = e().subtract(1, "year"), Y = a.add(1, "day");
|
|
7
|
+
t(o(a.format("YYYY-MM-DD"))).toEqual(1), t(o(Y.format("YYYY-MM-DD"))).toEqual(0);
|
|
8
|
+
}), r("유효하지 않은 날짜를 넘긴 경우에는 0을 반환한다.", () => {
|
|
9
|
+
const a = e().add(1, "day");
|
|
10
|
+
t(o("invalid")).toEqual(0), t(o("")).toEqual(0), t(o(void 0)).toEqual(0), t(o(a.format("YYYY-MM-DD"))).toEqual(0);
|
|
11
|
+
});
|
|
12
|
+
});
|