@dotss/tictoccroc 0.0.0 → 0.0.2
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/LessonNotesSection-a2QNdQtj.js +196 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +109 -52
- package/dist/shared/components/Calendar/Calendar.d.ts +3 -2
- package/dist/shared/components/Calendar/Calendar.mjs +1 -1
- package/dist/shared/components/Carousel/Carousel.d.ts +1 -1
- package/dist/shared/components/Carousel/Carousel.mjs +13 -13
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.d.ts +1 -1
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +1 -1
- package/dist/shared/components/Image/Image.d.ts +1 -1
- package/dist/shared/components/Image/Image.mjs +94 -93
- package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.mjs +12 -26
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.mjs +77 -98
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs +4 -4
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs +4 -4
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs +1 -1
- package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.d.ts +7 -0
- package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs +19 -0
- package/dist/shared/components/LoadingAnnouncer/index.d.ts +3 -0
- package/dist/shared/components/LoadingAnnouncer/index.mjs +4 -0
- package/dist/shared/components/Masonry/Masonry.d.ts +12 -0
- package/dist/shared/components/Masonry/Masonry.mjs +220 -0
- package/dist/shared/components/Masonry/Masonry.utils.d.ts +7 -0
- package/dist/shared/components/Masonry/Masonry.utils.mjs +76 -0
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +11 -0
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +77 -0
- package/dist/shared/components/Masonry/MasonryBlock/index.d.ts +3 -0
- package/dist/shared/components/Masonry/MasonryBlock/index.mjs +4 -0
- package/dist/shared/components/Masonry/index.d.ts +4 -0
- package/dist/shared/components/Masonry/index.mjs +6 -0
- package/dist/shared/components/Roller/Roller.d.ts +1 -2
- package/dist/shared/components/Roller/Roller.mjs +7 -120
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.d.ts +1 -1
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +1 -1
- package/dist/shared/components/Roller/index.mjs +3 -3
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.d.ts +2 -5
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +1 -1
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.d.ts +1 -1
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +2 -2
- package/dist/shared/components/Scheduler/Scheduler.d.ts +4 -4
- package/dist/shared/components/Scheduler/Scheduler.mjs +167 -178
- package/dist/shared/components/Swiper/Swiper.d.ts +1 -1
- package/dist/shared/components/Swiper/Swiper.mjs +77 -97
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.d.ts +1 -1
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +1 -1
- package/dist/shared/components/TimePicker/TimePicker.d.ts +2 -2
- package/dist/shared/components/TimePicker/TimePicker.mjs +1 -1
- package/dist/shared/components/index.d.ts +14 -1
- package/dist/shared/components/index.mjs +40 -28
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +9 -10
- package/dist/shared/utils/getDateRange/getDateRange.d.ts +1 -1
- package/dist/shared/utils/getDateRange/getDateRange.test.mjs +27 -28
- package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +19 -20
- package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +22 -23
- package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +11 -12
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.mjs +6 -4
- package/dist/shared/utils/isAndroid/isAndroid.test.mjs +9 -10
- package/dist/shared/utils/isApp/isApp.test.mjs +14 -15
- package/dist/shared/utils/isDesktop/isDesktop.test.mjs +8 -9
- package/dist/shared/utils/isServer/isServer.test.mjs +10 -11
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +7 -7
- package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +10 -11
- package/dist/shared/utils/share/index.d.ts +2 -0
- package/dist/shared/utils/share/index.mjs +4 -0
- package/dist/shared/utils/share/share.d.ts +9 -0
- package/dist/shared/utils/share/share.mjs +15 -0
- package/dist/shared/utils/share/share.test.d.ts +1 -0
- package/dist/shared/utils/share/share.test.mjs +31 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.d.ts +15 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +441 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.d.ts +3 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.mjs +5 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.d.ts +6 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +111 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.d.ts +6 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +43 -0
- package/dist/teacher/profile/components/AbilityCollection/index.d.ts +5 -0
- package/dist/teacher/profile/components/AbilityCollection/index.mjs +8 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.d.ts +11 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +101 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts +8 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +124 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.mjs +4 -0
- package/dist/teacher/profile/components/ActivityGallery/index.d.ts +4 -0
- package/dist/teacher/profile/components/ActivityGallery/index.mjs +6 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.d.ts +22 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +179 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/index.d.ts +3 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/index.mjs +4 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.d.ts +10 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +136 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/index.mjs +4 -0
- package/dist/teacher/profile/components/CareerSection/CareerSection.d.ts +9 -0
- package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +185 -0
- package/dist/teacher/profile/components/CareerSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/CareerSection/index.mjs +6 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.d.ts +8 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +91 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/index.mjs +4 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationSection.d.ts +9 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationSection.mjs +152 -0
- package/dist/teacher/profile/components/CertificationSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/CertificationSection/index.mjs +6 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.d.ts +9 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +105 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/index.mjs +4 -0
- package/dist/teacher/profile/components/EducationSection/EducationSection.d.ts +9 -0
- package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +152 -0
- package/dist/teacher/profile/components/EducationSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/EducationSection/index.mjs +6 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.d.ts +9 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs +54 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/index.d.ts +3 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/index.mjs +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.d.ts +7 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +8 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.utils.d.ts +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.utils.mjs +13 -0
- package/dist/teacher/profile/components/LessonNotesSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/index.mjs +6 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.d.ts +10 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs +103 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.d.ts +3 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.d.ts +7 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +79 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.d.ts +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs +13 -0
- package/dist/teacher/profile/components/ParentReviewSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/index.mjs +6 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.d.ts +9 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs +37 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.d.ts +3 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.mjs +4 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.d.ts +8 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs +32 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.d.ts +18 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +14 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/index.d.ts +4 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/index.mjs +6 -0
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.d.ts +25 -1
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +413 -5
- package/dist/teacher/profile/components/ProfileSummary/index.d.ts +2 -1
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.d.ts +7 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +105 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.d.ts +3 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.mjs +4 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.d.ts +6 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs +28 -0
- package/dist/teacher/profile/components/StatBadgeCollection/index.d.ts +4 -0
- package/dist/teacher/profile/components/StatBadgeCollection/index.mjs +6 -0
- package/dist/teacher/profile/components/index.d.ts +24 -0
- package/dist/teacher/profile/components/index.mjs +46 -0
- package/package.json +2 -2
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Flexbox as
|
|
1
|
+
import { jsxs as Z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as f, Children as P, isValidElement as G, useEffect as k, cloneElement as I } from "react";
|
|
3
|
+
import { Flexbox as K } from "@dotss/ui";
|
|
4
4
|
import { createSwipeEvent as b } from "./Swiper.utils.mjs";
|
|
5
5
|
import U from "./SwiperBlock/SwiperBlock.mjs";
|
|
6
|
-
function
|
|
7
|
-
children:
|
|
8
|
-
initialPage:
|
|
6
|
+
function dr({
|
|
7
|
+
children: j,
|
|
8
|
+
initialPage: p = 0,
|
|
9
9
|
onSwipe: u,
|
|
10
|
-
onSwiping:
|
|
11
|
-
loop:
|
|
10
|
+
onSwiping: D,
|
|
11
|
+
loop: y = !1,
|
|
12
12
|
disableSwipe: O = !1,
|
|
13
|
-
renderPagination:
|
|
13
|
+
renderPagination: q,
|
|
14
14
|
inlineCSS: S,
|
|
15
15
|
...w
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
!t.current || !$ || (N.current = t.current.style.transform, W.current = r, X.current = r + t.current.offsetWidth * (l + 1),
|
|
17
|
+
const [R, C] = _(p), [s, rr] = _(0), t = f(null), X = f(0), W = f(0), B = f(0), Y = f(0), o = f(!1), d = f(!0), N = f(""), n = f(p), H = f(!1), i = f(null), E = P.count(j), m = P.toArray(j).filter(G).filter((r) => r.type === U), $ = E > 1 && !O, tr = P.toArray(m == null ? void 0 : m[0]).filter(G).filter((r) => r.type === U), er = P.toArray(m == null ? void 0 : m[(m == null ? void 0 : m.length) - 1]).filter(G).filter((r) => r.type === U), J = (r, e, l) => {
|
|
18
|
+
!t.current || !$ || (N.current = t.current.style.transform, W.current = r, X.current = r + t.current.offsetWidth * (l + 1), B.current = e);
|
|
19
19
|
}, M = (r, e, l) => {
|
|
20
20
|
if (!t.current || !$ || !o.current || !d.current)
|
|
21
21
|
return;
|
|
22
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 ||
|
|
24
|
-
if (Math.abs(
|
|
23
|
+
const a = e || R, c = l || X.current - t.current.offsetWidth * (a + 1) - r, g = t.current.offsetWidth * 0.1;
|
|
24
|
+
if (Math.abs(c) < g && !e) {
|
|
25
25
|
t.current.style.transform = N.current, o.current = !1, d.current = !0, u == null || u(
|
|
26
26
|
b({
|
|
27
27
|
realPage: n.current,
|
|
28
|
-
totalPages:
|
|
28
|
+
totalPages: s,
|
|
29
29
|
lastPage: n.current,
|
|
30
30
|
isLoop: !1
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
n.current =
|
|
38
|
-
b({ realPage: n.current, totalPages:
|
|
35
|
+
const A = c <= -g && a - 1 < 0, x = c >= g && a + 1 === s, F = c >= g && a + 1 < s, z = c <= -g && a - 1 >= 0;
|
|
36
|
+
if (A) {
|
|
37
|
+
n.current = s - 1, u == null || u(
|
|
38
|
+
b({ realPage: n.current, totalPages: s, lastPage: 0, isLoop: !0 })
|
|
39
39
|
), t.current.style.transform = "translate3d(0, 0, 0)", i.current = (T) => {
|
|
40
|
-
var
|
|
40
|
+
var h, v, L;
|
|
41
41
|
if (T.propertyName === "transform") {
|
|
42
42
|
if (!t.current) return;
|
|
43
|
-
t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${
|
|
43
|
+
t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${s}), 0, 0)`, C(s - 1), o.current = !1, d.current = !0, (L = (v = (h = t.current) == null ? void 0 : h.children) == null ? void 0 : v[s]) == null || L.focus();
|
|
44
44
|
}
|
|
45
45
|
}, t.current.addEventListener("transitionend", i.current);
|
|
46
46
|
return;
|
|
47
|
-
} else if (
|
|
47
|
+
} else if (x) {
|
|
48
48
|
n.current = 0, u == null || u(
|
|
49
49
|
b({
|
|
50
50
|
realPage: n.current,
|
|
51
|
-
totalPages:
|
|
52
|
-
lastPage:
|
|
51
|
+
totalPages: s,
|
|
52
|
+
lastPage: s - 1,
|
|
53
53
|
isLoop: !0
|
|
54
54
|
})
|
|
55
55
|
), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`, i.current = (T) => {
|
|
56
|
-
var
|
|
56
|
+
var h, v, L;
|
|
57
57
|
if (T.propertyName === "transform") {
|
|
58
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, (
|
|
59
|
+
t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", C(0), o.current = !1, d.current = !0, (L = (v = (h = t.current) == null ? void 0 : h.children) == null ? void 0 : v[1]) == null || L.focus();
|
|
60
60
|
}
|
|
61
61
|
}, t.current.addEventListener("transitionend", i.current);
|
|
62
62
|
return;
|
|
@@ -64,39 +64,39 @@ function hr({
|
|
|
64
64
|
F ? (n.current = a + 1, u == null || u(
|
|
65
65
|
b({
|
|
66
66
|
realPage: n.current,
|
|
67
|
-
totalPages:
|
|
67
|
+
totalPages: s,
|
|
68
68
|
lastPage: a,
|
|
69
69
|
isLoop: !0
|
|
70
70
|
})
|
|
71
|
-
), C(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`) :
|
|
71
|
+
), C(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`) : z ? (n.current = a - 1, u == null || u(
|
|
72
72
|
b({
|
|
73
73
|
realPage: n.current,
|
|
74
|
-
totalPages:
|
|
74
|
+
totalPages: s,
|
|
75
75
|
lastPage: a,
|
|
76
76
|
isLoop: !1
|
|
77
77
|
})
|
|
78
78
|
), C(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a}), 0, 0)`) : (u == null || u(
|
|
79
79
|
b({
|
|
80
80
|
realPage: n.current,
|
|
81
|
-
totalPages:
|
|
81
|
+
totalPages: s,
|
|
82
82
|
lastPage: n.current,
|
|
83
83
|
isLoop: !1
|
|
84
84
|
})
|
|
85
85
|
), t.current.style.transform = N.current), i.current = (T) => {
|
|
86
|
-
var
|
|
86
|
+
var h;
|
|
87
87
|
if (T.propertyName === "transform") {
|
|
88
88
|
o.current = !1, d.current = !0;
|
|
89
|
-
const v = Array.from(((
|
|
90
|
-
(
|
|
89
|
+
const v = Array.from(((h = t.current) == null ? void 0 : h.children) ?? []).find(
|
|
90
|
+
(L) => L.getAttribute("aria-current") === "page"
|
|
91
91
|
);
|
|
92
92
|
v && v.focus();
|
|
93
93
|
}
|
|
94
94
|
}, t.current.addEventListener("transitionend", i.current);
|
|
95
95
|
}, nr = (r) => {
|
|
96
|
-
o.current = !0,
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
},
|
|
96
|
+
o.current = !0, J(r.clientX, r.clientY, n.current);
|
|
97
|
+
}, Q = (r) => M(r.clientX), cr = (r) => {
|
|
98
|
+
J(r.touches[0].clientX, r.touches[0].clientY, n.current);
|
|
99
|
+
}, V = (r) => M(r.changedTouches[0].clientX), sr = (r) => {
|
|
100
100
|
o.current = !0;
|
|
101
101
|
const e = r - 1;
|
|
102
102
|
C(e <= 0 ? 0 : e), M(0, r);
|
|
@@ -105,16 +105,16 @@ function hr({
|
|
|
105
105
|
switch (e.key) {
|
|
106
106
|
case "ArrowRight": {
|
|
107
107
|
if (e.preventDefault(), o.current || !d.current) return;
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
108
|
+
const c = n.current === s - 1;
|
|
109
|
+
if (!y && c)
|
|
110
110
|
return;
|
|
111
111
|
o.current = !0, M(0, n.current, (((l = t.current) == null ? void 0 : l.offsetWidth) ?? 0) * 0.1);
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
case "ArrowLeft": {
|
|
115
115
|
if (e.preventDefault(), o.current || !d.current) return;
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
116
|
+
const c = n.current === 0;
|
|
117
|
+
if (!y && c)
|
|
118
118
|
return;
|
|
119
119
|
o.current = !0, M(0, n.current, -((((a = t.current) == null ? void 0 : a.offsetWidth) ?? 0) * 0.1));
|
|
120
120
|
break;
|
|
@@ -131,36 +131,36 @@ function hr({
|
|
|
131
131
|
r == null || r(e);
|
|
132
132
|
};
|
|
133
133
|
return k(() => {
|
|
134
|
-
const r = t.current, e = (
|
|
134
|
+
const r = t.current, e = (c, g, A) => {
|
|
135
135
|
if (!t.current || !$ || !d.current) return;
|
|
136
|
-
Y.current =
|
|
137
|
-
const
|
|
138
|
-
if (o.current = o.current || Math.abs(Y.current) >
|
|
139
|
-
const F = W.current <
|
|
140
|
-
if (!
|
|
136
|
+
Y.current = c - X.current;
|
|
137
|
+
const x = 5;
|
|
138
|
+
if (o.current = o.current || Math.abs(Y.current) > x && Math.abs(g - B.current) < x, o.current) {
|
|
139
|
+
const F = W.current < c, z = W.current > c;
|
|
140
|
+
if (!y && F && n.current === 0) {
|
|
141
141
|
o.current = !1;
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
if (!
|
|
144
|
+
if (!y && z && n.current === s - 1) {
|
|
145
145
|
o.current = !1;
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
A.cancelable && A.preventDefault(), D == null || D(
|
|
149
149
|
b({
|
|
150
150
|
realPage: n.current,
|
|
151
|
-
totalPages:
|
|
151
|
+
totalPages: s,
|
|
152
152
|
lastPage: n.current,
|
|
153
153
|
isLoop: !1
|
|
154
154
|
})
|
|
155
155
|
), t.current.style.transition = "none", t.current.style.cursor = "grabbing", t.current.style.transform = `translate3d(${Y.current}px, 0, 0)`;
|
|
156
156
|
}
|
|
157
|
-
}, l = (
|
|
158
|
-
o.current && e(
|
|
159
|
-
}, a = (
|
|
157
|
+
}, l = (c) => {
|
|
158
|
+
o.current && e(c.clientX, c.clientY, c);
|
|
159
|
+
}, a = (c) => e(c.touches[0].clientX, c.touches[0].clientY, c);
|
|
160
160
|
return r && (r.addEventListener("mousemove", l), r.addEventListener("touchmove", a)), () => {
|
|
161
161
|
r && (r.removeEventListener("mousemove", l), r.removeEventListener("touchmove", a));
|
|
162
162
|
};
|
|
163
|
-
}, [$,
|
|
163
|
+
}, [$, D, y, s]), k(() => {
|
|
164
164
|
const r = t.current, e = (l) => {
|
|
165
165
|
d.current || l.stopPropagation();
|
|
166
166
|
};
|
|
@@ -175,12 +175,12 @@ function hr({
|
|
|
175
175
|
}, []), k(() => {
|
|
176
176
|
rr(E);
|
|
177
177
|
}, [E]), k(() => {
|
|
178
|
-
t.current && !
|
|
179
|
-
}, [
|
|
180
|
-
|
|
178
|
+
t.current && !H.current && (H.current = !0, t.current.style.transform = `translate3d(calc(-100% * ${E < p + 1 ? E : p + 1}), 0, 0)`);
|
|
179
|
+
}, [p, E]), /* @__PURE__ */ Z(
|
|
180
|
+
K,
|
|
181
181
|
{
|
|
182
182
|
flexGrow: 1,
|
|
183
|
-
role: "
|
|
183
|
+
role: "list",
|
|
184
184
|
"aria-roledescription": "carousel",
|
|
185
185
|
"aria-label": "슬라이더",
|
|
186
186
|
...w,
|
|
@@ -190,23 +190,23 @@ function hr({
|
|
|
190
190
|
...S
|
|
191
191
|
},
|
|
192
192
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
|
|
193
|
+
/* @__PURE__ */ Z(
|
|
194
|
+
K,
|
|
195
195
|
{
|
|
196
196
|
ref: t,
|
|
197
197
|
flexGrow: 1,
|
|
198
198
|
onMouseDown: nr,
|
|
199
|
-
onMouseUp:
|
|
200
|
-
onMouseLeave:
|
|
199
|
+
onMouseUp: Q,
|
|
200
|
+
onMouseLeave: Q,
|
|
201
201
|
onTouchStart: cr,
|
|
202
|
-
onTouchEnd:
|
|
203
|
-
onTouchCancel:
|
|
202
|
+
onTouchEnd: V,
|
|
203
|
+
onTouchCancel: V,
|
|
204
204
|
inlineCSS: {
|
|
205
205
|
"& > div:first-of-type": {
|
|
206
|
-
visibility:
|
|
206
|
+
visibility: y ? "visible" : "hidden"
|
|
207
207
|
},
|
|
208
208
|
"& > div:last-of-type": {
|
|
209
|
-
visibility:
|
|
209
|
+
visibility: y ? "visible" : "hidden"
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
212
|
style: {
|
|
@@ -217,58 +217,38 @@ function hr({
|
|
|
217
217
|
children: [
|
|
218
218
|
P.map(
|
|
219
219
|
er,
|
|
220
|
-
(r) =>
|
|
220
|
+
(r) => I(r, {
|
|
221
221
|
"aria-hidden": !0
|
|
222
222
|
})
|
|
223
223
|
),
|
|
224
|
-
|
|
225
|
-
(r, e) =>
|
|
226
|
-
role: "
|
|
227
|
-
tabIndex: e ===
|
|
224
|
+
m.map(
|
|
225
|
+
(r, e) => I(r, {
|
|
226
|
+
role: "listitem",
|
|
227
|
+
tabIndex: e === R ? 0 : -1,
|
|
228
228
|
onKeyDown: ur(r.props.onKeyDown),
|
|
229
229
|
"aria-roledescription": "slide",
|
|
230
|
-
"aria-hidden": e !==
|
|
231
|
-
"aria-current": e ===
|
|
232
|
-
"aria-label": `${
|
|
230
|
+
"aria-hidden": e !== R,
|
|
231
|
+
"aria-current": e === R ? "page" : void 0,
|
|
232
|
+
"aria-label": `${s}개 중 ${e + 1}번째 슬라이드`,
|
|
233
233
|
"aria-posinset": e + 1,
|
|
234
|
-
"aria-setsize":
|
|
234
|
+
"aria-setsize": s,
|
|
235
235
|
...r.props
|
|
236
236
|
})
|
|
237
237
|
),
|
|
238
238
|
P.map(
|
|
239
239
|
tr,
|
|
240
|
-
(r) =>
|
|
240
|
+
(r) => I(r, {
|
|
241
241
|
"aria-hidden": !0
|
|
242
242
|
})
|
|
243
243
|
)
|
|
244
244
|
]
|
|
245
245
|
}
|
|
246
246
|
),
|
|
247
|
-
typeof
|
|
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
|
-
)
|
|
247
|
+
typeof q == "function" && q({ page: R, totalPages: s, onChange: sr })
|
|
268
248
|
]
|
|
269
249
|
}
|
|
270
250
|
);
|
|
271
251
|
}
|
|
272
252
|
export {
|
|
273
|
-
|
|
253
|
+
dr as default
|
|
274
254
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlexboxProps } from 'node_modules/@
|
|
1
|
+
import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
|
|
2
2
|
export type SwiperBlockProps = FlexboxProps;
|
|
3
3
|
declare function SwiperBlock({ children, ...props }: SwiperBlockProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default SwiperBlock;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ChainPicker } from '@
|
|
3
|
-
import { FlexboxProps } from 'node_modules/@
|
|
2
|
+
import { ChainPicker } from '@dotss/ui';
|
|
3
|
+
import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
|
|
4
4
|
export interface TimePickerItem {
|
|
5
5
|
label: string;
|
|
6
6
|
value: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as R, jsx as c } from "react/jsx-runtime";
|
|
2
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 "@
|
|
3
|
+
import { ChainPicker as I, Typography as S, Flexbox as Q } from "@dotss/ui";
|
|
4
4
|
import z from "@emotion/styled";
|
|
5
5
|
import b from "../../utils/getTimeRange/getTimeRange.mjs";
|
|
6
6
|
const U = z.div`
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
export { default as Scheduler } from './Scheduler';
|
|
2
|
+
export { default as ImageZoomDialog } from './ImageZoomDialog';
|
|
3
|
+
export { default as Swiper } from './Swiper';
|
|
4
|
+
export { default as Carousel } from './Carousel';
|
|
5
|
+
export { default as TimePicker } from './TimePicker';
|
|
6
|
+
export { default as Roller } from './Roller';
|
|
7
|
+
export { default as Image } from './Image';
|
|
8
|
+
export { default as Calendar } from './Calendar';
|
|
9
|
+
export { default as Masonry } from './Masonry';
|
|
10
|
+
export { default as LoadingAnnouncer } from './LoadingAnnouncer';
|
|
1
11
|
export * from './Scheduler';
|
|
2
12
|
export * from './ImageZoomDialog';
|
|
3
|
-
export * from './Image';
|
|
4
13
|
export * from './Swiper';
|
|
5
14
|
export * from './Carousel';
|
|
6
15
|
export * from './TimePicker';
|
|
7
16
|
export * from './Roller';
|
|
17
|
+
export * from './Image';
|
|
18
|
+
export * from './Calendar';
|
|
19
|
+
export * from './Masonry';
|
|
20
|
+
export * from './LoadingAnnouncer';
|
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import "./Scheduler/Scheduler.mjs";
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { getAvailableDateRange as
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "./
|
|
12
|
-
import "
|
|
13
|
-
import { default as
|
|
14
|
-
import {
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import "./
|
|
19
|
-
import { default as
|
|
1
|
+
import { default as a } from "./Scheduler/Scheduler.mjs";
|
|
2
|
+
import { default as t } from "./Scheduler/ScheduleEvent/ScheduleEvent.mjs";
|
|
3
|
+
import { default as f } from "./Scheduler/ScheduleBlock/ScheduleBlock.mjs";
|
|
4
|
+
import { getAvailableDateRange as d } from "./Scheduler/Scheduler.utils.mjs";
|
|
5
|
+
import { default as s } from "./ImageZoomDialog/ImageZoomDialog.mjs";
|
|
6
|
+
import { default as x } from "./ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs";
|
|
7
|
+
import { default as i } from "./ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs";
|
|
8
|
+
import { default as c } from "./ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs";
|
|
9
|
+
import { default as k } from "./Swiper/Swiper.mjs";
|
|
10
|
+
import { default as I } from "./Swiper/SwiperBlock/SwiperBlock.mjs";
|
|
11
|
+
import { default as C } from "./Carousel/Carousel.mjs";
|
|
12
|
+
import { default as Z } from "./Carousel/CarouselSlide/CarouselSlide.mjs";
|
|
13
|
+
import { default as b } from "./TimePicker/TimePicker.mjs";
|
|
14
|
+
import { R as w } from "../../LessonNotesSection-a2QNdQtj.js";
|
|
15
|
+
import { default as A } from "./Roller/RollerBlock/RollerBlock.mjs";
|
|
16
|
+
import { default as T } from "./Image/Image.mjs";
|
|
17
|
+
import { default as F } from "./Calendar/Calendar.mjs";
|
|
18
|
+
import { default as P } from "./Masonry/Masonry.mjs";
|
|
19
|
+
import { default as q } from "./Masonry/MasonryBlock/MasonryBlock.mjs";
|
|
20
|
+
import { default as G } from "./LoadingAnnouncer/LoadingAnnouncer.mjs";
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Z as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
F as Calendar,
|
|
23
|
+
C as Carousel,
|
|
24
|
+
Z as CarouselSlide,
|
|
25
|
+
T as Image,
|
|
26
|
+
s as ImageZoomDialog,
|
|
27
|
+
x as ImageZoomDialogContent,
|
|
28
|
+
i as ImageZoomDialogFooter,
|
|
29
|
+
c as ImageZoomDialogToolbar,
|
|
30
|
+
G as LoadingAnnouncer,
|
|
31
|
+
P as Masonry,
|
|
32
|
+
q as MasonryBlock,
|
|
33
|
+
w as Roller,
|
|
34
|
+
A as RollerBlock,
|
|
35
|
+
f as ScheduleBlock,
|
|
36
|
+
t as ScheduleEvent,
|
|
37
|
+
a as Scheduler,
|
|
38
|
+
k as Swiper,
|
|
39
|
+
I as SwiperBlock,
|
|
40
|
+
b as TimePicker,
|
|
41
|
+
d as getAvailableDateRange
|
|
30
42
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
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);
|
|
11
10
|
});
|
|
12
11
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { DateValue } from '@dotss/ui/DatePicker';
|
|
1
2
|
import { Dayjs } from 'dayjs';
|
|
2
|
-
import { DateValue } from 'node_modules/@thedotscorp/ui/DatePicker/DatePicker';
|
|
3
3
|
interface DateRangeOptions {
|
|
4
4
|
format?: 'YYYY-MM-DD' | 'YYYY-MM-DD HH:mm' | 'YYYY-MM-DD HH:mm:ss' | 'YYYY-MM';
|
|
5
5
|
}
|
|
@@ -1,58 +1,57 @@
|
|
|
1
1
|
import t from "dayjs";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
e(a).toEqual([
|
|
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([
|
|
8
7
|
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
9
8
|
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
10
9
|
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
11
10
|
]);
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
}),
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
const
|
|
18
|
-
e
|
|
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([
|
|
19
18
|
{ label: "2024-01", value: t("2024-01-01").toDate() },
|
|
20
19
|
{ label: "2024-02", value: t("2024-02-01").toDate() },
|
|
21
20
|
{ label: "2024-03", value: t("2024-03-01").toDate() }
|
|
22
21
|
]);
|
|
23
|
-
}),
|
|
24
|
-
const
|
|
22
|
+
}), test("YYYY-MM-DD HH:mm 형식으로 날짜를 반환한다.", () => {
|
|
23
|
+
const e = a("2024-03-01 09:00", "2024-03-02 09:00", {
|
|
25
24
|
format: "YYYY-MM-DD HH:mm"
|
|
26
25
|
});
|
|
27
|
-
e
|
|
26
|
+
expect(e).toEqual([
|
|
28
27
|
{ label: "2024-03-01 09:00", value: t("2024-03-01 09:00").toDate() },
|
|
29
28
|
{ label: "2024-03-02 09:00", value: t("2024-03-02 09:00").toDate() }
|
|
30
29
|
]);
|
|
31
|
-
}),
|
|
32
|
-
const
|
|
30
|
+
}), test("YYYY-MM-DD HH:mm:ss 형식으로 날짜를 반환한다.", () => {
|
|
31
|
+
const e = a("2024-03-01 09:00:00", "2024-03-02 09:00:00", {
|
|
33
32
|
format: "YYYY-MM-DD HH:mm:ss"
|
|
34
33
|
});
|
|
35
|
-
e
|
|
34
|
+
expect(e).toEqual([
|
|
36
35
|
{ label: "2024-03-01 09:00:00", value: t("2024-03-01 09:00:00").toDate() },
|
|
37
36
|
{ label: "2024-03-02 09:00:00", value: t("2024-03-02 09:00:00").toDate() }
|
|
38
37
|
]);
|
|
39
|
-
}),
|
|
40
|
-
const
|
|
41
|
-
|
|
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([
|
|
42
41
|
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
43
42
|
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
44
43
|
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
45
44
|
]);
|
|
46
|
-
}),
|
|
47
|
-
const
|
|
48
|
-
|
|
45
|
+
}), test("Dayjs 객체를 입력으로 받을 수 있다.", () => {
|
|
46
|
+
const e = t("2024-03-01"), l = t("2024-03-03"), o = a(e, l);
|
|
47
|
+
expect(o).toEqual([
|
|
49
48
|
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
50
49
|
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
51
50
|
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
52
51
|
]);
|
|
53
|
-
}),
|
|
54
|
-
const
|
|
55
|
-
|
|
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([
|
|
56
55
|
{ label: "2024-03-01", value: t("2024-03-01").toDate() },
|
|
57
56
|
{ label: "2024-03-02", value: t("2024-03-02").toDate() },
|
|
58
57
|
{ label: "2024-03-03", value: t("2024-03-03").toDate() }
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
g("getImageUrl", () => {
|
|
1
|
+
import e, { LAMBDA_VERSION as i } from "./getImageUrl.mjs";
|
|
2
|
+
describe("getImageUrl", () => {
|
|
4
3
|
const t = "https://example.com/image.jpg";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`${t}?v=${
|
|
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`
|
|
8
7
|
);
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
`${t}?v=${
|
|
8
|
+
}), test("disabledResizing이 true일 경우 리사이징 파라미터를 추가하지 않는다.", () => {
|
|
9
|
+
expect(e({ src: t, width: 100, height: 200, disabledResizing: !0 })).toBe(
|
|
10
|
+
`${t}?v=${i}`
|
|
12
11
|
);
|
|
13
|
-
}),
|
|
14
|
-
|
|
15
|
-
`${t}?v=${
|
|
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`
|
|
16
15
|
);
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
`${t}?v=${
|
|
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`
|
|
20
19
|
);
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
`${t}?v=${
|
|
24
|
-
),
|
|
25
|
-
`${t}?v=${
|
|
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`
|
|
26
25
|
);
|
|
27
26
|
});
|
|
28
27
|
});
|