mario-education 2.4.52-admin → 2.4.55-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.
package/dist/index.js CHANGED
@@ -26117,19 +26117,22 @@ var getConvertMinuteToHour = function getConvertMinuteToHour(timeSecond) {
26117
26117
 
26118
26118
  return hTime;
26119
26119
  };
26120
+
26121
+ var handleViewSeriesActive = function handleViewSeriesActive(active) {
26122
+ var _active$filter;
26123
+
26124
+ var item = ((_active$filter = active.filter(function (r) {
26125
+ return r == true;
26126
+ })) === null || _active$filter === void 0 ? void 0 : _active$filter.length) || 0;
26127
+ return Array.from(Array(item).keys());
26128
+ };
26129
+
26120
26130
  var readinesToLearnoptions = function readinesToLearnoptions(seriesName, data) {
26121
26131
  var history = reactRouterDom.useHistory();
26122
- var listStudentWithId = [];
26123
26132
  data === null || data === void 0 ? void 0 : data.forEach(function (element) {
26124
26133
  var _element$studentPerce;
26125
26134
 
26126
26135
  element === null || element === void 0 ? void 0 : (_element$studentPerce = element.studentPercentQuestion) === null || _element$studentPerce === void 0 ? void 0 : _element$studentPerce.forEach(function (item) {
26127
- if (!(listStudentWithId !== null && listStudentWithId !== void 0 && listStudentWithId.map(function (i) {
26128
- return i === null || i === void 0 ? void 0 : i.studentId;
26129
- }).includes(item.studentId))) listStudentWithId.push({
26130
- studentName: item.studentName,
26131
- studentId: item.studentId
26132
- });
26133
26136
  });
26134
26137
  });
26135
26138
  return {
@@ -26139,15 +26142,13 @@ var readinesToLearnoptions = function readinesToLearnoptions(seriesName, data) {
26139
26142
  show: false
26140
26143
  },
26141
26144
  events: {
26142
- markerClick: function markerClick(_e, _chart, options) {
26143
- var _listStudentWithId$fi;
26144
-
26145
- var currentStudentId = (_listStudentWithId$fi = listStudentWithId.find(function (i) {
26146
- var _options$w, _options$w$globals;
26147
-
26148
- return i.studentName.toLowerCase().trim() == (options === null || options === void 0 ? void 0 : (_options$w = options.w) === null || _options$w === void 0 ? void 0 : (_options$w$globals = _options$w.globals) === null || _options$w$globals === void 0 ? void 0 : _options$w$globals.seriesZ[options === null || options === void 0 ? void 0 : options.dataPointIndex][options === null || options === void 0 ? void 0 : options.dataPointIndex].toLowerCase().trim());
26149
- })) === null || _listStudentWithId$fi === void 0 ? void 0 : _listStudentWithId$fi.studentId;
26150
- history.push("/student-detail/overview/" + currentStudentId);
26145
+ dataPointSelection: function dataPointSelection(_event, chartContext, config) {
26146
+ var studentName = chartContext.data.threeDSeries[config.dataPointIndex];
26147
+ var series = config.w.config.series[config.seriesIndex].data;
26148
+ var student = series.find(function (r) {
26149
+ return r.includes(studentName);
26150
+ });
26151
+ !!student && history.push("/student-detail/overview/" + student[student.length - 1]);
26151
26152
  }
26152
26153
  }
26153
26154
  },
@@ -26482,6 +26483,7 @@ var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, n
26482
26483
  decimalsInFloat: 0
26483
26484
  },
26484
26485
  tooltip: {
26486
+ enabledOnSeries: handleViewSeriesActive(activeData),
26485
26487
  y: {
26486
26488
  formatter: function formatter(value) {
26487
26489
  return value.toFixed(2) + "%";
@@ -27074,7 +27076,7 @@ var getBandScore = function getBandScore() {
27074
27076
  };
27075
27077
 
27076
27078
  var TITLE$s = "Dashboard";
27077
- var DEFAULT_START_DATE = moment().endOf("day").valueOf().valueOf() > moment().startOf("month").month("Aug").valueOf() ? moment().startOf("month").month("Aug").valueOf() : moment().startOf("month").month("Aug").subtract(1, "year").valueOf();
27079
+ var DEFAULT_START_DATE = moment().subtract(3, 'months').startOf("day").valueOf();
27078
27080
  var DEFAULT_END_DATE = moment().endOf("day").valueOf();
27079
27081
 
27080
27082
  var useDashboard = function useDashboard() {
@@ -27212,9 +27214,14 @@ var useDashboard = function useDashboard() {
27212
27214
  };
27213
27215
 
27214
27216
  React.useEffect(function () {
27215
- setActiveColumnOneToOne([true].concat(dataConvertedOneToOne.map(function (_i) {
27216
- return false;
27217
- }).splice(0, dataConvertedOneToOne.length - 2)));
27217
+ if (activeColumnOneToOne.filter(function (r) {
27218
+ return r === true;
27219
+ }).length == 0) {
27220
+ setActiveColumnOneToOne([true].concat(dataConvertedOneToOne.map(function (_i) {
27221
+ return false;
27222
+ }).splice(0, dataConvertedOneToOne.length - 2)));
27223
+ }
27224
+
27218
27225
  setAvgOneToOne(newAvgOneToOne === null || newAvgOneToOne === void 0 ? void 0 : newAvgOneToOne.map(function (_, index) {
27219
27226
  return activeColumnOneToOne[index] ? newAvgOneToOne[index] : 0;
27220
27227
  }));
@@ -27255,12 +27262,17 @@ var useDashboard = function useDashboard() {
27255
27262
  };
27256
27263
 
27257
27264
  React.useEffect(function () {
27265
+ if (activeColumnClassReflection.filter(function (r) {
27266
+ return r === true;
27267
+ }).length == 0) {
27268
+ setActiveColumnClassReflection([true].concat(dataConvertedClassReflection.map(function (_i) {
27269
+ return false;
27270
+ }).splice(0, dataConvertedClassReflection.length - 2)));
27271
+ }
27272
+
27258
27273
  setSeriesClassReflection(newSeriesClassReflection === null || newSeriesClassReflection === void 0 ? void 0 : newSeriesClassReflection.filter(function (_, idx) {
27259
27274
  return activeColumnClassReflection[idx];
27260
27275
  }));
27261
- setActiveColumnClassReflection([true].concat(dataConvertedClassReflection.map(function (_i) {
27262
- return false;
27263
- }).splice(0, dataConvertedClassReflection.length - 2)));
27264
27276
  setAvgClassReflection(newAvgClassReflection === null || newAvgClassReflection === void 0 ? void 0 : newAvgClassReflection.map(function (_, index) {
27265
27277
  return activeColumnClassReflection[index] ? newAvgClassReflection[index] : 0;
27266
27278
  }));
@@ -27298,12 +27310,17 @@ var useDashboard = function useDashboard() {
27298
27310
  };
27299
27311
 
27300
27312
  React.useEffect(function () {
27313
+ if (activeColumnConference.filter(function (r) {
27314
+ return r === true;
27315
+ }).length == 0) {
27316
+ setActiveColumnConference([true].concat(dataConvertedConference === null || dataConvertedConference === void 0 ? void 0 : dataConvertedConference.map(function (_i) {
27317
+ return false;
27318
+ }).splice(0, dataConvertedConference.length - 2)));
27319
+ }
27320
+
27301
27321
  setSeriesConference(newSeriesConference === null || newSeriesConference === void 0 ? void 0 : newSeriesConference.filter(function (_, idx) {
27302
27322
  return activeColumnConference[idx];
27303
27323
  }));
27304
- setActiveColumnConference([true].concat(dataConvertedConference === null || dataConvertedConference === void 0 ? void 0 : dataConvertedConference.map(function (_i) {
27305
- return false;
27306
- }).splice(0, dataConvertedConference.length - 2)));
27307
27324
  setAvgConference(newAvgConference === null || newAvgConference === void 0 ? void 0 : newAvgConference.map(function (_, idx) {
27308
27325
  return activeColumnConference[idx] ? newAvgConference[idx] : 0;
27309
27326
  }));
@@ -27621,14 +27638,6 @@ var useChartDatas = function useChartDatas() {
27621
27638
  name: FILTER_NAME.EndDate,
27622
27639
  icon: "/images/calendar.svg",
27623
27640
  handleChangeFilters: handleChangeFilters
27624
- }, {
27625
- name: FILTER_NAME.StartDate,
27626
- icon: "/images/calendar.svg",
27627
- handleChangeFilters: handleChangeFilters
27628
- }, {
27629
- name: FILTER_NAME.EndDate,
27630
- icon: "/images/calendar.svg",
27631
- handleChangeFilters: handleChangeFilters
27632
27641
  }, {
27633
27642
  name: FILTER_NAME.Gender,
27634
27643
  icon: "/images/gender-icon.svg",
@@ -28158,7 +28167,9 @@ var SelectFilter = function SelectFilter(_ref) {
28158
28167
  onChange: function onChange(date) {
28159
28168
  return handleChangeStartDate(date);
28160
28169
  },
28161
- inline: true
28170
+ inline: true,
28171
+ maxDate: moment(filter === null || filter === void 0 ? void 0 : filter.endDate).toDate(),
28172
+ minDate: moment(filter === null || filter === void 0 ? void 0 : filter.endDate).subtract(3, "months").toDate()
28162
28173
  })));
28163
28174
  }
28164
28175
 
@@ -28182,7 +28193,9 @@ var SelectFilter = function SelectFilter(_ref) {
28182
28193
  onChange: function onChange(date) {
28183
28194
  return handleChangeEndDate(date);
28184
28195
  },
28185
- inline: true
28196
+ inline: true,
28197
+ maxDate: moment(filter === null || filter === void 0 ? void 0 : filter.startDate).add(3, "months").toDate(),
28198
+ minDate: moment(filter === null || filter === void 0 ? void 0 : filter.startDate).toDate()
28186
28199
  })));
28187
28200
  }
28188
28201