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