principal-dashboard-lib-v2 0.0.30 → 0.0.31
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/bundles/principal-dashboard-lib-v2.umd.js +259 -9
- package/bundles/principal-dashboard-lib-v2.umd.js.map +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js.map +1 -1
- package/esm2015/lib/chartheader/chartheader.component.js +2 -2
- package/esm2015/lib/chartview/chartview.component.js +3 -1
- package/esm2015/lib/full-table-view/full-table-view.component.js +17 -7
- package/esm2015/lib/principal-dashboard-lib-v2.component.js +2 -2
- package/esm2015/lib/principal-dashboard-lib-v2.module.js +4 -2
- package/esm2015/lib/principal-dashboard-lib-v2.service.js +3 -1
- package/esm2015/lib/small-table-view/small-table-view.component.js +229 -0
- package/esm2015/principal-dashboard-lib-v2.js +2 -1
- package/fesm2015/principal-dashboard-lib-v2.js +252 -10
- package/fesm2015/principal-dashboard-lib-v2.js.map +1 -1
- package/lib/principal-dashboard-lib-v2.service.d.ts +2 -0
- package/lib/small-table-view/small-table-view.component.d.ts +24 -0
- package/package.json +1 -1
- package/principal-dashboard-lib-v2.d.ts +1 -0
- package/principal-dashboard-lib-v2.metadata.json +1 -1
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
//for get details of selected user
|
|
30
30
|
this.detailedviewData = new rxjs.BehaviorSubject(this.userMetadata);
|
|
31
31
|
this.detailedviewData$ = this.detailedviewData.asObservable();
|
|
32
|
+
this.openSmallTable = new rxjs.BehaviorSubject(false);
|
|
33
|
+
this.openSmallTable$ = this.openSmallTable.asObservable();
|
|
32
34
|
}
|
|
33
35
|
PrincipalDashboardLibV2Service.prototype.genarateResourseReqiuredData = function (data) {
|
|
34
36
|
this.isResoureMetaDataReady.next(false);
|
|
@@ -868,7 +870,7 @@
|
|
|
868
870
|
PrincipalDashboardLibV2Component.decorators = [
|
|
869
871
|
{ type: i0.Component, args: [{
|
|
870
872
|
selector: 'lib-principal-dashboard-lib-v2',
|
|
871
|
-
template: "<div id=\"reprtModule\">\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\n <!-- <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview> -->\n <lib-full-table-view *ngIf=\"data\" [data]=\"data\"></lib-full-table-view>\n <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview>\n \n </div>\n</div>\n ",
|
|
873
|
+
template: "<div id=\"reprtModule\">\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\n <!-- <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview> -->\n <lib-full-table-view *ngIf=\"data\" [data]=\"data\"></lib-full-table-view>\n <!-- <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview> -->\n <lib-small-table-view *ngIf=\"data\" [data]=\"data\"></lib-small-table-view>\n \n </div>\n</div>\n ",
|
|
872
874
|
styles: [".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;z-index:2}.bs-datepicker-head{background-color:#000!important}"]
|
|
873
875
|
},] }
|
|
874
876
|
];
|
|
@@ -889,7 +891,7 @@
|
|
|
889
891
|
this.isChartView = true;
|
|
890
892
|
}
|
|
891
893
|
ChartheaderComponent.prototype.ngOnInit = function () {
|
|
892
|
-
this.libVersion = "0.0.
|
|
894
|
+
this.libVersion = "0.0.31";
|
|
893
895
|
// this.myIcon = document.getElementById('myIconImg');
|
|
894
896
|
// this.changeChatType()
|
|
895
897
|
};
|
|
@@ -1530,7 +1532,9 @@
|
|
|
1530
1532
|
else {
|
|
1531
1533
|
this.selectedUserData = this.pdService.dataForDetailedView(this.currentdataList.userConsoleData, this.resourceDataList, row);
|
|
1532
1534
|
}
|
|
1535
|
+
var smallData = [{ 'a': this.currentdataList, 'b': row }];
|
|
1533
1536
|
// console.log("this.selectedUserData",this.selectedUserData);
|
|
1537
|
+
this.pdService.openSmallTable.next(this.selectedUserData);
|
|
1534
1538
|
this.pdService.detailedviewData.next(this.selectedUserData);
|
|
1535
1539
|
this.updateChart();
|
|
1536
1540
|
// alluserList
|
|
@@ -2925,12 +2929,12 @@
|
|
|
2925
2929
|
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
2926
2930
|
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
2927
2931
|
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
2928
|
-
var _a, _b, _c, _d;
|
|
2932
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2929
2933
|
var resourceId = userResource.resourceId;
|
|
2930
2934
|
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
2931
2935
|
userResource.type === resource.type; });
|
|
2932
2936
|
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
2933
|
-
var title = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title;
|
|
2937
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
2934
2938
|
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
2935
2939
|
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
2936
2940
|
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
@@ -2939,7 +2943,17 @@
|
|
|
2939
2943
|
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
2940
2944
|
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
2941
2945
|
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
2942
|
-
duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" :
|
|
2946
|
+
//duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" : this.formatTime(duration);
|
|
2947
|
+
if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
|
|
2948
|
+
duration = 0;
|
|
2949
|
+
}
|
|
2950
|
+
else {
|
|
2951
|
+
duration = duration === 0 ? "<span class='seenTag' style='color:blue;'>(Seen)</span>" : _this.formatTime(duration);
|
|
2952
|
+
}
|
|
2953
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
2954
|
+
if (title === '') {
|
|
2955
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
2956
|
+
}
|
|
2943
2957
|
_this.currentUserArray.push({
|
|
2944
2958
|
userId: user.userId,
|
|
2945
2959
|
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
@@ -2953,7 +2967,7 @@
|
|
|
2953
2967
|
subject: subject,
|
|
2954
2968
|
chapter: chapter,
|
|
2955
2969
|
grade: grade,
|
|
2956
|
-
details:
|
|
2970
|
+
details: finalAssetTitle,
|
|
2957
2971
|
});
|
|
2958
2972
|
});
|
|
2959
2973
|
}
|
|
@@ -3060,8 +3074,8 @@
|
|
|
3060
3074
|
FullTableViewComponent.decorators = [
|
|
3061
3075
|
{ type: i0.Component, args: [{
|
|
3062
3076
|
selector: 'lib-full-table-view',
|
|
3063
|
-
template: "\n<div class=\"tableViewList\" *ngIf=\"isDisplay\">\n <!-- <label for=\"usersCheckbox\">All</label>\n <input\n type=\"checkbox\"\n id=\"usersCheckbox\"\n [checked]=\"usersCheckboxChecked\"\n (change)=\"toggleUsers()\"\n /> -->\n <div class=\"tableArea\">\n \n <table id=\"teacherTable\">\n <thead class=\"tablehead\">\n <tr>\n <th>Teacher Name</th>\n <th>Subjects</th>\n <th>Date</th>\n <th>Start Time</th>\n <th>End Time</th>\n <th>Total Duration</th>\n <th>Room</th>\n <th>
|
|
3064
|
-
styles: ["body{font-family:Arial,sans-serif;margin:20px}.tablehead{position:sticky;top:0;background:#fff}table{width:100%;border-collapse:collapse}td,th{border:1px solid #ddd;padding:8px;text-align:left}th{background-color:#f4f4f4;font-weight:700}tr:nth-child(2n){background-color:#f9f9f9}tr:hover{background-color:#f1f1f1}.tableViewList{position:absolute;margin-top:20px}.tableArea{height:700px;overflow:scroll;font-size:12px;margin:20px 5px 5px}.
|
|
3077
|
+
template: "\n<div class=\"tableViewList\" *ngIf=\"isDisplay\">\n <!-- <label for=\"usersCheckbox\">All</label>\n <input\n type=\"checkbox\"\n id=\"usersCheckbox\"\n [checked]=\"usersCheckboxChecked\"\n (change)=\"toggleUsers()\"\n /> -->\n <div class=\"tableArea\">\n \n <table id=\"teacherTable\">\n <thead class=\"tablehead\">\n <tr>\n <th>Teacher Name</th>\n <th>Subjects</th>\n <th>Date</th>\n <th>Start Time</th>\n <th>End Time</th>\n <th>Total Duration</th>\n <th>Room</th>\n <th>Topic</th>\n <th>Subject</th>\n <th>Chapter</th>\n <th>Grade</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of currentUserArray\">\n <td>{{ user.teacherName }}</td>\n <td>{{ user.subjects }}</td>\n <td>{{ user.date }}</td>\n <td>{{ user.startTime }}</td>\n <td>{{ user.endtime }}</td>\n <td>{{ user.totalDuration }}</td>\n <td>{{ user.room }}</td>\n <td>{{ user.tp }}</td>\n <td>{{ user.subject }}</td>\n <td>{{ user.chapter }}</td>\n <td>{{ user.grade }}</td>\n <td><div [innerHTML]=\"user.details\"></div></td>\n </tr>\n </tbody>\n </table>\n </div>\n \n</div>\n ",
|
|
3078
|
+
styles: ["body{font-family:Arial,sans-serif;margin:20px}.tablehead{position:sticky;top:0;background:#fff}table{width:100%;border-collapse:collapse}td,th{border:1px solid #ddd;padding:8px;text-align:left}th{background-color:#f4f4f4;font-weight:700}tr:nth-child(2n){background-color:#f9f9f9}tr:hover{background-color:#f1f1f1}.tableViewList{position:absolute;margin-top:20px}.tableArea{height:700px;overflow:scroll;font-size:12px;margin:20px 5px 5px}.seenTag{color:#00f}"]
|
|
3065
3079
|
},] }
|
|
3066
3080
|
];
|
|
3067
3081
|
FullTableViewComponent.ctorParameters = function () { return [
|
|
@@ -3071,6 +3085,240 @@
|
|
|
3071
3085
|
data: [{ type: i0.Input }]
|
|
3072
3086
|
};
|
|
3073
3087
|
|
|
3088
|
+
var SmallTableViewComponent = /** @class */ (function () {
|
|
3089
|
+
function SmallTableViewComponent(pdService) {
|
|
3090
|
+
this.pdService = pdService;
|
|
3091
|
+
this.currentTimeFrameUserArray = [];
|
|
3092
|
+
this.currentUserArray = [];
|
|
3093
|
+
this.remaningUsers = [];
|
|
3094
|
+
this.allUsers = [];
|
|
3095
|
+
this.usersCheckboxChecked = false;
|
|
3096
|
+
this.isDisplay = false;
|
|
3097
|
+
}
|
|
3098
|
+
Object.defineProperty(SmallTableViewComponent.prototype, "data", {
|
|
3099
|
+
set: function (res) {
|
|
3100
|
+
if (res !== null) {
|
|
3101
|
+
//console.log('smallTable',JSON.parse(res));
|
|
3102
|
+
this.jsonResponse = JSON.parse(res);
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
enumerable: false,
|
|
3106
|
+
configurable: true
|
|
3107
|
+
});
|
|
3108
|
+
SmallTableViewComponent.prototype.ngOnInit = function () {
|
|
3109
|
+
var _this = this;
|
|
3110
|
+
this.pdService.openSmallTable$.subscribe(function (data) {
|
|
3111
|
+
if (data) {
|
|
3112
|
+
_this.isDisplay = true;
|
|
3113
|
+
var userid = _this.findUserIdByName(data['userDetails'][0]);
|
|
3114
|
+
var startTime = data['userDetails'][1];
|
|
3115
|
+
var endTime = data['userDetails'][3];
|
|
3116
|
+
_this.loadUserData(userid, startTime, endTime);
|
|
3117
|
+
}
|
|
3118
|
+
else {
|
|
3119
|
+
_this.isDisplay = false;
|
|
3120
|
+
}
|
|
3121
|
+
});
|
|
3122
|
+
};
|
|
3123
|
+
SmallTableViewComponent.prototype.findUserIdByName = function (name) {
|
|
3124
|
+
var json = this.jsonResponse;
|
|
3125
|
+
var user = json.usersMetadata.userMetadata.find(function (user) { return user.fullName === name; });
|
|
3126
|
+
return user ? user.userId : null;
|
|
3127
|
+
};
|
|
3128
|
+
SmallTableViewComponent.prototype.loadUserData = function (userId, inputStartTime, inputEndTime) {
|
|
3129
|
+
var _this = this;
|
|
3130
|
+
var json = this.jsonResponse;
|
|
3131
|
+
var usersConsole = json.usersConsole.userConsole;
|
|
3132
|
+
var usersMetadata = json.usersMetadata.userMetadata;
|
|
3133
|
+
var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
|
|
3134
|
+
var filteredUsersConsole = userId
|
|
3135
|
+
? usersConsole.filter(function (user) { return user.userId === userId; })
|
|
3136
|
+
: usersConsole;
|
|
3137
|
+
filteredUsersConsole.forEach(function (user) {
|
|
3138
|
+
var _a;
|
|
3139
|
+
var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
|
|
3140
|
+
if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
|
|
3141
|
+
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
3142
|
+
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
3143
|
+
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
3144
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3145
|
+
var resourceId = userResource.resourceId;
|
|
3146
|
+
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
3147
|
+
userResource.type === resource.type; });
|
|
3148
|
+
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
3149
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
3150
|
+
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
3151
|
+
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
3152
|
+
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
3153
|
+
var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
|
|
3154
|
+
var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
|
|
3155
|
+
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
3156
|
+
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
3157
|
+
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
3158
|
+
//duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : this.formatTime(duration);
|
|
3159
|
+
if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
|
|
3160
|
+
duration = 0;
|
|
3161
|
+
}
|
|
3162
|
+
else {
|
|
3163
|
+
duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : _this.formatTime(duration);
|
|
3164
|
+
}
|
|
3165
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
3166
|
+
if (title === '') {
|
|
3167
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
3168
|
+
}
|
|
3169
|
+
_this.currentUserArray.push({
|
|
3170
|
+
userId: user.userId,
|
|
3171
|
+
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
3172
|
+
subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
|
|
3173
|
+
date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
|
|
3174
|
+
startTime: userIndex === 0 ? _this.formatDate(startTime) : _this.formatDate(startTime),
|
|
3175
|
+
endtime: userIndex === 0 ? _this.formatDate(endTime) : _this.formatDate(endTime),
|
|
3176
|
+
totalDuration: userIndex === 0 ? totalDuration : '',
|
|
3177
|
+
room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
|
|
3178
|
+
tp: tp,
|
|
3179
|
+
subject: subject,
|
|
3180
|
+
chapter: chapter,
|
|
3181
|
+
grade: grade,
|
|
3182
|
+
details: finalAssetTitle,
|
|
3183
|
+
});
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
var currentUserIds = this.currentUserArray
|
|
3189
|
+
.map(function (x) { return x.userId; })
|
|
3190
|
+
.filter(function (x, i, a) { return a.indexOf(x) === i; });
|
|
3191
|
+
this.remaningUsers = usersMetadata
|
|
3192
|
+
.filter(function (user) { return !currentUserIds.includes(user.userId); })
|
|
3193
|
+
.map(function (user) {
|
|
3194
|
+
return {
|
|
3195
|
+
userId: user.userId,
|
|
3196
|
+
teacherName: user === null || user === void 0 ? void 0 : user.fullName,
|
|
3197
|
+
subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
|
|
3198
|
+
date: '',
|
|
3199
|
+
startTime: '',
|
|
3200
|
+
endtime: '',
|
|
3201
|
+
totalDuration: '0s',
|
|
3202
|
+
room: '',
|
|
3203
|
+
tp: '',
|
|
3204
|
+
subject: '',
|
|
3205
|
+
chapter: '',
|
|
3206
|
+
grade: '',
|
|
3207
|
+
details: '',
|
|
3208
|
+
};
|
|
3209
|
+
});
|
|
3210
|
+
this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
|
|
3211
|
+
this.currentTimeFrameUserArray = this.filterDataByCriteria(this.currentUserArray, userId, inputStartTime, inputEndTime);
|
|
3212
|
+
//console.log('smallData', this.currentTimeFrameUserArray)
|
|
3213
|
+
};
|
|
3214
|
+
SmallTableViewComponent.prototype.filterDataByCriteria = function (userData, inputUserId, inputStartTime, inputEndTime) {
|
|
3215
|
+
var parseTime = function (timeString) {
|
|
3216
|
+
if (!timeString)
|
|
3217
|
+
return null;
|
|
3218
|
+
var _g = __read(timeString.split(' '), 2), time = _g[0], meridian = _g[1];
|
|
3219
|
+
var _h = __read(time.split(':').map(Number), 3), hours = _h[0], minutes = _h[1], seconds = _h[2];
|
|
3220
|
+
var isPM = meridian === 'PM';
|
|
3221
|
+
return new Date(0, 0, 0, isPM && hours < 12 ? hours + 12 : hours, minutes, seconds);
|
|
3222
|
+
};
|
|
3223
|
+
var startTime = parseTime(inputStartTime);
|
|
3224
|
+
var endTime = parseTime(inputEndTime);
|
|
3225
|
+
var filteredData = userData.filter(function (entry) {
|
|
3226
|
+
if (entry.userId !== inputUserId)
|
|
3227
|
+
return false;
|
|
3228
|
+
if (!entry.startTime || !entry.endtime)
|
|
3229
|
+
return false;
|
|
3230
|
+
var entryStart = parseTime(entry.startTime);
|
|
3231
|
+
var entryEnd = parseTime(entry.endtime);
|
|
3232
|
+
return entryStart && entryEnd && entryStart >= startTime && entryEnd <= endTime;
|
|
3233
|
+
});
|
|
3234
|
+
return filteredData.map(function (entry, index) { return (Object.assign(Object.assign({}, entry), { subsequentCount: index })); });
|
|
3235
|
+
};
|
|
3236
|
+
SmallTableViewComponent.prototype.getDisplayTypeValue = function (key) {
|
|
3237
|
+
var assetTypeConfig = [
|
|
3238
|
+
{ type: 'asset_media', display: 'Media' },
|
|
3239
|
+
{ type: 'asset_print', display: 'Print' },
|
|
3240
|
+
{ type: 'quiz', display: 'Quiz' },
|
|
3241
|
+
{ type: 'question', display: 'Question' },
|
|
3242
|
+
{ type: 'chapter', display: 'Chapter' },
|
|
3243
|
+
{ type: 'tp', display: 'Topic' },
|
|
3244
|
+
{ type: 'whiteboard', display: 'Whiteboard' },
|
|
3245
|
+
{ type: 'widget', display: 'Widget' },
|
|
3246
|
+
{ type: 'casset_media', display: 'cMedia' },
|
|
3247
|
+
{ type: 'casset_print', display: 'cPrint' },
|
|
3248
|
+
{ type: 'cquiz', display: 'cQuiz' },
|
|
3249
|
+
{ type: 'cquestion', display: 'cQuestion' },
|
|
3250
|
+
{ type: 'image', display: 'Image' },
|
|
3251
|
+
{ type: 'video', display: 'Video' },
|
|
3252
|
+
{ type: 'tools', display: 'Tools' },
|
|
3253
|
+
{ type: 'feature', display: 'Feature' },
|
|
3254
|
+
];
|
|
3255
|
+
var asset = assetTypeConfig.find(function (value) { return value.type === key; });
|
|
3256
|
+
return asset ? asset.display : key;
|
|
3257
|
+
};
|
|
3258
|
+
SmallTableViewComponent.prototype.formatDate = function (now) {
|
|
3259
|
+
var hours = now.getHours();
|
|
3260
|
+
var minutes = now.getMinutes();
|
|
3261
|
+
var seconds = now.getSeconds();
|
|
3262
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
3263
|
+
hours = hours % 12 || 12;
|
|
3264
|
+
return hours.toString().padStart(2, '0') + ":" + minutes
|
|
3265
|
+
.toString()
|
|
3266
|
+
.padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
|
|
3267
|
+
};
|
|
3268
|
+
SmallTableViewComponent.prototype.formatTime = function (seconds) {
|
|
3269
|
+
var days = Math.floor(seconds / 86400);
|
|
3270
|
+
var hours = Math.floor((seconds % 86400) / 3600);
|
|
3271
|
+
var minutes = Math.floor((seconds % 3600) / 60);
|
|
3272
|
+
var secs = seconds % 60;
|
|
3273
|
+
if (seconds < 60)
|
|
3274
|
+
return secs + "s";
|
|
3275
|
+
if (seconds < 3600)
|
|
3276
|
+
return minutes + "m " + secs + "s";
|
|
3277
|
+
if (seconds < 86400)
|
|
3278
|
+
return hours + "h " + minutes + "m " + secs + "s";
|
|
3279
|
+
return days + "d " + hours + "h " + minutes + "m " + secs + "s";
|
|
3280
|
+
};
|
|
3281
|
+
SmallTableViewComponent.prototype.loadTable = function (data) {
|
|
3282
|
+
/*
|
|
3283
|
+
const tableBody = document.querySelector("#teacherTable tbody");
|
|
3284
|
+
|
|
3285
|
+
data.forEach((item) => {
|
|
3286
|
+
const row = document.createElement("tr");
|
|
3287
|
+
for (const key in item) {
|
|
3288
|
+
const cell = document.createElement("td");
|
|
3289
|
+
cell.textContent = item[key];
|
|
3290
|
+
if (key !== "userId") {
|
|
3291
|
+
row.appendChild(cell);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
tableBody.appendChild(row);
|
|
3295
|
+
});*/
|
|
3296
|
+
};
|
|
3297
|
+
SmallTableViewComponent.prototype.toggleUsers = function () {
|
|
3298
|
+
this.usersCheckboxChecked = !this.usersCheckboxChecked;
|
|
3299
|
+
this.loadTable(this.usersCheckboxChecked
|
|
3300
|
+
? this.allUsers
|
|
3301
|
+
: this.currentUserArray);
|
|
3302
|
+
};
|
|
3303
|
+
SmallTableViewComponent.prototype.onCloseBtnClick = function () {
|
|
3304
|
+
this.isDisplay = false;
|
|
3305
|
+
};
|
|
3306
|
+
return SmallTableViewComponent;
|
|
3307
|
+
}());
|
|
3308
|
+
SmallTableViewComponent.decorators = [
|
|
3309
|
+
{ type: i0.Component, args: [{
|
|
3310
|
+
selector: 'lib-small-table-view',
|
|
3311
|
+
template: "<div id=\"pd-deatilViewContainer\" *ngIf=\"isDisplay\">\n <div class=\"pd-detailview-header\">\n <div class=\"pd-detailview-title\">Details</div>\n <div id=\"pd-closeButton\" (click)=\"onCloseBtnClick()\">+</div>\n </div>\n\n <div class=\"newTablesContainer\">\n\n <table id=\"userDataTable\" class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Name:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.teacherName || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>Start Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.startTime || '' }}</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.subject || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>End Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.endtime || '' }}M</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Room Details:</label></th>\n <td><label> {{ currentTimeFrameUserArray[0]?.room || '' }}</label></td>\n </tr>\n </tbody>\n </table>\n \n \n\n <table class=\"table table-bordered\" id=\"resoureMetadataTable\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject</label></th>\n <th style=\"font-weight: bold;\"><label>Class</label></th>\n <th style=\"font-weight: bold;\"><label>Chapter Name</label></th>\n <th style=\"font-weight: bold;\"><label>Topic Name</label></th>\n <th style=\"font-weight: bold;\"><label>Assets Details</label></th>\n </tr>\n <tr *ngFor=\"let item of currentTimeFrameUserArray\">\n <td><label>{{ item.subject || '' }}</label></td>\n <td><label>{{ item.grade || '' }}</label></td>\n <td><label>{{ item.chapter || '' }}</label></td>\n <td [innerHTML]=\"item.tp || ''\"></td> <!-- Use innerHTML to handle HTML content -->\n <td [innerHTML]=\"item.details || ''\"></td> <!-- Assets Details column -->\n </tr>\n </tbody>\n </table>\n\n \n </div> \n </div>",
|
|
3312
|
+
styles: ["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}.newTablesContainer{overflow:scroll;height:310px;padding:3px;background:#fff;margin-bottom:2px}.dddd{color:#00f!important}"]
|
|
3313
|
+
},] }
|
|
3314
|
+
];
|
|
3315
|
+
SmallTableViewComponent.ctorParameters = function () { return [
|
|
3316
|
+
{ type: PrincipalDashboardLibV2Service }
|
|
3317
|
+
]; };
|
|
3318
|
+
SmallTableViewComponent.propDecorators = {
|
|
3319
|
+
data: [{ type: i0.Input }]
|
|
3320
|
+
};
|
|
3321
|
+
|
|
3074
3322
|
var PrincipalDashboardLibV2Module = /** @class */ (function () {
|
|
3075
3323
|
function PrincipalDashboardLibV2Module() {
|
|
3076
3324
|
}
|
|
@@ -3085,7 +3333,8 @@
|
|
|
3085
3333
|
HeaderComponent,
|
|
3086
3334
|
TableviewComponent,
|
|
3087
3335
|
PrincipalDashboardLibV2Component,
|
|
3088
|
-
FullTableViewComponent
|
|
3336
|
+
FullTableViewComponent,
|
|
3337
|
+
SmallTableViewComponent
|
|
3089
3338
|
],
|
|
3090
3339
|
imports: [
|
|
3091
3340
|
common.CommonModule,
|
|
@@ -3116,6 +3365,7 @@
|
|
|
3116
3365
|
exports.ɵe = ExceldataService;
|
|
3117
3366
|
exports.ɵf = TableviewComponent;
|
|
3118
3367
|
exports.ɵg = FullTableViewComponent;
|
|
3368
|
+
exports.ɵh = SmallTableViewComponent;
|
|
3119
3369
|
|
|
3120
3370
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3121
3371
|
|