touchstudy-core 0.1.48 → 0.1.50
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/containers/Textbooks/hooks/useTextbookList.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +56 -36
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +56 -37
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/hooks/useList.d.ts +2 -1
- package/dist/utils/types/PagingResponse.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -2119,6 +2119,11 @@ var grades_by_area = "영역별 성적";
|
|
2119
2119
|
var problems_that_took_a_long_time = "시간이 오래 걸린 문제";
|
2120
2120
|
var my_time = "나의 시간";
|
2121
2121
|
var top_time = "상위권 시간";
|
2122
|
+
var easy_problem = "쉬운 문제";
|
2123
|
+
var trick_problem = "함정 문제";
|
2124
|
+
var differential_problem = "변별력 문제";
|
2125
|
+
var difficult_problem = "어려운 문제";
|
2126
|
+
var general_problem = "일반적인 문제";
|
2122
2127
|
var fingerprint = "지문";
|
2123
2128
|
var end = "종료";
|
2124
2129
|
var ask_for_feedback = "피드백 요청하기";
|
@@ -2126,7 +2131,6 @@ var quit = "종료하기";
|
|
2126
2131
|
var chosen = "정답";
|
2127
2132
|
var sign_in_with_your_google_account = "Google 계정으로 로그인";
|
2128
2133
|
var it_will_be_generated_automatically_if_not_provided = "제공되지 않으면 자동으로 생성됩니다";
|
2129
|
-
var go_back = "돌아가기";
|
2130
2134
|
var academy_not_found = "아카데미를 찾을 수 없습니다";
|
2131
2135
|
var full_notice = "전체 공";
|
2132
2136
|
var academy_notice = "학원 공지";
|
@@ -2150,6 +2154,7 @@ var registration = "등록하기";
|
|
2150
2154
|
var you_can_only_select_the_10_most_recent_exams = "최근 시험 10개만 선택 가능합니다.";
|
2151
2155
|
var ask_a_question = "문제 질문하기";
|
2152
2156
|
var request_a_consultation = "상담 요청하기";
|
2157
|
+
var go_back = "돌아가기";
|
2153
2158
|
var next = "다음";
|
2154
2159
|
var complete_processing = "완료 처리";
|
2155
2160
|
var creation_date = "생성 날짜";
|
@@ -2531,6 +2536,11 @@ var lang_ko = {
|
|
2531
2536
|
problems_that_took_a_long_time: problems_that_took_a_long_time,
|
2532
2537
|
my_time: my_time,
|
2533
2538
|
top_time: top_time,
|
2539
|
+
easy_problem: easy_problem,
|
2540
|
+
trick_problem: trick_problem,
|
2541
|
+
differential_problem: differential_problem,
|
2542
|
+
difficult_problem: difficult_problem,
|
2543
|
+
general_problem: general_problem,
|
2534
2544
|
fingerprint: fingerprint,
|
2535
2545
|
end: end,
|
2536
2546
|
ask_for_feedback: ask_for_feedback,
|
@@ -2538,7 +2548,6 @@ var lang_ko = {
|
|
2538
2548
|
chosen: chosen,
|
2539
2549
|
sign_in_with_your_google_account: sign_in_with_your_google_account,
|
2540
2550
|
it_will_be_generated_automatically_if_not_provided: it_will_be_generated_automatically_if_not_provided,
|
2541
|
-
go_back: go_back,
|
2542
2551
|
academy_not_found: academy_not_found,
|
2543
2552
|
full_notice: full_notice,
|
2544
2553
|
academy_notice: academy_notice,
|
@@ -2564,6 +2573,7 @@ var lang_ko = {
|
|
2564
2573
|
you_can_only_select_the_10_most_recent_exams: you_can_only_select_the_10_most_recent_exams,
|
2565
2574
|
ask_a_question: ask_a_question,
|
2566
2575
|
request_a_consultation: request_a_consultation,
|
2576
|
+
go_back: go_back,
|
2567
2577
|
next: next,
|
2568
2578
|
"i'm_waiting_for_the_teacher_to_start_the_test": "선생님의 시험 시작을 기다리고 있습니다...",
|
2569
2579
|
complete_processing: complete_processing,
|
@@ -2928,7 +2938,7 @@ var number_of_classes$1 = "{{ number }} classes";
|
|
2928
2938
|
var complete_conversation_successfully$1 = "Complete conversation successfully";
|
2929
2939
|
var fail_to_complete_conversation$1 = "Fail to complete conversation";
|
2930
2940
|
var are_you_sure_you_want_to_complete_this_conversation$1 = "Are you sure you want to complete this conversation?";
|
2931
|
-
var switch_academy_fail$1 = "
|
2941
|
+
var switch_academy_fail$1 = "Switch academy failed";
|
2932
2942
|
var no_academy_available$1 = "No academy available";
|
2933
2943
|
var my_classes_calendar$1 = "My classes calendar";
|
2934
2944
|
var enter_exam_code$1 = "Enter exam code";
|
@@ -2993,11 +3003,11 @@ var grades_by_area$1 = "Grades by area";
|
|
2993
3003
|
var problems_that_took_a_long_time$1 = "Problems that took a long time";
|
2994
3004
|
var my_time$1 = "My time";
|
2995
3005
|
var top_time$1 = "Top time";
|
2996
|
-
var easy_problem = "Easy problem";
|
2997
|
-
var trick_problem = "Trick problem";
|
2998
|
-
var differential_problem = "Differential problem";
|
2999
|
-
var difficult_problem = "Difficult problem";
|
3000
|
-
var general_problem = "General problem";
|
3006
|
+
var easy_problem$1 = "Easy problem";
|
3007
|
+
var trick_problem$1 = "Trick problem";
|
3008
|
+
var differential_problem$1 = "Differential problem";
|
3009
|
+
var difficult_problem$1 = "Difficult problem";
|
3010
|
+
var general_problem$1 = "General problem";
|
3001
3011
|
var fingerprint$1 = "Fingerprint";
|
3002
3012
|
var end$1 = "end";
|
3003
3013
|
var ask_for_feedback$1 = "Ask for feedback";
|
@@ -3005,7 +3015,6 @@ var quit$1 = "Quit";
|
|
3005
3015
|
var chosen$1 = "Answer";
|
3006
3016
|
var sign_in_with_your_google_account$1 = "Sign in with your Google Account";
|
3007
3017
|
var it_will_be_generated_automatically_if_not_provided$1 = "It will be generated automatically if not provided";
|
3008
|
-
var go_back$1 = "Go back";
|
3009
3018
|
var academy_not_found$1 = "Academy not found";
|
3010
3019
|
var full_notice$1 = "Full notice";
|
3011
3020
|
var academy_notice$1 = "Academy Notice";
|
@@ -3029,6 +3038,7 @@ var registration$1 = "Registration";
|
|
3029
3038
|
var you_can_only_select_the_10_most_recent_exams$1 = "You can only select the 10 most recent exams.";
|
3030
3039
|
var ask_a_question$1 = "Ask a question";
|
3031
3040
|
var request_a_consultation$1 = "Request a consultation";
|
3041
|
+
var go_back$1 = "Go back";
|
3032
3042
|
var next$1 = "Next";
|
3033
3043
|
var complete_processing$1 = "Complete processing";
|
3034
3044
|
var creation_date$1 = "Creation date";
|
@@ -3444,11 +3454,11 @@ var lang_en = {
|
|
3444
3454
|
problems_that_took_a_long_time: problems_that_took_a_long_time$1,
|
3445
3455
|
my_time: my_time$1,
|
3446
3456
|
top_time: top_time$1,
|
3447
|
-
easy_problem: easy_problem,
|
3448
|
-
trick_problem: trick_problem,
|
3449
|
-
differential_problem: differential_problem,
|
3450
|
-
difficult_problem: difficult_problem,
|
3451
|
-
general_problem: general_problem,
|
3457
|
+
easy_problem: easy_problem$1,
|
3458
|
+
trick_problem: trick_problem$1,
|
3459
|
+
differential_problem: differential_problem$1,
|
3460
|
+
difficult_problem: difficult_problem$1,
|
3461
|
+
general_problem: general_problem$1,
|
3452
3462
|
fingerprint: fingerprint$1,
|
3453
3463
|
end: end$1,
|
3454
3464
|
ask_for_feedback: ask_for_feedback$1,
|
@@ -3456,7 +3466,6 @@ var lang_en = {
|
|
3456
3466
|
chosen: chosen$1,
|
3457
3467
|
sign_in_with_your_google_account: sign_in_with_your_google_account$1,
|
3458
3468
|
it_will_be_generated_automatically_if_not_provided: it_will_be_generated_automatically_if_not_provided$1,
|
3459
|
-
go_back: go_back$1,
|
3460
3469
|
academy_not_found: academy_not_found$1,
|
3461
3470
|
full_notice: full_notice$1,
|
3462
3471
|
academy_notice: academy_notice$1,
|
@@ -3482,6 +3491,7 @@ var lang_en = {
|
|
3482
3491
|
you_can_only_select_the_10_most_recent_exams: you_can_only_select_the_10_most_recent_exams$1,
|
3483
3492
|
ask_a_question: ask_a_question$1,
|
3484
3493
|
request_a_consultation: request_a_consultation$1,
|
3494
|
+
go_back: go_back$1,
|
3485
3495
|
next: next$1,
|
3486
3496
|
"i'm_waiting_for_the_teacher_to_start_the_test": "I'm waiting for the teacher to start the test...",
|
3487
3497
|
complete_processing: complete_processing$1,
|
@@ -3670,7 +3680,7 @@ var useSwitchAcademy = function useSwitchAcademy(role, navigate, homeAcademyUrl,
|
|
3670
3680
|
});
|
3671
3681
|
}, function (error) {
|
3672
3682
|
var _error$response, _error$response$data;
|
3673
|
-
toast.error((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.
|
3683
|
+
toast.error((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title) || "Get user academies failed");
|
3674
3684
|
});
|
3675
3685
|
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
|
3676
3686
|
} catch (e) {
|
@@ -8609,14 +8619,21 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
|
|
8609
8619
|
}, [window.location.pathname, user === null || user === void 0 ? void 0 : user.academyDomain]);
|
8610
8620
|
};
|
8611
8621
|
|
8622
|
+
var DEFAULT_PAGING_RESPONSE = {
|
8623
|
+
page: 0,
|
8624
|
+
limit: 0,
|
8625
|
+
totalItems: 0,
|
8626
|
+
totalPages: 0
|
8627
|
+
};
|
8628
|
+
|
8612
8629
|
var useList = function useList(fetchData, defaultQuery) {
|
8613
8630
|
var dispatch = useDispatch();
|
8614
8631
|
var _useState = useState(defaultQuery),
|
8615
8632
|
filter = _useState[0],
|
8616
8633
|
setFilter = _useState[1];
|
8617
|
-
var _useState2 = useState(
|
8618
|
-
|
8619
|
-
|
8634
|
+
var _useState2 = useState(DEFAULT_PAGING_RESPONSE),
|
8635
|
+
paging = _useState2[0],
|
8636
|
+
setPaging = _useState2[1];
|
8620
8637
|
var _useState3 = useState([]),
|
8621
8638
|
data = _useState3[0],
|
8622
8639
|
setData = _useState3[1];
|
@@ -8640,17 +8657,19 @@ var useList = function useList(fetchData, defaultQuery) {
|
|
8640
8657
|
isLoading && dispatch(setLoading(true));
|
8641
8658
|
var _temp = _catch(function () {
|
8642
8659
|
return Promise.resolve(fetchData(filter)).then(function (res) {
|
8643
|
-
var _res$data = res.data,
|
8644
|
-
_res$data$items
|
8645
|
-
|
8646
|
-
|
8647
|
-
|
8648
|
-
|
8660
|
+
var _res$data$items = res.data.items,
|
8661
|
+
items = _res$data$items === void 0 ? [] : _res$data$items;
|
8662
|
+
setPaging({
|
8663
|
+
limit: res.data.limit || 0,
|
8664
|
+
page: res.data.page || 0,
|
8665
|
+
totalItems: res.data.totalItems || 0,
|
8666
|
+
totalPages: res.data.totalPages || 0
|
8667
|
+
});
|
8649
8668
|
setData(items);
|
8650
8669
|
});
|
8651
8670
|
}, function (error) {
|
8652
8671
|
var _error$response, _error$response$data;
|
8653
|
-
|
8672
|
+
setPaging(DEFAULT_PAGING_RESPONSE);
|
8654
8673
|
setData([]);
|
8655
8674
|
toast.error((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title) || "Get data failed");
|
8656
8675
|
});
|
@@ -8683,8 +8702,8 @@ var useList = function useList(fetchData, defaultQuery) {
|
|
8683
8702
|
}));
|
8684
8703
|
};
|
8685
8704
|
var calcOrderNumber = function calcOrderNumber(index) {
|
8686
|
-
var
|
8687
|
-
return (((
|
8705
|
+
var _paging$page, _paging$limit;
|
8706
|
+
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
8688
8707
|
};
|
8689
8708
|
var debounceSearch = _.debounce(function () {
|
8690
8709
|
var _textSearchRef$curren;
|
@@ -8699,7 +8718,7 @@ var useList = function useList(fetchData, defaultQuery) {
|
|
8699
8718
|
return {
|
8700
8719
|
filter: filter,
|
8701
8720
|
textSearchRef: textSearchRef,
|
8702
|
-
|
8721
|
+
paging: paging,
|
8703
8722
|
data: data,
|
8704
8723
|
selectedItem: selectedItem,
|
8705
8724
|
handleSort: handleSort,
|
@@ -8728,7 +8747,7 @@ var useTextbookList = function useTextbookList(props) {
|
|
8728
8747
|
}, TextbookDefaultQuery),
|
8729
8748
|
filter = _useList.filter,
|
8730
8749
|
textSearchRef = _useList.textSearchRef,
|
8731
|
-
|
8750
|
+
paging = _useList.paging,
|
8732
8751
|
textbooks = _useList.data,
|
8733
8752
|
selectedTextbook = _useList.selectedItem,
|
8734
8753
|
handleSort = _useList.handleSort,
|
@@ -8785,7 +8804,7 @@ var useTextbookList = function useTextbookList(props) {
|
|
8785
8804
|
return {
|
8786
8805
|
filter: filter,
|
8787
8806
|
textSearchRef: textSearchRef,
|
8788
|
-
|
8807
|
+
paging: paging,
|
8789
8808
|
textbooks: textbooks,
|
8790
8809
|
selectedTextbook: selectedTextbook,
|
8791
8810
|
handleSort: handleSort,
|
@@ -8910,7 +8929,7 @@ var TextbookList = function TextbookList(props) {
|
|
8910
8929
|
var _useTextbookList = useTextbookList(props),
|
8911
8930
|
filter = _useTextbookList.filter,
|
8912
8931
|
textbooks = _useTextbookList.textbooks,
|
8913
|
-
|
8932
|
+
paging = _useTextbookList.paging,
|
8914
8933
|
textSearchRef = _useTextbookList.textSearchRef,
|
8915
8934
|
selectedTextbook = _useTextbookList.selectedTextbook,
|
8916
8935
|
handleChangeSearchText = _useTextbookList.handleChangeSearchText,
|
@@ -8988,9 +9007,9 @@ var TextbookList = function TextbookList(props) {
|
|
8988
9007
|
})))));
|
8989
9008
|
}), !textbooks.length && React__default.createElement(EmptyRow, null))), React__default.createElement("div", {
|
8990
9009
|
className: "d-flex justify-content-end mt-3"
|
8991
|
-
}, !!totalPages && React__default.createElement(Pagination, {
|
8992
|
-
count: totalPages,
|
8993
|
-
page:
|
9010
|
+
}, !!paging.totalPages && React__default.createElement(Pagination, {
|
9011
|
+
count: paging.totalPages,
|
9012
|
+
page: paging.page,
|
8994
9013
|
onChange: handleChangePage
|
8995
9014
|
})))), React__default.createElement(ConfirmDialog, {
|
8996
9015
|
open: !!(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id),
|
@@ -12214,7 +12233,7 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
12214
12233
|
style: {
|
12215
12234
|
border: "1px solid #FF0000"
|
12216
12235
|
}
|
12217
|
-
}, t("
|
12236
|
+
}, t("difficult_problem")));
|
12218
12237
|
}))));
|
12219
12238
|
});
|
12220
12239
|
};
|
@@ -13969,5 +13988,5 @@ var Header = function Header(_ref) {
|
|
13969
13988
|
}))));
|
13970
13989
|
};
|
13971
13990
|
|
13972
|
-
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, LayoutContext, Loading, Login, SignIn as LoginWithPassword, NotFound, PUSHER_CONFIG, QuestionCountSelector, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, diffFromNow, formatTime, getAcademyDomain, getAccessToken$1 as getAccessToken, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useGoogleSignOut, useLanguage, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, utcToLocalTime };
|
13991
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_PAGING_RESPONSE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, LayoutContext, Loading, Login, SignIn as LoginWithPassword, NotFound, PUSHER_CONFIG, QuestionCountSelector, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, diffFromNow, formatTime, getAcademyDomain, getAccessToken$1 as getAccessToken, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useGoogleSignOut, useLanguage, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, utcToLocalTime };
|
13973
13992
|
//# sourceMappingURL=index.modern.js.map
|