mario-education 2.4.292-release → 2.4.293-release

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.
@@ -9,5 +9,5 @@ interface Props {
9
9
  minRows?: number;
10
10
  isStartRecord?: boolean;
11
11
  }
12
- declare const TextFieldComponent: ({ valueText, isPageResult, isPageSessionResult, isUserChangeSession, }: Props) => JSX.Element;
12
+ declare const TextFieldComponent: ({ questionId, valueText, onChangeQuestionAnswer, isPageResult, isPageSessionResult, isUserChangeSession, isMultiline, minRows }: Props) => JSX.Element;
13
13
  export default TextFieldComponent;
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ isNotification?: boolean;
4
+ }
5
+ declare const Footer: FC<Props>;
6
+ export default Footer;
@@ -0,0 +1,2 @@
1
+ declare const HeaderSideBar: ({ children, navigations, onToggleModel }: any) => JSX.Element;
2
+ export default HeaderSideBar;
@@ -0,0 +1,2 @@
1
+ declare const HeaderSideBar: ({ children, navigations, onToggleModel }: any) => JSX.Element;
2
+ export default HeaderSideBar;
@@ -0,0 +1,2 @@
1
+ declare const LanguageDropdown: () => JSX.Element;
2
+ export default LanguageDropdown;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { NOTIFICATION_ALERT } from "./constants/types";
3
+ interface Props {
4
+ data?: NOTIFICATION_ALERT;
5
+ isOpen: boolean;
6
+ onClose?: Function;
7
+ fontSize: string;
8
+ }
9
+ declare const NotificationAlert: React.FC<Props>;
10
+ export default NotificationAlert;
@@ -0,0 +1,14 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ step: number;
4
+ title: string;
5
+ message: string;
6
+ onStepNext: Function;
7
+ totalStep: number;
8
+ isOpenNotificationBanner?: boolean;
9
+ onOpenNavigationItem?: Function;
10
+ openNavigationItem?: object;
11
+ navigations?: any;
12
+ }
13
+ declare const NotificationStepLogin: FC<Props>;
14
+ export default NotificationStepLogin;
@@ -0,0 +1,9 @@
1
+ export declare const caculateHeaderFont: (defaultFont: number) => number;
2
+ export declare const buttonFontSize: (defaultFont: number) => string;
3
+ export declare const tabFontSize: (defaultFont: number) => number;
4
+ export declare const tabLargeFontSize: (defaultFont: number) => number;
5
+ export declare const inputFontSize: (defaultFont: number) => number;
6
+ export declare const camelCaseToNomal: (text: string) => string;
7
+ export declare const validateEmail: (email: string) => RegExpMatchArray | null;
8
+ export declare const removeHTMLTags: (input: string) => string;
9
+ export declare const handleClearFilterStorage: () => void;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { NOTIFICATION_ALERT } from "../constants/types";
3
+ declare const useAnimation: (data?: NOTIFICATION_ALERT | undefined, fontSize?: string | undefined) => {
4
+ parentRef: import("react").RefObject<HTMLParagraphElement>;
5
+ childRef: import("react").RefObject<HTMLSpanElement>;
6
+ pWidth: number | undefined;
7
+ cWidth: number | undefined;
8
+ };
9
+ export default useAnimation;
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ declare const useHeaderSideBar: (_navigations: any) => {
3
+ anchorFontEl: HTMLElement | null;
4
+ anchorEl: HTMLElement | null;
5
+ classes: Record<"overlay" | "content" | "grow" | "menuItem" | "menuButton" | "title" | "listItem" | "header" | "dropdown" | "sectionDesktop" | "drawer" | "textPrivacy" | "subMenuDrawer" | "subDrawerItem" | "drawerItem" | "drawerContent" | "drawerPaper" | "drawerPaperMobile" | "drawerActive" | "contentShift" | "fontBodyLarge" | "fontBodySmall" | "fontSmall" | "fontMedium" | "fontLarge" | "sectionFontDesktop" | "itemSideBar" | "positionBox" | "arrow" | "arrowDown" | "arrowUp" | "dailyMotivation", string>;
6
+ screenWidth: number;
7
+ isReadOnly: string | null;
8
+ notificationAlert: import("../constants/types").NOTIFICATION_ALERT | undefined;
9
+ open: boolean;
10
+ openFont: boolean;
11
+ isOpen: boolean;
12
+ isOpenSideBar: any;
13
+ defaultFont: any;
14
+ user: any;
15
+ drawerRef: React.MutableRefObject<any>;
16
+ openNavigationItem: object;
17
+ handleOpenNavigationItem: (name: string) => void;
18
+ handleCloseNotification: () => void;
19
+ toggleSideBar: () => void;
20
+ handleMenu: (event: React.MouseEvent<HTMLElement>) => void;
21
+ handleFontMenu: (event: React.MouseEvent<HTMLElement>) => void;
22
+ handleFontClose: () => void;
23
+ signOut: () => void;
24
+ renderNotificationBadge: () => JSX.Element;
25
+ openProfile: () => void;
26
+ onChangeFont: (fontSize: number) => void;
27
+ handleClose: () => void;
28
+ renderNavigationItem: (navigation: any, isSubItem?: boolean | undefined) => JSX.Element;
29
+ goToSettings: () => void;
30
+ t: import("i18next").TFunction;
31
+ };
32
+ export default useHeaderSideBar;
@@ -0,0 +1,7 @@
1
+ import { NOTIFICATION_ALERT } from "../constants/types";
2
+ declare const useNotificationAlert: () => {
3
+ data: NOTIFICATION_ALERT | undefined;
4
+ isOpen: boolean;
5
+ handleCloseNotification: () => void;
6
+ };
7
+ export default useNotificationAlert;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ declare const TimesIcon: FC<any>;
3
+ export default TimesIcon;
@@ -0,0 +1,20 @@
1
+ export declare const LIST_TEACHER_STEP_POPUP: {
2
+ id: number;
3
+ title: string;
4
+ message: string;
5
+ }[];
6
+ export declare const LIST_ASSISTANT_STEP_POPUP: {
7
+ id: number;
8
+ title: string;
9
+ message: string;
10
+ }[];
11
+ export declare const LIST_STUDENT_STEP_POPUP: {
12
+ id: number;
13
+ title: string;
14
+ message: string;
15
+ }[];
16
+ export declare const STEP_PROFILE: {
17
+ id: number;
18
+ title: string;
19
+ message: string;
20
+ };
@@ -70,11 +70,13 @@ export interface IQuestionTemplate {
70
70
  questionAnswer: string[];
71
71
  fromLabel: string;
72
72
  toLabel: string;
73
+ orderDefaultQuestionTemplate: string;
73
74
  }
74
75
  export interface ITemplate {
75
76
  id: number;
76
77
  name: string;
77
78
  questionTemplates: IQuestionTemplate[];
79
+ orderDefaultSurvey: number;
78
80
  }
79
81
  export interface SURVEY_DETAIL {
80
82
  deadline?: number | null;
package/dist/index.js CHANGED
@@ -48316,7 +48316,7 @@ var useSurveyDetail = function useSurveyDetail() {
48316
48316
  return a.text.localeCompare(b.text);
48317
48317
  })[0]);
48318
48318
  setQuestionRatingConvert(ratingQuestions.questions.map(function (_r, index) {
48319
- return "Q # " + (index + 1);
48319
+ return "Q " + (index + 1);
48320
48320
  }));
48321
48321
  setActiveColumnQuestionRating([true].concat(ratingQuestions.questions.map(function (_i) {
48322
48322
  return false;
@@ -49381,6 +49381,10 @@ var RatingOfQuestions = function RatingOfQuestions(_ref) {
49381
49381
  id: "combo-box-demo",
49382
49382
  options: shadowQuestions.sort(function (a, b) {
49383
49383
  return a.text.localeCompare(b.text);
49384
+ }).map(function (item, index) {
49385
+ return _extends({}, item, {
49386
+ text: index + 1 + ". " + item.text
49387
+ });
49384
49388
  }),
49385
49389
  getOptionLabel: function getOptionLabel(option) {
49386
49390
  return option.text;
@@ -51314,19 +51318,51 @@ var SurveyTop = function SurveyTop(_ref) {
51314
51318
  })));
51315
51319
  };
51316
51320
 
51321
+ var useStyles$4 = core$1.makeStyles(function () {
51322
+ return {
51323
+ root: {
51324
+ "& > *": {
51325
+ width: "100%"
51326
+ }
51327
+ }
51328
+ };
51329
+ });
51330
+
51317
51331
  var TextFieldComponent = function TextFieldComponent(_ref) {
51318
- var valueText = _ref.valueText,
51332
+ var questionId = _ref.questionId,
51333
+ valueText = _ref.valueText,
51334
+ onChangeQuestionAnswer = _ref.onChangeQuestionAnswer,
51319
51335
  isPageResult = _ref.isPageResult,
51320
51336
  isPageSessionResult = _ref.isPageSessionResult,
51321
- isUserChangeSession = _ref.isUserChangeSession;
51322
- React.useEffect(function () {}, [valueText]);
51337
+ isUserChangeSession = _ref.isUserChangeSession,
51338
+ isMultiline = _ref.isMultiline,
51339
+ _ref$minRows = _ref.minRows,
51340
+ minRows = _ref$minRows === void 0 ? 1 : _ref$minRows;
51341
+ var classes = useStyles$4();
51323
51342
  return React__default.createElement("div", {
51324
51343
  className: styles["talk-conduct"]
51325
51344
  }, React__default.createElement("div", {
51326
51345
  className: isPageResult || !isUserChangeSession ? styles["box-talk"] : ""
51327
- }, isPageResult || isPageSessionResult || !isUserChangeSession && React__default.createElement("p", {
51346
+ }, isPageResult || isPageSessionResult || !isUserChangeSession ? React__default.createElement("p", {
51328
51347
  className: styles["box-p"]
51329
- }, valueText)));
51348
+ }, valueText) : React__default.createElement("div", {
51349
+ className: classes.root
51350
+ }, React__default.createElement(core$1.Box, null, React__default.createElement(core$1.OutlinedInput, {
51351
+ fullWidth: true,
51352
+ multiline: !!isMultiline,
51353
+ minRows: minRows,
51354
+ onChange: function onChange(event) {
51355
+ return onChangeQuestionAnswer === null || onChangeQuestionAnswer === void 0 ? void 0 : onChangeQuestionAnswer(questionId, event.target.value);
51356
+ },
51357
+ endAdornment: React__default.createElement(core$1.InputAdornment, {
51358
+ position: "end"
51359
+ }, React__default.createElement(core$1.Box, null, React__default.createElement("img", {
51360
+ src: "/teacher-student/icons/icon-micro.png",
51361
+ style: {
51362
+ cursor: "pointer"
51363
+ }
51364
+ })))
51365
+ })))));
51330
51366
  };
51331
51367
 
51332
51368
  var COLOR_INCREASE = "#22543D";
@@ -51481,7 +51517,7 @@ var SliderSurveyComponent = function SliderSurveyComponent(_ref) {
51481
51517
  }));
51482
51518
  };
51483
51519
 
51484
- var useStyles$4 = core$1.makeStyles(function (theme) {
51520
+ var useStyles$5 = core$1.makeStyles(function (theme) {
51485
51521
  var _container, _title, _activeImg, _node, _pNthChild, _active, _answers;
51486
51522
 
51487
51523
  return {
@@ -51614,7 +51650,7 @@ var EmotionComponent = function EmotionComponent(_ref) {
51614
51650
  questionId = _ref.questionId,
51615
51651
  valueText = _ref.valueText,
51616
51652
  isPreviewPage = _ref.isPreviewPage;
51617
- var classes = useStyles$4();
51653
+ var classes = useStyles$5();
51618
51654
  return React__default.createElement("div", {
51619
51655
  className: "d-flex justify-content-center " + classes.answers
51620
51656
  }, !isPreviewPage && !!emotionTypeList && emotionTypeList.length > 0 && emotionTypeList.map(function (item, index) {
@@ -51868,7 +51904,7 @@ var MultiChoiceComponent = function MultiChoiceComponent(_ref) {
51868
51904
  }, correctQuestionAnswer.join("; "))))));
51869
51905
  };
51870
51906
 
51871
- var useStyles$5 = core$1.makeStyles({
51907
+ var useStyles$6 = core$1.makeStyles({
51872
51908
  customAutocomplete: {
51873
51909
  '& .MuiFormControl-fullWidth': {
51874
51910
  width: '89%'
@@ -51883,7 +51919,7 @@ var DropDownComponent = function DropDownComponent(_ref) {
51883
51919
  isUserChangeSession = _ref.isUserChangeSession,
51884
51920
  onChangeQuestionAnswer = _ref.onChangeQuestionAnswer,
51885
51921
  questionAnswer = _ref.questionAnswer;
51886
- var classes = useStyles$5();
51922
+ var classes = useStyles$6();
51887
51923
  return React__default.createElement(lab.Autocomplete, {
51888
51924
  id: "combo-box-demo",
51889
51925
  className: "mt-1 ml-4 " + classes.customAutocomplete,
@@ -77621,7 +77657,7 @@ var lodash = createCommonjsModule(function (module, exports) {
77621
77657
  }.call(commonjsGlobal));
77622
77658
  });
77623
77659
 
77624
- var useStyles$6 = core$1.makeStyles(function () {
77660
+ var useStyles$7 = core$1.makeStyles(function () {
77625
77661
  return {
77626
77662
  container: {
77627
77663
  position: "relative"
@@ -77714,7 +77750,7 @@ var InterventionSelector = function InterventionSelector(_ref) {
77714
77750
  var optionSelected = options.find(function (i) {
77715
77751
  return i.name === (value === null || value === void 0 ? void 0 : value.name);
77716
77752
  });
77717
- var classes = useStyles$6();
77753
+ var classes = useStyles$7();
77718
77754
 
77719
77755
  var handleToggleOpen = function handleToggleOpen() {
77720
77756
  setOpen(function (state) {
@@ -79166,11 +79202,25 @@ var usePreviewSurvey = function usePreviewSurvey() {
79166
79202
  return r.text;
79167
79203
  })) || []
79168
79204
  });
79205
+ }).sort(function (a, b) {
79206
+ if (a.orderDefaultQuestionTemplate > b.orderDefaultQuestionTemplate) {
79207
+ return 1;
79208
+ } else if ((a.questionId || 0) > (b.questionId || 0)) {
79209
+ return 1;
79210
+ }
79211
+
79212
+ return -1;
79169
79213
  })
79170
79214
  });
79171
79215
  });
79172
79216
  setListQuestionTemplate(templateQuestions.sort(function (a, b) {
79173
- return a.id > b.id ? 1 : -1;
79217
+ if (a.orderDefaultSurvey > b.orderDefaultSurvey) {
79218
+ return 1;
79219
+ } else if (a.id > b.id) {
79220
+ return 1;
79221
+ }
79222
+
79223
+ return -1;
79174
79224
  }));
79175
79225
  var additionalQuestion = (_dataLocalStorage$add = dataLocalStorage.additionalQuestions) === null || _dataLocalStorage$add === void 0 ? void 0 : _dataLocalStorage$add.map(function (item) {
79176
79226
  var _item$answers;
@@ -79431,7 +79481,7 @@ var usePreviewSurvey = function usePreviewSurvey() {
79431
79481
  };
79432
79482
  };
79433
79483
 
79434
- var useStyles$7 = core$1.makeStyles(function (theme) {
79484
+ var useStyles$8 = core$1.makeStyles(function (theme) {
79435
79485
  var _tabLabel;
79436
79486
 
79437
79487
  return {
@@ -79622,7 +79672,7 @@ var ShareSurveyDialog = function ShareSurveyDialog(_ref) {
79622
79672
  };
79623
79673
 
79624
79674
  var PreviewSurveyAdmin = function PreviewSurveyAdmin() {
79625
- var classes = useStyles$7();
79675
+ var classes = useStyles$8();
79626
79676
 
79627
79677
  var _usePreviewSurvey = usePreviewSurvey(),
79628
79678
  classFontSize = _usePreviewSurvey.classFontSize,
@@ -83913,7 +83963,7 @@ var TableSelectStudent = function TableSelectStudent(_ref) {
83913
83963
  }, t("no_data")))));
83914
83964
  };
83915
83965
 
83916
- var useStyles$8 = core$1.makeStyles(function () {
83966
+ var useStyles$9 = core$1.makeStyles(function () {
83917
83967
  return {
83918
83968
  root: {
83919
83969
  "& > *": {
@@ -83938,7 +83988,7 @@ var InputComponent = function InputComponent(_ref) {
83938
83988
  canSubmit = _ref.canSubmit,
83939
83989
  disabled = _ref.disabled,
83940
83990
  onChangeEvent = _ref.onChangeEvent;
83941
- var classes = useStyles$8();
83991
+ var classes = useStyles$9();
83942
83992
  return React__default.createElement("div", {
83943
83993
  className: styles["talk-conduct"]
83944
83994
  }, React__default.createElement("div", {