mario-education 2.4.26-admin → 2.4.27-admin

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.
@@ -19638,6 +19638,40 @@ var CompareTeacher = function CompareTeacher() {
19638
19638
  }, "No compare result."))));
19639
19639
  };
19640
19640
 
19641
+ var LegalGenderType;
19642
+
19643
+ (function (LegalGenderType) {
19644
+ LegalGenderType[LegalGenderType["Male"] = 0] = "Male";
19645
+ LegalGenderType[LegalGenderType["Female"] = 1] = "Female";
19646
+ })(LegalGenderType || (LegalGenderType = {}));
19647
+
19648
+ var MtssType;
19649
+
19650
+ (function (MtssType) {
19651
+ MtssType[MtssType["Tier1"] = 0] = "Tier1";
19652
+ MtssType[MtssType["Tier2"] = 1] = "Tier2";
19653
+ MtssType[MtssType["Tier3"] = 2] = "Tier3";
19654
+ })(MtssType || (MtssType = {}));
19655
+
19656
+ var FILTER_YEAR;
19657
+
19658
+ (function (FILTER_YEAR) {
19659
+ FILTER_YEAR[FILTER_YEAR["THIS_YEAR"] = 0] = "THIS_YEAR";
19660
+ FILTER_YEAR[FILTER_YEAR["LAST_YEAR"] = 1] = "LAST_YEAR";
19661
+ FILTER_YEAR[FILTER_YEAR["LAST_QUARTER"] = 2] = "LAST_QUARTER";
19662
+ FILTER_YEAR[FILTER_YEAR["LAST_MONTH"] = 3] = "LAST_MONTH";
19663
+ FILTER_YEAR[FILTER_YEAR["LAST_DAY"] = 4] = "LAST_DAY";
19664
+ })(FILTER_YEAR || (FILTER_YEAR = {}));
19665
+
19666
+ var TYPECHART;
19667
+
19668
+ (function (TYPECHART) {
19669
+ TYPECHART[TYPECHART["AREA"] = 0] = "AREA";
19670
+ TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
19671
+ TYPECHART[TYPECHART["LINE"] = 2] = "LINE";
19672
+ TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
19673
+ })(TYPECHART || (TYPECHART = {}));
19674
+
19641
19675
  var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","size-icon":"_1WLBo","block-dashboard":"_10Pgm","size-arrow":"_3jPb_","color-down":"_1c43y","color-up":"_F1afY","box-filter":"_1kqUQ","title-card":"_10hbz","value-card":"_2rmw_","deviant-card":"_1tdQu","filter-card":"_2BvFN","box-skill-item":"_2TBTW","numerical-order":"_3XXJp","backoround-top-skill":"_LCuWQ","color-filter":"_3x9D7","btn-filter":"_2In63","block-collapse":"_1Vhg_","form-date-picker":"_6yLxd","bock-filter-left":"_h74SO","bock-filter-right":"_3e2pi","form-filter-right":"_ntUB6","form-filter-left":"_1DlZ4","bock-filter-wrap":"_1tYDM","title-card-box":"_3hSow","box-item":"_1yuC9","image-no-data":"_2PMoX","image-grade":"_3ZX0b","chart-data":"_2asi-","apexcharts-datalabels":"_muT01","apexcharts-pie-label":"_35BzZ","image-custom":"_3pkbc","image-special-need":"_16MpB","title-dashboard":"_CHu-i","box-chart":"_3Y-Dd","block-filter-right":"_1YJnk","shadow-lg":"_2eMbe","chart-header-wrapper":"_6ZvFg","devide-component":"_24CNV","header-chart":"_2vtSi","header-left":"_IpsVf","icon-chart":"_gzxWe","header-right":"_37IcR","header-title":"_2G6Wz","button-export":"_3xpNv","button-content":"_3H5Ly","button-icon":"_J_n-D","icon-config":"_3AALV","headẻ-chart":"_g5-bn","btn-show-chart":"_2htKu","checkbox-chart":"_1qXAT","column-chart-percent":"_3NgrB","chart-background":"_32fu3","custom-marker":"_DmMzw","mark-custom":"_1eUXn","item-legend":"_3hrrC","label-legend-custom":"_Q-iiW","mark-legend":"_cD4ey","label-chart":"_24PRg","percent":"_2HWhv","listItem":"_2Hdbu","item":"_3RJ2T","student-by-age":"_38ikt","total-student":"_1TnWs","pie-chart":"_3BTJi","options-gender":"_1Ws0m","legend":"_2HnO_","text-lengend":"_2BFJw","student-by-grade":"_2az-l","bubble-chart-custom":"_2j8fp","x-axis-custom-wrap":"_1BN5z","axis-content":"_1rYav","legend-wrap":"_3-zAs","list-percent":"_1PPhv","percent-item":"_1rjWR","chart-custom":"_f-Ti4","chart-buddle":"_TPa6x","title-grade":"_1hZ_V","title-chart":"_pFFg9"};
19642
19676
 
19643
19677
  var CheckboxCustom = function CheckboxCustom(_ref) {
@@ -19690,6 +19724,201 @@ var CheckboxCustom = function CheckboxCustom(_ref) {
19690
19724
  }));
19691
19725
  };
19692
19726
 
19727
+ var PlusButton = function PlusButton(_ref) {
19728
+ var _ref$isActive = _ref.isActive,
19729
+ isActive = _ref$isActive === void 0 ? false : _ref$isActive;
19730
+ return React.createElement("div", {
19731
+ style: {
19732
+ transform: isActive ? "rotate(45deg)" : ""
19733
+ }
19734
+ }, React.createElement("svg", {
19735
+ xmlns: "http://www.w3.org/2000/svg",
19736
+ width: "24",
19737
+ height: "24",
19738
+ viewBox: "0 0 24 24",
19739
+ fill: "none"
19740
+ }, React.createElement("rect", {
19741
+ width: "24",
19742
+ height: "24",
19743
+ rx: "12",
19744
+ fill: !isActive ? "#808080" : "#D9D9D9"
19745
+ }), React.createElement("path", {
19746
+ "fill-rule": "evenodd",
19747
+ "clip-rule": "evenodd",
19748
+ d: "M12.7143 7H11.2857V11.2857H7V12.7143H11.2857V17H12.7143V12.7143H17V11.2857H12.7143V7Z",
19749
+ fill: "white"
19750
+ })));
19751
+ };
19752
+
19753
+ var HeaderChart = function HeaderChart(_ref) {
19754
+ var title = _ref.title,
19755
+ isOpen = _ref.isOpen,
19756
+ onToggle = _ref.onToggle,
19757
+ _ref$isShowChangeChar = _ref.isShowChangeChart,
19758
+ isShowChangeChart = _ref$isShowChangeChar === void 0 ? false : _ref$isShowChangeChar,
19759
+ _ref$typeChart = _ref.typeChart,
19760
+ typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
19761
+ onChangeChart = _ref.onChangeChart,
19762
+ options = _ref.options;
19763
+ return React.createElement("div", {
19764
+ className: "d-flex justify-content-between align-items-center " + styles$1["header-chart"] + " "
19765
+ }, React.createElement("div", {
19766
+ className: "" + styles$1["header-left"]
19767
+ }, React.createElement("span", {
19768
+ className: styles$1["header-title"] + " pr-2"
19769
+ }, title), React.createElement("i", {
19770
+ className: styles$1["icon-chart"] + " fal fa-info-circle cursor-pointer"
19771
+ })), React.createElement("div", {
19772
+ className: "" + styles$1["header-right"]
19773
+ }, isOpen && isShowChangeChart && (options === null || options === void 0 ? void 0 : options.length) && React.createElement("div", {
19774
+ className: "d-flex align-items-center d-inline-block pr-4"
19775
+ }, React.createElement("div", {
19776
+ className: "d-flex align-items-center px-2 " + styles$1["checkbox-chart"]
19777
+ }, React.createElement("div", {
19778
+ className: "pr-4 d-flex",
19779
+ onClick: function onClick() {
19780
+ return onChangeChart(options[0].value);
19781
+ },
19782
+ style: {
19783
+ cursor: "pointer"
19784
+ }
19785
+ }, React.createElement(CheckboxCustom, {
19786
+ width: 16,
19787
+ height: 16,
19788
+ isActive: typeChart === options[0].value || typeChart === TYPECHART.BOTH,
19789
+ className: "pr-2"
19790
+ }), React.createElement("label", {
19791
+ className: "" + styles$1["label-chart"],
19792
+ style: {
19793
+ color: "#252733",
19794
+ marginBottom: 0,
19795
+ cursor: "pointer"
19796
+ }
19797
+ }, "Ridge charts"))), React.createElement("div", {
19798
+ className: "d-inline-block px-2 " + styles$1["checkbox-chart"]
19799
+ }, React.createElement("div", {
19800
+ className: "pr-4 d-flex",
19801
+ onClick: function onClick() {
19802
+ return onChangeChart(options[1].value);
19803
+ },
19804
+ style: {
19805
+ cursor: "pointer"
19806
+ }
19807
+ }, React.createElement(CheckboxCustom, {
19808
+ width: 16,
19809
+ height: 16,
19810
+ isActive: typeChart === options[1].value || typeChart === TYPECHART.BOTH,
19811
+ className: "pr-2"
19812
+ }), React.createElement("label", {
19813
+ className: "" + styles$1["label-chart"],
19814
+ style: {
19815
+ color: "#252733",
19816
+ marginBottom: 0,
19817
+ cursor: "pointer"
19818
+ }
19819
+ }, options[1].value === TYPECHART.BAR ? "Bar charts" : "Line charts")))), React.createElement("i", {
19820
+ className: "fas fa-ellipsis-v pr-4 " + styles$1["icon-config"]
19821
+ }), React.createElement("div", {
19822
+ onClick: onToggle,
19823
+ className: styles$1["btn-show-chart"],
19824
+ style: {
19825
+ cursor: "pointer"
19826
+ }
19827
+ }, React.createElement(PlusButton, {
19828
+ isActive: isOpen
19829
+ }))));
19830
+ };
19831
+
19832
+ var useBehavior = function useBehavior(initialTypeChart) {
19833
+ var _useState = useState(""),
19834
+ teacherUserId = _useState[0],
19835
+ setTeacherUserId = _useState[1];
19836
+
19837
+ var _useState2 = useState(initialTypeChart.map(function () {
19838
+ return false;
19839
+ })),
19840
+ chartIsOpened = _useState2[0],
19841
+ setChartIsOpened = _useState2[1];
19842
+
19843
+ var _useState3 = useState(initialTypeChart),
19844
+ typeChartList = _useState3[0],
19845
+ setTypeChartList = _useState3[1];
19846
+
19847
+ var onToggle = function onToggle(idx) {
19848
+ var newStateChart = [].concat(chartIsOpened);
19849
+ newStateChart[idx] = !newStateChart[idx];
19850
+ setChartIsOpened(newStateChart);
19851
+ };
19852
+
19853
+ var onChangeChart = function onChangeChart(idx, type) {
19854
+ switch (type) {
19855
+ case TYPECHART.AREA:
19856
+ if (typeChartList[idx] === TYPECHART.BAR || typeChartList[idx] === TYPECHART.LINE) {
19857
+ setTypeChartList(typeChartList.map(function (cur, index) {
19858
+ return index === idx ? TYPECHART.BOTH : cur;
19859
+ }));
19860
+ return;
19861
+ }
19862
+
19863
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19864
+ setTypeChartList(typeChartList.map(function (cur, index) {
19865
+ return index === idx ? initialTypeChart[idx] : cur;
19866
+ }));
19867
+ }
19868
+
19869
+ return;
19870
+
19871
+ case TYPECHART.BAR:
19872
+ if (typeChartList[idx] === TYPECHART.AREA) {
19873
+ setTypeChartList(typeChartList.map(function (cur, index) {
19874
+ return index === idx ? TYPECHART.BOTH : cur;
19875
+ }));
19876
+ return;
19877
+ }
19878
+
19879
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19880
+ setTypeChartList(typeChartList.map(function (cur, index) {
19881
+ return index === idx ? TYPECHART.AREA : cur;
19882
+ }));
19883
+ }
19884
+
19885
+ return;
19886
+
19887
+ case TYPECHART.LINE:
19888
+ if (typeChartList[idx] === TYPECHART.AREA) {
19889
+ setTypeChartList(typeChartList.map(function (cur, index) {
19890
+ return index === idx ? TYPECHART.BOTH : cur;
19891
+ }));
19892
+ return;
19893
+ }
19894
+
19895
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19896
+ setTypeChartList(typeChartList.map(function (cur, index) {
19897
+ return index === idx ? TYPECHART.AREA : cur;
19898
+ }));
19899
+ }
19900
+
19901
+ return;
19902
+
19903
+ default:
19904
+ return;
19905
+ }
19906
+ };
19907
+
19908
+ var changeCurrentTeacherUserId = function changeCurrentTeacherUserId(userId) {
19909
+ setTeacherUserId(userId);
19910
+ };
19911
+
19912
+ return {
19913
+ chartIsOpened: chartIsOpened,
19914
+ onToggle: onToggle,
19915
+ onChangeChart: onChangeChart,
19916
+ typeChartList: typeChartList,
19917
+ teacherUserId: teacherUserId,
19918
+ changeCurrentTeacherUserId: changeCurrentTeacherUserId
19919
+ };
19920
+ };
19921
+
19693
19922
  var INITIAL_BEST_FRIENDS = {
19694
19923
  friends: 0,
19695
19924
  couldBeFriends: 0,
@@ -25442,31 +25671,6 @@ var moment = createCommonjsModule(function (module, exports) {
25442
25671
  })));
25443
25672
  });
25444
25673
 
25445
- var LegalGenderType;
25446
-
25447
- (function (LegalGenderType) {
25448
- LegalGenderType[LegalGenderType["Male"] = 0] = "Male";
25449
- LegalGenderType[LegalGenderType["Female"] = 1] = "Female";
25450
- })(LegalGenderType || (LegalGenderType = {}));
25451
-
25452
- var MtssType;
25453
-
25454
- (function (MtssType) {
25455
- MtssType[MtssType["Tier1"] = 0] = "Tier1";
25456
- MtssType[MtssType["Tier2"] = 1] = "Tier2";
25457
- MtssType[MtssType["Tier3"] = 2] = "Tier3";
25458
- })(MtssType || (MtssType = {}));
25459
-
25460
- var FILTER_YEAR;
25461
-
25462
- (function (FILTER_YEAR) {
25463
- FILTER_YEAR[FILTER_YEAR["THIS_YEAR"] = 0] = "THIS_YEAR";
25464
- FILTER_YEAR[FILTER_YEAR["LAST_YEAR"] = 1] = "LAST_YEAR";
25465
- FILTER_YEAR[FILTER_YEAR["LAST_QUARTER"] = 2] = "LAST_QUARTER";
25466
- FILTER_YEAR[FILTER_YEAR["LAST_MONTH"] = 3] = "LAST_MONTH";
25467
- FILTER_YEAR[FILTER_YEAR["LAST_DAY"] = 4] = "LAST_DAY";
25468
- })(FILTER_YEAR || (FILTER_YEAR = {}));
25469
-
25470
25674
  var gradeOptions = function gradeOptions(grades, studentUserId) {
25471
25675
  var result = !studentUserId ? GRAGE_DEFAULT : GRAGE_DEFAULT.filter(function (val) {
25472
25676
  return grades.indexOf(val) != -1;
@@ -25491,7 +25695,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25491
25695
  horizontal: true,
25492
25696
  dataLabels: {
25493
25697
  position: "top"
25494
- }
25698
+ },
25699
+ borderRadius: 5
25495
25700
  }
25496
25701
  },
25497
25702
  stroke: {
@@ -25518,6 +25723,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25518
25723
  }
25519
25724
  },
25520
25725
  yaxis: {
25726
+ min: 0,
25727
+ max: 100,
25521
25728
  labels: {
25522
25729
  show: true,
25523
25730
  align: "left",
@@ -25643,6 +25850,11 @@ var studentByAgeOptions = function studentByAgeOptions(series) {
25643
25850
  dataLabels: {
25644
25851
  enabled: false
25645
25852
  },
25853
+ plotOptions: {
25854
+ bar: {
25855
+ borderRadius: 5
25856
+ }
25857
+ },
25646
25858
  grid: {
25647
25859
  borderColor: "#F6F6F6"
25648
25860
  },
@@ -25827,7 +26039,7 @@ var getConvertMinuteToHour = function getConvertMinuteToHour(timeSecond) {
25827
26039
 
25828
26040
  return hTime;
25829
26041
  };
25830
- var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
26042
+ var readinesToLearnoptions = function readinesToLearnoptions(seriesName) {
25831
26043
  return {
25832
26044
  chart: {
25833
26045
  height: 450,
@@ -25849,6 +26061,9 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25849
26061
  tickPlacement: "between",
25850
26062
  labels: {
25851
26063
  show: false
26064
+ },
26065
+ tooltip: {
26066
+ enabled: false
25852
26067
  }
25853
26068
  },
25854
26069
  yaxis: {
@@ -25857,7 +26072,7 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25857
26072
  tickAmount: 10,
25858
26073
  labels: {
25859
26074
  formatter: function formatter(value) {
25860
- return value + "%";
26075
+ return Math.round(value) !== value ? value.toFixed(2) + "%" : value + "%";
25861
26076
  }
25862
26077
  }
25863
26078
  },
@@ -25867,16 +26082,16 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25867
26082
  show: false
25868
26083
  },
25869
26084
  y: {
25870
- formatter: function formatter(_, opts) {
25871
- var _data$opts$seriesInde;
25872
-
25873
- return (_data$opts$seriesInde = data[opts.seriesIndex]) === null || _data$opts$seriesInde === void 0 ? void 0 : _data$opts$seriesInde.studentPercentQuestion[opts.dataPointIndex].studentName;
25874
- },
26085
+ formatter: undefined,
25875
26086
  title: {
25876
26087
  formatter: function formatter() {
25877
- return "Student:";
26088
+ return "Percent";
25878
26089
  }
25879
26090
  }
26091
+ },
26092
+ z: {
26093
+ formatter: undefined,
26094
+ title: "Student: "
25880
26095
  }
25881
26096
  },
25882
26097
  labels: seriesName,
@@ -25905,7 +26120,7 @@ var convertDataToSeriesBullderChart = function convertDataToSeriesBullderChart(d
25905
26120
  return {
25906
26121
  name: i.questionText.replace("<p>", "").replace("</p>", ""),
25907
26122
  data: ((_i$studentPercentQues = i.studentPercentQuestion) === null || _i$studentPercentQues === void 0 ? void 0 : _i$studentPercentQues.map(function (question) {
25908
- return [getRandomArbitrary((index + 1) * 1000 - 330, (index + 1) * 1000 + 330), question.percentQuestion];
26123
+ return [getRandomArbitrary((index + 1) * 1000 - 330, (index + 1) * 1000 + 330), question.percentQuestion, question.studentName];
25909
26124
  })) || []
25910
26125
  };
25911
26126
  });
@@ -25919,6 +26134,11 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
25919
26134
  show: false
25920
26135
  }
25921
26136
  },
26137
+ plotOptions: {
26138
+ bar: {
26139
+ borderRadius: 5
26140
+ }
26141
+ },
25922
26142
  dataLabels: {
25923
26143
  enabled: false
25924
26144
  },
@@ -25990,7 +26210,7 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
25990
26210
  }
25991
26211
  };
25992
26212
  };
25993
- var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26213
+ var optionLineChart = function optionLineChart(months, activeData) {
25994
26214
  return {
25995
26215
  chart: {
25996
26216
  height: 350,
@@ -26003,14 +26223,14 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26003
26223
  enabled: false
26004
26224
  },
26005
26225
  fill: {
26006
- opacity: 0.5
26226
+ opacity: 1
26007
26227
  },
26008
26228
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26009
26229
  return activeData[index];
26010
26230
  }),
26011
26231
  stroke: {
26012
- curve: "straight",
26013
- show: false,
26232
+ curve: "smooth",
26233
+ show: true,
26014
26234
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26015
26235
  return activeData[index];
26016
26236
  }),
@@ -26070,37 +26290,122 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26070
26290
  }
26071
26291
  };
26072
26292
  };
26073
- var convertDataToDataChart = function convertDataToDataChart(data) {
26074
- return data.reduce(function (acc, cur) {
26075
- return [].concat(acc, cur.resultQuestion.map(function (i) {
26076
- var quests = i.questionText.split("</p>");
26077
- return quests[0].replace("<p>", "").trim();
26078
- }).filter(function (i) {
26079
- return !!i && !acc.includes(i);
26080
- }));
26081
- }, []);
26082
- };
26083
- var convertToSeriesColumnChartAndPercent = function convertToSeriesColumnChartAndPercent(dataCharts, data) {
26084
- return dataCharts.map(function (dataName) {
26085
- return {
26086
- name: dataName,
26087
- data: data.map(function (i) {
26088
- var questionItem = i.resultQuestion.find(function (question) {
26089
- return question.questionText.includes(dataName);
26090
- });
26091
- return !!questionItem ? questionItem.avgOfStudentChoice : 0;
26092
- })
26093
- };
26094
- });
26095
- };
26096
- var convertToAvg = function convertToAvg(dataCharts, data, months) {
26097
- return dataCharts.map(function (dataName) {
26098
- return Number((data.map(function (i) {
26099
- var questionItem = i.resultQuestion.find(function (question) {
26100
- return question.questionText.includes(dataName);
26101
- });
26102
- return !!questionItem ? questionItem.avgOfStudentChoice : 0;
26103
- }).reduce(function (acc, curr) {
26293
+ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26294
+ return {
26295
+ chart: {
26296
+ height: 350,
26297
+ stacked: false,
26298
+ toolbar: {
26299
+ show: false
26300
+ }
26301
+ },
26302
+ plotOptions: {
26303
+ bar: {
26304
+ borderRadius: 5
26305
+ }
26306
+ },
26307
+ dataLabels: {
26308
+ enabled: false
26309
+ },
26310
+ fill: {
26311
+ opacity: 0.5
26312
+ },
26313
+ colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26314
+ return activeData[index];
26315
+ }),
26316
+ stroke: {
26317
+ curve: "smooth",
26318
+ show: false,
26319
+ colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26320
+ return activeData[index];
26321
+ }),
26322
+ width: 3,
26323
+ dashArray: 0
26324
+ },
26325
+ xaxis: {
26326
+ categories: months,
26327
+ labels: {
26328
+ show: true,
26329
+ style: {
26330
+ colors: ["#808080"],
26331
+ fontSize: "16px",
26332
+ fontFamily: "Roboto",
26333
+ fontWeight: 400,
26334
+ cssClass: "apexcharts-yaxis-label"
26335
+ }
26336
+ }
26337
+ },
26338
+ yaxis: {
26339
+ tickAmount: 2,
26340
+ min: 0,
26341
+ max: 100,
26342
+ labels: {
26343
+ show: true,
26344
+ align: "right",
26345
+ minWidth: 0,
26346
+ maxWidth: 160,
26347
+ style: {
26348
+ colors: ["#808080"],
26349
+ fontSize: "16px",
26350
+ fontFamily: "Roboto",
26351
+ fontWeight: 400,
26352
+ cssClass: "apexcharts-yaxis-label"
26353
+ },
26354
+ formatter: function formatter(value) {
26355
+ return value + "%";
26356
+ },
26357
+ offsetX: 0,
26358
+ offsetY: 0,
26359
+ rotate: 0
26360
+ },
26361
+ decimalsInFloat: 0
26362
+ },
26363
+ tooltip: {
26364
+ y: {
26365
+ formatter: function formatter(value) {
26366
+ return value.toFixed(2) + "%";
26367
+ }
26368
+ },
26369
+ onDatasetHover: {
26370
+ highlightDataSeries: true
26371
+ }
26372
+ },
26373
+ legend: {
26374
+ show: false
26375
+ }
26376
+ };
26377
+ };
26378
+ var convertDataToDataChart = function convertDataToDataChart(data) {
26379
+ return data.reduce(function (acc, cur) {
26380
+ return [].concat(acc, cur.resultQuestion.map(function (i) {
26381
+ var quests = i.questionText.split("</p>");
26382
+ return quests[0].replace("<p>", "").trim();
26383
+ }).filter(function (i) {
26384
+ return !!i && !acc.includes(i);
26385
+ }));
26386
+ }, []);
26387
+ };
26388
+ var convertToSeriesColumnChartAndPercent = function convertToSeriesColumnChartAndPercent(dataCharts, data) {
26389
+ return dataCharts.map(function (dataName) {
26390
+ return {
26391
+ name: dataName,
26392
+ data: data.map(function (i) {
26393
+ var questionItem = i.resultQuestion.find(function (question) {
26394
+ return question.questionText.includes(dataName);
26395
+ });
26396
+ return !!questionItem ? questionItem.avgOfStudentChoice : 0;
26397
+ })
26398
+ };
26399
+ });
26400
+ };
26401
+ var convertToAvg = function convertToAvg(dataCharts, data, months) {
26402
+ return dataCharts.map(function (dataName) {
26403
+ return Number((data.map(function (i) {
26404
+ var questionItem = i.resultQuestion.find(function (question) {
26405
+ return question.questionText.includes(dataName);
26406
+ });
26407
+ return !!questionItem ? questionItem.avgOfStudentChoice : 0;
26408
+ }).reduce(function (acc, curr) {
26104
26409
  return acc + curr;
26105
26410
  }, 0) / months.length).toFixed(2));
26106
26411
  });
@@ -26110,10 +26415,10 @@ var seriesNameBubbleChartCustom = function seriesNameBubbleChartCustom(series) {
26110
26415
  return i.questionText.replace("<p>", "").replace("</p>", "");
26111
26416
  });
26112
26417
  };
26113
- var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
26418
+ var mergeBarChartAndArea = function mergeBarChartAndArea(series, isHasLineChart) {
26114
26419
  var barChartSeries = series.map(function (i) {
26115
26420
  return _extends({}, i, {
26116
- type: "bar"
26421
+ type: isHasLineChart ? "line" : "bar"
26117
26422
  });
26118
26423
  });
26119
26424
  var areaChartSeries = series.map(function (i) {
@@ -26124,9 +26429,9 @@ var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
26124
26429
  return [].concat(barChartSeries, areaChartSeries);
26125
26430
  };
26126
26431
  var getLastQuarterRange = function getLastQuarterRange() {
26127
- var curQuarter = moment().quarter();
26128
- var start = moment().quarter(curQuarter).startOf("quarter").valueOf();
26129
- var end = moment().quarter(curQuarter).endOf("quarter").valueOf();
26432
+ var lastQuarter = moment().utc().quarter() - 1;
26433
+ var start = lastQuarter ? moment().utc().quarter(lastQuarter).startOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).startOf("quarter").valueOf();
26434
+ var end = lastQuarter ? moment().utc().quarter(lastQuarter).endOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).endOf("quarter").valueOf();
26130
26435
  return {
26131
26436
  start: start,
26132
26437
  end: end
@@ -26135,30 +26440,89 @@ var getLastQuarterRange = function getLastQuarterRange() {
26135
26440
  var filterYearData = [{
26136
26441
  label: "This Year",
26137
26442
  value: FILTER_YEAR.THIS_YEAR,
26138
- startDate: moment().startOf("year").valueOf(),
26139
- endDate: moment().endOf("day").valueOf()
26443
+ startDate: moment().utc().startOf("year").valueOf(),
26444
+ endDate: moment().utc().endOf("day").valueOf()
26140
26445
  }, {
26141
26446
  label: "Last Year",
26142
26447
  value: FILTER_YEAR.LAST_YEAR,
26143
- startDate: moment().add(-1, "years").startOf("year").valueOf(),
26144
- endDate: moment().add(-1, "years").endOf("year").valueOf()
26448
+ startDate: moment().utc().add(-1, "years").startOf("year").valueOf(),
26449
+ endDate: moment().utc().add(-1, "years").endOf("year").valueOf()
26145
26450
  }, {
26146
26451
  label: "Last Quarter",
26147
26452
  value: FILTER_YEAR.LAST_QUARTER,
26148
26453
  startDate: getLastQuarterRange().start,
26149
26454
  endDate: getLastQuarterRange().end
26150
26455
  }, {
26151
- label: "Last 30 day",
26456
+ label: "Last 30 Day",
26152
26457
  value: FILTER_YEAR.LAST_MONTH,
26153
- startDate: moment().add(-1, "months").startOf("month").valueOf(),
26154
- endDate: moment().add(-1, "months").endOf("month").valueOf()
26458
+ startDate: moment().utc().add(-30, "days").startOf("day").valueOf(),
26459
+ endDate: moment().utc().endOf("day").valueOf()
26155
26460
  }, {
26156
26461
  label: "Last Day",
26157
26462
  value: FILTER_YEAR.LAST_DAY,
26158
- startDate: moment().add(-1, "days").startOf("day").valueOf(),
26159
- endDate: moment().add(-1, "days").endOf("day").valueOf()
26463
+ startDate: moment().utc().add(-1, "days").startOf("day").valueOf(),
26464
+ endDate: moment().utc().add(-1, "days").endOf("day").valueOf()
26160
26465
  }];
26161
26466
 
26467
+ var BubbleChartCustom = function BubbleChartCustom(_ref) {
26468
+ var data = _ref.data;
26469
+ if (!data) return React.createElement("div", {
26470
+ className: "flex justify-content-center align-items-center",
26471
+ style: {
26472
+ height: 450
26473
+ }
26474
+ }, React.createElement("div", null, "No Data"));
26475
+ var seriesName = seriesNameBubbleChartCustom(data);
26476
+ return React.createElement("div", {
26477
+ className: styles$1["bubble-chart-custom"]
26478
+ }, React.createElement("div", {
26479
+ className: styles$1["chart-custom"]
26480
+ }, React.createElement("div", {
26481
+ className: styles$1["list-percent"]
26482
+ }, PERCENT.map(function (i, index) {
26483
+ return React.createElement("div", {
26484
+ className: "" + styles$1["percent-item"],
26485
+ key: index
26486
+ }, i, "%");
26487
+ })), React.createElement("div", {
26488
+ className: styles$1["chart-buddle"]
26489
+ }, React.createElement("div", null, React.createElement(Chart, {
26490
+ options: readinesToLearnoptions(seriesName),
26491
+ type: "scatter",
26492
+ series: convertDataToSeriesBullderChart(data),
26493
+ width: "100%",
26494
+ height: 450
26495
+ }))), React.createElement("div", {
26496
+ className: styles$1["x-axis-custom-wrap"]
26497
+ }, React.createElement("div", {
26498
+ className: styles$1["axis-content"]
26499
+ }, seriesName.map(function (i, index) {
26500
+ return React.createElement("div", {
26501
+ key: index
26502
+ }, i);
26503
+ }))), React.createElement("div", {
26504
+ className: styles$1["legend-wrap"]
26505
+ }, seriesName.map(function (i, index) {
26506
+ return React.createElement("div", {
26507
+ className: "" + styles$1["item"],
26508
+ key: index
26509
+ }, React.createElement("div", {
26510
+ className: "" + styles$1["mark-custom"],
26511
+ style: {
26512
+ backgroundColor: COLOR_CHART_BUBBLE[index]
26513
+ }
26514
+ }), React.createElement("label", {
26515
+ className: "" + styles$1["label-legend-custom"]
26516
+ }, i));
26517
+ }))));
26518
+ };
26519
+
26520
+ function propsAreEqual(prevProps, nextProps) {
26521
+ return JSON.stringify(prevProps === null || prevProps === void 0 ? void 0 : prevProps.data) === JSON.stringify(nextProps === null || nextProps === void 0 ? void 0 : nextProps.data);
26522
+ }
26523
+
26524
+ var BubbleChartCustom$1 = React.memo(BubbleChartCustom, propsAreEqual);
26525
+
26162
26526
  var AreaChart = function AreaChart(_ref) {
26163
26527
  var series = _ref.series,
26164
26528
  months = _ref.months,
@@ -26188,8 +26552,10 @@ var BarChart = function BarChart(_ref) {
26188
26552
  var BarAndAreaChart = function BarAndAreaChart(_ref) {
26189
26553
  var series = _ref.series,
26190
26554
  months = _ref.months,
26191
- activeColumn = _ref.activeColumn;
26192
- var newseries = mergeBarChartAndArea(series);
26555
+ activeColumn = _ref.activeColumn,
26556
+ _ref$isHasLineChart = _ref.isHasLineChart,
26557
+ isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart;
26558
+ var newseries = mergeBarChartAndArea(series, isHasLineChart);
26193
26559
  return React.createElement(Chart, {
26194
26560
  options: optionBarChartAndArea(months, activeColumn),
26195
26561
  type: "line",
@@ -26199,18 +26565,31 @@ var BarAndAreaChart = function BarAndAreaChart(_ref) {
26199
26565
  });
26200
26566
  };
26201
26567
 
26202
- var TYPECHART;
26203
-
26204
- (function (TYPECHART) {
26205
- TYPECHART[TYPECHART["AREA"] = 0] = "AREA";
26206
- TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
26207
- TYPECHART[TYPECHART["BOTH"] = 2] = "BOTH";
26208
- })(TYPECHART || (TYPECHART = {}));
26568
+ var LineChart = function LineChart(_ref) {
26569
+ var series = _ref.series,
26570
+ months = _ref.months,
26571
+ activeColumn = _ref.activeColumn;
26572
+ return React.createElement(Chart, {
26573
+ options: optionLineChart(months, activeColumn),
26574
+ type: "line",
26575
+ series: series,
26576
+ width: "100%",
26577
+ height: 450
26578
+ });
26579
+ };
26209
26580
 
26210
26581
  var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26211
26582
  var data = _ref.data,
26212
26583
  _ref$typeChart = _ref.typeChart,
26213
- typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart;
26584
+ typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
26585
+ _ref$isHasLineChart = _ref.isHasLineChart,
26586
+ isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart;
26587
+ if (!data) return React.createElement("div", {
26588
+ className: "flex justify-content-center align-items-center",
26589
+ style: {
26590
+ height: 450
26591
+ }
26592
+ }, React.createElement("div", null, "No Data"));
26214
26593
 
26215
26594
  var _useState = useState([]),
26216
26595
  activeColumn = _useState[0],
@@ -26296,6 +26675,11 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26296
26675
  activeColumn: activeColumn,
26297
26676
  series: series
26298
26677
  }), typeChart === TYPECHART.BOTH && React.createElement(BarAndAreaChart, {
26678
+ months: months,
26679
+ activeColumn: activeColumn,
26680
+ series: series,
26681
+ isHasLineChart: isHasLineChart
26682
+ }), typeChart === TYPECHART.LINE && React.createElement(LineChart, {
26299
26683
  months: months,
26300
26684
  activeColumn: activeColumn,
26301
26685
  series: series
@@ -26322,226 +26706,23 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26322
26706
  })));
26323
26707
  };
26324
26708
 
26325
- var propsAreEqual = function propsAreEqual(preProps, nextProps) {
26709
+ var propsAreEqual$1 = function propsAreEqual(preProps, nextProps) {
26326
26710
  return JSON.stringify(preProps) === JSON.stringify(nextProps);
26327
26711
  };
26328
26712
 
26329
- var ColumnChartAndPercent$1 = React.memo(ColumnChartAndPercent, propsAreEqual);
26330
-
26331
- var PlusButton = function PlusButton(_ref) {
26332
- var _ref$isActive = _ref.isActive,
26333
- isActive = _ref$isActive === void 0 ? false : _ref$isActive;
26334
- return React.createElement("div", {
26335
- style: {
26336
- transform: isActive ? "rotate(45deg)" : ""
26337
- }
26338
- }, React.createElement("svg", {
26339
- xmlns: "http://www.w3.org/2000/svg",
26340
- width: "24",
26341
- height: "24",
26342
- viewBox: "0 0 24 24",
26343
- fill: "none"
26344
- }, React.createElement("rect", {
26345
- width: "24",
26346
- height: "24",
26347
- rx: "12",
26348
- fill: !isActive ? "#808080" : "#D9D9D9"
26349
- }), React.createElement("path", {
26350
- "fill-rule": "evenodd",
26351
- "clip-rule": "evenodd",
26352
- d: "M12.7143 7H11.2857V11.2857H7V12.7143H11.2857V17H12.7143V12.7143H17V11.2857H12.7143V7Z",
26353
- fill: "white"
26354
- })));
26355
- };
26356
-
26357
- var HeaderChart = function HeaderChart(_ref) {
26358
- var title = _ref.title,
26359
- isOpen = _ref.isOpen,
26360
- onToggle = _ref.onToggle,
26361
- _ref$isShowChangeChar = _ref.isShowChangeChart,
26362
- isShowChangeChart = _ref$isShowChangeChar === void 0 ? false : _ref$isShowChangeChar,
26363
- _ref$typeChart = _ref.typeChart,
26364
- typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
26365
- onChangeChart = _ref.onChangeChart;
26366
- return React.createElement("div", {
26367
- className: "d-flex justify-content-between align-items-center " + styles$1["header-chart"] + " "
26368
- }, React.createElement("div", {
26369
- className: "" + styles$1["header-left"]
26370
- }, React.createElement("span", {
26371
- className: styles$1["header-title"] + " pr-2"
26372
- }, title), React.createElement("i", {
26373
- className: styles$1["icon-chart"] + " fal fa-info-circle cursor-pointer"
26374
- })), React.createElement("div", {
26375
- className: "" + styles$1["header-right"]
26376
- }, isOpen && isShowChangeChart && React.createElement("div", {
26377
- className: "d-flex align-items-center d-inline-block pr-4"
26378
- }, React.createElement("div", {
26379
- className: "d-flex align-items-center px-2 " + styles$1["checkbox-chart"]
26380
- }, React.createElement("div", {
26381
- className: "pr-4 d-flex",
26382
- onClick: function onClick() {
26383
- return onChangeChart(TYPECHART.AREA);
26384
- },
26385
- style: {
26386
- cursor: "pointer"
26387
- }
26388
- }, React.createElement(CheckboxCustom, {
26389
- width: 16,
26390
- height: 16,
26391
- isActive: typeChart === TYPECHART.AREA || typeChart === TYPECHART.BOTH,
26392
- className: "pr-2"
26393
- }), React.createElement("label", {
26394
- className: "" + styles$1["label-chart"],
26395
- style: {
26396
- color: "#252733",
26397
- marginBottom: 0,
26398
- cursor: "pointer"
26399
- }
26400
- }, "Ridge charts"))), React.createElement("div", {
26401
- className: "d-inline-block px-2 " + styles$1["checkbox-chart"]
26402
- }, React.createElement("div", {
26403
- className: "pr-4 d-flex",
26404
- onClick: function onClick() {
26405
- return onChangeChart(TYPECHART.BAR);
26406
- },
26407
- style: {
26408
- cursor: "pointer"
26409
- }
26410
- }, React.createElement(CheckboxCustom, {
26411
- width: 16,
26412
- height: 16,
26413
- isActive: typeChart === TYPECHART.BAR || typeChart === TYPECHART.BOTH,
26414
- className: "pr-2"
26415
- }), React.createElement("label", {
26416
- className: "" + styles$1["label-chart"],
26417
- style: {
26418
- color: "#252733",
26419
- marginBottom: 0,
26420
- cursor: "pointer"
26421
- }
26422
- }, "Line charts")))), React.createElement("i", {
26423
- className: "fas fa-ellipsis-v pr-4 " + styles$1["icon-config"]
26424
- }), React.createElement("div", {
26425
- onClick: onToggle,
26426
- className: styles$1["btn-show-chart"],
26427
- style: {
26428
- cursor: "pointer"
26429
- }
26430
- }, React.createElement(PlusButton, {
26431
- isActive: isOpen
26432
- }))));
26433
- };
26434
-
26435
- var INITIAL_CHART_STATUS = [false, false, false, false, false, false, false, false, false];
26436
- var INITIAL_TYPE_CHART = [TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR, TYPECHART.BAR];
26437
-
26438
- var useBehavior = function useBehavior() {
26439
- var _useState = useState([].concat(INITIAL_CHART_STATUS)),
26440
- chartIsOpened = _useState[0],
26441
- setChartIsOpened = _useState[1];
26442
-
26443
- var _useState2 = useState(INITIAL_TYPE_CHART),
26444
- typeChartList = _useState2[0],
26445
- setTypeChartList = _useState2[1];
26446
-
26447
- var onToggle = function onToggle(idx) {
26448
- var newStateChart = [].concat(chartIsOpened);
26449
- newStateChart[idx] = !newStateChart[idx];
26450
- setChartIsOpened(newStateChart);
26451
- };
26452
-
26453
- var onChangeChart = function onChangeChart(idx, type) {
26454
- if (type !== typeChartList[idx] && typeChartList[idx] !== TYPECHART.BOTH) {
26455
- setTypeChartList(typeChartList.map(function (cur, index) {
26456
- return index === idx ? TYPECHART.BOTH : cur;
26457
- }));
26458
- return;
26459
- }
26460
-
26461
- if (typeChartList[idx] === TYPECHART.BOTH && type === TYPECHART.AREA) {
26462
- setTypeChartList(typeChartList.map(function (cur, index) {
26463
- return index === idx ? TYPECHART.BAR : cur;
26464
- }));
26465
- return;
26466
- }
26467
-
26468
- if (typeChartList[idx] === TYPECHART.BOTH && type === TYPECHART.BAR) {
26469
- setTypeChartList(typeChartList.map(function (cur, index) {
26470
- return index === idx ? TYPECHART.AREA : cur;
26471
- }));
26472
- return;
26473
- }
26474
-
26475
- setTypeChartList(typeChartList.map(function (cur, index) {
26476
- return index === idx ? type : cur;
26477
- }));
26478
- };
26479
-
26480
- return {
26481
- chartIsOpened: chartIsOpened,
26482
- onToggle: onToggle,
26483
- onChangeChart: onChangeChart,
26484
- typeChartList: typeChartList
26485
- };
26486
- };
26487
-
26488
- var BubbleChartCustom = function BubbleChartCustom(_ref) {
26489
- var data = _ref.data;
26490
- var seriesName = seriesNameBubbleChartCustom(data);
26491
- return React.createElement("div", {
26492
- className: styles$1["bubble-chart-custom"]
26493
- }, React.createElement("div", {
26494
- className: styles$1["chart-custom"]
26495
- }, React.createElement("div", {
26496
- className: styles$1["list-percent"]
26497
- }, PERCENT.map(function (i, index) {
26498
- return React.createElement("div", {
26499
- className: "" + styles$1["percent-item"],
26500
- key: index
26501
- }, i, "%");
26502
- })), React.createElement("div", {
26503
- className: styles$1["chart-buddle"]
26504
- }, React.createElement("div", null, React.createElement(Chart, {
26505
- options: readinesToLearnoptions(data, seriesName),
26506
- type: "scatter",
26507
- series: convertDataToSeriesBullderChart(data),
26508
- width: "100%",
26509
- height: 450
26510
- }))), React.createElement("div", {
26511
- className: styles$1["x-axis-custom-wrap"]
26512
- }, React.createElement("div", {
26513
- className: styles$1["axis-content"]
26514
- }, seriesName.map(function (i, index) {
26515
- return React.createElement("div", {
26516
- key: index
26517
- }, i);
26518
- }))), React.createElement("div", {
26519
- className: styles$1["legend-wrap"]
26520
- }, seriesName.map(function (i, index) {
26521
- return React.createElement("div", {
26522
- className: "" + styles$1["item"],
26523
- key: index
26524
- }, React.createElement("div", {
26525
- className: "" + styles$1["mark-custom"],
26526
- style: {
26527
- backgroundColor: COLOR_CHART_BUBBLE[index]
26528
- }
26529
- }), React.createElement("label", {
26530
- className: "" + styles$1["label-legend-custom"]
26531
- }, i));
26532
- }))));
26533
- };
26534
-
26535
- function propsAreEqual$1(prevProps, nextProps) {
26536
- return JSON.stringify(prevProps === null || prevProps === void 0 ? void 0 : prevProps.data) === JSON.stringify(nextProps === null || nextProps === void 0 ? void 0 : nextProps.data);
26537
- }
26538
-
26539
- var BubbleChartCustom$1 = React.memo(BubbleChartCustom, propsAreEqual$1);
26713
+ var ColumnChartAndPercent$1 = React.memo(ColumnChartAndPercent, propsAreEqual$1);
26540
26714
 
26541
26715
  var CustomPieChart = function CustomPieChart(_ref) {
26542
26716
  var data = _ref.data;
26717
+ if (!data) return React.createElement("div", {
26718
+ className: "flex justify-content-center align-items-center",
26719
+ style: {
26720
+ height: 450
26721
+ }
26722
+ }, React.createElement("div", null, "No Data"));
26543
26723
  var series = Object.values(data).reverse();
26544
- var femalePropotion = Number((series[0] / (series[0] + series[1]) * 100).toFixed(2));
26724
+ var femalePropotion = series[0] / (series[0] + series[1]) * 100;
26725
+ var roundFemalePropotion = Math.round(femalePropotion) !== femalePropotion ? femalePropotion.toFixed(2) : femalePropotion;
26545
26726
  return React.createElement("div", {
26546
26727
  className: styles$1["pie-chart"]
26547
26728
  }, series.filter(function (i) {
@@ -26569,7 +26750,7 @@ var CustomPieChart = function CustomPieChart(_ref) {
26569
26750
  className: styles$1["text-lengend"]
26570
26751
  }, series[1]), React.createElement("div", {
26571
26752
  className: styles$1["text-lengend"]
26572
- }, "(", (100 - femalePropotion).toFixed(2), "%)")), React.createElement("div", {
26753
+ }, "(", 100 - Number(roundFemalePropotion), "%)")), React.createElement("div", {
26573
26754
  className: styles$1["legend"]
26574
26755
  }, React.createElement("div", {
26575
26756
  className: styles$1["mark-custom"],
@@ -26582,7 +26763,7 @@ var CustomPieChart = function CustomPieChart(_ref) {
26582
26763
  className: styles$1["text-lengend"]
26583
26764
  }, series[0]), React.createElement("div", {
26584
26765
  className: styles$1["text-lengend"]
26585
- }, "(", femalePropotion, "%)")))) : React.createElement("img", {
26766
+ }, "(", roundFemalePropotion, "%)")))) : React.createElement("img", {
26586
26767
  className: "" + styles$1["image-no-data"],
26587
26768
  src: "images/no-data-haft-pie.png"
26588
26769
  }));
@@ -26590,6 +26771,12 @@ var CustomPieChart = function CustomPieChart(_ref) {
26590
26771
 
26591
26772
  var StudentByAge = function StudentByAge(_ref) {
26592
26773
  var data = _ref.data;
26774
+ if (!data) return React.createElement("div", {
26775
+ className: "flex justify-content-center align-items-center",
26776
+ style: {
26777
+ height: 450
26778
+ }
26779
+ }, React.createElement("div", null, "No Data"));
26593
26780
  var series = convertDataStudentByAgeToSeries(data);
26594
26781
  var totalStudent = totalStudentByAge(data);
26595
26782
  return React.createElement("div", {
@@ -26634,6 +26821,12 @@ var StudentByAgeAndGender$1 = React.memo(StudentByAgeAndGender, propsAreEqual$2)
26634
26821
 
26635
26822
  var StudentByGrade = function StudentByGrade(_ref) {
26636
26823
  var data = _ref.data;
26824
+ if (!data) return React.createElement("div", {
26825
+ className: "flex justify-content-center align-items-center",
26826
+ style: {
26827
+ height: 450
26828
+ }
26829
+ }, React.createElement("div", null, "No Data"));
26637
26830
  var series = convertDataToSeriesStudentByGrade(data);
26638
26831
  var totalStudent = findTotalStudentByGrade(data);
26639
26832
  return React.createElement("div", {
@@ -27122,7 +27315,8 @@ var useChartDatas = function useChartDatas() {
27122
27315
  data: topLearningStrategies
27123
27316
  });
27124
27317
  },
27125
- isShowChangeChart: false
27318
+ isShowChangeChart: false,
27319
+ options: []
27126
27320
  }, {
27127
27321
  id: "Readiness_to_learn",
27128
27322
  label: "Readiness to learn",
@@ -27131,7 +27325,8 @@ var useChartDatas = function useChartDatas() {
27131
27325
  data: readinessToLearning
27132
27326
  });
27133
27327
  },
27134
- isShowChangeChart: false
27328
+ isShowChangeChart: false,
27329
+ options: []
27135
27330
  }, {
27136
27331
  id: "1_to_1",
27137
27332
  label: "1 To 1",
@@ -27142,7 +27337,14 @@ var useChartDatas = function useChartDatas() {
27142
27337
  typeChart: typeChart
27143
27338
  });
27144
27339
  },
27145
- isShowChangeChart: true
27340
+ isShowChangeChart: true,
27341
+ options: [{
27342
+ label: "Ridge charts",
27343
+ value: TYPECHART.AREA
27344
+ }, {
27345
+ label: "Bar charts",
27346
+ value: TYPECHART.BAR
27347
+ }]
27146
27348
  }, {
27147
27349
  id: "class_reflection",
27148
27350
  label: "Class Reflection",
@@ -27150,10 +27352,18 @@ var useChartDatas = function useChartDatas() {
27150
27352
  return React.createElement(ColumnChartAndPercent$1, {
27151
27353
  data: chartClassReflection.overviewQuestionChoice,
27152
27354
  typeChart: typeChart,
27153
- id: "class_reflection"
27355
+ id: "class_reflection",
27356
+ isHasLineChart: true
27154
27357
  });
27155
27358
  },
27156
- isShowChangeChart: true
27359
+ isShowChangeChart: true,
27360
+ options: [{
27361
+ label: "Ridge charts",
27362
+ value: TYPECHART.AREA
27363
+ }, {
27364
+ label: "Line charts",
27365
+ value: TYPECHART.LINE
27366
+ }]
27157
27367
  }, {
27158
27368
  id: "conference",
27159
27369
  label: "Conference",
@@ -27164,7 +27374,14 @@ var useChartDatas = function useChartDatas() {
27164
27374
  id: "conference"
27165
27375
  });
27166
27376
  },
27167
- isShowChangeChart: true
27377
+ isShowChangeChart: true,
27378
+ options: [{
27379
+ label: "Ridge charts",
27380
+ value: TYPECHART.AREA
27381
+ }, {
27382
+ label: "Bar charts",
27383
+ value: TYPECHART.BAR
27384
+ }]
27168
27385
  }, {
27169
27386
  id: "safety",
27170
27387
  label: "Safety",
@@ -27172,10 +27389,18 @@ var useChartDatas = function useChartDatas() {
27172
27389
  return React.createElement(ColumnChartAndPercent$1, {
27173
27390
  data: safety.overviewQuestionChoice,
27174
27391
  typeChart: typeChart,
27175
- id: "safety"
27392
+ id: "safety",
27393
+ isHasLineChart: true
27176
27394
  });
27177
27395
  },
27178
- isShowChangeChart: true
27396
+ isShowChangeChart: true,
27397
+ options: [{
27398
+ label: "Ridge charts",
27399
+ value: TYPECHART.AREA
27400
+ }, {
27401
+ label: "Line charts",
27402
+ value: TYPECHART.LINE
27403
+ }]
27179
27404
  }, {
27180
27405
  id: "Student_by_age",
27181
27406
  label: "Student by age",
@@ -27185,7 +27410,8 @@ var useChartDatas = function useChartDatas() {
27185
27410
  studentByGenderData: studentByGender
27186
27411
  });
27187
27412
  },
27188
- isShowChangeChart: false
27413
+ isShowChangeChart: false,
27414
+ options: []
27189
27415
  }, {
27190
27416
  id: "student_by_grade",
27191
27417
  label: "Students by Grade",
@@ -27194,8 +27420,12 @@ var useChartDatas = function useChartDatas() {
27194
27420
  data: studentByGrade
27195
27421
  });
27196
27422
  },
27197
- isShowChangeChart: false
27423
+ isShowChangeChart: false,
27424
+ options: []
27198
27425
  }];
27426
+ var initialTypeChart = chartDashBoards.map(function (i) {
27427
+ return i.options.length > 0 ? i.options[1].value : TYPECHART.BAR;
27428
+ });
27199
27429
  var totalCardData = [{
27200
27430
  icon: "images/icon_chart.png",
27201
27431
  title: "Total 1-to-1:",
@@ -27239,7 +27469,8 @@ var useChartDatas = function useChartDatas() {
27239
27469
  LIST_FILTERS_LEFT: LIST_FILTERS_LEFT,
27240
27470
  LIST_FILTERS_RIGHT: LIST_FILTERS_RIGHT,
27241
27471
  totalCardData: totalCardData,
27242
- onChangeFilters: onChangeFilters
27472
+ onChangeFilters: onChangeFilters,
27473
+ initialTypeChart: initialTypeChart
27243
27474
  };
27244
27475
  };
27245
27476
 
@@ -27248,7 +27479,9 @@ var StudentItemSelector = function StudentItemSelector(_ref) {
27248
27479
  onChange = _ref.onChange,
27249
27480
  externalStudentIds = _ref.externalStudentIds,
27250
27481
  studentDefault = _ref.studentDefault,
27251
- teacherUserId = _ref.teacherUserId;
27482
+ teacherUserId = _ref.teacherUserId,
27483
+ _ref$placeholder = _ref.placeholder,
27484
+ placeholder = _ref$placeholder === void 0 ? "Search student" : _ref$placeholder;
27252
27485
  var dispatch = useDispatch();
27253
27486
 
27254
27487
  var _useState = useState([]),
@@ -27326,7 +27559,7 @@ var StudentItemSelector = function StudentItemSelector(_ref) {
27326
27559
  return setSearchString(inputValue);
27327
27560
  },
27328
27561
  isLoading: isLoading,
27329
- placeholder: "Search student",
27562
+ placeholder: placeholder,
27330
27563
  defaultValue: value,
27331
27564
  onChange: onChange,
27332
27565
  isClearable: true
@@ -27381,16 +27614,18 @@ var TeacherItemSelector = function TeacherItemSelector(_ref) {
27381
27614
  };
27382
27615
 
27383
27616
  var SelectFilter = function SelectFilter(_ref) {
27384
- var teacherId = _ref.teacherId,
27385
- studentUserId = _ref.studentUserId,
27617
+ var studentUserId = _ref.studentUserId,
27386
27618
  studentId = _ref.studentId,
27387
- teacherUserId = _ref.teacherUserId,
27388
27619
  studentDefault = _ref.studentDefault,
27389
27620
  handleChangeFilters = _ref.handleChangeFilters,
27390
27621
  name = _ref.name,
27391
27622
  icon = _ref.icon,
27392
27623
  option = _ref.option,
27393
- onChangeFilters = _ref.onChangeFilters;
27624
+ onChangeFilters = _ref.onChangeFilters,
27625
+ btnStyle = _ref.btnStyle,
27626
+ filter = _ref.filter,
27627
+ teacherUserId = _ref.teacherUserId,
27628
+ changeCurrentTeacherUserId = _ref.changeCurrentTeacherUserId;
27394
27629
 
27395
27630
  var _useState = useState(false),
27396
27631
  isOpenCollapse = _useState[0],
@@ -27661,6 +27896,7 @@ var SelectFilter = function SelectFilter(_ref) {
27661
27896
  }, React.createElement(TeacherItemSelector, {
27662
27897
  onChange: function onChange(e) {
27663
27898
  handleChangeFilters(e);
27899
+ !!changeCurrentTeacherUserId && changeCurrentTeacherUserId(e.teacherUserId || "");
27664
27900
 
27665
27901
  if (!(e !== null && e !== void 0 && e.label)) {
27666
27902
  setTeacherName("");
@@ -27668,7 +27904,7 @@ var SelectFilter = function SelectFilter(_ref) {
27668
27904
  setTeacherName(e.label);
27669
27905
  }
27670
27906
  },
27671
- defaultValue: teacherId,
27907
+ defaultValue: filter === null || filter === void 0 ? void 0 : filter.teacherId,
27672
27908
  studentUserId: studentUserId || ""
27673
27909
  })));
27674
27910
  }
@@ -27679,7 +27915,8 @@ var SelectFilter = function SelectFilter(_ref) {
27679
27915
  className: styles["block-filter-component"] + " "
27680
27916
  }, React.createElement("button", {
27681
27917
  onClick: handleToggleCollapse,
27682
- className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer"
27918
+ className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer",
27919
+ style: btnStyle
27683
27920
  }, React.createElement("img", {
27684
27921
  src: "" + icon,
27685
27922
  alt: name
@@ -27693,14 +27930,14 @@ var SelectFilter = function SelectFilter(_ref) {
27693
27930
 
27694
27931
  if (!(e !== null && e !== void 0 && e.label)) {
27695
27932
  setStudentName("");
27696
- setTeacherName("");
27697
27933
  } else {
27698
27934
  setStudentName(e.label);
27699
27935
  }
27700
27936
  },
27701
27937
  value: studentId,
27702
27938
  studentDefault: studentDefault,
27703
- teacherUserId: teacherUserId
27939
+ teacherUserId: teacherUserId,
27940
+ placeholder: "Type 2 characters to search"
27704
27941
  })));
27705
27942
  }
27706
27943
 
@@ -27737,13 +27974,16 @@ var Dashboard = function Dashboard() {
27737
27974
  LIST_FILTERS_LEFT = _useChartDatas.LIST_FILTERS_LEFT,
27738
27975
  LIST_FILTERS_RIGHT = _useChartDatas.LIST_FILTERS_RIGHT,
27739
27976
  totalCardData = _useChartDatas.totalCardData,
27740
- onChangeFilters = _useChartDatas.onChangeFilters;
27977
+ onChangeFilters = _useChartDatas.onChangeFilters,
27978
+ initialTypeChart = _useChartDatas.initialTypeChart;
27741
27979
 
27742
- var _useBehavior = useBehavior(),
27980
+ var _useBehavior = useBehavior(initialTypeChart),
27743
27981
  chartIsOpened = _useBehavior.chartIsOpened,
27744
27982
  _onToggle = _useBehavior.onToggle,
27745
27983
  _onChangeChart = _useBehavior.onChangeChart,
27746
- typeChartList = _useBehavior.typeChartList;
27984
+ typeChartList = _useBehavior.typeChartList,
27985
+ teacherUserId = _useBehavior.teacherUserId,
27986
+ changeCurrentTeacherUserId = _useBehavior.changeCurrentTeacherUserId;
27747
27987
 
27748
27988
  return React.createElement("div", {
27749
27989
  className: "" + styles$1["block-dashboard"]
@@ -27789,7 +28029,13 @@ var Dashboard = function Dashboard() {
27789
28029
  filter: filter,
27790
28030
  studentId: e.studentId || 0,
27791
28031
  studentDefault: e.studentDefault,
27792
- onChangeFilters: onChangeFilters
28032
+ onChangeFilters: onChangeFilters,
28033
+ teacherUserId: teacherUserId,
28034
+ changeCurrentTeacherUserId: changeCurrentTeacherUserId,
28035
+ btnStyle: e.name === FILTER_NAME.StudentName ? {
28036
+ minWidth: 220,
28037
+ justifyContent: "center"
28038
+ } : {}
27793
28039
  });
27794
28040
  }))), React.createElement("div", {
27795
28041
  className: "d-flex align-items-center justify-content-between flex-wrap mb-3"
@@ -27816,7 +28062,8 @@ var Dashboard = function Dashboard() {
27816
28062
  onChangeChart: function onChangeChart(type) {
27817
28063
  return _onChangeChart(index, type);
27818
28064
  },
27819
- isOpen: chartIsOpened[index]
28065
+ isOpen: chartIsOpened[index],
28066
+ options: chartDashBoard.options
27820
28067
  }), React.createElement(Collapse, {
27821
28068
  isOpen: chartIsOpened[index]
27822
28069
  }, chartDashBoard.children(typeChartList[index])));