mario-education 2.4.186-level → 2.4.187-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.
@@ -6,6 +6,7 @@ interface IProps {
6
6
  series: ISeries[];
7
7
  colors: string[];
8
8
  dayOfWeek: string[];
9
+ isCountSeries?: boolean;
9
10
  }
10
11
  declare const AreaChart: FC<IProps>;
11
12
  export default AreaChart;
@@ -6,6 +6,7 @@ interface IProps {
6
6
  width?: number | string;
7
7
  height?: number | string;
8
8
  textColors?: string[];
9
+ isCountSeries?: boolean;
9
10
  }
10
11
  declare const OverallDonutChart: FC<IProps>;
11
12
  export default OverallDonutChart;
@@ -102,10 +102,10 @@ export declare const convertDataToSeriesBullderChart: (data: IReadinessToLearnin
102
102
  name: string;
103
103
  data: import("react").ReactText[][];
104
104
  }[];
105
- export declare const optionColumnChartAndPercents: (months: string[], activeData: boolean[], isRidgeCharts: boolean, colors: string[], dayOfWeek: string[]) => ApexOptions;
105
+ export declare const optionColumnChartAndPercents: (months: string[], activeData: boolean[], isRidgeCharts: boolean, colors: string[], dayOfWeek: string[], isCountSeries?: boolean | undefined) => ApexOptions;
106
106
  export declare const optionLineChart: (months: string[], activeData: boolean[], colors: string[], dayOfWeek: string[]) => ApexOptions;
107
107
  export declare const optionBarChartAndArea: (months: string[], activeData: boolean[], dayOfWeek: string[], newseries?: any) => ApexOptions;
108
- export declare const overallDonutCHartOptions: (labelNames: string[], colors: string[], textColors?: string[] | undefined) => ApexOptions;
108
+ export declare const overallDonutCHartOptions: (labelNames: string[], colors: string[], isCountSeries?: boolean | undefined, textColors?: string[] | undefined) => ApexOptions;
109
109
  export declare const convertDataToDataChart: (data: IOverviewQuestionChoice[]) => string[];
110
110
  export declare const convertToSeriesColumnChartAndPercent: (dataCharts: string[], data: IOverviewQuestionChoice[]) => {
111
111
  name: string;
package/dist/index.js CHANGED
@@ -28767,7 +28767,7 @@ var convertDataToSeriesBullderChart = function convertDataToSeriesBullderChart(d
28767
28767
  };
28768
28768
  });
28769
28769
  };
28770
- var optionColumnChartAndPercents = function optionColumnChartAndPercents(months, activeData, isRidgeCharts, colors, dayOfWeek) {
28770
+ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months, activeData, isRidgeCharts, colors, dayOfWeek, isCountSeries) {
28771
28771
  return {
28772
28772
  chart: {
28773
28773
  height: 350,
@@ -28848,7 +28848,8 @@ var optionColumnChartAndPercents = function optionColumnChartAndPercents(months,
28848
28848
  cssClass: "apexcharts-yaxis-label"
28849
28849
  },
28850
28850
  formatter: function formatter(value) {
28851
- return value + "%";
28851
+ var roundedValue = Math.round(value);
28852
+ return !isCountSeries ? roundedValue + "%" : roundedValue.toString();
28852
28853
  },
28853
28854
  offsetX: 0,
28854
28855
  offsetY: 0,
@@ -28980,7 +28981,7 @@ var optionLineChart = function optionLineChart(months, activeData, colors, dayOf
28980
28981
  }
28981
28982
  };
28982
28983
  };
28983
- var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, colors, textColors) {
28984
+ var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, colors, isCountSeries, textColors) {
28984
28985
  return {
28985
28986
  legend: {
28986
28987
  show: false,
@@ -29008,13 +29009,18 @@ var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, col
29008
29009
  theme: "palette5",
29009
29010
  y: {
29010
29011
  formatter: function formatter(value) {
29011
- return value.toFixed(1).toString() + "%";
29012
+ return !isCountSeries ? value.toFixed(1).toString() + "%" : value.toString();
29012
29013
  }
29013
29014
  }
29014
29015
  },
29015
29016
  colors: colors,
29016
29017
  dataLabels: {
29017
29018
  enabled: true,
29019
+ formatter: function formatter(val, opt) {
29020
+ var _opt$w, _opt$w$globals, _opt$w$globals$series;
29021
+
29022
+ return !isCountSeries ? val.toFixed(1) + "%" : opt === null || opt === void 0 ? void 0 : (_opt$w = opt.w) === null || _opt$w === void 0 ? void 0 : (_opt$w$globals = _opt$w.globals) === null || _opt$w$globals === void 0 ? void 0 : (_opt$w$globals$series = _opt$w$globals.series) === null || _opt$w$globals$series === void 0 ? void 0 : _opt$w$globals$series[opt === null || opt === void 0 ? void 0 : opt.seriesIndex];
29023
+ },
29018
29024
  style: {
29019
29025
  colors: textColors || ["#242424", "#242424"],
29020
29026
  fontSize: "12px",
@@ -30696,8 +30702,9 @@ var AreaChart = function AreaChart(_ref) {
30696
30702
  months = _ref.months,
30697
30703
  activeColumn = _ref.activeColumn,
30698
30704
  colors = _ref.colors,
30699
- dayOfWeek = _ref.dayOfWeek;
30700
- var options = optionColumnChartAndPercents(months, activeColumn, true, colors, dayOfWeek);
30705
+ dayOfWeek = _ref.dayOfWeek,
30706
+ isCountSeries = _ref.isCountSeries;
30707
+ var options = optionColumnChartAndPercents(months, activeColumn, true, colors, dayOfWeek, isCountSeries);
30701
30708
  options.tooltip = {
30702
30709
  custom: function custom(_ref2) {
30703
30710
  var dataPointIndex = _ref2.dataPointIndex,
@@ -30707,7 +30714,7 @@ var AreaChart = function AreaChart(_ref) {
30707
30714
  return "<div class=" + styles$1["custom-tooltip"] + "> \n <p class=" + styles$1["custom-tooltip-month"] + "> " + dayOfWeek[dataPointIndex] + " </p>\n " + seriesItem.map(function (r, index) {
30708
30715
  var _r$data$dataPointInde;
30709
30716
 
30710
- return "<div key={" + index + "} class=" + styles$1["tooltip-data-box"] + ">\n <div class=" + styles$1["tooltip-data-cursor"] + " style=\"background: " + colorsItem[index] + "\"></div>\n <div class=" + styles$1["tooltip-data"] + ">\n <p class=" + styles$1["name"] + ">" + r.name + ":</p>\n <p class=" + styles$1["data"] + ">" + ((_r$data$dataPointInde = r.data[dataPointIndex]) === null || _r$data$dataPointInde === void 0 ? void 0 : _r$data$dataPointInde.toFixed(2)) + "%</p>\n </div>\n </div>";
30717
+ return "<div key={" + index + "} class=" + styles$1["tooltip-data-box"] + ">\n <div class=" + styles$1["tooltip-data-cursor"] + " style=\"background: " + colorsItem[index] + "\"></div>\n <div class=" + styles$1["tooltip-data"] + ">\n <p class=" + styles$1["name"] + ">" + r.name + ":</p>\n <p class=" + styles$1["data"] + ">" + (!isCountSeries ? ((_r$data$dataPointInde = r.data[dataPointIndex]) === null || _r$data$dataPointInde === void 0 ? void 0 : _r$data$dataPointInde.toFixed(2)) + "%" : r.data[dataPointIndex]) + "</p>\n </div>\n </div>";
30711
30718
  }) + "\n </div>";
30712
30719
  }
30713
30720
  };
@@ -30772,9 +30779,10 @@ var OverallDonutChart = function OverallDonutChart(_ref) {
30772
30779
  width = _ref$width === void 0 ? "100%" : _ref$width,
30773
30780
  _ref$height = _ref.height,
30774
30781
  height = _ref$height === void 0 ? 250 : _ref$height,
30782
+ isCountSeries = _ref.isCountSeries,
30775
30783
  textColors = _ref.textColors;
30776
30784
  return React__default.createElement(Chart, {
30777
- options: overallDonutCHartOptions(label, colors, textColors),
30785
+ options: overallDonutCHartOptions(label, colors, isCountSeries, textColors),
30778
30786
  series: series,
30779
30787
  type: "donut",
30780
30788
  width: width,
@@ -30912,6 +30920,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30912
30920
  })), React__default.createElement("div", {
30913
30921
  className: "w-100 " + (isPrint && typeChart === TYPECHART.DONUT ? "d-flex justify-content-center" : "")
30914
30922
  }, typeChart === TYPECHART.AREA && React__default.createElement(AreaChart, {
30923
+ isCountSeries: !!avgContent,
30915
30924
  months: months,
30916
30925
  activeColumn: activeColumn,
30917
30926
  series: newSeries,
@@ -30930,6 +30939,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30930
30939
  dayOfWeek: dayOfWeek,
30931
30940
  colors: colors
30932
30941
  }), typeChart === TYPECHART.DONUT && React__default.createElement(OverallDonutChart, {
30942
+ isCountSeries: !!avgContent,
30933
30943
  series: seriesDonut,
30934
30944
  colors: colors,
30935
30945
  label: label,
@@ -32563,7 +32573,7 @@ var useExportSessionCsv = function useExportSessionCsv() {
32563
32573
  var headers = "Student Name,ID/Email,Question,Answer,Teacher,Start Time";
32564
32574
 
32565
32575
  if (startDate || endDate) {
32566
- headers = "" + (moment(startDate).isValid() ? moment(startDate).format("DD/MM/YYYY") : '') + (moment(startDate).isValid() && moment(endDate).isValid() ? '-' : '') + moment(endDate).format("DD/MM/YYYY") + "\n" + headers;
32576
+ headers = "\"" + (moment(startDate).isValid() ? 'From: ' + moment(startDate).format("DD/MM/YYYY") : '') + (moment(startDate).isValid() && moment(endDate).isValid() ? ' - ' : '') + (moment(endDate).isValid() ? 'To: ' + moment(endDate).format("DD/MM/YYYY") : '') + "\"\n" + headers;
32567
32577
  }
32568
32578
 
32569
32579
  var questions = data.questions,
@@ -35143,7 +35153,7 @@ var SurveyDashboard = function SurveyDashboard() {
35143
35153
  })), React__default.createElement(reactstrap.Col, {
35144
35154
  md: 12
35145
35155
  }, React__default.createElement(GenerateChartData, {
35146
- colors: ["#73C8E5", "#F9F871", "#D7B0DE", "#E56362", "#169490", "#D3D3D3", "#316CD9"],
35156
+ colors: ["#73C8E5", "#FFB04F", "#D7B0DE", "#E56362", "#169490", "#D3D3D3", "#316CD9"],
35147
35157
  name: "Survey Results",
35148
35158
  typeChart: TYPECHART$2.AREA,
35149
35159
  activeColumn: activeColumnResult,