mario-education 2.4.126-admin → 2.4.127-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/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/types.d.ts +5 -8
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/AreaChart.d.ts +10 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/BarAndAreaChart.d.ts +9 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/BarChart.d.ts +11 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/ChartViewDashboard.d.ts +20 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/CheckboxCustom.d.ts +12 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/ChoiceChartType.d.ts +10 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/DashboardCard.d.ts +7 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/HeaderChart/HeaderChart.d.ts +16 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/HeaderChart/PlusButton.d.ts +6 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/Loading.d.ts +3 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/PieChart.d.ts +9 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/StudentByGrade.d.ts +7 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/TopMostSurveyUsed.d.ts +7 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/components/TotalCard.d.ts +4 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/chartOptions.d.ts +6 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/constants.d.ts +60 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/overviewFn.d.ts +17 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/types.d.ts +274 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/utils.d.ts +129 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useBehavior.d.ts +7 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useChartDatas.d.ts +38 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useContainerDimensions.d.ts +4 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useDashboard.d.ts +29 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/views/SurveyDashboard.d.ts +3 -0
- package/dist/MarioFramework.Education/ClientApp/src/index.d.ts +2 -1
- package/dist/MarioFramework.Education/ClientApp/src/services/dashboardService.d.ts +4 -0
- package/dist/MarioFramework.Education/ClientApp/src/utils/constants.d.ts +2 -1
- package/dist/MarioFramework.Education/ClientApp/src/utils/type.d.ts +1 -0
- package/dist/index.css +822 -1
- package/dist/index.js +1642 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1642 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
- package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/ReadinessToLearn.d.ts +0 -7
- package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchCounselor/hooks/useSwitchAssistant.d.ts +0 -18
- package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchSecondaryTeacher/components/SwitchCounselorModal.d.ts +0 -4
- package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchSecondaryTeacher/hooks/useSwitchCounselor.d.ts +0 -18
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/apiClient/index.d.ts +0 -9
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/components/SelectorTemplate.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/components/TemplateDialogModal.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/configs/types.d.ts +0 -12
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/hooks/useTemplateBuilder.d.ts +0 -12
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/hooks/useTemplateDetail.d.ts +0 -20
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/hooks/useTemplateList.d.ts +0 -9
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/hooks/useTemplateStart.d.ts +0 -9
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/views/TemplateBuilderPage.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/views/TemplateContainer.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/views/TemplateIEPList.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/views/TemplateStartBuild.d.ts +0 -3
- package/dist/MarioFramework.Education/ClientApp/src/containers/TemplateSystem/views/TemplateSystemList.d.ts +0 -3
- /package/dist/MarioFramework.Education/ClientApp/src/utils/{servicetype.interface.d.ts → serviceType.interface.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1212,6 +1212,7 @@ var FILTER_NAME;
|
|
|
1212
1212
|
FILTER_NAME["TeacherName"] = "teacher_name";
|
|
1213
1213
|
FILTER_NAME["StartDate"] = "start_date";
|
|
1214
1214
|
FILTER_NAME["EndDate"] = "end_date";
|
|
1215
|
+
FILTER_NAME["FavoriteSurvey"] = "favorite_survey";
|
|
1215
1216
|
})(FILTER_NAME || (FILTER_NAME = {}));
|
|
1216
1217
|
|
|
1217
1218
|
var header$1 = "Conference rubric";
|
|
@@ -1711,6 +1712,48 @@ function _objectDestructuringEmpty(obj) {
|
|
|
1711
1712
|
if (obj == null) throw new TypeError("Cannot destructure undefined");
|
|
1712
1713
|
}
|
|
1713
1714
|
|
|
1715
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1716
|
+
if (!o) return;
|
|
1717
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1718
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1719
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1720
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1721
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
function _arrayLikeToArray(arr, len) {
|
|
1725
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1726
|
+
|
|
1727
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1728
|
+
|
|
1729
|
+
return arr2;
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
1733
|
+
var it;
|
|
1734
|
+
|
|
1735
|
+
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
1736
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
1737
|
+
if (it) o = it;
|
|
1738
|
+
var i = 0;
|
|
1739
|
+
return function () {
|
|
1740
|
+
if (i >= o.length) return {
|
|
1741
|
+
done: true
|
|
1742
|
+
};
|
|
1743
|
+
return {
|
|
1744
|
+
done: false,
|
|
1745
|
+
value: o[i++]
|
|
1746
|
+
};
|
|
1747
|
+
};
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
it = o[Symbol.iterator]();
|
|
1754
|
+
return it.next.bind(it);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1714
1757
|
var RubricItemColumnOrder;
|
|
1715
1758
|
|
|
1716
1759
|
(function (RubricItemColumnOrder) {
|
|
@@ -29268,6 +29311,26 @@ var getGrades = function getGrades(studentUserId) {
|
|
|
29268
29311
|
var getBandScore = function getBandScore() {
|
|
29269
29312
|
return marioCore.api.get("" + BAND_SCORE);
|
|
29270
29313
|
};
|
|
29314
|
+
var getTopMostSurveyUsed = function getTopMostSurveyUsed(filter) {
|
|
29315
|
+
return marioCore.api.get(REPORT_URL + "/top-most-survey-used", {
|
|
29316
|
+
params: filter
|
|
29317
|
+
});
|
|
29318
|
+
};
|
|
29319
|
+
var getAllTotalSurvey = function getAllTotalSurvey(filter) {
|
|
29320
|
+
return marioCore.api.get(REPORT_URL + "/dashboard-survey-total", {
|
|
29321
|
+
params: filter
|
|
29322
|
+
});
|
|
29323
|
+
};
|
|
29324
|
+
var getDashboardFlagSurvey = function getDashboardFlagSurvey(filters) {
|
|
29325
|
+
return marioCore.api.get(REPORT_URL + "/get-dashboard-flag-survey", {
|
|
29326
|
+
params: filters
|
|
29327
|
+
});
|
|
29328
|
+
};
|
|
29329
|
+
var getDashboardTemplateSurvey = function getDashboardTemplateSurvey(filters) {
|
|
29330
|
+
return marioCore.api.get(REPORT_URL + "/get-dashboard-template-survey", {
|
|
29331
|
+
params: filters
|
|
29332
|
+
});
|
|
29333
|
+
};
|
|
29271
29334
|
|
|
29272
29335
|
var TITLE$y = "Dashboard";
|
|
29273
29336
|
|
|
@@ -29957,7 +30020,8 @@ var SelectFilter = function SelectFilter(_ref) {
|
|
|
29957
30020
|
label: "All"
|
|
29958
30021
|
},
|
|
29959
30022
|
grade: -1,
|
|
29960
|
-
bandScore: -1
|
|
30023
|
+
bandScore: -1,
|
|
30024
|
+
favoriteSurvey: -1
|
|
29961
30025
|
}),
|
|
29962
30026
|
labelBox = _useState2[0],
|
|
29963
30027
|
setLabelBox = _useState2[1];
|
|
@@ -30018,6 +30082,22 @@ var SelectFilter = function SelectFilter(_ref) {
|
|
|
30018
30082
|
}
|
|
30019
30083
|
};
|
|
30020
30084
|
|
|
30085
|
+
var onChangeFavoriteSurvey = function onChangeFavoriteSurvey(favoriteSurvey) {
|
|
30086
|
+
setLabelBox(_extends({}, labelBox, {
|
|
30087
|
+
favoriteSurvey: favoriteSurvey.value
|
|
30088
|
+
}));
|
|
30089
|
+
|
|
30090
|
+
if (favoriteSurvey.value == -1) {
|
|
30091
|
+
!!onChangeFilters && onChangeFilters({
|
|
30092
|
+
favoriteSurvey: []
|
|
30093
|
+
});
|
|
30094
|
+
} else {
|
|
30095
|
+
!!onChangeFilters && onChangeFilters({
|
|
30096
|
+
favoriteSurvey: [favoriteSurvey.value]
|
|
30097
|
+
});
|
|
30098
|
+
}
|
|
30099
|
+
};
|
|
30100
|
+
|
|
30021
30101
|
var onChangeCalendar = function onChangeCalendar(calendar) {
|
|
30022
30102
|
setLabelBox(_extends({}, labelBox, {
|
|
30023
30103
|
calendarTime: calendar
|
|
@@ -30366,6 +30446,50 @@ var SelectFilter = function SelectFilter(_ref) {
|
|
|
30366
30446
|
}))));
|
|
30367
30447
|
}
|
|
30368
30448
|
|
|
30449
|
+
if (name == FILTER_NAME.FavoriteSurvey) {
|
|
30450
|
+
var _option$find3;
|
|
30451
|
+
|
|
30452
|
+
return React__default.createElement("div", {
|
|
30453
|
+
key: "" + name,
|
|
30454
|
+
className: styles["block-filter-component"] + " ",
|
|
30455
|
+
ref: ref
|
|
30456
|
+
}, React__default.createElement("button", {
|
|
30457
|
+
onClick: handleToggleCollapse,
|
|
30458
|
+
className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer"
|
|
30459
|
+
}, React__default.createElement("img", {
|
|
30460
|
+
src: "" + icon,
|
|
30461
|
+
alt: name
|
|
30462
|
+
}), React__default.createElement("p", {
|
|
30463
|
+
className: styles["color-filter"] + " my-0 mx-2"
|
|
30464
|
+
}, labelBox.favoriteSurvey === -1 ? "" + t(name) : option === null || option === void 0 ? void 0 : (_option$find3 = option.find(function (i) {
|
|
30465
|
+
return i.value === labelBox.favoriteSurvey;
|
|
30466
|
+
})) === null || _option$find3 === void 0 ? void 0 : _option$find3.label), !isOpenCollapse ? React__default.createElement(fi.FiChevronDown, null) : React__default.createElement(fi.FiChevronUp, null)), React__default.createElement("div", {
|
|
30467
|
+
className: styles["select-filter-component"] + " " + (!isOpenCollapse && "" + styles["hidden"])
|
|
30468
|
+
}, React__default.createElement(reactstrap.Form, {
|
|
30469
|
+
className: styles["box-select"] + " " + styles["box-select-format"]
|
|
30470
|
+
}, option === null || option === void 0 ? void 0 : option.map(function (e) {
|
|
30471
|
+
return React__default.createElement(reactstrap.FormGroup, {
|
|
30472
|
+
check: true,
|
|
30473
|
+
className: "my-2 px-3",
|
|
30474
|
+
key: "" + e.label
|
|
30475
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
30476
|
+
id: e.label + "favorite",
|
|
30477
|
+
name: "favorite",
|
|
30478
|
+
value: [e.label],
|
|
30479
|
+
type: "radio",
|
|
30480
|
+
className: "" + styles["radio-btn"],
|
|
30481
|
+
checked: labelBox.favoriteSurvey === e.value,
|
|
30482
|
+
onChange: function onChange() {
|
|
30483
|
+
return onChangeFavoriteSurvey(e);
|
|
30484
|
+
}
|
|
30485
|
+
}), React__default.createElement(reactstrap.Label, {
|
|
30486
|
+
check: true,
|
|
30487
|
+
"for": e.label + "favorite",
|
|
30488
|
+
className: "" + styles["box-select-label"]
|
|
30489
|
+
}, React__default.createElement("p", null, e.label)));
|
|
30490
|
+
}))));
|
|
30491
|
+
}
|
|
30492
|
+
|
|
30369
30493
|
return React__default.createElement("div", null);
|
|
30370
30494
|
};
|
|
30371
30495
|
|
|
@@ -31585,6 +31709,1522 @@ var AdminTraining = function AdminTraining() {
|
|
|
31585
31709
|
})));
|
|
31586
31710
|
};
|
|
31587
31711
|
|
|
31712
|
+
var styles$2 = {"dashboard-card":"_3U9cF","quantity-table":"_3lYP4","label-chart":"_EIKHR","size-icon":"_3waCS","block-dashboard":"_2n_zv","size-arrow":"_36sKX","color-down":"_1TjNf","color-up":"_i4rwq","box-filter":"_BlYR7","title-card":"_3fBK1","value-card":"_2w6yc","deviant-card":"_1aq6C","filter-card":"_2lX51","box-skill-item":"_jGO7A","numerical-order":"_2dXys","backoround-top-skill":"_3-8WB","color-filter":"_5QHKk","btn-filter":"_2UyJG","block-collapse":"_1SL-6","form-date-picker":"_pKQ8e","bock-filter-left":"_2eZGm","bock-filter-right":"_dz04Q","form-filter-right":"_OhjkA","form-filter-left":"_-q4tF","bock-filter-wrap":"_nukn6","title-card-box":"_2ysrj","box-item":"_37HdU","image-no-data":"_-jYtE","image-grade":"_2FOHk","chart-data":"_38Xgv","apexcharts-datalabels":"_3m9ET","apexcharts-pie-label":"_3QJAM","image-custom":"_11W3J","image-special-need":"_2-frJ","title-dashboard":"_1_YyD","box-chart":"_xbK6p","block-filter-right":"_11sYZ","shadow-lg":"_rFfwe","chart-header-wrapper":"_zLI7s","devide-component":"_OoZLR","header-chart":"_3mzht","header-left":"_2gXQT","icon-chart":"_3XABq","header-right":"_1FHsv","header-title":"_2JBD5","button-export":"_2OEd7","button-content":"_2nyRe","button-icon":"_31EdD","icon-config":"_TmymT","cursor-pointer":"_3X_ow","btn-show-chart":"_1qdL4","checkbox-chart":"_PghQI","column-chart-percent":"_12jqi","chart-background":"_2rwg5","custom-marker":"_3iwnG","mark-custom":"_rKYWD","item-legend":"_n_lnI","label-legend-custom":"_3hlTa","mark-legend":"_1LGIl","percent":"_1mr1m","listItem":"_E_ciE","item":"_27ojF","student-by-age":"_2KJYt","total-student":"_hEgnv","pie-chart":"_34-k0","options-gender":"_119UL","legend":"_tlvnI","text-lengend":"_2Ehxf","student-by-grade":"_L1RnZ","bubble-chart-custom":"_18zab","x-axis-custom-wrap":"_1NRsG","axis-content":"_1jDpB","legend-wrap":"_93MRp","list-percent":"_3ipHU","percent-item":"_35mGN","chart-custom":"_1769M","chart-buddle":"_ton1p","title-grade":"_2LTMk","title-modal":"_3f2-D","header-desc-modal":"_19k86","form-checkbox":"_2ZpLB","checkbox-content":"_jLDZ4","btn-export":"_2sMK7","title-chart":"_1E7vX","image-logo":"_3Xggx","chart-to-canvas":"_3zQW_","box-chart-title":"_2HMn5","chart-view-dashboard":"_1qtzK","chart-left":"_g4q-z","chart-right":"_9ibzA","block-header-chart":"_1s7DG","item-checkbox":"_5wSJP","check-box":"_1h1ro","legend-pie-custom":"_2MTrM","legend-item":"_2kriq","color-box":"_jOIdn"};
|
|
31713
|
+
|
|
31714
|
+
var LegalGenderType$1;
|
|
31715
|
+
|
|
31716
|
+
(function (LegalGenderType) {
|
|
31717
|
+
LegalGenderType[LegalGenderType["None"] = 0] = "None";
|
|
31718
|
+
LegalGenderType[LegalGenderType["Male"] = 1] = "Male";
|
|
31719
|
+
LegalGenderType[LegalGenderType["Female"] = 2] = "Female";
|
|
31720
|
+
})(LegalGenderType$1 || (LegalGenderType$1 = {}));
|
|
31721
|
+
|
|
31722
|
+
var MtssType$1;
|
|
31723
|
+
|
|
31724
|
+
(function (MtssType) {
|
|
31725
|
+
MtssType[MtssType["Tier1"] = 0] = "Tier1";
|
|
31726
|
+
MtssType[MtssType["Tier2"] = 1] = "Tier2";
|
|
31727
|
+
MtssType[MtssType["Tier3"] = 2] = "Tier3";
|
|
31728
|
+
})(MtssType$1 || (MtssType$1 = {}));
|
|
31729
|
+
|
|
31730
|
+
var FILTER_YEAR$1;
|
|
31731
|
+
|
|
31732
|
+
(function (FILTER_YEAR) {
|
|
31733
|
+
FILTER_YEAR[FILTER_YEAR["THIS_YEAR"] = 0] = "THIS_YEAR";
|
|
31734
|
+
FILTER_YEAR[FILTER_YEAR["LAST_YEAR"] = 1] = "LAST_YEAR";
|
|
31735
|
+
FILTER_YEAR[FILTER_YEAR["LAST_QUARTER"] = 2] = "LAST_QUARTER";
|
|
31736
|
+
FILTER_YEAR[FILTER_YEAR["LAST_MONTH"] = 3] = "LAST_MONTH";
|
|
31737
|
+
FILTER_YEAR[FILTER_YEAR["LAST_DAY"] = 4] = "LAST_DAY";
|
|
31738
|
+
})(FILTER_YEAR$1 || (FILTER_YEAR$1 = {}));
|
|
31739
|
+
|
|
31740
|
+
var TYPECHART$1;
|
|
31741
|
+
|
|
31742
|
+
(function (TYPECHART) {
|
|
31743
|
+
TYPECHART[TYPECHART["AREA"] = 0] = "AREA";
|
|
31744
|
+
TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
|
|
31745
|
+
TYPECHART[TYPECHART["LINE"] = 2] = "LINE";
|
|
31746
|
+
TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
|
|
31747
|
+
})(TYPECHART$1 || (TYPECHART$1 = {}));
|
|
31748
|
+
|
|
31749
|
+
var COLOR_CHART_AND_PERCENTS$1 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
|
|
31750
|
+
|
|
31751
|
+
var COLOR_CHART_AND_PIE = ["#5A7F05", "#C94645", "#FFB04F"];
|
|
31752
|
+
var COLOR_LABEL_PIE = ["#006E60", "#FF7670", "#994700"];
|
|
31753
|
+
var GRAGE_DEFAULT$1 = ["K", "G", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
31754
|
+
var LABEL_NAME_PIE_CHART = ["Green", "Red", "Yellow"];
|
|
31755
|
+
var INITIAl_STUDENT_DASHBOARD$1 = {
|
|
31756
|
+
responseRate: 0,
|
|
31757
|
+
totalSurvey: 0
|
|
31758
|
+
};
|
|
31759
|
+
var INIT_TOP_MOST_SURVEY_USED = {
|
|
31760
|
+
nameSurvey: "",
|
|
31761
|
+
sendDateSurvey: new Date(),
|
|
31762
|
+
percentSurvey: 0
|
|
31763
|
+
};
|
|
31764
|
+
var COLOR_CHART_AND_PERCENTS$2 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
|
|
31765
|
+
var DEFAULT_START_DATE$1 = moment().subtract(2, 'months').startOf("day").valueOf();
|
|
31766
|
+
var DEFAULT_END_DATE$1 = moment().endOf("day").valueOf();
|
|
31767
|
+
var CALENDAR_OPTIONS$1 = [{
|
|
31768
|
+
label: "Today",
|
|
31769
|
+
startDate: moment().startOf("day").valueOf(),
|
|
31770
|
+
endDate: moment().endOf("day").valueOf()
|
|
31771
|
+
}, {
|
|
31772
|
+
label: "This week",
|
|
31773
|
+
startDate: moment().startOf("week").weekday(1).valueOf(),
|
|
31774
|
+
endDate: moment().endOf("week").weekday(7).valueOf()
|
|
31775
|
+
}, {
|
|
31776
|
+
label: "This month",
|
|
31777
|
+
startDate: moment().startOf("month").valueOf(),
|
|
31778
|
+
endDate: moment().endOf("month").valueOf()
|
|
31779
|
+
}];
|
|
31780
|
+
var COLOR_NAME = ["Green", "Red", "Yellow"];
|
|
31781
|
+
var TYPECHART$2;
|
|
31782
|
+
|
|
31783
|
+
(function (TYPECHART) {
|
|
31784
|
+
TYPECHART[TYPECHART["AREA"] = 0] = "AREA";
|
|
31785
|
+
TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
|
|
31786
|
+
TYPECHART[TYPECHART["LINE"] = 2] = "LINE";
|
|
31787
|
+
TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
|
|
31788
|
+
})(TYPECHART$2 || (TYPECHART$2 = {}));
|
|
31789
|
+
|
|
31790
|
+
var topMostSurveyNameUsed = "top_5_most_survey_used";
|
|
31791
|
+
|
|
31792
|
+
var TotalCard$1 = function TotalCard(_ref) {
|
|
31793
|
+
var icon = _ref.icon,
|
|
31794
|
+
title = _ref.title,
|
|
31795
|
+
value = _ref.value;
|
|
31796
|
+
return React__default.createElement("div", {
|
|
31797
|
+
className: styles$2["title-card-box"] + " " + styles$2["box-item"] + " p-4 mb-2 shadow-md mr-3"
|
|
31798
|
+
}, React__default.createElement("div", {
|
|
31799
|
+
className: "d-flex align-items-center justify-content-center"
|
|
31800
|
+
}, React__default.createElement("img", {
|
|
31801
|
+
src: icon
|
|
31802
|
+
}), React__default.createElement("p", {
|
|
31803
|
+
className: styles$2["title-card"] + " m-0 mx-2"
|
|
31804
|
+
}, title, ":")), React__default.createElement("div", {
|
|
31805
|
+
className: "d-flex align-items-center justify-content-center mt-3"
|
|
31806
|
+
}, React__default.createElement("p", {
|
|
31807
|
+
className: "" + styles$2["value-card"]
|
|
31808
|
+
}, value)));
|
|
31809
|
+
};
|
|
31810
|
+
|
|
31811
|
+
var gradeOptions$1 = function gradeOptions(grades, studentUserId) {
|
|
31812
|
+
var result = !studentUserId ? GRAGE_DEFAULT$1 : GRAGE_DEFAULT$1.filter(function (val) {
|
|
31813
|
+
return grades.indexOf(val) != -1;
|
|
31814
|
+
});
|
|
31815
|
+
return result.map(function (grade, index) {
|
|
31816
|
+
return {
|
|
31817
|
+
label: grade,
|
|
31818
|
+
value: index
|
|
31819
|
+
};
|
|
31820
|
+
});
|
|
31821
|
+
};
|
|
31822
|
+
var topMostSurveyChartOptions = function topMostSurveyChartOptions(labelNames, percentSurvey, isDonutChart) {
|
|
31823
|
+
return {
|
|
31824
|
+
legend: {
|
|
31825
|
+
show: false,
|
|
31826
|
+
fontFamily: 'Poppins-Regular !important'
|
|
31827
|
+
},
|
|
31828
|
+
chart: {
|
|
31829
|
+
type: "bar",
|
|
31830
|
+
toolbar: {
|
|
31831
|
+
show: false
|
|
31832
|
+
}
|
|
31833
|
+
},
|
|
31834
|
+
noData: {
|
|
31835
|
+
text: "No data",
|
|
31836
|
+
align: 'center',
|
|
31837
|
+
verticalAlign: 'middle'
|
|
31838
|
+
},
|
|
31839
|
+
grid: {
|
|
31840
|
+
strokeDashArray: 5,
|
|
31841
|
+
borderColor: "#D3D3D3"
|
|
31842
|
+
},
|
|
31843
|
+
plotOptions: {
|
|
31844
|
+
bar: {
|
|
31845
|
+
horizontal: true,
|
|
31846
|
+
distributed: true,
|
|
31847
|
+
borderRadius: 5
|
|
31848
|
+
}
|
|
31849
|
+
},
|
|
31850
|
+
stroke: {
|
|
31851
|
+
show: false,
|
|
31852
|
+
width: 1,
|
|
31853
|
+
colors: ["#fff"]
|
|
31854
|
+
},
|
|
31855
|
+
colors: ["#316CD9", "#5a89e1", "#83a7e8", "#adc4f0", "#eaf0fb"],
|
|
31856
|
+
xaxis: {
|
|
31857
|
+
categories: labelNames,
|
|
31858
|
+
labels: {
|
|
31859
|
+
show: true,
|
|
31860
|
+
style: {
|
|
31861
|
+
colors: ["#808080"],
|
|
31862
|
+
fontSize: "14px",
|
|
31863
|
+
fontFamily: 'Poppins-Regular !important',
|
|
31864
|
+
fontWeight: 400,
|
|
31865
|
+
cssClass: "apexcharts-yaxis-label"
|
|
31866
|
+
}
|
|
31867
|
+
}
|
|
31868
|
+
},
|
|
31869
|
+
labels: labelNames,
|
|
31870
|
+
tooltip: {
|
|
31871
|
+
x: {
|
|
31872
|
+
formatter: function formatter(value) {
|
|
31873
|
+
return value.toString();
|
|
31874
|
+
}
|
|
31875
|
+
},
|
|
31876
|
+
y: {
|
|
31877
|
+
formatter: function formatter(value) {
|
|
31878
|
+
return value.toFixed(2).toString();
|
|
31879
|
+
}
|
|
31880
|
+
}
|
|
31881
|
+
},
|
|
31882
|
+
yaxis: {
|
|
31883
|
+
min: 0,
|
|
31884
|
+
max: 100,
|
|
31885
|
+
labels: {
|
|
31886
|
+
show: true,
|
|
31887
|
+
align: "left",
|
|
31888
|
+
minWidth: 0,
|
|
31889
|
+
style: {
|
|
31890
|
+
fontSize: "14px",
|
|
31891
|
+
fontFamily: 'Poppins-Regular !important',
|
|
31892
|
+
fontWeight: 400,
|
|
31893
|
+
cssClass: "apexcharts-yaxis-label"
|
|
31894
|
+
},
|
|
31895
|
+
offsetX: 0,
|
|
31896
|
+
offsetY: 0,
|
|
31897
|
+
rotate: 0
|
|
31898
|
+
}
|
|
31899
|
+
},
|
|
31900
|
+
dataLabels: {
|
|
31901
|
+
enabled: true,
|
|
31902
|
+
formatter: function formatter(val, opts) {
|
|
31903
|
+
if (!val) {
|
|
31904
|
+
return "";
|
|
31905
|
+
}
|
|
31906
|
+
|
|
31907
|
+
if (!isDonutChart) {
|
|
31908
|
+
return typeof val === "number" ? val.toFixed(2) + "%" : "" + val;
|
|
31909
|
+
} else {
|
|
31910
|
+
return percentSurvey[opts.seriesIndex];
|
|
31911
|
+
}
|
|
31912
|
+
},
|
|
31913
|
+
style: {
|
|
31914
|
+
colors: ["#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#242424"]
|
|
31915
|
+
}
|
|
31916
|
+
}
|
|
31917
|
+
};
|
|
31918
|
+
};
|
|
31919
|
+
var getLastQuarterRange$1 = function getLastQuarterRange() {
|
|
31920
|
+
var lastQuarter = moment().utc().quarter() - 1;
|
|
31921
|
+
var start = lastQuarter ? moment().utc().quarter(lastQuarter).startOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).startOf("quarter").valueOf();
|
|
31922
|
+
var end = lastQuarter ? moment().utc().quarter(lastQuarter).endOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).endOf("quarter").valueOf();
|
|
31923
|
+
return {
|
|
31924
|
+
start: start,
|
|
31925
|
+
end: end
|
|
31926
|
+
};
|
|
31927
|
+
};
|
|
31928
|
+
var filterYearData$1 = [{
|
|
31929
|
+
label: "This Year",
|
|
31930
|
+
value: FILTER_YEAR$1.THIS_YEAR,
|
|
31931
|
+
startDate: moment().utc().startOf("year").valueOf(),
|
|
31932
|
+
endDate: moment().utc().endOf("day").valueOf()
|
|
31933
|
+
}, {
|
|
31934
|
+
label: "Last Year",
|
|
31935
|
+
value: FILTER_YEAR$1.LAST_YEAR,
|
|
31936
|
+
startDate: moment().utc().add(-1, "years").startOf("year").valueOf(),
|
|
31937
|
+
endDate: moment().utc().add(-1, "years").endOf("year").valueOf()
|
|
31938
|
+
}, {
|
|
31939
|
+
label: "Last Quarter",
|
|
31940
|
+
value: FILTER_YEAR$1.LAST_QUARTER,
|
|
31941
|
+
startDate: getLastQuarterRange$1().start,
|
|
31942
|
+
endDate: getLastQuarterRange$1().end
|
|
31943
|
+
}, {
|
|
31944
|
+
label: "Last 30 Day",
|
|
31945
|
+
value: FILTER_YEAR$1.LAST_MONTH,
|
|
31946
|
+
startDate: moment().utc().add(-30, "days").startOf("day").valueOf(),
|
|
31947
|
+
endDate: moment().utc().endOf("day").valueOf()
|
|
31948
|
+
}, {
|
|
31949
|
+
label: "Last Day",
|
|
31950
|
+
value: FILTER_YEAR$1.LAST_DAY,
|
|
31951
|
+
startDate: moment().utc().add(-1, "days").startOf("day").valueOf(),
|
|
31952
|
+
endDate: moment().utc().add(-1, "days").endOf("day").valueOf()
|
|
31953
|
+
}];
|
|
31954
|
+
|
|
31955
|
+
var handleViewSeriesActive = function handleViewSeriesActive(active) {
|
|
31956
|
+
var _active$filter;
|
|
31957
|
+
|
|
31958
|
+
var item = ((_active$filter = active.filter(function (r) {
|
|
31959
|
+
return r == true;
|
|
31960
|
+
})) === null || _active$filter === void 0 ? void 0 : _active$filter.length) || 0;
|
|
31961
|
+
return Array.from(Array(item).keys());
|
|
31962
|
+
};
|
|
31963
|
+
var convertDataToDataChart$1 = function convertDataToDataChart(data) {
|
|
31964
|
+
if (data.length > 0) {
|
|
31965
|
+
return data.reduce(function (acc, cur) {
|
|
31966
|
+
return [].concat(acc, cur.surveyTemplate.map(function (i) {
|
|
31967
|
+
return i.templateName.trim();
|
|
31968
|
+
}).filter(function (i) {
|
|
31969
|
+
return !!i && !acc.includes(i);
|
|
31970
|
+
}));
|
|
31971
|
+
}, []);
|
|
31972
|
+
}
|
|
31973
|
+
|
|
31974
|
+
return [];
|
|
31975
|
+
};
|
|
31976
|
+
var convertToSeriesTemplate = function convertToSeriesTemplate(data) {
|
|
31977
|
+
return convertDataToDataChart$1(data).map(function (dataName) {
|
|
31978
|
+
return {
|
|
31979
|
+
name: dataName,
|
|
31980
|
+
data: data.map(function (i) {
|
|
31981
|
+
var questionItem = i.surveyTemplate.find(function (question) {
|
|
31982
|
+
return question.templateName.includes(dataName);
|
|
31983
|
+
});
|
|
31984
|
+
return !!questionItem ? questionItem.avgTemplateSurvey : 0;
|
|
31985
|
+
})
|
|
31986
|
+
};
|
|
31987
|
+
});
|
|
31988
|
+
};
|
|
31989
|
+
var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
|
|
31990
|
+
var barChartSeries = series.map(function (i) {
|
|
31991
|
+
return _extends({}, i, {
|
|
31992
|
+
type: "bar"
|
|
31993
|
+
});
|
|
31994
|
+
});
|
|
31995
|
+
var areaChartSeries = series.map(function (i) {
|
|
31996
|
+
return _extends({}, i, {
|
|
31997
|
+
type: "area"
|
|
31998
|
+
});
|
|
31999
|
+
});
|
|
32000
|
+
return [].concat(barChartSeries, areaChartSeries);
|
|
32001
|
+
};
|
|
32002
|
+
var convertToAvg = function convertToAvg(dataCharts, data, months) {
|
|
32003
|
+
var result = dataCharts.map(function (dataName) {
|
|
32004
|
+
return Number(data.map(function (i) {
|
|
32005
|
+
var templateItem = i.surveyTemplate.find(function (question) {
|
|
32006
|
+
return question.templateName.includes(dataName);
|
|
32007
|
+
});
|
|
32008
|
+
return !!templateItem ? templateItem.avgTemplateSurvey : 0;
|
|
32009
|
+
}).reduce(function (acc, curr) {
|
|
32010
|
+
return acc + curr;
|
|
32011
|
+
}, 0) / (months === null || months === void 0 ? void 0 : months.length));
|
|
32012
|
+
});
|
|
32013
|
+
return result;
|
|
32014
|
+
};
|
|
32015
|
+
|
|
32016
|
+
var TITLE$z = "Dashboard";
|
|
32017
|
+
|
|
32018
|
+
var useDashboard$1 = function useDashboard() {
|
|
32019
|
+
var dispatch = reactRedux.useDispatch();
|
|
32020
|
+
|
|
32021
|
+
var _useState = React.useState({
|
|
32022
|
+
calendar: "",
|
|
32023
|
+
studentIds: [],
|
|
32024
|
+
studentId: undefined,
|
|
32025
|
+
teacherId: undefined,
|
|
32026
|
+
teacherUserId: "",
|
|
32027
|
+
studentUserId: "",
|
|
32028
|
+
bandScore: "",
|
|
32029
|
+
grade: [],
|
|
32030
|
+
startDate: DEFAULT_START_DATE$1,
|
|
32031
|
+
endDate: DEFAULT_END_DATE$1
|
|
32032
|
+
}),
|
|
32033
|
+
filter = _useState[0],
|
|
32034
|
+
setFilter = _useState[1];
|
|
32035
|
+
|
|
32036
|
+
var _useState2 = React.useState(INITIAl_STUDENT_DASHBOARD$1),
|
|
32037
|
+
listSurveyTotal = _useState2[0],
|
|
32038
|
+
setListSurveyTotal = _useState2[1];
|
|
32039
|
+
|
|
32040
|
+
var _useState3 = React.useState([INIT_TOP_MOST_SURVEY_USED]),
|
|
32041
|
+
topMostSurveyUsed = _useState3[0],
|
|
32042
|
+
setTopMostSurveyUsed = _useState3[1];
|
|
32043
|
+
|
|
32044
|
+
var _useState4 = React.useState([]),
|
|
32045
|
+
templateSurveyDashboard = _useState4[0],
|
|
32046
|
+
setTemplateSurveyDashboard = _useState4[1];
|
|
32047
|
+
|
|
32048
|
+
var _useState5 = React.useState([true]),
|
|
32049
|
+
activeColumnResult = _useState5[0],
|
|
32050
|
+
setActiveColumnResult = _useState5[1];
|
|
32051
|
+
|
|
32052
|
+
var _useState6 = React.useState([]),
|
|
32053
|
+
avgResult = _useState6[0],
|
|
32054
|
+
setAvgResult = _useState6[1];
|
|
32055
|
+
|
|
32056
|
+
var _useState7 = React.useState([]),
|
|
32057
|
+
seriseResult = _useState7[0],
|
|
32058
|
+
setSeriesResult = _useState7[1];
|
|
32059
|
+
|
|
32060
|
+
var _useState8 = React.useState([TYPECHART$2.BAR]),
|
|
32061
|
+
typeChartList = _useState8[0],
|
|
32062
|
+
setTypeChartList = _useState8[1];
|
|
32063
|
+
|
|
32064
|
+
var _useState9 = React.useState(),
|
|
32065
|
+
surveyFlagData = _useState9[0],
|
|
32066
|
+
setSurveyFlagData = _useState9[1];
|
|
32067
|
+
|
|
32068
|
+
var _useState10 = React.useState([]),
|
|
32069
|
+
studentByGrade = _useState10[0],
|
|
32070
|
+
setStudentByGrade = _useState10[1];
|
|
32071
|
+
|
|
32072
|
+
var user = reactRedux.useSelector(function (state) {
|
|
32073
|
+
return state.common.user;
|
|
32074
|
+
});
|
|
32075
|
+
|
|
32076
|
+
var _useState11 = React.useState(undefined),
|
|
32077
|
+
studentDefault = _useState11[0],
|
|
32078
|
+
setStudentDefault = _useState11[1];
|
|
32079
|
+
|
|
32080
|
+
var _useState12 = React.useState(""),
|
|
32081
|
+
genderOfStudent = _useState12[0],
|
|
32082
|
+
setGenderOfStudent = _useState12[1];
|
|
32083
|
+
|
|
32084
|
+
var handleChangeFilters = function handleChangeFilters(event) {
|
|
32085
|
+
var _extends2;
|
|
32086
|
+
|
|
32087
|
+
setFilter(_extends({}, filter, (_extends2 = {}, _extends2[event.target.name] = event.target.value, _extends2)));
|
|
32088
|
+
};
|
|
32089
|
+
|
|
32090
|
+
var callApi = React.useCallback(function (apiCaller, setData, defaultData, type) {
|
|
32091
|
+
try {
|
|
32092
|
+
var _temp2 = _catch(function () {
|
|
32093
|
+
return Promise.resolve(type ? apiCaller(_extends({}, filter, {
|
|
32094
|
+
type: type
|
|
32095
|
+
})) : apiCaller(filter)).then(function (res) {
|
|
32096
|
+
!!(res !== null && res !== void 0 && res.data) && setData(res.data);
|
|
32097
|
+
});
|
|
32098
|
+
}, function (err) {
|
|
32099
|
+
var _err$response, _err$response$data;
|
|
32100
|
+
|
|
32101
|
+
dispatch(marioCore.setAlert({
|
|
32102
|
+
type: "danger",
|
|
32103
|
+
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
32104
|
+
}));
|
|
32105
|
+
setData(defaultData);
|
|
32106
|
+
});
|
|
32107
|
+
|
|
32108
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
32109
|
+
} catch (e) {
|
|
32110
|
+
return Promise.reject(e);
|
|
32111
|
+
}
|
|
32112
|
+
}, [filter]);
|
|
32113
|
+
|
|
32114
|
+
var handleFilterTeacher = function handleFilterTeacher(option) {
|
|
32115
|
+
if (option != null) {
|
|
32116
|
+
setFilter(_extends({}, filter, {
|
|
32117
|
+
teacherId: option ? option === null || option === void 0 ? void 0 : option.value : undefined,
|
|
32118
|
+
teacherUserId: option === null || option === void 0 ? void 0 : option.teacherUserId
|
|
32119
|
+
}));
|
|
32120
|
+
} else {
|
|
32121
|
+
setFilter(_extends({}, filter, {
|
|
32122
|
+
teacherId: undefined,
|
|
32123
|
+
teacherUserId: ""
|
|
32124
|
+
}));
|
|
32125
|
+
}
|
|
32126
|
+
};
|
|
32127
|
+
|
|
32128
|
+
var handleFilterStudent = function handleFilterStudent(option) {
|
|
32129
|
+
if (option != null) {
|
|
32130
|
+
setGenderOfStudent(option === null || option === void 0 ? void 0 : option.gender);
|
|
32131
|
+
setStudentDefault(option);
|
|
32132
|
+
setFilter(_extends({}, filter, {
|
|
32133
|
+
studentId: option ? option === null || option === void 0 ? void 0 : option.studentId : undefined,
|
|
32134
|
+
studentUserId: option === null || option === void 0 ? void 0 : option.id
|
|
32135
|
+
}));
|
|
32136
|
+
return;
|
|
32137
|
+
}
|
|
32138
|
+
|
|
32139
|
+
setGenderOfStudent("");
|
|
32140
|
+
setStudentDefault(undefined);
|
|
32141
|
+
setFilter(_extends({}, filter, {
|
|
32142
|
+
grade: [],
|
|
32143
|
+
studentId: undefined,
|
|
32144
|
+
studentUserId: ""
|
|
32145
|
+
}));
|
|
32146
|
+
return;
|
|
32147
|
+
};
|
|
32148
|
+
|
|
32149
|
+
var handleSaveGradeFilter = function handleSaveGradeFilter(grades) {
|
|
32150
|
+
setFilter(_extends({}, filter, {
|
|
32151
|
+
grade: grades
|
|
32152
|
+
}));
|
|
32153
|
+
};
|
|
32154
|
+
|
|
32155
|
+
var onChangeFilters = function onChangeFilters(filterSelect) {
|
|
32156
|
+
setFilter(_extends({}, filter, filterSelect));
|
|
32157
|
+
};
|
|
32158
|
+
|
|
32159
|
+
var callApiByStudentUserId = function callApiByStudentUserId(apiCaller, setData, studentUserId, defaultData) {
|
|
32160
|
+
try {
|
|
32161
|
+
var _temp5 = function _temp5() {
|
|
32162
|
+
dispatch(marioCore.setLoading(false));
|
|
32163
|
+
};
|
|
32164
|
+
|
|
32165
|
+
dispatch(marioCore.setLoading(true));
|
|
32166
|
+
|
|
32167
|
+
var _temp6 = _catch(function () {
|
|
32168
|
+
return Promise.resolve(apiCaller(studentUserId)).then(function (res) {
|
|
32169
|
+
res && setData(res.data);
|
|
32170
|
+
});
|
|
32171
|
+
}, function (err) {
|
|
32172
|
+
var _err$response2, _err$response2$data;
|
|
32173
|
+
|
|
32174
|
+
dispatch(marioCore.setAlert({
|
|
32175
|
+
type: "danger",
|
|
32176
|
+
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message
|
|
32177
|
+
}));
|
|
32178
|
+
setData(defaultData);
|
|
32179
|
+
});
|
|
32180
|
+
|
|
32181
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
|
|
32182
|
+
} catch (e) {
|
|
32183
|
+
return Promise.reject(e);
|
|
32184
|
+
}
|
|
32185
|
+
};
|
|
32186
|
+
|
|
32187
|
+
var getData = React.useCallback(function () {
|
|
32188
|
+
try {
|
|
32189
|
+
document.title = TITLE$z;
|
|
32190
|
+
dispatch(marioCore.setLoading(true));
|
|
32191
|
+
return Promise.resolve(Promise.any([callApi(getAllTotalSurvey, setListSurveyTotal, []), callApi(getStudentByGrade, setStudentByGrade, []), callApi(getTopMostSurveyUsed, setTopMostSurveyUsed, []), callApi(getDashboardFlagSurvey, setSurveyFlagData, [])])).then(function () {
|
|
32192
|
+
dispatch(marioCore.setLoading(false));
|
|
32193
|
+
});
|
|
32194
|
+
} catch (e) {
|
|
32195
|
+
return Promise.reject(e);
|
|
32196
|
+
}
|
|
32197
|
+
}, [filter]);
|
|
32198
|
+
|
|
32199
|
+
var handleActiveColumnOneToOne = function handleActiveColumnOneToOne(index) {
|
|
32200
|
+
var _convertToSeriesTempl;
|
|
32201
|
+
|
|
32202
|
+
var newActiveColumn = [].concat(activeColumnResult);
|
|
32203
|
+
|
|
32204
|
+
if (newActiveColumn.filter(function (r) {
|
|
32205
|
+
return r;
|
|
32206
|
+
}).length >= 6 && newActiveColumn[index] === false) {
|
|
32207
|
+
dispatch(marioCore.setAlert({
|
|
32208
|
+
type: "danger",
|
|
32209
|
+
message: "Maximum 6 options can be select at the same time"
|
|
32210
|
+
}));
|
|
32211
|
+
return;
|
|
32212
|
+
}
|
|
32213
|
+
|
|
32214
|
+
newActiveColumn[index] = !newActiveColumn[index];
|
|
32215
|
+
setActiveColumnResult(newActiveColumn);
|
|
32216
|
+
setSeriesResult((_convertToSeriesTempl = convertToSeriesTemplate(templateSurveyDashboard)) === null || _convertToSeriesTempl === void 0 ? void 0 : _convertToSeriesTempl.filter(function (_, idx) {
|
|
32217
|
+
return newActiveColumn[idx];
|
|
32218
|
+
}));
|
|
32219
|
+
};
|
|
32220
|
+
|
|
32221
|
+
var onChangeChart = React.useCallback(function (type) {
|
|
32222
|
+
var indexType = typeChartList.findIndex(function (r) {
|
|
32223
|
+
return r === type;
|
|
32224
|
+
});
|
|
32225
|
+
var newListTypeChart = typeChartList || [];
|
|
32226
|
+
|
|
32227
|
+
if (indexType >= 0) {
|
|
32228
|
+
newListTypeChart.length > 1 && newListTypeChart.splice(indexType, 1);
|
|
32229
|
+
} else {
|
|
32230
|
+
newListTypeChart.push(type);
|
|
32231
|
+
}
|
|
32232
|
+
|
|
32233
|
+
setTypeChartList([].concat(newListTypeChart));
|
|
32234
|
+
}, [typeChartList]);
|
|
32235
|
+
var getDashBoardTemplate = React.useCallback(function () {
|
|
32236
|
+
try {
|
|
32237
|
+
var _temp9 = function _temp9() {
|
|
32238
|
+
dispatch(marioCore.setLoading(false));
|
|
32239
|
+
};
|
|
32240
|
+
|
|
32241
|
+
dispatch(marioCore.setLoading(true));
|
|
32242
|
+
|
|
32243
|
+
var _temp10 = _catch(function () {
|
|
32244
|
+
return Promise.resolve(getDashboardTemplateSurvey(filter)).then(function (res) {
|
|
32245
|
+
if (!!res) {
|
|
32246
|
+
var dataConvert = convertToSeriesTemplate(res.data);
|
|
32247
|
+
var dataChart = convertDataToDataChart$1(res.data);
|
|
32248
|
+
var avg = convertToAvg(dataChart, res.data, res.data.map(function (r) {
|
|
32249
|
+
return r.month || "";
|
|
32250
|
+
}));
|
|
32251
|
+
setAvgResult(avg);
|
|
32252
|
+
setTemplateSurveyDashboard(res.data);
|
|
32253
|
+
setSeriesResult(dataConvert.filter(function (_, idx) {
|
|
32254
|
+
return activeColumnResult[idx];
|
|
32255
|
+
}));
|
|
32256
|
+
|
|
32257
|
+
if (activeColumnResult.filter(function (r) {
|
|
32258
|
+
return r == true;
|
|
32259
|
+
}).length == 0 || activeColumnResult.length != activeColumnResult.length) {
|
|
32260
|
+
setActiveColumnResult([true].concat(dataConvert.map(function (_i) {
|
|
32261
|
+
return false;
|
|
32262
|
+
}).splice(0, dataConvert.length - 1)));
|
|
32263
|
+
}
|
|
32264
|
+
}
|
|
32265
|
+
});
|
|
32266
|
+
}, function (err) {
|
|
32267
|
+
var _err$response3, _err$response3$data;
|
|
32268
|
+
|
|
32269
|
+
dispatch(marioCore.setAlert({
|
|
32270
|
+
type: "danger",
|
|
32271
|
+
message: ((_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.title) || err.message
|
|
32272
|
+
}));
|
|
32273
|
+
});
|
|
32274
|
+
|
|
32275
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(_temp9) : _temp9(_temp10));
|
|
32276
|
+
} catch (e) {
|
|
32277
|
+
return Promise.reject(e);
|
|
32278
|
+
}
|
|
32279
|
+
}, [filter, activeColumnResult]);
|
|
32280
|
+
React.useEffect(function () {
|
|
32281
|
+
getData();
|
|
32282
|
+
getDashBoardTemplate();
|
|
32283
|
+
}, [filter]);
|
|
32284
|
+
React.useEffect(function () {
|
|
32285
|
+
!!filter.studentUserId && callApiByStudentUserId(getGrades, handleSaveGradeFilter, filter.studentUserId, []);
|
|
32286
|
+
}, [filter.studentUserId]);
|
|
32287
|
+
return {
|
|
32288
|
+
setFilter: setFilter,
|
|
32289
|
+
filter: filter,
|
|
32290
|
+
listSurveyTotal: listSurveyTotal,
|
|
32291
|
+
studentByGrade: studentByGrade,
|
|
32292
|
+
handleChangeFilters: handleChangeFilters,
|
|
32293
|
+
user: user,
|
|
32294
|
+
studentDefault: studentDefault,
|
|
32295
|
+
setStudentDefault: setStudentDefault,
|
|
32296
|
+
genderOfStudent: genderOfStudent,
|
|
32297
|
+
setGenderOfStudent: setGenderOfStudent,
|
|
32298
|
+
handleFilterStudent: handleFilterStudent,
|
|
32299
|
+
handleFilterTeacher: handleFilterTeacher,
|
|
32300
|
+
onChangeFilters: onChangeFilters,
|
|
32301
|
+
topMostSurveyUsed: topMostSurveyUsed,
|
|
32302
|
+
surveyFlagData: surveyFlagData,
|
|
32303
|
+
templateSurveyDashboard: templateSurveyDashboard,
|
|
32304
|
+
avgResult: avgResult,
|
|
32305
|
+
seriseResult: seriseResult,
|
|
32306
|
+
activeColumnResult: activeColumnResult,
|
|
32307
|
+
handleActiveColumnOneToOne: handleActiveColumnOneToOne,
|
|
32308
|
+
typeChartList: typeChartList,
|
|
32309
|
+
onChangeChart: onChangeChart
|
|
32310
|
+
};
|
|
32311
|
+
};
|
|
32312
|
+
|
|
32313
|
+
var useChartDatas$1 = function useChartDatas() {
|
|
32314
|
+
var _useDashboard = useDashboard$1(),
|
|
32315
|
+
topMostSurveyUsed = _useDashboard.topMostSurveyUsed,
|
|
32316
|
+
handleChangeFilters = _useDashboard.handleChangeFilters,
|
|
32317
|
+
user = _useDashboard.user,
|
|
32318
|
+
studentDefault = _useDashboard.studentDefault,
|
|
32319
|
+
handleFilterStudent = _useDashboard.handleFilterStudent,
|
|
32320
|
+
filter = _useDashboard.filter,
|
|
32321
|
+
listSurveyTotal = _useDashboard.listSurveyTotal,
|
|
32322
|
+
onChangeFilters = _useDashboard.onChangeFilters,
|
|
32323
|
+
surveyFlagData = _useDashboard.surveyFlagData,
|
|
32324
|
+
templateSurveyDashboard = _useDashboard.templateSurveyDashboard,
|
|
32325
|
+
avgResult = _useDashboard.avgResult,
|
|
32326
|
+
seriseResult = _useDashboard.seriseResult,
|
|
32327
|
+
activeColumnResult = _useDashboard.activeColumnResult,
|
|
32328
|
+
handleActiveColumnOneToOne = _useDashboard.handleActiveColumnOneToOne,
|
|
32329
|
+
typeChartList = _useDashboard.typeChartList,
|
|
32330
|
+
onChangeChart = _useDashboard.onChangeChart;
|
|
32331
|
+
|
|
32332
|
+
var _useState = React.useState([]),
|
|
32333
|
+
selectedToPrint = _useState[0],
|
|
32334
|
+
setSelectedToPrint = _useState[1];
|
|
32335
|
+
|
|
32336
|
+
var handleSelectToPrint = function handleSelectToPrint(checked, data, chartType) {
|
|
32337
|
+
var updateSelectToPrint = [].concat(selectedToPrint);
|
|
32338
|
+
var foundItem = updateSelectToPrint === null || updateSelectToPrint === void 0 ? void 0 : updateSelectToPrint.find(function (e) {
|
|
32339
|
+
return e.identification == data.id;
|
|
32340
|
+
});
|
|
32341
|
+
|
|
32342
|
+
if (checked) {
|
|
32343
|
+
if (!!data.id && !foundItem) {
|
|
32344
|
+
updateSelectToPrint.push({
|
|
32345
|
+
chartIndex: data.chartIndex,
|
|
32346
|
+
id: data.id,
|
|
32347
|
+
identification: data.id,
|
|
32348
|
+
label: data.label,
|
|
32349
|
+
children: data.children,
|
|
32350
|
+
chartType: chartType
|
|
32351
|
+
});
|
|
32352
|
+
}
|
|
32353
|
+
|
|
32354
|
+
if (!!data && foundItem && foundItem.id == null) {
|
|
32355
|
+
var itemIndex = updateSelectToPrint.indexOf(foundItem);
|
|
32356
|
+
updateSelectToPrint[itemIndex].id = data.id;
|
|
32357
|
+
updateSelectToPrint[itemIndex].children = data.children;
|
|
32358
|
+
}
|
|
32359
|
+
} else {
|
|
32360
|
+
var _itemIndex = updateSelectToPrint.indexOf(foundItem);
|
|
32361
|
+
|
|
32362
|
+
updateSelectToPrint[_itemIndex].id = null;
|
|
32363
|
+
updateSelectToPrint[_itemIndex].children = null;
|
|
32364
|
+
}
|
|
32365
|
+
|
|
32366
|
+
setSelectedToPrint(updateSelectToPrint);
|
|
32367
|
+
};
|
|
32368
|
+
|
|
32369
|
+
var checkSelectedItem = function checkSelectedItem(id) {
|
|
32370
|
+
for (var _iterator = _createForOfIteratorHelperLoose(selectedToPrint), _step; !(_step = _iterator()).done;) {
|
|
32371
|
+
var item = _step.value;
|
|
32372
|
+
if (item.id === id) return true;
|
|
32373
|
+
}
|
|
32374
|
+
|
|
32375
|
+
return false;
|
|
32376
|
+
};
|
|
32377
|
+
|
|
32378
|
+
var LIST_FILTERS_LEFT = [{
|
|
32379
|
+
name: FILTER_NAME.Calendar,
|
|
32380
|
+
icon: "/images/calendar.svg",
|
|
32381
|
+
handleChangeFilters: handleChangeFilters,
|
|
32382
|
+
option: CALENDAR_OPTIONS$1
|
|
32383
|
+
}, {
|
|
32384
|
+
name: FILTER_NAME.StartDate,
|
|
32385
|
+
icon: "/images/calendar.svg",
|
|
32386
|
+
handleChangeFilters: handleChangeFilters
|
|
32387
|
+
}, {
|
|
32388
|
+
name: FILTER_NAME.EndDate,
|
|
32389
|
+
icon: "/images/calendar.svg",
|
|
32390
|
+
handleChangeFilters: handleChangeFilters
|
|
32391
|
+
}, {
|
|
32392
|
+
name: FILTER_NAME.Grade,
|
|
32393
|
+
icon: "/images/star-icon.svg",
|
|
32394
|
+
handleChangeFilters: handleChangeFilters,
|
|
32395
|
+
option: [{
|
|
32396
|
+
value: -1,
|
|
32397
|
+
label: "All"
|
|
32398
|
+
}].concat(gradeOptions$1(filter.grade, filter.studentUserId))
|
|
32399
|
+
}];
|
|
32400
|
+
var LIST_FILTERS_RIGHT = [{
|
|
32401
|
+
name: FILTER_NAME.StudentName,
|
|
32402
|
+
icon: "/images/student-icon.svg",
|
|
32403
|
+
handleChangeFilters: handleFilterStudent,
|
|
32404
|
+
studentId: filter.studentId,
|
|
32405
|
+
studentDefault: studentDefault
|
|
32406
|
+
}, {
|
|
32407
|
+
name: FILTER_NAME.FavoriteSurvey,
|
|
32408
|
+
icon: "/images/teacher-icon.svg",
|
|
32409
|
+
handleChangeFilters: handleChangeFilters,
|
|
32410
|
+
option: [{
|
|
32411
|
+
value: -1,
|
|
32412
|
+
label: "All"
|
|
32413
|
+
}, {
|
|
32414
|
+
value: 1,
|
|
32415
|
+
label: "Favorite Survey"
|
|
32416
|
+
}]
|
|
32417
|
+
}];
|
|
32418
|
+
var totalCardData = [{
|
|
32419
|
+
icon: "images/icon_chart.png",
|
|
32420
|
+
title: "total_surveys",
|
|
32421
|
+
value: listSurveyTotal === null || listSurveyTotal === void 0 ? void 0 : listSurveyTotal.totalSurvey,
|
|
32422
|
+
isUp: true,
|
|
32423
|
+
deviant: "2",
|
|
32424
|
+
filter: "this week"
|
|
32425
|
+
}, {
|
|
32426
|
+
icon: "images/icon_watch.png",
|
|
32427
|
+
title: "response_rate",
|
|
32428
|
+
value: (listSurveyTotal === null || listSurveyTotal === void 0 ? void 0 : listSurveyTotal.responseRate) + "%",
|
|
32429
|
+
isUp: true,
|
|
32430
|
+
deviant: "17 min",
|
|
32431
|
+
filter: "this week"
|
|
32432
|
+
}];
|
|
32433
|
+
return {
|
|
32434
|
+
user: user,
|
|
32435
|
+
filter: filter,
|
|
32436
|
+
LIST_FILTERS_LEFT: LIST_FILTERS_LEFT,
|
|
32437
|
+
LIST_FILTERS_RIGHT: LIST_FILTERS_RIGHT,
|
|
32438
|
+
totalCardData: totalCardData,
|
|
32439
|
+
onChangeFilters: onChangeFilters,
|
|
32440
|
+
handleSelectToPrint: handleSelectToPrint,
|
|
32441
|
+
checkSelectedItem: checkSelectedItem,
|
|
32442
|
+
selectedToPrint: selectedToPrint,
|
|
32443
|
+
setSelectedToPrint: setSelectedToPrint,
|
|
32444
|
+
topMostSurveyUsed: topMostSurveyUsed,
|
|
32445
|
+
surveyFlagData: surveyFlagData,
|
|
32446
|
+
templateSurveyDashboard: templateSurveyDashboard,
|
|
32447
|
+
avgResult: avgResult,
|
|
32448
|
+
seriseResult: seriseResult,
|
|
32449
|
+
activeColumnResult: activeColumnResult,
|
|
32450
|
+
handleActiveColumnOneToOne: handleActiveColumnOneToOne,
|
|
32451
|
+
typeChartList: typeChartList,
|
|
32452
|
+
onChangeChart: onChangeChart
|
|
32453
|
+
};
|
|
32454
|
+
};
|
|
32455
|
+
|
|
32456
|
+
var Loading$1 = function Loading() {
|
|
32457
|
+
return React__default.createElement("div", {
|
|
32458
|
+
className: "d-flex align-items-center justify-content-center"
|
|
32459
|
+
}, React__default.createElement("div", {
|
|
32460
|
+
className: "spinner-grow",
|
|
32461
|
+
role: "status"
|
|
32462
|
+
}, React__default.createElement("span", {
|
|
32463
|
+
className: "sr-only"
|
|
32464
|
+
}, "Loading...")), React__default.createElement("div", {
|
|
32465
|
+
className: "spinner-grow mx-2",
|
|
32466
|
+
role: "status"
|
|
32467
|
+
}, React__default.createElement("span", {
|
|
32468
|
+
className: "sr-only"
|
|
32469
|
+
}, "Loading...")), React__default.createElement("div", {
|
|
32470
|
+
className: "spinner-grow",
|
|
32471
|
+
role: "status"
|
|
32472
|
+
}, React__default.createElement("span", {
|
|
32473
|
+
className: "sr-only"
|
|
32474
|
+
}, "Loading...")));
|
|
32475
|
+
};
|
|
32476
|
+
|
|
32477
|
+
var TopMostSurveyUsed = function TopMostSurveyUsed(_ref) {
|
|
32478
|
+
var data = _ref.data;
|
|
32479
|
+
if (!data) return React__default.createElement(Loading$1, null);
|
|
32480
|
+
|
|
32481
|
+
var _useTranslation = marioCore.useTranslation(),
|
|
32482
|
+
t = _useTranslation.t;
|
|
32483
|
+
|
|
32484
|
+
var labelNames = data === null || data === void 0 ? void 0 : data.map(function (i) {
|
|
32485
|
+
return i.nameSurvey;
|
|
32486
|
+
});
|
|
32487
|
+
var labelTimes = data === null || data === void 0 ? void 0 : data.map(function (i) {
|
|
32488
|
+
return marioCore.utcToLocalTime(i.sendDateSurvey.toString(), "Do MMMM yyyy - hh:mm A");
|
|
32489
|
+
});
|
|
32490
|
+
console.log({
|
|
32491
|
+
labelTimes: labelTimes
|
|
32492
|
+
});
|
|
32493
|
+
var percentSurvey = data === null || data === void 0 ? void 0 : data.map(function (i) {
|
|
32494
|
+
return i.percentSurvey;
|
|
32495
|
+
});
|
|
32496
|
+
var seriesLearningStrategy = [{
|
|
32497
|
+
name: "Perceived Usefulness",
|
|
32498
|
+
data: percentSurvey
|
|
32499
|
+
}];
|
|
32500
|
+
return React__default.createElement("div", {
|
|
32501
|
+
className: "h-100 w-100 " + styles$2["chart-background"] + " pl-4"
|
|
32502
|
+
}, React__default.createElement("div", {
|
|
32503
|
+
className: "" + styles$2["block-header-chart"]
|
|
32504
|
+
}, React__default.createElement("div", {
|
|
32505
|
+
className: "" + styles$2["block-header-name"]
|
|
32506
|
+
}, React__default.createElement("p", {
|
|
32507
|
+
className: "" + styles$2["title-chart"]
|
|
32508
|
+
}, t(topMostSurveyNameUsed)))), seriesLearningStrategy.some(function (i) {
|
|
32509
|
+
return i.data;
|
|
32510
|
+
}) ? React__default.createElement("div", null, React__default.createElement(Chart, {
|
|
32511
|
+
options: topMostSurveyChartOptions(labelNames, percentSurvey),
|
|
32512
|
+
series: seriesLearningStrategy,
|
|
32513
|
+
type: "bar",
|
|
32514
|
+
width: "100%",
|
|
32515
|
+
height: 450
|
|
32516
|
+
})) : React__default.createElement("img", {
|
|
32517
|
+
className: styles$2["image-no-data"] + " " + styles$2["image-custom"],
|
|
32518
|
+
src: "images/chart-top-learning.png"
|
|
32519
|
+
}));
|
|
32520
|
+
};
|
|
32521
|
+
|
|
32522
|
+
var propsAreEqual$1 = function propsAreEqual(preProps, nextProps) {
|
|
32523
|
+
return JSON.stringify(preProps) === JSON.stringify(nextProps);
|
|
32524
|
+
};
|
|
32525
|
+
|
|
32526
|
+
var TopMostSurveyUsed$1 = React__default.memo(TopMostSurveyUsed, propsAreEqual$1);
|
|
32527
|
+
|
|
32528
|
+
var maxSeries = function maxSeries(series) {
|
|
32529
|
+
var max = 0;
|
|
32530
|
+
|
|
32531
|
+
for (var i = 0; i < series.length; i++) {
|
|
32532
|
+
max = Math.max.apply(Math, series[i].data.concat([max]));
|
|
32533
|
+
}
|
|
32534
|
+
|
|
32535
|
+
return max;
|
|
32536
|
+
};
|
|
32537
|
+
var optionColumnChartAndPercents$1 = function optionColumnChartAndPercents(months, activeData, isRidgeCharts, isShowChartLabel, percentData, series) {
|
|
32538
|
+
return {
|
|
32539
|
+
chart: {
|
|
32540
|
+
height: 350,
|
|
32541
|
+
stacked: false,
|
|
32542
|
+
toolbar: {
|
|
32543
|
+
show: false,
|
|
32544
|
+
"export": {
|
|
32545
|
+
png: {
|
|
32546
|
+
filename: "test"
|
|
32547
|
+
}
|
|
32548
|
+
}
|
|
32549
|
+
}
|
|
32550
|
+
},
|
|
32551
|
+
plotOptions: {
|
|
32552
|
+
bar: {
|
|
32553
|
+
borderRadius: 5
|
|
32554
|
+
}
|
|
32555
|
+
},
|
|
32556
|
+
dataLabels: {
|
|
32557
|
+
enabled: false
|
|
32558
|
+
},
|
|
32559
|
+
fill: {
|
|
32560
|
+
opacity: isRidgeCharts ? 0.2 : 1
|
|
32561
|
+
},
|
|
32562
|
+
colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
|
|
32563
|
+
return activeData[index];
|
|
32564
|
+
}),
|
|
32565
|
+
stroke: {
|
|
32566
|
+
curve: "smooth",
|
|
32567
|
+
show: true,
|
|
32568
|
+
colors: isRidgeCharts ? COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
|
|
32569
|
+
return activeData[index];
|
|
32570
|
+
}) : ["#fff"],
|
|
32571
|
+
width: 3,
|
|
32572
|
+
dashArray: 0
|
|
32573
|
+
},
|
|
32574
|
+
xaxis: {
|
|
32575
|
+
categories: months,
|
|
32576
|
+
labels: {
|
|
32577
|
+
show: months.length > 0 ? true : false,
|
|
32578
|
+
style: {
|
|
32579
|
+
colors: ["#808080"],
|
|
32580
|
+
fontSize: "16px",
|
|
32581
|
+
fontFamily: "Roboto",
|
|
32582
|
+
fontWeight: 400,
|
|
32583
|
+
cssClass: "apexcharts-yaxis-label"
|
|
32584
|
+
}
|
|
32585
|
+
},
|
|
32586
|
+
axisTicks: {
|
|
32587
|
+
show: months.length > 0 ? true : false
|
|
32588
|
+
}
|
|
32589
|
+
},
|
|
32590
|
+
yaxis: {
|
|
32591
|
+
tickAmount: 2,
|
|
32592
|
+
min: 0,
|
|
32593
|
+
max: percentData ? 100 : maxSeries(series || []),
|
|
32594
|
+
labels: {
|
|
32595
|
+
show: true,
|
|
32596
|
+
align: "right",
|
|
32597
|
+
minWidth: 0,
|
|
32598
|
+
maxWidth: 160,
|
|
32599
|
+
style: {
|
|
32600
|
+
colors: ["#808080"],
|
|
32601
|
+
fontSize: "16px",
|
|
32602
|
+
fontFamily: "Roboto",
|
|
32603
|
+
fontWeight: 400,
|
|
32604
|
+
cssClass: "apexcharts-yaxis-label"
|
|
32605
|
+
},
|
|
32606
|
+
formatter: function formatter(value) {
|
|
32607
|
+
return "" + (!percentData ? value : value + "%");
|
|
32608
|
+
},
|
|
32609
|
+
offsetX: 0,
|
|
32610
|
+
offsetY: 0,
|
|
32611
|
+
rotate: 0
|
|
32612
|
+
},
|
|
32613
|
+
decimalsInFloat: 0
|
|
32614
|
+
},
|
|
32615
|
+
tooltip: {
|
|
32616
|
+
shared: false,
|
|
32617
|
+
y: {
|
|
32618
|
+
formatter: function formatter(value) {
|
|
32619
|
+
return "" + (!percentData ? value : value.toFixed(2) + "%");
|
|
32620
|
+
}
|
|
32621
|
+
},
|
|
32622
|
+
onDatasetHover: {
|
|
32623
|
+
highlightDataSeries: true
|
|
32624
|
+
}
|
|
32625
|
+
},
|
|
32626
|
+
legend: {
|
|
32627
|
+
show: isShowChartLabel
|
|
32628
|
+
}
|
|
32629
|
+
};
|
|
32630
|
+
};
|
|
32631
|
+
var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, newseries) {
|
|
32632
|
+
return {
|
|
32633
|
+
chart: {
|
|
32634
|
+
height: 350,
|
|
32635
|
+
stacked: false,
|
|
32636
|
+
toolbar: {
|
|
32637
|
+
show: false
|
|
32638
|
+
}
|
|
32639
|
+
},
|
|
32640
|
+
plotOptions: {
|
|
32641
|
+
bar: {
|
|
32642
|
+
columnWidth: "50%",
|
|
32643
|
+
borderRadius: 5
|
|
32644
|
+
}
|
|
32645
|
+
},
|
|
32646
|
+
dataLabels: {
|
|
32647
|
+
enabled: false
|
|
32648
|
+
},
|
|
32649
|
+
fill: {
|
|
32650
|
+
opacity: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
|
|
32651
|
+
if ((item === null || item === void 0 ? void 0 : item.type) == "area") {
|
|
32652
|
+
return 0.2;
|
|
32653
|
+
}
|
|
32654
|
+
|
|
32655
|
+
return 0.6;
|
|
32656
|
+
})
|
|
32657
|
+
},
|
|
32658
|
+
colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
|
|
32659
|
+
return activeData[index];
|
|
32660
|
+
}),
|
|
32661
|
+
stroke: {
|
|
32662
|
+
curve: "smooth",
|
|
32663
|
+
show: true,
|
|
32664
|
+
colors: COLOR_CHART_AND_PERCENTS$2.filter(function (_, index) {
|
|
32665
|
+
return activeData[index];
|
|
32666
|
+
}),
|
|
32667
|
+
width: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
|
|
32668
|
+
if ((item === null || item === void 0 ? void 0 : item.type) == "area") {
|
|
32669
|
+
return 2;
|
|
32670
|
+
}
|
|
32671
|
+
|
|
32672
|
+
return 0;
|
|
32673
|
+
}),
|
|
32674
|
+
dashArray: 0
|
|
32675
|
+
},
|
|
32676
|
+
xaxis: {
|
|
32677
|
+
categories: months,
|
|
32678
|
+
labels: {
|
|
32679
|
+
show: true,
|
|
32680
|
+
style: {
|
|
32681
|
+
colors: ["#808080"],
|
|
32682
|
+
fontSize: "16px",
|
|
32683
|
+
fontFamily: "Roboto",
|
|
32684
|
+
fontWeight: 400,
|
|
32685
|
+
cssClass: "apexcharts-yaxis-label"
|
|
32686
|
+
}
|
|
32687
|
+
}
|
|
32688
|
+
},
|
|
32689
|
+
yaxis: {
|
|
32690
|
+
tickAmount: 2,
|
|
32691
|
+
min: 0,
|
|
32692
|
+
max: 100,
|
|
32693
|
+
labels: {
|
|
32694
|
+
show: true,
|
|
32695
|
+
align: "right",
|
|
32696
|
+
minWidth: 0,
|
|
32697
|
+
maxWidth: 160,
|
|
32698
|
+
style: {
|
|
32699
|
+
colors: ["#808080"],
|
|
32700
|
+
fontSize: "16px",
|
|
32701
|
+
fontFamily: "Roboto",
|
|
32702
|
+
fontWeight: 400,
|
|
32703
|
+
cssClass: "apexcharts-yaxis-label"
|
|
32704
|
+
},
|
|
32705
|
+
formatter: function formatter(value) {
|
|
32706
|
+
return value + "%";
|
|
32707
|
+
},
|
|
32708
|
+
offsetX: 0,
|
|
32709
|
+
offsetY: 0,
|
|
32710
|
+
rotate: 0
|
|
32711
|
+
},
|
|
32712
|
+
decimalsInFloat: 0
|
|
32713
|
+
},
|
|
32714
|
+
tooltip: {
|
|
32715
|
+
shared: false,
|
|
32716
|
+
enabledOnSeries: handleViewSeriesActive(activeData),
|
|
32717
|
+
y: {
|
|
32718
|
+
formatter: function formatter(value) {
|
|
32719
|
+
return value.toFixed(2) + "%";
|
|
32720
|
+
}
|
|
32721
|
+
},
|
|
32722
|
+
onDatasetHover: {
|
|
32723
|
+
highlightDataSeries: true
|
|
32724
|
+
}
|
|
32725
|
+
},
|
|
32726
|
+
legend: {
|
|
32727
|
+
show: false
|
|
32728
|
+
}
|
|
32729
|
+
};
|
|
32730
|
+
};
|
|
32731
|
+
var pieChartOptions = {
|
|
32732
|
+
labels: LABEL_NAME_PIE_CHART,
|
|
32733
|
+
colors: COLOR_LABEL_PIE,
|
|
32734
|
+
legend: {
|
|
32735
|
+
show: false
|
|
32736
|
+
},
|
|
32737
|
+
chart: {
|
|
32738
|
+
height: "100%"
|
|
32739
|
+
},
|
|
32740
|
+
plotOptions: {
|
|
32741
|
+
pie: {
|
|
32742
|
+
donut: {
|
|
32743
|
+
size: "15%"
|
|
32744
|
+
}
|
|
32745
|
+
}
|
|
32746
|
+
},
|
|
32747
|
+
dataLabels: {
|
|
32748
|
+
enabled: false
|
|
32749
|
+
},
|
|
32750
|
+
fill: {
|
|
32751
|
+
colors: COLOR_CHART_AND_PIE
|
|
32752
|
+
},
|
|
32753
|
+
stroke: {
|
|
32754
|
+
colors: COLOR_CHART_AND_PIE,
|
|
32755
|
+
width: 1
|
|
32756
|
+
},
|
|
32757
|
+
states: {
|
|
32758
|
+
normal: {
|
|
32759
|
+
filter: {
|
|
32760
|
+
type: "none",
|
|
32761
|
+
value: 0
|
|
32762
|
+
}
|
|
32763
|
+
},
|
|
32764
|
+
hover: {
|
|
32765
|
+
filter: {
|
|
32766
|
+
type: "none",
|
|
32767
|
+
value: 0
|
|
32768
|
+
}
|
|
32769
|
+
},
|
|
32770
|
+
active: {
|
|
32771
|
+
filter: {
|
|
32772
|
+
type: "none",
|
|
32773
|
+
value: 0
|
|
32774
|
+
}
|
|
32775
|
+
}
|
|
32776
|
+
}
|
|
32777
|
+
};
|
|
32778
|
+
|
|
32779
|
+
var useContainerDimensions = function useContainerDimensions(myRef) {
|
|
32780
|
+
var _myRef$current;
|
|
32781
|
+
|
|
32782
|
+
var _useState = React.useState({
|
|
32783
|
+
width: 0,
|
|
32784
|
+
height: 0
|
|
32785
|
+
}),
|
|
32786
|
+
dimensions = _useState[0],
|
|
32787
|
+
setDimensions = _useState[1];
|
|
32788
|
+
|
|
32789
|
+
React.useEffect(function () {
|
|
32790
|
+
var getDimensions = function getDimensions() {
|
|
32791
|
+
return {
|
|
32792
|
+
width: myRef.current.offsetWidth,
|
|
32793
|
+
height: myRef.current.offsetHeight
|
|
32794
|
+
};
|
|
32795
|
+
};
|
|
32796
|
+
|
|
32797
|
+
var handleResize = function handleResize() {
|
|
32798
|
+
setDimensions(getDimensions());
|
|
32799
|
+
};
|
|
32800
|
+
|
|
32801
|
+
if (myRef.current) {
|
|
32802
|
+
setDimensions(getDimensions());
|
|
32803
|
+
}
|
|
32804
|
+
|
|
32805
|
+
window.addEventListener("resize", handleResize);
|
|
32806
|
+
return function () {
|
|
32807
|
+
window.removeEventListener("resize", handleResize);
|
|
32808
|
+
};
|
|
32809
|
+
}, [myRef === null || myRef === void 0 ? void 0 : (_myRef$current = myRef.current) === null || _myRef$current === void 0 ? void 0 : _myRef$current.offsetWidth]);
|
|
32810
|
+
return dimensions;
|
|
32811
|
+
};
|
|
32812
|
+
|
|
32813
|
+
var PieChart = function PieChart(_ref) {
|
|
32814
|
+
var data = _ref.data,
|
|
32815
|
+
name = _ref.name;
|
|
32816
|
+
var ref = React.useRef(null);
|
|
32817
|
+
|
|
32818
|
+
var _useContainerDimensio = useContainerDimensions(ref),
|
|
32819
|
+
width = _useContainerDimensio.width;
|
|
32820
|
+
|
|
32821
|
+
if (!data) return React__default.createElement("div", {
|
|
32822
|
+
className: "flex justify-content-center align-items-center",
|
|
32823
|
+
style: {
|
|
32824
|
+
height: 450
|
|
32825
|
+
}
|
|
32826
|
+
}, React__default.createElement("div", null, "No Data"));
|
|
32827
|
+
var series = [data.numberSurveyBlue, data.numberSurveyRed, data.numberSurveyYellow];
|
|
32828
|
+
return React__default.createElement("div", {
|
|
32829
|
+
className: styles$2["pie-chart"],
|
|
32830
|
+
ref: ref
|
|
32831
|
+
}, React__default.createElement("div", {
|
|
32832
|
+
className: styles$2["box-chart-title"]
|
|
32833
|
+
}, React__default.createElement("p", {
|
|
32834
|
+
className: styles$2["title-chart"]
|
|
32835
|
+
}, name)), React__default.createElement("div", {
|
|
32836
|
+
className: styles$2["box-chart"] + " " + (width == 0 && styles$2["h-75"])
|
|
32837
|
+
}, React__default.createElement(Chart, {
|
|
32838
|
+
options: pieChartOptions,
|
|
32839
|
+
series: series,
|
|
32840
|
+
type: "donut",
|
|
32841
|
+
width: width || "100%",
|
|
32842
|
+
height: width || "100%"
|
|
32843
|
+
}), React__default.createElement("div", {
|
|
32844
|
+
className: "" + styles$2["legend-pie-custom"]
|
|
32845
|
+
}, COLOR_NAME.map(function (color, index) {
|
|
32846
|
+
return React__default.createElement("div", {
|
|
32847
|
+
className: "" + styles$2["legend-item"]
|
|
32848
|
+
}, React__default.createElement("div", {
|
|
32849
|
+
className: "" + styles$2["color-box"],
|
|
32850
|
+
style: {
|
|
32851
|
+
backgroundColor: COLOR_CHART_AND_PIE[index]
|
|
32852
|
+
}
|
|
32853
|
+
}), React__default.createElement("div", {
|
|
32854
|
+
className: "" + styles$2["text"]
|
|
32855
|
+
}, color));
|
|
32856
|
+
}))));
|
|
32857
|
+
};
|
|
32858
|
+
|
|
32859
|
+
var BarChart$1 = function BarChart(_ref) {
|
|
32860
|
+
var series = _ref.series,
|
|
32861
|
+
months = _ref.months,
|
|
32862
|
+
activeColumn = _ref.activeColumn,
|
|
32863
|
+
isShowChartLabel = _ref.isShowChartLabel,
|
|
32864
|
+
percentData = _ref.percentData;
|
|
32865
|
+
return React__default.createElement(Chart, {
|
|
32866
|
+
options: optionColumnChartAndPercents$1(months, activeColumn, false, isShowChartLabel, percentData, series),
|
|
32867
|
+
type: "bar",
|
|
32868
|
+
series: series,
|
|
32869
|
+
width: "100%",
|
|
32870
|
+
height: 450
|
|
32871
|
+
});
|
|
32872
|
+
};
|
|
32873
|
+
|
|
32874
|
+
var CheckboxCustom$1 = function CheckboxCustom(_ref) {
|
|
32875
|
+
var _ref$background = _ref.background,
|
|
32876
|
+
background = _ref$background === void 0 ? "#2B4DC0" : _ref$background,
|
|
32877
|
+
_ref$width = _ref.width,
|
|
32878
|
+
width = _ref$width === void 0 ? 16 : _ref$width,
|
|
32879
|
+
_ref$height = _ref.height,
|
|
32880
|
+
height = _ref$height === void 0 ? 16 : _ref$height,
|
|
32881
|
+
_ref$isActive = _ref.isActive,
|
|
32882
|
+
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
32883
|
+
_ref$className = _ref.className,
|
|
32884
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
32885
|
+
onClick = _ref.onClick;
|
|
32886
|
+
return React__default.createElement("div", {
|
|
32887
|
+
className: className,
|
|
32888
|
+
onClick: onClick,
|
|
32889
|
+
style: {
|
|
32890
|
+
cursor: "pointer"
|
|
32891
|
+
}
|
|
32892
|
+
}, isActive ? React__default.createElement("svg", {
|
|
32893
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32894
|
+
width: width,
|
|
32895
|
+
height: height,
|
|
32896
|
+
viewBox: "0 0 24 24",
|
|
32897
|
+
fill: "none"
|
|
32898
|
+
}, React__default.createElement("rect", {
|
|
32899
|
+
x: "2.5",
|
|
32900
|
+
y: "2.5",
|
|
32901
|
+
width: "19",
|
|
32902
|
+
height: "19",
|
|
32903
|
+
rx: "1.5",
|
|
32904
|
+
fill: background,
|
|
32905
|
+
stroke: background
|
|
32906
|
+
}), React__default.createElement("path", {
|
|
32907
|
+
d: "M7.3335 12.6667L10.0002 15.3334L16.6668 8.66669",
|
|
32908
|
+
stroke: "white",
|
|
32909
|
+
"stroke-width": "2",
|
|
32910
|
+
"stroke-linecap": "round",
|
|
32911
|
+
"stroke-linejoin": "round"
|
|
32912
|
+
})) : React__default.createElement("div", {
|
|
32913
|
+
style: {
|
|
32914
|
+
width: width,
|
|
32915
|
+
height: height,
|
|
32916
|
+
background: "#FCFCFC",
|
|
32917
|
+
border: "1px solid #CCCCCC",
|
|
32918
|
+
borderRadius: 2,
|
|
32919
|
+
cursor: "pointer",
|
|
32920
|
+
marginTop: 3
|
|
32921
|
+
}
|
|
32922
|
+
}));
|
|
32923
|
+
};
|
|
32924
|
+
|
|
32925
|
+
var ChoiceChartType = function ChoiceChartType(_ref) {
|
|
32926
|
+
var onChangeChart = _ref.onChangeChart,
|
|
32927
|
+
_ref$typeChart = _ref.typeChart,
|
|
32928
|
+
typeChart = _ref$typeChart === void 0 ? [TYPECHART$2.BAR] : _ref$typeChart,
|
|
32929
|
+
options = _ref.options;
|
|
32930
|
+
return React__default.createElement("div", {
|
|
32931
|
+
className: "d-flex align-items-center d-inline-block"
|
|
32932
|
+
}, React__default.createElement("div", {
|
|
32933
|
+
className: "d-flex align-items-center px-2 " + styles$2["checkbox-chart"]
|
|
32934
|
+
}, React__default.createElement("div", {
|
|
32935
|
+
className: "pr-4 d-flex align-items-center",
|
|
32936
|
+
onClick: function onClick() {
|
|
32937
|
+
return onChangeChart === null || onChangeChart === void 0 ? void 0 : onChangeChart(options[0].value);
|
|
32938
|
+
},
|
|
32939
|
+
style: {
|
|
32940
|
+
cursor: "pointer"
|
|
32941
|
+
}
|
|
32942
|
+
}, React__default.createElement(CheckboxCustom$1, {
|
|
32943
|
+
width: 16,
|
|
32944
|
+
height: 16,
|
|
32945
|
+
isActive: typeChart.includes(TYPECHART$2.BOTH),
|
|
32946
|
+
className: "pr-2 d-flex align-items-center"
|
|
32947
|
+
}), React__default.createElement("label", {
|
|
32948
|
+
className: "" + styles$2["label-chart"],
|
|
32949
|
+
style: {
|
|
32950
|
+
color: "#252733",
|
|
32951
|
+
marginBottom: 0,
|
|
32952
|
+
cursor: "pointer"
|
|
32953
|
+
}
|
|
32954
|
+
}, "Ridge charts"))), React__default.createElement("div", {
|
|
32955
|
+
className: "d-inline-block " + styles$2["checkbox-chart"]
|
|
32956
|
+
}, React__default.createElement("div", {
|
|
32957
|
+
className: "pr-4 d-flex align-items-center",
|
|
32958
|
+
onClick: function onClick() {
|
|
32959
|
+
return onChangeChart === null || onChangeChart === void 0 ? void 0 : onChangeChart(options[1].value);
|
|
32960
|
+
},
|
|
32961
|
+
style: {
|
|
32962
|
+
cursor: "pointer"
|
|
32963
|
+
}
|
|
32964
|
+
}, React__default.createElement(CheckboxCustom$1, {
|
|
32965
|
+
width: 16,
|
|
32966
|
+
height: 16,
|
|
32967
|
+
isActive: typeChart.includes(TYPECHART$2.LINE) || typeChart.includes(TYPECHART$2.BAR),
|
|
32968
|
+
className: "pr-2 d-flex align-items-center"
|
|
32969
|
+
}), React__default.createElement("label", {
|
|
32970
|
+
className: "" + styles$2["label-chart"],
|
|
32971
|
+
style: {
|
|
32972
|
+
color: "#252733",
|
|
32973
|
+
marginBottom: 0,
|
|
32974
|
+
cursor: "pointer"
|
|
32975
|
+
}
|
|
32976
|
+
}, options[1].value === TYPECHART$2.BAR ? "Bar charts" : "Line charts"))));
|
|
32977
|
+
};
|
|
32978
|
+
|
|
32979
|
+
var AreaChart$1 = function AreaChart(_ref) {
|
|
32980
|
+
var series = _ref.series,
|
|
32981
|
+
months = _ref.months,
|
|
32982
|
+
activeColumn = _ref.activeColumn,
|
|
32983
|
+
percentData = _ref.percentData;
|
|
32984
|
+
return React__default.createElement(Chart, {
|
|
32985
|
+
options: optionColumnChartAndPercents$1(months, activeColumn, true, false, percentData),
|
|
32986
|
+
type: "area",
|
|
32987
|
+
series: series,
|
|
32988
|
+
width: "100%",
|
|
32989
|
+
height: 450
|
|
32990
|
+
});
|
|
32991
|
+
};
|
|
32992
|
+
|
|
32993
|
+
var BarAndAreaChart = function BarAndAreaChart(_ref) {
|
|
32994
|
+
var series = _ref.series,
|
|
32995
|
+
months = _ref.months,
|
|
32996
|
+
activeColumn = _ref.activeColumn;
|
|
32997
|
+
var newseries = mergeBarChartAndArea(series);
|
|
32998
|
+
return React__default.createElement(Chart, {
|
|
32999
|
+
options: optionBarChartAndArea(months, activeColumn, newseries),
|
|
33000
|
+
series: newseries,
|
|
33001
|
+
width: "100%",
|
|
33002
|
+
height: 450
|
|
33003
|
+
});
|
|
33004
|
+
};
|
|
33005
|
+
|
|
33006
|
+
var ChartViewDashboard = function ChartViewDashboard(_ref) {
|
|
33007
|
+
var data = _ref.data,
|
|
33008
|
+
typeChart = _ref.typeChart,
|
|
33009
|
+
onActiveColumn = _ref.onActiveColumn,
|
|
33010
|
+
activeColumn = _ref.activeColumn,
|
|
33011
|
+
series = _ref.series,
|
|
33012
|
+
avg = _ref.avg,
|
|
33013
|
+
months = _ref.months,
|
|
33014
|
+
onChangeChart = _ref.onChangeChart,
|
|
33015
|
+
optionType = _ref.optionType,
|
|
33016
|
+
name = _ref.name,
|
|
33017
|
+
_ref$isShowChartLabel = _ref.isShowChartLabel,
|
|
33018
|
+
isShowChartLabel = _ref$isShowChartLabel === void 0 ? false : _ref$isShowChartLabel,
|
|
33019
|
+
_ref$percentData = _ref.percentData,
|
|
33020
|
+
percentData = _ref$percentData === void 0 ? true : _ref$percentData,
|
|
33021
|
+
classFontSize = _ref.classFontSize;
|
|
33022
|
+
|
|
33023
|
+
var _useTranslation = marioCore.useTranslation(),
|
|
33024
|
+
t = _useTranslation.t;
|
|
33025
|
+
|
|
33026
|
+
if (!data) return React__default.createElement("div", {
|
|
33027
|
+
className: "flex justify-content-center align-items-center",
|
|
33028
|
+
style: {
|
|
33029
|
+
height: 450
|
|
33030
|
+
}
|
|
33031
|
+
}, React__default.createElement("p", null, t("no_data")));
|
|
33032
|
+
return React__default.createElement("div", {
|
|
33033
|
+
key: name,
|
|
33034
|
+
className: " " + styles$2["size-100"] + " " + styles$2[classFontSize != null ? classFontSize : '']
|
|
33035
|
+
}, React__default.createElement("div", {
|
|
33036
|
+
className: "" + styles$2["block-header-chart"]
|
|
33037
|
+
}, React__default.createElement("p", {
|
|
33038
|
+
className: "" + styles$2["title-chart"]
|
|
33039
|
+
}, t(name)), !!onChangeChart && !!optionType && React__default.createElement(ChoiceChartType, {
|
|
33040
|
+
onChangeChart: onChangeChart,
|
|
33041
|
+
options: optionType,
|
|
33042
|
+
typeChart: typeChart
|
|
33043
|
+
})), React__default.createElement("div", {
|
|
33044
|
+
className: "" + styles$2["column-chart-percent"]
|
|
33045
|
+
}, !!onActiveColumn && React__default.createElement("div", {
|
|
33046
|
+
className: "" + styles$2["listItem"]
|
|
33047
|
+
}, data.map(function (month, index) {
|
|
33048
|
+
return React__default.createElement("div", {
|
|
33049
|
+
className: "" + styles$2["item-checkbox"],
|
|
33050
|
+
key: index
|
|
33051
|
+
}, React__default.createElement(CheckboxCustom$1, {
|
|
33052
|
+
background: COLOR_CHART_AND_PERCENTS$1[index],
|
|
33053
|
+
width: 16,
|
|
33054
|
+
height: 16,
|
|
33055
|
+
isActive: activeColumn[index],
|
|
33056
|
+
className: "" + styles$2["check-box"],
|
|
33057
|
+
onClick: function onClick() {
|
|
33058
|
+
return onActiveColumn === null || onActiveColumn === void 0 ? void 0 : onActiveColumn(index);
|
|
33059
|
+
}
|
|
33060
|
+
}), React__default.createElement("label", {
|
|
33061
|
+
className: "" + styles$2["label-chart"],
|
|
33062
|
+
style: {
|
|
33063
|
+
color: !activeColumn[index] ? "#CCCCCC" : "#4D4D4D",
|
|
33064
|
+
marginBottom: 0,
|
|
33065
|
+
cursor: "pointer"
|
|
33066
|
+
},
|
|
33067
|
+
onClick: function onClick() {
|
|
33068
|
+
return onActiveColumn === null || onActiveColumn === void 0 ? void 0 : onActiveColumn(index);
|
|
33069
|
+
}
|
|
33070
|
+
}, month));
|
|
33071
|
+
})), React__default.createElement("div", {
|
|
33072
|
+
className: "w-100",
|
|
33073
|
+
style: {
|
|
33074
|
+
height: 450
|
|
33075
|
+
}
|
|
33076
|
+
}, typeChart.includes(TYPECHART$1.BOTH) && typeChart.length == 1 && React__default.createElement(AreaChart$1, {
|
|
33077
|
+
months: months,
|
|
33078
|
+
activeColumn: activeColumn,
|
|
33079
|
+
series: series,
|
|
33080
|
+
percentData: percentData
|
|
33081
|
+
}), typeChart.includes(TYPECHART$1.BAR) && typeChart.length == 1 && React__default.createElement(BarChart$1, {
|
|
33082
|
+
months: months,
|
|
33083
|
+
activeColumn: activeColumn,
|
|
33084
|
+
series: series,
|
|
33085
|
+
isShowChartLabel: isShowChartLabel,
|
|
33086
|
+
percentData: percentData
|
|
33087
|
+
}), typeChart.includes(TYPECHART$1.BOTH) && typeChart.includes(TYPECHART$1.BAR) && React__default.createElement(BarAndAreaChart, {
|
|
33088
|
+
months: months,
|
|
33089
|
+
activeColumn: activeColumn,
|
|
33090
|
+
series: series
|
|
33091
|
+
})), !!avg && React__default.createElement("div", {
|
|
33092
|
+
className: "" + styles$2["listItem"]
|
|
33093
|
+
}, data.map(function (month, index) {
|
|
33094
|
+
return avg[index] > 0 && React__default.createElement("div", {
|
|
33095
|
+
className: "" + styles$2["item-legend"],
|
|
33096
|
+
key: index
|
|
33097
|
+
}, React__default.createElement("div", {
|
|
33098
|
+
className: "" + styles$2["item"]
|
|
33099
|
+
}, React__default.createElement("div", {
|
|
33100
|
+
className: "" + styles$2["mark-custom"],
|
|
33101
|
+
style: {
|
|
33102
|
+
backgroundColor: COLOR_CHART_AND_PERCENTS$1[index]
|
|
33103
|
+
}
|
|
33104
|
+
}), React__default.createElement("label", {
|
|
33105
|
+
className: "" + styles$2["label-legend-custom"]
|
|
33106
|
+
}, month)), React__default.createElement("div", {
|
|
33107
|
+
className: "" + styles$2["percent"]
|
|
33108
|
+
}, React__default.createElement("label", {
|
|
33109
|
+
className: "" + styles$2["m-0"]
|
|
33110
|
+
}, avg[index].toFixed(2))));
|
|
33111
|
+
}))));
|
|
33112
|
+
};
|
|
33113
|
+
|
|
33114
|
+
var SurveyDashboard = function SurveyDashboard() {
|
|
33115
|
+
var _useTranslation = marioCore.useTranslation(),
|
|
33116
|
+
t = _useTranslation.t;
|
|
33117
|
+
|
|
33118
|
+
var _useChartDatas = useChartDatas$1(),
|
|
33119
|
+
filter = _useChartDatas.filter,
|
|
33120
|
+
LIST_FILTERS_LEFT = _useChartDatas.LIST_FILTERS_LEFT,
|
|
33121
|
+
LIST_FILTERS_RIGHT = _useChartDatas.LIST_FILTERS_RIGHT,
|
|
33122
|
+
totalCardData = _useChartDatas.totalCardData,
|
|
33123
|
+
onChangeFilters = _useChartDatas.onChangeFilters,
|
|
33124
|
+
topMostSurveyUsed = _useChartDatas.topMostSurveyUsed,
|
|
33125
|
+
surveyFlagData = _useChartDatas.surveyFlagData,
|
|
33126
|
+
templateSurveyDashboard = _useChartDatas.templateSurveyDashboard,
|
|
33127
|
+
avgResult = _useChartDatas.avgResult,
|
|
33128
|
+
seriseResult = _useChartDatas.seriseResult,
|
|
33129
|
+
activeColumnResult = _useChartDatas.activeColumnResult,
|
|
33130
|
+
handleActiveColumnOneToOne = _useChartDatas.handleActiveColumnOneToOne,
|
|
33131
|
+
typeChartList = _useChartDatas.typeChartList,
|
|
33132
|
+
onChangeChart = _useChartDatas.onChangeChart;
|
|
33133
|
+
|
|
33134
|
+
console.log({
|
|
33135
|
+
LIST_FILTERS_RIGHT: LIST_FILTERS_RIGHT
|
|
33136
|
+
});
|
|
33137
|
+
return React__default.createElement("div", {
|
|
33138
|
+
className: styles$2["block-dashboard"] + " mb-5"
|
|
33139
|
+
}, React__default.createElement("div", {
|
|
33140
|
+
className: "d-flex align-items-center justify-content-between"
|
|
33141
|
+
}, React__default.createElement("div", {
|
|
33142
|
+
className: "d-flex align-items-center mx-3"
|
|
33143
|
+
}, React__default.createElement("h4", {
|
|
33144
|
+
className: styles$2["title-dashboard"] + " m-0"
|
|
33145
|
+
}, t('survey_dashboard')))), React__default.createElement("div", {
|
|
33146
|
+
className: "d-flex justify-content-between flex-wrap my-2"
|
|
33147
|
+
}, React__default.createElement("div", {
|
|
33148
|
+
className: "d-flex"
|
|
33149
|
+
}, LIST_FILTERS_LEFT.map(function (e) {
|
|
33150
|
+
return React__default.createElement(SelectFilter, {
|
|
33151
|
+
name: e.name,
|
|
33152
|
+
icon: e.icon,
|
|
33153
|
+
handleChangeFilters: e.handleChangeFilters,
|
|
33154
|
+
filter: filter,
|
|
33155
|
+
option: e.option,
|
|
33156
|
+
onChangeFilters: onChangeFilters
|
|
33157
|
+
});
|
|
33158
|
+
})), React__default.createElement("div", {
|
|
33159
|
+
className: "d-flex"
|
|
33160
|
+
}, LIST_FILTERS_RIGHT.map(function (e) {
|
|
33161
|
+
return React__default.createElement(SelectFilter, {
|
|
33162
|
+
name: e.name,
|
|
33163
|
+
icon: e.icon,
|
|
33164
|
+
handleChangeFilters: e.handleChangeFilters,
|
|
33165
|
+
filter: filter,
|
|
33166
|
+
option: e.option,
|
|
33167
|
+
studentId: e.studentId || 0,
|
|
33168
|
+
studentDefault: e.studentDefault,
|
|
33169
|
+
onChangeFilters: onChangeFilters,
|
|
33170
|
+
btnStyle: e.name === FILTER_NAME.StudentName ? {
|
|
33171
|
+
minWidth: 220,
|
|
33172
|
+
justifyContent: "center"
|
|
33173
|
+
} : {}
|
|
33174
|
+
});
|
|
33175
|
+
}))), React__default.createElement("div", {
|
|
33176
|
+
className: "d-flex align-items-center flex-wrap mb-3"
|
|
33177
|
+
}, totalCardData.map(function (item) {
|
|
33178
|
+
return React__default.createElement(TotalCard$1, {
|
|
33179
|
+
icon: item.icon,
|
|
33180
|
+
title: t("" + item.title),
|
|
33181
|
+
value: item.value,
|
|
33182
|
+
isUp: item.isUp,
|
|
33183
|
+
deviant: item.deviant,
|
|
33184
|
+
filter: item.filter
|
|
33185
|
+
});
|
|
33186
|
+
})), React__default.createElement("div", {
|
|
33187
|
+
className: "shadow-lg mb-3 " + styles$2["chart-header-wrapper"]
|
|
33188
|
+
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
33189
|
+
md: 7
|
|
33190
|
+
}, React__default.createElement(TopMostSurveyUsed$1, {
|
|
33191
|
+
data: topMostSurveyUsed
|
|
33192
|
+
})), React__default.createElement(reactstrap.Col, {
|
|
33193
|
+
md: 5
|
|
33194
|
+
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
33195
|
+
md: 7,
|
|
33196
|
+
style: {
|
|
33197
|
+
margin: "0 auto"
|
|
33198
|
+
}
|
|
33199
|
+
}, React__default.createElement(PieChart, {
|
|
33200
|
+
data: surveyFlagData,
|
|
33201
|
+
name: "Flag"
|
|
33202
|
+
})))))), React__default.createElement(reactstrap.Row, {
|
|
33203
|
+
className: "" + styles$2["chart-view-dashboard"]
|
|
33204
|
+
}, React__default.createElement(reactstrap.Col, {
|
|
33205
|
+
md: 12
|
|
33206
|
+
}, React__default.createElement(ChartViewDashboard, {
|
|
33207
|
+
name: "survey_result",
|
|
33208
|
+
data: convertDataToDataChart$1(templateSurveyDashboard),
|
|
33209
|
+
months: templateSurveyDashboard.map(function (r) {
|
|
33210
|
+
return r.month || "";
|
|
33211
|
+
}),
|
|
33212
|
+
series: seriseResult,
|
|
33213
|
+
activeColumn: activeColumnResult,
|
|
33214
|
+
onActiveColumn: handleActiveColumnOneToOne,
|
|
33215
|
+
typeChart: typeChartList,
|
|
33216
|
+
onChangeChart: onChangeChart,
|
|
33217
|
+
avg: avgResult,
|
|
33218
|
+
optionType: [{
|
|
33219
|
+
label: "Ridge charts",
|
|
33220
|
+
value: TYPECHART$2.BOTH
|
|
33221
|
+
}, {
|
|
33222
|
+
label: "Bar charts",
|
|
33223
|
+
value: TYPECHART$2.BAR
|
|
33224
|
+
}]
|
|
33225
|
+
}))));
|
|
33226
|
+
};
|
|
33227
|
+
|
|
31588
33228
|
core.LicenseManager.setLicenseKey(marioCore.LICENSE_AGGRID);
|
|
31589
33229
|
|
|
31590
33230
|
exports.AdminTraining = AdminTraining;
|
|
@@ -31619,6 +33259,7 @@ exports.SessionTemplateList = SessionTemplateList;
|
|
|
31619
33259
|
exports.SetupContainer = SetupContainer;
|
|
31620
33260
|
exports.SubjectList = SubjectList;
|
|
31621
33261
|
exports.SuggestionList = SuggestionBankList;
|
|
33262
|
+
exports.SurveyDashboard = SurveyDashboard;
|
|
31622
33263
|
exports.SurveyQuestionContainer = SurveyQuestionContainer;
|
|
31623
33264
|
exports.TutorialScreenContainer = TutorialScreenContainer;
|
|
31624
33265
|
//# sourceMappingURL=index.js.map
|