touchstudy-core 0.1.18 → 0.1.20

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 (78) 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/apiClient/conversationService.d.ts +1 -1
  21. package/dist/components/Dialogs/CommonDialog.d.ts +3 -3
  22. package/dist/components/Dialogs/ConfirmDialog.d.ts +1 -0
  23. package/dist/components/Inputs/InputText.d.ts +4 -0
  24. package/dist/components/Selectors/AnswerCountSelector.d.ts +9 -0
  25. package/dist/components/Selectors/ArticleCategorySelector.d.ts +11 -0
  26. package/dist/components/Selectors/QuestionCountSelector.d.ts +9 -0
  27. package/dist/components/Selectors/ScoreSelector.d.ts +9 -0
  28. package/dist/components/Selectors/configs/constants.d.ts +4 -0
  29. package/dist/containers/ExamResult/apiClients/index.d.ts +12 -0
  30. package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +5 -0
  31. package/dist/containers/ExamResult/components/Dialog/CreateNewQuestion.d.ts +9 -0
  32. package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +12 -0
  33. package/dist/containers/ExamResult/components/MyAnswer/components/CreateNewQuestion.d.ts +12 -0
  34. package/dist/containers/ExamResult/components/MyAnswer/hooks/useCreateDialog.d.ts +10 -0
  35. package/dist/containers/ExamResult/components/MyAnswer/hooks/useMyAnswer.d.ts +10 -0
  36. package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +9 -0
  37. package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +12 -0
  38. package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +12 -0
  39. package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +12 -0
  40. package/dist/containers/ExamResult/configs/constants.d.ts +19 -0
  41. package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
  42. package/dist/containers/ExamResult/configs/types.d.ts +95 -0
  43. package/dist/containers/ExamResult/hooks/useCreateDialog.d.ts +9 -0
  44. package/dist/containers/ExamResult/hooks/useExamResult.d.ts +109 -0
  45. package/dist/containers/ExamResult/views/ExamResultV2.d.ts +7 -0
  46. package/dist/containers/Exams/components/ArticleGroupView.d.ts +5 -1
  47. package/dist/containers/Exams/components/QuestionView.d.ts +1 -1
  48. package/dist/containers/Exams/configs/constants.d.ts +0 -4
  49. package/dist/containers/Exams/configs/interfaces.d.ts +1 -2
  50. package/dist/containers/Exams/configs/types.d.ts +1 -0
  51. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -0
  52. package/dist/containers/Select/Category/apiClient/categoryService.d.ts +3 -0
  53. package/dist/containers/Select/Category/configs/types.d.ts +17 -0
  54. package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +15 -0
  55. package/dist/containers/Select/Subject/apiClient/subjectService.d.ts +2 -0
  56. package/dist/containers/Select/Subject/configs/types.d.ts +9 -0
  57. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +12 -0
  58. package/dist/index.css +496 -3
  59. package/dist/index.d.ts +13 -3
  60. package/dist/index.js +4517 -413
  61. package/dist/index.js.map +1 -1
  62. package/dist/index.modern.js +4513 -419
  63. package/dist/index.modern.js.map +1 -1
  64. package/dist/utils/constants.d.ts +5 -0
  65. package/dist/utils/enums/index.d.ts +2 -0
  66. package/dist/utils/enums/order.d.ts +4 -0
  67. package/dist/utils/helpers.d.ts +8 -0
  68. package/dist/utils/hooks/index.d.ts +2 -1
  69. package/dist/utils/hooks/useList.d.ts +17 -0
  70. package/dist/utils/types/index.d.ts +3 -0
  71. package/dist/utils/types/searchQuery.d.ts +8 -0
  72. package/dist/utils/types/tableHeaderType.d.ts +4 -0
  73. package/package.json +4 -4
  74. package/dist/components/Alerts/CommonAlert.d.ts +0 -3
  75. package/dist/components/Alerts/EmptyDataAlert.d.ts +0 -8
  76. package/dist/components/Chats/hooks/useConversationList.d.ts +0 -20
  77. package/dist/utils/useGoogleSignOut.d.ts +0 -10
  78. package/dist/utils/useLanguage.d.ts +0 -12
@@ -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.18",
3
+ "version": "0.1.20",
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;
@@ -1,20 +0,0 @@
1
- import { ChangeEvent } from "react";
2
- import { ConversationFilter, ConversationResponse, MessageResponse } from "../configs/types";
3
- declare const useConversationList: () => {
4
- isStudent: any;
5
- conversationFilter: ConversationFilter;
6
- selectedConversation: ConversationResponse | undefined;
7
- conversations: ConversationResponse[];
8
- handleUpdateTotalUnreadMessage: () => void;
9
- handleChangeFilter: (filter: ConversationFilter) => void;
10
- handleChangeSelectedConversation: (val: ConversationResponse) => void;
11
- handleChangeTextSearch: (e: ChangeEvent<HTMLInputElement>) => void;
12
- setSelectedConversation: import("react").Dispatch<import("react").SetStateAction<ConversationResponse | undefined>>;
13
- handleUpdateLastMessage: (lastMessage: MessageResponse) => void;
14
- getConversationList: () => Promise<void>;
15
- formatConversationLastMessageContent: (conversation: ConversationResponse) => string;
16
- handleNewMessageConversation: (val: ConversationResponse) => void;
17
- handleCreateConversationSuccess: (id: number) => Promise<void>;
18
- handleMessageReadConversation: (id: number, totalUnread: number) => void;
19
- };
20
- export default useConversationList;
@@ -1,10 +0,0 @@
1
- interface Props {
2
- onLogoutSuccess?: () => void;
3
- onFailure?: () => void;
4
- onNavigate: Function;
5
- }
6
- declare const useGoogleSignOut: (props: Props) => {
7
- handleSignOut: () => void;
8
- loaded: boolean;
9
- };
10
- export default useGoogleSignOut;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { Language } from "../configs/constants";
3
- import "moment/locale/ko.js";
4
- import "moment/locale/en-au.js";
5
- declare const useLanguage: () => {
6
- language: string;
7
- dropdownOpen: boolean;
8
- currentLanguage: Language | null;
9
- toggle: () => void;
10
- setItemLanguage: import("react").Dispatch<import("react").SetStateAction<string>>;
11
- };
12
- export default useLanguage;