@cuemath/leap 3.5.30-as5 → 3.5.30-as7
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/features/timeline/monthly-report/comps/attendance/attendance-utils.js +13 -14
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +35 -67
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +52 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +45 -36
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +10 -11
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,26 +6,25 @@ import _ from "../../../../../assets/line-icons/icons/pause-icon.js";
|
|
|
6
6
|
import { ATTENDANCE_STATUS as a } from "./attendance-constants.js";
|
|
7
7
|
import { StatusSymbol as C } from "./attendance.styled.js";
|
|
8
8
|
import T from "../../../../ui/theme/clrs.js";
|
|
9
|
-
const l = T(), w = (t) => t == null ? void 0 : t.map((o) => I(o)).join(
|
|
10
|
-
|
|
11
|
-
let o = 0, s = 0, r = 0;
|
|
9
|
+
const l = T(), w = (t, s) => [s, ...(t == null ? void 0 : t.map((o) => I(o))) || []].join("/n"), b = (t) => t.is_present ? a.ATTENDED : t.is_paused ? a.PAUSED : a.MISSED, x = (t) => {
|
|
10
|
+
let s = 0, o = 0, r = 0;
|
|
12
11
|
Object.values(t).forEach((i) => {
|
|
13
12
|
i.forEach((e) => {
|
|
14
13
|
switch (b(e)) {
|
|
15
14
|
case a.ATTENDED:
|
|
16
|
-
|
|
15
|
+
s++;
|
|
17
16
|
break;
|
|
18
17
|
case a.PAUSED:
|
|
19
18
|
r++;
|
|
20
19
|
break;
|
|
21
20
|
default:
|
|
22
|
-
|
|
21
|
+
o++;
|
|
23
22
|
break;
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
25
|
});
|
|
27
26
|
const n = [];
|
|
28
|
-
return
|
|
27
|
+
return s > 0 && n.push(`${s} attended`), o > 0 && n.push(`${o} missed`), r > 0 && n.push(`${r} paused`), `${n.join(", ")}.`;
|
|
29
28
|
}, A = (t) => {
|
|
30
29
|
if (t.length === 0)
|
|
31
30
|
return {
|
|
@@ -41,14 +40,14 @@ const l = T(), w = (t) => t == null ? void 0 : t.map((o) => I(o)).join(`
|
|
|
41
40
|
tooltipBgColor: "WHITE_5",
|
|
42
41
|
snackbarBg: l.WHITE_5
|
|
43
42
|
};
|
|
44
|
-
const
|
|
45
|
-
return
|
|
43
|
+
const s = t.find((r) => r.is_present), o = t.find((r) => r.is_paused);
|
|
44
|
+
return s ? {
|
|
46
45
|
status: a.ATTENDED,
|
|
47
46
|
themeColor: "GREEN_1",
|
|
48
47
|
statusSymbol: /* @__PURE__ */ u(S, { color: "GREEN_6", width: 14, height: 14 }),
|
|
49
48
|
tooltipBgColor: "GREEN_2",
|
|
50
49
|
snackbarBg: l.GREEN_2
|
|
51
|
-
} :
|
|
50
|
+
} : o ? {
|
|
52
51
|
status: a.PAUSED,
|
|
53
52
|
themeColor: "WHITE_4",
|
|
54
53
|
statusSymbol: /* @__PURE__ */ u(_, { color: "BLACK_T_60", width: 8, height: 8 }),
|
|
@@ -61,12 +60,12 @@ const l = T(), w = (t) => t == null ? void 0 : t.map((o) => I(o)).join(`
|
|
|
61
60
|
tooltipBgColor: "ORANGE_2",
|
|
62
61
|
snackbarBg: l.ORANGE_2
|
|
63
62
|
};
|
|
64
|
-
}, P = (t,
|
|
65
|
-
const r = new Date(
|
|
63
|
+
}, P = (t, s, o) => {
|
|
64
|
+
const r = new Date(o, s - 1, 1).getDay(), n = new Date(o, s, 0).getDate(), i = [];
|
|
66
65
|
for (let e = 0; e < r; e++)
|
|
67
66
|
i.push(null);
|
|
68
67
|
for (let e = 1; e <= n; e++) {
|
|
69
|
-
const m = `${
|
|
68
|
+
const m = `${o}-${s.toString().padStart(2, "0")}-${e.toString().padStart(2, "0")}`, c = t[m] || [], { status: d, themeColor: h, statusSymbol: E, tooltipBgColor: g, snackbarBg: p } = A(c);
|
|
70
69
|
i.push({
|
|
71
70
|
date: e,
|
|
72
71
|
status: d,
|
|
@@ -81,8 +80,8 @@ const l = T(), w = (t) => t == null ? void 0 : t.map((o) => I(o)).join(`
|
|
|
81
80
|
return i;
|
|
82
81
|
}, I = (t) => {
|
|
83
82
|
if (!t.status) return "";
|
|
84
|
-
const
|
|
85
|
-
return `${`${
|
|
83
|
+
const o = new Date(t.time * 1e3).getHours(), r = o >= 12 ? "PM" : "AM";
|
|
84
|
+
return `${`${o % 12 || 12} ${r}`}: ${t.status}`;
|
|
86
85
|
};
|
|
87
86
|
export {
|
|
88
87
|
x as attendanceStatsText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attendance-utils.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance-utils.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport DotIcon from '../../../../../assets/line-icons/icons/dots-icon';\nimport PauseIcon from '../../../../../assets/line-icons/icons/pause-icon';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { IClassEvent, TCalendarData } from '../../monthly-report-types';\nimport { ATTENDANCE_STATUS } from './attendance-constants';\nimport type { ICalendarDay, TAttendanceStatus } from './attendance-types';\nimport * as Styled from './attendance.styled';\nimport getColors from '../../../../ui/theme/clrs';\n\nconst colors = getColors();\n\nexport const getSnackbarMsg = (classes: IClassEvent[] | undefined) => {\n return classes?.map(item => getStatusText(item)).join('
|
|
1
|
+
{"version":3,"file":"attendance-utils.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance-utils.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport DotIcon from '../../../../../assets/line-icons/icons/dots-icon';\nimport PauseIcon from '../../../../../assets/line-icons/icons/pause-icon';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { IClassEvent, TCalendarData } from '../../monthly-report-types';\nimport { ATTENDANCE_STATUS } from './attendance-constants';\nimport type { ICalendarDay, TAttendanceStatus } from './attendance-types';\nimport * as Styled from './attendance.styled';\nimport getColors from '../../../../ui/theme/clrs';\n\nconst colors = getColors();\n\nexport const getSnackbarMsg = (classes: IClassEvent[] | undefined, date: string) => {\n return [date, ...(classes?.map(item => getStatusText(item)) || [])].join('/n');\n};\n\nexport const getClassStatus = (classEvent: IClassEvent): TAttendanceStatus => {\n if (classEvent.is_present) {\n return ATTENDANCE_STATUS.ATTENDED;\n }\n\n if (classEvent.is_paused) {\n return ATTENDANCE_STATUS.PAUSED;\n }\n\n return ATTENDANCE_STATUS.MISSED;\n};\n\nexport const attendanceStatsText = (calendarData: TCalendarData) => {\n let attended = 0;\n let missed = 0;\n let paused = 0;\n\n Object.values(calendarData).forEach(dayClasses => {\n dayClasses.forEach(classEvent => {\n const status = getClassStatus(classEvent);\n\n switch (status) {\n case ATTENDANCE_STATUS.ATTENDED:\n attended++;\n break;\n case ATTENDANCE_STATUS.PAUSED:\n paused++;\n break;\n default:\n missed++;\n break;\n }\n });\n });\n\n const parts: string[] = [];\n\n if (attended > 0) parts.push(`${attended} attended`);\n\n if (missed > 0) parts.push(`${missed} missed`);\n\n if (paused > 0) parts.push(`${paused} paused`);\n\n return `${parts.join(', ')}.`;\n};\n\nexport const getDayStatusInfo = (dayClasses: IClassEvent[]) => {\n if (dayClasses.length === 0) {\n return {\n status: null,\n themeColor: null,\n statusSymbol: '',\n };\n }\n\n if (dayClasses.length > 1) {\n return {\n status: ATTENDANCE_STATUS.PAUSED,\n themeColor: 'WHITE_4',\n statusSymbol: (\n <Styled.StatusSymbol $top=\"2px\" $right=\"2px\">\n <DotIcon color=\"GREEN_6\" width={8} height={8} />\n </Styled.StatusSymbol>\n ),\n tooltipBgColor: 'WHITE_5',\n snackbarBg: colors.WHITE_5,\n };\n }\n\n const attendedClass = dayClasses.find(cls => cls.is_present);\n const pausedClass = dayClasses.find(cls => cls.is_paused);\n\n if (attendedClass) {\n return {\n status: ATTENDANCE_STATUS.ATTENDED,\n themeColor: 'GREEN_1',\n statusSymbol: <Check2Icon color=\"GREEN_6\" width={14} height={14} />,\n tooltipBgColor: 'GREEN_2',\n snackbarBg: colors.GREEN_2,\n };\n }\n\n if (pausedClass) {\n return {\n status: ATTENDANCE_STATUS.PAUSED,\n themeColor: 'WHITE_4',\n statusSymbol: <PauseIcon color=\"BLACK_T_60\" width={8} height={8} />,\n tooltipBgColor: 'WHITE_5',\n snackbarBg: colors.WHITE_5,\n };\n }\n\n return {\n status: ATTENDANCE_STATUS.MISSED,\n themeColor: 'ORANGE_1',\n statusSymbol: <CrossIcon color=\"RED\" width={12} height={12} />,\n tooltipBgColor: 'ORANGE_2',\n snackbarBg: colors.ORANGE_2,\n };\n};\n\nexport const generateCalendarGrid = (\n calendarData: TCalendarData,\n reportMonth: number,\n reportYear: number,\n): (ICalendarDay | null)[] => {\n const firstDay = new Date(reportYear, reportMonth - 1, 1).getDay();\n const daysInMonth = new Date(reportYear, reportMonth, 0).getDate();\n const grid: (ICalendarDay | null)[] = [];\n\n // Add empty cells for days before the first day of the month\n for (let i = 0; i < firstDay; i++) {\n grid.push(null);\n }\n\n // Add all days of the month\n for (let day = 1; day <= daysInMonth; day++) {\n const dateString = `${reportYear}-${reportMonth.toString().padStart(2, '0')}-${day\n .toString()\n .padStart(2, '0')}`;\n const dayClasses = calendarData[dateString] || [];\n const { status, themeColor, statusSymbol, tooltipBgColor, snackbarBg } =\n getDayStatusInfo(dayClasses);\n\n grid.push({\n date: day,\n status,\n hasClasses: dayClasses.length > 0,\n classes: dayClasses,\n themeColor: themeColor as TColorNames | null,\n statusSymbol: statusSymbol as JSX.Element,\n tooltipBgColor: tooltipBgColor as TColorNames | null,\n snackbarBg,\n });\n }\n\n return grid;\n};\n\nexport const getStatusText = (classEvent: IClassEvent) => {\n if (!classEvent.status) return '';\n\n const date = new Date(classEvent.time * 1000);\n const hours = date.getHours();\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const displayHours = hours % 12 || 12;\n\n const timeStr = `${displayHours} ${ampm}`;\n\n return `${timeStr}: ${classEvent.status}`;\n};\n"],"names":["colors","getColors","getSnackbarMsg","classes","date","item","getStatusText","getClassStatus","classEvent","ATTENDANCE_STATUS","attendanceStatsText","calendarData","attended","missed","paused","dayClasses","parts","getDayStatusInfo","jsx","Styled.StatusSymbol","DotIcon","attendedClass","cls","pausedClass","Check2Icon","PauseIcon","CrossIcon","generateCalendarGrid","reportMonth","reportYear","firstDay","daysInMonth","grid","i","day","dateString","status","themeColor","statusSymbol","tooltipBgColor","snackbarBg","hours","ampm"],"mappings":";;;;;;;;AAaA,MAAMA,IAASC,EAAU,GAEZC,IAAiB,CAACC,GAAoCC,MAC1D,CAACA,GAAM,IAAID,KAAA,gBAAAA,EAAS,IAAI,CAAQE,MAAAC,EAAcD,CAAI,OAAM,CAAA,CAAG,EAAE,KAAK,IAAI,GAGlEE,IAAiB,CAACC,MACzBA,EAAW,aACNC,EAAkB,WAGvBD,EAAW,YACNC,EAAkB,SAGpBA,EAAkB,QAGdC,IAAsB,CAACC,MAAgC;AAClE,MAAIC,IAAW,GACXC,IAAS,GACTC,IAAS;AAEb,SAAO,OAAOH,CAAY,EAAE,QAAQ,CAAcI,MAAA;AAChD,IAAAA,EAAW,QAAQ,CAAcP,MAAA;AAG/B,cAFeD,EAA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OAAO;AAKlC,SAAO,GAFS,GAFKA,IAAQ,MAAM,EAEJ,IAAIC,CAAI,EAEtB,KAAKlC,EAAW,MAAM;AACzC;"}
|
|
@@ -1,76 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import m from "../../../../ui/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
onDateClick: i
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as $, useMemo as n } from "react";
|
|
3
|
+
import l from "../../../../ui/layout/flex-view.js";
|
|
4
|
+
import h from "../../../../ui/separator/separator.js";
|
|
5
|
+
import m from "../../../../ui/text/text.js";
|
|
6
|
+
import { CALENDAR_CONFIG as u } from "./attendance-constants.js";
|
|
7
|
+
import { attendanceStatsText as C, generateCalendarGrid as b } from "./attendance-utils.js";
|
|
8
|
+
import { CalendarHeader as _, CalendarBody as x } from "./attendance.styled.js";
|
|
9
|
+
import g from "./attendence-view.js";
|
|
10
|
+
const T = ({
|
|
11
|
+
calendarData: e,
|
|
12
|
+
reportMonth: t,
|
|
13
|
+
reportYear: i,
|
|
14
|
+
onDateClick: c
|
|
16
15
|
}) => {
|
|
17
|
-
const A =
|
|
18
|
-
() => !!
|
|
19
|
-
[
|
|
20
|
-
),
|
|
21
|
-
() => !!
|
|
22
|
-
[
|
|
23
|
-
),
|
|
24
|
-
return !
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
16
|
+
const A = n(
|
|
17
|
+
() => !!e && C(e),
|
|
18
|
+
[e]
|
|
19
|
+
), s = n(
|
|
20
|
+
() => !!e && b(e, t, i),
|
|
21
|
+
[e, t, i]
|
|
22
|
+
), f = n(() => e ? Object.values(e).some((r) => r.length > 0) : !1, [e]);
|
|
23
|
+
return !e || Object.keys(e).length === 0 || !f || !s ? null : /* @__PURE__ */ d(l, { children: [
|
|
24
|
+
/* @__PURE__ */ o(m, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "Attendance" }),
|
|
25
|
+
/* @__PURE__ */ o(m, { $renderAs: "ub2-bold", $color: "BLACK_T_60", children: A }),
|
|
26
|
+
/* @__PURE__ */ o(h, { heightX: 1 }),
|
|
27
|
+
/* @__PURE__ */ d(l, { $borderColor: "WHITE_5", children: [
|
|
28
|
+
/* @__PURE__ */ o(_, { children: u.DAY_HEADERS.map((r) => /* @__PURE__ */ o(m, { $align: "center", $renderAs: "ub3", $color: "BLACK_T_60", children: r }, r)) }),
|
|
29
|
+
/* @__PURE__ */ o(x, { children: s.map((r, p) => /* @__PURE__ */ o(
|
|
30
|
+
g,
|
|
32
31
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
bgColor: (e == null ? void 0 : e.snackbarBg) || "WHITE_5"
|
|
37
|
-
}),
|
|
38
|
-
children: /* @__PURE__ */ r(
|
|
39
|
-
f,
|
|
40
|
-
{
|
|
41
|
-
renderAs: "primary",
|
|
42
|
-
position: "top",
|
|
43
|
-
hidden: u || !(e != null && e.hasClasses),
|
|
44
|
-
backgroundColor: (e == null ? void 0 : e.tooltipBgColor) || "WHITE_5",
|
|
45
|
-
tooltipItem: e != null && e.classes ? /* @__PURE__ */ n(m, { children: [
|
|
46
|
-
/* @__PURE__ */ n(t, { $align: "center", $renderAs: "ab3", $color: "BLACK_1", children: [
|
|
47
|
-
S[s],
|
|
48
|
-
" ",
|
|
49
|
-
e.date
|
|
50
|
-
] }),
|
|
51
|
-
e.classes.map((h) => /* @__PURE__ */ r(t, { $align: "center", $renderAs: "ab3", children: x(h) }, h.time))
|
|
52
|
-
] }) : "",
|
|
53
|
-
children: /* @__PURE__ */ r(
|
|
54
|
-
K,
|
|
55
|
-
{
|
|
56
|
-
$background: (e == null ? void 0 : e.themeColor) || "WHITE_1",
|
|
57
|
-
$justifyContent: "center",
|
|
58
|
-
$alignItems: "center",
|
|
59
|
-
children: e && /* @__PURE__ */ n(_, { children: [
|
|
60
|
-
/* @__PURE__ */ r(t, { $renderAs: "ab2", $color: "BLACK_T_38", children: e.date }),
|
|
61
|
-
/* @__PURE__ */ r(L, { children: !!e.statusSymbol && e.statusSymbol })
|
|
62
|
-
] })
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
)
|
|
32
|
+
day: r,
|
|
33
|
+
reportMonth: t,
|
|
34
|
+
onDateClick: c
|
|
67
35
|
},
|
|
68
|
-
|
|
36
|
+
r ? `day-${r.date}` : `empty-${p}`
|
|
69
37
|
)) })
|
|
70
38
|
] })
|
|
71
39
|
] });
|
|
72
|
-
},
|
|
40
|
+
}, w = $(T);
|
|
73
41
|
export {
|
|
74
|
-
|
|
42
|
+
w as default
|
|
75
43
|
};
|
|
76
44
|
//# sourceMappingURL=attendance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attendance.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"attendance.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { CALENDAR_CONFIG } from './attendance-constants';\nimport type { IAttendanceProps } from './attendance-types';\nimport { attendanceStatsText, generateCalendarGrid } from './attendance-utils';\nimport * as Styled from './attendance.styled';\nimport AttendenceView from './attendence-view';\n\nconst Attendance: FC<IAttendanceProps> = ({\n calendarData,\n reportMonth,\n reportYear,\n onDateClick,\n}) => {\n const attendanceStats = useMemo(\n () => !!calendarData && attendanceStatsText(calendarData),\n [calendarData],\n );\n const calendarGrid = useMemo(\n () => !!calendarData && generateCalendarGrid(calendarData, reportMonth, reportYear),\n [calendarData, reportMonth, reportYear],\n );\n\n const hasClasses = useMemo(() => {\n if (!calendarData) return false;\n\n return Object.values(calendarData).some(dayClasses => dayClasses.length > 0);\n }, [calendarData]);\n\n if (!calendarData || Object.keys(calendarData).length === 0 || !hasClasses || !calendarGrid) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Attendance\n </Text>\n <Text $renderAs=\"ub2-bold\" $color=\"BLACK_T_60\">\n {attendanceStats}\n </Text>\n <Separator heightX={1} />\n <FlexView $borderColor=\"WHITE_5\">\n <Styled.CalendarHeader>\n {CALENDAR_CONFIG.DAY_HEADERS.map(dayLetter => (\n <Text $align=\"center\" $renderAs=\"ub3\" $color=\"BLACK_T_60\" key={dayLetter}>\n {dayLetter}\n </Text>\n ))}\n </Styled.CalendarHeader>\n <Styled.CalendarBody>\n {calendarGrid.map((day, index) => (\n <AttendenceView\n day={day}\n key={day ? `day-${day.date}` : `empty-${index}`}\n reportMonth={reportMonth}\n onDateClick={onDateClick}\n />\n ))}\n </Styled.CalendarBody>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(Attendance);\n"],"names":["Attendance","calendarData","reportMonth","reportYear","onDateClick","attendanceStats","useMemo","attendanceStatsText","calendarGrid","generateCalendarGrid","hasClasses","dayClasses","FlexView","jsx","Text","Separator","jsxs","Styled.CalendarHeader","dayLetter","Styled.CalendarBody","day","index","AttendenceView","Attendance$1","memo"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAmC,CAAC;AAAA,EACxC,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AACF,MAAM;AACJ,QAAMC,IAAkBC;AAAA,IACt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
|
|
1
|
+
import { jsx as r, jsxs as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { memo as p, useCallback as f } from "react";
|
|
3
|
+
import { IS_APP_RUNNING_IN_RN as g } from "../../../../../constants/app-config.js";
|
|
4
|
+
import $ from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
|
+
import b from "../../../../ui/layout/flex-view.js";
|
|
6
|
+
import n from "../../../../ui/text/text.js";
|
|
7
|
+
import { MONTH_NAMES as l } from "./attendance-constants.js";
|
|
8
|
+
import { getSnackbarMsg as h, getStatusText as u } from "./attendance-utils.js";
|
|
9
|
+
import { TooltipWrapper as A, CalendarDay as _, StatusSymbol as T } from "./attendance.styled.js";
|
|
10
|
+
function C({ day: e, reportMonth: s, onDateClick: o }) {
|
|
11
|
+
const m = f(() => {
|
|
12
|
+
o == null || o({
|
|
13
|
+
type: "info",
|
|
14
|
+
message: h((e == null ? void 0 : e.classes) || [], `${l[s]} ${(e == null ? void 0 : e.date) ?? ""}`) ?? "",
|
|
15
|
+
bgColor: (e == null ? void 0 : e.snackbarBg) || "WHITE_5"
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
return /* @__PURE__ */ r(A, { onClick: m, children: /* @__PURE__ */ r(
|
|
19
|
+
$,
|
|
20
|
+
{
|
|
21
|
+
renderAs: "primary",
|
|
22
|
+
position: "top",
|
|
23
|
+
hidden: g || !(e != null && e.hasClasses),
|
|
24
|
+
backgroundColor: (e == null ? void 0 : e.tooltipBgColor) || "WHITE_5",
|
|
25
|
+
tooltipItem: e != null && e.classes ? /* @__PURE__ */ t(b, { children: [
|
|
26
|
+
/* @__PURE__ */ t(n, { $align: "center", $renderAs: "ab3", $color: "BLACK_1", children: [
|
|
27
|
+
l[s],
|
|
28
|
+
" ",
|
|
29
|
+
e.date
|
|
30
|
+
] }),
|
|
31
|
+
e.classes.map((i) => /* @__PURE__ */ r(n, { $align: "center", $renderAs: "ab3", children: u(i) }, i.time))
|
|
32
|
+
] }) : "",
|
|
33
|
+
children: /* @__PURE__ */ r(
|
|
34
|
+
_,
|
|
35
|
+
{
|
|
36
|
+
$background: (e == null ? void 0 : e.themeColor) || "WHITE_1",
|
|
37
|
+
$justifyContent: "center",
|
|
38
|
+
$alignItems: "center",
|
|
39
|
+
children: e && /* @__PURE__ */ t(c, { children: [
|
|
40
|
+
/* @__PURE__ */ r(n, { $renderAs: "ab2", $color: "BLACK_T_38", children: e.date }),
|
|
41
|
+
/* @__PURE__ */ r(T, { children: !!e.statusSymbol && e.statusSymbol })
|
|
42
|
+
] })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
) });
|
|
47
|
+
}
|
|
48
|
+
const k = p(C);
|
|
49
|
+
export {
|
|
50
|
+
k as default
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=attendence-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendence-view.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendence-view.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { MONTH_NAMES } from './attendance-constants';\nimport { getSnackbarMsg, getStatusText } from './attendance-utils';\nimport * as Styled from './attendance.styled';\nimport type { ICalenderViewProps } from './attendance-types';\n\nfunction AttendenceView({ day, reportMonth, onDateClick }: ICalenderViewProps) {\n const handleClick = useCallback(() => {\n onDateClick?.({\n type: 'info',\n message:\n getSnackbarMsg(day?.classes || [], `${MONTH_NAMES[reportMonth]} ${day?.date ?? ''}`) ?? '',\n bgColor: day?.snackbarBg || 'WHITE_5',\n });\n }, []);\n\n return (\n <Styled.TooltipWrapper onClick={handleClick}>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n hidden={IS_APP_RUNNING_IN_RN || !day?.hasClasses}\n backgroundColor={day?.tooltipBgColor || 'WHITE_5'}\n tooltipItem={\n day?.classes ? (\n <FlexView>\n <Text $align=\"center\" $renderAs=\"ab3\" $color=\"BLACK_1\">\n {MONTH_NAMES[reportMonth]} {day.date}\n </Text>\n {day.classes.map(classEvent => (\n <Text $align=\"center\" $renderAs=\"ab3\" key={classEvent.time}>\n {getStatusText(classEvent)}\n </Text>\n ))}\n </FlexView>\n ) : (\n ''\n )\n }\n >\n <Styled.CalendarDay\n $background={day?.themeColor || 'WHITE_1'}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {day && (\n <>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_38\">\n {day.date}\n </Text>\n <Styled.StatusSymbol>{!!day.statusSymbol && day.statusSymbol}</Styled.StatusSymbol>\n </>\n )}\n </Styled.CalendarDay>\n </ArrowTooltip>\n </Styled.TooltipWrapper>\n );\n}\n\nexport default memo(AttendenceView);\n"],"names":["AttendenceView","day","reportMonth","onDateClick","handleClick","useCallback","getSnackbarMsg","MONTH_NAMES","jsx","Styled.TooltipWrapper","ArrowTooltip","IS_APP_RUNNING_IN_RN","jsxs","FlexView","Text","classEvent","getStatusText","Styled.CalendarDay","Fragment","Styled.StatusSymbol","AttendenceView$1","memo"],"mappings":";;;;;;;;;AAWA,SAASA,EAAe,EAAE,KAAAC,GAAK,aAAAC,GAAa,aAAAC,KAAmC;AACvE,QAAAC,IAAcC,EAAY,MAAM;AACtB,IAAAF,KAAA,QAAAA,EAAA;AAAA,MACZ,MAAM;AAAA,MACN,SACEG,GAAeL,KAAA,gBAAAA,EAAK,YAAW,CAAI,GAAA,GAAGM,EAAYL,CAAW,CAAC,KAAID,KAAA,gBAAAA,EAAK,SAAQ,EAAE,EAAE,KAAK;AAAA,MAC1F,UAASA,KAAA,gBAAAA,EAAK,eAAc;AAAA,IAAA;AAAA,EAEhC,GAAG,CAAE,CAAA;AAEL,SACG,gBAAAO,EAAAC,GAAA,EAAsB,SAASL,GAC9B,UAAA,gBAAAI;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,UAAS;AAAA,MACT,QAAQC,KAAwB,EAACV,KAAA,QAAAA,EAAK;AAAA,MACtC,kBAAiBA,KAAA,gBAAAA,EAAK,mBAAkB;AAAA,MACxC,aACEA,KAAA,QAAAA,EAAK,UACH,gBAAAW,EAACC,GACC,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACE,KAAK,QAAO,UAAS,WAAU,OAAM,QAAO,WAC1C,UAAA;AAAA,UAAAP,EAAYL,CAAW;AAAA,UAAE;AAAA,UAAED,EAAI;AAAA,QAAA,GAClC;AAAA,QACCA,EAAI,QAAQ,IAAI,CAAAc,wBACdD,GAAK,EAAA,QAAO,UAAS,WAAU,OAC7B,UAAcE,EAAAD,CAAU,KADgBA,EAAW,IAEtD,CACD;AAAA,MAAA,EAAA,CACH,IAEA;AAAA,MAIJ,UAAA,gBAAAP;AAAA,QAACS;AAAAA,QAAA;AAAA,UACC,cAAahB,KAAA,gBAAAA,EAAK,eAAc;AAAA,UAChC,iBAAgB;AAAA,UAChB,aAAY;AAAA,UAEX,eAEG,gBAAAW,EAAAM,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAV,EAACM,KAAK,WAAU,OAAM,QAAO,cAC1B,YAAI,MACP;AAAA,YACA,gBAAAN,EAACW,GAAA,EAAqB,WAAC,CAAClB,EAAI,gBAAgBA,EAAI,cAAa;AAAA,UAAA,GAC/D;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;AAEA,MAAemB,IAAAC,EAAKrB,CAAc;"}
|
|
@@ -1,53 +1,62 @@
|
|
|
1
1
|
import { jsxs as e, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { GOAL_CATEGORY_CONFIG as
|
|
4
|
-
import { ProgressBarContainer as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { memo as F, useState as H, useMemo as O, useCallback as W } from "react";
|
|
3
|
+
import { GOAL_CATEGORY_CONFIG as j, calculateProgress as w } from "../goals-constants.js";
|
|
4
|
+
import { ProgressBarContainer as y, TagContainer as E, ChaptersContainer as V } from "./goals-card-styled.js";
|
|
5
|
+
import t from "../../../../../ui/text/text.js";
|
|
6
|
+
import l from "../../../../../ui/layout/flex-view.js";
|
|
7
7
|
import C from "../../../../../ui/separator/separator.js";
|
|
8
8
|
import Y from "../../../../../ui/image/image.js";
|
|
9
9
|
import G from "../../../../../ui/buttons/clickable/clickable.js";
|
|
10
10
|
import B from "./goal-chapter-card.js";
|
|
11
11
|
import q from "../../../../../ui/linear-progress-bar/linear-progress-bar.js";
|
|
12
|
-
const z = ({ category: L, milestone: T, isExpended:
|
|
13
|
-
const [d, k] =
|
|
12
|
+
const z = ({ category: L, milestone: T, isExpended: o = !1 }) => {
|
|
13
|
+
const [d, k] = H(!1), {
|
|
14
14
|
milestone_name: v,
|
|
15
15
|
user_chapters: p,
|
|
16
|
-
progress_stat:
|
|
16
|
+
progress_stat: P,
|
|
17
17
|
previous_progress_stat: n
|
|
18
|
-
} = T, { completed:
|
|
19
|
-
k((
|
|
18
|
+
} = T, { completed: I, total: a } = P, { completed: $, total: u } = n ?? {}, c = w(I, a), f = n && $ && u ? w($, u) : 0, i = c - f, g = !!(n && i > 0 && a === a), S = !!(n && i <= 0 && a !== a), b = c === 100, K = Math.round(c), x = Math.round(i), _ = p.length, D = p.slice(0, 2), m = Math.max(0, _ - 2), M = d ? p.slice(2) : [], N = m > 0, s = O(() => j[L], []), A = s.icon, X = W(() => {
|
|
19
|
+
k((R) => !R);
|
|
20
20
|
}, []);
|
|
21
|
-
return /* @__PURE__ */ e(
|
|
21
|
+
return /* @__PURE__ */ e(l, { children: [
|
|
22
22
|
/* @__PURE__ */ e(
|
|
23
|
-
|
|
23
|
+
l,
|
|
24
24
|
{
|
|
25
25
|
$position: "relative",
|
|
26
|
-
$background:
|
|
27
|
-
$borderColor:
|
|
26
|
+
$background: s.backgroundColor,
|
|
27
|
+
$borderColor: o ? "WHITE_5" : void 0,
|
|
28
28
|
$gutterX: 1,
|
|
29
29
|
$gapX: 1,
|
|
30
|
-
$height:
|
|
30
|
+
$height: o ? "auto" : 72,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
A && /* @__PURE__ */ r(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
/* @__PURE__ */ e(l, { $flexDirection: "row", $flexGapX: o ? 1 : 0.5, children: [
|
|
33
|
+
A && /* @__PURE__ */ r(
|
|
34
|
+
Y,
|
|
35
|
+
{
|
|
36
|
+
src: A,
|
|
37
|
+
withLoader: !0,
|
|
38
|
+
width: o ? 40 : 32,
|
|
39
|
+
height: o ? 40 : 32,
|
|
40
|
+
alt: s.label
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ e(l, { children: [
|
|
44
|
+
o && /* @__PURE__ */ e(h, { children: [
|
|
45
|
+
/* @__PURE__ */ r(t, { $renderAs: "ac5", $color: s.labelColor, children: s.label }),
|
|
37
46
|
/* @__PURE__ */ r(C, { heightX: 0.25 })
|
|
38
47
|
] }),
|
|
39
|
-
/* @__PURE__ */ r(
|
|
40
|
-
/* @__PURE__ */ r(C, { heightX:
|
|
41
|
-
/* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ r(
|
|
43
|
-
g && !b && /* @__PURE__ */ e(
|
|
48
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab2", $color: "BLACK_1", children: v }),
|
|
49
|
+
/* @__PURE__ */ r(C, { heightX: o ? 0.5 : 0.125 }),
|
|
50
|
+
/* @__PURE__ */ e(l, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.25, children: [
|
|
51
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab3", $color: "BLACK_T_60", children: b ? "Completed" : `${K}% complete` }),
|
|
52
|
+
g && !b && /* @__PURE__ */ e(t, { $renderAs: "ab3", $color: "GREEN_6", children: [
|
|
44
53
|
"(+",
|
|
45
|
-
|
|
54
|
+
x,
|
|
46
55
|
"%)"
|
|
47
56
|
] })
|
|
48
57
|
] })
|
|
49
58
|
] }),
|
|
50
|
-
/* @__PURE__ */ r(
|
|
59
|
+
/* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
51
60
|
q,
|
|
52
61
|
{
|
|
53
62
|
percentage: g ? f : c,
|
|
@@ -59,14 +68,14 @@ const z = ({ category: L, milestone: T, isExpended: s = !1 }) => {
|
|
|
59
68
|
}
|
|
60
69
|
) })
|
|
61
70
|
] }),
|
|
62
|
-
|
|
71
|
+
S && /* @__PURE__ */ e(h, { children: [
|
|
63
72
|
/* @__PURE__ */ r(C, { heightX: 0.875 }),
|
|
64
|
-
/* @__PURE__ */ r(
|
|
73
|
+
/* @__PURE__ */ r(E, { $gapX: 0.5, $gutterX: 1, $background: s.tagColor, children: /* @__PURE__ */ r(t, { $renderAs: "ub3", $color: "BLACK_1", children: "Learning plan was modified — progress updated accordingly." }) })
|
|
65
74
|
] })
|
|
66
75
|
]
|
|
67
76
|
}
|
|
68
77
|
),
|
|
69
|
-
|
|
78
|
+
o && _ > 0 && /* @__PURE__ */ e(
|
|
70
79
|
V,
|
|
71
80
|
{
|
|
72
81
|
$gapX: 1,
|
|
@@ -75,13 +84,13 @@ const z = ({ category: L, milestone: T, isExpended: s = !1 }) => {
|
|
|
75
84
|
$borderColor: "WHITE_5",
|
|
76
85
|
children: [
|
|
77
86
|
/* @__PURE__ */ r(B, { chapters: D }),
|
|
78
|
-
|
|
79
|
-
!d && /* @__PURE__ */ r(
|
|
87
|
+
N && /* @__PURE__ */ e(h, { children: [
|
|
88
|
+
!d && /* @__PURE__ */ r(l, { $gutterX: 4.5, children: /* @__PURE__ */ r(
|
|
80
89
|
G,
|
|
81
90
|
{
|
|
82
91
|
onClick: X,
|
|
83
92
|
label: `+${m} chapters`,
|
|
84
|
-
children: /* @__PURE__ */ e(
|
|
93
|
+
children: /* @__PURE__ */ e(t, { $renderAs: "ub3-bold", $color: "BLACK_1", children: [
|
|
85
94
|
"+",
|
|
86
95
|
m,
|
|
87
96
|
" chapters"
|
|
@@ -89,15 +98,15 @@ const z = ({ category: L, milestone: T, isExpended: s = !1 }) => {
|
|
|
89
98
|
}
|
|
90
99
|
) }),
|
|
91
100
|
d && /* @__PURE__ */ e(h, { children: [
|
|
92
|
-
/* @__PURE__ */ r(B, { chapters:
|
|
93
|
-
/* @__PURE__ */ r(
|
|
101
|
+
/* @__PURE__ */ r(B, { chapters: M }),
|
|
102
|
+
/* @__PURE__ */ r(l, { $gutterX: 4.5, children: /* @__PURE__ */ r(G, { onClick: X, label: "Show less", children: /* @__PURE__ */ r(t, { $renderAs: "ub3-bold", $color: "BLACK_1", children: "Show less" }) }) })
|
|
94
103
|
] })
|
|
95
104
|
] })
|
|
96
105
|
]
|
|
97
106
|
}
|
|
98
107
|
)
|
|
99
108
|
] });
|
|
100
|
-
}, nr =
|
|
109
|
+
}, nr = F(z);
|
|
101
110
|
export {
|
|
102
111
|
nr as default
|
|
103
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goals-card.js","sources":["../../../../../../../src/features/timeline/monthly-report/comps/goals/goals-card/goals-card.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useMemo, useState } from 'react';\n\nimport { type IGoalsCardProps } from '../goals-types';\nimport { calculateProgress, GOAL_CATEGORY_CONFIG } from '../goals-constants';\nimport * as Styled from './goals-card-styled';\nimport Text from '../../../../../ui/text/text';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Image from '../../../../../ui/image/image';\nimport Clickable from '../../../../../ui/buttons/clickable/clickable';\nimport GoalsCardChapters from './goal-chapter-card';\nimport LinearProgressBar from '../../../../../ui/linear-progress-bar/linear-progress-bar';\n\nconst GoalsCard: FC<IGoalsCardProps> = ({ category, milestone, isExpended = false }) => {\n const [showAllChapters, setShowAllChapters] = useState(false);\n const {\n milestone_name: milestoneName,\n user_chapters: userChapters,\n progress_stat: progressStat,\n previous_progress_stat: prevProgressStat,\n } = milestone;\n const { completed, total } = progressStat;\n const { completed: prevCompleted, total: prevTotal } = prevProgressStat ?? {};\n const currentProgress = calculateProgress(completed, total);\n const previousProgress =\n prevProgressStat && prevCompleted && prevTotal\n ? calculateProgress(prevCompleted, prevTotal)\n : 0;\n\n const progressDifference = currentProgress - previousProgress;\n const showIndicator = Boolean(prevProgressStat && progressDifference > 0 && total === total);\n const showTag = Boolean(prevProgressStat && progressDifference <= 0 && total !== total);\n const isCompleted = currentProgress === 100;\n const roundedProgress = Math.round(currentProgress);\n const roundedDifference = Math.round(progressDifference);\n\n const totalChapters = userChapters.length;\n const visibleChapters = userChapters.slice(0, 2);\n const remainingChapters = Math.max(0, totalChapters - 2);\n const hiddenChapters = showAllChapters ? userChapters.slice(2) : [];\n const hasRemainingChapters = remainingChapters > 0;\n\n const categoryConfig = useMemo(() => GOAL_CATEGORY_CONFIG[category], []);\n const icon = categoryConfig.icon;\n\n const handleToggleChapters = useCallback(() => {\n setShowAllChapters(prev => !prev);\n }, []);\n\n return (\n <FlexView>\n <FlexView\n $position=\"relative\"\n $background={categoryConfig.backgroundColor}\n $borderColor={isExpended ? 'WHITE_5' : undefined}\n $gutterX={1}\n $gapX={1}\n $height={isExpended ? 'auto' : 72}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {icon && (\n <Image src={icon} withLoader width={40} height={40} alt={categoryConfig.label} />\n )}\n <FlexView>\n {isExpended && (\n <>\n <Text $renderAs=\"ac5\" $color={categoryConfig.labelColor}>\n {categoryConfig.label}\n </Text>\n <Separator heightX={0.25} />\n </>\n )}\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\">\n {milestoneName}\n </Text>\n <Separator heightX={isExpended ? 0.5 : 0.125} />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.25}>\n <Text $renderAs=\"ab3\" $color=\"BLACK_T_60\">\n {isCompleted ? 'Completed' : `${roundedProgress}% complete`}\n </Text>\n {showIndicator && !isCompleted && (\n <Text $renderAs=\"ab3\" $color=\"GREEN_6\">\n (+{roundedDifference}%)\n </Text>\n )}\n </FlexView>\n </FlexView>\n <Styled.ProgressBarContainer>\n <LinearProgressBar\n percentage={showIndicator ? previousProgress : currentProgress}\n delta={showIndicator ? progressDifference : 0}\n height={4}\n backgroundColor=\"WHITE_5\"\n fillColor=\"BLACK_1\"\n deltaProgressColor=\"GREEN_5\"\n />\n </Styled.ProgressBarContainer>\n </FlexView>\n {showTag && (\n <>\n <Separator heightX={0.875} />\n <Styled.TagContainer $gapX={0.5} $gutterX={1} $background={categoryConfig.tagColor}>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\">\n Learning plan was modified — progress updated accordingly.\n </Text>\n </Styled.TagContainer>\n </>\n )}\n </FlexView>\n {isExpended && totalChapters > 0 && (\n <Styled.ChaptersContainer\n $gapX={1}\n $flexDirection=\"column\"\n $flexGapX={1.25}\n $borderColor=\"WHITE_5\"\n >\n <GoalsCardChapters chapters={visibleChapters} />\n {hasRemainingChapters && (\n <>\n {!showAllChapters && (\n <FlexView $gutterX={4.5}>\n <Clickable\n onClick={handleToggleChapters}\n label={`+${remainingChapters} chapters`}\n >\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\">\n +{remainingChapters} chapters\n </Text>\n </Clickable>\n </FlexView>\n )}\n {showAllChapters && (\n <>\n <GoalsCardChapters chapters={hiddenChapters} />\n <FlexView $gutterX={4.5}>\n <Clickable onClick={handleToggleChapters} label=\"Show less\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\">\n Show less\n </Text>\n </Clickable>\n </FlexView>\n </>\n )}\n </>\n )}\n </Styled.ChaptersContainer>\n )}\n </FlexView>\n );\n};\n\nexport default memo(GoalsCard);\n"],"names":["GoalsCard","category","milestone","isExpended","showAllChapters","setShowAllChapters","useState","milestoneName","userChapters","progressStat","prevProgressStat","completed","total","prevCompleted","prevTotal","currentProgress","calculateProgress","previousProgress","progressDifference","showIndicator","showTag","isCompleted","roundedProgress","roundedDifference","totalChapters","visibleChapters","remainingChapters","hiddenChapters","hasRemainingChapters","categoryConfig","useMemo","GOAL_CATEGORY_CONFIG","icon","handleToggleChapters","useCallback","prev","FlexView","jsxs","jsx","Image","Fragment","Text","Separator","Styled.ProgressBarContainer","LinearProgressBar","Styled.TagContainer","Styled.ChaptersContainer","GoalsCardChapters","Clickable","GoalsCard$1","memo"],"mappings":";;;;;;;;;;;AAaA,MAAMA,IAAiC,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,YAAAC,IAAa,SAAY;AACtF,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GACtD;AAAA,IACJ,gBAAgBC;AAAA,IAChB,eAAeC;AAAA,IACf,eAAeC;AAAA,IACf,wBAAwBC;AAAA,EACtB,IAAAR,GACE,EAAE,WAAAS,GAAW,OAAAC,EAAU,IAAAH,GACvB,EAAE,WAAWI,GAAe,OAAOC,EAAU,IAAIJ,KAAoB,IACrEK,IAAkBC,EAAkBL,GAAWC,CAAK,GACpDK,IACJP,KAAoBG,KAAiBC,IACjCE,EAAkBH,GAAeC,CAAS,IAC1C,GAEAI,IAAqBH,IAAkBE,GACvCE,IAAgB,GAAQT,KAAoBQ,IAAqB,KAAKN,MAAUA,IAChFQ,IAAU,GAAQV,KAAoBQ,KAAsB,KAAKN,MAAUA,IAC3ES,IAAcN,MAAoB,KAClCO,IAAkB,KAAK,MAAMP,CAAe,GAC5CQ,IAAoB,KAAK,MAAML,CAAkB,GAEjDM,IAAgBhB,EAAa,QAC7BiB,IAAkBjB,EAAa,MAAM,GAAG,CAAC,GACzCkB,IAAoB,KAAK,IAAI,GAAGF,IAAgB,CAAC,GACjDG,IAAiBvB,IAAkBI,EAAa,MAAM,CAAC,IAAI,IAC3DoB,IAAuBF,IAAoB,GAE3CG,IAAiBC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BAAkB;AAAA,gBAAA,GACtB;AAAA,cAAA;AAAA,YAAA,GAEJ;AAAA,YAEDtB,KAEG,gBAAAiC,EAAAG,GAAA,EAAA,UAAA;AAAA,cAAC,gBAAAF,EAAAS,GAAA,EAAkB,UAAUpB,EAAgB,CAAA;AAAA,gCAC5CS,GAAS,EAAA,UAAU,KAClB,UAAC,gBAAAE,EAAAU,GAAA,EAAU,SAASf,GAAsB,OAAM,aAC9C,UAAA,gBAAAK,EAACG,KAAK,WAAU,YAAW,QAAO,WAAU,UAAA,aAE5C,GACF,EACF,CAAA;AAAA,YAAA,GACF;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeQ,KAAAC,EAAKlD,CAAS;"}
|
|
1
|
+
{"version":3,"file":"goals-card.js","sources":["../../../../../../../src/features/timeline/monthly-report/comps/goals/goals-card/goals-card.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useMemo, useState } from 'react';\n\nimport { type IGoalsCardProps } from '../goals-types';\nimport { calculateProgress, GOAL_CATEGORY_CONFIG } from '../goals-constants';\nimport * as Styled from './goals-card-styled';\nimport Text from '../../../../../ui/text/text';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Image from '../../../../../ui/image/image';\nimport Clickable from '../../../../../ui/buttons/clickable/clickable';\nimport GoalsCardChapters from './goal-chapter-card';\nimport LinearProgressBar from '../../../../../ui/linear-progress-bar/linear-progress-bar';\n\nconst GoalsCard: FC<IGoalsCardProps> = ({ category, milestone, isExpended = false }) => {\n const [showAllChapters, setShowAllChapters] = useState(false);\n const {\n milestone_name: milestoneName,\n user_chapters: userChapters,\n progress_stat: progressStat,\n previous_progress_stat: prevProgressStat,\n } = milestone;\n const { completed, total } = progressStat;\n const { completed: prevCompleted, total: prevTotal } = prevProgressStat ?? {};\n const currentProgress = calculateProgress(completed, total);\n const previousProgress =\n prevProgressStat && prevCompleted && prevTotal\n ? calculateProgress(prevCompleted, prevTotal)\n : 0;\n\n const progressDifference = currentProgress - previousProgress;\n const showIndicator = Boolean(prevProgressStat && progressDifference > 0 && total === total);\n const showTag = Boolean(prevProgressStat && progressDifference <= 0 && total !== total);\n const isCompleted = currentProgress === 100;\n const roundedProgress = Math.round(currentProgress);\n const roundedDifference = Math.round(progressDifference);\n\n const totalChapters = userChapters.length;\n const visibleChapters = userChapters.slice(0, 2);\n const remainingChapters = Math.max(0, totalChapters - 2);\n const hiddenChapters = showAllChapters ? userChapters.slice(2) : [];\n const hasRemainingChapters = remainingChapters > 0;\n\n const categoryConfig = useMemo(() => GOAL_CATEGORY_CONFIG[category], []);\n const icon = categoryConfig.icon;\n\n const handleToggleChapters = useCallback(() => {\n setShowAllChapters(prev => !prev);\n }, []);\n\n return (\n <FlexView>\n <FlexView\n $position=\"relative\"\n $background={categoryConfig.backgroundColor}\n $borderColor={isExpended ? 'WHITE_5' : undefined}\n $gutterX={1}\n $gapX={1}\n $height={isExpended ? 'auto' : 72}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={isExpended ? 1 : 0.5}>\n {icon && (\n <Image\n src={icon}\n withLoader\n width={isExpended ? 40 : 32}\n height={isExpended ? 40 : 32}\n alt={categoryConfig.label}\n />\n )}\n <FlexView>\n {isExpended && (\n <>\n <Text $renderAs=\"ac5\" $color={categoryConfig.labelColor}>\n {categoryConfig.label}\n </Text>\n <Separator heightX={0.25} />\n </>\n )}\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\">\n {milestoneName}\n </Text>\n <Separator heightX={isExpended ? 0.5 : 0.125} />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.25}>\n <Text $renderAs=\"ab3\" $color=\"BLACK_T_60\">\n {isCompleted ? 'Completed' : `${roundedProgress}% complete`}\n </Text>\n {showIndicator && !isCompleted && (\n <Text $renderAs=\"ab3\" $color=\"GREEN_6\">\n (+{roundedDifference}%)\n </Text>\n )}\n </FlexView>\n </FlexView>\n <Styled.ProgressBarContainer>\n <LinearProgressBar\n percentage={showIndicator ? previousProgress : currentProgress}\n delta={showIndicator ? progressDifference : 0}\n height={4}\n backgroundColor=\"WHITE_5\"\n fillColor=\"BLACK_1\"\n deltaProgressColor=\"GREEN_5\"\n />\n </Styled.ProgressBarContainer>\n </FlexView>\n {showTag && (\n <>\n <Separator heightX={0.875} />\n <Styled.TagContainer $gapX={0.5} $gutterX={1} $background={categoryConfig.tagColor}>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\">\n Learning plan was modified — progress updated accordingly.\n </Text>\n </Styled.TagContainer>\n </>\n )}\n </FlexView>\n {isExpended && totalChapters > 0 && (\n <Styled.ChaptersContainer\n $gapX={1}\n $flexDirection=\"column\"\n $flexGapX={1.25}\n $borderColor=\"WHITE_5\"\n >\n <GoalsCardChapters chapters={visibleChapters} />\n {hasRemainingChapters && (\n <>\n {!showAllChapters && (\n <FlexView $gutterX={4.5}>\n <Clickable\n onClick={handleToggleChapters}\n label={`+${remainingChapters} chapters`}\n >\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\">\n +{remainingChapters} chapters\n </Text>\n </Clickable>\n </FlexView>\n )}\n {showAllChapters && (\n <>\n <GoalsCardChapters chapters={hiddenChapters} />\n <FlexView $gutterX={4.5}>\n <Clickable onClick={handleToggleChapters} label=\"Show less\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\">\n Show less\n </Text>\n </Clickable>\n </FlexView>\n </>\n )}\n </>\n )}\n </Styled.ChaptersContainer>\n )}\n </FlexView>\n );\n};\n\nexport default memo(GoalsCard);\n"],"names":["GoalsCard","category","milestone","isExpended","showAllChapters","setShowAllChapters","useState","milestoneName","userChapters","progressStat","prevProgressStat","completed","total","prevCompleted","prevTotal","currentProgress","calculateProgress","previousProgress","progressDifference","showIndicator","showTag","isCompleted","roundedProgress","roundedDifference","totalChapters","visibleChapters","remainingChapters","hiddenChapters","hasRemainingChapters","categoryConfig","useMemo","GOAL_CATEGORY_CONFIG","icon","handleToggleChapters","useCallback","prev","FlexView","jsxs","jsx","Image","Fragment","Text","Separator","Styled.ProgressBarContainer","LinearProgressBar","Styled.TagContainer","Styled.ChaptersContainer","GoalsCardChapters","Clickable","GoalsCard$1","memo"],"mappings":";;;;;;;;;;;AAaA,MAAMA,IAAiC,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,YAAAC,IAAa,SAAY;AACtF,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GACtD;AAAA,IACJ,gBAAgBC;AAAA,IAChB,eAAeC;AAAA,IACf,eAAeC;AAAA,IACf,wBAAwBC;AAAA,EACtB,IAAAR,GACE,EAAE,WAAAS,GAAW,OAAAC,EAAU,IAAAH,GACvB,EAAE,WAAWI,GAAe,OAAOC,EAAU,IAAIJ,KAAoB,IACrEK,IAAkBC,EAAkBL,GAAWC,CAAK,GACpDK,IACJP,KAAoBG,KAAiBC,IACjCE,EAAkBH,GAAeC,CAAS,IAC1C,GAEAI,IAAqBH,IAAkBE,GACvCE,IAAgB,GAAQT,KAAoBQ,IAAqB,KAAKN,MAAUA,IAChFQ,IAAU,GAAQV,KAAoBQ,KAAsB,KAAKN,MAAUA,IAC3ES,IAAcN,MAAoB,KAClCO,IAAkB,KAAK,MAAMP,CAAe,GAC5CQ,IAAoB,KAAK,MAAML,CAAkB,GAEjDM,IAAgBhB,EAAa,QAC7BiB,IAAkBjB,EAAa,MAAM,GAAG,CAAC,GACzCkB,IAAoB,KAAK,IAAI,GAAGF,IAAgB,CAAC,GACjDG,IAAiBvB,IAAkBI,EAAa,MAAM,CAAC,IAAI,IAC3DoB,IAAuBF,IAAoB,GAE3CG,IAAiBC,EAAQ,MAAMC,EAAqB9B,CAAQ,GAAG,CAAA,CAAE,GACjE+B,IAAOH,EAAe,MAEtBI,IAAuBC,EAAY,MAAM;AAC1B,IAAA7B,EAAA,CAAA8B,MAAQ,CAACA,CAAI;AAAA,EAClC,GAAG,CAAE,CAAA;AAE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,EAAAG,GAAA,EAAA,UAAA;AAAA,cAAC,gBAAAF,EAAAS,GAAA,EAAkB,UAAUpB,EAAgB,CAAA;AAAA,gCAC5CS,GAAS,EAAA,UAAU,KAClB,UAAC,gBAAAE,EAAAU,GAAA,EAAU,SAASf,GAAsB,OAAM,aAC9C,UAAA,gBAAAK,EAACG,KAAK,WAAU,YAAW,QAAO,WAAU,UAAA,aAE5C,GACF,EACF,CAAA;AAAA,YAAA,GACF;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeQ,KAAAC,EAAKlD,CAAS;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { memo as x } from "react";
|
|
3
3
|
import { GoalsSection as P } from "./monthly-card.styled.js";
|
|
4
4
|
import I from "../../../monthly-report/comps/goals/goals-card/goals-card.js";
|
|
5
|
-
import
|
|
5
|
+
import n from "../../../../ui/layout/flex-view.js";
|
|
6
6
|
import M from "../../../../ui/buttons/clickable/clickable.js";
|
|
7
7
|
import w from "../../../../../assets/line-icons/icons/carat-right.js";
|
|
8
8
|
import $ from "../../../../ui/text/text.js";
|
|
@@ -28,8 +28,8 @@ const T = ({
|
|
|
28
28
|
icon: "full"
|
|
29
29
|
});
|
|
30
30
|
const d = l === o.PTM ? [] : ((m = e == null ? void 0 : e.progress_data) == null ? void 0 : m.user_milestones) || [];
|
|
31
|
-
return l === o.MPR_V2 && !((h = (f = e == null ? void 0 : e.progress_data) == null ? void 0 : f.user_milestones) != null && h.length) ? /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
return l === o.MPR_V2 && !((h = (f = e == null ? void 0 : e.progress_data) == null ? void 0 : f.user_milestones) != null && h.length) ? /* @__PURE__ */ a(
|
|
32
|
+
n,
|
|
33
33
|
{
|
|
34
34
|
$flexDirection: "row",
|
|
35
35
|
$alignItems: "center",
|
|
@@ -39,7 +39,7 @@ const T = ({
|
|
|
39
39
|
$borderColor: "WHITE_5",
|
|
40
40
|
$background: "WHITE_3",
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */ i(g, { src: L.NO_REPORT, alt: "report icon", withLoader: !0, width:
|
|
42
|
+
/* @__PURE__ */ i(g, { src: L.NO_REPORT, alt: "report icon", withLoader: !0, width: 32, height: 32 }),
|
|
43
43
|
/* @__PURE__ */ i($, { $renderAs: "ub2", $color: "BLACK_1", children: "Report unavailable - no activity this month." })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
@@ -49,7 +49,7 @@ const T = ({
|
|
|
49
49
|
onClick: b,
|
|
50
50
|
disabled: !(e != null && e.id) && l !== o.MPR_V1,
|
|
51
51
|
label: "Report Card click",
|
|
52
|
-
children: /* @__PURE__ */ n
|
|
52
|
+
children: /* @__PURE__ */ a(n, { $flexGap: 1, $borderColor: "BLACK_1", children: [
|
|
53
53
|
!!d.length && /* @__PURE__ */ i(P, { $flexGap: 1, children: d.map((r, C) => /* @__PURE__ */ i(
|
|
54
54
|
I,
|
|
55
55
|
{
|
|
@@ -59,21 +59,20 @@ const T = ({
|
|
|
59
59
|
},
|
|
60
60
|
r.user_milestone_id || C
|
|
61
61
|
)) }),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
n,
|
|
64
64
|
{
|
|
65
65
|
$flexDirection: "row",
|
|
66
66
|
$alignItems: "center",
|
|
67
67
|
$justifyContent: "space-between",
|
|
68
68
|
$background: "BLACK_1",
|
|
69
|
-
$gutterX: 1,
|
|
70
69
|
$heightX: 3,
|
|
71
70
|
children: [
|
|
72
|
-
/* @__PURE__ */ n
|
|
71
|
+
/* @__PURE__ */ a(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.5, $gutterX: 1, children: [
|
|
73
72
|
/* @__PURE__ */ i(g, { src: t.icon, alt: "report icon", withLoader: !0, width: 32, height: 32 }),
|
|
74
73
|
/* @__PURE__ */ i($, { $renderAs: "ub2-bold", $color: "WHITE", children: t.label })
|
|
75
74
|
] }),
|
|
76
|
-
/* @__PURE__ */ i(w, { width: 24, height: 24, color: "WHITE" })
|
|
75
|
+
/* @__PURE__ */ i(n, { $gutterX: 0.75, children: /* @__PURE__ */ i(w, { width: 24, height: 24, color: "WHITE" }) })
|
|
77
76
|
]
|
|
78
77
|
}
|
|
79
78
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-card.js","sources":["../../../../../../src/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IMonthlyReportCardProps } from './monthly-card-types';\nimport * as Styled from './monthly-card.styled';\nimport GoalsCard from '../../../monthly-report/comps/goals/goals-card/goals-card';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport Text from '../../../../ui/text/text';\nimport Image from '../../../../ui/image/image';\nimport { monthNames, REPORT_CONFIG } from '../../constants';\nimport { REPORT_TYPE } from '../../monthly-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\n\nconst MonthlyReportCard: FC<IMonthlyReportCardProps> = ({\n report,\n year,\n month,\n onReportClick,\n reportType,\n courseStream,\n}) => {\n const handleReportClick = () => {\n if (onReportClick) {\n onReportClick(report?.id || '', reportType, year, monthNames[month - 1] || '');\n }\n };\n\n let config = { label: '', icon: '' };\n\n if (reportType === REPORT_TYPE.PTM) {\n config = REPORT_CONFIG.PTM ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V1) {\n config = REPORT_CONFIG.MPR_V1 ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V2) {\n config = REPORT_CONFIG['MPR_V2_' + (courseStream || '').toLowerCase()] ?? {\n label: 'Report',\n icon: 'full',\n };\n }\n\n const reportMilestones =\n reportType === REPORT_TYPE.PTM ? [] : report?.progress_data?.user_milestones || [];\n\n if (reportType === REPORT_TYPE.MPR_V2 && !report?.progress_data?.user_milestones?.length) {\n return (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={0.5}\n $gutterX={0.5}\n $gapX={1}\n $borderColor=\"WHITE_5\"\n $background=\"WHITE_3\"\n >\n <Image src={ILLUSTRATIONS.NO_REPORT} alt=\"report icon\" withLoader width={
|
|
1
|
+
{"version":3,"file":"monthly-card.js","sources":["../../../../../../src/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IMonthlyReportCardProps } from './monthly-card-types';\nimport * as Styled from './monthly-card.styled';\nimport GoalsCard from '../../../monthly-report/comps/goals/goals-card/goals-card';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport Text from '../../../../ui/text/text';\nimport Image from '../../../../ui/image/image';\nimport { monthNames, REPORT_CONFIG } from '../../constants';\nimport { REPORT_TYPE } from '../../monthly-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\n\nconst MonthlyReportCard: FC<IMonthlyReportCardProps> = ({\n report,\n year,\n month,\n onReportClick,\n reportType,\n courseStream,\n}) => {\n const handleReportClick = () => {\n if (onReportClick) {\n onReportClick(report?.id || '', reportType, year, monthNames[month - 1] || '');\n }\n };\n\n let config = { label: '', icon: '' };\n\n if (reportType === REPORT_TYPE.PTM) {\n config = REPORT_CONFIG.PTM ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V1) {\n config = REPORT_CONFIG.MPR_V1 ?? { label: 'Report', icon: 'full' };\n } else if (reportType === REPORT_TYPE.MPR_V2) {\n config = REPORT_CONFIG['MPR_V2_' + (courseStream || '').toLowerCase()] ?? {\n label: 'Report',\n icon: 'full',\n };\n }\n\n const reportMilestones =\n reportType === REPORT_TYPE.PTM ? [] : report?.progress_data?.user_milestones || [];\n\n if (reportType === REPORT_TYPE.MPR_V2 && !report?.progress_data?.user_milestones?.length) {\n return (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={0.5}\n $gutterX={0.5}\n $gapX={1}\n $borderColor=\"WHITE_5\"\n $background=\"WHITE_3\"\n >\n <Image src={ILLUSTRATIONS.NO_REPORT} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n Report unavailable - no activity this month.\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Clickable\n onClick={handleReportClick}\n disabled={!report?.id && reportType !== REPORT_TYPE.MPR_V1}\n label=\"Report Card click\"\n >\n <FlexView $flexGap={1} $borderColor=\"BLACK_1\">\n {!!reportMilestones.length && (\n <Styled.GoalsSection $flexGap={1}>\n {reportMilestones.map((milestone, milestoneIndex) => (\n <GoalsCard\n key={milestone.user_milestone_id || milestoneIndex}\n category={milestone.goal_category}\n milestone={milestone}\n isExpended={false}\n />\n ))}\n </Styled.GoalsSection>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $background=\"BLACK_1\"\n $heightX={3}\n >\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.5} $gutterX={1}>\n <Image src={config.icon} alt=\"report icon\" withLoader width={32} height={32} />\n <Text $renderAs=\"ub2-bold\" $color=\"WHITE\">\n {config.label}\n </Text>\n </FlexView>\n <FlexView $gutterX={0.75}>\n <CaratRightIcon width={24} height={24} color=\"WHITE\" />\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n );\n};\n\nexport default memo(MonthlyReportCard);\n"],"names":["MonthlyReportCard","report","year","month","onReportClick","reportType","courseStream","handleReportClick","monthNames","config","REPORT_TYPE","REPORT_CONFIG","reportMilestones","_a","_c","_b","jsxs","FlexView","jsx","Image","ILLUSTRATIONS","Text","Clickable","Styled.GoalsSection","milestone","milestoneIndex","GoalsCard","CaratRightIcon","MonthlyReportCard$1","memo"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,IAAiD,CAAC;AAAA,EACtD,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AACF,MAAM;;AACJ,QAAMC,IAAoB,MAAM;AAC9B,IAAIH,KACYA,GAAAH,KAAA,gBAAAA,EAAQ,OAAM,IAAII,GAAYH,GAAMM,EAAWL,IAAQ,CAAC,KAAK,EAAE;AAAA,EAC/E;AAGF,MAAIM,IAAS,EAAE,OAAO,IAAI,MAAM,GAAG;AAE/B,EAAAJ,MAAeK,EAAY,MAC7BD,IAASE,EAAc,OAAO,EAAE,OAAO,UAAU,MAAM,WAC9CN,MAAeK,EAAY,SACpCD,IAASE,EAAc,UAAU,EAAE,OAAO,UAAU,MAAM,WACjDN,MAAeK,EAAY,WACpCD,IAASE,EAAc,aAAaL,KAAgB,IAAI,YAAA,CAAa,KAAK;AAAA,IACxE,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAIJ,QAAAM,IACJP,MAAeK,EAAY,MAAM,CAAK,MAAAG,IAAAZ,KAAA,gBAAAA,EAAQ,kBAAR,gBAAAY,EAAuB,oBAAmB;AAElF,SAAIR,MAAeK,EAAY,UAAU,GAACI,KAAAC,IAAAd,KAAA,gBAAAA,EAAQ,kBAAR,gBAAAc,EAAuB,oBAAvB,QAAAD,EAAwC,UAE9E,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,WAAW;AAAA,MACX,UAAU;AAAA,MACV,OAAO;AAAA,MACP,cAAa;AAAA,MACb,aAAY;AAAA,MAEZ,UAAA;AAAA,QAAC,gBAAAC,EAAAC,GAAA,EAAM,KAAKC,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AA,GACvD;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,IAAAC,EAAK7B,CAAiB;"}
|
|
@@ -33,7 +33,7 @@ const _ = ({
|
|
|
33
33
|
const a = $ === 0, u = r.month === 12, s = !a && u, h = F[r.year];
|
|
34
34
|
return /* @__PURE__ */ l(t, { $width: "100%", children: [
|
|
35
35
|
!a && !s && /* @__PURE__ */ e(c, { heightX: 2 }),
|
|
36
|
-
s && h && /* @__PURE__ */ e(M, { $marginBottom: -
|
|
36
|
+
s && h && /* @__PURE__ */ e(M, { $marginBottom: -122, children: /* @__PURE__ */ e(E, { src: h, alt: r.year.toString(), height: "248px" }) }),
|
|
37
37
|
/* @__PURE__ */ l(t, { $gutterX: 1, children: [
|
|
38
38
|
/* @__PURE__ */ e(D, { $renderAs: "ac4", $color: "BLACK_T_60", children: X[r.month - 1] }),
|
|
39
39
|
/* @__PURE__ */ e(c, { heightX: 1 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { useMonthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n}) => {\n const {\n get: getTimeline,\n data: timelineData,\n isProcessing,\n isProcessingFailed,\n } = useMonthlyTimelineGet();\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, {\n course_stream: userType === 'TEACHER' ? courseStreams : [],\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n });\n }, [getTimeline, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing || !timelineData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-
|
|
1
|
+
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { useMonthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n}) => {\n const {\n get: getTimeline,\n data: timelineData,\n isProcessing,\n isProcessingFailed,\n } = useMonthlyTimelineGet();\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, {\n course_stream: userType === 'TEACHER' ? courseStreams : [],\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n });\n }, [getTimeline, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing || !timelineData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} height=\"248px\" />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Text $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Text>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","getTimeline","timelineData","isProcessing","isProcessingFailed","useMonthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Text","monthNames","MonthlyTimelineView","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IAC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