touchstudy-core 0.1.17 → 0.1.19

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 (79) hide show
  1. package/dist/assets/iconAssignedQuestions.d.ts +3 -0
  2. package/dist/assets/iconBtnFeedback.d.ts +3 -0
  3. package/dist/assets/iconBtnNextChart.d.ts +3 -0
  4. package/dist/assets/iconBtnPrevChart.d.ts +3 -0
  5. package/dist/assets/iconBtnTerminate.d.ts +3 -0
  6. package/dist/assets/iconChat.d.ts +3 -0
  7. package/dist/assets/iconCloseDialog.d.ts +3 -0
  8. package/dist/assets/iconCorrectAnswer.d.ts +3 -0
  9. package/dist/assets/iconDownArrow.d.ts +3 -0
  10. package/dist/assets/iconInCorrectAnswer.d.ts +3 -0
  11. package/dist/assets/iconMeanTime.d.ts +3 -0
  12. package/dist/assets/iconMyPoolTime.d.ts +3 -0
  13. package/dist/assets/iconNoGrass.d.ts +3 -0
  14. package/dist/assets/iconNoStarQuestion.d.ts +3 -0
  15. package/dist/assets/iconStarQuestion.d.ts +3 -0
  16. package/dist/assets/iconTopTime.d.ts +3 -0
  17. package/dist/assets/iconUpArrow.d.ts +3 -0
  18. package/dist/assets/iconWarning.d.ts +3 -0
  19. package/dist/assets/iconX.d.ts +3 -0
  20. package/dist/components/Chats/InputChat.d.ts +2 -3
  21. package/dist/components/Chats/configs/types.d.ts +9 -1
  22. package/dist/components/Dialogs/CommonDialog.d.ts +4 -3
  23. package/dist/components/Dialogs/ConfirmDialog.d.ts +1 -0
  24. package/dist/components/Inputs/InputText.d.ts +4 -0
  25. package/dist/components/Selectors/AnswerCountSelector.d.ts +9 -0
  26. package/dist/components/Selectors/ArticleCategorySelector.d.ts +11 -0
  27. package/dist/components/Selectors/QuestionCountSelector.d.ts +9 -0
  28. package/dist/components/Selectors/ScoreSelector.d.ts +9 -0
  29. package/dist/components/Selectors/configs/constants.d.ts +4 -0
  30. package/dist/components/Selects/CustomSelectOption.d.ts +3 -0
  31. package/dist/containers/ExamResult/apiClients/index.d.ts +12 -0
  32. package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +5 -0
  33. package/dist/containers/ExamResult/components/Dialog/CreateNewQuestion.d.ts +9 -0
  34. package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +12 -0
  35. package/dist/containers/ExamResult/components/MyAnswer/components/CreateNewQuestion.d.ts +12 -0
  36. package/dist/containers/ExamResult/components/MyAnswer/hooks/useCreateDialog.d.ts +10 -0
  37. package/dist/containers/ExamResult/components/MyAnswer/hooks/useMyAnswer.d.ts +10 -0
  38. package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +9 -0
  39. package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +12 -0
  40. package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +12 -0
  41. package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +12 -0
  42. package/dist/containers/ExamResult/configs/constants.d.ts +19 -0
  43. package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
  44. package/dist/containers/ExamResult/configs/types.d.ts +95 -0
  45. package/dist/containers/ExamResult/hooks/useCreateDialog.d.ts +9 -0
  46. package/dist/containers/ExamResult/hooks/useExamResult.d.ts +109 -0
  47. package/dist/containers/ExamResult/views/ExamResultV2.d.ts +7 -0
  48. package/dist/containers/Exams/components/ArticleGroupView.d.ts +5 -1
  49. package/dist/containers/Exams/components/QuestionView.d.ts +1 -1
  50. package/dist/containers/Exams/configs/constants.d.ts +0 -4
  51. package/dist/containers/Exams/configs/interfaces.d.ts +1 -2
  52. package/dist/containers/Exams/configs/types.d.ts +1 -0
  53. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -0
  54. package/dist/containers/Select/Category/apiClient/categoryService.d.ts +3 -0
  55. package/dist/containers/Select/Category/configs/types.d.ts +17 -0
  56. package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +15 -0
  57. package/dist/containers/Select/Subject/apiClient/subjectService.d.ts +2 -0
  58. package/dist/containers/Select/Subject/configs/types.d.ts +9 -0
  59. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +12 -0
  60. package/dist/index.css +496 -3
  61. package/dist/index.d.ts +14 -3
  62. package/dist/index.js +4757 -458
  63. package/dist/index.js.map +1 -1
  64. package/dist/index.modern.js +4757 -469
  65. package/dist/index.modern.js.map +1 -1
  66. package/dist/redux/commons/action.d.ts +1 -0
  67. package/dist/services/academyService.d.ts +1 -0
  68. package/dist/utils/constants.d.ts +5 -0
  69. package/dist/utils/enums/index.d.ts +2 -0
  70. package/dist/utils/enums/order.d.ts +4 -0
  71. package/dist/utils/helpers.d.ts +8 -0
  72. package/dist/utils/hooks/index.d.ts +2 -1
  73. package/dist/utils/hooks/useList.d.ts +17 -0
  74. package/dist/utils/types/index.d.ts +3 -0
  75. package/dist/utils/types/searchQuery.d.ts +8 -0
  76. package/dist/utils/types/tableHeaderType.d.ts +4 -0
  77. package/package.json +4 -4
  78. package/dist/components/Alerts/CommonAlert.d.ts +0 -3
  79. package/dist/components/Alerts/EmptyDataAlert.d.ts +0 -8
@@ -1,6 +1,7 @@
1
1
  export declare const setLoading: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<boolean | undefined, string>;
2
2
  export declare const setAlert: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
3
3
  export declare const setUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
4
+ export declare const setAcademy: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
4
5
  export declare const setLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>;
5
6
  export declare const reset: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
6
7
  export declare const setReFetchUserAcademies: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
@@ -1,3 +1,4 @@
1
1
  export declare const getAcademyList: (role?: string | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
2
2
  export declare const getUserAcademies: (role?: string | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const getAcademyDetail: () => Promise<import("axios").AxiosResponse<any, any>>;
3
4
  export declare const switchAcademy: (academyId: number) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -18,3 +18,8 @@ export declare const EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{st
18
18
  export declare const getAccessToken: () => string | null;
19
19
  export declare const getAcademyDomain: () => string | null;
20
20
  export declare const encodeParams: (params: any) => string;
21
+ export declare enum Roles {
22
+ Student = "Student",
23
+ Teacher = "Teacher",
24
+ Admin = "Admin"
25
+ }
@@ -0,0 +1,2 @@
1
+ import { OrderType } from "./order";
2
+ export { OrderType };
@@ -0,0 +1,4 @@
1
+ export declare enum OrderType {
2
+ ASC = "ASC",
3
+ DESC = "DESC"
4
+ }
@@ -0,0 +1,8 @@
1
+ import { Category, CategoryResponse, ExamResult, Question } from "../containers/ExamResult/configs/types";
2
+ export declare const formatDateTime: (inputDate: string) => string;
3
+ export declare type FormatDataMyAnswer = {
4
+ category: Category;
5
+ questions: Question[];
6
+ };
7
+ export declare const formatDataMyAnswer: (inputData: ExamResult, categories: CategoryResponse[]) => FormatDataMyAnswer[];
8
+ export declare const formatTimeSecond: (duration: number, t: any) => string;
@@ -1,3 +1,4 @@
1
1
  import useAutoAcademyDomain from "./useAutoAcademyDomain";
2
+ import useList from "./useList";
2
3
  import useLogin from "./useLogin";
3
- export { useLogin, useAutoAcademyDomain };
4
+ export { useLogin, useAutoAcademyDomain, useList };
@@ -0,0 +1,17 @@
1
+ import { ChangeEvent } from "react";
2
+ import { AxiosResponse } from "axios";
3
+ import { SearchQuery } from "../types/searchQuery";
4
+ declare const useList: <TResponse>(fetchData: (filter: SearchQuery) => Promise<AxiosResponse<any, any>>, defaultQuery: SearchQuery) => {
5
+ filter: SearchQuery;
6
+ textSearchRef: import("react").RefObject<HTMLInputElement>;
7
+ totalPages: number;
8
+ data: TResponse[];
9
+ selectedItem: TResponse | undefined;
10
+ handleSort: (sortColumnName: string) => void;
11
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
12
+ handleChangePage: (_: any, page: number) => void;
13
+ calcOrderNumber: (index: number) => number;
14
+ handleChangeSelectedItem: (item?: TResponse | undefined) => void;
15
+ getData: (isLoading?: boolean) => Promise<void>;
16
+ };
17
+ export default useList;
@@ -0,0 +1,3 @@
1
+ import { SearchQuery } from "./searchQuery";
2
+ import { TableHeaderType } from "./tableHeaderType";
3
+ export { SearchQuery, TableHeaderType };
@@ -0,0 +1,8 @@
1
+ import { OrderType } from "../enums/order";
2
+ export declare type SearchQuery = {
3
+ textSearch?: string;
4
+ currentPage?: number;
5
+ pageSize?: number;
6
+ sortColumnDirection?: OrderType;
7
+ sortColumnName?: string;
8
+ };
@@ -0,0 +1,4 @@
1
+ export declare type TableHeaderType = {
2
+ title: string;
3
+ sortKey?: string;
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "touchstudy-core",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Contains core components && functions for TouchStudy project",
5
5
  "author": "brss",
6
6
  "license": "MIT",
@@ -29,14 +29,12 @@
29
29
  "react-icons": "^4.12.0",
30
30
  "react-select": "^5.8.0",
31
31
  "react-toastify": "^9.1.3",
32
- "reactstrap": "^9.2.1",
33
32
  "yup": "^1.3.3"
34
33
  },
35
34
  "peerDependencies": {
36
35
  "react": "^18.2.0",
37
36
  "react-dom": "^18.2.0",
38
- "react-redux": "^9.0.4",
39
- "react-router-dom": "^5.2.0"
37
+ "react-redux": "^9.0.4"
40
38
  },
41
39
  "scripts": {
42
40
  "build": "microbundle-crl --no-compress --format modern,cjs",
@@ -65,6 +63,7 @@
65
63
  "@types/react-router-dom": "^5.3.3",
66
64
  "@types/redux-logger": "^3.0.12",
67
65
  "@types/yup": "^0.32.0",
66
+ "apexcharts": "3.15.5",
68
67
  "babel-eslint": "^10.0.3",
69
68
  "cross-env": "^7.0.3",
70
69
  "eslint": "^8.56.0",
@@ -81,6 +80,7 @@
81
80
  "microbundle-crl": "^0.13.10",
82
81
  "npm-run-all": "^4.1.5",
83
82
  "prettier": "^3.1.1",
83
+ "react-apexcharts": "1.3.6",
84
84
  "react-scripts": "5.0.1",
85
85
  "redux-logger": "^3.0.6",
86
86
  "typescript": "^4.9.5"
@@ -1,3 +0,0 @@
1
- import { FC } from "react";
2
- declare const CommonAlert: FC;
3
- export default CommonAlert;
@@ -1,8 +0,0 @@
1
- import { CSSProperties, FC } from "react";
2
- interface Props {
3
- label: string;
4
- className?: string;
5
- style?: CSSProperties;
6
- }
7
- declare const EmptyDataAlert: FC<Props>;
8
- export default EmptyDataAlert;