touchstudy-core 0.1.166 → 0.1.168

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/components/Chats/components/TinyChatEditor.d.ts +3 -1
  2. package/dist/components/Dialogs/CommonDialog.d.ts +3 -1
  3. package/dist/components/Dialogs/index.d.ts +2 -1
  4. package/dist/components/Selectors/QuestionCountSelector.d.ts +0 -1
  5. package/dist/containers/ExamResult/components/MyAnswer/components/SelectQuestion.d.ts +1 -1
  6. package/dist/containers/ExamResult/configs/types.d.ts +2 -0
  7. package/dist/containers/ExamResult/hooks/useExamResultData.d.ts +1 -0
  8. package/dist/containers/PreparedTextbook/configs/constants.d.ts +0 -1
  9. package/dist/containers/StudentInfoDrawer/apiClients/courseService.d.ts +2 -1
  10. package/dist/containers/StudentInfoDrawer/components/Attendance/AttedanceFormDialog.d.ts +13 -0
  11. package/dist/containers/StudentInfoDrawer/components/Attendance/AttendanceCourseTable.d.ts +2 -3
  12. package/dist/containers/StudentInfoDrawer/components/Attendance/AttendanceFormBody.d.ts +11 -0
  13. package/dist/containers/StudentInfoDrawer/components/Attendance/AttendanceFormDialog.d.ts +13 -0
  14. package/dist/containers/StudentInfoDrawer/components/Attendance/CourseAttendanceItem.d.ts +2 -3
  15. package/dist/containers/StudentInfoDrawer/components/Attendance/DrawerAttendanceTab.d.ts +5 -1
  16. package/dist/containers/StudentInfoDrawer/components/Attendance/LessonTooltip.d.ts +2 -1
  17. package/dist/containers/StudentInfoDrawer/configs/fns.d.ts +2 -2
  18. package/dist/containers/StudentInfoDrawer/configs/interfaces.d.ts +3 -3
  19. package/dist/containers/StudentInfoDrawer/configs/types.d.ts +16 -2
  20. package/dist/containers/StudentInfoDrawer/hooks/useDrawerAttendanceTab.d.ts +6 -3
  21. package/dist/containers/StudentInfoDrawer/index.d.ts +5 -1
  22. package/dist/index.css +586 -0
  23. package/dist/index.js +1535 -1251
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.modern.js +1527 -1247
  26. package/dist/index.modern.js.map +1 -1
  27. package/dist/utils/functions/isRealTabletOrMobileDevice.d.ts +1 -0
  28. package/dist/utils/hooks/index.d.ts +2 -1
  29. package/dist/utils/hooks/useKeyboardVisible.d.ts +6 -0
  30. package/package.json +1 -1
@@ -5,6 +5,8 @@ declare type Props = {
5
5
  initValue: string;
6
6
  onChange: any;
7
7
  disabled?: boolean;
8
+ onFocus?: any;
9
+ onBlur?: any;
8
10
  };
9
- declare const TinyChatEditor: ({ disabled, onChange, initValue, config }: Props) => React.JSX.Element;
11
+ declare const TinyChatEditor: ({ disabled, onChange, initValue, config, onFocus, onBlur }: Props) => React.JSX.Element;
10
12
  export default TinyChatEditor;
@@ -1,5 +1,5 @@
1
1
  import { FC, PropsWithChildren } from "react";
2
- import { DialogProps } from "@mui/material";
2
+ import { DialogProps, SxProps, Theme } from "@mui/material";
3
3
  interface Props {
4
4
  open: boolean;
5
5
  onClose: (event?: any, reason?: "backdropClick" | "escapeKeyDown") => void;
@@ -8,6 +8,8 @@ interface Props {
8
8
  isShowHeader?: boolean;
9
9
  titleClassName?: string;
10
10
  minWidth?: string;
11
+ zIndex?: number;
12
+ paperSx?: SxProps<Theme>;
11
13
  }
12
14
  declare const CommonDialog: FC<Props & PropsWithChildren>;
13
15
  export default CommonDialog;
@@ -1,5 +1,6 @@
1
1
  import CommonDialog from "./CommonDialog";
2
2
  import ConfirmDeleteDialog from "./ConfirmDeleteDialog";
3
3
  import { ConfirmDialog } from "./ConfirmDialog";
4
+ import CommonCreateNewQuestionDialog from "./CreateQuestionDialog";
4
5
  import PassCodeDialog from "./PassCodeDialog";
5
- export { CommonDialog, ConfirmDialog, PassCodeDialog, ConfirmDeleteDialog };
6
+ export { CommonDialog, ConfirmDialog, PassCodeDialog, ConfirmDeleteDialog, CommonCreateNewQuestionDialog };
@@ -5,7 +5,6 @@ interface Props {
5
5
  onChange: Function;
6
6
  isDisabled?: boolean;
7
7
  rest?: any;
8
- totalQuestions?: number;
9
8
  }
10
9
  declare const QuestionCountSelector: FC<Props>;
11
10
  export default QuestionCountSelector;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  declare type Props = {
3
3
  openCreateQuestionDialog: boolean;
4
4
  toggleCreateQuestion: () => void;
@@ -101,5 +101,7 @@ export declare type ExamResultV2Props = {
101
101
  isMyStoryStudent?: boolean;
102
102
  chapterId?: number;
103
103
  role: Role;
104
+ showLoading?: boolean;
105
+ onLoadingChange?: (isLoading: boolean) => void;
104
106
  onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
105
107
  };
@@ -12,6 +12,7 @@ interface Props {
12
12
  selectedTab?: number;
13
13
  isPrint?: boolean;
14
14
  chapterId?: number;
15
+ onLoadingChange?: (val: boolean) => void;
15
16
  }
16
17
  declare const useExamResultData: (props: Props) => {
17
18
  t: any;
@@ -93,4 +93,3 @@ export declare const CompareTypeOptions: {
93
93
  label: string;
94
94
  value: QuestionAnswerType;
95
95
  }[];
96
- export declare const MAX_QUESTIONS_IN_QUESTION_GROUP = 20;
@@ -1,3 +1,4 @@
1
1
  import { BaseSearchQuery } from "../../../utils";
2
+ import { AttendanceRequest } from "../configs/types";
2
3
  export declare const getAttendanceByStudentIdApi: (studentId: number, query: BaseSearchQuery<string>) => Promise<import("axios").AxiosResponse<any, any>>;
3
- export declare const getCheckInLessonsApi: (lessonId: number, studentId: number) => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const getCheckInLessonsApi: (lessonId: number, attendanceRequest: AttendanceRequest) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,13 @@
1
+ import { FC } from "react";
2
+ import { Attendance, AttendanceRequest, LessonResponse } from "../../configs/types";
3
+ interface Props {
4
+ lesson: LessonResponse;
5
+ open: boolean;
6
+ studentId: number;
7
+ attendance?: Attendance;
8
+ onSearchTeachers: (text: string) => void;
9
+ onClose: () => void;
10
+ onSubmit: (attendance: AttendanceRequest) => void;
11
+ }
12
+ declare const LessonFormDialog: FC<Props>;
13
+ export default LessonFormDialog;
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { LessonAttendance, LessonResponse } from "../../configs/types";
2
+ import { Attendance, LessonAttendance, LessonResponse } from "../../configs/types";
3
3
  interface AttendanceCourseTableProps {
4
4
  data: LessonAttendance[];
5
5
  containerProps?: any;
@@ -8,8 +8,7 @@ interface AttendanceCourseTableProps {
8
8
  mainTeacherName: string;
9
9
  courseName: string;
10
10
  courseId: number;
11
- studentId: number;
12
- onCheckInLesson: (lesson: LessonResponse, studentId: number) => void;
11
+ onCheckInLesson: (lesson: LessonResponse, attendance?: Attendance) => void;
13
12
  }
14
13
  declare const AttendanceCourseTable: FC<AttendanceCourseTableProps>;
15
14
  export default AttendanceCourseTable;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { FormikProps } from "formik";
3
+ import { Attendance, AttendanceFormRequest, LessonResponse } from "../../configs/types";
4
+ interface AttendanceFormBodyProps {
5
+ formikProp: FormikProps<AttendanceFormRequest>;
6
+ lesson: LessonResponse;
7
+ attendance?: Attendance;
8
+ onClose: () => void;
9
+ }
10
+ declare const AttendanceFormBody: FC<AttendanceFormBodyProps>;
11
+ export default AttendanceFormBody;
@@ -0,0 +1,13 @@
1
+ import { FC } from "react";
2
+ import { Attendance, AttendanceRequest, LessonResponse } from "../../configs/types";
3
+ interface Props {
4
+ lesson?: LessonResponse;
5
+ open: boolean;
6
+ studentId: number;
7
+ attendance?: Attendance;
8
+ zIndex?: number;
9
+ onClose: () => void;
10
+ onSubmit: (lesson: LessonResponse, attendance: AttendanceRequest) => Promise<void>;
11
+ }
12
+ declare const AttendanceFormDialog: FC<Props>;
13
+ export default AttendanceFormDialog;
@@ -1,9 +1,8 @@
1
1
  import { FC } from "react";
2
- import { CourseAttendanceResponse, LessonResponse } from "../../configs/types";
2
+ import { Attendance, CourseAttendanceResponse, LessonResponse } from "../../configs/types";
3
3
  interface Props {
4
- studentId: number;
5
4
  data: CourseAttendanceResponse;
6
- onCheckInLesson: (lesson: LessonResponse, studentId: number) => void;
5
+ onCheckInLesson: (lesson: LessonResponse, attendance?: Attendance) => void;
7
6
  onLoad?: () => void;
8
7
  }
9
8
  declare const CourseAttendanceItem: FC<Props>;
@@ -1,4 +1,8 @@
1
1
  import { FC } from "react";
2
2
  import { TabContentProps } from "../../configs/interfaces";
3
- declare const DrawerAttendanceTab: FC<TabContentProps>;
3
+ import { Attendance } from "../../configs/types";
4
+ interface Props extends TabContentProps {
5
+ onUpdatedAttendance?: (attendance: Attendance, studentId: number) => void;
6
+ }
7
+ declare const DrawerAttendanceTab: FC<Props>;
4
8
  export default DrawerAttendanceTab;
@@ -3,6 +3,7 @@ import { Attendance, LessonResponse } from "../../configs/types";
3
3
  declare type Props = {
4
4
  lesson: LessonResponse;
5
5
  lessonAttendance?: Attendance;
6
+ padding?: number | string;
6
7
  };
7
- declare const LessonTooltip: ({ lesson, lessonAttendance }: Props) => React.JSX.Element;
8
+ declare const LessonTooltip: ({ lesson, lessonAttendance, padding }: Props) => React.JSX.Element;
8
9
  export default LessonTooltip;
@@ -1,3 +1,4 @@
1
+ import { moment } from "../../../utils";
1
2
  export declare const formatGrade: (grade: number, t: any, language?: string | undefined) => string;
2
3
  export declare const formatLessonOrder: (index: number, t: any, language?: string | undefined) => string;
3
4
  export declare const formatTime: (t: any, timeInMilliseconds: number) => any;
@@ -22,5 +23,4 @@ export declare const a11yProps: (index: number) => {
22
23
  };
23
24
  };
24
25
  };
25
- export declare const subtractTime: (time1: string, time2: string, t: any) => string;
26
- export declare const formatTimeHHmm: (time: string) => string;
26
+ export declare const subtractTime: (time1: moment.Moment, time2: moment.Moment, t: any) => string;
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from "@mui/material";
2
2
  import { DrawerTab } from "./enums";
3
- import { CourseAttendanceResponse, ExamSessionResponse, LessonResponse, TextbookResponse } from "./types";
3
+ import { Attendance, CourseAttendanceResponse, ExamSessionResponse, LessonResponse, TextbookResponse } from "./types";
4
4
  import { Role } from "../../../utils";
5
5
  export interface StudentInfoDrawerProps {
6
6
  role: Role;
@@ -12,6 +12,7 @@ export interface StudentInfoDrawerProps {
12
12
  width?: number | string;
13
13
  history: any;
14
14
  onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
15
+ onUpdatedAttendance?: (attendance: Attendance, studentId: number) => void;
15
16
  }
16
17
  export interface TabContentProps {
17
18
  studentId: number;
@@ -19,13 +20,12 @@ export interface TabContentProps {
19
20
  value: DrawerTab;
20
21
  }
21
22
  export interface CourseAttendanceListProps {
22
- studentId: number;
23
23
  data: CourseAttendanceResponse[];
24
24
  containerProps?: BoxProps;
25
25
  isLoading: boolean;
26
26
  listHeight?: number;
27
27
  onLoadMore: () => void;
28
- onCheckInLesson: (lesson: LessonResponse, studentId: number) => void;
28
+ onCheckInLesson: (lesson: LessonResponse, attendance?: Attendance) => void;
29
29
  }
30
30
  export interface ExamResultListProps {
31
31
  studentId: number;
@@ -1,4 +1,4 @@
1
- import { BaseSearchQuery, ExamStatus, PreparedType } from "../../../utils";
1
+ import { BaseSearchQuery, ExamStatus, moment, PreparedType } from "../../../utils";
2
2
  import { StudentAttendanceStatus } from "./enums";
3
3
  export declare type StudentInfo = {
4
4
  id: number;
@@ -28,7 +28,7 @@ export declare type LessonAttendance = {
28
28
  };
29
29
  export declare type Attendance = {
30
30
  lessonId: number;
31
- attendanceTime: string;
31
+ attendanceTime?: string;
32
32
  status: StudentAttendanceStatus;
33
33
  };
34
34
  export declare type LessonResponse = {
@@ -99,3 +99,17 @@ export declare type TextbookResponse = {
99
99
  isStudying: boolean;
100
100
  totalAnswerTime: number;
101
101
  };
102
+ export declare type AttendanceRequest = {
103
+ studentId: number;
104
+ status: StudentAttendanceStatus;
105
+ attendanceTime?: string;
106
+ };
107
+ export declare type AttendanceFormRequest = {
108
+ studentId: number;
109
+ status: StudentAttendanceStatus;
110
+ attendanceTime?: moment.Moment;
111
+ };
112
+ export declare type AttendanceDialogData = {
113
+ attendance?: Attendance;
114
+ lesson: LessonResponse;
115
+ };
@@ -1,8 +1,11 @@
1
- import { CourseAttendanceResponse, LessonResponse } from "../configs/types";
2
- declare const useDrawerAttendanceTab: (studentId: number) => {
1
+ import { Attendance, AttendanceDialogData, AttendanceRequest, CourseAttendanceResponse, LessonResponse } from "../configs/types";
2
+ declare const useDrawerAttendanceTab: (studentId: number, onUpdatedAttendance?: ((attendance: Attendance, studentId: number) => void) | undefined) => {
3
3
  items: CourseAttendanceResponse[];
4
4
  isLoading: boolean;
5
+ openAttendanceDalog: AttendanceDialogData | undefined;
5
6
  handleLoadMore: () => void;
6
- handleCheckInLesson: (lesson: LessonResponse, studentId: number) => Promise<void>;
7
+ handleCheckInLesson: (lesson: LessonResponse, attendance?: Attendance | undefined) => void;
8
+ handleCloseAttendanceDialog: () => void;
9
+ handleUpdateStudentAttendance: (lesson: LessonResponse, attendanceRequest: AttendanceRequest) => Promise<void>;
7
10
  };
8
11
  export default useDrawerAttendanceTab;
@@ -1,2 +1,6 @@
1
+ import AttendanceFormDialog from "./components/Attendance/AttendanceFormDialog";
1
2
  import StudentInfoDrawer from "./views/StudentInfoDrawer";
2
- export { StudentInfoDrawer };
3
+ import { AttendanceRequest, AttendanceDialogData } from "./configs/types";
4
+ import LessonTooltip from "./components/Attendance/LessonTooltip";
5
+ export { StudentInfoDrawer, AttendanceFormDialog, LessonTooltip };
6
+ export type { AttendanceRequest, AttendanceDialogData };