@dotss/tictoccroc 0.0.3 → 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.
Files changed (30) hide show
  1. package/dist/index.mjs +78 -77
  2. package/dist/shared/components/Masonry/Masonry.mjs +111 -103
  3. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +1 -1
  4. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +103 -86
  5. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +1 -1
  6. package/dist/shared/components/MediaDialog/MediaDialog.mjs +121 -118
  7. package/dist/shared/components/Roller/Roller.mjs +131 -7
  8. package/dist/shared/components/Roller/index.mjs +3 -3
  9. package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +1 -1
  10. package/dist/shared/components/Swiper/Swiper.mjs +1 -1
  11. package/dist/shared/components/index.mjs +3 -3
  12. package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +1 -1
  13. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +1 -1
  14. package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +79 -6
  15. package/dist/teacher/profile/components/LessonNotesSection/index.mjs +3 -3
  16. package/dist/teacher/profile/components/index.mjs +5 -5
  17. package/package.json +2 -2
  18. package/dist/LessonNotesSection-Bg1DHFxg.js +0 -208
  19. package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +0 -11
  20. package/dist/shared/utils/getDateRange/getDateRange.test.mjs +0 -60
  21. package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +0 -27
  22. package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +0 -75
  23. package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +0 -14
  24. package/dist/shared/utils/isAndroid/isAndroid.test.mjs +0 -12
  25. package/dist/shared/utils/isApp/isApp.test.mjs +0 -22
  26. package/dist/shared/utils/isDesktop/isDesktop.test.mjs +0 -10
  27. package/dist/shared/utils/isServer/isServer.test.mjs +0 -12
  28. package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +0 -11
  29. package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +0 -15
  30. package/dist/shared/utils/share/share.test.mjs +0 -31
@@ -1,9 +1,133 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "@dotss/ui";
4
- import "./RollerBlock/RollerBlock.mjs";
5
- import { R as e } from "../../../LessonNotesSection-Bg1DHFxg.js";
6
- import "../../../teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs";
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
- e as default
132
+ V as default
9
133
  };
@@ -1,6 +1,6 @@
1
- import { R as l } from "../../../LessonNotesSection-Bg1DHFxg.js";
2
- import { default as a } from "./RollerBlock/RollerBlock.mjs";
1
+ import l from "./Roller.mjs";
2
+ import { default as t } from "./RollerBlock/RollerBlock.mjs";
3
3
  export {
4
- a as RollerBlock,
4
+ t as RollerBlock,
5
5
  l as default
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { Flexbox as l, Typography as n } from "/Users/x/WebstormProjects/dotss/node_modules/.pnpm/@dotss+ui@0.0.10_@emotion+react@11.14.0_@types+react@19.1.6_react@18.3.1__@emotion+styl_fdc48194e396bad48e1a88da53a8b49d/node_modules/@dotss/ui/index.es.js";
2
+ import { Flexbox as l, Typography as n } from "@dotss/ui";
3
3
  import p from "@dotss/ui/core/useTheme";
4
4
  function s({ children: r, style: t, startDate: f, endDate: i, ...o }) {
5
5
  const {
@@ -176,7 +176,7 @@ function hr({
176
176
  }, []), k(() => {
177
177
  rr(E);
178
178
  }, [E]), k(() => {
179
- t.current && !H.current && (H.current = !0, t.current.style.transform = `translate3d(calc(-100% * ${E < p + 1 ? E : p + 1}), 0, 0)`);
179
+ t.current && !H.current && (H.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${E < p + 1 ? E : p + 1}), 0, 0)`);
180
180
  }, [p, E]), /* @__PURE__ */ Z(
181
181
  K,
182
182
  {
@@ -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 h } from "./Carousel/Carousel.mjs";
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 { R as T } from "../../LessonNotesSection-Bg1DHFxg.js";
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
- h as Carousel,
24
+ R as Carousel,
25
25
  v as CarouselSlide,
26
26
  L as Image,
27
27
  K as LoadingAnnouncer,
@@ -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 "/Users/x/WebstormProjects/dotss/node_modules/.pnpm/@dotss+ui@0.0.10_@emotion+react@11.14.0_@types+react@19.1.6_react@18.3.1__@emotion+styl_fdc48194e396bad48e1a88da53a8b49d/node_modules/@dotss/ui/core/useTheme.es.js";
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 "/Users/x/WebstormProjects/dotss/node_modules/.pnpm/@dotss+ui@0.0.10_@emotion+react@11.14.0_@types+react@19.1.6_react@18.3.1__@emotion+styl_fdc48194e396bad48e1a88da53a8b49d/node_modules/@dotss/ui/core/useTheme.es.js";
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 { L as a } from "../../../../LessonNotesSection-Bg1DHFxg.js";
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
- a as default
80
+ w as default
8
81
  };
@@ -1,6 +1,6 @@
1
- import { L as e } from "../../../../LessonNotesSection-Bg1DHFxg.js";
2
- import { default as a } from "./LessonNote/LessonNote.mjs";
1
+ import e from "./LessonNotesSection.mjs";
2
+ import { default as r } from "./LessonNote/LessonNote.mjs";
3
3
  export {
4
- a as LessonNote,
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 L } from "./PreferredAgeGroup/PreferredAgeGroup.utils.mjs";
15
- import { default as K } from "./AbilityCollection/AbilityCollection.mjs";
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 { L as D } from "../../../LessonNotesSection-Bg1DHFxg.js";
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
- K as AbilityCollection,
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
- L as getPreferredAgeKeywords
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.3",
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
- });