@dotss/tictoccroc 0.0.4 → 0.0.5
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.mjs +78 -77
- package/dist/shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs +1 -1
- package/dist/shared/components/Roller/Roller.mjs +131 -7
- package/dist/shared/components/Roller/index.mjs +3 -3
- package/dist/shared/components/index.mjs +3 -3
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +1 -1
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +1 -1
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +79 -6
- package/dist/teacher/profile/components/LessonNotesSection/index.mjs +3 -3
- package/dist/teacher/profile/components/index.mjs +5 -5
- package/package.json +2 -2
- package/dist/LessonNotesSection-Bg1DHFxg.js +0 -208
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +0 -11
- package/dist/shared/utils/getDateRange/getDateRange.test.mjs +0 -60
- package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +0 -27
- package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +0 -75
- package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +0 -14
- package/dist/shared/utils/isAndroid/isAndroid.test.mjs +0 -12
- package/dist/shared/utils/isApp/isApp.test.mjs +0 -22
- package/dist/shared/utils/isDesktop/isDesktop.test.mjs +0 -10
- package/dist/shared/utils/isServer/isServer.test.mjs +0 -12
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +0 -11
- package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +0 -15
- package/dist/shared/utils/share/share.test.mjs +0 -31
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { default as t } from "./shared/components/Scheduler/Scheduler.mjs";
|
|
|
2
2
|
import { default as a } from "./shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs";
|
|
3
3
|
import { default as l } from "./shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs";
|
|
4
4
|
import { getAvailableDateRange as s } from "./shared/components/Scheduler/Scheduler.utils.mjs";
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as m } from "./shared/components/MediaDialog/MediaDialog.mjs";
|
|
6
6
|
import { default as i } from "./shared/components/MediaDialog/MediaBlock/MediaBlock.mjs";
|
|
7
7
|
import { default as n } from "./shared/components/MediaDialog/MediaDialogContent/MediaDialogContent.mjs";
|
|
8
8
|
import { default as g } from "./shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs";
|
|
@@ -10,104 +10,105 @@ import { default as y } from "./shared/components/MediaDialog/MediaDialogToolbar
|
|
|
10
10
|
import { default as C } from "./shared/components/Swiper/Swiper.mjs";
|
|
11
11
|
import { default as b } from "./shared/components/Swiper/SwiperBlock/SwiperBlock.mjs";
|
|
12
12
|
import { default as D } from "./shared/components/Carousel/Carousel.mjs";
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import {
|
|
13
|
+
import { default as h } from "./shared/components/Carousel/CarouselSlide/CarouselSlide.mjs";
|
|
14
|
+
import { default as M } from "./shared/components/TimePicker/TimePicker.mjs";
|
|
15
|
+
import { default as R } from "./shared/components/Roller/Roller.mjs";
|
|
16
16
|
import { default as T } from "./shared/components/Roller/RollerBlock/RollerBlock.mjs";
|
|
17
17
|
import { default as G } from "./shared/components/Image/Image.mjs";
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
18
|
+
import { default as K } from "./shared/components/Calendar/Calendar.mjs";
|
|
19
|
+
import { default as Q } from "./shared/components/Masonry/Masonry.mjs";
|
|
20
|
+
import { default as F } from "./shared/components/Masonry/MasonryBlock/MasonryBlock.mjs";
|
|
21
|
+
import { default as V } from "./shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs";
|
|
22
|
+
import { default as z } from "./shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs";
|
|
23
|
+
import { default as J } from "./shared/utils/getImageUrl/getImageUrl.mjs";
|
|
24
|
+
import { default as W } from "./shared/utils/isServer/isServer.mjs";
|
|
25
|
+
import { default as Y } from "./shared/utils/getTimeRange/getTimeRange.mjs";
|
|
26
|
+
import { default as _ } from "./shared/utils/getDateRange/getDateRange.mjs";
|
|
27
|
+
import { default as ee } from "./shared/utils/isAndroid/isAndroid.mjs";
|
|
28
|
+
import { default as te } from "./shared/utils/isApp/isApp.mjs";
|
|
29
|
+
import { default as ae } from "./shared/utils/isDesktop/isDesktop.mjs";
|
|
30
|
+
import { default as le } from "./shared/utils/birthDateToAge/birthDateToAge.mjs";
|
|
31
|
+
import { default as se } from "./shared/utils/objectToQueryString/objectToQueryString.mjs";
|
|
32
|
+
import { default as me } from "./shared/utils/getVimeoId/getVimeoId.mjs";
|
|
33
|
+
import { default as ie } from "./shared/utils/parseQueryString/parseQueryString.mjs";
|
|
34
|
+
import { default as ne } from "./shared/utils/share/share.mjs";
|
|
35
|
+
import { default as ge } from "./teacher/profile/components/ProfileSummary/ProfileSummary.mjs";
|
|
36
|
+
import { default as ye } from "./teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs";
|
|
37
|
+
import { default as Ce } from "./teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs";
|
|
38
|
+
import { default as be } from "./teacher/profile/components/ActivityGallery/ActivityGallery.mjs";
|
|
39
|
+
import { default as De } from "./teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs";
|
|
40
40
|
import { default as he } from "./teacher/profile/components/CertificationSection/CertificationSection.mjs";
|
|
41
41
|
import { default as Me } from "./teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs";
|
|
42
|
-
import { default as
|
|
42
|
+
import { default as Re } from "./teacher/profile/components/CareerSection/CareerSection.mjs";
|
|
43
43
|
import { default as Te } from "./teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs";
|
|
44
44
|
import { default as Ge } from "./teacher/profile/components/EducationSection/EducationSection.mjs";
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { getPreferredAgeKeywords as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { getAbilityCollection as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
45
|
+
import { default as Ke } from "./teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs";
|
|
46
|
+
import { default as Qe } from "./teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs";
|
|
47
|
+
import { default as Fe } from "./teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs";
|
|
48
|
+
import { getPreferredAgeKeywords as Ve } from "./teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs";
|
|
49
|
+
import { default as ze } from "./teacher/profile/components/AbilityCollection/AbilityCollection.mjs";
|
|
50
|
+
import { default as Je } from "./teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs";
|
|
51
|
+
import { getAbilityCollection as We } from "./teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs";
|
|
52
|
+
import { default as Ye } from "./teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs";
|
|
53
|
+
import { default as _e } from "./teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs";
|
|
54
|
+
import { default as eo } from "./teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
55
|
+
import { default as to } from "./teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs";
|
|
56
|
+
import { default as ao } from "./teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs";
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
Je as AbilityBadge,
|
|
59
|
+
ze as AbilityCollection,
|
|
60
|
+
be as ActivityGallery,
|
|
61
|
+
De as ActivityGalleryItem,
|
|
62
|
+
Ye as AvailableScheduleSection,
|
|
63
|
+
K as Calendar,
|
|
63
64
|
Te as CareerItem,
|
|
64
|
-
|
|
65
|
+
Re as CareerSection,
|
|
65
66
|
D as Carousel,
|
|
66
|
-
|
|
67
|
+
h as CarouselSlide,
|
|
67
68
|
Me as CertificationItem,
|
|
68
69
|
he as CertificationSection,
|
|
69
|
-
|
|
70
|
+
Ke as EducationItem,
|
|
70
71
|
Ge as EducationSection,
|
|
71
72
|
G as Image,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
eo as LessonNote,
|
|
74
|
+
_e as LessonNotesSection,
|
|
75
|
+
V as LoadingAnnouncer,
|
|
76
|
+
Q as Masonry,
|
|
77
|
+
F as MasonryBlock,
|
|
77
78
|
i as MediaBlock,
|
|
78
|
-
|
|
79
|
+
m as MediaDialog,
|
|
79
80
|
n as MediaDialogContent,
|
|
80
81
|
g as MediaDialogFooter,
|
|
81
82
|
y as MediaDialogToolbar,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
ao as ParentReviewCard,
|
|
84
|
+
to as ParentReviewSection,
|
|
85
|
+
Qe as PreferredActivityKeywordGroup,
|
|
86
|
+
Fe as PreferredAgeGroup,
|
|
87
|
+
ge as ProfileSummary,
|
|
88
|
+
R as Roller,
|
|
88
89
|
T as RollerBlock,
|
|
89
90
|
l as ScheduleBlock,
|
|
90
91
|
a as ScheduleEvent,
|
|
91
92
|
t as Scheduler,
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
Ce as StatBadge,
|
|
94
|
+
ye as StatBadgeCollection,
|
|
94
95
|
C as Swiper,
|
|
95
96
|
b as SwiperBlock,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
M as TimePicker,
|
|
98
|
+
le as birthDateToAge,
|
|
99
|
+
We as getAbilityCollection,
|
|
99
100
|
s as getAvailableDateRange,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
_ as getDateRange,
|
|
102
|
+
J as getImageUrl,
|
|
103
|
+
Ve as getPreferredAgeKeywords,
|
|
104
|
+
Y as getTimeRange,
|
|
105
|
+
me as getVimeoId,
|
|
106
|
+
ee as isAndroid,
|
|
107
|
+
te as isApp,
|
|
108
|
+
ae as isDesktop,
|
|
109
|
+
W as isServer,
|
|
110
|
+
se as objectToQueryString,
|
|
111
|
+
ie as parseQueryString,
|
|
112
|
+
ne as share,
|
|
113
|
+
z as useIsomorphicLayoutEffect
|
|
113
114
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Flexbox as i } from "
|
|
2
|
+
import { Flexbox as i } from "@dotss/ui";
|
|
3
3
|
import r from "@dotss/ui/core/useTheme";
|
|
4
4
|
function l({ children: o }) {
|
|
5
5
|
const {
|
|
@@ -1,9 +1,133 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "@dotss/ui";
|
|
4
|
-
import "./RollerBlock/RollerBlock.mjs";
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as a, Children as k, isValidElement as X, useEffect as g, cloneElement as N } from "react";
|
|
3
|
+
import { Flexbox as P } from "@dotss/ui";
|
|
4
|
+
import U from "./RollerBlock/RollerBlock.mjs";
|
|
5
|
+
import S from "../../../teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
6
|
+
function V({
|
|
7
|
+
children: L,
|
|
8
|
+
spacing: A = 2,
|
|
9
|
+
edgeSpacing: m = 4,
|
|
10
|
+
rowCount: o = 1,
|
|
11
|
+
inlineCSS: M,
|
|
12
|
+
...R
|
|
13
|
+
}) {
|
|
14
|
+
const [y, x] = w(0), n = a(null), i = a(!1), u = a(!0), b = a(0), l = a(0), c = a(0), v = k.toArray(L).filter(X).filter((r) => r.type === U || r.type === S), f = v.length, E = (r) => {
|
|
15
|
+
var e, t;
|
|
16
|
+
i.current = !0, b.current = r.clientX - (((e = n.current) == null ? void 0 : e.offsetLeft) || 0), l.current = ((t = n.current) == null ? void 0 : t.scrollLeft) || 0;
|
|
17
|
+
}, I = (r) => {
|
|
18
|
+
i.current && (r.currentTarget.style.cursor = "grabbing", n.current && (n.current.scrollLeft = l.current - (r.clientX - n.current.offsetLeft - b.current)));
|
|
19
|
+
}, d = (r) => {
|
|
20
|
+
var t;
|
|
21
|
+
i.current = !1, l.current !== ((t = n.current) == null ? void 0 : t.scrollLeft) ? (r.currentTarget.style.cursor = "grab", u.current = !1, c.current && cancelAnimationFrame(c.current), c.current = requestAnimationFrame(() => {
|
|
22
|
+
u.current = !0;
|
|
23
|
+
})) : u.current = !0;
|
|
24
|
+
}, T = (r) => (e) => {
|
|
25
|
+
var D;
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
const t = Number(e.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
28
|
+
let s = t;
|
|
29
|
+
switch (e.key) {
|
|
30
|
+
case "ArrowRight": {
|
|
31
|
+
e.preventDefault(), t + o < f && (s = t + o);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case "ArrowLeft": {
|
|
35
|
+
e.preventDefault(), t - o >= 0 && (s = t - o);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case "ArrowDown": {
|
|
39
|
+
e.preventDefault(), (t + 1) % o !== 0 && t + 1 < f && (s = t + 1);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case "ArrowUp": {
|
|
43
|
+
e.preventDefault(), t % o !== 0 && t - 1 >= 0 && (s = t - 1);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case "Enter":
|
|
47
|
+
case " ": {
|
|
48
|
+
e.preventDefault(), e.currentTarget.click();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
default:
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (s !== t) {
|
|
55
|
+
const p = (D = n.current) == null ? void 0 : D.children[s];
|
|
56
|
+
p == null || p.focus();
|
|
57
|
+
}
|
|
58
|
+
r == null || r(e);
|
|
59
|
+
}, F = (r) => (e) => {
|
|
60
|
+
const t = Number(e.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
61
|
+
x(t), r == null || r(e);
|
|
62
|
+
};
|
|
63
|
+
return g(() => {
|
|
64
|
+
const r = n.current, e = (t) => {
|
|
65
|
+
u.current || t.stopPropagation();
|
|
66
|
+
};
|
|
67
|
+
return r == null || r.addEventListener("click", e), () => {
|
|
68
|
+
r == null || r.removeEventListener("click", e);
|
|
69
|
+
};
|
|
70
|
+
}, []), g(() => {
|
|
71
|
+
const r = n.current, e = (t) => {
|
|
72
|
+
t.stopPropagation();
|
|
73
|
+
};
|
|
74
|
+
return r == null || r.addEventListener("touchmove", e), () => {
|
|
75
|
+
r == null || r.removeEventListener("touchmove", e);
|
|
76
|
+
};
|
|
77
|
+
}, []), g(() => () => {
|
|
78
|
+
c.current && cancelAnimationFrame(c.current);
|
|
79
|
+
}, []), /* @__PURE__ */ h(
|
|
80
|
+
P,
|
|
81
|
+
{
|
|
82
|
+
ref: n,
|
|
83
|
+
alignItems: "baseline",
|
|
84
|
+
gap: A,
|
|
85
|
+
pl: m,
|
|
86
|
+
pr: m,
|
|
87
|
+
onMouseDown: E,
|
|
88
|
+
onMouseMove: I,
|
|
89
|
+
onMouseUp: d,
|
|
90
|
+
onMouseLeave: d,
|
|
91
|
+
role: "list",
|
|
92
|
+
"aria-roledescription": "carousel",
|
|
93
|
+
"aria-label": "슬라이더",
|
|
94
|
+
...R,
|
|
95
|
+
inlineCSS: {
|
|
96
|
+
display: "grid",
|
|
97
|
+
gridAutoFlow: "column",
|
|
98
|
+
gridAutoColumns: "min-content",
|
|
99
|
+
overflowX: "auto",
|
|
100
|
+
scrollbarWidth: "none",
|
|
101
|
+
cursor: "grab",
|
|
102
|
+
transform: "translate3d(0, 0, 0)",
|
|
103
|
+
"&::-webkit-scrollbar": {
|
|
104
|
+
display: "none"
|
|
105
|
+
},
|
|
106
|
+
...M
|
|
107
|
+
},
|
|
108
|
+
children: k.map(
|
|
109
|
+
v,
|
|
110
|
+
(r, e) => {
|
|
111
|
+
var t;
|
|
112
|
+
return N(r, {
|
|
113
|
+
role: "listitem",
|
|
114
|
+
tabIndex: e === y ? 0 : -1,
|
|
115
|
+
"aria-roledescription": "slide",
|
|
116
|
+
"aria-posinset": e + 1,
|
|
117
|
+
"aria-setsize": f,
|
|
118
|
+
onKeyDown: T(r.props.onKeyDown),
|
|
119
|
+
onFocus: F(r.props.onFocus),
|
|
120
|
+
...r.props,
|
|
121
|
+
style: {
|
|
122
|
+
...(t = r.props) == null ? void 0 : t.style,
|
|
123
|
+
gridRow: `${e % o + 1} / ${e % o + 1}`
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
7
131
|
export {
|
|
8
|
-
|
|
132
|
+
V as default
|
|
9
133
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as
|
|
1
|
+
import l from "./Roller.mjs";
|
|
2
|
+
import { default as t } from "./RollerBlock/RollerBlock.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
t as RollerBlock,
|
|
5
5
|
l as default
|
|
6
6
|
};
|
|
@@ -9,10 +9,10 @@ import { default as g } from "./MediaDialog/MediaDialogFooter/MediaDialogFooter.
|
|
|
9
9
|
import { default as k } from "./MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs";
|
|
10
10
|
import { default as B } from "./Swiper/Swiper.mjs";
|
|
11
11
|
import { default as C } from "./Swiper/SwiperBlock/SwiperBlock.mjs";
|
|
12
|
-
import { default as
|
|
12
|
+
import { default as R } from "./Carousel/Carousel.mjs";
|
|
13
13
|
import { default as v } from "./Carousel/CarouselSlide/CarouselSlide.mjs";
|
|
14
14
|
import { default as y } from "./TimePicker/TimePicker.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { default as T } from "./Roller/Roller.mjs";
|
|
16
16
|
import { default as F } from "./Roller/RollerBlock/RollerBlock.mjs";
|
|
17
17
|
import { default as L } from "./Image/Image.mjs";
|
|
18
18
|
import { default as j } from "./Calendar/Calendar.mjs";
|
|
@@ -21,7 +21,7 @@ import { default as H } from "./Masonry/MasonryBlock/MasonryBlock.mjs";
|
|
|
21
21
|
import { default as K } from "./LoadingAnnouncer/LoadingAnnouncer.mjs";
|
|
22
22
|
export {
|
|
23
23
|
j as Calendar,
|
|
24
|
-
|
|
24
|
+
R as Carousel,
|
|
25
25
|
v as CarouselSlide,
|
|
26
26
|
L as Image,
|
|
27
27
|
K as LoadingAnnouncer,
|
package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useId as u } from "react";
|
|
3
3
|
import { Flexbox as a, Typography as g, Icon as c } from "@dotss/ui";
|
|
4
|
-
import y from "
|
|
4
|
+
import y from "@dotss/ui/core/useTheme";
|
|
5
5
|
import { useCheckHoverPossible as C } from "@dotss/ui/hooks";
|
|
6
6
|
function E({ name: b, acquisitionDate: h, status: o, ...e }) {
|
|
7
7
|
const t = u(), { isHoverPossible: s } = C(), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { useId as y } from "react";
|
|
3
3
|
import { Flexbox as c, Typography as d, Icon as m } from "@dotss/ui";
|
|
4
|
-
import C from "
|
|
4
|
+
import C from "@dotss/ui/core/useTheme";
|
|
5
5
|
import { useCheckHoverPossible as v } from "@dotss/ui/hooks";
|
|
6
6
|
function R({ name: f, status: g, major: u, academicStatus: o, ...e }) {
|
|
7
7
|
const l = y(), { isHoverPossible: s } = v(), {
|
|
@@ -1,8 +1,81 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "@dotss/ui";
|
|
4
|
-
import "@dotss/ui/core/useTheme";
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d, Children as h } from "react";
|
|
3
|
+
import { Flexbox as i, Typography as l, Button as p, Icon as f } from "@dotss/ui";
|
|
4
|
+
import u from "@dotss/ui/core/useTheme";
|
|
5
|
+
import x from "../../../../shared/components/Roller/Roller.mjs";
|
|
6
|
+
const w = d(
|
|
7
|
+
({ children: r, totalCount: a = 0, onClickViewAll: c, ...n }, s) => {
|
|
8
|
+
const {
|
|
9
|
+
palette: { background: m },
|
|
10
|
+
spacing: e
|
|
11
|
+
} = u(), g = h.count(r);
|
|
12
|
+
return /* @__PURE__ */ t(
|
|
13
|
+
i,
|
|
14
|
+
{
|
|
15
|
+
ref: s,
|
|
16
|
+
tag: "section",
|
|
17
|
+
pt: 10,
|
|
18
|
+
pb: 10,
|
|
19
|
+
pl: 4,
|
|
20
|
+
pr: 4,
|
|
21
|
+
gap: 4,
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
"aria-labelledby": "lesson-notes-section-title",
|
|
24
|
+
...n,
|
|
25
|
+
inlineCSS: {
|
|
26
|
+
width: "100%",
|
|
27
|
+
backgroundColor: m.primary,
|
|
28
|
+
...n == null ? void 0 : n.inlineCSS
|
|
29
|
+
},
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ t(i, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
|
|
32
|
+
/* @__PURE__ */ o(i, { alignItems: "center", gap: 2, children: /* @__PURE__ */ t(l, { id: "lesson-notes-section-title", tag: "h2", variant: "h2B", children: [
|
|
33
|
+
"선생님의 수업노트",
|
|
34
|
+
a > 0 && /* @__PURE__ */ t(
|
|
35
|
+
l,
|
|
36
|
+
{
|
|
37
|
+
tag: "span",
|
|
38
|
+
variant: "h4R",
|
|
39
|
+
color: "grey.70",
|
|
40
|
+
inlineCSS: { marginLeft: e.content(2), verticalAlign: 2 },
|
|
41
|
+
children: [
|
|
42
|
+
"(",
|
|
43
|
+
a.toLocaleString(),
|
|
44
|
+
"개)"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] }) }),
|
|
49
|
+
typeof c == "function" && /* @__PURE__ */ o(
|
|
50
|
+
p,
|
|
51
|
+
{
|
|
52
|
+
variant: "text",
|
|
53
|
+
size: "small",
|
|
54
|
+
color: "secondary",
|
|
55
|
+
endAdornment: /* @__PURE__ */ o(f, { name: "ChevronRightLine" }),
|
|
56
|
+
onClick: c,
|
|
57
|
+
children: "전체보기"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
x,
|
|
63
|
+
{
|
|
64
|
+
rowCount: 1,
|
|
65
|
+
spacing: 3,
|
|
66
|
+
inlineCSS: {
|
|
67
|
+
width: `calc(100% + ${e.content(8)}px)`,
|
|
68
|
+
gridAutoColumns: g > 1 ? `calc(100% - ${e.content(8)}px)` : "100%",
|
|
69
|
+
margin: `0 -${e.content(4)}px`
|
|
70
|
+
},
|
|
71
|
+
children: r
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
6
79
|
export {
|
|
7
|
-
|
|
80
|
+
w as default
|
|
8
81
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as
|
|
1
|
+
import e from "./LessonNotesSection.mjs";
|
|
2
|
+
import { default as r } from "./LessonNote/LessonNote.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
r as LessonNote,
|
|
5
5
|
e as default
|
|
6
6
|
};
|
|
@@ -11,18 +11,18 @@ import { default as g } from "./EducationSection/EducationSection.mjs";
|
|
|
11
11
|
import { default as P } from "./EducationSection/EducationItem/EducationItem.mjs";
|
|
12
12
|
import { default as w } from "./PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs";
|
|
13
13
|
import { default as I } from "./PreferredAgeGroup/PreferredAgeGroup.mjs";
|
|
14
|
-
import { getPreferredAgeKeywords as
|
|
15
|
-
import { default as
|
|
14
|
+
import { getPreferredAgeKeywords as E } from "./PreferredAgeGroup/PreferredAgeGroup.utils.mjs";
|
|
15
|
+
import { default as L } from "./AbilityCollection/AbilityCollection.mjs";
|
|
16
16
|
import { default as R } from "./AbilityCollection/AbilityBadge/AbilityBadge.mjs";
|
|
17
17
|
import { getAbilityCollection as j } from "./AbilityCollection/AbilityCollection.utils.mjs";
|
|
18
18
|
import { default as q } from "./AvailableScheduleSection/AvailableScheduleSection.mjs";
|
|
19
|
-
import {
|
|
19
|
+
import { default as D } from "./LessonNotesSection/LessonNotesSection.mjs";
|
|
20
20
|
import { default as H } from "./LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
21
21
|
import { default as M } from "./ParentReviewSection/ParentReviewSection.mjs";
|
|
22
22
|
import { default as Q } from "./ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs";
|
|
23
23
|
export {
|
|
24
24
|
R as AbilityBadge,
|
|
25
|
-
|
|
25
|
+
L as AbilityCollection,
|
|
26
26
|
d as ActivityGallery,
|
|
27
27
|
s as ActivityGalleryItem,
|
|
28
28
|
q as AvailableScheduleSection,
|
|
@@ -42,5 +42,5 @@ export {
|
|
|
42
42
|
l as StatBadge,
|
|
43
43
|
a as StatBadgeCollection,
|
|
44
44
|
j as getAbilityCollection,
|
|
45
|
-
|
|
45
|
+
E as getPreferredAgeKeywords
|
|
46
46
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotss/tictoccroc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "Tictoccroc shared components, hooks, utils, and APIs for Dotss",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"vitest": "^1.6.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
+
"@dotss/ui": "^0.0.10",
|
|
81
82
|
"@emotion/react": "^11.14.0",
|
|
82
83
|
"@emotion/styled": "^11.14.0",
|
|
83
|
-
"@dotss/ui": "^0.0.10",
|
|
84
84
|
"dayjs": "^1.11.13",
|
|
85
85
|
"react": "^18.0.0 || 19.0.0",
|
|
86
86
|
"react-dom": "^18.0.0 || 19.0.0"
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { jsx as u, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useState as N, useRef as c, Children as A, isValidElement as $, useEffect as x, cloneElement as X, forwardRef as j } from "react";
|
|
3
|
-
import { Flexbox as d, Typography as w, Button as B, Icon as P } from "@dotss/ui";
|
|
4
|
-
import U from "@dotss/ui/core/useTheme";
|
|
5
|
-
import z from "./shared/components/Roller/RollerBlock/RollerBlock.mjs";
|
|
6
|
-
import q from "./teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
7
|
-
function W({
|
|
8
|
-
children: f,
|
|
9
|
-
spacing: g = 2,
|
|
10
|
-
edgeSpacing: i = 4,
|
|
11
|
-
rowCount: n = 1,
|
|
12
|
-
inlineCSS: b,
|
|
13
|
-
...v
|
|
14
|
-
}) {
|
|
15
|
-
const [s, h] = N(0), o = c(null), L = c(!1), p = c(!0), R = c(0), y = c(0), l = c(0), S = A.toArray(f).filter($).filter((e) => e.type === z || e.type === q), k = S.length, C = (e) => {
|
|
16
|
-
var r, t;
|
|
17
|
-
L.current = !0, R.current = e.clientX - (((r = o.current) == null ? void 0 : r.offsetLeft) || 0), y.current = ((t = o.current) == null ? void 0 : t.scrollLeft) || 0;
|
|
18
|
-
}, E = (e) => {
|
|
19
|
-
L.current && (e.currentTarget.style.cursor = "grabbing", o.current && (o.current.scrollLeft = y.current - (e.clientX - o.current.offsetLeft - R.current)));
|
|
20
|
-
}, I = (e) => {
|
|
21
|
-
var t;
|
|
22
|
-
L.current = !1, y.current !== ((t = o.current) == null ? void 0 : t.scrollLeft) ? (e.currentTarget.style.cursor = "grab", p.current = !1, l.current && cancelAnimationFrame(l.current), l.current = requestAnimationFrame(() => {
|
|
23
|
-
p.current = !0;
|
|
24
|
-
})) : p.current = !0;
|
|
25
|
-
}, T = (e) => (r) => {
|
|
26
|
-
var M;
|
|
27
|
-
r.stopPropagation();
|
|
28
|
-
const t = Number(r.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
29
|
-
let a = t;
|
|
30
|
-
switch (r.key) {
|
|
31
|
-
case "ArrowRight": {
|
|
32
|
-
r.preventDefault(), t + n < k && (a = t + n);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
case "ArrowLeft": {
|
|
36
|
-
r.preventDefault(), t - n >= 0 && (a = t - n);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
case "ArrowDown": {
|
|
40
|
-
r.preventDefault(), (t + 1) % n !== 0 && t + 1 < k && (a = t + 1);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
case "ArrowUp": {
|
|
44
|
-
r.preventDefault(), t % n !== 0 && t - 1 >= 0 && (a = t - 1);
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case "Enter":
|
|
48
|
-
case " ": {
|
|
49
|
-
r.preventDefault(), r.currentTarget.click();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
default:
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (a !== t) {
|
|
56
|
-
const D = (M = o.current) == null ? void 0 : M.children[a];
|
|
57
|
-
D == null || D.focus();
|
|
58
|
-
}
|
|
59
|
-
e == null || e(r);
|
|
60
|
-
}, F = (e) => (r) => {
|
|
61
|
-
const t = Number(r.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
62
|
-
h(t), e == null || e(r);
|
|
63
|
-
};
|
|
64
|
-
return x(() => {
|
|
65
|
-
const e = o.current, r = (t) => {
|
|
66
|
-
p.current || t.stopPropagation();
|
|
67
|
-
};
|
|
68
|
-
return e == null || e.addEventListener("click", r), () => {
|
|
69
|
-
e == null || e.removeEventListener("click", r);
|
|
70
|
-
};
|
|
71
|
-
}, []), x(() => {
|
|
72
|
-
const e = o.current, r = (t) => {
|
|
73
|
-
t.stopPropagation();
|
|
74
|
-
};
|
|
75
|
-
return e == null || e.addEventListener("touchmove", r), () => {
|
|
76
|
-
e == null || e.removeEventListener("touchmove", r);
|
|
77
|
-
};
|
|
78
|
-
}, []), x(() => () => {
|
|
79
|
-
l.current && cancelAnimationFrame(l.current);
|
|
80
|
-
}, []), /* @__PURE__ */ u(
|
|
81
|
-
d,
|
|
82
|
-
{
|
|
83
|
-
ref: o,
|
|
84
|
-
alignItems: "baseline",
|
|
85
|
-
gap: g,
|
|
86
|
-
pl: i,
|
|
87
|
-
pr: i,
|
|
88
|
-
onMouseDown: C,
|
|
89
|
-
onMouseMove: E,
|
|
90
|
-
onMouseUp: I,
|
|
91
|
-
onMouseLeave: I,
|
|
92
|
-
role: "list",
|
|
93
|
-
"aria-roledescription": "carousel",
|
|
94
|
-
"aria-label": "슬라이더",
|
|
95
|
-
...v,
|
|
96
|
-
inlineCSS: {
|
|
97
|
-
display: "grid",
|
|
98
|
-
gridAutoFlow: "column",
|
|
99
|
-
gridAutoColumns: "min-content",
|
|
100
|
-
overflowX: "auto",
|
|
101
|
-
scrollbarWidth: "none",
|
|
102
|
-
cursor: "grab",
|
|
103
|
-
transform: "translate3d(0, 0, 0)",
|
|
104
|
-
"&::-webkit-scrollbar": {
|
|
105
|
-
display: "none"
|
|
106
|
-
},
|
|
107
|
-
...b
|
|
108
|
-
},
|
|
109
|
-
children: A.map(
|
|
110
|
-
S,
|
|
111
|
-
(e, r) => {
|
|
112
|
-
var t;
|
|
113
|
-
return X(e, {
|
|
114
|
-
role: "listitem",
|
|
115
|
-
tabIndex: r === s ? 0 : -1,
|
|
116
|
-
"aria-roledescription": "slide",
|
|
117
|
-
"aria-posinset": r + 1,
|
|
118
|
-
"aria-setsize": k,
|
|
119
|
-
onKeyDown: T(e.props.onKeyDown),
|
|
120
|
-
onFocus: F(e.props.onFocus),
|
|
121
|
-
...e.props,
|
|
122
|
-
style: {
|
|
123
|
-
...(t = e.props) == null ? void 0 : t.style,
|
|
124
|
-
gridRow: `${r % n + 1} / ${r % n + 1}`
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
const Z = j(
|
|
133
|
-
({ children: f, totalCount: g = 0, onClickViewAll: i, ...n }, b) => {
|
|
134
|
-
const {
|
|
135
|
-
palette: { background: v },
|
|
136
|
-
spacing: s
|
|
137
|
-
} = U(), h = A.count(f);
|
|
138
|
-
return /* @__PURE__ */ m(
|
|
139
|
-
d,
|
|
140
|
-
{
|
|
141
|
-
ref: b,
|
|
142
|
-
tag: "section",
|
|
143
|
-
pt: 10,
|
|
144
|
-
pb: 10,
|
|
145
|
-
pl: 4,
|
|
146
|
-
pr: 4,
|
|
147
|
-
gap: 4,
|
|
148
|
-
flexDirection: "column",
|
|
149
|
-
"aria-labelledby": "lesson-notes-section-title",
|
|
150
|
-
...n,
|
|
151
|
-
inlineCSS: {
|
|
152
|
-
width: "100%",
|
|
153
|
-
backgroundColor: v.primary,
|
|
154
|
-
...n == null ? void 0 : n.inlineCSS
|
|
155
|
-
},
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ m(d, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
|
|
158
|
-
/* @__PURE__ */ u(d, { alignItems: "center", gap: 2, children: /* @__PURE__ */ m(w, { id: "lesson-notes-section-title", tag: "h2", variant: "h2B", children: [
|
|
159
|
-
"선생님의 수업노트",
|
|
160
|
-
g > 0 && /* @__PURE__ */ m(
|
|
161
|
-
w,
|
|
162
|
-
{
|
|
163
|
-
tag: "span",
|
|
164
|
-
variant: "h4R",
|
|
165
|
-
color: "grey.70",
|
|
166
|
-
inlineCSS: { marginLeft: s.content(2), verticalAlign: 2 },
|
|
167
|
-
children: [
|
|
168
|
-
"(",
|
|
169
|
-
g.toLocaleString(),
|
|
170
|
-
"개)"
|
|
171
|
-
]
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
] }) }),
|
|
175
|
-
typeof i == "function" && /* @__PURE__ */ u(
|
|
176
|
-
B,
|
|
177
|
-
{
|
|
178
|
-
variant: "text",
|
|
179
|
-
size: "small",
|
|
180
|
-
color: "secondary",
|
|
181
|
-
endAdornment: /* @__PURE__ */ u(P, { name: "ChevronRightLine" }),
|
|
182
|
-
onClick: i,
|
|
183
|
-
children: "전체보기"
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
] }),
|
|
187
|
-
/* @__PURE__ */ u(
|
|
188
|
-
W,
|
|
189
|
-
{
|
|
190
|
-
rowCount: 1,
|
|
191
|
-
spacing: 3,
|
|
192
|
-
inlineCSS: {
|
|
193
|
-
width: `calc(100% + ${s.content(8)}px)`,
|
|
194
|
-
gridAutoColumns: h > 1 ? `calc(100% - ${s.content(8)}px)` : "100%",
|
|
195
|
-
margin: `0 -${s.content(4)}px`
|
|
196
|
-
},
|
|
197
|
-
children: f
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
export {
|
|
206
|
-
Z as L,
|
|
207
|
-
W as R
|
|
208
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import o from "dayjs";
|
|
2
|
-
import t from "./birthDateToAge.mjs";
|
|
3
|
-
describe("convertBirthDateToAge", (a) => {
|
|
4
|
-
a("만 나이를 반환한다.", () => {
|
|
5
|
-
const e = o().subtract(1, "year"), r = e.add(1, "day");
|
|
6
|
-
expect(t(e.format("YYYY-MM-DD"))).toEqual(1), expect(t(r.format("YYYY-MM-DD"))).toEqual(0);
|
|
7
|
-
}), a("유효하지 않은 날짜를 넘긴 경우에는 0을 반환한다.", () => {
|
|
8
|
-
const e = o().add(1, "day");
|
|
9
|
-
expect(t("invalid")).toEqual(0), expect(t("")).toEqual(0), expect(t(void 0)).toEqual(0), expect(t(e.format("YYYY-MM-DD"))).toEqual(0);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import t from "dayjs";
|
|
2
|
-
import a from "./getDateRange.mjs";
|
|
3
|
-
describe("getDateRange", () => {
|
|
4
|
-
test("시작 날짜와 종료 날짜 사이의 날짜를 배열로 반환한다.", () => {
|
|
5
|
-
const e = a("2024-03-01", "2024-03-03");
|
|
6
|
-
expect(e).toEqual([
|
|
7
|
-
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
8
|
-
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
9
|
-
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
10
|
-
]);
|
|
11
|
-
}), test("시작 날짜가 종료 날짜보다 크면 빈 배열을 반환한다.", () => {
|
|
12
|
-
expect(a("2024-03-03", "2024-03-01")).toEqual([]);
|
|
13
|
-
}), test("유효하지 않은 날짜가 포함되면 빈 배열을 반환한다.", () => {
|
|
14
|
-
expect(a("invalid", "2024-03-03")).toEqual([]), expect(a("2024-03-01", "invalid")).toEqual([]);
|
|
15
|
-
}), test("YYYY-MM 형식으로 월 단위의 날짜를 반환한다.", () => {
|
|
16
|
-
const e = a("2024-01-01", "2024-03-01", { format: "YYYY-MM" });
|
|
17
|
-
expect(e).toEqual([
|
|
18
|
-
{ label: "2024-01", value: t("2024-01-01").toDate() },
|
|
19
|
-
{ label: "2024-02", value: t("2024-02-01").toDate() },
|
|
20
|
-
{ label: "2024-03", value: t("2024-03-01").toDate() }
|
|
21
|
-
]);
|
|
22
|
-
}), test("YYYY-MM-DD HH:mm 형식으로 날짜를 반환한다.", () => {
|
|
23
|
-
const e = a("2024-03-01 09:00", "2024-03-02 09:00", {
|
|
24
|
-
format: "YYYY-MM-DD HH:mm"
|
|
25
|
-
});
|
|
26
|
-
expect(e).toEqual([
|
|
27
|
-
{ label: "2024-03-01 09:00", value: t("2024-03-01 09:00").toDate() },
|
|
28
|
-
{ label: "2024-03-02 09:00", value: t("2024-03-02 09:00").toDate() }
|
|
29
|
-
]);
|
|
30
|
-
}), test("YYYY-MM-DD HH:mm:ss 형식으로 날짜를 반환한다.", () => {
|
|
31
|
-
const e = a("2024-03-01 09:00:00", "2024-03-02 09:00:00", {
|
|
32
|
-
format: "YYYY-MM-DD HH:mm:ss"
|
|
33
|
-
});
|
|
34
|
-
expect(e).toEqual([
|
|
35
|
-
{ label: "2024-03-01 09:00:00", value: t("2024-03-01 09:00:00").toDate() },
|
|
36
|
-
{ label: "2024-03-02 09:00:00", value: t("2024-03-02 09:00:00").toDate() }
|
|
37
|
-
]);
|
|
38
|
-
}), test("Date 객체를 입력으로 받을 수 있다.", () => {
|
|
39
|
-
const e = t("2024-03-01").toDate(), l = t("2024-03-03").toDate(), o = a(e, l);
|
|
40
|
-
expect(o).toEqual([
|
|
41
|
-
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
42
|
-
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
43
|
-
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
44
|
-
]);
|
|
45
|
-
}), test("Dayjs 객체를 입력으로 받을 수 있다.", () => {
|
|
46
|
-
const e = t("2024-03-01"), l = t("2024-03-03"), o = a(e, l);
|
|
47
|
-
expect(o).toEqual([
|
|
48
|
-
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
49
|
-
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
50
|
-
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
51
|
-
]);
|
|
52
|
-
}), test("Dayjs 객체와 Date 객체를 혼합해서 입력으로 받을 수 있다.", () => {
|
|
53
|
-
const e = t("2024-03-01"), l = t("2024-03-03").toDate(), o = a(e, l);
|
|
54
|
-
expect(o).toEqual([
|
|
55
|
-
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
56
|
-
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
57
|
-
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
58
|
-
]);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import e, { LAMBDA_VERSION as i } from "./getImageUrl.mjs";
|
|
2
|
-
describe("getImageUrl", () => {
|
|
3
|
-
const t = "https://example.com/image.jpg";
|
|
4
|
-
test("기본 옵션으로 URL을 생성한다.", () => {
|
|
5
|
-
expect(e({ src: t, width: 100, height: 200 })).toBe(
|
|
6
|
-
`${t}?v=${i}&fit=cover&position=center&width=200&height=400`
|
|
7
|
-
);
|
|
8
|
-
}), test("disabledResizing이 true일 경우 리사이징 파라미터를 추가하지 않는다.", () => {
|
|
9
|
-
expect(e({ src: t, width: 100, height: 200, disabledResizing: !0 })).toBe(
|
|
10
|
-
`${t}?v=${i}`
|
|
11
|
-
);
|
|
12
|
-
}), test("fit과 position 옵션을 변경하여 URL을 생성한다.", () => {
|
|
13
|
-
expect(e({ src: t, width: 100, height: 200, fit: "contain", position: "top" })).toBe(
|
|
14
|
-
`${t}?v=${i}&fit=contain&position=top&width=200&height=400`
|
|
15
|
-
);
|
|
16
|
-
}), test("scale을 1로 설정하면 원본 크기로 설정된다.", () => {
|
|
17
|
-
expect(e({ src: t, width: 100, height: 200, scale: 1 })).toBe(
|
|
18
|
-
`${t}?v=${i}&fit=cover&position=center&width=100&height=200`
|
|
19
|
-
);
|
|
20
|
-
}), test("width 또는 height가 제공되지 않을 경우 해당 파라미터를 추가하지 않는다.", () => {
|
|
21
|
-
expect(e({ src: t, width: 100 })).toBe(
|
|
22
|
-
`${t}?v=${i}&fit=cover&position=center&width=200`
|
|
23
|
-
), expect(e({ src: t, height: 200 })).toBe(
|
|
24
|
-
`${t}?v=${i}&fit=cover&position=center&height=400`
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import e from "./getTimeRange.mjs";
|
|
2
|
-
describe("getTimeRange", () => {
|
|
3
|
-
test("시작 시간과 종료 시간 사이의 시간을 배열로 반환한다.", () => {
|
|
4
|
-
const l = e(5.5, 10.5);
|
|
5
|
-
expect(l).toEqual([
|
|
6
|
-
{ label: "05:30", value: 5.5 },
|
|
7
|
-
{ label: "06:00", value: 6 },
|
|
8
|
-
{ label: "06:30", value: 6.5 },
|
|
9
|
-
{ label: "07:00", value: 7 },
|
|
10
|
-
{ label: "07:30", value: 7.5 },
|
|
11
|
-
{ label: "08:00", value: 8 },
|
|
12
|
-
{ label: "08:30", value: 8.5 },
|
|
13
|
-
{ label: "09:00", value: 9 },
|
|
14
|
-
{ label: "09:30", value: 9.5 },
|
|
15
|
-
{ label: "10:00", value: 10 },
|
|
16
|
-
{ label: "10:30", value: 10.5 }
|
|
17
|
-
]);
|
|
18
|
-
}), test("시작 시간이 종료 시간보다 크면 빈 배열을 반환한다.", () => {
|
|
19
|
-
expect(e(10.5, 5.5)).toEqual([]);
|
|
20
|
-
}), test("음수 시간이 포함되면 빈 배열을 반환한다.", () => {
|
|
21
|
-
expect(e(-1, 5.5)).toEqual([]), expect(e(5.5, -1)).toEqual([]);
|
|
22
|
-
}), test("step이 0 이하면 빈 배열을 반환한다.", () => {
|
|
23
|
-
expect(e(5.5, 10.5, { step: 0 })).toEqual([]), expect(e(5.5, 10.5, { step: -0.5 })).toEqual([]);
|
|
24
|
-
}), test("minTime과 maxTime을 적용할 수 있다.", () => {
|
|
25
|
-
const l = e(5.5, 10.5, {
|
|
26
|
-
minTime: 6,
|
|
27
|
-
maxTime: 9.5
|
|
28
|
-
});
|
|
29
|
-
expect(l).toEqual([
|
|
30
|
-
{ label: "06:00", value: 6 },
|
|
31
|
-
{ label: "06:30", value: 6.5 },
|
|
32
|
-
{ label: "07:00", value: 7 },
|
|
33
|
-
{ label: "07:30", value: 7.5 },
|
|
34
|
-
{ label: "08:00", value: 8 },
|
|
35
|
-
{ label: "08:30", value: 8.5 },
|
|
36
|
-
{ label: "09:00", value: 9 },
|
|
37
|
-
{ label: "09:30", value: 9.5 }
|
|
38
|
-
]);
|
|
39
|
-
}), test("step을 조정할 수 있다.", () => {
|
|
40
|
-
const l = e(5.5, 7.5, { step: 1 });
|
|
41
|
-
expect(l).toEqual([
|
|
42
|
-
{ label: "05:30", value: 5.5 },
|
|
43
|
-
{ label: "06:30", value: 6.5 },
|
|
44
|
-
{ label: "07:30", value: 7.5 }
|
|
45
|
-
]);
|
|
46
|
-
}), test("pairs 옵션을 사용하면 연속된 시간 쌍을 반환한다.", () => {
|
|
47
|
-
const l = e(8.5, 9.5, { pairs: !0 });
|
|
48
|
-
expect(l).toEqual([
|
|
49
|
-
{ label: "08:30", value: 8.5 },
|
|
50
|
-
// 첫 번째 쌍의 시작 시간
|
|
51
|
-
{ label: "09:00", value: 9 },
|
|
52
|
-
// 첫 번째 쌍의 종료 시간
|
|
53
|
-
{ label: "09:00", value: 9 },
|
|
54
|
-
// 두 번째 쌍의 시작 시간
|
|
55
|
-
{ label: "09:30", value: 9.5 }
|
|
56
|
-
// 두 번째 쌍의 종료 시간
|
|
57
|
-
]);
|
|
58
|
-
}), test("pairs 옵션과 다른 옵션을 함께 사용할 수 있다.", () => {
|
|
59
|
-
const l = e(8.5, 10.5, {
|
|
60
|
-
pairs: !0,
|
|
61
|
-
minTime: 9,
|
|
62
|
-
maxTime: 10
|
|
63
|
-
});
|
|
64
|
-
expect(l).toEqual([
|
|
65
|
-
{ label: "09:00", value: 9 },
|
|
66
|
-
// 첫 번째 쌍의 시작 시간
|
|
67
|
-
{ label: "09:30", value: 9.5 },
|
|
68
|
-
// 첫 번째 쌍의 종료 시간
|
|
69
|
-
{ label: "09:30", value: 9.5 },
|
|
70
|
-
// 두 번째 쌍의 시작 시간
|
|
71
|
-
{ label: "10:00", value: 10 }
|
|
72
|
-
// 두 번째 쌍의 종료 시간
|
|
73
|
-
]);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import e from "./getVimeoId.mjs";
|
|
2
|
-
describe("getVimeoId", (o) => {
|
|
3
|
-
o("유효한 Vimeo URL에서 ID를 추출한다.", () => {
|
|
4
|
-
expect(e("https://vimeo.com/123456789")).toBe(123456789);
|
|
5
|
-
}), o("URL이 비어있으면 0을 반환한다.", () => {
|
|
6
|
-
expect(e("")).toBe(0);
|
|
7
|
-
}), o("Vimeo URL이 아니면 0을 반환한다.", () => {
|
|
8
|
-
expect(e("https://youtube.com/watch?v=abcdef")).toBe(0);
|
|
9
|
-
}), o("ID가 포함되지 않은 Vimeo URL이면 0을 반환한다.", () => {
|
|
10
|
-
expect(e("https://vimeo.com/")).toBe(0);
|
|
11
|
-
}), o("올바르지 않은 URL 형식이면 0을 반환한다.", () => {
|
|
12
|
-
expect(e("")).toBe(0), expect(e(void 0)).toBe(0), expect(e("parent.tictoccroc.com")).toBe(0), expect(e("parent.tictoccroc.com///")).toBe(0), expect(e("tictocisland")).toBe(0);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import e from "./isAndroid.mjs";
|
|
2
|
-
describe("isAndroid", () => {
|
|
3
|
-
afterEach(() => {
|
|
4
|
-
vi.restoreAllMocks();
|
|
5
|
-
}), test("Android userAgent일 때 true를 반환한다.", () => {
|
|
6
|
-
vi.stubGlobal("navigator", { userAgent: "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36" }), expect(e()).toBe(!0);
|
|
7
|
-
}), test("Android가 아닌 userAgent일 때 false를 반환한다.", () => {
|
|
8
|
-
vi.stubGlobal("navigator", {
|
|
9
|
-
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/537.36"
|
|
10
|
-
}), expect(e()).toBe(!1);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import e from "./isApp.mjs";
|
|
2
|
-
describe("isApp", () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
vi.stubGlobal("document", {}), vi.stubGlobal("window", {});
|
|
5
|
-
}), afterEach(() => {
|
|
6
|
-
vi.restoreAllMocks();
|
|
7
|
-
}), test("웹 환경에서는 false를 반환한다.", () => {
|
|
8
|
-
expect(e()).toBe(!1);
|
|
9
|
-
}), test("앱 환경에서는 true를 반환한다.", () => {
|
|
10
|
-
Object.defineProperty(window, "flutter_inappwebview", {
|
|
11
|
-
value: {
|
|
12
|
-
callHandler: () => {
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
configurable: !0
|
|
16
|
-
}), expect(e()).toBe(!0);
|
|
17
|
-
}), test("document가 존재하지 않으면 false를 반환한다.", () => {
|
|
18
|
-
vi.stubGlobal("document", void 0), expect(e()).toBe(!1);
|
|
19
|
-
}), test("window가 존재하지 않으면 false를 반환한다.", () => {
|
|
20
|
-
vi.stubGlobal("window", void 0), expect(e()).toBe(!1);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import e from "./isDesktop.mjs";
|
|
2
|
-
describe("isDesktop", (t) => {
|
|
3
|
-
afterEach(() => {
|
|
4
|
-
vi.restoreAllMocks();
|
|
5
|
-
}), t("모바일 환경인 경우 false를 반환한다.", () => {
|
|
6
|
-
vi.stubGlobal("navigator", { userAgent: "android" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "iphone" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "ipad" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "mobile" }), expect(e()).toBe(!1);
|
|
7
|
-
}), t("데스크탑 환경인 경우 true를 반환한다.", () => {
|
|
8
|
-
vi.stubGlobal("navigator", { userAgent: "windows" }), expect(e()).toBe(!0), vi.stubGlobal("navigator", { userAgent: "mac" }), expect(e()).toBe(!0), vi.stubGlobal("navigator", { userAgent: "linux" }), expect(e()).toBe(!0);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import o from "./isServer.mjs";
|
|
2
|
-
describe("isServer", (e) => {
|
|
3
|
-
afterEach(() => {
|
|
4
|
-
vi.restoreAllMocks();
|
|
5
|
-
}), e("document가 존재하면 false를 반환한다.", () => {
|
|
6
|
-
vi.stubGlobal("document", {}), expect(o()).toBe(!1);
|
|
7
|
-
}), e("document가 존재하지 않으면 true를 반환한다.", () => {
|
|
8
|
-
vi.stubGlobal("document", void 0), expect(o()).toBe(!0);
|
|
9
|
-
}), e("window가 존재하지 않으면 true를 반환한다.", () => {
|
|
10
|
-
vi.stubGlobal("window", void 0), expect(o()).toBe(!0);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import e from "./objectToQueryString.mjs";
|
|
2
|
-
describe("convertObjectToQueryString", (t) => {
|
|
3
|
-
t("object 타입이 들어왔을 때 query string으로 변환한다.", () => {
|
|
4
|
-
const c = { a: 1, b: !0, c: "test", d: void 0, e: null, f: { fa: 1 } };
|
|
5
|
-
expect(e(c)).toEqual(
|
|
6
|
-
"?a=1&b=true&c=test&d=undefined&e=null&f=%5Bobject+Object%5D"
|
|
7
|
-
);
|
|
8
|
-
}), t("변환할 수 없는 타입이 들어온 경우 빈 문자열을 반환한다.", () => {
|
|
9
|
-
expect(e(null)).toEqual(""), expect(e(void 0)).toEqual("");
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import e from "./parseQueryString.mjs";
|
|
2
|
-
describe("parseQueryStrings", (a) => {
|
|
3
|
-
a("단일 키:값 쌍을 넘겼을 떄 Object를 리턴한다.", () => {
|
|
4
|
-
expect(e("key=value")).toEqual({ key: "value" });
|
|
5
|
-
}), a("두 개 이상의 키:값 쌍을 넘겼을 때 Object를 리턴한다.", () => {
|
|
6
|
-
expect(e("key1=value1&key2=value2")).toEqual({
|
|
7
|
-
key1: "value1",
|
|
8
|
-
key2: "value2"
|
|
9
|
-
});
|
|
10
|
-
}), a("빈 값을 넘겼을 때 빈 Object를 리턴한다.", () => {
|
|
11
|
-
expect(e()).toEqual({}), expect(e(void 0)).toEqual({}), expect(e("")).toEqual({});
|
|
12
|
-
}), a("유효하지 않은 값을 넘겼을 때에도 Object를 리턴한다.", () => {
|
|
13
|
-
expect(e("key=")).toEqual({ key: "" }), expect(e("key")).toEqual({ key: "" }), expect(e("=value")).toEqual({ "": "value" });
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import o from "./share.mjs";
|
|
2
|
-
describe("share", () => {
|
|
3
|
-
const a = { title: "test", text: "test", url: "test" }, t = vi.fn(() => !0), e = vi.fn(() => !0), r = vi.fn(async () => !0).mockResolvedValue(!0);
|
|
4
|
-
afterEach(() => {
|
|
5
|
-
vi.restoreAllMocks();
|
|
6
|
-
}), test("navigator에 canShare가 없는 경우 onError를 호출한다.", () => {
|
|
7
|
-
vi.stubGlobal("window", { navigator: { share: r } }), o(a, { onError: e }), expect(e).toHaveBeenCalledTimes(1);
|
|
8
|
-
}), test("navigator.canShare가 false를 반환하는 경우 onError를 호출한다.", () => {
|
|
9
|
-
vi.stubGlobal("window", {
|
|
10
|
-
navigator: {
|
|
11
|
-
canShare: () => !1,
|
|
12
|
-
share: r
|
|
13
|
-
}
|
|
14
|
-
}), o(a, { onError: e }), expect(e).toHaveBeenCalledTimes(1);
|
|
15
|
-
}), test("navigator.canShare가 true를 반환하는 경우 navigator.share를 호출하고 onSuccess를 실행한다.", async () => {
|
|
16
|
-
vi.stubGlobal("window", {
|
|
17
|
-
navigator: {
|
|
18
|
-
canShare: () => !0,
|
|
19
|
-
share: r
|
|
20
|
-
}
|
|
21
|
-
}), await o(a, { onSuccess: t, onError: e }), expect(r).toHaveBeenCalledWith(a), expect(t).toHaveBeenCalledTimes(1), expect(e).not.toHaveBeenCalled();
|
|
22
|
-
}), test("navigator.share가 실패하면 onSucces를 호출하지 않는다.", async () => {
|
|
23
|
-
const n = vi.fn().mockRejectedValue(new Error("Share failed"));
|
|
24
|
-
vi.stubGlobal("window", {
|
|
25
|
-
navigator: {
|
|
26
|
-
canShare: () => !0,
|
|
27
|
-
share: n
|
|
28
|
-
}
|
|
29
|
-
}), await o(a, { onSuccess: t, onError: e }), expect(t).not.toHaveBeenCalled();
|
|
30
|
-
});
|
|
31
|
-
});
|