mario-education 2.4.171-level → 2.4.173-level

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -28429,9 +28429,9 @@ var INITIAl_STUDENT_DASHBOARD = {
28429
28429
  totalOneToOne: 0,
28430
28430
  totalTimeConference: 0,
28431
28431
  totalTimeOneToOne: 0,
28432
- totalCheckIn: 0
28432
+ totalCheckIn: 0,
28433
+ schoolName: ""
28433
28434
  };
28434
- var COLOR_CHART_AND_PERCENTS = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
28435
28435
  var COLOR_CHART_BUBBLE = ["#169490", "#316CD9", "#FFB04F", "#0F9655"];
28436
28436
  var PERCENT = [100, 80, 60, 40, 20, 0];
28437
28437
  var GENDER_OPTION = [{
@@ -29673,6 +29673,12 @@ var useChartDatas = function useChartDatas() {
29673
29673
  handleActiveColumnConference = _useDashboard.handleActiveColumnConference,
29674
29674
  activeColumnConference = _useDashboard.activeColumnConference;
29675
29675
 
29676
+ var schoolName = reactRedux.useSelector(function (state) {
29677
+ var _state$common, _state$common$user;
29678
+
29679
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.schoolName;
29680
+ });
29681
+
29676
29682
  var _useState = React.useState([]),
29677
29683
  selectedToPrint = _useState[0],
29678
29684
  setSelectedToPrint = _useState[1];
@@ -29871,7 +29877,8 @@ var useChartDatas = function useChartDatas() {
29871
29877
  avgQuestionLastMonth: avgQuestionLastMonth,
29872
29878
  studentPressure: studentPressure,
29873
29879
  dataOverallReadyToLearn: dataOverallReadyToLearn,
29874
- readinessToLearning: readinessToLearning
29880
+ readinessToLearning: readinessToLearning,
29881
+ schoolName: schoolName
29875
29882
  };
29876
29883
  };
29877
29884
 
@@ -30688,13 +30695,17 @@ var LineChart = function LineChart(_ref) {
30688
30695
  var OverallDonutChart = function OverallDonutChart(_ref) {
30689
30696
  var series = _ref.series,
30690
30697
  colors = _ref.colors,
30691
- label = _ref.label;
30698
+ label = _ref.label,
30699
+ _ref$width = _ref.width,
30700
+ width = _ref$width === void 0 ? "100%" : _ref$width,
30701
+ _ref$height = _ref.height,
30702
+ height = _ref$height === void 0 ? 250 : _ref$height;
30692
30703
  return React__default.createElement(Chart, {
30693
30704
  options: overallDonutCHartOptions(label, colors),
30694
30705
  series: series,
30695
30706
  type: "donut",
30696
- width: "100%",
30697
- height: 250
30707
+ width: width,
30708
+ height: height
30698
30709
  });
30699
30710
  };
30700
30711
 
@@ -30711,7 +30722,10 @@ var GenerateChartData = function GenerateChartData(_ref) {
30711
30722
  avgQuestionLastMonth = _ref.avgQuestionLastMonth,
30712
30723
  isShowExpandIcon = _ref.isShowExpandIcon,
30713
30724
  onExpand = _ref.onExpand,
30714
- timeOfDay = _ref.timeOfDay;
30725
+ timeOfDay = _ref.timeOfDay,
30726
+ isPrint = _ref.isPrint,
30727
+ width = _ref.width,
30728
+ height = _ref.height;
30715
30729
  var avgs = [];
30716
30730
 
30717
30731
  var _loop = function _loop(i) {
@@ -30748,7 +30762,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30748
30762
  return React__default.createElement("div", {
30749
30763
  key: name,
30750
30764
  className: "w-100 h-100 " + styles$1["column-chart-percent"]
30751
- }, React__default.createElement("div", {
30765
+ }, !isPrint && React__default.createElement("div", {
30752
30766
  className: "" + styles$1["header-chart-generate"]
30753
30767
  }, React__default.createElement("p", {
30754
30768
  className: "" + styles$1["title-chart-generate"]
@@ -30767,6 +30781,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30767
30781
  var isStressQuestion = item.name.toLocaleLowerCase().includes("stress");
30768
30782
  var classArrowUp = !isStressQuestion ? "arrow-up" : "arrow-down";
30769
30783
  var classArrowDown = !isStressQuestion ? "arrow-down" : "arrow-up";
30784
+ if (isPrint && !activeColumn[index]) return null;
30770
30785
  return React__default.createElement("div", {
30771
30786
  hidden: !item.name,
30772
30787
  className: "" + styles$1["item-checkbox"],
@@ -30820,7 +30835,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30820
30835
  className: "" + styles$1["month-text"]
30821
30836
  }, "vs last " + timeOfDay))));
30822
30837
  })), React__default.createElement("div", {
30823
- className: "w-100"
30838
+ className: "w-100 " + (isPrint && typeChart === TYPECHART.DONUT ? "d-flex justify-content-center" : "")
30824
30839
  }, typeChart === TYPECHART.AREA && React__default.createElement(AreaChart, {
30825
30840
  months: months,
30826
30841
  activeColumn: activeColumn,
@@ -30842,7 +30857,9 @@ var GenerateChartData = function GenerateChartData(_ref) {
30842
30857
  }), typeChart === TYPECHART.DONUT && React__default.createElement(OverallDonutChart, {
30843
30858
  series: seriesDonut,
30844
30859
  colors: colors,
30845
- label: label
30860
+ label: label,
30861
+ width: width,
30862
+ height: height
30846
30863
  })));
30847
30864
  };
30848
30865
 
@@ -30927,9 +30944,18 @@ var CustomArcLabel = function CustomArcLabel(_ref) {
30927
30944
  var TopLearningStrategy = function TopLearningStrategy(_ref2) {
30928
30945
  var _data$learningStrateg, _learningStrategies$f, _learningStrategies$f2;
30929
30946
 
30930
- var data = _ref2.data;
30947
+ var data = _ref2.data,
30948
+ learningStrategyId = _ref2.learningStrategyId,
30949
+ topLearningStrategyId = _ref2.topLearningStrategyId,
30950
+ width = _ref2.width,
30951
+ isPrint = _ref2.isPrint;
30931
30952
  if (!data) return React__default.createElement(Loading, null);
30932
30953
  var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
30954
+
30955
+ if (width) {
30956
+ screenWidth = width;
30957
+ }
30958
+
30933
30959
  var isMobileScreen = screenWidth < 576;
30934
30960
  var learningStrategies = (data === null || data === void 0 ? void 0 : (_data$learningStrateg = data.learningStrategies) === null || _data$learningStrateg === void 0 ? void 0 : _data$learningStrateg.sort(function (a, b) {
30935
30961
  return average(b.usagePoint) - average(a.usagePoint);
@@ -31038,8 +31064,8 @@ var TopLearningStrategy = function TopLearningStrategy(_ref2) {
31038
31064
  className: "h-100 w-100 " + styles$1["chart-background"] + " pl-4"
31039
31065
  }, React__default.createElement(reactstrap.Row, {
31040
31066
  className: "d-flex"
31041
- }, React__default.createElement(reactstrap.Col, {
31042
- md: 7
31067
+ }, (!isPrint || isPrint && learningStrategyId) && React__default.createElement(reactstrap.Col, {
31068
+ md: isPrint ? 12 : 7
31043
31069
  }, React__default.createElement("div", {
31044
31070
  className: "" + styles$1["block-header-chart"]
31045
31071
  }, React__default.createElement("div", {
@@ -31048,7 +31074,10 @@ var TopLearningStrategy = function TopLearningStrategy(_ref2) {
31048
31074
  className: "" + styles$1["title-chart"]
31049
31075
  }, t(topLearningStrategyName)), React__default.createElement("p", {
31050
31076
  className: "" + styles$1["description-chart"]
31051
- }, "The Effectiveness of Learning Strategies by Student's feedback"))), seriesLearningStrategy.some(function (i) {
31077
+ }, "The Effectiveness of Learning Strategies by Student's feedback"))), React__default.createElement("div", {
31078
+ className: "w-100 h-100",
31079
+ id: learningStrategyId
31080
+ }, seriesLearningStrategy.some(function (i) {
31052
31081
  return i.data;
31053
31082
  }) ? React__default.createElement("div", {
31054
31083
  style: {
@@ -31065,8 +31094,8 @@ var TopLearningStrategy = function TopLearningStrategy(_ref2) {
31065
31094
  src: "images/chart-top-learning.png"
31066
31095
  }), React__default.createElement("p", {
31067
31096
  className: "" + styles$1["name-chart"]
31068
- }, "Perceived Usefulness")), React__default.createElement(reactstrap.Col, {
31069
- md: 5,
31097
+ }, "Perceived Usefulness"))), (!isPrint || isPrint && topLearningStrategyId) && React__default.createElement(reactstrap.Col, {
31098
+ md: isPrint ? 12 : 5,
31070
31099
  className: "" + styles$1["box-top-5-most"]
31071
31100
  }, React__default.createElement("div", {
31072
31101
  className: "" + styles$1["block-header-chart"]
@@ -31076,7 +31105,10 @@ var TopLearningStrategy = function TopLearningStrategy(_ref2) {
31076
31105
  className: "" + styles$1["title-chart"]
31077
31106
  }, t(topMostUsedStrategiesName)), React__default.createElement("p", {
31078
31107
  className: "" + styles$1["description-chart"]
31079
- }, "How many times a strategy has been chosen"))), dataConvert.length > 0 ? React__default.createElement(pie.ResponsivePie, {
31108
+ }, "How many times a strategy has been chosen"))), React__default.createElement("div", {
31109
+ className: "w-100 h-100",
31110
+ id: topLearningStrategyId
31111
+ }, dataConvert.length > 0 ? React__default.createElement(pie.ResponsivePie, {
31080
31112
  data: dataConvert,
31081
31113
  margin: screenWidth > 550 ? largeMarginChart : smallMarginChart,
31082
31114
  innerRadius: 0.5,
@@ -31091,7 +31123,7 @@ var TopLearningStrategy = function TopLearningStrategy(_ref2) {
31091
31123
  style: {
31092
31124
  fontSize: "14px"
31093
31125
  }
31094
- }, t("no_data"))))));
31126
+ }, t("no_data")))))));
31095
31127
  };
31096
31128
 
31097
31129
  var propsAreEqual = function propsAreEqual(preProps, nextProps) {
@@ -31101,7 +31133,8 @@ var propsAreEqual = function propsAreEqual(preProps, nextProps) {
31101
31133
  var TopLearningStrategy$1 = React__default.memo(TopLearningStrategy, propsAreEqual);
31102
31134
 
31103
31135
  var BubbleChartCustom = function BubbleChartCustom(_ref) {
31104
- var data = _ref.data;
31136
+ var data = _ref.data,
31137
+ isPrint = _ref.isPrint;
31105
31138
 
31106
31139
  var _useTranslation = marioCore.useTranslation(),
31107
31140
  t = _useTranslation.t;
@@ -31115,7 +31148,7 @@ var BubbleChartCustom = function BubbleChartCustom(_ref) {
31115
31148
  var seriesName = seriesNameBubbleChartCustom(data);
31116
31149
  return React__default.createElement("div", {
31117
31150
  className: "" + styles$1["size-100"]
31118
- }, React__default.createElement("div", {
31151
+ }, !isPrint && React__default.createElement("div", {
31119
31152
  className: "" + styles$1["block-header-chart"]
31120
31153
  }, React__default.createElement("p", {
31121
31154
  className: styles$1["title-chart"] + " " + styles$1["ml-10"]
@@ -31439,299 +31472,431 @@ var DashboardToPDF = function DashboardToPDF(props) {
31439
31472
  dayOfWeekConference = props.dayOfWeekConference,
31440
31473
  avgConferenceLastMonth = props.avgConferenceLastMonth,
31441
31474
  readinessToLearning = props.readinessToLearning,
31442
- studentPressure = props.studentPressure;
31475
+ studentPressure = props.studentPressure,
31476
+ dataOverallReadyToLearn = props.dataOverallReadyToLearn,
31477
+ schoolName = props.schoolName;
31443
31478
 
31444
31479
  var _useTranslation = marioCore.useTranslation(),
31445
31480
  t = _useTranslation.t;
31446
31481
 
31447
31482
  var dispatch = reactRedux.useDispatch();
31448
31483
 
31484
+ var getWidthOfWord = function getWidthOfWord(character, fontSize, fontWeight) {
31485
+ var dummyElement = document.createElement("span");
31486
+ dummyElement.style.visibility = "hidden";
31487
+ dummyElement.style.position = "absolute";
31488
+ dummyElement.style.whiteSpace = "nowrap";
31489
+ dummyElement.style.fontSize = fontSize;
31490
+ dummyElement.style.fontWeight = fontWeight;
31491
+ dummyElement.innerHTML = character;
31492
+ document.body.appendChild(dummyElement);
31493
+ var width = dummyElement.offsetWidth;
31494
+ document.body.removeChild(dummyElement);
31495
+ return width;
31496
+ };
31497
+
31449
31498
  var generatePDF = function generatePDF() {
31450
31499
  try {
31451
- var _temp42 = function _temp42() {
31500
+ var _temp46 = function _temp46() {
31452
31501
  dispatch(marioCore.setLoading(false));
31453
31502
  };
31454
31503
 
31455
31504
  dispatch(marioCore.setLoading(true));
31456
31505
 
31457
- var _temp43 = _catch(function () {
31458
- function _temp39() {
31459
- function _temp37() {
31460
- function _temp35() {
31461
- function _temp33() {
31462
- function _temp31() {
31463
- function _temp29() {
31464
- function _temp27() {
31465
- function _temp25() {
31466
- doc.save("DashBoard.pdf");
31506
+ var _temp47 = _catch(function () {
31507
+ function _temp43() {
31508
+ function _temp41() {
31509
+ function _temp39() {
31510
+ function _temp37() {
31511
+ function _temp35() {
31512
+ function _temp33() {
31513
+ function _temp31() {
31514
+ function _temp29() {
31515
+ function _temp27() {
31516
+ doc.save("DashBoard.pdf");
31517
+ }
31518
+
31519
+ var _temp26 = function () {
31520
+ if (selectedToPDF.includes(topLearningStrategyName)) {
31521
+ return Promise.resolve(createImageHeader()).then(function () {
31522
+ doc.setFontSize(14);
31523
+ doc.setTextColor("#000");
31524
+ doc.setFont("Helvetica", "normal", "bold");
31525
+ doc.text(t(topLearningStrategyName), left, 70);
31526
+ doc.setFontSize(12);
31527
+ doc.setTextColor("#3D3D3D");
31528
+ doc.setFont("Helvetica", "normal", "normal");
31529
+ doc.text("The Effectiveness of Learning Strategies by Student's feedback", left, line + 4);
31530
+ var chart = document.getElementById(topLearningStrategyName);
31531
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31532
+ line += 12;
31533
+ left = 20;
31534
+ var chartWidth = 420;
31535
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31536
+ doc.addImage(canvas.toDataURL("image/png"), 10, line, chartWidth, chartHeight);
31537
+ doc.addPage();
31538
+ line = 80;
31539
+ left = 20;
31540
+ return Promise.resolve(createImageHeader()).then(function () {
31541
+ doc.setFontSize(14);
31542
+ doc.setFont("Helvetica", "normal", "bold");
31543
+ doc.setTextColor("#000");
31544
+ doc.text(t(topMostUsedStrategiesName), left, 70);
31545
+ doc.setFontSize(12);
31546
+ doc.setTextColor("#3D3D3D");
31547
+ doc.setFont("Helvetica", "normal", "normal");
31548
+ doc.text("How many times a strategy has been chosen", left, line + 4);
31549
+ var topChart = document.getElementById(topMostUsedStrategiesName);
31550
+ return Promise.resolve(html2canvas(topChart)).then(function (topCanvas) {
31551
+ doc.setFontSize(8);
31552
+ line += 16;
31553
+ var topChartWidth = 420;
31554
+ var topChartHeight = topChart && topChart.clientWidth ? topChartWidth * topChart.clientHeight / topChart.clientWidth : heightChart;
31555
+ doc.addImage(topCanvas.toDataURL("image/png"), 10, line + 20, topChartWidth, topChartHeight);
31556
+ });
31557
+ });
31558
+ });
31559
+ });
31560
+ }
31561
+ }();
31562
+
31563
+ return _temp26 && _temp26.then ? _temp26.then(_temp27) : _temp27(_temp26);
31467
31564
  }
31468
31565
 
31469
- var _temp24 = function () {
31470
- if (selectedToPDF.includes(topLearningStrategyName)) {
31471
- var chart = document.getElementById("learning_strategy");
31472
- return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31473
- doc.setFontSize(8);
31474
- left = 20;
31475
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, 450, 150);
31476
- doc.setFontSize(8);
31566
+ var _temp28 = function () {
31567
+ if (selectedToPDF.includes(learningProcessName)) {
31568
+ return Promise.resolve(createImageHeader()).then(function () {
31569
+ doc.setFontSize(14);
31570
+ doc.setFont("Helvetica", "normal", "bold");
31571
+ doc.text(t(learningProcessName), left, 70);
31572
+ line += 20;
31573
+ var chart = document.getElementById("learning_progress");
31574
+ return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31575
+ function _temp25() {
31576
+ function _temp23() {
31577
+ doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, chartWidth, chartHeight);
31578
+ chartCount++;
31579
+
31580
+ if (chartCount < selectedToPDF.length) {
31581
+ doc.addPage();
31582
+ line = 80;
31583
+ left = 20;
31584
+ }
31585
+ }
31586
+
31587
+ left = 20;
31588
+ line += questions.length * 10;
31589
+ var chartWidth = 420;
31590
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31591
+
31592
+ var _temp22 = function () {
31593
+ if (line + chartHeight + 20 > HEIGHT_PAPER) {
31594
+ doc.addPage();
31595
+ return Promise.resolve(createImageHeader()).then(function () {
31596
+ line = 80;
31597
+ left = 20;
31598
+ doc.setFontSize(14);
31599
+ doc.setFont("Helvetica", "normal", "bold");
31600
+ doc.text(t(learningProcessName), left, line);
31601
+ line += 10;
31602
+ });
31603
+ }
31604
+ }();
31605
+
31606
+ return _temp22 && _temp22.then ? _temp22.then(_temp23) : _temp23(_temp22);
31607
+ }
31608
+
31609
+ var lineOptionPrecess = line;
31610
+ doc.setFontSize(8);
31611
+ var questions = seriesConference.map(function (r) {
31612
+ return r.name;
31613
+ });
31614
+ var COLORS = ["#73C8E5", "#F9F871", "#D7B0DE", "#E56362", "#5A7F05", "#D3D3D3"];
31615
+
31616
+ var _temp24 = function () {
31617
+ if (seriesConference !== null && seriesConference !== void 0 && seriesConference.length) {
31618
+ return _forTo(monthsConference, function (index) {
31619
+ var _line = line;
31620
+ doc.setFontSize(12);
31621
+ doc.setFont("Helvetica", "normal", "bold");
31622
+ doc.text(monthsConference[index], left, _line);
31623
+ doc.setFontSize(8);
31624
+
31625
+ for (var indexResult = 0; indexResult < (seriesConference === null || seriesConference === void 0 ? void 0 : seriesConference.length); indexResult++) {
31626
+ var avg = seriesConference[indexResult].data[index];
31627
+
31628
+ if (avg != 0) {
31629
+ var questionText = questions[indexResult];
31630
+
31631
+ if (questionText != "") {
31632
+ doc.setDrawColor(0);
31633
+ doc.setFillColor(COLORS[indexResult]);
31634
+ doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31635
+ doc.setFont("Helvetica", "normal", "bold");
31636
+ doc.text(questionText + ":", left + 8, _line + 10);
31637
+ doc.setFont("Helvetica", "normal", "normal");
31638
+ doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31639
+ }
31640
+
31641
+ _line += 10;
31642
+
31643
+ if (_line > lineOptionPrecess) {
31644
+ lineOptionPrecess = _line;
31645
+ }
31646
+ }
31647
+ }
31648
+
31649
+ left += 100;
31650
+
31651
+ if (left + 105 > WIDTH_PAPER) {
31652
+ left = 20;
31653
+ line = lineOptionPrecess + 20;
31654
+ }
31655
+
31656
+ var _temp21 = function () {
31657
+ if (line + 150 > HEIGHT_PAPER) {
31658
+ doc.addPage();
31659
+ return Promise.resolve(createImageHeader()).then(function () {
31660
+ line = 80;
31661
+ left = 20;
31662
+ });
31663
+ }
31664
+ }();
31665
+
31666
+ if (_temp21 && _temp21.then) return _temp21.then(function () {});
31667
+ });
31668
+ }
31669
+ }();
31670
+
31671
+ return _temp24 && _temp24.then ? _temp24.then(_temp25) : _temp25(_temp24);
31672
+ });
31477
31673
  });
31478
31674
  }
31479
31675
  }();
31480
31676
 
31481
- return _temp24 && _temp24.then ? _temp24.then(_temp25) : _temp25(_temp24);
31677
+ return _temp28 && _temp28.then ? _temp28.then(_temp29) : _temp29(_temp28);
31482
31678
  }
31483
31679
 
31484
- var _temp26 = function () {
31485
- if (selectedToPDF.includes(learningProcessName)) {
31486
- var _temp44 = function _temp44() {
31680
+ var _temp30 = function () {
31681
+ if (selectedToPDF.includes(successIndicatorsName)) {
31682
+ return Promise.resolve(createImageHeader()).then(function () {
31487
31683
  doc.setFontSize(14);
31488
31684
  doc.setFont("Helvetica", "normal", "bold");
31489
- doc.text(t(learningProcessName), left, line);
31490
- line += 20;
31491
- var chart = document.getElementById("learning_progress");
31685
+ doc.text(t(successIndicatorsName), left, line);
31686
+ line += 40;
31687
+ var chart = document.getElementById("success_indicators");
31492
31688
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31493
- function _temp21() {
31494
- left = 20;
31495
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 70, 420, heightChart);
31496
- doc.setFontSize(8);
31497
- doc.addPage();
31498
- line = 80;
31499
- left = 20;
31500
- }
31689
+ function _temp20() {
31690
+ function _temp18() {
31691
+ doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, chartWidth, chartHeight);
31692
+ chartCount++;
31501
31693
 
31502
- var lineOptionPrecess = line;
31503
- doc.setFontSize(8);
31504
- var questions = seriesConference.map(function (r) {
31505
- return r.name;
31506
- });
31507
-
31508
- var _temp20 = _forTo(monthsConference, function (index) {
31509
- var _line = line;
31510
- doc.setFontSize(12);
31511
- doc.setFont("Helvetica", "normal", "bold");
31512
- doc.text(monthsConference[index], left, _line);
31513
- doc.setFontSize(8);
31514
-
31515
- for (var indexResult = 0; indexResult < (seriesConference === null || seriesConference === void 0 ? void 0 : seriesConference.length); indexResult++) {
31516
- var avg = seriesConference[indexResult].data[index];
31517
-
31518
- if (avg != 0) {
31519
- var questionText = questions[indexResult];
31520
-
31521
- if (questionText != "") {
31522
- doc.setDrawColor(0);
31523
- doc.setFillColor(COLOR_CHART_AND_PERCENTS[indexResult]);
31524
- doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31525
- doc.setFont("Helvetica", "normal", "bold");
31526
- doc.text(questionText + ":", left + 8, _line + 10);
31527
- doc.setFont("Helvetica", "normal", "normal");
31528
- doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31529
- }
31530
-
31531
- _line += 10;
31532
-
31533
- if (_line > lineOptionPrecess) {
31534
- lineOptionPrecess = _line;
31535
- }
31694
+ if (chartCount < selectedToPDF.length) {
31695
+ doc.addPage();
31696
+ line = 80;
31697
+ left = 20;
31536
31698
  }
31537
31699
  }
31538
31700
 
31539
- left += 100;
31540
-
31541
- if (left + 105 > WIDTH_PAPER) {
31542
- left = 20;
31543
- line = lineOptionPrecess + 25;
31544
- }
31701
+ left = 20;
31702
+ line += questions.length * 10;
31703
+ var chartWidth = 420;
31704
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31545
31705
 
31546
- var _temp19 = function () {
31547
- if (line + 150 > HEIGHT_PAPER) {
31706
+ var _temp17 = function () {
31707
+ if (line + chartHeight + 20 > HEIGHT_PAPER) {
31548
31708
  doc.addPage();
31549
31709
  return Promise.resolve(createImageHeader()).then(function () {
31550
31710
  line = 80;
31551
31711
  left = 20;
31712
+ doc.setFontSize(14);
31713
+ doc.setFont("Helvetica", "normal", "bold");
31714
+ doc.text(t(successIndicatorsName), left, line);
31715
+ line += 10;
31552
31716
  });
31553
31717
  }
31554
31718
  }();
31555
31719
 
31556
- if (_temp19 && _temp19.then) return _temp19.then(function () {});
31720
+ return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
31721
+ }
31722
+
31723
+ var lineOptionCheckIn = line;
31724
+ doc.setFontSize(8);
31725
+ var questions = successIndicatorsData.map(function (r) {
31726
+ return r.name;
31557
31727
  });
31728
+ var COLORS = ["#73C8E5", "#FFB04F", "#D7B0DE", "#E56362", "#5A7F05", "#D3D3D3"];
31729
+
31730
+ var _temp19 = function () {
31731
+ if (successIndicatorsData !== null && successIndicatorsData !== void 0 && successIndicatorsData.length) {
31732
+ return _forTo(monthsOneToOne, function (indexCheckIn) {
31733
+ var _line = line;
31734
+ doc.setFontSize(12);
31735
+ doc.setFont("Helvetica", "normal", "bold");
31736
+ doc.text(monthsOneToOne[indexCheckIn], left, _line);
31737
+ doc.setFontSize(8);
31738
+
31739
+ for (var indexResult = 0; indexResult < (successIndicatorsData === null || successIndicatorsData === void 0 ? void 0 : successIndicatorsData.length); indexResult++) {
31740
+ var avg = successIndicatorsData[indexResult].data[indexCheckIn];
31741
+
31742
+ if (avg != 0) {
31743
+ var questionText = questions[indexResult];
31744
+
31745
+ if (questionText != "") {
31746
+ doc.setDrawColor(0);
31747
+ doc.setFillColor(COLORS[indexResult]);
31748
+ doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31749
+ doc.setFont("Helvetica", "normal", "bold");
31750
+ doc.text(questionText + ":", left + 8, _line + 10);
31751
+ doc.setFont("Helvetica", "normal", "normal");
31752
+ doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31753
+ }
31754
+
31755
+ _line += 10;
31756
+
31757
+ if (_line > lineOptionCheckIn) {
31758
+ lineOptionCheckIn = _line;
31759
+ }
31760
+ }
31761
+ }
31558
31762
 
31559
- return _temp20 && _temp20.then ? _temp20.then(_temp21) : _temp21(_temp20);
31560
- });
31561
- };
31763
+ left += 100;
31562
31764
 
31563
- var _temp45 = function () {
31564
- if (line > HEIGHT_PAPER / 2) {
31565
- line = 80;
31566
- left = 20;
31567
- doc.addPage();
31568
- return Promise.resolve(createImageHeader()).then(function () {});
31569
- }
31570
- }();
31765
+ if (left + 105 > WIDTH_PAPER) {
31766
+ left = 20;
31767
+ line = lineOptionCheckIn + 20;
31768
+ }
31769
+
31770
+ var _temp16 = function () {
31771
+ if (line + 150 > HEIGHT_PAPER) {
31772
+ doc.addPage();
31773
+ return Promise.resolve(createImageHeader()).then(function () {
31774
+ line = 80;
31775
+ left = 20;
31776
+ });
31777
+ }
31778
+ }();
31779
+
31780
+ if (_temp16 && _temp16.then) return _temp16.then(function () {});
31781
+ });
31782
+ }
31783
+ }();
31571
31784
 
31572
- return _temp45 && _temp45.then ? _temp45.then(_temp44) : _temp44(_temp45);
31785
+ return _temp19 && _temp19.then ? _temp19.then(_temp20) : _temp20(_temp19);
31786
+ });
31787
+ });
31573
31788
  }
31574
31789
  }();
31575
31790
 
31576
- return _temp26 && _temp26.then ? _temp26.then(_temp27) : _temp27(_temp26);
31791
+ return _temp30 && _temp30.then ? _temp30.then(_temp31) : _temp31(_temp30);
31577
31792
  }
31578
31793
 
31579
- var _temp28 = function () {
31794
+ var _temp32 = function () {
31580
31795
  if (selectedToPDF.includes(studentStressByZone)) {
31581
- var _temp46 = function _temp46() {
31796
+ var _temp48 = function _temp48() {
31582
31797
  doc.setFontSize(14);
31583
31798
  doc.setFont("Helvetica", "normal", "bold");
31584
- doc.text(t(studentStressByZone), left, line);
31799
+ doc.text(t(studentStressByZone), left, line <= 85 ? 70 : line);
31585
31800
  line += 20;
31586
31801
  var chart = document.getElementById("student_stress_by_zone");
31587
31802
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31588
- doc.addImage(canvas.toDataURL("image/png"), 10, line, 420, heightChart);
31589
- line += heightChart + 20;
31803
+ var chartWidth = 460;
31804
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31805
+ doc.addImage(canvas.toDataURL("image/png"), 10, line, chartWidth, chartHeight);
31806
+ chartCount++;
31807
+
31808
+ if (chartCount < selectedToPDF.length) {
31809
+ doc.addPage();
31810
+ line = 80;
31811
+ left = 20;
31812
+ }
31590
31813
  });
31591
31814
  };
31592
31815
 
31593
- var _temp47 = function () {
31594
- if (line > HEIGHT_PAPER / 2) {
31595
- line = 80;
31596
- left = 20;
31597
- doc.addPage();
31816
+ if (line > HEIGHT_PAPER / 2) {
31817
+ line = 80;
31818
+ left = 20;
31819
+ doc.addPage();
31820
+ }
31821
+
31822
+ var _temp49 = function () {
31823
+ if (line <= 85) {
31598
31824
  return Promise.resolve(createImageHeader()).then(function () {});
31599
31825
  }
31600
31826
  }();
31601
31827
 
31602
- return _temp47 && _temp47.then ? _temp47.then(_temp46) : _temp46(_temp47);
31828
+ return _temp49 && _temp49.then ? _temp49.then(_temp48) : _temp48(_temp49);
31603
31829
  }
31604
31830
  }();
31605
31831
 
31606
- return _temp28 && _temp28.then ? _temp28.then(_temp29) : _temp29(_temp28);
31832
+ return _temp32 && _temp32.then ? _temp32.then(_temp33) : _temp33(_temp32);
31607
31833
  }
31608
31834
 
31609
- var _temp30 = function () {
31835
+ var _temp34 = function () {
31610
31836
  if (selectedToPDF.includes(studentDistribution)) {
31611
- var _temp48 = function _temp48() {
31612
- var chart = document.getElementById("student_distribution");
31837
+ var _temp50 = function _temp50() {
31838
+ doc.setFontSize(14);
31839
+ doc.setFont("Helvetica", "normal", "bold");
31840
+ doc.text(t(studentDistribution), left, line <= 85 ? 70 : line);
31841
+ var chart = document.getElementById(studentDistribution);
31613
31842
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31614
- doc.addImage(canvas.toDataURL("image/png"), 10, line, 420, heightChart);
31615
- line += heightChart + 20;
31843
+ var chartWidth = 420;
31844
+ line += 20;
31845
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31846
+ doc.addImage(canvas.toDataURL("image/png"), 10, line, chartWidth, chartHeight);
31847
+ chartCount++;
31848
+ line += heightChart;
31849
+
31850
+ if (chartCount < selectedToPDF.length && !selectedToPDF.includes(studentStressByZone)) {
31851
+ doc.addPage();
31852
+ line = 80;
31853
+ left = 20;
31854
+ }
31616
31855
  });
31617
31856
  };
31618
31857
 
31619
- var _temp49 = function () {
31620
- if (line > HEIGHT_PAPER / 2) {
31621
- line = 80;
31622
- left = 20;
31623
- doc.addPage();
31858
+ if (line > HEIGHT_PAPER / 2) {
31859
+ line = 80;
31860
+ left = 20;
31861
+ doc.addPage();
31862
+ }
31863
+
31864
+ var _temp51 = function () {
31865
+ if (line <= 85) {
31624
31866
  return Promise.resolve(createImageHeader()).then(function () {});
31625
31867
  }
31626
31868
  }();
31627
31869
 
31628
- return _temp49 && _temp49.then ? _temp49.then(_temp48) : _temp48(_temp49);
31870
+ return _temp51 && _temp51.then ? _temp51.then(_temp50) : _temp50(_temp51);
31629
31871
  }
31630
31872
  }();
31631
31873
 
31632
- return _temp30 && _temp30.then ? _temp30.then(_temp31) : _temp31(_temp30);
31874
+ return _temp34 && _temp34.then ? _temp34.then(_temp35) : _temp35(_temp34);
31633
31875
  }
31634
31876
 
31635
- var _temp32 = function () {
31636
- if (selectedToPDF.includes(successIndicatorsName)) {
31637
- var _temp50 = function _temp50() {
31877
+ var _temp36 = function () {
31878
+ if (selectedToPDF.includes(overallReadinessToLearn)) {
31879
+ return Promise.resolve(createImageHeader()).then(function () {
31638
31880
  doc.setFontSize(14);
31639
31881
  doc.setFont("Helvetica", "normal", "bold");
31640
- doc.text(t(successIndicatorsName), left, line);
31641
- line += 20;
31642
- var chart = document.getElementById("success_indicators");
31882
+ doc.text(t(overallReadinessToLearn), left, 70);
31883
+ var chart = document.getElementById(overallReadinessToLearn);
31643
31884
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31644
- function _temp12() {
31645
- left = 20;
31646
- line += questions.length * 10;
31647
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, 420, heightChart);
31648
- doc.setFontSize(8);
31649
- line += heightChart + 20;
31650
- }
31651
-
31652
- var lineOptionCheckIn = line;
31653
- doc.setFontSize(8);
31654
- var questions = successIndicatorsData.map(function (r) {
31655
- return r.name;
31656
- });
31657
- var indexCheckIn = 0;
31658
-
31659
- var _temp11 = _for(function () {
31660
- return indexCheckIn < monthsOneToOne.length;
31661
- }, function () {
31662
- return indexCheckIn++;
31663
- }, function () {
31664
- var _line = line;
31665
- doc.setFontSize(12);
31666
- doc.setFont("Helvetica", "normal", "bold");
31667
- doc.text(monthsOneToOne[indexCheckIn], left, _line);
31668
- doc.setFontSize(8);
31669
-
31670
- for (var indexResult = 0; indexResult < (successIndicatorsData === null || successIndicatorsData === void 0 ? void 0 : successIndicatorsData.length); indexResult++) {
31671
- var avg = successIndicatorsData[indexResult].data[indexCheckIn];
31672
-
31673
- if (avg != 0) {
31674
- var questionText = questions[indexResult];
31675
-
31676
- if (questionText != "") {
31677
- doc.setDrawColor(0);
31678
- doc.setFillColor(COLOR_CHART_AND_PERCENTS[indexResult]);
31679
- doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31680
- doc.setFont("Helvetica", "normal", "bold");
31681
- doc.text(questionText + ":", left + 8, _line + 10);
31682
- doc.setFont("Helvetica", "normal", "normal");
31683
- doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31684
- }
31685
-
31686
- _line += 10;
31687
-
31688
- if (_line > lineOptionCheckIn) {
31689
- lineOptionCheckIn = _line;
31690
- }
31691
- }
31692
- }
31693
-
31694
- left += 100;
31695
-
31696
- if (left + 105 > WIDTH_PAPER) {
31697
- left = 20;
31698
- line = lineOptionCheckIn + 25;
31699
- }
31700
-
31701
- var _temp10 = function () {
31702
- if (line + 150 > HEIGHT_PAPER) {
31703
- doc.addPage();
31704
- return Promise.resolve(createImageHeader()).then(function () {
31705
- line = 80;
31706
- left = 20;
31707
- });
31708
- }
31709
- }();
31710
-
31711
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
31712
- });
31713
-
31714
- return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
31715
- });
31716
- };
31717
-
31718
- var _temp51 = function () {
31719
- if (line > HEIGHT_PAPER / 2) {
31720
- line = 80;
31721
31885
  left = 20;
31722
- doc.addPage();
31723
- return Promise.resolve(createImageHeader()).then(function () {});
31724
- }
31725
- }();
31726
-
31727
- return _temp51 && _temp51.then ? _temp51.then(_temp50) : _temp50(_temp51);
31886
+ var chartWidth = 420;
31887
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31888
+ doc.addImage(canvas.toDataURL("image/png"), 10, line, chartWidth, chartHeight);
31889
+ chartCount++;
31890
+ line += heightChart + 20;
31891
+ });
31892
+ });
31728
31893
  }
31729
31894
  }();
31730
31895
 
31731
- return _temp32 && _temp32.then ? _temp32.then(_temp33) : _temp33(_temp32);
31896
+ return _temp36 && _temp36.then ? _temp36.then(_temp37) : _temp37(_temp36);
31732
31897
  }
31733
31898
 
31734
- var _temp34 = function () {
31899
+ var _temp38 = function () {
31735
31900
  if (selectedToPDF.includes(preparednessChartName)) {
31736
31901
  return Promise.resolve(createImageHeader()).then(function () {
31737
31902
  doc.setFontSize(14);
@@ -31740,86 +31905,113 @@ var DashboardToPDF = function DashboardToPDF(props) {
31740
31905
  line += 20;
31741
31906
  var chart = document.getElementById("preparedness");
31742
31907
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31743
- function _temp9() {
31908
+ function _temp11() {
31909
+ function _temp9() {
31910
+ doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, chartWidth, chartHeight);
31911
+ chartCount++;
31912
+
31913
+ if (chartCount < selectedToPDF.length) {
31914
+ doc.addPage();
31915
+ line = 80;
31916
+ left = 20;
31917
+ }
31918
+ }
31919
+
31744
31920
  left = 20;
31745
31921
  line += questions.length * 10;
31746
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, 420, heightChart);
31747
- doc.setFontSize(8);
31748
- line += heightChart + 20;
31922
+ var chartWidth = 420;
31923
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
31924
+
31925
+ var _temp8 = function () {
31926
+ if (line + chartHeight + 20 > HEIGHT_PAPER) {
31927
+ doc.addPage();
31928
+ return Promise.resolve(createImageHeader()).then(function () {
31929
+ line = 80;
31930
+ left = 20;
31931
+ doc.setFontSize(14);
31932
+ doc.setFont("Helvetica", "normal", "bold");
31933
+ doc.text("Readiness To Learn", left, line);
31934
+ line += 10;
31935
+ });
31936
+ }
31937
+ }();
31938
+
31939
+ return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
31749
31940
  }
31750
31941
 
31942
+ line += 20;
31751
31943
  var lineOptionCheckIn = line;
31752
31944
  doc.setFontSize(8);
31753
31945
  var questions = preparednessData.map(function (r) {
31754
31946
  return r.name;
31755
31947
  });
31756
- var indexCheckIn = 0;
31757
-
31758
- var _temp8 = _for(function () {
31759
- return indexCheckIn < monthsOneToOne.length;
31760
- }, function () {
31761
- return indexCheckIn++;
31762
- }, function () {
31763
- var _line = line;
31764
- doc.setFontSize(12);
31765
- doc.setFont("Helvetica", "normal", "bold");
31766
- doc.text(monthsOneToOne[indexCheckIn], left, _line);
31767
- doc.setFontSize(8);
31768
31948
 
31769
- for (var indexResult = 0; indexResult < (preparednessData === null || preparednessData === void 0 ? void 0 : preparednessData.length); indexResult++) {
31770
- var avg = preparednessData[indexResult].data[indexCheckIn];
31949
+ var _temp10 = function () {
31950
+ if (preparednessData !== null && preparednessData !== void 0 && preparednessData.length) {
31951
+ return _forTo(monthsOneToOne, function (indexCheckIn) {
31952
+ var _line = line;
31953
+ doc.setFontSize(12);
31954
+ doc.setFont("Helvetica", "normal", "bold");
31955
+ doc.text(monthsOneToOne[indexCheckIn], left, _line);
31956
+ doc.setFontSize(8);
31957
+ var COLORS = ["#169490", "#316CD9", "#FFB04F"];
31958
+
31959
+ for (var indexResult = 0; indexResult < (preparednessData === null || preparednessData === void 0 ? void 0 : preparednessData.length); indexResult++) {
31960
+ var avg = preparednessData[indexResult].data[indexCheckIn];
31961
+
31962
+ if (avg != 0) {
31963
+ var questionText = questions[indexResult];
31964
+
31965
+ if (questionText != "") {
31966
+ doc.setDrawColor(0);
31967
+ doc.setFillColor(COLORS[indexResult]);
31968
+ doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31969
+ doc.setFont("Helvetica", "normal", "bold");
31970
+ doc.text(questionText + ":", left + 8, _line + 10);
31971
+ doc.setFont("Helvetica", "normal", "normal");
31972
+ doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31973
+ }
31771
31974
 
31772
- if (avg != 0) {
31773
- var questionText = questions[indexResult];
31975
+ _line += 10;
31774
31976
 
31775
- if (questionText != "") {
31776
- doc.setDrawColor(0);
31777
- doc.setFillColor(COLOR_CHART_AND_PERCENTS[indexResult]);
31778
- doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31779
- doc.setFont("Helvetica", "normal", "bold");
31780
- doc.text(questionText + ":", left + 8, _line + 10);
31781
- doc.setFont("Helvetica", "normal", "normal");
31782
- doc.text((avg === null || avg === void 0 ? void 0 : avg.toFixed(2)) + "%", left + (questionText === null || questionText === void 0 ? void 0 : questionText.length) * 2.5 + 20.5, _line + 10);
31977
+ if (_line > lineOptionCheckIn) {
31978
+ lineOptionCheckIn = _line;
31979
+ }
31980
+ }
31783
31981
  }
31784
31982
 
31785
- _line += 10;
31983
+ left += 100;
31786
31984
 
31787
- if (_line > lineOptionCheckIn) {
31788
- lineOptionCheckIn = _line;
31985
+ if (left + 105 > WIDTH_PAPER) {
31986
+ left = 20;
31987
+ line = lineOptionCheckIn + 20;
31789
31988
  }
31790
- }
31791
- }
31792
31989
 
31793
- left += 100;
31990
+ var _temp7 = function () {
31991
+ if (line + 150 > HEIGHT_PAPER) {
31992
+ doc.addPage();
31993
+ return Promise.resolve(createImageHeader()).then(function () {
31994
+ line = 80;
31995
+ left = 20;
31996
+ });
31997
+ }
31998
+ }();
31794
31999
 
31795
- if (left + 105 > WIDTH_PAPER) {
31796
- left = 20;
31797
- line = lineOptionCheckIn + 25;
32000
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
32001
+ });
31798
32002
  }
32003
+ }();
31799
32004
 
31800
- var _temp7 = function () {
31801
- if (line + 150 > HEIGHT_PAPER) {
31802
- doc.addPage();
31803
- return Promise.resolve(createImageHeader()).then(function () {
31804
- line = 80;
31805
- left = 20;
31806
- });
31807
- }
31808
- }();
31809
-
31810
- if (_temp7 && _temp7.then) return _temp7.then(function () {});
31811
- });
31812
-
31813
- return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
32005
+ return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
31814
32006
  });
31815
32007
  });
31816
32008
  }
31817
32009
  }();
31818
32010
 
31819
- return _temp34 && _temp34.then ? _temp34.then(_temp35) : _temp35(_temp34);
32011
+ return _temp38 && _temp38.then ? _temp38.then(_temp39) : _temp39(_temp38);
31820
32012
  }
31821
32013
 
31822
- var _temp36 = function () {
32014
+ var _temp40 = function () {
31823
32015
  if (selectedToPDF.includes(averageStudentStressName)) {
31824
32016
  return Promise.resolve(createImageHeader()).then(function () {
31825
32017
  doc.setFontSize(14);
@@ -31830,13 +32022,19 @@ var DashboardToPDF = function DashboardToPDF(props) {
31830
32022
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31831
32023
  function _temp6() {
31832
32024
  left = 20;
31833
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, 420, heightChart);
31834
- doc.setFontSize(8);
31835
- doc.addPage();
31836
- line = 80;
31837
- left = 20;
32025
+ var chartWidth = 420;
32026
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
32027
+ doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, chartWidth, chartHeight);
32028
+ chartCount++;
32029
+
32030
+ if (chartCount < selectedToPDF.length) {
32031
+ doc.addPage();
32032
+ line = 80;
32033
+ left = 20;
32034
+ }
31838
32035
  }
31839
32036
 
32037
+ line += 20;
31840
32038
  var lineOptionCheckIn = line;
31841
32039
  doc.setFontSize(8);
31842
32040
  var questions = stressData.map(function (r) {
@@ -31863,7 +32061,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
31863
32061
 
31864
32062
  if (questionText != "") {
31865
32063
  doc.setDrawColor(0);
31866
- doc.setFillColor(COLOR_CHART_AND_PERCENTS[indexResult]);
32064
+ doc.setFillColor("#C44140");
31867
32065
  doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31868
32066
  doc.setFont("Helvetica", "normal", "bold");
31869
32067
  doc.text(questionText + ":", left + 8, _line + 10);
@@ -31883,7 +32081,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
31883
32081
 
31884
32082
  if (left + 105 > WIDTH_PAPER) {
31885
32083
  left = 20;
31886
- line = lineOptionCheckIn + 25;
32084
+ line = lineOptionCheckIn + 20;
31887
32085
  }
31888
32086
 
31889
32087
  var _temp4 = function () {
@@ -31905,7 +32103,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
31905
32103
  }
31906
32104
  }();
31907
32105
 
31908
- return _temp36 && _temp36.then ? _temp36.then(_temp37) : _temp37(_temp36);
32106
+ return _temp40 && _temp40.then ? _temp40.then(_temp41) : _temp41(_temp40);
31909
32107
  }
31910
32108
 
31911
32109
  var doc = new jsPDF({
@@ -31916,12 +32114,18 @@ var DashboardToPDF = function DashboardToPDF(props) {
31916
32114
  var WIDTH_PAPER = doc.internal.pageSize.width;
31917
32115
  var HEIGHT_PAPER = doc.internal.pageSize.height;
31918
32116
  var heightChart = 200;
32117
+ var splitShoolName = doc.splitTextToSize(schoolName, 120);
32118
+ var chartCount = 0;
32119
+ var schoolWidth = schoolName.length <= 18 ? getWidthOfWord(schoolName, "18px", "bold") : getWidthOfWord(splitShoolName.join(""), "18px", "bold");
31919
32120
 
31920
32121
  var createImageHeader = function createImageHeader() {
31921
32122
  try {
31922
32123
  var imageLogo = document.getElementById("header-logo");
31923
32124
  return Promise.resolve(html2canvas(imageLogo)).then(function (imageLogoCanvas) {
31924
32125
  doc.addImage(imageLogoCanvas.toDataURL("image/png", 1.0), "png", 20, 20, 90, 25);
32126
+ doc.setFontSize(18);
32127
+ doc.setFont("Helvetica", "normal", "bold");
32128
+ doc.text(schoolName.length <= 18 ? schoolName : splitShoolName[0] + "...", (WIDTH_PAPER - schoolWidth) / 2 + 15, 40);
31925
32129
  doc.setFontSize(10);
31926
32130
  doc.setFont("Helvetica", "italic", "normal");
31927
32131
  doc.text("From: " + moment(startTime).format("DD/MM/YYYY"), 310, 40);
@@ -31938,7 +32142,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
31938
32142
  var line = 85;
31939
32143
  var left = 20;
31940
32144
 
31941
- var _temp38 = function () {
32145
+ var _temp42 = function () {
31942
32146
  if (selectedToPDF.includes(averageStudentSafetyName)) {
31943
32147
  return Promise.resolve(createImageHeader()).then(function () {
31944
32148
  doc.setFontSize(14);
@@ -31948,16 +32152,19 @@ var DashboardToPDF = function DashboardToPDF(props) {
31948
32152
  return Promise.resolve(html2canvas(chart)).then(function (canvas) {
31949
32153
  function _temp3() {
31950
32154
  left = 20;
31951
- doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, 420, heightChart);
31952
- line = line + heightChart + 30;
32155
+ var chartWidth = 420;
32156
+ var chartHeight = chart && chart.clientWidth ? chartWidth * chart.clientHeight / chart.clientWidth : heightChart;
32157
+ doc.addImage(canvas.toDataURL("image/png"), 10, line + 20, chartWidth, chartHeight);
32158
+ chartCount++;
31953
32159
 
31954
- if (line + 150 > HEIGHT_PAPER) {
32160
+ if (chartCount < selectedToPDF.length) {
31955
32161
  doc.addPage();
31956
32162
  line = 80;
31957
32163
  left = 20;
31958
32164
  }
31959
32165
  }
31960
32166
 
32167
+ line += 20;
31961
32168
  var lineOptionCheckIn = line;
31962
32169
  doc.setFontSize(8);
31963
32170
  var questions = safetyData.map(function (r) {
@@ -31984,7 +32191,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
31984
32191
 
31985
32192
  if (questionText != "") {
31986
32193
  doc.setDrawColor(0);
31987
- doc.setFillColor(COLOR_CHART_AND_PERCENTS[indexResult]);
32194
+ doc.setFillColor("#0F9655");
31988
32195
  doc.roundedRect(left, _line + 5, 5, 5, 1, 1, "F");
31989
32196
  doc.setFont("Helvetica", "normal", "bold");
31990
32197
  doc.text(questionText + ":", left + 8, _line + 10);
@@ -32004,7 +32211,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
32004
32211
 
32005
32212
  if (left + 105 > WIDTH_PAPER) {
32006
32213
  left = 20;
32007
- line = lineOptionCheckIn + 25;
32214
+ line = lineOptionCheckIn + 20;
32008
32215
  }
32009
32216
 
32010
32217
  var _temp = function () {
@@ -32026,7 +32233,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
32026
32233
  }
32027
32234
  }();
32028
32235
 
32029
- return _temp38 && _temp38.then ? _temp38.then(_temp39) : _temp39(_temp38);
32236
+ return _temp42 && _temp42.then ? _temp42.then(_temp43) : _temp43(_temp42);
32030
32237
  }, function (err) {
32031
32238
  console.log(err);
32032
32239
  dispatch(marioCore.setAlert({
@@ -32035,7 +32242,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
32035
32242
  }));
32036
32243
  });
32037
32244
 
32038
- return Promise.resolve(_temp43 && _temp43.then ? _temp43.then(_temp42) : _temp42(_temp43));
32245
+ return Promise.resolve(_temp47 && _temp47.then ? _temp47.then(_temp46) : _temp46(_temp47));
32039
32246
  } catch (e) {
32040
32247
  return Promise.reject(e);
32041
32248
  }
@@ -32044,11 +32251,7 @@ var DashboardToPDF = function DashboardToPDF(props) {
32044
32251
  return React__default.createElement("div", null, React__default.createElement("div", {
32045
32252
  className: "" + styles$1["chart-to-canvas"]
32046
32253
  }, React__default.createElement("div", {
32047
- id: "safety",
32048
- style: {
32049
- display: "block",
32050
- width: "45%"
32051
- }
32254
+ id: "safety"
32052
32255
  }, React__default.createElement(GenerateChartData, {
32053
32256
  colors: ["#0F9655"],
32054
32257
  typeChart: TYPECHART.AREA,
@@ -32057,13 +32260,10 @@ var DashboardToPDF = function DashboardToPDF(props) {
32057
32260
  months: monthsOneToOne,
32058
32261
  dayOfWeek: dayOfWeekOneToOne,
32059
32262
  avgQuestionLastMonth: avgQuestionLastMonth,
32060
- timeOfDay: timeOfDay
32263
+ timeOfDay: timeOfDay,
32264
+ isPrint: true
32061
32265
  })), React__default.createElement("div", {
32062
- id: "stress",
32063
- style: {
32064
- display: "block",
32065
- width: "45%"
32066
- }
32266
+ id: "stress"
32067
32267
  }, React__default.createElement(GenerateChartData, {
32068
32268
  colors: ["#C44140"],
32069
32269
  typeChart: TYPECHART.LINE,
@@ -32072,13 +32272,10 @@ var DashboardToPDF = function DashboardToPDF(props) {
32072
32272
  months: monthsOneToOne,
32073
32273
  dayOfWeek: dayOfWeekOneToOne,
32074
32274
  avgQuestionLastMonth: avgQuestionLastMonth,
32075
- timeOfDay: timeOfDay
32275
+ timeOfDay: timeOfDay,
32276
+ isPrint: true
32076
32277
  })), React__default.createElement("div", {
32077
- id: "preparedness",
32078
- style: {
32079
- display: "block",
32080
- width: "45%"
32081
- }
32278
+ id: "preparedness"
32082
32279
  }, React__default.createElement(GenerateChartData, {
32083
32280
  colors: ["#169490", "#316CD9", "#FFB04F"],
32084
32281
  typeChart: TYPECHART.LINE,
@@ -32087,13 +32284,10 @@ var DashboardToPDF = function DashboardToPDF(props) {
32087
32284
  months: monthsOneToOne,
32088
32285
  dayOfWeek: dayOfWeekOneToOne,
32089
32286
  avgQuestionLastMonth: avgQuestionLastMonth,
32090
- timeOfDay: timeOfDay
32287
+ timeOfDay: timeOfDay,
32288
+ isPrint: true
32091
32289
  })), React__default.createElement("div", {
32092
- id: "success_indicators",
32093
- style: {
32094
- display: "block",
32095
- width: "45%"
32096
- }
32290
+ id: "success_indicators"
32097
32291
  }, React__default.createElement(GenerateChartData, {
32098
32292
  typeChart: TYPECHART.AREA,
32099
32293
  activeColumn: activeColumnSuccessIndicators,
@@ -32102,29 +32296,38 @@ var DashboardToPDF = function DashboardToPDF(props) {
32102
32296
  months: monthsOneToOne,
32103
32297
  dayOfWeek: dayOfWeekOneToOne,
32104
32298
  timeOfDay: timeOfDay,
32105
- colors: ["#73C8E5", "#FFB04F", "#D7B0DE", "#E56362", "#5A7F05", "#D3D3D3"]
32299
+ colors: ["#73C8E5", "#FFB04F", "#D7B0DE", "#E56362", "#5A7F05", "#D3D3D3"],
32300
+ isPrint: true
32106
32301
  })), React__default.createElement("div", {
32107
- id: "student_distribution",
32108
- style: {
32109
- display: "block",
32110
- width: "45%"
32111
- }
32302
+ id: overallReadinessToLearn
32303
+ }, React__default.createElement(GenerateChartData, {
32304
+ isPrint: true,
32305
+ colors: ["#D9EEE4", "#FAF0F0"],
32306
+ name: t(overallReadinessToLearn),
32307
+ typeChart: TYPECHART.DONUT,
32308
+ months: [],
32309
+ activeColumn: [true, true],
32310
+ avgQuestionLastMonth: dataOverallReadyToLearn.overViewQuestionLastMonth,
32311
+ series: dataOverallReadyToLearn.resultQuestion,
32312
+ timeOfDay: timeOfDay,
32313
+ dayOfWeek: [],
32314
+ width: 320,
32315
+ height: 320
32316
+ })), React__default.createElement("div", {
32317
+ id: studentDistribution
32112
32318
  }, React__default.createElement(BubbleChartCustom$1, {
32113
- data: readinessToLearning
32319
+ data: readinessToLearning,
32320
+ isPrint: true
32114
32321
  })), React__default.createElement("div", {
32115
32322
  id: "student_stress_by_zone",
32116
32323
  style: {
32117
- display: "block",
32118
- width: "45%"
32324
+ width: "1280px"
32119
32325
  }
32120
32326
  }, React__default.createElement(StudentPressureChart, {
32121
- studentPressure: studentPressure
32327
+ studentPressure: studentPressure,
32328
+ width: 1280
32122
32329
  })), React__default.createElement("div", {
32123
- id: "learning_progress",
32124
- style: {
32125
- display: "block",
32126
- width: "45%"
32127
- }
32330
+ id: "learning_progress"
32128
32331
  }, React__default.createElement(GenerateChartData, {
32129
32332
  colors: ["#73C8E5", "#F9F871", "#D7B0DE", "#E56362", "#5A7F05", "#D3D3D3"],
32130
32333
  typeChart: TYPECHART.AREA,
@@ -32133,11 +32336,18 @@ var DashboardToPDF = function DashboardToPDF(props) {
32133
32336
  months: monthsConference,
32134
32337
  dayOfWeek: dayOfWeekConference,
32135
32338
  avgQuestionLastMonth: avgConferenceLastMonth,
32136
- timeOfDay: timeOfDay
32137
- })), React__default.createElement("div", {
32138
- id: "learning_strategy"
32139
- }, React__default.createElement(TopLearningStrategy$1, {
32140
- data: topLearningStrategiesData
32339
+ timeOfDay: timeOfDay,
32340
+ isPrint: true
32341
+ })), React__default.createElement("div", null, React__default.createElement(TopLearningStrategy$1, {
32342
+ data: topLearningStrategiesData,
32343
+ learningStrategyId: topLearningStrategyName,
32344
+ width: 800,
32345
+ isPrint: true
32346
+ })), React__default.createElement("div", null, React__default.createElement(TopLearningStrategy$1, {
32347
+ data: topLearningStrategiesData,
32348
+ topLearningStrategyId: topMostUsedStrategiesName,
32349
+ width: 800,
32350
+ isPrint: true
32141
32351
  }))), React__default.createElement("div", {
32142
32352
  className: "" + styles$1["image-logo"],
32143
32353
  id: "header-logo"
@@ -32314,7 +32524,8 @@ var Dashboard = function Dashboard() {
32314
32524
  avgQuestionLastMonth = _useChartDatas.avgQuestionLastMonth,
32315
32525
  studentPressure = _useChartDatas.studentPressure,
32316
32526
  dataOverallReadyToLearn = _useChartDatas.dataOverallReadyToLearn,
32317
- readinessToLearning = _useChartDatas.readinessToLearning;
32527
+ readinessToLearning = _useChartDatas.readinessToLearning,
32528
+ schoolName = _useChartDatas.schoolName;
32318
32529
 
32319
32530
  var _useBehavior = useBehavior(),
32320
32531
  chartIsOpened = _useBehavior.chartIsOpened,
@@ -32403,7 +32614,9 @@ var Dashboard = function Dashboard() {
32403
32614
  dayOfWeekConference: dayOfWeekConference,
32404
32615
  avgConferenceLastMonth: avgConferenceLastMonth,
32405
32616
  readinessToLearning: readinessToLearning,
32406
- studentPressure: studentPressure
32617
+ studentPressure: studentPressure,
32618
+ dataOverallReadyToLearn: dataOverallReadyToLearn,
32619
+ schoolName: schoolName
32407
32620
  }))), React__default.createElement("div", {
32408
32621
  className: "d-flex align-items-center justify-content-between"
32409
32622
  }, React__default.createElement("div", {
@@ -33905,7 +34118,7 @@ var TYPECHART$1;
33905
34118
  TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
33906
34119
  })(TYPECHART$1 || (TYPECHART$1 = {}));
33907
34120
 
33908
- var COLOR_CHART_AND_PERCENTS$1 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
34121
+ var COLOR_CHART_AND_PERCENTS = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
33909
34122
 
33910
34123
  var COLOR_CHART_AND_PIE = ["#5A7F05", "#C94645", "#FFB04F"];
33911
34124
  var COLOR_LABEL_PIE = ["#006E60", "#FF7670", "#994700"];
@@ -33920,7 +34133,7 @@ var INIT_TOP_MOST_SURVEY_USED = {
33920
34133
  sendDateSurvey: new Date(),
33921
34134
  percentSurvey: 0
33922
34135
  };
33923
- var COLOR_CHART_AND_PERCENTS$2 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
34136
+ var COLOR_CHART_AND_PERCENTS$1 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
33924
34137
  var DEFAULT_START_DATE$1 = moment().subtract(2, 'months').startOf("day").valueOf();
33925
34138
  var DEFAULT_END_DATE$1 = moment().endOf("day").valueOf();
33926
34139
  var CALENDAR_OPTIONS$1 = [{
@@ -34757,13 +34970,13 @@ var optionColumnChartAndPercents$1 = function optionColumnChartAndPercents(month
34757
34970
  fill: {
34758
34971
  opacity: isRidgeCharts ? 0.2 : 1
34759
34972
  },
34760
- colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
34973
+ colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
34761
34974
  return activeData[index];
34762
34975
  }),
34763
34976
  stroke: {
34764
34977
  curve: "smooth",
34765
34978
  show: true,
34766
- colors: isRidgeCharts ? COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
34979
+ colors: isRidgeCharts ? COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
34767
34980
  return activeData[index];
34768
34981
  }) : ["#fff"],
34769
34982
  width: 3,
@@ -34853,13 +35066,13 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, n
34853
35066
  return 0.6;
34854
35067
  })
34855
35068
  },
34856
- colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
35069
+ colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
34857
35070
  return activeData[index];
34858
35071
  }),
34859
35072
  stroke: {
34860
35073
  curve: "smooth",
34861
35074
  show: true,
34862
- colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
35075
+ colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
34863
35076
  return activeData[index];
34864
35077
  }),
34865
35078
  width: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
@@ -35248,7 +35461,7 @@ var ChartViewDashboard = function ChartViewDashboard(_ref) {
35248
35461
  className: "" + styles$2["item-checkbox"],
35249
35462
  key: index
35250
35463
  }, React__default.createElement(CheckboxCustom$1, {
35251
- background: COLOR_CHART_AND_PERCENTS$1[index],
35464
+ background: COLOR_CHART_AND_PERCENTS[index],
35252
35465
  width: 16,
35253
35466
  height: 16,
35254
35467
  isActive: activeColumn[index],
@@ -35298,7 +35511,7 @@ var ChartViewDashboard = function ChartViewDashboard(_ref) {
35298
35511
  }, React__default.createElement("div", {
35299
35512
  className: "" + styles$2["mark-custom"],
35300
35513
  style: {
35301
- backgroundColor: COLOR_CHART_AND_PERCENTS$1[index]
35514
+ backgroundColor: COLOR_CHART_AND_PERCENTS[index]
35302
35515
  }
35303
35516
  }), React__default.createElement("label", {
35304
35517
  className: "" + styles$2["label-legend-custom"]