mario-education 2.4.26-admin → 2.4.28-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.
Files changed (20) hide show
  1. package/dist/MarioFramework.Education/ClientApp/src/components/Select/SelectFilter.d.ts +1 -1
  2. package/dist/MarioFramework.Education/ClientApp/src/containers/Classes/components/StudentItemSelector.d.ts +1 -0
  3. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/BarAndAreaChart.d.ts +1 -0
  4. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/ColumnChartAndPercent.d.ts +9 -11
  5. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/DashboardToPDF.d.ts +3 -0
  6. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/HeaderChart/HeaderChart.d.ts +2 -1
  7. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/LineChart.d.ts +9 -0
  8. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/StudentByAgeAndGender.d.ts +1 -0
  9. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/types.d.ts +10 -0
  10. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/utils.d.ts +6 -7
  11. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/hooks/useBehavior.d.ts +4 -2
  12. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/hooks/useChartDatas.d.ts +15 -4
  13. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/hooks/useDashboard.d.ts +29 -1
  14. package/dist/MarioFramework.Education/ClientApp/src/utils/type.d.ts +6 -0
  15. package/dist/index.css +253 -134
  16. package/dist/index.js +1809 -425
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.modern.js +1809 -425
  19. package/dist/index.modern.js.map +1 -1
  20. package/package.json +3 -1
@@ -18,6 +18,8 @@ import { FaCheck, FaTimes, FaRegEdit } from 'react-icons/fa';
18
18
  import { Editor } from '@tinymce/tinymce-react';
19
19
  import Chart from 'react-apexcharts';
20
20
  import { FiChevronDown, FiChevronUp } from 'react-icons/fi';
21
+ import jsPDF from 'jspdf';
22
+ import html2canvas from 'html2canvas';
21
23
 
22
24
  // A type of promise-like that resolves synchronously and supports only one observer
23
25
 
@@ -1146,7 +1148,7 @@ var ConferenceRubricList = function ConferenceRubricList() {
1146
1148
  }))));
1147
1149
  };
1148
1150
 
1149
- var styles = {"test":"_3ybTi","body-question-right":"_1H0W8","body-question":"_b-AXV","badge-icon":"_1fgfO","input-color-picker":"_2YR4l","question-list-session-template":"_114IY","delete-column-question-list-sesstion-template":"_qE7J0","conference-rubric-skill-column":"_2BV3o","conference-rubric-additional-row":"_1P4F2","conference-rubric-row-test":"_1SRmg","emotional-response":"_ZDINp","star-rating":"_Kzkzd","list-teacher-compare":"_Q0sF1","teacher-item":"_gu_yD","teacher-item-selected":"_33tYy","btn-filter":"_2VZin","block-filter-component":"_1d6uY","select-filter-component":"_1XSIo","hidden":"_3o8gR","box-select":"_3ru37","radio-btn":"_1tQvL","box-select-label":"_3VNX5"};
1151
+ var styles = {"test":"_3ybTi","body-question-right":"_1H0W8","body-question":"_b-AXV","badge-icon":"_1fgfO","input-color-picker":"_2YR4l","question-list-session-template":"_114IY","delete-column-question-list-sesstion-template":"_qE7J0","conference-rubric-skill-column":"_2BV3o","conference-rubric-additional-row":"_1P4F2","conference-rubric-row-test":"_1SRmg","emotional-response":"_ZDINp","star-rating":"_Kzkzd","list-teacher-compare":"_Q0sF1","teacher-item":"_gu_yD","teacher-item-selected":"_33tYy","btn-filter":"_2VZin","color-filter":"_2M0vR","block-filter-component":"_1d6uY","select-filter-component":"_1XSIo","hidden":"_3o8gR","box-select":"_3ru37","radio-btn":"_1tQvL","box-select-label":"_3VNX5"};
1150
1152
 
1151
1153
  var ToggleInput = function ToggleInput(_ref) {
1152
1154
  var value = _ref.value,
@@ -1529,6 +1531,48 @@ function _objectDestructuringEmpty(obj) {
1529
1531
  if (obj == null) throw new TypeError("Cannot destructure undefined");
1530
1532
  }
1531
1533
 
1534
+ function _unsupportedIterableToArray(o, minLen) {
1535
+ if (!o) return;
1536
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1537
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1538
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1539
+ if (n === "Map" || n === "Set") return Array.from(o);
1540
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1541
+ }
1542
+
1543
+ function _arrayLikeToArray(arr, len) {
1544
+ if (len == null || len > arr.length) len = arr.length;
1545
+
1546
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1547
+
1548
+ return arr2;
1549
+ }
1550
+
1551
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1552
+ var it;
1553
+
1554
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
1555
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1556
+ if (it) o = it;
1557
+ var i = 0;
1558
+ return function () {
1559
+ if (i >= o.length) return {
1560
+ done: true
1561
+ };
1562
+ return {
1563
+ done: false,
1564
+ value: o[i++]
1565
+ };
1566
+ };
1567
+ }
1568
+
1569
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1570
+ }
1571
+
1572
+ it = o[Symbol.iterator]();
1573
+ return it.next.bind(it);
1574
+ }
1575
+
1532
1576
  var RubricItemColumnOrder;
1533
1577
 
1534
1578
  (function (RubricItemColumnOrder) {
@@ -19638,7 +19682,41 @@ var CompareTeacher = function CompareTeacher() {
19638
19682
  }, "No compare result."))));
19639
19683
  };
19640
19684
 
19641
- 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"};
19685
+ var LegalGenderType;
19686
+
19687
+ (function (LegalGenderType) {
19688
+ LegalGenderType[LegalGenderType["Male"] = 0] = "Male";
19689
+ LegalGenderType[LegalGenderType["Female"] = 1] = "Female";
19690
+ })(LegalGenderType || (LegalGenderType = {}));
19691
+
19692
+ var MtssType;
19693
+
19694
+ (function (MtssType) {
19695
+ MtssType[MtssType["Tier1"] = 0] = "Tier1";
19696
+ MtssType[MtssType["Tier2"] = 1] = "Tier2";
19697
+ MtssType[MtssType["Tier3"] = 2] = "Tier3";
19698
+ })(MtssType || (MtssType = {}));
19699
+
19700
+ var FILTER_YEAR;
19701
+
19702
+ (function (FILTER_YEAR) {
19703
+ FILTER_YEAR[FILTER_YEAR["THIS_YEAR"] = 0] = "THIS_YEAR";
19704
+ FILTER_YEAR[FILTER_YEAR["LAST_YEAR"] = 1] = "LAST_YEAR";
19705
+ FILTER_YEAR[FILTER_YEAR["LAST_QUARTER"] = 2] = "LAST_QUARTER";
19706
+ FILTER_YEAR[FILTER_YEAR["LAST_MONTH"] = 3] = "LAST_MONTH";
19707
+ FILTER_YEAR[FILTER_YEAR["LAST_DAY"] = 4] = "LAST_DAY";
19708
+ })(FILTER_YEAR || (FILTER_YEAR = {}));
19709
+
19710
+ var TYPECHART;
19711
+
19712
+ (function (TYPECHART) {
19713
+ TYPECHART[TYPECHART["AREA"] = 0] = "AREA";
19714
+ TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
19715
+ TYPECHART[TYPECHART["LINE"] = 2] = "LINE";
19716
+ TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
19717
+ })(TYPECHART || (TYPECHART = {}));
19718
+
19719
+ var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","label-chart":"_24PRg","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","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-modal":"_3L9WC","header-desc-modal":"_1TFtP","form-checkbox":"_37aqf","checkbox-content":"_1iabV","btn-export":"_1eQAg","title-chart":"_pFFg9","image-logo":"_1eqkj","chart-to-canvas":"_2IQ8b"};
19642
19720
 
19643
19721
  var CheckboxCustom = function CheckboxCustom(_ref) {
19644
19722
  var _ref$background = _ref.background,
@@ -19690,6 +19768,201 @@ var CheckboxCustom = function CheckboxCustom(_ref) {
19690
19768
  }));
19691
19769
  };
19692
19770
 
19771
+ var PlusButton = function PlusButton(_ref) {
19772
+ var _ref$isActive = _ref.isActive,
19773
+ isActive = _ref$isActive === void 0 ? false : _ref$isActive;
19774
+ return React.createElement("div", {
19775
+ style: {
19776
+ transform: isActive ? "rotate(45deg)" : ""
19777
+ }
19778
+ }, React.createElement("svg", {
19779
+ xmlns: "http://www.w3.org/2000/svg",
19780
+ width: "24",
19781
+ height: "24",
19782
+ viewBox: "0 0 24 24",
19783
+ fill: "none"
19784
+ }, React.createElement("rect", {
19785
+ width: "24",
19786
+ height: "24",
19787
+ rx: "12",
19788
+ fill: !isActive ? "#808080" : "#D9D9D9"
19789
+ }), React.createElement("path", {
19790
+ "fill-rule": "evenodd",
19791
+ "clip-rule": "evenodd",
19792
+ d: "M12.7143 7H11.2857V11.2857H7V12.7143H11.2857V17H12.7143V12.7143H17V11.2857H12.7143V7Z",
19793
+ fill: "white"
19794
+ })));
19795
+ };
19796
+
19797
+ var HeaderChart = function HeaderChart(_ref) {
19798
+ var title = _ref.title,
19799
+ isOpen = _ref.isOpen,
19800
+ onToggle = _ref.onToggle,
19801
+ _ref$isShowChangeChar = _ref.isShowChangeChart,
19802
+ isShowChangeChart = _ref$isShowChangeChar === void 0 ? false : _ref$isShowChangeChar,
19803
+ _ref$typeChart = _ref.typeChart,
19804
+ typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
19805
+ onChangeChart = _ref.onChangeChart,
19806
+ options = _ref.options;
19807
+ return React.createElement("div", {
19808
+ className: "d-flex justify-content-between align-items-center " + styles$1["header-chart"] + " "
19809
+ }, React.createElement("div", {
19810
+ className: "" + styles$1["header-left"]
19811
+ }, React.createElement("span", {
19812
+ className: styles$1["header-title"] + " pr-2"
19813
+ }, title), React.createElement("i", {
19814
+ className: styles$1["icon-chart"] + " fal fa-info-circle cursor-pointer"
19815
+ })), React.createElement("div", {
19816
+ className: "" + styles$1["header-right"]
19817
+ }, isOpen && isShowChangeChart && (options === null || options === void 0 ? void 0 : options.length) && React.createElement("div", {
19818
+ className: "d-flex align-items-center d-inline-block pr-4"
19819
+ }, React.createElement("div", {
19820
+ className: "d-flex align-items-center px-2 " + styles$1["checkbox-chart"]
19821
+ }, React.createElement("div", {
19822
+ className: "pr-4 d-flex",
19823
+ onClick: function onClick() {
19824
+ return onChangeChart(options[0].value);
19825
+ },
19826
+ style: {
19827
+ cursor: "pointer"
19828
+ }
19829
+ }, React.createElement(CheckboxCustom, {
19830
+ width: 16,
19831
+ height: 16,
19832
+ isActive: typeChart === options[0].value || typeChart === TYPECHART.BOTH,
19833
+ className: "pr-2"
19834
+ }), React.createElement("label", {
19835
+ className: "" + styles$1["label-chart"],
19836
+ style: {
19837
+ color: "#252733",
19838
+ marginBottom: 0,
19839
+ cursor: "pointer"
19840
+ }
19841
+ }, "Ridge charts"))), React.createElement("div", {
19842
+ className: "d-inline-block px-2 " + styles$1["checkbox-chart"]
19843
+ }, React.createElement("div", {
19844
+ className: "pr-4 d-flex",
19845
+ onClick: function onClick() {
19846
+ return onChangeChart(options[1].value);
19847
+ },
19848
+ style: {
19849
+ cursor: "pointer"
19850
+ }
19851
+ }, React.createElement(CheckboxCustom, {
19852
+ width: 16,
19853
+ height: 16,
19854
+ isActive: typeChart === options[1].value || typeChart === TYPECHART.BOTH,
19855
+ className: "pr-2"
19856
+ }), React.createElement("label", {
19857
+ className: "" + styles$1["label-chart"],
19858
+ style: {
19859
+ color: "#252733",
19860
+ marginBottom: 0,
19861
+ cursor: "pointer"
19862
+ }
19863
+ }, options[1].value === TYPECHART.BAR ? "Bar charts" : "Line charts")))), React.createElement("i", {
19864
+ className: "fas fa-ellipsis-v pr-4 " + styles$1["icon-config"]
19865
+ }), React.createElement("div", {
19866
+ onClick: onToggle,
19867
+ className: styles$1["btn-show-chart"],
19868
+ style: {
19869
+ cursor: "pointer"
19870
+ }
19871
+ }, React.createElement(PlusButton, {
19872
+ isActive: isOpen
19873
+ }))));
19874
+ };
19875
+
19876
+ var useBehavior = function useBehavior(initialTypeChart) {
19877
+ var _useState = useState(""),
19878
+ teacherUserId = _useState[0],
19879
+ setTeacherUserId = _useState[1];
19880
+
19881
+ var _useState2 = useState(initialTypeChart.map(function () {
19882
+ return false;
19883
+ })),
19884
+ chartIsOpened = _useState2[0],
19885
+ setChartIsOpened = _useState2[1];
19886
+
19887
+ var _useState3 = useState(initialTypeChart),
19888
+ typeChartList = _useState3[0],
19889
+ setTypeChartList = _useState3[1];
19890
+
19891
+ var onToggle = function onToggle(idx) {
19892
+ var newStateChart = [].concat(chartIsOpened);
19893
+ newStateChart[idx] = !newStateChart[idx];
19894
+ setChartIsOpened(newStateChart);
19895
+ };
19896
+
19897
+ var onChangeChart = function onChangeChart(idx, type) {
19898
+ switch (type) {
19899
+ case TYPECHART.AREA:
19900
+ if (typeChartList[idx] === TYPECHART.BAR || typeChartList[idx] === TYPECHART.LINE) {
19901
+ setTypeChartList(typeChartList.map(function (cur, index) {
19902
+ return index === idx ? TYPECHART.BOTH : cur;
19903
+ }));
19904
+ return;
19905
+ }
19906
+
19907
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19908
+ setTypeChartList(typeChartList.map(function (cur, index) {
19909
+ return index === idx ? initialTypeChart[idx] : cur;
19910
+ }));
19911
+ }
19912
+
19913
+ return;
19914
+
19915
+ case TYPECHART.BAR:
19916
+ if (typeChartList[idx] === TYPECHART.AREA) {
19917
+ setTypeChartList(typeChartList.map(function (cur, index) {
19918
+ return index === idx ? TYPECHART.BOTH : cur;
19919
+ }));
19920
+ return;
19921
+ }
19922
+
19923
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19924
+ setTypeChartList(typeChartList.map(function (cur, index) {
19925
+ return index === idx ? TYPECHART.AREA : cur;
19926
+ }));
19927
+ }
19928
+
19929
+ return;
19930
+
19931
+ case TYPECHART.LINE:
19932
+ if (typeChartList[idx] === TYPECHART.AREA) {
19933
+ setTypeChartList(typeChartList.map(function (cur, index) {
19934
+ return index === idx ? TYPECHART.BOTH : cur;
19935
+ }));
19936
+ return;
19937
+ }
19938
+
19939
+ if (typeChartList[idx] === TYPECHART.BOTH) {
19940
+ setTypeChartList(typeChartList.map(function (cur, index) {
19941
+ return index === idx ? TYPECHART.AREA : cur;
19942
+ }));
19943
+ }
19944
+
19945
+ return;
19946
+
19947
+ default:
19948
+ return;
19949
+ }
19950
+ };
19951
+
19952
+ var changeCurrentTeacherUserId = function changeCurrentTeacherUserId(userId) {
19953
+ setTeacherUserId(userId);
19954
+ };
19955
+
19956
+ return {
19957
+ chartIsOpened: chartIsOpened,
19958
+ onToggle: onToggle,
19959
+ onChangeChart: onChangeChart,
19960
+ typeChartList: typeChartList,
19961
+ teacherUserId: teacherUserId,
19962
+ changeCurrentTeacherUserId: changeCurrentTeacherUserId
19963
+ };
19964
+ };
19965
+
19693
19966
  var INITIAL_BEST_FRIENDS = {
19694
19967
  friends: 0,
19695
19968
  couldBeFriends: 0,
@@ -25442,31 +25715,6 @@ var moment = createCommonjsModule(function (module, exports) {
25442
25715
  })));
25443
25716
  });
25444
25717
 
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
25718
  var gradeOptions = function gradeOptions(grades, studentUserId) {
25471
25719
  var result = !studentUserId ? GRAGE_DEFAULT : GRAGE_DEFAULT.filter(function (val) {
25472
25720
  return grades.indexOf(val) != -1;
@@ -25491,7 +25739,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25491
25739
  horizontal: true,
25492
25740
  dataLabels: {
25493
25741
  position: "top"
25494
- }
25742
+ },
25743
+ borderRadius: 5
25495
25744
  }
25496
25745
  },
25497
25746
  stroke: {
@@ -25501,7 +25750,17 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25501
25750
  },
25502
25751
  colors: ["#86BD74", "#9DD889"],
25503
25752
  xaxis: {
25504
- categories: labelNames
25753
+ categories: labelNames,
25754
+ labels: {
25755
+ show: true,
25756
+ style: {
25757
+ colors: ["#808080"],
25758
+ fontSize: "14px",
25759
+ fontFamily: "Roboto",
25760
+ fontWeight: 400,
25761
+ cssClass: "apexcharts-yaxis-label"
25762
+ }
25763
+ }
25505
25764
  },
25506
25765
  tooltip: {
25507
25766
  x: {
@@ -25518,6 +25777,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25518
25777
  }
25519
25778
  },
25520
25779
  yaxis: {
25780
+ min: 0,
25781
+ max: 100,
25521
25782
  labels: {
25522
25783
  show: true,
25523
25784
  align: "left",
@@ -25525,8 +25786,8 @@ var learningStrategyChartOptions = function learningStrategyChartOptions(labelNa
25525
25786
  maxWidth: 120,
25526
25787
  style: {
25527
25788
  colors: [],
25528
- fontSize: "12px",
25529
- fontFamily: "Helvetica, Arial, sans-serif",
25789
+ fontSize: "14px",
25790
+ fontFamily: "Roboto",
25530
25791
  fontWeight: 400,
25531
25792
  cssClass: "apexcharts-yaxis-label"
25532
25793
  },
@@ -25643,6 +25904,11 @@ var studentByAgeOptions = function studentByAgeOptions(series) {
25643
25904
  dataLabels: {
25644
25905
  enabled: false
25645
25906
  },
25907
+ plotOptions: {
25908
+ bar: {
25909
+ borderRadius: 5
25910
+ }
25911
+ },
25646
25912
  grid: {
25647
25913
  borderColor: "#F6F6F6"
25648
25914
  },
@@ -25682,7 +25948,8 @@ var studentByAgeOptions = function studentByAgeOptions(series) {
25682
25948
  position: "top",
25683
25949
  horizontalAlign: "left",
25684
25950
  fontSize: "14px",
25685
- offsetY: -5
25951
+ offsetY: 0,
25952
+ fontFamily: "Roboto"
25686
25953
  }
25687
25954
  };
25688
25955
  };
@@ -25729,9 +25996,6 @@ var pieChartOptions = {
25729
25996
  }
25730
25997
  }
25731
25998
  },
25732
- chart: {
25733
- offsetY: 20
25734
- },
25735
25999
  dataLabels: {
25736
26000
  enabled: false
25737
26001
  },
@@ -25827,14 +26091,13 @@ var getConvertMinuteToHour = function getConvertMinuteToHour(timeSecond) {
25827
26091
 
25828
26092
  return hTime;
25829
26093
  };
25830
- var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
26094
+ var readinesToLearnoptions = function readinesToLearnoptions(seriesName) {
25831
26095
  return {
25832
26096
  chart: {
25833
26097
  height: 450,
25834
26098
  toolbar: {
25835
26099
  show: false
25836
- },
25837
- offsetY: -20
26100
+ }
25838
26101
  },
25839
26102
  dataLabels: {
25840
26103
  enabled: false
@@ -25849,6 +26112,9 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25849
26112
  tickPlacement: "between",
25850
26113
  labels: {
25851
26114
  show: false
26115
+ },
26116
+ tooltip: {
26117
+ enabled: false
25852
26118
  }
25853
26119
  },
25854
26120
  yaxis: {
@@ -25857,7 +26123,7 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25857
26123
  tickAmount: 10,
25858
26124
  labels: {
25859
26125
  formatter: function formatter(value) {
25860
- return value + "%";
26126
+ return Math.round(value) !== value ? value.toFixed(2) + "%" : value + "%";
25861
26127
  }
25862
26128
  }
25863
26129
  },
@@ -25867,16 +26133,16 @@ var readinesToLearnoptions = function readinesToLearnoptions(data, seriesName) {
25867
26133
  show: false
25868
26134
  },
25869
26135
  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
- },
26136
+ formatter: undefined,
25875
26137
  title: {
25876
26138
  formatter: function formatter() {
25877
- return "Student:";
26139
+ return "Percent";
25878
26140
  }
25879
26141
  }
26142
+ },
26143
+ z: {
26144
+ formatter: undefined,
26145
+ title: "Student: "
25880
26146
  }
25881
26147
  },
25882
26148
  labels: seriesName,
@@ -25905,7 +26171,7 @@ var convertDataToSeriesBullderChart = function convertDataToSeriesBullderChart(d
25905
26171
  return {
25906
26172
  name: i.questionText.replace("<p>", "").replace("</p>", ""),
25907
26173
  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];
26174
+ return [getRandomArbitrary((index + 1) * 1000 - 330, (index + 1) * 1000 + 330), question.percentQuestion, question.studentName];
25909
26175
  })) || []
25910
26176
  };
25911
26177
  });
@@ -25916,7 +26182,17 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
25916
26182
  height: 350,
25917
26183
  stacked: false,
25918
26184
  toolbar: {
25919
- show: false
26185
+ show: false,
26186
+ "export": {
26187
+ png: {
26188
+ filename: "test"
26189
+ }
26190
+ }
26191
+ }
26192
+ },
26193
+ plotOptions: {
26194
+ bar: {
26195
+ borderRadius: 5
25920
26196
  }
25921
26197
  },
25922
26198
  dataLabels: {
@@ -25990,7 +26266,7 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
25990
26266
  }
25991
26267
  };
25992
26268
  };
25993
- var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26269
+ var optionLineChart = function optionLineChart(months, activeData) {
25994
26270
  return {
25995
26271
  chart: {
25996
26272
  height: 350,
@@ -26003,14 +26279,14 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26003
26279
  enabled: false
26004
26280
  },
26005
26281
  fill: {
26006
- opacity: 0.5
26282
+ opacity: 1
26007
26283
  },
26008
26284
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26009
26285
  return activeData[index];
26010
26286
  }),
26011
26287
  stroke: {
26012
- curve: "straight",
26013
- show: false,
26288
+ curve: "smooth",
26289
+ show: true,
26014
26290
  colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26015
26291
  return activeData[index];
26016
26292
  }),
@@ -26070,6 +26346,104 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData) {
26070
26346
  }
26071
26347
  };
26072
26348
  };
26349
+ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, newseries) {
26350
+ return {
26351
+ chart: {
26352
+ height: 350,
26353
+ stacked: false,
26354
+ toolbar: {
26355
+ show: false
26356
+ }
26357
+ },
26358
+ plotOptions: {
26359
+ bar: {
26360
+ columnWidth: "50%",
26361
+ borderRadius: 5
26362
+ }
26363
+ },
26364
+ dataLabels: {
26365
+ enabled: false
26366
+ },
26367
+ fill: {
26368
+ opacity: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
26369
+ if ((item === null || item === void 0 ? void 0 : item.type) == 'area') {
26370
+ return 0.2;
26371
+ }
26372
+
26373
+ return 0.6;
26374
+ })
26375
+ },
26376
+ colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26377
+ return activeData[index];
26378
+ }),
26379
+ stroke: {
26380
+ curve: "smooth",
26381
+ show: true,
26382
+ colors: COLOR_CHART_AND_PERCENTS.filter(function (_, index) {
26383
+ return activeData[index];
26384
+ }),
26385
+ width: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
26386
+ if ((item === null || item === void 0 ? void 0 : item.type) == 'area') {
26387
+ return 2;
26388
+ }
26389
+
26390
+ return 0;
26391
+ }),
26392
+ dashArray: 0
26393
+ },
26394
+ xaxis: {
26395
+ categories: months,
26396
+ labels: {
26397
+ show: true,
26398
+ style: {
26399
+ colors: ["#808080"],
26400
+ fontSize: "16px",
26401
+ fontFamily: "Roboto",
26402
+ fontWeight: 400,
26403
+ cssClass: "apexcharts-yaxis-label"
26404
+ }
26405
+ }
26406
+ },
26407
+ yaxis: {
26408
+ tickAmount: 2,
26409
+ min: 0,
26410
+ max: 100,
26411
+ labels: {
26412
+ show: true,
26413
+ align: "right",
26414
+ minWidth: 0,
26415
+ maxWidth: 160,
26416
+ style: {
26417
+ colors: ["#808080"],
26418
+ fontSize: "16px",
26419
+ fontFamily: "Roboto",
26420
+ fontWeight: 400,
26421
+ cssClass: "apexcharts-yaxis-label"
26422
+ },
26423
+ formatter: function formatter(value) {
26424
+ return value + "%";
26425
+ },
26426
+ offsetX: 0,
26427
+ offsetY: 0,
26428
+ rotate: 0
26429
+ },
26430
+ decimalsInFloat: 0
26431
+ },
26432
+ tooltip: {
26433
+ y: {
26434
+ formatter: function formatter(value) {
26435
+ return value.toFixed(2) + "%";
26436
+ }
26437
+ },
26438
+ onDatasetHover: {
26439
+ highlightDataSeries: true
26440
+ }
26441
+ },
26442
+ legend: {
26443
+ show: false
26444
+ }
26445
+ };
26446
+ };
26073
26447
  var convertDataToDataChart = function convertDataToDataChart(data) {
26074
26448
  return data.reduce(function (acc, cur) {
26075
26449
  return [].concat(acc, cur.resultQuestion.map(function (i) {
@@ -26110,10 +26484,10 @@ var seriesNameBubbleChartCustom = function seriesNameBubbleChartCustom(series) {
26110
26484
  return i.questionText.replace("<p>", "").replace("</p>", "");
26111
26485
  });
26112
26486
  };
26113
- var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
26487
+ var mergeBarChartAndArea = function mergeBarChartAndArea(series, isHasLineChart) {
26114
26488
  var barChartSeries = series.map(function (i) {
26115
26489
  return _extends({}, i, {
26116
- type: "bar"
26490
+ type: isHasLineChart ? "line" : "bar"
26117
26491
  });
26118
26492
  });
26119
26493
  var areaChartSeries = series.map(function (i) {
@@ -26124,9 +26498,9 @@ var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
26124
26498
  return [].concat(barChartSeries, areaChartSeries);
26125
26499
  };
26126
26500
  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();
26501
+ var lastQuarter = moment().utc().quarter() - 1;
26502
+ var start = lastQuarter ? moment().utc().quarter(lastQuarter).startOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).startOf("quarter").valueOf();
26503
+ var end = lastQuarter ? moment().utc().quarter(lastQuarter).endOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).endOf("quarter").valueOf();
26130
26504
  return {
26131
26505
  start: start,
26132
26506
  end: end
@@ -26135,30 +26509,89 @@ var getLastQuarterRange = function getLastQuarterRange() {
26135
26509
  var filterYearData = [{
26136
26510
  label: "This Year",
26137
26511
  value: FILTER_YEAR.THIS_YEAR,
26138
- startDate: moment().startOf("year").valueOf(),
26139
- endDate: moment().endOf("day").valueOf()
26512
+ startDate: moment().utc().startOf("year").valueOf(),
26513
+ endDate: moment().utc().endOf("day").valueOf()
26140
26514
  }, {
26141
26515
  label: "Last Year",
26142
26516
  value: FILTER_YEAR.LAST_YEAR,
26143
- startDate: moment().add(-1, "years").startOf("year").valueOf(),
26144
- endDate: moment().add(-1, "years").endOf("year").valueOf()
26517
+ startDate: moment().utc().add(-1, "years").startOf("year").valueOf(),
26518
+ endDate: moment().utc().add(-1, "years").endOf("year").valueOf()
26145
26519
  }, {
26146
26520
  label: "Last Quarter",
26147
26521
  value: FILTER_YEAR.LAST_QUARTER,
26148
26522
  startDate: getLastQuarterRange().start,
26149
26523
  endDate: getLastQuarterRange().end
26150
26524
  }, {
26151
- label: "Last 30 day",
26525
+ label: "Last 30 Day",
26152
26526
  value: FILTER_YEAR.LAST_MONTH,
26153
- startDate: moment().add(-1, "months").startOf("month").valueOf(),
26154
- endDate: moment().add(-1, "months").endOf("month").valueOf()
26527
+ startDate: moment().utc().add(-30, "days").startOf("day").valueOf(),
26528
+ endDate: moment().utc().endOf("day").valueOf()
26155
26529
  }, {
26156
26530
  label: "Last Day",
26157
26531
  value: FILTER_YEAR.LAST_DAY,
26158
- startDate: moment().add(-1, "days").startOf("day").valueOf(),
26159
- endDate: moment().add(-1, "days").endOf("day").valueOf()
26532
+ startDate: moment().utc().add(-1, "days").startOf("day").valueOf(),
26533
+ endDate: moment().utc().add(-1, "days").endOf("day").valueOf()
26160
26534
  }];
26161
26535
 
26536
+ var BubbleChartCustom = function BubbleChartCustom(_ref) {
26537
+ var data = _ref.data;
26538
+ if (!data) return React.createElement("div", {
26539
+ className: "flex justify-content-center align-items-center",
26540
+ style: {
26541
+ height: 450
26542
+ }
26543
+ }, React.createElement("div", null, "No Data"));
26544
+ var seriesName = seriesNameBubbleChartCustom(data);
26545
+ return React.createElement("div", {
26546
+ className: styles$1["bubble-chart-custom"]
26547
+ }, React.createElement("div", {
26548
+ className: styles$1["chart-custom"]
26549
+ }, React.createElement("div", {
26550
+ className: styles$1["list-percent"]
26551
+ }, PERCENT.map(function (i, index) {
26552
+ return React.createElement("div", {
26553
+ className: "" + styles$1["percent-item"],
26554
+ key: index
26555
+ }, i, "%");
26556
+ })), React.createElement("div", {
26557
+ className: styles$1["chart-buddle"]
26558
+ }, React.createElement("div", null, React.createElement(Chart, {
26559
+ options: readinesToLearnoptions(seriesName),
26560
+ type: "scatter",
26561
+ series: convertDataToSeriesBullderChart(data),
26562
+ width: "100%",
26563
+ height: 450
26564
+ }))), React.createElement("div", {
26565
+ className: styles$1["x-axis-custom-wrap"]
26566
+ }, React.createElement("div", {
26567
+ className: styles$1["axis-content"]
26568
+ }, seriesName.map(function (i, index) {
26569
+ return React.createElement("div", {
26570
+ key: index
26571
+ }, i);
26572
+ }))), React.createElement("div", {
26573
+ className: styles$1["legend-wrap"]
26574
+ }, seriesName.map(function (i, index) {
26575
+ return React.createElement("div", {
26576
+ className: "" + styles$1["item"],
26577
+ key: index
26578
+ }, React.createElement("div", {
26579
+ className: "" + styles$1["mark-custom"],
26580
+ style: {
26581
+ backgroundColor: COLOR_CHART_BUBBLE[index]
26582
+ }
26583
+ }), React.createElement("label", {
26584
+ className: "" + styles$1["label-legend-custom"]
26585
+ }, i));
26586
+ }))));
26587
+ };
26588
+
26589
+ function propsAreEqual(prevProps, nextProps) {
26590
+ return JSON.stringify(prevProps === null || prevProps === void 0 ? void 0 : prevProps.data) === JSON.stringify(nextProps === null || nextProps === void 0 ? void 0 : nextProps.data);
26591
+ }
26592
+
26593
+ var BubbleChartCustom$1 = React.memo(BubbleChartCustom, propsAreEqual);
26594
+
26162
26595
  var AreaChart = function AreaChart(_ref) {
26163
26596
  var series = _ref.series,
26164
26597
  months = _ref.months,
@@ -26188,77 +26621,56 @@ var BarChart = function BarChart(_ref) {
26188
26621
  var BarAndAreaChart = function BarAndAreaChart(_ref) {
26189
26622
  var series = _ref.series,
26190
26623
  months = _ref.months,
26191
- activeColumn = _ref.activeColumn;
26192
- var newseries = mergeBarChartAndArea(series);
26624
+ activeColumn = _ref.activeColumn,
26625
+ _ref$isHasLineChart = _ref.isHasLineChart,
26626
+ isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart;
26627
+ var newseries = mergeBarChartAndArea(series, isHasLineChart);
26628
+ console.log({
26629
+ newseries: newseries
26630
+ });
26193
26631
  return React.createElement(Chart, {
26194
- options: optionBarChartAndArea(months, activeColumn),
26195
- type: "line",
26632
+ options: optionBarChartAndArea(months, activeColumn, newseries),
26196
26633
  series: newseries,
26197
26634
  width: "100%",
26198
26635
  height: 450
26199
26636
  });
26200
26637
  };
26201
26638
 
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 = {}));
26639
+ var LineChart = function LineChart(_ref) {
26640
+ var series = _ref.series,
26641
+ months = _ref.months,
26642
+ activeColumn = _ref.activeColumn;
26643
+ return React.createElement(Chart, {
26644
+ options: optionLineChart(months, activeColumn),
26645
+ type: "line",
26646
+ series: series,
26647
+ width: "100%",
26648
+ height: 450
26649
+ });
26650
+ };
26209
26651
 
26210
26652
  var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26211
26653
  var data = _ref.data,
26212
26654
  _ref$typeChart = _ref.typeChart,
26213
- typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart;
26214
-
26215
- var _useState = useState([]),
26216
- activeColumn = _useState[0],
26217
- setActiveColumn = _useState[1];
26218
-
26219
- var _useState2 = useState([]),
26220
- series = _useState2[0],
26221
- setSeries = _useState2[1];
26222
-
26223
- var _useState3 = useState(INITIAL_AVG),
26224
- avg = _useState3[0],
26225
- setAvg = _useState3[1];
26226
-
26227
- var months = data.map(function (i) {
26228
- return (i === null || i === void 0 ? void 0 : i.month) || "";
26229
- });
26230
- var dataCharts = convertDataToDataChart(data);
26231
- var newSeries = convertToSeriesColumnChartAndPercent(dataCharts, data);
26232
- var newAvg = convertToAvg(dataCharts, data, months);
26233
-
26234
- var onActiveColumn = function onActiveColumn(index) {
26235
- var newActiveColumn = [].concat(activeColumn);
26236
- newActiveColumn[index] = !newActiveColumn[index];
26237
- setActiveColumn(newActiveColumn);
26238
- setSeries(newSeries.filter(function (_, idx) {
26239
- return newActiveColumn[idx];
26240
- }));
26241
- setAvg(newAvg.map(function (_, index) {
26242
- return newActiveColumn[index] ? newAvg[index] : 0;
26243
- }));
26244
- };
26245
-
26246
- useEffect(function () {
26247
- if (!!data && data !== null && data !== void 0 && data.length) {
26248
- setSeries(newSeries);
26249
- setActiveColumn(dataCharts.map(function (_i) {
26250
- return true;
26251
- }));
26252
- setAvg(newAvg.map(function (_, index) {
26253
- return newAvg[index];
26254
- }));
26655
+ typeChart = _ref$typeChart === void 0 ? TYPECHART.BAR : _ref$typeChart,
26656
+ _ref$isHasLineChart = _ref.isHasLineChart,
26657
+ isHasLineChart = _ref$isHasLineChart === void 0 ? false : _ref$isHasLineChart,
26658
+ onActiveColumn = _ref.onActiveColumn,
26659
+ activeColumn = _ref.activeColumn,
26660
+ series = _ref.series,
26661
+ avg = _ref.avg,
26662
+ months = _ref.months;
26663
+ if (!data) return React.createElement("div", {
26664
+ className: "flex justify-content-center align-items-center",
26665
+ style: {
26666
+ height: 450
26255
26667
  }
26256
- }, [data]);
26668
+ }, React.createElement("div", null, "No Data"));
26257
26669
  return React.createElement("div", {
26258
26670
  className: "w-100 h-100 " + styles$1["column-chart-percent"]
26259
26671
  }, React.createElement("div", {
26260
26672
  className: "w-full d-flex gap-2 flex-wrap " + styles$1["listItem"]
26261
- }, dataCharts.map(function (column, index) {
26673
+ }, data.map(function (month, index) {
26262
26674
  return React.createElement("div", {
26263
26675
  className: "pr-4 d-flex",
26264
26676
  key: index
@@ -26281,7 +26693,7 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26281
26693
  onClick: function onClick() {
26282
26694
  return onActiveColumn(index);
26283
26695
  }
26284
- }, column));
26696
+ }, month));
26285
26697
  })), React.createElement("div", {
26286
26698
  className: "w-100",
26287
26699
  style: {
@@ -26296,12 +26708,17 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26296
26708
  activeColumn: activeColumn,
26297
26709
  series: series
26298
26710
  }), typeChart === TYPECHART.BOTH && React.createElement(BarAndAreaChart, {
26711
+ months: months,
26712
+ activeColumn: activeColumn,
26713
+ series: series,
26714
+ isHasLineChart: isHasLineChart
26715
+ }), typeChart === TYPECHART.LINE && React.createElement(LineChart, {
26299
26716
  months: months,
26300
26717
  activeColumn: activeColumn,
26301
26718
  series: series
26302
26719
  })), React.createElement("div", {
26303
26720
  className: "w-100 d-flex gap-2 flex-wrap " + styles$1["listItem"]
26304
- }, dataCharts.map(function (column, index) {
26721
+ }, data.map(function (month, index) {
26305
26722
  return React.createElement("div", {
26306
26723
  className: "" + styles$1["item-legend"],
26307
26724
  key: index
@@ -26314,7 +26731,7 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26314
26731
  }
26315
26732
  }), React.createElement("label", {
26316
26733
  className: "" + styles$1["label-legend-custom"]
26317
- }, column)), React.createElement("div", {
26734
+ }, month)), React.createElement("div", {
26318
26735
  className: "" + styles$1["percent"]
26319
26736
  }, React.createElement("label", {
26320
26737
  className: "m-0"
@@ -26322,226 +26739,23 @@ var ColumnChartAndPercent = function ColumnChartAndPercent(_ref) {
26322
26739
  })));
26323
26740
  };
26324
26741
 
26325
- var propsAreEqual = function propsAreEqual(preProps, nextProps) {
26742
+ var propsAreEqual$1 = function propsAreEqual(preProps, nextProps) {
26326
26743
  return JSON.stringify(preProps) === JSON.stringify(nextProps);
26327
26744
  };
26328
26745
 
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);
26746
+ var ColumnChartAndPercent$1 = React.memo(ColumnChartAndPercent, propsAreEqual$1);
26540
26747
 
26541
26748
  var CustomPieChart = function CustomPieChart(_ref) {
26542
26749
  var data = _ref.data;
26750
+ if (!data) return React.createElement("div", {
26751
+ className: "flex justify-content-center align-items-center",
26752
+ style: {
26753
+ height: 450
26754
+ }
26755
+ }, React.createElement("div", null, "No Data"));
26543
26756
  var series = Object.values(data).reverse();
26544
- var femalePropotion = Number((series[0] / (series[0] + series[1]) * 100).toFixed(2));
26757
+ var femalePropotion = series[0] / (series[0] + series[1]) * 100;
26758
+ var roundFemalePropotion = Math.round(femalePropotion) !== femalePropotion ? femalePropotion.toFixed(2) : femalePropotion;
26545
26759
  return React.createElement("div", {
26546
26760
  className: styles$1["pie-chart"]
26547
26761
  }, series.filter(function (i) {
@@ -26569,7 +26783,7 @@ var CustomPieChart = function CustomPieChart(_ref) {
26569
26783
  className: styles$1["text-lengend"]
26570
26784
  }, series[1]), React.createElement("div", {
26571
26785
  className: styles$1["text-lengend"]
26572
- }, "(", (100 - femalePropotion).toFixed(2), "%)")), React.createElement("div", {
26786
+ }, "(", 100 - Number(roundFemalePropotion), "%)")), React.createElement("div", {
26573
26787
  className: styles$1["legend"]
26574
26788
  }, React.createElement("div", {
26575
26789
  className: styles$1["mark-custom"],
@@ -26582,7 +26796,7 @@ var CustomPieChart = function CustomPieChart(_ref) {
26582
26796
  className: styles$1["text-lengend"]
26583
26797
  }, series[0]), React.createElement("div", {
26584
26798
  className: styles$1["text-lengend"]
26585
- }, "(", femalePropotion, "%)")))) : React.createElement("img", {
26799
+ }, "(", roundFemalePropotion, "%)")))) : React.createElement("img", {
26586
26800
  className: "" + styles$1["image-no-data"],
26587
26801
  src: "images/no-data-haft-pie.png"
26588
26802
  }));
@@ -26590,6 +26804,12 @@ var CustomPieChart = function CustomPieChart(_ref) {
26590
26804
 
26591
26805
  var StudentByAge = function StudentByAge(_ref) {
26592
26806
  var data = _ref.data;
26807
+ if (!data) return React.createElement("div", {
26808
+ className: "flex justify-content-center align-items-center",
26809
+ style: {
26810
+ height: 450
26811
+ }
26812
+ }, React.createElement("div", null, "No Data"));
26593
26813
  var series = convertDataStudentByAgeToSeries(data);
26594
26814
  var totalStudent = totalStudentByAge(data);
26595
26815
  return React.createElement("div", {
@@ -26612,15 +26832,17 @@ var StudentByAge = function StudentByAge(_ref) {
26612
26832
 
26613
26833
  var StudentByAgeAndGender = function StudentByAgeAndGender(_ref) {
26614
26834
  var studentByAgeData = _ref.studentByAgeData,
26615
- studentByGenderData = _ref.studentByGenderData;
26835
+ studentByGenderData = _ref.studentByGenderData,
26836
+ columnFlex = _ref.columnFlex;
26616
26837
  return React.createElement(Row, {
26617
- className: "d-flex"
26838
+ className: "d-flex " + (columnFlex && "flex-column")
26618
26839
  }, React.createElement(Col, {
26619
26840
  md: 6
26620
26841
  }, React.createElement(StudentByAge, {
26621
26842
  data: studentByAgeData
26622
26843
  })), React.createElement(Col, {
26623
- md: 6
26844
+ md: 6,
26845
+ className: "mt-5"
26624
26846
  }, React.createElement(CustomPieChart, {
26625
26847
  data: studentByGenderData
26626
26848
  })));
@@ -26634,6 +26856,12 @@ var StudentByAgeAndGender$1 = React.memo(StudentByAgeAndGender, propsAreEqual$2)
26634
26856
 
26635
26857
  var StudentByGrade = function StudentByGrade(_ref) {
26636
26858
  var data = _ref.data;
26859
+ if (!data) return React.createElement("div", {
26860
+ className: "flex justify-content-center align-items-center",
26861
+ style: {
26862
+ height: 450
26863
+ }
26864
+ }, React.createElement("div", null, "No Data"));
26637
26865
  var series = convertDataToSeriesStudentByGrade(data);
26638
26866
  var totalStudent = findTotalStudentByGrade(data);
26639
26867
  return React.createElement("div", {
@@ -26799,6 +27027,8 @@ var DEFAULT_START_DATE = moment().startOf("year").valueOf();
26799
27027
  var DEFAULT_END_DATE = moment().endOf("day").valueOf();
26800
27028
 
26801
27029
  var useDashboard = function useDashboard() {
27030
+ var _chartConference$over, _safety$overviewQuest;
27031
+
26802
27032
  var dispatch = useDispatch();
26803
27033
 
26804
27034
  var _useState = useState({
@@ -26841,62 +27071,271 @@ var useDashboard = function useDashboard() {
26841
27071
  chartClassReflection = _useState7[0],
26842
27072
  setChartClassReflection = _useState7[1];
26843
27073
 
26844
- var _useState8 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
26845
- chartConference = _useState8[0],
26846
- setChartConference = _useState8[1];
27074
+ var _useState8 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
27075
+ chartConference = _useState8[0],
27076
+ setChartConference = _useState8[1];
27077
+
27078
+ var _useState9 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
27079
+ learningProgress = _useState9[0],
27080
+ setLearningProgress = _useState9[1];
27081
+
27082
+ var _useState10 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
27083
+ safety = _useState10[0],
27084
+ setSafety = _useState10[1];
27085
+
27086
+ var _useState11 = useState(),
27087
+ friendCircles = _useState11[0],
27088
+ setFriendCircles = _useState11[1];
27089
+
27090
+ var _useState12 = useState(),
27091
+ activityCircles = _useState12[0],
27092
+ setActivityCircles = _useState12[1];
27093
+
27094
+ var _useState13 = useState([]),
27095
+ studentBySpecialNeed = _useState13[0],
27096
+ setStudentBySpecialNeed = _useState13[1];
27097
+
27098
+ var _useState14 = useState(INITIAL_AGE_OF_STUDENT),
27099
+ studentByAge = _useState14[0],
27100
+ setStudentByAge = _useState14[1];
27101
+
27102
+ var _useState15 = useState(INITIAL_STUDENT_BY_GENDER),
27103
+ studentByGender = _useState15[0],
27104
+ setStudentByGender = _useState15[1];
27105
+
27106
+ var _useState16 = useState([]),
27107
+ topSkill = _useState16[0],
27108
+ setTopSkill = _useState16[1];
27109
+
27110
+ var _useState17 = useState([]),
27111
+ bandScore = _useState17[0],
27112
+ setBandScore = _useState17[1];
27113
+
27114
+ var user = useSelector(function (state) {
27115
+ return state.common.user;
27116
+ });
27117
+
27118
+ var _useState18 = useState(undefined),
27119
+ studentDefault = _useState18[0],
27120
+ setStudentDefault = _useState18[1];
27121
+
27122
+ var _useState19 = useState(""),
27123
+ genderOfStudent = _useState19[0],
27124
+ setGenderOfStudent = _useState19[1];
27125
+
27126
+ var handleChangeFilters = function handleChangeFilters(event) {
27127
+ var _extends2;
27128
+
27129
+ setFilter(_extends({}, filter, (_extends2 = {}, _extends2[event.target.name] = event.target.value, _extends2)));
27130
+ };
27131
+
27132
+ var _useState20 = useState([]),
27133
+ activeColumnOneToOne = _useState20[0],
27134
+ setActiveColumnOneToOne = _useState20[1];
27135
+
27136
+ var _useState21 = useState([]),
27137
+ seriesOneToOne = _useState21[0],
27138
+ setSeriesOneToOne = _useState21[1];
27139
+
27140
+ var _useState22 = useState(INITIAL_AVG),
27141
+ avgOneToOne = _useState22[0],
27142
+ setAvgOneToOne = _useState22[1];
27143
+
27144
+ var monthsOneToOne = chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice.map(function (i) {
27145
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27146
+ });
27147
+ var dataConvertedOneToOne = convertDataToDataChart(chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice);
27148
+ var newSeriesOneToOne = convertToSeriesColumnChartAndPercent(dataConvertedOneToOne, chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice);
27149
+ var newAvgOneToOne = convertToAvg(dataConvertedOneToOne, chartOneToOneData === null || chartOneToOneData === void 0 ? void 0 : chartOneToOneData.overviewQuestionChoice, monthsOneToOne);
27150
+
27151
+ var handleActiveColumnOneToOne = function handleActiveColumnOneToOne(index) {
27152
+ var newActiveColumn = [].concat(activeColumnOneToOne);
27153
+ newActiveColumn[index] = !newActiveColumn[index];
27154
+ setActiveColumnOneToOne(newActiveColumn);
27155
+ setSeriesOneToOne(newSeriesOneToOne === null || newSeriesOneToOne === void 0 ? void 0 : newSeriesOneToOne.filter(function (_, idx) {
27156
+ return newActiveColumn[idx];
27157
+ }));
27158
+ setAvgOneToOne(newAvgOneToOne === null || newAvgOneToOne === void 0 ? void 0 : newAvgOneToOne.map(function (_, idx) {
27159
+ return newActiveColumn[idx] ? newAvgOneToOne[idx] : 0;
27160
+ }));
27161
+ };
27162
+
27163
+ useEffect(function () {
27164
+ setSeriesOneToOne(newSeriesOneToOne);
27165
+ setActiveColumnOneToOne(dataConvertedOneToOne.map(function (_i) {
27166
+ return true;
27167
+ }));
27168
+ setAvgOneToOne(newAvgOneToOne === null || newAvgOneToOne === void 0 ? void 0 : newAvgOneToOne.map(function (_, index) {
27169
+ return newAvgOneToOne[index];
27170
+ }));
27171
+ }, [chartOneToOneData.overviewQuestionChoice]);
27172
+
27173
+ var _useState23 = useState([]),
27174
+ activeColumnClassReflection = _useState23[0],
27175
+ setActiveColumnClassReflection = _useState23[1];
27176
+
27177
+ var _useState24 = useState([]),
27178
+ seriesClassRefection = _useState24[0],
27179
+ setSeriesClassReflection = _useState24[1];
27180
+
27181
+ var _useState25 = useState(INITIAL_AVG),
27182
+ avgClassReflection = _useState25[0],
27183
+ setAvgClassReflection = _useState25[1];
27184
+
27185
+ var monthsClassReflection = chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice.map(function (i) {
27186
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27187
+ });
27188
+ var dataConvertedClassReflection = convertDataToDataChart(chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice);
27189
+ var newSeriesClassReflection = convertToSeriesColumnChartAndPercent(dataConvertedClassReflection, chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice);
27190
+ var newAvgClassReflection = convertToAvg(dataConvertedClassReflection, chartClassReflection === null || chartClassReflection === void 0 ? void 0 : chartClassReflection.overviewQuestionChoice, monthsClassReflection);
27191
+
27192
+ var handleActiveColumnClassReflection = function handleActiveColumnClassReflection(index) {
27193
+ var newActiveColumn = [].concat(activeColumnClassReflection);
27194
+ newActiveColumn[index] = !newActiveColumn[index];
27195
+ setActiveColumnClassReflection(newActiveColumn);
27196
+ setSeriesClassReflection(newSeriesClassReflection === null || newSeriesClassReflection === void 0 ? void 0 : newSeriesClassReflection.filter(function (_, idx) {
27197
+ return newActiveColumn[idx];
27198
+ }));
27199
+ setAvgClassReflection(newAvgClassReflection === null || newAvgClassReflection === void 0 ? void 0 : newAvgClassReflection.map(function (_, idx) {
27200
+ return newActiveColumn[idx] ? newAvgOneToOne[idx] : 0;
27201
+ }));
27202
+ };
27203
+
27204
+ useEffect(function () {
27205
+ setSeriesClassReflection(newSeriesClassReflection);
27206
+ setActiveColumnClassReflection(dataConvertedClassReflection.map(function (_i) {
27207
+ return true;
27208
+ }));
27209
+ setAvgClassReflection(newAvgClassReflection === null || newAvgClassReflection === void 0 ? void 0 : newAvgClassReflection.map(function (_, index) {
27210
+ return newAvgClassReflection[index];
27211
+ }));
27212
+ }, [chartClassReflection.overviewQuestionChoice]);
27213
+
27214
+ var _useState26 = useState([]),
27215
+ activeColumnConference = _useState26[0],
27216
+ setActiveColumnConference = _useState26[1];
27217
+
27218
+ var _useState27 = useState([]),
27219
+ seriesConference = _useState27[0],
27220
+ setSeriesConference = _useState27[1];
27221
+
27222
+ var _useState28 = useState(INITIAL_AVG),
27223
+ avgConference = _useState28[0],
27224
+ setAvgConference = _useState28[1];
27225
+
27226
+ var monthsConference = chartConference === null || chartConference === void 0 ? void 0 : (_chartConference$over = chartConference.overviewQuestionChoice) === null || _chartConference$over === void 0 ? void 0 : _chartConference$over.map(function (i) {
27227
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27228
+ });
27229
+ var dataConvertedConference = convertDataToDataChart(chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice);
27230
+ var newSeriesConference = convertToSeriesColumnChartAndPercent(dataConvertedConference, chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice);
27231
+ var newAvgConference = convertToAvg(dataConvertedConference, chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice, monthsConference);
27232
+
27233
+ var handleActiveColumnConference = function handleActiveColumnConference(index) {
27234
+ var newActiveColumn = [].concat(activeColumnConference);
27235
+ newActiveColumn[index] = !newActiveColumn[index];
27236
+ setActiveColumnConference(newActiveColumn);
27237
+ setSeriesConference(newSeriesConference === null || newSeriesConference === void 0 ? void 0 : newSeriesConference.filter(function (_, idx) {
27238
+ return newActiveColumn[idx];
27239
+ }));
27240
+ setAvgConference(newAvgConference === null || newAvgConference === void 0 ? void 0 : newAvgConference.map(function (_, idx) {
27241
+ return newActiveColumn[idx] ? newAvgConference[idx] : 0;
27242
+ }));
27243
+ };
26847
27244
 
26848
- var _useState9 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
26849
- learningProgress = _useState9[0],
26850
- setLearningProgress = _useState9[1];
27245
+ useEffect(function () {
27246
+ setSeriesConference(newSeriesConference);
27247
+ setActiveColumnConference(dataConvertedConference === null || dataConvertedConference === void 0 ? void 0 : dataConvertedConference.map(function (_i) {
27248
+ return true;
27249
+ }));
27250
+ setAvgConference(newAvgConference === null || newAvgConference === void 0 ? void 0 : newAvgConference.map(function (_, idx) {
27251
+ return newAvgConference[idx];
27252
+ }));
27253
+ }, [chartConference === null || chartConference === void 0 ? void 0 : chartConference.overviewQuestionChoice]);
26851
27254
 
26852
- var _useState10 = useState(INITIAl_COLUNM_CHART_AND_PERCENT),
26853
- safety = _useState10[0],
26854
- setSafety = _useState10[1];
27255
+ var _useState29 = useState([]),
27256
+ activeColumnSafety = _useState29[0],
27257
+ setActiveColumnSafety = _useState29[1];
26855
27258
 
26856
- var _useState11 = useState(),
26857
- friendCircles = _useState11[0],
26858
- setFriendCircles = _useState11[1];
27259
+ var _useState30 = useState([]),
27260
+ seriesSafety = _useState30[0],
27261
+ setSeriesSafety = _useState30[1];
26859
27262
 
26860
- var _useState12 = useState(),
26861
- activityCircles = _useState12[0],
26862
- setActivityCircles = _useState12[1];
27263
+ var _useState31 = useState(INITIAL_AVG),
27264
+ avgSafety = _useState31[0],
27265
+ setAvgSafety = _useState31[1];
26863
27266
 
26864
- var _useState13 = useState([]),
26865
- studentBySpecialNeed = _useState13[0],
26866
- setStudentBySpecialNeed = _useState13[1];
27267
+ var monthsSafety = safety === null || safety === void 0 ? void 0 : (_safety$overviewQuest = safety.overviewQuestionChoice) === null || _safety$overviewQuest === void 0 ? void 0 : _safety$overviewQuest.map(function (i) {
27268
+ return (i === null || i === void 0 ? void 0 : i.month) || "";
27269
+ });
27270
+ var dataConvertedSafety = convertDataToDataChart(safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice);
27271
+ var newSeriesSafety = convertToSeriesColumnChartAndPercent(dataConvertedSafety, safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice);
27272
+ var newAvgSafety = convertToAvg(dataConvertedSafety, safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice, monthsSafety);
26867
27273
 
26868
- var _useState14 = useState(INITIAL_AGE_OF_STUDENT),
26869
- studentByAge = _useState14[0],
26870
- setStudentByAge = _useState14[1];
27274
+ var handleActiveColumnSafety = function handleActiveColumnSafety(index) {
27275
+ var newActiveColumn = [].concat(activeColumnSafety);
27276
+ newActiveColumn[index] = !newActiveColumn[index];
27277
+ setActiveColumnSafety(newActiveColumn);
27278
+ setSeriesSafety(newSeriesSafety === null || newSeriesSafety === void 0 ? void 0 : newSeriesSafety.filter(function (_, idx) {
27279
+ return newActiveColumn[idx];
27280
+ }));
27281
+ setAvgSafety(newAvgSafety === null || newAvgSafety === void 0 ? void 0 : newAvgSafety.map(function (_, idx) {
27282
+ return newActiveColumn[idx] ? newAvgSafety[idx] : 0;
27283
+ }));
27284
+ };
26871
27285
 
26872
- var _useState15 = useState(INITIAL_STUDENT_BY_GENDER),
26873
- studentByGender = _useState15[0],
26874
- setStudentByGender = _useState15[1];
27286
+ useEffect(function () {
27287
+ setSeriesSafety(newSeriesSafety);
27288
+ setActiveColumnSafety(dataConvertedSafety === null || dataConvertedSafety === void 0 ? void 0 : dataConvertedSafety.map(function (_i) {
27289
+ return true;
27290
+ }));
27291
+ setAvgSafety(newAvgSafety === null || newAvgSafety === void 0 ? void 0 : newAvgSafety.map(function (_, idx) {
27292
+ return newAvgSafety[idx];
27293
+ }));
27294
+ }, [safety === null || safety === void 0 ? void 0 : safety.overviewQuestionChoice]);
26875
27295
 
26876
- var _useState16 = useState([]),
26877
- topSkill = _useState16[0],
26878
- setTopSkill = _useState16[1];
27296
+ var _useState32 = useState([]),
27297
+ selectedToPrint = _useState32[0],
27298
+ setSelectedToPrint = _useState32[1];
26879
27299
 
26880
- var _useState17 = useState([]),
26881
- bandScore = _useState17[0],
26882
- setBandScore = _useState17[1];
27300
+ var handleSelectToPrint = function handleSelectToPrint(checked, data, chartType) {
27301
+ var updateSelectToPrint = [].concat(selectedToPrint);
27302
+ var foundItem = updateSelectToPrint === null || updateSelectToPrint === void 0 ? void 0 : updateSelectToPrint.find(function (e) {
27303
+ return e.identification == data.id;
27304
+ });
26883
27305
 
26884
- var user = useSelector(function (state) {
26885
- return state.common.user;
26886
- });
27306
+ if (checked) {
27307
+ if (!!data.id && !foundItem) {
27308
+ updateSelectToPrint.push({
27309
+ id: data.id,
27310
+ identification: data.id,
27311
+ label: data.label,
27312
+ children: data.children,
27313
+ chartType: chartType
27314
+ });
27315
+ }
26887
27316
 
26888
- var _useState18 = useState(undefined),
26889
- studentDefault = _useState18[0],
26890
- setStudentDefault = _useState18[1];
27317
+ if (!!data && foundItem && foundItem.id == null) {
27318
+ var itemIndex = updateSelectToPrint.indexOf(foundItem);
27319
+ updateSelectToPrint[itemIndex].id = data.id;
27320
+ updateSelectToPrint[itemIndex].children = data.children;
27321
+ }
27322
+ } else {
27323
+ var _itemIndex = updateSelectToPrint.indexOf(foundItem);
26891
27324
 
26892
- var _useState19 = useState(""),
26893
- genderOfStudent = _useState19[0],
26894
- setGenderOfStudent = _useState19[1];
27325
+ updateSelectToPrint[_itemIndex].id = null;
27326
+ updateSelectToPrint[_itemIndex].children = null;
27327
+ }
26895
27328
 
26896
- var handleChangeFilters = function handleChangeFilters(event) {
26897
- var _extends2;
27329
+ setSelectedToPrint(updateSelectToPrint);
27330
+ };
26898
27331
 
26899
- setFilter(_extends({}, filter, (_extends2 = {}, _extends2[event.target.name] = event.target.value, _extends2)));
27332
+ var checkSelectedItem = function checkSelectedItem(id) {
27333
+ for (var _iterator = _createForOfIteratorHelperLoose(selectedToPrint), _step; !(_step = _iterator()).done;) {
27334
+ var item = _step.value;
27335
+ if (item.id === id) return true;
27336
+ }
27337
+
27338
+ return false;
26900
27339
  };
26901
27340
 
26902
27341
  var callApi = useCallback(function (apiCaller, setData, defaultData, type) {
@@ -27051,20 +27490,45 @@ var useDashboard = function useDashboard() {
27051
27490
  setGenderOfStudent: setGenderOfStudent,
27052
27491
  handleFilterStudent: handleFilterStudent,
27053
27492
  handleFilterTeacher: handleFilterTeacher,
27054
- onChangeFilters: onChangeFilters
27493
+ handleSelectToPrint: handleSelectToPrint,
27494
+ checkSelectedItem: checkSelectedItem,
27495
+ selectedToPrint: selectedToPrint,
27496
+ setSelectedToPrint: setSelectedToPrint,
27497
+ onChangeFilters: onChangeFilters,
27498
+ handleActiveColumnOneToOne: handleActiveColumnOneToOne,
27499
+ seriesOneToOne: seriesOneToOne,
27500
+ avgOneToOne: avgOneToOne,
27501
+ dataConvertedOneToOne: dataConvertedOneToOne,
27502
+ monthsOneToOne: monthsOneToOne,
27503
+ activeColumnOneToOne: activeColumnOneToOne,
27504
+ handleActiveColumnClassReflection: handleActiveColumnClassReflection,
27505
+ seriesClassRefection: seriesClassRefection,
27506
+ avgClassReflection: avgClassReflection,
27507
+ dataConvertedClassReflection: dataConvertedClassReflection,
27508
+ monthsClassReflection: monthsClassReflection,
27509
+ activeColumnClassReflection: activeColumnClassReflection,
27510
+ handleActiveColumnConference: handleActiveColumnConference,
27511
+ seriesConference: seriesConference,
27512
+ avgConference: avgConference,
27513
+ dataConvertedConference: dataConvertedConference,
27514
+ monthsConference: monthsConference,
27515
+ activeColumnConference: activeColumnConference,
27516
+ handleActiveColumnSafety: handleActiveColumnSafety,
27517
+ seriesSafety: seriesSafety,
27518
+ avgSafety: avgSafety,
27519
+ dataConvertedSafety: dataConvertedSafety,
27520
+ monthsSafety: monthsSafety,
27521
+ activeColumnSafety: activeColumnSafety
27055
27522
  };
27056
27523
  };
27057
27524
 
27058
27525
  var useChartDatas = function useChartDatas() {
27059
27526
  var _useDashboard = useDashboard(),
27060
27527
  topLearningStrategies = _useDashboard.topLearningStrategies,
27061
- chartOneToOneData = _useDashboard.chartOneToOneData,
27062
27528
  readinessToLearning = _useDashboard.readinessToLearning,
27063
- chartClassReflection = _useDashboard.chartClassReflection,
27064
27529
  studentByAge = _useDashboard.studentByAge,
27065
27530
  studentByGender = _useDashboard.studentByGender,
27066
27531
  studentByGrade = _useDashboard.studentByGrade,
27067
- chartConference = _useDashboard.chartConference,
27068
27532
  handleChangeFilters = _useDashboard.handleChangeFilters,
27069
27533
  bandScore = _useDashboard.bandScore,
27070
27534
  user = _useDashboard.user,
@@ -27072,9 +27536,32 @@ var useChartDatas = function useChartDatas() {
27072
27536
  handleFilterStudent = _useDashboard.handleFilterStudent,
27073
27537
  handleFilterTeacher = _useDashboard.handleFilterTeacher,
27074
27538
  filter = _useDashboard.filter,
27075
- safety = _useDashboard.safety,
27076
27539
  listTotalTime = _useDashboard.listTotalTime,
27077
- onChangeFilters = _useDashboard.onChangeFilters;
27540
+ onChangeFilters = _useDashboard.onChangeFilters,
27541
+ handleActiveColumnOneToOne = _useDashboard.handleActiveColumnOneToOne,
27542
+ seriesOneToOne = _useDashboard.seriesOneToOne,
27543
+ avgOneToOne = _useDashboard.avgOneToOne,
27544
+ monthsOneToOne = _useDashboard.monthsOneToOne,
27545
+ dataConvertedOneToOne = _useDashboard.dataConvertedOneToOne,
27546
+ activeColumnOneToOne = _useDashboard.activeColumnOneToOne,
27547
+ handleActiveColumnClassReflection = _useDashboard.handleActiveColumnClassReflection,
27548
+ seriesClassRefection = _useDashboard.seriesClassRefection,
27549
+ avgClassReflection = _useDashboard.avgClassReflection,
27550
+ monthsClassReflection = _useDashboard.monthsClassReflection,
27551
+ dataConvertedClassReflection = _useDashboard.dataConvertedClassReflection,
27552
+ activeColumnClassReflection = _useDashboard.activeColumnClassReflection,
27553
+ handleActiveColumnConference = _useDashboard.handleActiveColumnConference,
27554
+ seriesConference = _useDashboard.seriesConference,
27555
+ avgConference = _useDashboard.avgConference,
27556
+ monthsConference = _useDashboard.monthsConference,
27557
+ dataConvertedConference = _useDashboard.dataConvertedConference,
27558
+ activeColumnConference = _useDashboard.activeColumnConference,
27559
+ handleActiveColumnSafety = _useDashboard.handleActiveColumnSafety,
27560
+ seriesSafety = _useDashboard.seriesSafety,
27561
+ avgSafety = _useDashboard.avgSafety,
27562
+ monthsSafety = _useDashboard.monthsSafety,
27563
+ dataConvertedSafety = _useDashboard.dataConvertedSafety,
27564
+ activeColumnSafety = _useDashboard.activeColumnSafety;
27078
27565
 
27079
27566
  var LIST_FILTERS_LEFT = [{
27080
27567
  name: FILTER_NAME.Calendar,
@@ -27122,70 +27609,124 @@ var useChartDatas = function useChartDatas() {
27122
27609
  data: topLearningStrategies
27123
27610
  });
27124
27611
  },
27125
- isShowChangeChart: false
27612
+ isShowChangeChart: false,
27613
+ options: []
27126
27614
  }, {
27127
- id: "Readiness_to_learn",
27615
+ id: "readiness_to_learn",
27128
27616
  label: "Readiness to learn",
27129
27617
  children: function children(_) {
27130
27618
  return React.createElement(BubbleChartCustom$1, {
27131
27619
  data: readinessToLearning
27132
27620
  });
27133
27621
  },
27134
- isShowChangeChart: false
27622
+ isShowChangeChart: false,
27623
+ options: []
27135
27624
  }, {
27136
27625
  id: "1_to_1",
27137
27626
  label: "1 To 1",
27138
27627
  children: function children(typeChart) {
27139
27628
  return React.createElement(ColumnChartAndPercent$1, {
27140
- data: chartOneToOneData.overviewQuestionChoice,
27629
+ data: dataConvertedOneToOne,
27141
27630
  id: "1_to_1",
27142
- typeChart: typeChart
27631
+ typeChart: typeChart,
27632
+ onActiveColumn: handleActiveColumnOneToOne,
27633
+ activeColumn: activeColumnOneToOne,
27634
+ series: seriesOneToOne,
27635
+ avg: avgOneToOne,
27636
+ months: monthsOneToOne
27143
27637
  });
27144
27638
  },
27145
- isShowChangeChart: true
27639
+ isShowChangeChart: true,
27640
+ options: [{
27641
+ label: "Ridge charts",
27642
+ value: TYPECHART.AREA
27643
+ }, {
27644
+ label: "Bar charts",
27645
+ value: TYPECHART.BAR
27646
+ }]
27146
27647
  }, {
27147
27648
  id: "class_reflection",
27148
27649
  label: "Class Reflection",
27149
27650
  children: function children(typeChart) {
27150
27651
  return React.createElement(ColumnChartAndPercent$1, {
27151
- data: chartClassReflection.overviewQuestionChoice,
27652
+ data: dataConvertedClassReflection,
27152
27653
  typeChart: typeChart,
27153
- id: "class_reflection"
27654
+ id: "class_reflection",
27655
+ isHasLineChart: true,
27656
+ onActiveColumn: handleActiveColumnClassReflection,
27657
+ activeColumn: activeColumnClassReflection,
27658
+ series: seriesClassRefection,
27659
+ avg: avgClassReflection,
27660
+ months: monthsClassReflection
27154
27661
  });
27155
27662
  },
27156
- isShowChangeChart: true
27663
+ isShowChangeChart: true,
27664
+ options: [{
27665
+ label: "Ridge charts",
27666
+ value: TYPECHART.AREA
27667
+ }, {
27668
+ label: "Line charts",
27669
+ value: TYPECHART.LINE
27670
+ }]
27157
27671
  }, {
27158
27672
  id: "conference",
27159
27673
  label: "Conference",
27160
27674
  children: function children(typeChart) {
27161
27675
  return React.createElement(ColumnChartAndPercent$1, {
27162
- data: chartConference.overviewQuestionChoice,
27676
+ data: dataConvertedConference,
27163
27677
  typeChart: typeChart,
27164
- id: "conference"
27678
+ id: "conference",
27679
+ onActiveColumn: handleActiveColumnConference,
27680
+ activeColumn: activeColumnConference,
27681
+ series: seriesConference,
27682
+ avg: avgConference,
27683
+ months: monthsConference
27165
27684
  });
27166
27685
  },
27167
- isShowChangeChart: true
27686
+ isShowChangeChart: true,
27687
+ options: [{
27688
+ label: "Ridge charts",
27689
+ value: TYPECHART.AREA
27690
+ }, {
27691
+ label: "Bar charts",
27692
+ value: TYPECHART.BAR
27693
+ }]
27168
27694
  }, {
27169
27695
  id: "safety",
27170
27696
  label: "Safety",
27171
27697
  children: function children(typeChart) {
27172
27698
  return React.createElement(ColumnChartAndPercent$1, {
27173
- data: safety.overviewQuestionChoice,
27699
+ data: dataConvertedSafety,
27174
27700
  typeChart: typeChart,
27175
- id: "safety"
27701
+ id: "safety",
27702
+ isHasLineChart: true,
27703
+ onActiveColumn: handleActiveColumnSafety,
27704
+ activeColumn: activeColumnSafety,
27705
+ series: seriesSafety,
27706
+ avg: avgSafety,
27707
+ months: monthsSafety
27176
27708
  });
27177
27709
  },
27178
- isShowChangeChart: true
27710
+ isShowChangeChart: true,
27711
+ options: [{
27712
+ label: "Ridge charts",
27713
+ value: TYPECHART.AREA
27714
+ }, {
27715
+ label: "Line charts",
27716
+ value: TYPECHART.LINE
27717
+ }]
27179
27718
  }, {
27180
27719
  id: "Student_by_age",
27181
27720
  label: "Student by age",
27182
- children: function children(_) {
27721
+ children: function children(_, columnFlex) {
27183
27722
  return React.createElement(StudentByAgeAndGender$1, {
27723
+ columnFlex: columnFlex,
27184
27724
  studentByAgeData: studentByAge,
27185
27725
  studentByGenderData: studentByGender
27186
27726
  });
27187
27727
  },
27188
- isShowChangeChart: false
27728
+ isShowChangeChart: false,
27729
+ options: []
27189
27730
  }, {
27190
27731
  id: "student_by_grade",
27191
27732
  label: "Students by Grade",
@@ -27194,8 +27735,12 @@ var useChartDatas = function useChartDatas() {
27194
27735
  data: studentByGrade
27195
27736
  });
27196
27737
  },
27197
- isShowChangeChart: false
27738
+ isShowChangeChart: false,
27739
+ options: []
27198
27740
  }];
27741
+ var initialTypeChart = chartDashBoards.map(function (i) {
27742
+ return i.options.length > 0 ? i.options[1].value : TYPECHART.BAR;
27743
+ });
27199
27744
  var totalCardData = [{
27200
27745
  icon: "images/icon_chart.png",
27201
27746
  title: "Total 1-to-1:",
@@ -27239,7 +27784,8 @@ var useChartDatas = function useChartDatas() {
27239
27784
  LIST_FILTERS_LEFT: LIST_FILTERS_LEFT,
27240
27785
  LIST_FILTERS_RIGHT: LIST_FILTERS_RIGHT,
27241
27786
  totalCardData: totalCardData,
27242
- onChangeFilters: onChangeFilters
27787
+ onChangeFilters: onChangeFilters,
27788
+ initialTypeChart: initialTypeChart
27243
27789
  };
27244
27790
  };
27245
27791
 
@@ -27248,7 +27794,9 @@ var StudentItemSelector = function StudentItemSelector(_ref) {
27248
27794
  onChange = _ref.onChange,
27249
27795
  externalStudentIds = _ref.externalStudentIds,
27250
27796
  studentDefault = _ref.studentDefault,
27251
- teacherUserId = _ref.teacherUserId;
27797
+ teacherUserId = _ref.teacherUserId,
27798
+ _ref$placeholder = _ref.placeholder,
27799
+ placeholder = _ref$placeholder === void 0 ? "Search student" : _ref$placeholder;
27252
27800
  var dispatch = useDispatch();
27253
27801
 
27254
27802
  var _useState = useState([]),
@@ -27326,7 +27874,7 @@ var StudentItemSelector = function StudentItemSelector(_ref) {
27326
27874
  return setSearchString(inputValue);
27327
27875
  },
27328
27876
  isLoading: isLoading,
27329
- placeholder: "Search student",
27877
+ placeholder: placeholder,
27330
27878
  defaultValue: value,
27331
27879
  onChange: onChange,
27332
27880
  isClearable: true
@@ -27381,16 +27929,18 @@ var TeacherItemSelector = function TeacherItemSelector(_ref) {
27381
27929
  };
27382
27930
 
27383
27931
  var SelectFilter = function SelectFilter(_ref) {
27384
- var teacherId = _ref.teacherId,
27385
- studentUserId = _ref.studentUserId,
27932
+ var studentUserId = _ref.studentUserId,
27386
27933
  studentId = _ref.studentId,
27387
- teacherUserId = _ref.teacherUserId,
27388
27934
  studentDefault = _ref.studentDefault,
27389
27935
  handleChangeFilters = _ref.handleChangeFilters,
27390
27936
  name = _ref.name,
27391
27937
  icon = _ref.icon,
27392
27938
  option = _ref.option,
27393
- onChangeFilters = _ref.onChangeFilters;
27939
+ onChangeFilters = _ref.onChangeFilters,
27940
+ btnStyle = _ref.btnStyle,
27941
+ filter = _ref.filter,
27942
+ teacherUserId = _ref.teacherUserId,
27943
+ changeCurrentTeacherUserId = _ref.changeCurrentTeacherUserId;
27394
27944
 
27395
27945
  var _useState = useState(false),
27396
27946
  isOpenCollapse = _useState[0],
@@ -27661,6 +28211,7 @@ var SelectFilter = function SelectFilter(_ref) {
27661
28211
  }, React.createElement(TeacherItemSelector, {
27662
28212
  onChange: function onChange(e) {
27663
28213
  handleChangeFilters(e);
28214
+ !!changeCurrentTeacherUserId && changeCurrentTeacherUserId(e.teacherUserId || "");
27664
28215
 
27665
28216
  if (!(e !== null && e !== void 0 && e.label)) {
27666
28217
  setTeacherName("");
@@ -27668,7 +28219,7 @@ var SelectFilter = function SelectFilter(_ref) {
27668
28219
  setTeacherName(e.label);
27669
28220
  }
27670
28221
  },
27671
- defaultValue: teacherId,
28222
+ defaultValue: filter === null || filter === void 0 ? void 0 : filter.teacherId,
27672
28223
  studentUserId: studentUserId || ""
27673
28224
  })));
27674
28225
  }
@@ -27679,7 +28230,8 @@ var SelectFilter = function SelectFilter(_ref) {
27679
28230
  className: styles["block-filter-component"] + " "
27680
28231
  }, React.createElement("button", {
27681
28232
  onClick: handleToggleCollapse,
27682
- className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer"
28233
+ className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer",
28234
+ style: btnStyle
27683
28235
  }, React.createElement("img", {
27684
28236
  src: "" + icon,
27685
28237
  alt: name
@@ -27693,14 +28245,14 @@ var SelectFilter = function SelectFilter(_ref) {
27693
28245
 
27694
28246
  if (!(e !== null && e !== void 0 && e.label)) {
27695
28247
  setStudentName("");
27696
- setTeacherName("");
27697
28248
  } else {
27698
28249
  setStudentName(e.label);
27699
28250
  }
27700
28251
  },
27701
28252
  value: studentId,
27702
28253
  studentDefault: studentDefault,
27703
- teacherUserId: teacherUserId
28254
+ teacherUserId: teacherUserId,
28255
+ placeholder: "Type 2 characters to search"
27704
28256
  })));
27705
28257
  }
27706
28258
 
@@ -27729,6 +28281,778 @@ var TotalCard = function TotalCard(_ref) {
27729
28281
  }, value)));
27730
28282
  };
27731
28283
 
28284
+ var headerLogo = "../images/logoV1-2.png";
28285
+
28286
+ var DashboardToPDF = function DashboardToPDF(props) {
28287
+ var selectedToPDF = props.selectedToPDF,
28288
+ initialData = props.initialData,
28289
+ typeChartList = props.typeChartList;
28290
+ var dispatch = useDispatch();
28291
+
28292
+ var _useDashboard = useDashboard(),
28293
+ chartOneToOneData = _useDashboard.chartOneToOneData,
28294
+ topLearningStrategies = _useDashboard.topLearningStrategies,
28295
+ chartClassReflection = _useDashboard.chartClassReflection,
28296
+ chartConference = _useDashboard.chartConference,
28297
+ safety = _useDashboard.safety;
28298
+
28299
+ var chartHightImpactLearningStrategie = selectedToPDF.find(function (i) {
28300
+ return i.id === "high_impact_learning_strategie";
28301
+ });
28302
+ var chartReadinessToLearn = selectedToPDF.find(function (i) {
28303
+ return i.id === "readiness_to_learn";
28304
+ });
28305
+ var chartOneToOne = selectedToPDF.find(function (i) {
28306
+ return i.id === "1_to_1";
28307
+ });
28308
+ var chartClassReflectionPDF = selectedToPDF.find(function (i) {
28309
+ return i.id === "class_reflection";
28310
+ });
28311
+ var chartConferecePDF = selectedToPDF.find(function (i) {
28312
+ return i.id === "conference";
28313
+ });
28314
+ var chartSafety = selectedToPDF.find(function (i) {
28315
+ return i.id === "safety";
28316
+ });
28317
+ var chartStudentByAge = selectedToPDF.find(function (i) {
28318
+ return i.id === "Student_by_age";
28319
+ });
28320
+ var chartStudentByGrade = selectedToPDF.find(function (i) {
28321
+ return i.id === "student_by_grade";
28322
+ });
28323
+
28324
+ var generatePDF = function generatePDF() {
28325
+ try {
28326
+ var _temp19 = function _temp19() {
28327
+ dispatch(setLoading(false));
28328
+ };
28329
+
28330
+ dispatch(setLoading(true));
28331
+
28332
+ var _temp20 = _catch(function () {
28333
+ function _temp16() {
28334
+ function _temp14() {
28335
+ function _temp12() {
28336
+ function _temp10() {
28337
+ function _temp8() {
28338
+ function _temp6() {
28339
+ function _temp4() {
28340
+ function _temp2() {
28341
+ doc.save("DashBoard.pdf");
28342
+ }
28343
+
28344
+ var _temp = function () {
28345
+ if (!!chartStudentByGrade) {
28346
+ var _selectedToPDF;
28347
+
28348
+ var line = 80;
28349
+ var left = 20;
28350
+ if (selectedToPDF.indexOf(chartStudentByGrade) != 0 && ((_selectedToPDF = selectedToPDF[selectedToPDF.indexOf(chartStudentByGrade) - 1]) === null || _selectedToPDF === void 0 ? void 0 : _selectedToPDF.id) != null) doc.addPage();
28351
+ return Promise.resolve(createImageHeader()).then(function () {
28352
+ doc.setFontSize(14);
28353
+ doc.setFont("Helvetica", "normal", "bold");
28354
+ doc.text(chartStudentByGrade.label, left, line);
28355
+ var chart = document.getElementById("student_by_grade");
28356
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28357
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 140);
28358
+ });
28359
+ });
28360
+ }
28361
+ }();
28362
+
28363
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
28364
+ }
28365
+
28366
+ var _temp3 = function () {
28367
+ if (!!chartStudentByAge) {
28368
+ var _selectedToPDF2;
28369
+
28370
+ var line = 80;
28371
+ var left = 20;
28372
+ if (selectedToPDF.indexOf(chartStudentByAge) != 0 && ((_selectedToPDF2 = selectedToPDF[selectedToPDF.indexOf(chartStudentByAge) - 1]) === null || _selectedToPDF2 === void 0 ? void 0 : _selectedToPDF2.id) != null) doc.addPage();
28373
+ return Promise.resolve(createImageHeader()).then(function () {
28374
+ doc.setFontSize(14);
28375
+ doc.setFont("Helvetica", "normal", "bold");
28376
+ doc.text(chartStudentByAge.label, left, line);
28377
+ var chart = document.getElementById("Student_by_age");
28378
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28379
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 20, line + 20, 800, 450);
28380
+ });
28381
+ });
28382
+ }
28383
+ }();
28384
+
28385
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
28386
+ }
28387
+
28388
+ var _temp5 = function () {
28389
+ if (!!chartSafety) {
28390
+ var _selectedToPDF3;
28391
+
28392
+ var line = 80;
28393
+ var left = 20;
28394
+ if (selectedToPDF.indexOf(chartSafety) != 0 && ((_selectedToPDF3 = selectedToPDF[selectedToPDF.indexOf(chartSafety) - 1]) === null || _selectedToPDF3 === void 0 ? void 0 : _selectedToPDF3.id) != null) doc.addPage();
28395
+ return Promise.resolve(createImageHeader()).then(function () {
28396
+ doc.setFontSize(14);
28397
+ doc.setFont("Helvetica", "normal", "bold");
28398
+ doc.text(chartSafety.label, left, line);
28399
+ var chart = document.getElementById("safety");
28400
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28401
+ doc.setFontSize(8);
28402
+
28403
+ for (var i = 0; i < ((_safety$overviewQuest = safety.overviewQuestionChoice) === null || _safety$overviewQuest === void 0 ? void 0 : _safety$overviewQuest.length); i++) {
28404
+ var _safety$overviewQuest;
28405
+
28406
+ if (safety.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28407
+ var _sortedResultQuestion, _sortedResultQuestion2, _sortedResultQuestion3, _sortedResultQuestion4, _sortedResultQuestion5, _sortedResultQuestion6;
28408
+
28409
+ var sortedResultQuestions = safety.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28410
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28411
+ });
28412
+ var bestResultQuestion1 = ((_sortedResultQuestion = sortedResultQuestions[0]) === null || _sortedResultQuestion === void 0 ? void 0 : _sortedResultQuestion.questionText.slice(3, (_sortedResultQuestion2 = sortedResultQuestions[0]) === null || _sortedResultQuestion2 === void 0 ? void 0 : _sortedResultQuestion2.questionText.indexOf("</p>"))) || "";
28413
+ var bestResultQuestion2 = ((_sortedResultQuestion3 = sortedResultQuestions[1]) === null || _sortedResultQuestion3 === void 0 ? void 0 : _sortedResultQuestion3.questionText.slice(3, (_sortedResultQuestion4 = sortedResultQuestions[1]) === null || _sortedResultQuestion4 === void 0 ? void 0 : _sortedResultQuestion4.questionText.indexOf("</p>"))) || "";
28414
+ var bestResultQuestion3 = ((_sortedResultQuestion5 = sortedResultQuestions[2]) === null || _sortedResultQuestion5 === void 0 ? void 0 : _sortedResultQuestion5.questionText.slice(3, (_sortedResultQuestion6 = sortedResultQuestions[2]) === null || _sortedResultQuestion6 === void 0 ? void 0 : _sortedResultQuestion6.questionText.indexOf("</p>"))) || "";
28415
+ doc.setFont("Helvetica", "normal", "bold");
28416
+ doc.text(safety.overviewQuestionChoice[i].month, left, line + 20);
28417
+
28418
+ if (bestResultQuestion1 != "") {
28419
+ var _sortedResultQuestion7;
28420
+
28421
+ doc.setFont("Helvetica", "normal", "bold");
28422
+ doc.text(bestResultQuestion1, left + 10, line + 30);
28423
+ doc.setFont("Helvetica", "normal", "normal");
28424
+ doc.text(((_sortedResultQuestion7 = sortedResultQuestions[0]) === null || _sortedResultQuestion7 === void 0 ? void 0 : _sortedResultQuestion7.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 4 + 15, line + 30);
28425
+ doc.setDrawColor(0);
28426
+ doc.setFillColor(64, 210, 204);
28427
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28428
+ }
28429
+
28430
+ if (bestResultQuestion2 != "") {
28431
+ var _sortedResultQuestion8;
28432
+
28433
+ doc.setFont("Helvetica", "normal", "bold");
28434
+ doc.text(bestResultQuestion2, left + 10, line + 40);
28435
+ doc.setFont("Helvetica", "normal", "normal");
28436
+ doc.text(((_sortedResultQuestion8 = sortedResultQuestions[1]) === null || _sortedResultQuestion8 === void 0 ? void 0 : _sortedResultQuestion8.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 4 + 15, line + 40);
28437
+ doc.setDrawColor(0);
28438
+ doc.setFillColor(120, 182, 226);
28439
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28440
+ }
28441
+
28442
+ if (bestResultQuestion3 != "") {
28443
+ var _sortedResultQuestion9;
28444
+
28445
+ doc.setFont("Helvetica", "normal", "bold");
28446
+ doc.text(bestResultQuestion3, left + 10, line + 50);
28447
+ doc.setFont("Helvetica", "normal", "normal");
28448
+ doc.text(((_sortedResultQuestion9 = sortedResultQuestions[2]) === null || _sortedResultQuestion9 === void 0 ? void 0 : _sortedResultQuestion9.avgOfStudentChoice.toFixed(1)) + "%", left + (bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 4 + 15, line + 50);
28449
+ doc.setDrawColor(0);
28450
+ doc.setFillColor(255, 176, 79);
28451
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28452
+ }
28453
+
28454
+ if ((bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 5 + 5 + 10 > 100) {
28455
+ left = left + (bestResultQuestion1 === null || bestResultQuestion1 === void 0 ? void 0 : bestResultQuestion1.length) * 5 + 20;
28456
+ } else if ((bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 5 + 5 + 10 > 100) {
28457
+ left = left + (bestResultQuestion2 === null || bestResultQuestion2 === void 0 ? void 0 : bestResultQuestion2.length) * 5 + 20;
28458
+ } else if ((bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 5 + 5 + 10 > 100) {
28459
+ left = left + (bestResultQuestion3 === null || bestResultQuestion3 === void 0 ? void 0 : bestResultQuestion3.length) * 5 + 20;
28460
+ } else {
28461
+ left = left + 100;
28462
+ }
28463
+
28464
+ if (left + 80 > WIDTH_PAPER) {
28465
+ left = 20;
28466
+ line += 60;
28467
+ }
28468
+ }
28469
+ }
28470
+
28471
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28472
+ });
28473
+ });
28474
+ }
28475
+ }();
28476
+
28477
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
28478
+ }
28479
+
28480
+ var _temp7 = function () {
28481
+ if (!!chartConferecePDF) {
28482
+ var _selectedToPDF4;
28483
+
28484
+ var line = 80;
28485
+ var left = 20;
28486
+ if (selectedToPDF.indexOf(chartConferecePDF) != 0 && ((_selectedToPDF4 = selectedToPDF[selectedToPDF.indexOf(chartConferecePDF) - 1]) === null || _selectedToPDF4 === void 0 ? void 0 : _selectedToPDF4.id) != null) doc.addPage();
28487
+ return Promise.resolve(createImageHeader()).then(function () {
28488
+ doc.setFontSize(14);
28489
+ doc.setFont("Helvetica", "normal", "bold");
28490
+ doc.text(chartConferecePDF.label, left, line);
28491
+ var chart = document.getElementById("conference");
28492
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28493
+ doc.setFontSize(8);
28494
+
28495
+ for (var i = 0; i < ((_chartConference$over = chartConference.overviewQuestionChoice) === null || _chartConference$over === void 0 ? void 0 : _chartConference$over.length); i++) {
28496
+ var _chartConference$over;
28497
+
28498
+ if (chartConference.overviewQuestionChoice[i].resultQuestion[0].questionId != 0 || chartConference.overviewQuestionChoice[i].resultQuestion[0].questionText != "") {
28499
+ var _sortedResultQuestion10, _sortedResultQuestion11, _sortedResultQuestion12, _sortedResultQuestion13, _sortedResultQuestion14, _sortedResultQuestion15;
28500
+
28501
+ var sortedResultQuestions = chartConference.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28502
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28503
+ });
28504
+ var resultQuestion1 = ((_sortedResultQuestion10 = sortedResultQuestions[0]) === null || _sortedResultQuestion10 === void 0 ? void 0 : _sortedResultQuestion10.questionText) || "";
28505
+ var resultQuestion2 = ((_sortedResultQuestion11 = sortedResultQuestions[1]) === null || _sortedResultQuestion11 === void 0 ? void 0 : _sortedResultQuestion11.questionText) || "";
28506
+ var resultQuestion3 = ((_sortedResultQuestion12 = sortedResultQuestions[2]) === null || _sortedResultQuestion12 === void 0 ? void 0 : _sortedResultQuestion12.questionText) || "";
28507
+ var resultQuestion4 = ((_sortedResultQuestion13 = sortedResultQuestions[3]) === null || _sortedResultQuestion13 === void 0 ? void 0 : _sortedResultQuestion13.questionText) || "";
28508
+ var resultQuestion5 = ((_sortedResultQuestion14 = sortedResultQuestions[4]) === null || _sortedResultQuestion14 === void 0 ? void 0 : _sortedResultQuestion14.questionText) || "";
28509
+ var resultQuestion6 = ((_sortedResultQuestion15 = sortedResultQuestions[5]) === null || _sortedResultQuestion15 === void 0 ? void 0 : _sortedResultQuestion15.questionText) || "";
28510
+ doc.setFont("Helvetica", "normal", "bold");
28511
+ doc.text(chartConference.overviewQuestionChoice[i].month, left, line + 20);
28512
+
28513
+ if (resultQuestion1 != "") {
28514
+ var _sortedResultQuestion16;
28515
+
28516
+ doc.setFont("Helvetica", "normal", "bold");
28517
+ doc.text(resultQuestion1, left + 10, line + 30);
28518
+ doc.setFont("Helvetica", "normal", "normal");
28519
+ doc.text(((_sortedResultQuestion16 = sortedResultQuestions[0]) === null || _sortedResultQuestion16 === void 0 ? void 0 : _sortedResultQuestion16.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 17, line + 30);
28520
+ doc.setDrawColor(0);
28521
+ doc.setFillColor(64, 210, 204);
28522
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28523
+ }
28524
+
28525
+ if (resultQuestion2 != "") {
28526
+ var _sortedResultQuestion17;
28527
+
28528
+ doc.setFont("Helvetica", "normal", "bold");
28529
+ doc.text(resultQuestion2, left + 10, line + 40);
28530
+ doc.setFont("Helvetica", "normal", "normal");
28531
+ doc.text(((_sortedResultQuestion17 = sortedResultQuestions[1]) === null || _sortedResultQuestion17 === void 0 ? void 0 : _sortedResultQuestion17.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 17, line + 40);
28532
+ doc.setDrawColor(0);
28533
+ doc.setFillColor(120, 182, 226);
28534
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28535
+ }
28536
+
28537
+ if (resultQuestion3 != "") {
28538
+ var _sortedResultQuestion18;
28539
+
28540
+ doc.setFont("Helvetica", "normal", "bold");
28541
+ doc.text(resultQuestion3, left + 10, line + 50);
28542
+ doc.setFont("Helvetica", "normal", "normal");
28543
+ doc.text(((_sortedResultQuestion18 = sortedResultQuestions[2]) === null || _sortedResultQuestion18 === void 0 ? void 0 : _sortedResultQuestion18.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 17, line + 50);
28544
+ doc.setDrawColor(0);
28545
+ doc.setFillColor(255, 176, 79);
28546
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28547
+ }
28548
+
28549
+ if (resultQuestion4 != "") {
28550
+ var _sortedResultQuestion19;
28551
+
28552
+ doc.setFont("Helvetica", "normal", "bold");
28553
+ doc.text(resultQuestion4, left + 10, line + 60);
28554
+ doc.setFont("Helvetica", "normal", "normal");
28555
+ doc.text(((_sortedResultQuestion19 = sortedResultQuestions[2]) === null || _sortedResultQuestion19 === void 0 ? void 0 : _sortedResultQuestion19.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 17, line + 60);
28556
+ doc.setDrawColor(0);
28557
+ doc.setFillColor(206, 74, 73);
28558
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28559
+ }
28560
+
28561
+ if (resultQuestion5 != "") {
28562
+ var _sortedResultQuestion20;
28563
+
28564
+ doc.setFont("Helvetica", "normal", "bold");
28565
+ doc.text(resultQuestion5, left + 10, line + 70);
28566
+ doc.setFont("Helvetica", "normal", "normal");
28567
+ doc.text(((_sortedResultQuestion20 = sortedResultQuestions[2]) === null || _sortedResultQuestion20 === void 0 ? void 0 : _sortedResultQuestion20.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 17, line + 70);
28568
+ doc.setDrawColor(0);
28569
+ doc.setFillColor(27, 183, 177);
28570
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28571
+ }
28572
+
28573
+ if (resultQuestion6 != "") {
28574
+ var _sortedResultQuestion21;
28575
+
28576
+ doc.setFont("Helvetica", "normal", "bold");
28577
+ doc.text(resultQuestion6, left + 10, line + 80);
28578
+ doc.setFont("Helvetica", "normal", "normal");
28579
+ doc.text(((_sortedResultQuestion21 = sortedResultQuestions[2]) === null || _sortedResultQuestion21 === void 0 ? void 0 : _sortedResultQuestion21.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 3 + 17, line + 80);
28580
+ doc.setDrawColor(0);
28581
+ doc.setFillColor(75, 146, 206);
28582
+ doc.roundedRect(left, line + 75, 5, 5, 1, 1, "F");
28583
+ }
28584
+
28585
+ if ((resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 5 + 10 > 100) {
28586
+ left = left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 20;
28587
+ } else if ((resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 5 + 10 > 100) {
28588
+ left = left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 20;
28589
+ } else if ((resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 5 + 10 > 100) {
28590
+ left = left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 20;
28591
+ } else if ((resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 5 + 10 > 100) {
28592
+ left = left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 20;
28593
+ } else if ((resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 5 + 10 > 100) {
28594
+ left = left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 20;
28595
+ } else if ((resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 5 + 5 + 10 > 100) {
28596
+ left = left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 5 + 20;
28597
+ } else {
28598
+ left = left + 100;
28599
+ }
28600
+
28601
+ if (left + 80 > WIDTH_PAPER) {
28602
+ left = 20;
28603
+ line += 90;
28604
+ }
28605
+ }
28606
+ }
28607
+
28608
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28609
+ });
28610
+ });
28611
+ }
28612
+ }();
28613
+
28614
+ return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
28615
+ }
28616
+
28617
+ var _temp9 = function () {
28618
+ if (!!chartClassReflectionPDF) {
28619
+ var _selectedToPDF5;
28620
+
28621
+ var line = 80;
28622
+ var left = 20;
28623
+ if (selectedToPDF.indexOf(chartClassReflectionPDF) != 0 && ((_selectedToPDF5 = selectedToPDF[selectedToPDF.indexOf(chartClassReflectionPDF) - 1]) === null || _selectedToPDF5 === void 0 ? void 0 : _selectedToPDF5.id) != null) doc.addPage();
28624
+ return Promise.resolve(createImageHeader()).then(function () {
28625
+ doc.setFontSize(14);
28626
+ doc.setFont("Helvetica", "normal", "bold");
28627
+ doc.text(chartClassReflectionPDF.label, left, line);
28628
+ var chart = document.getElementById("class_reflection");
28629
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28630
+ doc.setFontSize(8);
28631
+
28632
+ for (var i = 0; i < ((_chartClassReflection = chartClassReflection.overviewQuestionChoice) === null || _chartClassReflection === void 0 ? void 0 : _chartClassReflection.length); i++) {
28633
+ var _chartClassReflection;
28634
+
28635
+ if (chartClassReflection.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28636
+ var _sortedResultQuestion22, _sortedResultQuestion23, _sortedResultQuestion24, _sortedResultQuestion25, _sortedResultQuestion26, _sortedResultQuestion27, _sortedResultQuestion28, _sortedResultQuestion29, _sortedResultQuestion30, _sortedResultQuestion31;
28637
+
28638
+ var sortedResultQuestions = chartClassReflection.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28639
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28640
+ });
28641
+ var resultQuestion1 = ((_sortedResultQuestion22 = sortedResultQuestions[0]) === null || _sortedResultQuestion22 === void 0 ? void 0 : _sortedResultQuestion22.questionText.slice(3, (_sortedResultQuestion23 = sortedResultQuestions[0]) === null || _sortedResultQuestion23 === void 0 ? void 0 : _sortedResultQuestion23.questionText.indexOf("</p>"))) || "";
28642
+ var resultQuestion2 = ((_sortedResultQuestion24 = sortedResultQuestions[1]) === null || _sortedResultQuestion24 === void 0 ? void 0 : _sortedResultQuestion24.questionText.slice(3, (_sortedResultQuestion25 = sortedResultQuestions[1]) === null || _sortedResultQuestion25 === void 0 ? void 0 : _sortedResultQuestion25.questionText.indexOf("</p>"))) || "";
28643
+ var resultQuestion3 = ((_sortedResultQuestion26 = sortedResultQuestions[2]) === null || _sortedResultQuestion26 === void 0 ? void 0 : _sortedResultQuestion26.questionText.slice(3, (_sortedResultQuestion27 = sortedResultQuestions[2]) === null || _sortedResultQuestion27 === void 0 ? void 0 : _sortedResultQuestion27.questionText.indexOf("</p>"))) || "";
28644
+ var resultQuestion4 = ((_sortedResultQuestion28 = sortedResultQuestions[3]) === null || _sortedResultQuestion28 === void 0 ? void 0 : _sortedResultQuestion28.questionText.slice(3, (_sortedResultQuestion29 = sortedResultQuestions[3]) === null || _sortedResultQuestion29 === void 0 ? void 0 : _sortedResultQuestion29.questionText.indexOf("</p>"))) || "";
28645
+ var resultQuestion5 = ((_sortedResultQuestion30 = sortedResultQuestions[4]) === null || _sortedResultQuestion30 === void 0 ? void 0 : _sortedResultQuestion30.questionText.slice(3, (_sortedResultQuestion31 = sortedResultQuestions[4]) === null || _sortedResultQuestion31 === void 0 ? void 0 : _sortedResultQuestion31.questionText.indexOf("</p>"))) || "";
28646
+ doc.setFont("Helvetica", "normal", "bold");
28647
+ doc.text(chartClassReflection.overviewQuestionChoice[i].month, left, line + 20);
28648
+
28649
+ if (resultQuestion1 != "") {
28650
+ var _sortedResultQuestion32;
28651
+
28652
+ doc.setFont("Helvetica", "normal", "bold");
28653
+ doc.text(resultQuestion1, left + 10, line + 30);
28654
+ doc.setFont("Helvetica", "normal", "normal");
28655
+ doc.text(((_sortedResultQuestion32 = sortedResultQuestions[0]) === null || _sortedResultQuestion32 === void 0 ? void 0 : _sortedResultQuestion32.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 15, line + 30);
28656
+ doc.setDrawColor(0);
28657
+ doc.setFillColor(64, 210, 204);
28658
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28659
+ }
28660
+
28661
+ if (resultQuestion2 != "") {
28662
+ var _sortedResultQuestion33;
28663
+
28664
+ doc.setFont("Helvetica", "normal", "bold");
28665
+ doc.text(resultQuestion2, left + 10, line + 40);
28666
+ doc.setFont("Helvetica", "normal", "normal");
28667
+ doc.text(((_sortedResultQuestion33 = sortedResultQuestions[1]) === null || _sortedResultQuestion33 === void 0 ? void 0 : _sortedResultQuestion33.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 15, line + 40);
28668
+ doc.setDrawColor(0);
28669
+ doc.setFillColor(120, 182, 226);
28670
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28671
+ }
28672
+
28673
+ if (resultQuestion3 != "") {
28674
+ var _sortedResultQuestion34;
28675
+
28676
+ doc.setFont("Helvetica", "normal", "bold");
28677
+ doc.text(resultQuestion3, left + 10, line + 50);
28678
+ doc.setFont("Helvetica", "normal", "normal");
28679
+ doc.text(((_sortedResultQuestion34 = sortedResultQuestions[2]) === null || _sortedResultQuestion34 === void 0 ? void 0 : _sortedResultQuestion34.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 15, line + 50);
28680
+ doc.setDrawColor(0);
28681
+ doc.setFillColor(255, 176, 79);
28682
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28683
+ }
28684
+
28685
+ if (resultQuestion4 != "") {
28686
+ var _sortedResultQuestion35;
28687
+
28688
+ doc.setFont("Helvetica", "normal", "bold");
28689
+ doc.text(resultQuestion4, left + 10, line + 60);
28690
+ doc.setFont("Helvetica", "normal", "normal");
28691
+ doc.text(((_sortedResultQuestion35 = sortedResultQuestions[3]) === null || _sortedResultQuestion35 === void 0 ? void 0 : _sortedResultQuestion35.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 15, line + 60);
28692
+ doc.setDrawColor(0);
28693
+ doc.setFillColor(206, 74, 73);
28694
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28695
+ }
28696
+
28697
+ if (resultQuestion5 != "") {
28698
+ var _sortedResultQuestion36;
28699
+
28700
+ doc.setFont("Helvetica", "normal", "bold");
28701
+ doc.text(resultQuestion5, left + 10, line + 70);
28702
+ doc.setFont("Helvetica", "normal", "normal");
28703
+ doc.text(((_sortedResultQuestion36 = sortedResultQuestions[4]) === null || _sortedResultQuestion36 === void 0 ? void 0 : _sortedResultQuestion36.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 15, line + 70);
28704
+ doc.setDrawColor(0);
28705
+ doc.setFillColor(27, 183, 177);
28706
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28707
+ }
28708
+
28709
+ if ((resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 5 + 10 > 80) {
28710
+ left = left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 5 + 15;
28711
+ } else if ((resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 5 + 10 > 80) {
28712
+ left = left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 5 + 15;
28713
+ } else if ((resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 5 + 10 > 80) {
28714
+ left = left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 5 + 15;
28715
+ } else if ((resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 5 + 10 > 80) {
28716
+ left = left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 5 + 15;
28717
+ } else if ((resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 5 + 10 > 80) {
28718
+ left = left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 5 + 15;
28719
+ } else {
28720
+ left = left + 80;
28721
+ }
28722
+
28723
+ if (left + 80 > WIDTH_PAPER) {
28724
+ left = 20;
28725
+ line += 75;
28726
+ }
28727
+ }
28728
+ }
28729
+
28730
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 170);
28731
+ });
28732
+ });
28733
+ }
28734
+ }();
28735
+
28736
+ return _temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9);
28737
+ }
28738
+
28739
+ var _temp11 = function () {
28740
+ if (!!chartOneToOne) {
28741
+ var _selectedToPDF6;
28742
+
28743
+ var line = 80;
28744
+ var left = 20;
28745
+ if (selectedToPDF.indexOf(chartOneToOne) != 0 && ((_selectedToPDF6 = selectedToPDF[selectedToPDF.indexOf(chartOneToOne) - 1]) === null || _selectedToPDF6 === void 0 ? void 0 : _selectedToPDF6.id) != null) doc.addPage();
28746
+ return Promise.resolve(createImageHeader()).then(function () {
28747
+ doc.setFontSize(14);
28748
+ doc.setFont("Helvetica", "normal", "bold");
28749
+ doc.text(chartOneToOne.label, left, line);
28750
+ var chart = document.getElementById("1_to_1");
28751
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28752
+ doc.setFontSize(8);
28753
+
28754
+ for (var i = 0; i < ((_chartOneToOneData$ov = chartOneToOneData.overviewQuestionChoice) === null || _chartOneToOneData$ov === void 0 ? void 0 : _chartOneToOneData$ov.length); i++) {
28755
+ var _chartOneToOneData$ov;
28756
+
28757
+ if (chartOneToOneData.overviewQuestionChoice[i].resultQuestion[0].questionId != 0) {
28758
+ var _sortedResultQuestion37, _sortedResultQuestion38, _sortedResultQuestion39, _sortedResultQuestion40, _sortedResultQuestion41, _sortedResultQuestion42, _sortedResultQuestion43, _sortedResultQuestion44, _sortedResultQuestion45, _sortedResultQuestion46, _sortedResultQuestion47, _sortedResultQuestion48, _sortedResultQuestion49, _sortedResultQuestion50, _sortedResultQuestion51, _sortedResultQuestion52, _sortedResultQuestion53, _sortedResultQuestion54;
28759
+
28760
+ var sortedResultQuestions = chartOneToOneData.overviewQuestionChoice[i].resultQuestion.sort(function (a, b) {
28761
+ return a.avgOfStudentChoice < b.avgOfStudentChoice ? 1 : -1;
28762
+ });
28763
+ var resultQuestion1 = ((_sortedResultQuestion37 = sortedResultQuestions[0]) === null || _sortedResultQuestion37 === void 0 ? void 0 : _sortedResultQuestion37.questionText.slice(3, (_sortedResultQuestion38 = sortedResultQuestions[0]) === null || _sortedResultQuestion38 === void 0 ? void 0 : _sortedResultQuestion38.questionText.indexOf("</p>"))) || "";
28764
+ var resultQuestion2 = ((_sortedResultQuestion39 = sortedResultQuestions[1]) === null || _sortedResultQuestion39 === void 0 ? void 0 : _sortedResultQuestion39.questionText.slice(3, (_sortedResultQuestion40 = sortedResultQuestions[1]) === null || _sortedResultQuestion40 === void 0 ? void 0 : _sortedResultQuestion40.questionText.indexOf("</p>"))) || "";
28765
+ var resultQuestion3 = ((_sortedResultQuestion41 = sortedResultQuestions[2]) === null || _sortedResultQuestion41 === void 0 ? void 0 : _sortedResultQuestion41.questionText.slice(3, (_sortedResultQuestion42 = sortedResultQuestions[2]) === null || _sortedResultQuestion42 === void 0 ? void 0 : _sortedResultQuestion42.questionText.indexOf("</p>"))) || "";
28766
+ var resultQuestion4 = ((_sortedResultQuestion43 = sortedResultQuestions[3]) === null || _sortedResultQuestion43 === void 0 ? void 0 : _sortedResultQuestion43.questionText.slice(3, (_sortedResultQuestion44 = sortedResultQuestions[3]) === null || _sortedResultQuestion44 === void 0 ? void 0 : _sortedResultQuestion44.questionText.indexOf("</p>"))) || "";
28767
+ var resultQuestion5 = ((_sortedResultQuestion45 = sortedResultQuestions[4]) === null || _sortedResultQuestion45 === void 0 ? void 0 : _sortedResultQuestion45.questionText.slice(3, (_sortedResultQuestion46 = sortedResultQuestions[4]) === null || _sortedResultQuestion46 === void 0 ? void 0 : _sortedResultQuestion46.questionText.indexOf("</p>"))) || "";
28768
+ var resultQuestion6 = ((_sortedResultQuestion47 = sortedResultQuestions[5]) === null || _sortedResultQuestion47 === void 0 ? void 0 : _sortedResultQuestion47.questionText.slice(3, (_sortedResultQuestion48 = sortedResultQuestions[5]) === null || _sortedResultQuestion48 === void 0 ? void 0 : _sortedResultQuestion48.questionText.indexOf("</p>"))) || "";
28769
+ var resultQuestion7 = ((_sortedResultQuestion49 = sortedResultQuestions[6]) === null || _sortedResultQuestion49 === void 0 ? void 0 : _sortedResultQuestion49.questionText.slice(3, (_sortedResultQuestion50 = sortedResultQuestions[6]) === null || _sortedResultQuestion50 === void 0 ? void 0 : _sortedResultQuestion50.questionText.indexOf("</p>"))) || "";
28770
+ var resultQuestion8 = ((_sortedResultQuestion51 = sortedResultQuestions[7]) === null || _sortedResultQuestion51 === void 0 ? void 0 : _sortedResultQuestion51.questionText.slice(3, (_sortedResultQuestion52 = sortedResultQuestions[7]) === null || _sortedResultQuestion52 === void 0 ? void 0 : _sortedResultQuestion52.questionText.indexOf("</p>"))) || "";
28771
+ var resultQuestion9 = ((_sortedResultQuestion53 = sortedResultQuestions[8]) === null || _sortedResultQuestion53 === void 0 ? void 0 : _sortedResultQuestion53.questionText.slice(3, (_sortedResultQuestion54 = sortedResultQuestions[8]) === null || _sortedResultQuestion54 === void 0 ? void 0 : _sortedResultQuestion54.questionText.indexOf("</p>"))) || "";
28772
+ doc.setFont("Helvetica", "normal", "bold");
28773
+ doc.text(chartOneToOneData.overviewQuestionChoice[i].month, left, line + 20);
28774
+
28775
+ if (resultQuestion1 != "") {
28776
+ var _sortedResultQuestion55;
28777
+
28778
+ doc.setFont("Helvetica", "normal", "bold");
28779
+ doc.text(resultQuestion1, left + 10, line + 30);
28780
+ doc.setFont("Helvetica", "normal", "normal");
28781
+ doc.text(((_sortedResultQuestion55 = sortedResultQuestions[0]) === null || _sortedResultQuestion55 === void 0 ? void 0 : _sortedResultQuestion55.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion1 === null || resultQuestion1 === void 0 ? void 0 : resultQuestion1.length) * 3 + 17, line + 30);
28782
+ doc.setDrawColor(0);
28783
+ doc.setFillColor(64, 210, 204);
28784
+ doc.roundedRect(left, line + 25, 5, 5, 1, 1, "F");
28785
+ }
28786
+
28787
+ if (resultQuestion2 != "") {
28788
+ var _sortedResultQuestion56;
28789
+
28790
+ doc.setFont("Helvetica", "normal", "bold");
28791
+ doc.text(resultQuestion2, left + 10, line + 40);
28792
+ doc.setFont("Helvetica", "normal", "normal");
28793
+ doc.text(((_sortedResultQuestion56 = sortedResultQuestions[1]) === null || _sortedResultQuestion56 === void 0 ? void 0 : _sortedResultQuestion56.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion2 === null || resultQuestion2 === void 0 ? void 0 : resultQuestion2.length) * 3 + 17, line + 40);
28794
+ doc.setDrawColor(0);
28795
+ doc.setFillColor(120, 182, 226);
28796
+ doc.roundedRect(left, line + 35, 5, 5, 1, 1, "F");
28797
+ }
28798
+
28799
+ if (resultQuestion3 != "") {
28800
+ var _sortedResultQuestion57;
28801
+
28802
+ doc.setFont("Helvetica", "normal", "bold");
28803
+ doc.text(resultQuestion3, left + 10, line + 50);
28804
+ doc.setFont("Helvetica", "normal", "normal");
28805
+ doc.text(((_sortedResultQuestion57 = sortedResultQuestions[2]) === null || _sortedResultQuestion57 === void 0 ? void 0 : _sortedResultQuestion57.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion3 === null || resultQuestion3 === void 0 ? void 0 : resultQuestion3.length) * 3 + 17, line + 50);
28806
+ doc.setDrawColor(0);
28807
+ doc.setFillColor(255, 176, 79);
28808
+ doc.roundedRect(left, line + 45, 5, 5, 1, 1, "F");
28809
+ }
28810
+
28811
+ if (resultQuestion4 != "") {
28812
+ var _sortedResultQuestion58;
28813
+
28814
+ doc.setFont("Helvetica", "normal", "bold");
28815
+ doc.text(resultQuestion4, left + 10, line + 60);
28816
+ doc.setFont("Helvetica", "normal", "normal");
28817
+ doc.text(((_sortedResultQuestion58 = sortedResultQuestions[3]) === null || _sortedResultQuestion58 === void 0 ? void 0 : _sortedResultQuestion58.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion4 === null || resultQuestion4 === void 0 ? void 0 : resultQuestion4.length) * 3 + 17, line + 60);
28818
+ doc.setDrawColor(0);
28819
+ doc.setFillColor(206, 74, 73);
28820
+ doc.roundedRect(left, line + 55, 5, 5, 1, 1, "F");
28821
+ }
28822
+
28823
+ if (resultQuestion5 != "") {
28824
+ var _sortedResultQuestion59;
28825
+
28826
+ doc.setFont("Helvetica", "normal", "bold");
28827
+ doc.text(resultQuestion5, left + 10, line + 70);
28828
+ doc.setFont("Helvetica", "normal", "normal");
28829
+ doc.text(((_sortedResultQuestion59 = sortedResultQuestions[4]) === null || _sortedResultQuestion59 === void 0 ? void 0 : _sortedResultQuestion59.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion5 === null || resultQuestion5 === void 0 ? void 0 : resultQuestion5.length) * 3 + 17, line + 70);
28830
+ doc.setDrawColor(0);
28831
+ doc.setFillColor(27, 183, 177);
28832
+ doc.roundedRect(left, line + 65, 5, 5, 1, 1, "F");
28833
+ }
28834
+
28835
+ if (resultQuestion6 != "") {
28836
+ var _sortedResultQuestion60;
28837
+
28838
+ doc.setFont("Helvetica", "normal", "bold");
28839
+ doc.text(resultQuestion6, left + 10, line + 80);
28840
+ doc.setFont("Helvetica", "normal", "normal");
28841
+ doc.text(((_sortedResultQuestion60 = sortedResultQuestions[5]) === null || _sortedResultQuestion60 === void 0 ? void 0 : _sortedResultQuestion60.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion6 === null || resultQuestion6 === void 0 ? void 0 : resultQuestion6.length) * 3 + 17, line + 80);
28842
+ doc.setDrawColor(0);
28843
+ doc.setFillColor(75, 146, 206);
28844
+ doc.roundedRect(left, line + 75, 5, 5, 1, 1, "F");
28845
+ }
28846
+
28847
+ if (resultQuestion7 != "") {
28848
+ var _sortedResultQuestion61;
28849
+
28850
+ doc.setFont("Helvetica", "normal", "bold");
28851
+ doc.text(resultQuestion7, left + 10, line + 90);
28852
+ doc.setFont("Helvetica", "normal", "normal");
28853
+ doc.text(((_sortedResultQuestion61 = sortedResultQuestions[6]) === null || _sortedResultQuestion61 === void 0 ? void 0 : _sortedResultQuestion61.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion7 === null || resultQuestion7 === void 0 ? void 0 : resultQuestion7.length) * 3 + 17, line + 90);
28854
+ doc.setDrawColor(0);
28855
+ doc.setFillColor(240, 148, 34);
28856
+ doc.roundedRect(left, line + 85, 5, 5, 1, 1, "F");
28857
+ }
28858
+
28859
+ if (resultQuestion8 != "") {
28860
+ var _sortedResultQuestion62;
28861
+
28862
+ doc.setFont("Helvetica", "normal", "bold");
28863
+ doc.text(resultQuestion8, left + 10, line + 100);
28864
+ doc.setFont("Helvetica", "normal", "normal");
28865
+ doc.text(((_sortedResultQuestion62 = sortedResultQuestions[7]) === null || _sortedResultQuestion62 === void 0 ? void 0 : _sortedResultQuestion62.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion8 === null || resultQuestion8 === void 0 ? void 0 : resultQuestion8.length) * 3 + 17, line + 100);
28866
+ doc.setDrawColor(0);
28867
+ doc.setFillColor(162, 51, 51);
28868
+ doc.roundedRect(left, line + 95, 5, 5, 1, 1, "F");
28869
+ }
28870
+
28871
+ if (resultQuestion9 != "") {
28872
+ var _sortedResultQuestion63;
28873
+
28874
+ doc.setFont("Helvetica", "normal", "bold");
28875
+ doc.text(resultQuestion9, left + 10, line + 110);
28876
+ doc.setFont("Helvetica", "normal", "normal");
28877
+ doc.text(((_sortedResultQuestion63 = sortedResultQuestions[8]) === null || _sortedResultQuestion63 === void 0 ? void 0 : _sortedResultQuestion63.avgOfStudentChoice.toFixed(1)) + "%", left + (resultQuestion9 === null || resultQuestion9 === void 0 ? void 0 : resultQuestion9.length) * 3 + 17, line + 110);
28878
+ doc.setDrawColor(0);
28879
+ doc.setFillColor(11, 153, 148);
28880
+ doc.roundedRect(left, line + 105, 5, 5, 1, 1, "F");
28881
+ }
28882
+
28883
+ left = left + 100;
28884
+
28885
+ if (left + 80 > WIDTH_PAPER) {
28886
+ left = 20;
28887
+ line += 110;
28888
+ }
28889
+ }
28890
+ }
28891
+
28892
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 25, 420, 170);
28893
+ });
28894
+ });
28895
+ }
28896
+ }();
28897
+
28898
+ return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
28899
+ }
28900
+
28901
+ var _temp13 = function () {
28902
+ if (!!chartReadinessToLearn) {
28903
+ var _selectedToPDF7;
28904
+
28905
+ var line = 80;
28906
+ var left = 20;
28907
+ if (selectedToPDF.indexOf(chartReadinessToLearn) != 0 && ((_selectedToPDF7 = selectedToPDF[selectedToPDF.indexOf(chartReadinessToLearn) - 1]) === null || _selectedToPDF7 === void 0 ? void 0 : _selectedToPDF7.id) != null) doc.addPage();
28908
+ return Promise.resolve(createImageHeader()).then(function () {
28909
+ doc.setFontSize(14);
28910
+ doc.setFont("Helvetica", "normal", "bold");
28911
+ doc.text(chartReadinessToLearn.label, left, line);
28912
+ var chart = document.getElementById("readiness_to_learn");
28913
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28914
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 30, 420, 150);
28915
+ });
28916
+ });
28917
+ }
28918
+ }();
28919
+
28920
+ return _temp13 && _temp13.then ? _temp13.then(_temp14) : _temp14(_temp13);
28921
+ }
28922
+
28923
+ var doc = new jsPDF({
28924
+ orientation: "p",
28925
+ unit: "px",
28926
+ format: "a4"
28927
+ });
28928
+ var WIDTH_PAPER = doc.internal.pageSize.width;
28929
+
28930
+ var createImageHeader = function createImageHeader() {
28931
+ try {
28932
+ var imageLogo = document.getElementById("header-logo");
28933
+ return Promise.resolve(html2canvas(imageLogo)).then(function (imageLogoCanvas) {
28934
+ doc.addImage(imageLogoCanvas.toDataURL("image/png", 1.0), "png", 20, 20, 100, 30);
28935
+ });
28936
+ } catch (e) {
28937
+ return Promise.reject(e);
28938
+ }
28939
+ };
28940
+
28941
+ var line = 80;
28942
+ var left = 20;
28943
+
28944
+ var _temp15 = function () {
28945
+ if (!!chartHightImpactLearningStrategie) {
28946
+ var line = 80;
28947
+ var left = 20;
28948
+ if (selectedToPDF.indexOf(chartHightImpactLearningStrategie) != 0 && selectedToPDF[selectedToPDF.indexOf(chartHightImpactLearningStrategie) - 1].id != null) doc.addPage();
28949
+ return Promise.resolve(createImageHeader()).then(function () {
28950
+ doc.setFontSize(14);
28951
+ doc.setFont("Helvetica", "normal", "bold");
28952
+ doc.text(chartHightImpactLearningStrategie.label, left, line);
28953
+ var chart = document.getElementById("high_impact_learning_strategie");
28954
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
28955
+ doc.setFontSize(8);
28956
+
28957
+ for (var j = 0; j < ((_topLearningStrategie = topLearningStrategies.learningStrategies) === null || _topLearningStrategie === void 0 ? void 0 : _topLearningStrategie.length); j++) {
28958
+ var _topLearningStrategie, _topLearningStrategie2, _topLearningStrategie3;
28959
+
28960
+ var sumUsagePoint = topLearningStrategies.learningStrategies[j].usagePoint.reduce(function (partialSum, a) {
28961
+ return partialSum + a;
28962
+ }, 0);
28963
+ var avgSumUsagePoint = sumUsagePoint / ((_topLearningStrategie2 = topLearningStrategies.learningStrategies[j].usagePoint) === null || _topLearningStrategie2 === void 0 ? void 0 : _topLearningStrategie2.length) || 0;
28964
+
28965
+ if (topLearningStrategies.learningStrategies[j].usageCount != 0 || ((_topLearningStrategie3 = topLearningStrategies.learningStrategies[j].usagePoint) === null || _topLearningStrategie3 === void 0 ? void 0 : _topLearningStrategie3.length) > 0) {
28966
+ var _topLearningStrategie4, _topLearningStrategie5, _topLearningStrategie6, _topLearningStrategie7;
28967
+
28968
+ doc.setFont("Helvetica", "normal", "bold");
28969
+ doc.text(topLearningStrategies.learningStrategies[j].learningStrategyName, left, line + 20);
28970
+ doc.setFont("Helvetica", "normal", "normal");
28971
+ doc.text("Usage count: " + topLearningStrategies.learningStrategies[j].usageCount || "0", left, line + 30);
28972
+ doc.text("Usage point: " + avgSumUsagePoint, left, line + 40);
28973
+ left = left + (((_topLearningStrategie4 = topLearningStrategies.learningStrategies[j].learningStrategyName) === null || _topLearningStrategie4 === void 0 ? void 0 : _topLearningStrategie4.length) * 4 > 45 ? ((_topLearningStrategie5 = topLearningStrategies.learningStrategies[j].learningStrategyName) === null || _topLearningStrategie5 === void 0 ? void 0 : _topLearningStrategie5.length) * 4 : 60) + 15;
28974
+
28975
+ if (left + ((_topLearningStrategie6 = topLearningStrategies.learningStrategies[j + 1]) === null || _topLearningStrategie6 === void 0 ? void 0 : (_topLearningStrategie7 = _topLearningStrategie6.learningStrategyName) === null || _topLearningStrategie7 === void 0 ? void 0 : _topLearningStrategie7.length) * 5 + 15 > WIDTH_PAPER) {
28976
+ line += 40;
28977
+ left = 20;
28978
+ }
28979
+ }
28980
+ }
28981
+
28982
+ doc.addImage(canvas.toDataURL("image/png", 1.0), 15, line + 40, 420, 130);
28983
+ });
28984
+ });
28985
+ }
28986
+ }();
28987
+
28988
+ return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
28989
+ }, function () {
28990
+ dispatch(setAlert({
28991
+ type: "danger",
28992
+ message: "Can't print"
28993
+ }));
28994
+ });
28995
+
28996
+ return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
28997
+ } catch (e) {
28998
+ return Promise.reject(e);
28999
+ }
29000
+ };
29001
+
29002
+ return React.createElement("div", null, !!chartHightImpactLearningStrategie && React.createElement("div", {
29003
+ className: "" + styles$1["chart-to-canvas"]
29004
+ }, React.createElement("div", {
29005
+ id: chartHightImpactLearningStrategie.id
29006
+ }, chartHightImpactLearningStrategie.children())), !!chartReadinessToLearn && React.createElement("div", {
29007
+ className: "" + styles$1["chart-to-canvas"]
29008
+ }, React.createElement("div", {
29009
+ id: chartReadinessToLearn.id
29010
+ }, chartReadinessToLearn.children())), !!chartOneToOne && React.createElement("div", {
29011
+ className: "" + styles$1["chart-to-canvas"]
29012
+ }, React.createElement("div", {
29013
+ id: chartOneToOne.id
29014
+ }, chartOneToOne.children(typeChartList[initialData.map(function (i) {
29015
+ return i.id;
29016
+ }).indexOf(chartOneToOne === null || chartOneToOne === void 0 ? void 0 : chartOneToOne.id)]))), !!chartClassReflectionPDF && React.createElement("div", {
29017
+ className: "" + styles$1["chart-to-canvas"]
29018
+ }, React.createElement("div", {
29019
+ id: chartClassReflectionPDF.id
29020
+ }, chartClassReflectionPDF.children(typeChartList[initialData.map(function (i) {
29021
+ return i.id;
29022
+ }).indexOf(chartClassReflectionPDF === null || chartClassReflectionPDF === void 0 ? void 0 : chartClassReflectionPDF.id)]))), !!chartConferecePDF && React.createElement("div", {
29023
+ className: "" + styles$1["chart-to-canvas"]
29024
+ }, React.createElement("div", {
29025
+ id: chartConferecePDF.id
29026
+ }, chartConferecePDF.children(typeChartList[initialData.map(function (i) {
29027
+ return i.id;
29028
+ }).indexOf(chartConferecePDF === null || chartConferecePDF === void 0 ? void 0 : chartConferecePDF.id)]))), !!chartSafety && React.createElement("div", {
29029
+ className: "" + styles$1["chart-to-canvas"]
29030
+ }, React.createElement("div", {
29031
+ id: chartSafety.id
29032
+ }, chartSafety.children(typeChartList[initialData.map(function (i) {
29033
+ return i.id;
29034
+ }).indexOf(chartSafety === null || chartSafety === void 0 ? void 0 : chartSafety.id)]))), !!chartStudentByAge && React.createElement("div", {
29035
+ className: "" + styles$1["chart-to-canvas"]
29036
+ }, React.createElement("div", {
29037
+ id: chartStudentByAge.id
29038
+ }, chartStudentByAge.children(null, true))), !!chartStudentByGrade && React.createElement("div", {
29039
+ className: "" + styles$1["chart-to-canvas"]
29040
+ }, React.createElement("div", {
29041
+ id: chartStudentByGrade.id
29042
+ }, chartStudentByGrade.children())), React.createElement("div", {
29043
+ className: "" + styles$1["image-logo"],
29044
+ id: "header-logo"
29045
+ }, React.createElement("img", {
29046
+ src: headerLogo,
29047
+ alt: ""
29048
+ })), React.createElement(Button, {
29049
+ color: "success",
29050
+ onClick: function onClick() {
29051
+ selectedToPDF.length > 0 && generatePDF();
29052
+ }
29053
+ }, "Export"));
29054
+ };
29055
+
27732
29056
  var Dashboard = function Dashboard() {
27733
29057
  var _useChartDatas = useChartDatas(),
27734
29058
  chartDashBoards = _useChartDatas.chartDashBoards,
@@ -27737,17 +29061,69 @@ var Dashboard = function Dashboard() {
27737
29061
  LIST_FILTERS_LEFT = _useChartDatas.LIST_FILTERS_LEFT,
27738
29062
  LIST_FILTERS_RIGHT = _useChartDatas.LIST_FILTERS_RIGHT,
27739
29063
  totalCardData = _useChartDatas.totalCardData,
27740
- onChangeFilters = _useChartDatas.onChangeFilters;
29064
+ onChangeFilters = _useChartDatas.onChangeFilters,
29065
+ initialTypeChart = _useChartDatas.initialTypeChart;
27741
29066
 
27742
- var _useBehavior = useBehavior(),
29067
+ var _useBehavior = useBehavior(initialTypeChart),
27743
29068
  chartIsOpened = _useBehavior.chartIsOpened,
27744
29069
  _onToggle = _useBehavior.onToggle,
27745
29070
  _onChangeChart = _useBehavior.onChangeChart,
27746
- typeChartList = _useBehavior.typeChartList;
29071
+ typeChartList = _useBehavior.typeChartList,
29072
+ teacherUserId = _useBehavior.teacherUserId,
29073
+ changeCurrentTeacherUserId = _useBehavior.changeCurrentTeacherUserId;
29074
+
29075
+ var _useDashboard = useDashboard(),
29076
+ handleSelectToPrint = _useDashboard.handleSelectToPrint,
29077
+ checkSelectedItem = _useDashboard.checkSelectedItem,
29078
+ selectedToPrint = _useDashboard.selectedToPrint,
29079
+ setSelectedToPrint = _useDashboard.setSelectedToPrint;
29080
+
29081
+ var _useState = useState(false),
29082
+ modal = _useState[0],
29083
+ setModal = _useState[1];
29084
+
29085
+ var toggle = function toggle() {
29086
+ setSelectedToPrint([]);
29087
+ setModal(!modal);
29088
+ };
27747
29089
 
27748
29090
  return React.createElement("div", {
27749
29091
  className: "" + styles$1["block-dashboard"]
27750
- }, React.createElement("div", {
29092
+ }, React.createElement(Modal, {
29093
+ isOpen: modal,
29094
+ toggle: toggle,
29095
+ style: {
29096
+ overflow: "hidden"
29097
+ },
29098
+ centered: true
29099
+ }, React.createElement(ModalHeader, null, React.createElement("p", {
29100
+ className: "" + styles$1["title-modal"]
29101
+ }, "Export to PDF"), React.createElement("p", {
29102
+ className: "" + styles$1["header-desc-modal"]
29103
+ }, "The data is taken from the home screen."), React.createElement("p", {
29104
+ className: "" + styles$1["header-desc-modal"]
29105
+ }, "Make sure everything is set correctly before exporting.")), React.createElement(ModalBody, null, chartDashBoards === null || chartDashBoards === void 0 ? void 0 : chartDashBoards.map(function (item, index) {
29106
+ return React.createElement(FormGroup, {
29107
+ check: true,
29108
+ className: "" + styles$1["form-checkbox"]
29109
+ }, React.createElement(Input, {
29110
+ type: "checkbox",
29111
+ checked: checkSelectedItem(item.id),
29112
+ onChange: function onChange(event) {
29113
+ return handleSelectToPrint(event.target.checked, item, typeChartList[index]);
29114
+ }
29115
+ }), React.createElement(Label, {
29116
+ check: true,
29117
+ className: "" + styles$1["checkbox-content"]
29118
+ }, item.label));
29119
+ })), React.createElement(ModalFooter, null, React.createElement(Button, {
29120
+ color: "light",
29121
+ onClick: toggle
29122
+ }, "Cancel"), React.createElement(DashboardToPDF, {
29123
+ selectedToPDF: selectedToPrint,
29124
+ initialData: chartDashBoards,
29125
+ typeChartList: typeChartList
29126
+ }))), React.createElement("div", {
27751
29127
  className: "d-flex align-items-center justify-content-between"
27752
29128
  }, React.createElement("div", {
27753
29129
  className: "d-flex align-items-center mx-3"
@@ -27758,7 +29134,8 @@ var Dashboard = function Dashboard() {
27758
29134
  src: "images/waving-hand.png",
27759
29135
  alt: ""
27760
29136
  })), React.createElement("button", {
27761
- className: styles$1["button-export"] + " d-flex align-items-center border-0 p-0"
29137
+ className: styles$1["button-export"] + " d-flex align-items-center border-0 p-0",
29138
+ onClick: toggle
27762
29139
  }, React.createElement("div", {
27763
29140
  className: "" + styles$1["button-icon"]
27764
29141
  }, React.createElement("img", {
@@ -27789,7 +29166,13 @@ var Dashboard = function Dashboard() {
27789
29166
  filter: filter,
27790
29167
  studentId: e.studentId || 0,
27791
29168
  studentDefault: e.studentDefault,
27792
- onChangeFilters: onChangeFilters
29169
+ onChangeFilters: onChangeFilters,
29170
+ teacherUserId: teacherUserId,
29171
+ changeCurrentTeacherUserId: changeCurrentTeacherUserId,
29172
+ btnStyle: e.name === FILTER_NAME.StudentName ? {
29173
+ minWidth: 220,
29174
+ justifyContent: "center"
29175
+ } : {}
27793
29176
  });
27794
29177
  }))), React.createElement("div", {
27795
29178
  className: "d-flex align-items-center justify-content-between flex-wrap mb-3"
@@ -27816,7 +29199,8 @@ var Dashboard = function Dashboard() {
27816
29199
  onChangeChart: function onChangeChart(type) {
27817
29200
  return _onChangeChart(index, type);
27818
29201
  },
27819
- isOpen: chartIsOpened[index]
29202
+ isOpen: chartIsOpened[index],
29203
+ options: chartDashBoard.options
27820
29204
  }), React.createElement(Collapse, {
27821
29205
  isOpen: chartIsOpened[index]
27822
29206
  }, chartDashBoard.children(typeChartList[index])));