@dotss/tictoccroc 0.0.6 → 0.0.8
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/shared/components/Scheduler/Scheduler.d.ts +2 -2
- package/dist/shared/components/Scheduler/Scheduler.mjs +164 -163
- package/dist/shared/components/Scheduler/Scheduler.utils.d.ts +13 -7
- package/dist/shared/components/Scheduler/Scheduler.utils.mjs +65 -54
- package/dist/shared/utils/getDateRange/getDateRange.mjs +16 -15
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts +2 -2
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +11 -12
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +33 -31
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +4 -4
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +114 -121
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +15 -15
- package/package.json +1 -1
|
@@ -20,13 +20,19 @@ export declare function getDayScheduleEvents(scheduleEvents: ScheduleEventWithRa
|
|
|
20
20
|
export declare function resolvePositionedScheduleEventsForDate(scheduleEvents: ScheduleEventWithRange[], date: Dayjs): PositionedScheduleEvent[];
|
|
21
21
|
export declare function assignColumnsToGroup(group: InternalScheduleEvent[]): PositionedScheduleEvent[];
|
|
22
22
|
export declare function getMinutesFromMidnight(date: string): number;
|
|
23
|
-
export declare function getAvailableDateRange(startDate: string | Date | Dayjs, endDate: string | Date | Dayjs, schedules: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
export declare function getAvailableDateRange(startDate: string | Date | Dayjs, endDate: string | Date | Dayjs, { schedules, mergedTimeBlocks }: {
|
|
24
|
+
schedules: {
|
|
25
|
+
id: string | number;
|
|
26
|
+
startDate: string;
|
|
27
|
+
endDate: string;
|
|
28
|
+
startTime: number;
|
|
29
|
+
endTime: number;
|
|
30
|
+
weekDay: string | number;
|
|
31
|
+
oneDayDate: string | null;
|
|
32
|
+
}[];
|
|
33
|
+
mergedTimeBlocks: boolean;
|
|
34
|
+
}): {
|
|
35
|
+
id: string | number;
|
|
30
36
|
startDate: string;
|
|
31
37
|
endDate: string;
|
|
32
38
|
}[];
|
|
@@ -1,92 +1,103 @@
|
|
|
1
1
|
import s from "dayjs";
|
|
2
2
|
import g from "../../utils/getDateRange/getDateRange.mjs";
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
const
|
|
3
|
+
import y from "../../utils/getTimeRange/getTimeRange.mjs";
|
|
4
|
+
function M(u, n = []) {
|
|
5
|
+
const a = Array.from({ length: 7 }, (e, f) => u.add(f, "day")), i = u, o = u.add(6, "day").endOf("day"), m = n.map((e) => {
|
|
6
|
+
const f = s(e.startDate), t = s(e.endDate).endOf("day"), r = f.isBefore(i) ? i : f, c = t.isAfter(o) ? o : t, l = r.diff(i, "day"), p = c.diff(r, "day") + 1;
|
|
7
7
|
return {
|
|
8
8
|
...e,
|
|
9
|
-
start:
|
|
10
|
-
end:
|
|
9
|
+
start: l,
|
|
10
|
+
end: l + p - 1
|
|
11
11
|
};
|
|
12
12
|
}).filter((e) => e.start <= 6 && e.end >= 0);
|
|
13
|
-
return { days:
|
|
13
|
+
return { days: a.map((e) => e), scheduleEvents: m };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
(
|
|
15
|
+
function _(u, n) {
|
|
16
|
+
return u.filter(
|
|
17
|
+
(a) => s(a.startDate).isBefore(n.endOf("day")) && s(a.endDate).isAfter(n.startOf("day"))
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
(t) => s(t.startDate).isBefore(
|
|
20
|
+
function Y(u, n) {
|
|
21
|
+
const a = n.startOf("day"), i = n.endOf("day"), m = [...u.filter(
|
|
22
|
+
(t) => s(t.startDate).isBefore(i) && s(t.endDate).isAfter(a)
|
|
23
23
|
).map((t) => ({
|
|
24
24
|
...t,
|
|
25
25
|
_start: Math.max(
|
|
26
26
|
s(t.startDate).minute() + s(t.startDate).hour() * 60,
|
|
27
|
-
|
|
27
|
+
a.minute() + a.hour() * 60
|
|
28
28
|
),
|
|
29
29
|
_end: Math.min(
|
|
30
30
|
s(t.endDate).minute() + s(t.endDate).hour() * 60,
|
|
31
|
-
|
|
31
|
+
i.minute() + i.hour() * 60
|
|
32
32
|
)
|
|
33
|
-
}))].sort((t,
|
|
34
|
-
let e = [],
|
|
35
|
-
for (const t of
|
|
36
|
-
e.length === 0 || t._start <
|
|
37
|
-
return e.length > 0 &&
|
|
33
|
+
}))].sort((t, r) => t._start - r._start), d = [];
|
|
34
|
+
let e = [], f = -1;
|
|
35
|
+
for (const t of m)
|
|
36
|
+
e.length === 0 || t._start < f ? (e.push(t), f = Math.max(f, t._end)) : (d.push(...D(e)), e = [t], f = t._end);
|
|
37
|
+
return e.length > 0 && d.push(...D(e)), d;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const n = [],
|
|
41
|
-
for (const
|
|
42
|
-
let
|
|
43
|
-
for (let
|
|
44
|
-
const e = n[
|
|
39
|
+
function D(u) {
|
|
40
|
+
const n = [], a = [];
|
|
41
|
+
for (const o of u) {
|
|
42
|
+
let m = !1;
|
|
43
|
+
for (let d = 0; d < n.length; d++) {
|
|
44
|
+
const e = n[d];
|
|
45
45
|
if (!e.some(
|
|
46
46
|
(t) => !(t._end <= t._start || t._end <= t._start)
|
|
47
47
|
)) {
|
|
48
|
-
e.push(
|
|
49
|
-
...
|
|
50
|
-
columnIndex:
|
|
48
|
+
e.push(o), a.push({
|
|
49
|
+
...o,
|
|
50
|
+
columnIndex: d,
|
|
51
51
|
totalColumns: 0
|
|
52
|
-
}),
|
|
52
|
+
}), m = !0;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
...
|
|
56
|
+
m || (n.push([o]), a.push({
|
|
57
|
+
...o,
|
|
58
58
|
columnIndex: n.length - 1,
|
|
59
59
|
totalColumns: 0
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
return
|
|
62
|
+
const i = n.length;
|
|
63
|
+
return a.forEach((o) => o.totalColumns = i), a;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const n = s(
|
|
65
|
+
function C(u) {
|
|
66
|
+
const n = s(u);
|
|
67
67
|
return n.hour() * 60 + n.minute();
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
function O(u, n, {
|
|
70
|
+
schedules: a,
|
|
71
|
+
mergedTimeBlocks: i = !1
|
|
72
|
+
}) {
|
|
73
|
+
return g(u, n).flatMap(({ value: o }, m) => {
|
|
74
|
+
const e = a.filter(({ startDate: r, endDate: c, weekDay: l }) => {
|
|
75
|
+
const p = s(r), h = s(c);
|
|
76
|
+
return p.isAfter(o) || h.isBefore(o) ? !1 : String(l) === o.getDay().toString();
|
|
77
|
+
}).filter(({ oneDayDate: r }) => r ? s(r).isSame(o, "date") : !0).flatMap(
|
|
78
|
+
({ id: r, startTime: c, endTime: l }) => y(Number(c), Number(l), {
|
|
79
|
+
step: i ? l - c : void 0,
|
|
80
|
+
pairs: !i
|
|
81
|
+
}).map(({ value: p, label: h }) => ({
|
|
82
|
+
id: r,
|
|
83
|
+
value: p,
|
|
84
|
+
label: h
|
|
85
|
+
}))
|
|
86
|
+
), f = 2, t = [];
|
|
87
|
+
for (let r = 0; r < e.length; r += f)
|
|
88
|
+
t.push(e.slice(r, r + f));
|
|
89
|
+
return t.map(([{ id: r, value: c }, { value: l }]) => ({
|
|
90
|
+
id: r || `${m}-${c}-${l}`,
|
|
91
|
+
startDate: s(o).hour(Math.floor(c)).minute(c % 1 * 60).format("YYYY-MM-DD HH:mm"),
|
|
81
92
|
endDate: s(o).hour(Math.floor(l)).minute(l % 1 * 60).format("YYYY-MM-DD HH:mm")
|
|
82
93
|
}));
|
|
83
94
|
});
|
|
84
95
|
}
|
|
85
96
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
D as assignColumnsToGroup,
|
|
98
|
+
M as generateWeek,
|
|
99
|
+
O as getAvailableDateRange,
|
|
100
|
+
_ as getDayScheduleEvents,
|
|
101
|
+
C as getMinutesFromMidnight,
|
|
102
|
+
Y as resolvePositionedScheduleEventsForDate
|
|
92
103
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
a
|
|
4
|
-
|
|
5
|
-
const { format: o = "YYYY-MM-DD" } = f, t = a(i), r = a(n);
|
|
6
|
-
if (!t.isValid() || !r.isValid())
|
|
1
|
+
import o from "dayjs";
|
|
2
|
+
function l(t, r, f = {}) {
|
|
3
|
+
const { format: s = "YYYY-MM-DD" } = f, a = o(t), n = o(r);
|
|
4
|
+
if (!a.isValid() || !n.isValid())
|
|
7
5
|
return [];
|
|
8
|
-
if (
|
|
6
|
+
if (a.isAfter(n))
|
|
9
7
|
return [];
|
|
10
|
-
const
|
|
11
|
-
let e =
|
|
12
|
-
for (; e
|
|
13
|
-
|
|
14
|
-
label: e.format(
|
|
8
|
+
const i = [];
|
|
9
|
+
let e = a;
|
|
10
|
+
for (; u(e, n); )
|
|
11
|
+
i.push({
|
|
12
|
+
label: e.format(s),
|
|
15
13
|
value: e.toDate()
|
|
16
|
-
}),
|
|
17
|
-
return
|
|
14
|
+
}), s === "YYYY-MM" ? e = e.add(1, "month") : e = e.add(1, "day");
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function u(t, r) {
|
|
18
|
+
return t.isBefore(r) || t.isSame(r);
|
|
18
19
|
}
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
+
l as default
|
|
21
22
|
};
|
package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MasonryBlockProps } from '../../../../../shared/components/Masonry/MasonryBlock';
|
|
2
|
-
export interface ActivityGalleryItemProps extends MasonryBlockProps {
|
|
2
|
+
export interface ActivityGalleryItemProps extends Omit<MasonryBlockProps, 'id'> {
|
|
3
3
|
type: 'VIDEO' | 'VIMEO' | 'YOUTUBE' | 'IMAGE';
|
|
4
4
|
primary: boolean;
|
|
5
5
|
status: 'VERIFIED' | 'PENDING' | 'REJECTED' | 'DELETED';
|
|
6
|
-
id: string;
|
|
6
|
+
id: string | number;
|
|
7
7
|
}
|
|
8
8
|
declare function ActivityGalleryItem({ children, type, primary, status, id, ...props }: ActivityGalleryItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default ActivityGalleryItem;
|
package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs
CHANGED
|
@@ -6,13 +6,12 @@ import D from "@dotss/ui/Switch";
|
|
|
6
6
|
import j from "../../../../shared/components/Image/Image.mjs";
|
|
7
7
|
import A from "../../../../shared/components/Scheduler/Scheduler.mjs";
|
|
8
8
|
import "dayjs";
|
|
9
|
-
|
|
10
|
-
const U = w(
|
|
9
|
+
const M = w(
|
|
11
10
|
function({
|
|
12
|
-
children:
|
|
13
|
-
title:
|
|
11
|
+
children: g,
|
|
12
|
+
title: m = "수업 가능 일정",
|
|
14
13
|
action: c,
|
|
15
|
-
footer:
|
|
14
|
+
footer: d,
|
|
16
15
|
flat: s = !1,
|
|
17
16
|
schedulerProps: p,
|
|
18
17
|
enableToggle: h = !0,
|
|
@@ -21,9 +20,9 @@ const U = w(
|
|
|
21
20
|
}, v) {
|
|
22
21
|
const {
|
|
23
22
|
palette: { grey: b, background: f }
|
|
24
|
-
} = R(), [t, C] = S(!1), x = () => C((
|
|
23
|
+
} = R(), [t, C] = S(!1), x = () => C((r) => !r), y = (r) => {
|
|
25
24
|
var u;
|
|
26
|
-
return (u = i.onChange) == null ? void 0 : u.call(i,
|
|
25
|
+
return (u = i.onChange) == null ? void 0 : u.call(i, r);
|
|
27
26
|
};
|
|
28
27
|
return /* @__PURE__ */ l(
|
|
29
28
|
n,
|
|
@@ -33,14 +32,14 @@ const U = w(
|
|
|
33
32
|
flexDirection: "column",
|
|
34
33
|
gap: 4,
|
|
35
34
|
"aria-labelledby": "available-schedule-section-title",
|
|
36
|
-
"aria-describedby":
|
|
35
|
+
"aria-describedby": d ? "available-schedule-section-footer" : void 0,
|
|
37
36
|
...a,
|
|
38
37
|
inlineCSS: {
|
|
39
38
|
width: "100%",
|
|
40
39
|
...a == null ? void 0 : a.inlineCSS
|
|
41
40
|
},
|
|
42
41
|
children: [
|
|
43
|
-
/* @__PURE__ */ e(o, { id: "available-schedule-section-title", tag: "h2", variant: "h2B", children:
|
|
42
|
+
/* @__PURE__ */ e(o, { id: "available-schedule-section-title", tag: "h2", variant: "h2B", children: m }),
|
|
44
43
|
i.active && /* @__PURE__ */ l(n, { flexDirection: "column", gap: 2, children: [
|
|
45
44
|
/* @__PURE__ */ l(
|
|
46
45
|
n,
|
|
@@ -62,7 +61,7 @@ const U = w(
|
|
|
62
61
|
id: "available-schedule-section-scheduler",
|
|
63
62
|
"aria-labelledby": "available-schedule-section-title",
|
|
64
63
|
...p,
|
|
65
|
-
children:
|
|
64
|
+
children: g
|
|
66
65
|
}
|
|
67
66
|
),
|
|
68
67
|
h && /* @__PURE__ */ e(
|
|
@@ -88,7 +87,7 @@ const U = w(
|
|
|
88
87
|
]
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
|
|
90
|
+
d && /* @__PURE__ */ e(n, { id: "available-schedule-section-footer", tag: "footer", pl: 12, pr: 2, children: d })
|
|
92
91
|
] }),
|
|
93
92
|
typeof i.onChange == "function" && /* @__PURE__ */ l(
|
|
94
93
|
n,
|
|
@@ -189,5 +188,5 @@ const U = w(
|
|
|
189
188
|
}
|
|
190
189
|
);
|
|
191
190
|
export {
|
|
192
|
-
|
|
191
|
+
M as default
|
|
193
192
|
};
|
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Flexbox as
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { Flexbox as t, Typography as o, Button as h, Icon as c } from "@dotss/ui";
|
|
4
4
|
import p from "@dotss/ui/core/useTheme";
|
|
5
|
-
const
|
|
6
|
-
({ children:
|
|
5
|
+
const x = s(
|
|
6
|
+
({ children: g, totalCount: r, onClickViewAll: l, ...i }, d) => {
|
|
7
7
|
const {
|
|
8
|
-
palette: { grey:
|
|
9
|
-
spacing:
|
|
8
|
+
palette: { grey: m },
|
|
9
|
+
spacing: a
|
|
10
10
|
} = p();
|
|
11
11
|
return /* @__PURE__ */ n(
|
|
12
|
-
|
|
12
|
+
t,
|
|
13
13
|
{
|
|
14
|
-
ref:
|
|
14
|
+
ref: d,
|
|
15
15
|
tag: "section",
|
|
16
|
-
pl: 4,
|
|
17
|
-
pr: 4,
|
|
18
16
|
gap: 4,
|
|
19
17
|
flexDirection: "column",
|
|
20
18
|
"aria-labelledby": "parent-review-section-title",
|
|
21
|
-
...
|
|
19
|
+
...i,
|
|
22
20
|
inlineCSS: {
|
|
23
21
|
width: "100%",
|
|
24
|
-
...
|
|
22
|
+
...i == null ? void 0 : i.inlineCSS
|
|
25
23
|
},
|
|
26
24
|
children: [
|
|
27
|
-
/* @__PURE__ */ n(
|
|
28
|
-
/* @__PURE__ */ t
|
|
25
|
+
/* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
|
|
26
|
+
/* @__PURE__ */ e(t, { alignItems: "center", gap: 2, children: /* @__PURE__ */ n(o, { id: "parent-review-section-title", tag: "h2", variant: "h2B", children: [
|
|
29
27
|
"부모님 리뷰",
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/* @__PURE__ */ n(
|
|
29
|
+
o,
|
|
32
30
|
{
|
|
33
31
|
tag: "span",
|
|
34
32
|
variant: "h4R",
|
|
35
33
|
color: "grey.70",
|
|
36
|
-
inlineCSS: { marginLeft:
|
|
34
|
+
inlineCSS: { marginLeft: a.content(2), verticalAlign: 2 },
|
|
37
35
|
children: [
|
|
38
36
|
"(",
|
|
39
|
-
|
|
37
|
+
r.toLocaleString(),
|
|
40
38
|
"개)"
|
|
41
39
|
]
|
|
42
40
|
}
|
|
43
41
|
)
|
|
44
42
|
] }) }),
|
|
45
|
-
typeof
|
|
46
|
-
|
|
43
|
+
typeof l == "function" && /* @__PURE__ */ e(
|
|
44
|
+
h,
|
|
47
45
|
{
|
|
48
46
|
variant: "text",
|
|
49
47
|
size: "small",
|
|
50
48
|
color: "secondary",
|
|
51
|
-
endAdornment: /* @__PURE__ */
|
|
52
|
-
onClick:
|
|
49
|
+
endAdornment: /* @__PURE__ */ e(c, { name: "ChevronRightLine" }),
|
|
50
|
+
onClick: l,
|
|
53
51
|
children: "전체보기"
|
|
54
52
|
}
|
|
55
53
|
)
|
|
56
54
|
] }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
55
|
+
r > 0 && /* @__PURE__ */ e(
|
|
56
|
+
t,
|
|
59
57
|
{
|
|
60
58
|
tag: "ul",
|
|
61
59
|
flexDirection: "column",
|
|
62
60
|
inlineCSS: {
|
|
63
61
|
"& > li + li": {
|
|
64
|
-
borderTop: `1px solid ${
|
|
65
|
-
marginTop:
|
|
66
|
-
paddingTop:
|
|
62
|
+
borderTop: `1px solid ${m[10]}`,
|
|
63
|
+
marginTop: a.content(5),
|
|
64
|
+
paddingTop: a.content(5)
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
|
-
children:
|
|
67
|
+
children: g
|
|
70
68
|
}
|
|
71
|
-
)
|
|
69
|
+
),
|
|
70
|
+
r <= 0 && /* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "center", gap: 1, pt: 8, pb: 8, children: [
|
|
71
|
+
/* @__PURE__ */ e(c, { name: "OngoingFill", color: "grey.50" }),
|
|
72
|
+
/* @__PURE__ */ e(o, { tag: "p", variant: "b4R", color: "grey.70", children: "아직 작성된 부모님 리뷰가 없어요." })
|
|
73
|
+
] })
|
|
72
74
|
]
|
|
73
75
|
}
|
|
74
76
|
);
|
|
75
77
|
}
|
|
76
78
|
);
|
|
77
79
|
export {
|
|
78
|
-
|
|
80
|
+
x as default
|
|
79
81
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const l = {
|
|
2
2
|
age1: { label: "~24개월" },
|
|
3
|
-
age2: { label: "3
|
|
4
|
-
age3: { label: "
|
|
5
|
-
age4: { label: "
|
|
6
|
-
age5: { label: "
|
|
3
|
+
age2: { label: "2~3세" },
|
|
4
|
+
age3: { label: "4~6세" },
|
|
5
|
+
age4: { label: "7~9세" },
|
|
6
|
+
age5: { label: "10~12세" }
|
|
7
7
|
};
|
|
8
8
|
function r(a) {
|
|
9
9
|
return Object.keys(l).filter((e) => a[e] === "Y").map((e) => l[e].label);
|