mario-education 2.2.6 → 2.2.7
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 +16 -210
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +17 -211
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList,
|
|
1
|
+
import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, LICENSE_AGGRID } from 'mario-core';
|
|
2
2
|
import { LicenseManager } from '@ag-grid-enterprise/core';
|
|
3
3
|
import React, { useState, useRef, useCallback, useEffect, forwardRef, useMemo, Fragment, memo } from 'react';
|
|
4
4
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -17265,107 +17265,6 @@ var DashboardCard = function DashboardCard(_ref) {
|
|
|
17265
17265
|
}, children));
|
|
17266
17266
|
};
|
|
17267
17267
|
|
|
17268
|
-
var colors = ["#1C77AC", "#00979B", "#8B0000", "#87E0E0", "#2EB82E"];
|
|
17269
|
-
var levels = [{
|
|
17270
|
-
name: "No progress",
|
|
17271
|
-
field: "noProgress"
|
|
17272
|
-
}, {
|
|
17273
|
-
name: "Slight",
|
|
17274
|
-
field: "slight"
|
|
17275
|
-
}, {
|
|
17276
|
-
name: "Moderate",
|
|
17277
|
-
field: "moderate"
|
|
17278
|
-
}, {
|
|
17279
|
-
name: "Significant",
|
|
17280
|
-
field: "significant"
|
|
17281
|
-
}, {
|
|
17282
|
-
name: "Achieved",
|
|
17283
|
-
field: "achieved"
|
|
17284
|
-
}];
|
|
17285
|
-
|
|
17286
|
-
var GoalProgressReport = function GoalProgressReport(_ref) {
|
|
17287
|
-
var data = _ref.data;
|
|
17288
|
-
var series = useMemo(function () {
|
|
17289
|
-
if (!data) return [];
|
|
17290
|
-
|
|
17291
|
-
try {
|
|
17292
|
-
return levels.map(function (level) {
|
|
17293
|
-
return {
|
|
17294
|
-
name: level.name,
|
|
17295
|
-
data: data.map(function (item) {
|
|
17296
|
-
return item[level.field];
|
|
17297
|
-
})
|
|
17298
|
-
};
|
|
17299
|
-
});
|
|
17300
|
-
} catch (_unused) {
|
|
17301
|
-
return [];
|
|
17302
|
-
}
|
|
17303
|
-
}, [data]);
|
|
17304
|
-
var categories = useMemo(function () {
|
|
17305
|
-
if (!data) return [];
|
|
17306
|
-
|
|
17307
|
-
try {
|
|
17308
|
-
return data.map(function (item) {
|
|
17309
|
-
return item.createdAt;
|
|
17310
|
-
});
|
|
17311
|
-
} catch (_unused2) {
|
|
17312
|
-
return [];
|
|
17313
|
-
}
|
|
17314
|
-
}, [data]);
|
|
17315
|
-
if (!data) return React.createElement(Loading$1, null);
|
|
17316
|
-
var options = {
|
|
17317
|
-
chart: {
|
|
17318
|
-
type: "bar",
|
|
17319
|
-
height: 350,
|
|
17320
|
-
stacked: true,
|
|
17321
|
-
stackType: "100%",
|
|
17322
|
-
toolbar: {
|
|
17323
|
-
show: false
|
|
17324
|
-
}
|
|
17325
|
-
},
|
|
17326
|
-
plotOptions: {
|
|
17327
|
-
bar: {
|
|
17328
|
-
horizontal: false,
|
|
17329
|
-
columnWidth: "80%"
|
|
17330
|
-
}
|
|
17331
|
-
},
|
|
17332
|
-
colors: colors,
|
|
17333
|
-
responsive: [{
|
|
17334
|
-
breakpoint: 480,
|
|
17335
|
-
options: {
|
|
17336
|
-
legend: {
|
|
17337
|
-
position: "bottom",
|
|
17338
|
-
offsetX: -10,
|
|
17339
|
-
offsetY: 0
|
|
17340
|
-
}
|
|
17341
|
-
}
|
|
17342
|
-
}],
|
|
17343
|
-
xaxis: {
|
|
17344
|
-
categories: categories
|
|
17345
|
-
},
|
|
17346
|
-
fill: {
|
|
17347
|
-
opacity: 1
|
|
17348
|
-
},
|
|
17349
|
-
legend: {
|
|
17350
|
-
position: "right",
|
|
17351
|
-
offsetX: 0,
|
|
17352
|
-
offsetY: 50,
|
|
17353
|
-
onItemClick: {
|
|
17354
|
-
toggleDataSeries: false
|
|
17355
|
-
},
|
|
17356
|
-
onItemHover: {
|
|
17357
|
-
highlightDataSeries: false
|
|
17358
|
-
}
|
|
17359
|
-
}
|
|
17360
|
-
};
|
|
17361
|
-
return React.createElement("div", null, React.createElement(ReactApexChart, {
|
|
17362
|
-
options: options,
|
|
17363
|
-
series: series,
|
|
17364
|
-
type: "bar",
|
|
17365
|
-
height: 350
|
|
17366
|
-
}));
|
|
17367
|
-
};
|
|
17368
|
-
|
|
17369
17268
|
var Loading = function Loading() {
|
|
17370
17269
|
return React.createElement("div", {
|
|
17371
17270
|
className: "d-flex align-items-center justify-content-center"
|
|
@@ -17387,14 +17286,14 @@ var Loading = function Loading() {
|
|
|
17387
17286
|
}, "Loading...")));
|
|
17388
17287
|
};
|
|
17389
17288
|
|
|
17390
|
-
var colors
|
|
17289
|
+
var colors = ["rgba(129, 236, 236, 0.8)", "rgba(116, 185, 255, 0.8)", "rgba(250, 177, 160, 0.8)", "rgba(255, 234, 167, 0.8)", "rgba(178, 190, 195, 0.8)", "rgba(85, 239, 196, 0.8)", "rgba(120, 111, 166, 0.8)", "rgba(243, 166, 131, 0.8)"];
|
|
17391
17290
|
|
|
17392
17291
|
var getColors = function getColors(length) {
|
|
17393
|
-
if (colors
|
|
17394
|
-
var newColors = [].concat(colors
|
|
17292
|
+
if (colors.length >= length) return colors;
|
|
17293
|
+
var newColors = [].concat(colors);
|
|
17395
17294
|
|
|
17396
17295
|
while (newColors.length < length) {
|
|
17397
|
-
newColors = [].concat(newColors, colors
|
|
17296
|
+
newColors = [].concat(newColors, colors);
|
|
17398
17297
|
}
|
|
17399
17298
|
|
|
17400
17299
|
return newColors;
|
|
@@ -17485,7 +17384,7 @@ var HighImpact = function HighImpact(_ref) {
|
|
|
17485
17384
|
})));
|
|
17486
17385
|
};
|
|
17487
17386
|
|
|
17488
|
-
var colors$
|
|
17387
|
+
var colors$1 = ["#1abc9c", "#c0392b"];
|
|
17489
17388
|
|
|
17490
17389
|
var LoginCouting = function LoginCouting(_ref) {
|
|
17491
17390
|
var data = _ref.data;
|
|
@@ -17502,11 +17401,11 @@ var LoginCouting = function LoginCouting(_ref) {
|
|
|
17502
17401
|
var series = [{
|
|
17503
17402
|
name: "Teacher",
|
|
17504
17403
|
data: teacherCount,
|
|
17505
|
-
color: colors$
|
|
17404
|
+
color: colors$1[0]
|
|
17506
17405
|
}, {
|
|
17507
17406
|
name: "Student",
|
|
17508
17407
|
data: studentCount,
|
|
17509
|
-
color: colors$
|
|
17408
|
+
color: colors$1[1]
|
|
17510
17409
|
}];
|
|
17511
17410
|
var options = {
|
|
17512
17411
|
chart: {
|
|
@@ -17523,7 +17422,7 @@ var LoginCouting = function LoginCouting(_ref) {
|
|
|
17523
17422
|
markers: {
|
|
17524
17423
|
size: 4,
|
|
17525
17424
|
colors: ["#fff"],
|
|
17526
|
-
strokeColors: colors$
|
|
17425
|
+
strokeColors: colors$1,
|
|
17527
17426
|
strokeWidth: 2,
|
|
17528
17427
|
strokeOpacity: 0.9,
|
|
17529
17428
|
strokeDashArray: 0,
|
|
@@ -17555,7 +17454,7 @@ var LoginCouting = function LoginCouting(_ref) {
|
|
|
17555
17454
|
}));
|
|
17556
17455
|
};
|
|
17557
17456
|
|
|
17558
|
-
var colors$
|
|
17457
|
+
var colors$2 = ["#00cec9", "#00b894"];
|
|
17559
17458
|
|
|
17560
17459
|
var PerceivedImpact = function PerceivedImpact(_ref) {
|
|
17561
17460
|
var data = _ref.data;
|
|
@@ -17582,7 +17481,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
|
|
|
17582
17481
|
show: false
|
|
17583
17482
|
}
|
|
17584
17483
|
},
|
|
17585
|
-
colors: colors$
|
|
17484
|
+
colors: colors$2,
|
|
17586
17485
|
plotOptions: {
|
|
17587
17486
|
bar: {
|
|
17588
17487
|
horizontal: false,
|
|
@@ -17620,7 +17519,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
|
|
|
17620
17519
|
}));
|
|
17621
17520
|
};
|
|
17622
17521
|
|
|
17623
|
-
var colors$
|
|
17522
|
+
var colors$3 = ["#00b894", "#00cec9", "#0984e3"];
|
|
17624
17523
|
|
|
17625
17524
|
var Quantity = function Quantity(_ref) {
|
|
17626
17525
|
var data = _ref.data;
|
|
@@ -17637,7 +17536,7 @@ var Quantity = function Quantity(_ref) {
|
|
|
17637
17536
|
type: "pie"
|
|
17638
17537
|
},
|
|
17639
17538
|
labels: ["Teachers", "Students", "Assistants"],
|
|
17640
|
-
colors: colors$
|
|
17539
|
+
colors: colors$3,
|
|
17641
17540
|
legend: {
|
|
17642
17541
|
show: false
|
|
17643
17542
|
},
|
|
@@ -17652,15 +17551,15 @@ var Quantity = function Quantity(_ref) {
|
|
|
17652
17551
|
};
|
|
17653
17552
|
var details = [{
|
|
17654
17553
|
label: "Teachers",
|
|
17655
|
-
color: colors$
|
|
17554
|
+
color: colors$3[0],
|
|
17656
17555
|
value: teacherPercentage
|
|
17657
17556
|
}, {
|
|
17658
17557
|
label: "Students",
|
|
17659
|
-
color: colors$
|
|
17558
|
+
color: colors$3[1],
|
|
17660
17559
|
value: studentPercentage
|
|
17661
17560
|
}, {
|
|
17662
17561
|
label: "Assistants",
|
|
17663
|
-
color: colors$
|
|
17562
|
+
color: colors$3[2],
|
|
17664
17563
|
value: assistantPercentage
|
|
17665
17564
|
}];
|
|
17666
17565
|
return React.createElement("div", {
|
|
@@ -17697,95 +17596,12 @@ var Quantity = function Quantity(_ref) {
|
|
|
17697
17596
|
})));
|
|
17698
17597
|
};
|
|
17699
17598
|
|
|
17700
|
-
var colors$5 = ["#f0932b", "#22a6b3", "#6ab04c"];
|
|
17701
|
-
var categories = ["Before intervention", "During intervention", "After intervention"];
|
|
17702
|
-
|
|
17703
|
-
var findGradeLabel = function findGradeLabel(value, bandScores) {
|
|
17704
|
-
var sortedBandScores = bandScores === null || bandScores === void 0 ? void 0 : bandScores.sort(function (item1, item2) {
|
|
17705
|
-
return item1.value - item2.value;
|
|
17706
|
-
});
|
|
17707
|
-
|
|
17708
|
-
if ((sortedBandScores === null || sortedBandScores === void 0 ? void 0 : sortedBandScores.length) > 0) {
|
|
17709
|
-
for (var i = 0; i < sortedBandScores.length; i++) {
|
|
17710
|
-
var _sortedBandScores$i, _sortedBandScores;
|
|
17711
|
-
|
|
17712
|
-
if (((_sortedBandScores$i = sortedBandScores[i]) === null || _sortedBandScores$i === void 0 ? void 0 : _sortedBandScores$i.value) <= value && value <= ((_sortedBandScores = sortedBandScores[i + 1]) === null || _sortedBandScores === void 0 ? void 0 : _sortedBandScores.value)) {
|
|
17713
|
-
var _sortedBandScores$i2, _sortedBandScores2, _sortedBandScores3;
|
|
17714
|
-
|
|
17715
|
-
if (value - ((_sortedBandScores$i2 = sortedBandScores[i]) === null || _sortedBandScores$i2 === void 0 ? void 0 : _sortedBandScores$i2.value) <= ((_sortedBandScores2 = sortedBandScores[i + 1]) === null || _sortedBandScores2 === void 0 ? void 0 : _sortedBandScores2.value) - value) {
|
|
17716
|
-
var _sortedBandScores$i3;
|
|
17717
|
-
|
|
17718
|
-
return (_sortedBandScores$i3 = sortedBandScores[i]) === null || _sortedBandScores$i3 === void 0 ? void 0 : _sortedBandScores$i3.label;
|
|
17719
|
-
}
|
|
17720
|
-
|
|
17721
|
-
return (_sortedBandScores3 = sortedBandScores[i + 1]) === null || _sortedBandScores3 === void 0 ? void 0 : _sortedBandScores3.label;
|
|
17722
|
-
}
|
|
17723
|
-
}
|
|
17724
|
-
}
|
|
17725
|
-
|
|
17726
|
-
return "";
|
|
17727
|
-
};
|
|
17728
|
-
|
|
17729
|
-
var Grade = function Grade(_ref) {
|
|
17730
|
-
var data = _ref.data;
|
|
17731
|
-
if (!data) return React.createElement(Loading, null);
|
|
17732
|
-
var series = [{
|
|
17733
|
-
data: [data.beforeIntervention, data.duringIntervention, data.afterIntervention]
|
|
17734
|
-
}];
|
|
17735
|
-
var options = {
|
|
17736
|
-
chart: {
|
|
17737
|
-
height: 350,
|
|
17738
|
-
type: "bar",
|
|
17739
|
-
toolbar: {
|
|
17740
|
-
show: false
|
|
17741
|
-
}
|
|
17742
|
-
},
|
|
17743
|
-
colors: colors$5,
|
|
17744
|
-
plotOptions: {
|
|
17745
|
-
bar: {
|
|
17746
|
-
columnWidth: "45%",
|
|
17747
|
-
distributed: true
|
|
17748
|
-
}
|
|
17749
|
-
},
|
|
17750
|
-
dataLabels: {
|
|
17751
|
-
enabled: false
|
|
17752
|
-
},
|
|
17753
|
-
legend: {
|
|
17754
|
-
show: false
|
|
17755
|
-
},
|
|
17756
|
-
xaxis: {
|
|
17757
|
-
categories: categories
|
|
17758
|
-
},
|
|
17759
|
-
yaxis: {
|
|
17760
|
-
max: Math.max.apply(Math, data.bandScores.map(function (item) {
|
|
17761
|
-
return item.value;
|
|
17762
|
-
})),
|
|
17763
|
-
min: Math.min.apply(Math, data.bandScores.map(function (item) {
|
|
17764
|
-
return item.value;
|
|
17765
|
-
})),
|
|
17766
|
-
labels: {
|
|
17767
|
-
formatter: function formatter(val) {
|
|
17768
|
-
return findGradeLabel(val, data.bandScores);
|
|
17769
|
-
}
|
|
17770
|
-
}
|
|
17771
|
-
}
|
|
17772
|
-
};
|
|
17773
|
-
return React.createElement("div", null, React.createElement(ReactApexChart, {
|
|
17774
|
-
options: options,
|
|
17775
|
-
series: series,
|
|
17776
|
-
type: "bar",
|
|
17777
|
-
height: 350
|
|
17778
|
-
}));
|
|
17779
|
-
};
|
|
17780
|
-
|
|
17781
17599
|
var Dashboard = function Dashboard() {
|
|
17782
17600
|
var _useDashboard = useDashboard(),
|
|
17783
17601
|
loginCounting = _useDashboard.loginCounting,
|
|
17784
17602
|
quantity = _useDashboard.quantity,
|
|
17785
|
-
goalProgress = _useDashboard.goalProgress,
|
|
17786
17603
|
highImpact = _useDashboard.highImpact,
|
|
17787
|
-
perceivedImpact = _useDashboard.perceivedImpact
|
|
17788
|
-
grade = _useDashboard.grade;
|
|
17604
|
+
perceivedImpact = _useDashboard.perceivedImpact;
|
|
17789
17605
|
|
|
17790
17606
|
var cards = [{
|
|
17791
17607
|
label: "High-impact learning strategies of current school year",
|
|
@@ -17807,16 +17623,6 @@ var Dashboard = function Dashboard() {
|
|
|
17807
17623
|
children: React.createElement(Quantity, {
|
|
17808
17624
|
data: quantity
|
|
17809
17625
|
})
|
|
17810
|
-
}, {
|
|
17811
|
-
label: "Goal progress",
|
|
17812
|
-
children: React.createElement(GoalProgressReport, {
|
|
17813
|
-
data: goalProgress
|
|
17814
|
-
})
|
|
17815
|
-
}, {
|
|
17816
|
-
label: "Grades",
|
|
17817
|
-
children: React.createElement(Grade, {
|
|
17818
|
-
data: grade
|
|
17819
|
-
})
|
|
17820
17626
|
}];
|
|
17821
17627
|
return React.createElement("div", null, React.createElement("h4", {
|
|
17822
17628
|
className: "mb-5"
|