@skysoftware-co/bayan-hr-widgets-ui 1.0.0

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.
@@ -0,0 +1,757 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Input, Output, Component } from '@angular/core';
3
+ import * as i1$1 from 'devextreme-angular';
4
+ import { DxTooltipModule, DxPopupModule, DxScrollViewModule, DxLoadPanelModule } from 'devextreme-angular';
5
+ import { NgClass, DecimalPipe, DatePipe, LowerCasePipe, CommonModule } from '@angular/common';
6
+ import * as i1$2 from '@fortawesome/angular-fontawesome';
7
+ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
8
+ import { BayanEmployeeBadgeComponent } from '@skysoftware-co/bayan-components-ui';
9
+ import * as i2$1 from '@skysoftware-co/sky-components-ui';
10
+ import { SkyShortcutIconComponent, SkyAlertType } from '@skysoftware-co/sky-components-ui';
11
+ import * as i1 from '@angular/common/http';
12
+ import { HttpParams } from '@angular/common/http';
13
+ import { faCakeCandles, faTreePalm, faCalendarStar } from '@fortawesome/pro-light-svg-icons';
14
+ import * as i2 from 'devextreme-angular/core';
15
+
16
+ var MainWidgetShortcut;
17
+ (function (MainWidgetShortcut) {
18
+ MainWidgetShortcut[MainWidgetShortcut["Profile"] = 0] = "Profile";
19
+ MainWidgetShortcut[MainWidgetShortcut["PaySlip"] = 1] = "PaySlip";
20
+ MainWidgetShortcut[MainWidgetShortcut["Attendance"] = 2] = "Attendance";
21
+ MainWidgetShortcut[MainWidgetShortcut["VacationStatement"] = 3] = "VacationStatement";
22
+ MainWidgetShortcut[MainWidgetShortcut["Loans"] = 4] = "Loans";
23
+ })(MainWidgetShortcut || (MainWidgetShortcut = {}));
24
+ var EventOption;
25
+ (function (EventOption) {
26
+ EventOption[EventOption["Birthday"] = 1] = "Birthday";
27
+ EventOption[EventOption["PublicHoliday"] = 2] = "PublicHoliday";
28
+ EventOption[EventOption["All"] = 3] = "All";
29
+ })(EventOption || (EventOption = {}));
30
+ var RelativeDay;
31
+ (function (RelativeDay) {
32
+ RelativeDay[RelativeDay["Today"] = 0] = "Today";
33
+ RelativeDay[RelativeDay["Tomorrow"] = 1] = "Tomorrow";
34
+ RelativeDay[RelativeDay["TwoDays"] = 2] = "TwoDays";
35
+ })(RelativeDay || (RelativeDay = {}));
36
+ var PublicHolidayWeekContext;
37
+ (function (PublicHolidayWeekContext) {
38
+ PublicHolidayWeekContext[PublicHolidayWeekContext["ThisWeek"] = 0] = "ThisWeek";
39
+ PublicHolidayWeekContext[PublicHolidayWeekContext["NextWeek"] = 1] = "NextWeek";
40
+ })(PublicHolidayWeekContext || (PublicHolidayWeekContext = {}));
41
+ var EventTypeEnum;
42
+ (function (EventTypeEnum) {
43
+ EventTypeEnum[EventTypeEnum["Birthdays"] = 1] = "Birthdays";
44
+ EventTypeEnum[EventTypeEnum["PublicHolidays"] = 2] = "PublicHolidays";
45
+ })(EventTypeEnum || (EventTypeEnum = {}));
46
+
47
+ class HrConstantsService {
48
+ defaultVacationBalanceColor = '#727070';
49
+ defaultVacationColor = '#DCDCDC';
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrConstantsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
51
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrConstantsService, providedIn: 'root' });
52
+ }
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrConstantsService, decorators: [{
54
+ type: Injectable,
55
+ args: [{
56
+ providedIn: 'root',
57
+ }]
58
+ }] });
59
+
60
+ class HrMyMainDetailsWidgetComponent {
61
+ http;
62
+ constants;
63
+ employeeMainInfo = null;
64
+ onShortcutClicked = new EventEmitter();
65
+ isLoadingChanged = new EventEmitter();
66
+ badgeClass = 'badge employee-rounded-badge-xl fs-5';
67
+ badgeImageClass = 'rounded-circle shadow-lg';
68
+ badgeWidth = '50px';
69
+ badgeHeight = '50px';
70
+ employeeInfoContainerClass = 'd-flex align-content-center';
71
+ employeeDetailsClass = 'ms-3';
72
+ employeeNameContainerClass = 'd-flex align-items-center';
73
+ employeeNameClass = 'fs-14 text-dark-gray fw-medium text-ellipsis-one-line';
74
+ employeePositionClass = 'fs-12 fw-normal text-dark-gray text-ellipsis-one-line mb-1';
75
+ employeeGradeClass = 'fs-12 text-dark-gray';
76
+ containerClass = 'card rounded rounded-4 card-shadow p-16 border-top-0 mb-4';
77
+ cardBodyClass = 'card-body p-4';
78
+ headerRowClass = 'd-md-flex justify-content-between align-items-center mt-2 mb-3';
79
+ shortcutsContainerClass = 'd-flex justify-content-md-end justify-content-sm-start fs-12 fw-normal text-secondary mt-3 mt-md-0';
80
+ shortcutItemClass = 'd-flex flex-column align-items-center mx-2 wp-60';
81
+ shortcutIconContainerClass = 'd-flex justify-content-center align-items-center rounded-circle-40 cursor-pointer';
82
+ shortcutIconClass = 'fs-4';
83
+ shortcutTextClass = 'text-center mt-1';
84
+ detailsRowClass = 'd-flex mt-4';
85
+ reportingBlockClass = 'd-flex text-secondary align-items-center mb-2 mx-2';
86
+ captionLabelClasses = 'd-flex flex-column align-self-start fs-14 text-dark-gray';
87
+ captionLabelValueClass = 'fw-medium mt-2';
88
+ vacationBalancesContainerClass = 'd-flex text-secondary align-items-center mb-2';
89
+ vacationBalanceItemClass = 'd-flex flex-column me-4';
90
+ vacationBalanceHeaderClass = 'd-flex align-items-center';
91
+ vacationColorDotClass = 'vacation-color-container-sm';
92
+ vacationTypeNameClass = 'mx-2 fs-14 fw-normal text-dark-gray';
93
+ vacationBalanceValueRowClass = 'd-flex mt-2';
94
+ vacationBalanceValueClass = 'mx-2 fw-medium fs-14 text-dark-gray';
95
+ tooltipTriggerLinkClass = 'd-flex align-items-center cursor-pointer';
96
+ tooltipTriggerTextClass = 'mx-2 fs-14 text-dark-gray';
97
+ tooltipVacationRowClass = 'd-flex align-items-center justify-content-around fs-12 mb-2';
98
+ tooltipVacationNameContainerClass = 'd-flex flex-grow-1 align-items-center me-5';
99
+ tooltipVacationNameClass = 'mx-2';
100
+ reportingToLabel = 'ReportingTo';
101
+ emptyReportingToLabel = 'NotAnknown';
102
+ serviceYearsLabel = 'ServiceYears';
103
+ moreLabel = 'More';
104
+ dayLabel = 'day';
105
+ daysLabel = 'days';
106
+ yearsLabel = 'Years';
107
+ monthsLabel = 'Months';
108
+ defaultVacationBalanceColor;
109
+ defaultVacationColor;
110
+ baseUrl = '';
111
+ employeeBadge = {
112
+ EmployeePhotoKey: null,
113
+ EmployeePhotoFailed: false,
114
+ EmployeeNameInitials: ''
115
+ };
116
+ isMobile = false;
117
+ isTablet = false;
118
+ shortcuts = [];
119
+ constructor(http, constants) {
120
+ this.http = http;
121
+ this.constants = constants;
122
+ this.defaultVacationBalanceColor = this.constants.defaultVacationBalanceColor;
123
+ this.defaultVacationColor = this.constants.defaultVacationColor;
124
+ }
125
+ ngOnInit() {
126
+ this.loadEmployeeMainInfo();
127
+ }
128
+ loadEmployeeMainInfo() {
129
+ this.isLoadingChanged.emit(true);
130
+ this.getEmployeeMainDetails().subscribe({
131
+ next: (data) => {
132
+ const responses = data.ResponseData;
133
+ this.employeeMainInfo = {
134
+ EmployeeNumber: responses.EmployeeNumber,
135
+ EmployeeName: responses.EmployeeName,
136
+ EmployeeNameInitials: responses.EmployeeNameInitials,
137
+ PositionName: responses.PositionName,
138
+ GradeName: responses.GradeName,
139
+ PhotoPath: responses.PhotoPath,
140
+ ReportingTo: responses.ReportingToEmployeeName,
141
+ ServiceYears: `${responses.ServicePeriod.Years} ${this.yearsLabel} ${responses.ServicePeriod.Months} ${this.monthsLabel}`,
142
+ VacationBalances: responses.VacationBalances,
143
+ AttendanceUrl: responses.AttendanceReportUrl,
144
+ VacationStatementUrl: responses.VacationStatementReportUrl,
145
+ };
146
+ this.employeeBadge.EmployeePhotoKey = this.employeeMainInfo.PhotoPath || null;
147
+ this.employeeBadge.EmployeeNameInitials = this.employeeMainInfo.EmployeeNameInitials || '';
148
+ this.employeeBadge.EmployeePhotoFailed = false;
149
+ this.employeeMainInfo.VacationBalances.forEach(v => {
150
+ if (v.VacationTypeColor == null)
151
+ v.VacationTypeColor = this.defaultVacationColor;
152
+ });
153
+ this.shortcuts.forEach(item => {
154
+ if (item.shortcutId == MainWidgetShortcut.Attendance && this.employeeMainInfo?.AttendanceUrl != null)
155
+ item.navigateUrl = [this.employeeMainInfo.AttendanceUrl];
156
+ if (item.shortcutId == MainWidgetShortcut.VacationStatement && this.employeeMainInfo?.VacationStatementUrl != null)
157
+ item.navigateUrl = [this.employeeMainInfo.VacationStatementUrl];
158
+ });
159
+ this.isLoadingChanged.emit(false);
160
+ },
161
+ error: (error) => {
162
+ this.isLoadingChanged.emit(false);
163
+ if (error.status == 401)
164
+ return;
165
+ },
166
+ });
167
+ }
168
+ shortcutClicked(icon) {
169
+ this.onShortcutClicked.emit(icon);
170
+ }
171
+ handleEmployeePhotoError() {
172
+ this.employeeBadge.EmployeePhotoFailed = true;
173
+ }
174
+ getEmployeeMainDetails() {
175
+ return this.http.get(`${this.baseUrl}/hr/employee-portal/main-details`, {
176
+ headers: { 'api-version': '2' }
177
+ });
178
+ }
179
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrMyMainDetailsWidgetComponent, deps: [{ token: i1.HttpClient }, { token: HrConstantsService }], target: i0.ɵɵFactoryTarget.Component });
180
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: HrMyMainDetailsWidgetComponent, isStandalone: true, selector: "hr-my-main-details-widget", inputs: { badgeClass: "badgeClass", badgeImageClass: "badgeImageClass", badgeWidth: "badgeWidth", badgeHeight: "badgeHeight", employeeInfoContainerClass: "employeeInfoContainerClass", employeeDetailsClass: "employeeDetailsClass", employeeNameContainerClass: "employeeNameContainerClass", employeeNameClass: "employeeNameClass", employeePositionClass: "employeePositionClass", employeeGradeClass: "employeeGradeClass", containerClass: "containerClass", cardBodyClass: "cardBodyClass", headerRowClass: "headerRowClass", shortcutsContainerClass: "shortcutsContainerClass", shortcutItemClass: "shortcutItemClass", shortcutIconContainerClass: "shortcutIconContainerClass", shortcutIconClass: "shortcutIconClass", shortcutTextClass: "shortcutTextClass", detailsRowClass: "detailsRowClass", reportingBlockClass: "reportingBlockClass", captionLabelClasses: "captionLabelClasses", captionLabelValueClass: "captionLabelValueClass", vacationBalancesContainerClass: "vacationBalancesContainerClass", vacationBalanceItemClass: "vacationBalanceItemClass", vacationBalanceHeaderClass: "vacationBalanceHeaderClass", vacationColorDotClass: "vacationColorDotClass", vacationTypeNameClass: "vacationTypeNameClass", vacationBalanceValueRowClass: "vacationBalanceValueRowClass", vacationBalanceValueClass: "vacationBalanceValueClass", tooltipTriggerLinkClass: "tooltipTriggerLinkClass", tooltipTriggerTextClass: "tooltipTriggerTextClass", tooltipVacationRowClass: "tooltipVacationRowClass", tooltipVacationNameContainerClass: "tooltipVacationNameContainerClass", tooltipVacationNameClass: "tooltipVacationNameClass", reportingToLabel: "reportingToLabel", emptyReportingToLabel: "emptyReportingToLabel", serviceYearsLabel: "serviceYearsLabel", moreLabel: "moreLabel", dayLabel: "dayLabel", daysLabel: "daysLabel", yearsLabel: "yearsLabel", monthsLabel: "monthsLabel", defaultVacationBalanceColor: "defaultVacationBalanceColor", defaultVacationColor: "defaultVacationColor", baseUrl: "baseUrl", isMobile: "isMobile", isTablet: "isTablet", shortcuts: "shortcuts" }, outputs: { onShortcutClicked: "onShortcutClicked", isLoadingChanged: "isLoadingChanged" }, ngImport: i0, template: "<div [class]=\"containerClass\">\r\n <div [class]=\"cardBodyClass\">\r\n <div [class]=\"headerRowClass\">\r\n <div>\r\n @if(employeeMainInfo!=null){\r\n <div [class]=\"employeeInfoContainerClass\">\r\n <bayan-employee-badge [badge]=\"employeeBadge\"\r\n [badgeClass]=\"badgeClass\"\r\n [imageClass]=\"badgeImageClass\"\r\n [width]=\"badgeWidth\"\r\n [height]=\"badgeHeight\"\r\n (employeePhotoError)=\"handleEmployeePhotoError()\"></bayan-employee-badge>\r\n\r\n <div [class]=\"employeeDetailsClass\">\r\n <div [class]=\"employeeNameContainerClass\">\r\n <div [class]=\"employeeNameClass\"\r\n data-bs-toggle=\"tooltip\" [title]=\"employeeMainInfo.EmployeeNumber+' | '+ employeeMainInfo.EmployeeName\">\r\n {{employeeMainInfo.EmployeeNumber + ' | ' + employeeMainInfo.EmployeeName}}\r\n </div>\r\n </div>\r\n @if(employeeMainInfo.PositionName != null && employeeMainInfo.PositionName != ''){\r\n <div [class]=\"employeePositionClass\"\r\n data-bs-toggle=\"tooltip\"\r\n [title]=\"employeeMainInfo.PositionName\">\r\n {{employeeMainInfo.PositionName}}\r\n </div>\r\n }\r\n @if(employeeMainInfo.GradeName !=null){\r\n <div [class]=\"employeeGradeClass\" [title]=\"employeeMainInfo.GradeName\">\r\n {{employeeMainInfo.GradeName}}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <div [class]=\"shortcutsContainerClass\">\r\n @for(Icon of shortcuts ; track Icon ; let i = $index;){\r\n <sky-shortcut-icon [shortcut]=\"Icon\"\r\n [itemClass]=\"shortcutItemClass\"\r\n [iconContainerClass]=\"shortcutIconContainerClass\"\r\n [iconClass]=\"shortcutIconClass\"\r\n [textClass]=\"shortcutTextClass\"\r\n (onClicked)=\"shortcutClicked($event)\"></sky-shortcut-icon>\r\n }\r\n </div>\r\n </div>\r\n <div [class]=\"detailsRowClass\" [ngClass]=\"{'flex-wrap': isMobile || isTablet}\">\r\n <div [class]=\"reportingBlockClass\" [ngClass]=\"{'mb-3': isMobile}\">\r\n <div [class]=\"captionLabelClasses + ' me-5'\">\r\n <div>\r\n {{reportingToLabel}}\r\n </div>\r\n <div [class]=\"captionLabelValueClass\">\r\n @if(employeeMainInfo?.ReportingTo){\r\n {{employeeMainInfo?.ReportingTo}}\r\n }@else{\r\n {{emptyReportingToLabel}}\r\n }\r\n </div>\r\n </div>\r\n <div [class]=\"captionLabelClasses\" [ngClass]=\"{'border-end border-1 pe-4': !isMobile}\">\r\n <div>\r\n {{serviceYearsLabel}}\r\n </div>\r\n <div [class]=\"captionLabelValueClass\">\r\n {{employeeMainInfo?.ServiceYears}}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex-grow-1\" [ngClass]=\"{' ms-4': !isMobile && !isTablet, 'w-100': isTablet}\">\r\n <div [class]=\"vacationBalancesContainerClass\" [ngClass]=\"{'flex-wrap': isMobile,'w-100': isTablet}\">\r\n @for(vacationBalance of employeeMainInfo?.VacationBalances ; track vacationBalance ; let i = $index;){\r\n @if(i <= 2 || employeeMainInfo?.VacationBalances?.length == 4) {\r\n <div [class]=\"vacationBalanceItemClass\" [ngClass]=\"{'mb-2 w-40': isMobile}\">\r\n <div [class]=\"vacationBalanceHeaderClass\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"vacationBalance.VacationTypeColor\"></div>\r\n </div>\r\n <div [class]=\"vacationTypeNameClass\">\r\n {{vacationBalance.VacationTypeName}}\r\n </div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueRowClass\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle invisible\" style=\"height: 11px; width: 11px;\"></div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueClass\">{{vacationBalance.CurrentBalance | number:'1.2-2'}} {{vacationBalance.CurrentBalance! == 1 ? dayLabel : daysLabel}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @if(employeeMainInfo?.VacationBalances && employeeMainInfo!.VacationBalances!.length > 4){\r\n <div [class]=\"vacationBalanceItemClass\">\r\n <div [class]=\"tooltipTriggerLinkClass\" id=\"otherVacationBalances\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"defaultVacationBalanceColor\"></div>\r\n </div>\r\n <div [class]=\"tooltipTriggerTextClass\">\r\n +{{(employeeMainInfo!.VacationBalances!.length - 3)}} {{moreLabel}}\r\n </div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueRowClass\" style=\"visibility: hidden\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\"></div>\r\n </div>\r\n <div class=\"mx-1 fw-medium fs-14 text-dark-gray\">{{moreLabel}}</div>\r\n </div>\r\n <dx-tooltip [target]=\"'#otherVacationBalances'\"\r\n [showEvent]=\"'mouseenter'\"\r\n [hideEvent]=\"'mouseleave'\">\r\n @for (vacationBalance of employeeMainInfo!.VacationBalances! ; track vacationBalance; let i = $index;){\r\n @if(i > 2){\r\n <div [class]=\"tooltipVacationRowClass\">\r\n <div [class]=\"tooltipVacationNameContainerClass\">\r\n\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"vacationBalance.VacationTypeColor\"></div>\r\n </div>\r\n <div [class]=\"tooltipVacationNameClass\">\r\n {{vacationBalance.VacationTypeName}}\r\n </div>\r\n </div>\r\n <div>{{vacationBalance.CurrentBalance | number:'1.2-2'}} {{vacationBalance.CurrentBalance! == 1 ? dayLabel : daysLabel}}</div>\r\n </div>\r\n }\r\n }\r\n </dx-tooltip>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: DxTooltipModule }, { kind: "component", type: i1$1.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "deferRendering", "disabled", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "deferRenderingChange", "disabledChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "component", type: BayanEmployeeBadgeComponent, selector: "bayan-employee-badge", inputs: ["badge", "width", "height", "imageClass", "badgeClass"], outputs: ["employeePhotoError"] }, { kind: "component", type: SkyShortcutIconComponent, selector: "sky-shortcut-icon", inputs: ["shortcut", "itemClass", "iconContainerClass", "iconClass", "textClass"], outputs: ["onClicked"] }] });
181
+ }
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrMyMainDetailsWidgetComponent, decorators: [{
183
+ type: Component,
184
+ args: [{ selector: 'hr-my-main-details-widget', standalone: true, imports: [DxTooltipModule, NgClass, FontAwesomeModule, DecimalPipe, BayanEmployeeBadgeComponent, SkyShortcutIconComponent], template: "<div [class]=\"containerClass\">\r\n <div [class]=\"cardBodyClass\">\r\n <div [class]=\"headerRowClass\">\r\n <div>\r\n @if(employeeMainInfo!=null){\r\n <div [class]=\"employeeInfoContainerClass\">\r\n <bayan-employee-badge [badge]=\"employeeBadge\"\r\n [badgeClass]=\"badgeClass\"\r\n [imageClass]=\"badgeImageClass\"\r\n [width]=\"badgeWidth\"\r\n [height]=\"badgeHeight\"\r\n (employeePhotoError)=\"handleEmployeePhotoError()\"></bayan-employee-badge>\r\n\r\n <div [class]=\"employeeDetailsClass\">\r\n <div [class]=\"employeeNameContainerClass\">\r\n <div [class]=\"employeeNameClass\"\r\n data-bs-toggle=\"tooltip\" [title]=\"employeeMainInfo.EmployeeNumber+' | '+ employeeMainInfo.EmployeeName\">\r\n {{employeeMainInfo.EmployeeNumber + ' | ' + employeeMainInfo.EmployeeName}}\r\n </div>\r\n </div>\r\n @if(employeeMainInfo.PositionName != null && employeeMainInfo.PositionName != ''){\r\n <div [class]=\"employeePositionClass\"\r\n data-bs-toggle=\"tooltip\"\r\n [title]=\"employeeMainInfo.PositionName\">\r\n {{employeeMainInfo.PositionName}}\r\n </div>\r\n }\r\n @if(employeeMainInfo.GradeName !=null){\r\n <div [class]=\"employeeGradeClass\" [title]=\"employeeMainInfo.GradeName\">\r\n {{employeeMainInfo.GradeName}}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <div [class]=\"shortcutsContainerClass\">\r\n @for(Icon of shortcuts ; track Icon ; let i = $index;){\r\n <sky-shortcut-icon [shortcut]=\"Icon\"\r\n [itemClass]=\"shortcutItemClass\"\r\n [iconContainerClass]=\"shortcutIconContainerClass\"\r\n [iconClass]=\"shortcutIconClass\"\r\n [textClass]=\"shortcutTextClass\"\r\n (onClicked)=\"shortcutClicked($event)\"></sky-shortcut-icon>\r\n }\r\n </div>\r\n </div>\r\n <div [class]=\"detailsRowClass\" [ngClass]=\"{'flex-wrap': isMobile || isTablet}\">\r\n <div [class]=\"reportingBlockClass\" [ngClass]=\"{'mb-3': isMobile}\">\r\n <div [class]=\"captionLabelClasses + ' me-5'\">\r\n <div>\r\n {{reportingToLabel}}\r\n </div>\r\n <div [class]=\"captionLabelValueClass\">\r\n @if(employeeMainInfo?.ReportingTo){\r\n {{employeeMainInfo?.ReportingTo}}\r\n }@else{\r\n {{emptyReportingToLabel}}\r\n }\r\n </div>\r\n </div>\r\n <div [class]=\"captionLabelClasses\" [ngClass]=\"{'border-end border-1 pe-4': !isMobile}\">\r\n <div>\r\n {{serviceYearsLabel}}\r\n </div>\r\n <div [class]=\"captionLabelValueClass\">\r\n {{employeeMainInfo?.ServiceYears}}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex-grow-1\" [ngClass]=\"{' ms-4': !isMobile && !isTablet, 'w-100': isTablet}\">\r\n <div [class]=\"vacationBalancesContainerClass\" [ngClass]=\"{'flex-wrap': isMobile,'w-100': isTablet}\">\r\n @for(vacationBalance of employeeMainInfo?.VacationBalances ; track vacationBalance ; let i = $index;){\r\n @if(i <= 2 || employeeMainInfo?.VacationBalances?.length == 4) {\r\n <div [class]=\"vacationBalanceItemClass\" [ngClass]=\"{'mb-2 w-40': isMobile}\">\r\n <div [class]=\"vacationBalanceHeaderClass\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"vacationBalance.VacationTypeColor\"></div>\r\n </div>\r\n <div [class]=\"vacationTypeNameClass\">\r\n {{vacationBalance.VacationTypeName}}\r\n </div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueRowClass\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle invisible\" style=\"height: 11px; width: 11px;\"></div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueClass\">{{vacationBalance.CurrentBalance | number:'1.2-2'}} {{vacationBalance.CurrentBalance! == 1 ? dayLabel : daysLabel}}</div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @if(employeeMainInfo?.VacationBalances && employeeMainInfo!.VacationBalances!.length > 4){\r\n <div [class]=\"vacationBalanceItemClass\">\r\n <div [class]=\"tooltipTriggerLinkClass\" id=\"otherVacationBalances\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"defaultVacationBalanceColor\"></div>\r\n </div>\r\n <div [class]=\"tooltipTriggerTextClass\">\r\n +{{(employeeMainInfo!.VacationBalances!.length - 3)}} {{moreLabel}}\r\n </div>\r\n </div>\r\n <div [class]=\"vacationBalanceValueRowClass\" style=\"visibility: hidden\">\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\"></div>\r\n </div>\r\n <div class=\"mx-1 fw-medium fs-14 text-dark-gray\">{{moreLabel}}</div>\r\n </div>\r\n <dx-tooltip [target]=\"'#otherVacationBalances'\"\r\n [showEvent]=\"'mouseenter'\"\r\n [hideEvent]=\"'mouseleave'\">\r\n @for (vacationBalance of employeeMainInfo!.VacationBalances! ; track vacationBalance; let i = $index;){\r\n @if(i > 2){\r\n <div [class]=\"tooltipVacationRowClass\">\r\n <div [class]=\"tooltipVacationNameContainerClass\">\r\n\r\n <div [class]=\"vacationColorDotClass\">\r\n <div class=\"rounded rounded-circle\" style=\"height: 11px; width: 11px;\" [style.background-color]=\"vacationBalance.VacationTypeColor\"></div>\r\n </div>\r\n <div [class]=\"tooltipVacationNameClass\">\r\n {{vacationBalance.VacationTypeName}}\r\n </div>\r\n </div>\r\n <div>{{vacationBalance.CurrentBalance | number:'1.2-2'}} {{vacationBalance.CurrentBalance! == 1 ? dayLabel : daysLabel}}</div>\r\n </div>\r\n }\r\n }\r\n </dx-tooltip>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
185
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: HrConstantsService }], propDecorators: { onShortcutClicked: [{
186
+ type: Output
187
+ }], isLoadingChanged: [{
188
+ type: Output
189
+ }], badgeClass: [{
190
+ type: Input
191
+ }], badgeImageClass: [{
192
+ type: Input
193
+ }], badgeWidth: [{
194
+ type: Input
195
+ }], badgeHeight: [{
196
+ type: Input
197
+ }], employeeInfoContainerClass: [{
198
+ type: Input
199
+ }], employeeDetailsClass: [{
200
+ type: Input
201
+ }], employeeNameContainerClass: [{
202
+ type: Input
203
+ }], employeeNameClass: [{
204
+ type: Input
205
+ }], employeePositionClass: [{
206
+ type: Input
207
+ }], employeeGradeClass: [{
208
+ type: Input
209
+ }], containerClass: [{
210
+ type: Input
211
+ }], cardBodyClass: [{
212
+ type: Input
213
+ }], headerRowClass: [{
214
+ type: Input
215
+ }], shortcutsContainerClass: [{
216
+ type: Input
217
+ }], shortcutItemClass: [{
218
+ type: Input
219
+ }], shortcutIconContainerClass: [{
220
+ type: Input
221
+ }], shortcutIconClass: [{
222
+ type: Input
223
+ }], shortcutTextClass: [{
224
+ type: Input
225
+ }], detailsRowClass: [{
226
+ type: Input
227
+ }], reportingBlockClass: [{
228
+ type: Input
229
+ }], captionLabelClasses: [{
230
+ type: Input
231
+ }], captionLabelValueClass: [{
232
+ type: Input
233
+ }], vacationBalancesContainerClass: [{
234
+ type: Input
235
+ }], vacationBalanceItemClass: [{
236
+ type: Input
237
+ }], vacationBalanceHeaderClass: [{
238
+ type: Input
239
+ }], vacationColorDotClass: [{
240
+ type: Input
241
+ }], vacationTypeNameClass: [{
242
+ type: Input
243
+ }], vacationBalanceValueRowClass: [{
244
+ type: Input
245
+ }], vacationBalanceValueClass: [{
246
+ type: Input
247
+ }], tooltipTriggerLinkClass: [{
248
+ type: Input
249
+ }], tooltipTriggerTextClass: [{
250
+ type: Input
251
+ }], tooltipVacationRowClass: [{
252
+ type: Input
253
+ }], tooltipVacationNameContainerClass: [{
254
+ type: Input
255
+ }], tooltipVacationNameClass: [{
256
+ type: Input
257
+ }], reportingToLabel: [{
258
+ type: Input
259
+ }], emptyReportingToLabel: [{
260
+ type: Input
261
+ }], serviceYearsLabel: [{
262
+ type: Input
263
+ }], moreLabel: [{
264
+ type: Input
265
+ }], dayLabel: [{
266
+ type: Input
267
+ }], daysLabel: [{
268
+ type: Input
269
+ }], yearsLabel: [{
270
+ type: Input
271
+ }], monthsLabel: [{
272
+ type: Input
273
+ }], defaultVacationBalanceColor: [{
274
+ type: Input
275
+ }], defaultVacationColor: [{
276
+ type: Input
277
+ }], baseUrl: [{
278
+ type: Input
279
+ }], isMobile: [{
280
+ type: Input
281
+ }], isTablet: [{
282
+ type: Input
283
+ }], shortcuts: [{
284
+ type: Input
285
+ }] } });
286
+
287
+ class HrCardHeaderComponent {
288
+ icon;
289
+ title;
290
+ containerClass = 'd-flex align-items-center mb-2';
291
+ iconClass = 'fs-6 text-primary pe-2';
292
+ titleClass = 'text-center table-header-lg fw-medium';
293
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrCardHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
294
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: HrCardHeaderComponent, isStandalone: true, selector: "hr-card-header", inputs: { icon: "icon", title: "title", containerClass: "containerClass", iconClass: "iconClass", titleClass: "titleClass" }, ngImport: i0, template: "<div [class]=\"containerClass\">\r\n <fa-icon [icon]=\"icon\" [class]=\"iconClass\"></fa-icon>\r\n <span [class]=\"titleClass\">{{ title }}</span>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] });
295
+ }
296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrCardHeaderComponent, decorators: [{
297
+ type: Component,
298
+ args: [{ selector: 'hr-card-header', standalone: true, imports: [FontAwesomeModule], template: "<div [class]=\"containerClass\">\r\n <fa-icon [icon]=\"icon\" [class]=\"iconClass\"></fa-icon>\r\n <span [class]=\"titleClass\">{{ title }}</span>\r\n</div>\r\n" }]
299
+ }], propDecorators: { icon: [{
300
+ type: Input
301
+ }], title: [{
302
+ type: Input
303
+ }], containerClass: [{
304
+ type: Input
305
+ }], iconClass: [{
306
+ type: Input
307
+ }], titleClass: [{
308
+ type: Input
309
+ }] } });
310
+
311
+ class HrEventItemComponent {
312
+ events = [];
313
+ showDates = false;
314
+ showProperty = true;
315
+ selectedLanguage = 'en';
316
+ selectedEventType = null;
317
+ weekendWarningDescription = null;
318
+ labels;
319
+ eventIconClass = 'fs-6 text-primary pe-2';
320
+ eventNameBoldClass = 'fw-medium';
321
+ eventDescriptionClass = 'text-primary fw-medium';
322
+ propertyBadgeClass = 'property-badge cursor-pointer me-1';
323
+ noEventsTextClass = 'text-center my-4 text-light-gray';
324
+ warningTextClass = 'text-center my-2 text-light-gray';
325
+ dateFormat = 'dd/MM/yyyy';
326
+ eventTypeEnum = EventTypeEnum;
327
+ cakeCandles = faCakeCandles;
328
+ treePalm = faTreePalm;
329
+ get isArabic() { return this.selectedLanguage === 'ar'; }
330
+ isBirthday(event) { return event.EventType === EventTypeEnum.Birthdays; }
331
+ hasPropertyBadge(event) { return this.showProperty && !!event.PropertySymbol; }
332
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
333
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: HrEventItemComponent, isStandalone: true, selector: "hr-event-item", inputs: { events: "events", showDates: "showDates", showProperty: "showProperty", selectedLanguage: "selectedLanguage", selectedEventType: "selectedEventType", weekendWarningDescription: "weekendWarningDescription", labels: "labels", eventIconClass: "eventIconClass", eventNameBoldClass: "eventNameBoldClass", eventDescriptionClass: "eventDescriptionClass", propertyBadgeClass: "propertyBadgeClass", noEventsTextClass: "noEventsTextClass", warningTextClass: "warningTextClass", dateFormat: "dateFormat" }, ngImport: i0, template: "@if (events.length > 0) {\r\n<div>\r\n @for (event of events; track event) {\r\n <div [class]=\"'d-flex ' + (showDates ? 'my-3' : 'my-1')\">\r\n <fa-icon [icon]=\"isBirthday(event) ? cakeCandles : treePalm\"\r\n [class]=\"eventIconClass\"\r\n [title]=\"isBirthday(event) ? labels.birthday : labels.publicHoliday\">\r\n </fa-icon>\r\n\r\n <div>\r\n @if (isBirthday(event)) {\r\n @if (hasPropertyBadge(event)) {\r\n <span [class]=\"propertyBadgeClass\" [title]=\"event.PropertyName!\">{{ event.PropertySymbol }}</span>\r\n }\r\n @if (isArabic) {\r\n <span>{{ labels.birthday }}</span>\r\n <span [class]=\"eventNameBoldClass\">{{ ' ' + event.Name + ' ' }}</span>\r\n @if (event.IsIn2Days) { <span>{{ labels.during }} </span> }\r\n } @else {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }}'s </span>\r\n <span>{{ labels.birthday }} {{ (event.IsIn2Days ? labels.isIn : labels.is) | lowercase }} </span>\r\n }\r\n } @else {\r\n @if (isArabic) {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }}</span> <span> {{ labels.in + ' ' }}</span>\r\n } @else {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }} </span><span>{{ ' ' + (labels.is | lowercase) }} </span>\r\n }\r\n }\r\n\r\n <span [class]=\"eventDescriptionClass\">{{ event.Description }}</span>\r\n\r\n @if (!isBirthday(event) && showDates && event.StartDate && event.EndDate) {\r\n <span>{{ ' (' + (event.StartDate | date:dateFormat) + ' - ' + (event.EndDate | date:dateFormat) + ')' }}</span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n} @else {\r\n@if (weekendWarningDescription) {\r\n<div [class]=\"warningTextClass\">{{ weekendWarningDescription }}</div>\r\n} @else {\r\n<div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n}\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: LowerCasePipe, name: "lowercase" }] });
334
+ }
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventItemComponent, decorators: [{
336
+ type: Component,
337
+ args: [{ selector: 'hr-event-item', standalone: true, imports: [FontAwesomeModule, DatePipe, LowerCasePipe], template: "@if (events.length > 0) {\r\n<div>\r\n @for (event of events; track event) {\r\n <div [class]=\"'d-flex ' + (showDates ? 'my-3' : 'my-1')\">\r\n <fa-icon [icon]=\"isBirthday(event) ? cakeCandles : treePalm\"\r\n [class]=\"eventIconClass\"\r\n [title]=\"isBirthday(event) ? labels.birthday : labels.publicHoliday\">\r\n </fa-icon>\r\n\r\n <div>\r\n @if (isBirthday(event)) {\r\n @if (hasPropertyBadge(event)) {\r\n <span [class]=\"propertyBadgeClass\" [title]=\"event.PropertyName!\">{{ event.PropertySymbol }}</span>\r\n }\r\n @if (isArabic) {\r\n <span>{{ labels.birthday }}</span>\r\n <span [class]=\"eventNameBoldClass\">{{ ' ' + event.Name + ' ' }}</span>\r\n @if (event.IsIn2Days) { <span>{{ labels.during }} </span> }\r\n } @else {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }}'s </span>\r\n <span>{{ labels.birthday }} {{ (event.IsIn2Days ? labels.isIn : labels.is) | lowercase }} </span>\r\n }\r\n } @else {\r\n @if (isArabic) {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }}</span> <span> {{ labels.in + ' ' }}</span>\r\n } @else {\r\n <span [class]=\"eventNameBoldClass\">{{ event.Name }} </span><span>{{ ' ' + (labels.is | lowercase) }} </span>\r\n }\r\n }\r\n\r\n <span [class]=\"eventDescriptionClass\">{{ event.Description }}</span>\r\n\r\n @if (!isBirthday(event) && showDates && event.StartDate && event.EndDate) {\r\n <span>{{ ' (' + (event.StartDate | date:dateFormat) + ' - ' + (event.EndDate | date:dateFormat) + ')' }}</span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n} @else {\r\n@if (weekendWarningDescription) {\r\n<div [class]=\"warningTextClass\">{{ weekendWarningDescription }}</div>\r\n} @else {\r\n<div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n}\r\n}\r\n" }]
338
+ }], propDecorators: { events: [{
339
+ type: Input
340
+ }], showDates: [{
341
+ type: Input
342
+ }], showProperty: [{
343
+ type: Input
344
+ }], selectedLanguage: [{
345
+ type: Input
346
+ }], selectedEventType: [{
347
+ type: Input
348
+ }], weekendWarningDescription: [{
349
+ type: Input
350
+ }], labels: [{
351
+ type: Input
352
+ }], eventIconClass: [{
353
+ type: Input
354
+ }], eventNameBoldClass: [{
355
+ type: Input
356
+ }], eventDescriptionClass: [{
357
+ type: Input
358
+ }], propertyBadgeClass: [{
359
+ type: Input
360
+ }], noEventsTextClass: [{
361
+ type: Input
362
+ }], warningTextClass: [{
363
+ type: Input
364
+ }], dateFormat: [{
365
+ type: Input
366
+ }] } });
367
+
368
+ class HrEventTabBarComponent {
369
+ selectedType = null;
370
+ selectedLanguage = 'en';
371
+ labels;
372
+ tabSelectedClass = 'selected-event-option';
373
+ tabNotSelectedClass = 'not-selected-event-option';
374
+ tabTextSelectedClass = 'text-white';
375
+ tabTextNotSelectedClass = 'text-primary';
376
+ containerClass = 'd-flex gap-2 mb-3';
377
+ tabItemClass = 'col-1 align-items-center rounded rounded-3 cursor-pointer text-center d-flex justify-content-center py-2 px-3';
378
+ tabTextClass = 'fs-16';
379
+ tabIconClass = 'fs-6';
380
+ tabSelected = new EventEmitter();
381
+ tabList = [
382
+ { id: null, icon: null },
383
+ { id: EventTypeEnum.Birthdays, icon: faCakeCandles },
384
+ { id: EventTypeEnum.PublicHolidays, icon: faTreePalm }
385
+ ];
386
+ getTabText(tab) {
387
+ if (tab.id === null)
388
+ return this.labels.all;
389
+ if (tab.id === EventTypeEnum.Birthdays)
390
+ return this.labels.birthday;
391
+ return this.labels.publicHoliday;
392
+ }
393
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventTabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
394
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: HrEventTabBarComponent, isStandalone: true, selector: "hr-event-tab-bar", inputs: { selectedType: "selectedType", selectedLanguage: "selectedLanguage", labels: "labels", tabSelectedClass: "tabSelectedClass", tabNotSelectedClass: "tabNotSelectedClass", tabTextSelectedClass: "tabTextSelectedClass", tabTextNotSelectedClass: "tabTextNotSelectedClass", containerClass: "containerClass", tabItemClass: "tabItemClass", tabTextClass: "tabTextClass", tabIconClass: "tabIconClass" }, outputs: { tabSelected: "tabSelected" }, ngImport: i0, template: "<div [class]=\"containerClass\">\r\n @for (tab of tabList; track tab) {\r\n <div [class]=\"tabItemClass + ' ' + (selectedType == tab.id ? tabSelectedClass : tabNotSelectedClass)\"\r\n [ngClass]=\"{'w-25': (selectedLanguage == 'fr' && !tab?.icon)}\"\r\n (click)=\"tabSelected.emit(tab.id)\">\r\n @if (!tab?.icon) {\r\n <span [class]=\"tabTextClass + ' ' + (selectedType == tab.id ? tabTextSelectedClass : tabTextNotSelectedClass)\">{{ getTabText(tab) }}</span>\r\n } @else {\r\n <fa-icon [icon]=\"tab.icon!\" [class]=\"tabIconClass + ' ' + (selectedType == tab.id ? tabTextSelectedClass : tabTextNotSelectedClass)\" [title]=\"getTabText(tab)\"></fa-icon>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
395
+ }
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventTabBarComponent, decorators: [{
397
+ type: Component,
398
+ args: [{ selector: 'hr-event-tab-bar', standalone: true, imports: [FontAwesomeModule, NgClass], template: "<div [class]=\"containerClass\">\r\n @for (tab of tabList; track tab) {\r\n <div [class]=\"tabItemClass + ' ' + (selectedType == tab.id ? tabSelectedClass : tabNotSelectedClass)\"\r\n [ngClass]=\"{'w-25': (selectedLanguage == 'fr' && !tab?.icon)}\"\r\n (click)=\"tabSelected.emit(tab.id)\">\r\n @if (!tab?.icon) {\r\n <span [class]=\"tabTextClass + ' ' + (selectedType == tab.id ? tabTextSelectedClass : tabTextNotSelectedClass)\">{{ getTabText(tab) }}</span>\r\n } @else {\r\n <fa-icon [icon]=\"tab.icon!\" [class]=\"tabIconClass + ' ' + (selectedType == tab.id ? tabTextSelectedClass : tabTextNotSelectedClass)\" [title]=\"getTabText(tab)\"></fa-icon>\r\n }\r\n </div>\r\n }\r\n</div>\r\n" }]
399
+ }], propDecorators: { selectedType: [{
400
+ type: Input
401
+ }], selectedLanguage: [{
402
+ type: Input
403
+ }], labels: [{
404
+ type: Input
405
+ }], tabSelectedClass: [{
406
+ type: Input
407
+ }], tabNotSelectedClass: [{
408
+ type: Input
409
+ }], tabTextSelectedClass: [{
410
+ type: Input
411
+ }], tabTextNotSelectedClass: [{
412
+ type: Input
413
+ }], containerClass: [{
414
+ type: Input
415
+ }], tabItemClass: [{
416
+ type: Input
417
+ }], tabTextClass: [{
418
+ type: Input
419
+ }], tabIconClass: [{
420
+ type: Input
421
+ }], tabSelected: [{
422
+ type: Output
423
+ }] } });
424
+
425
+ class HrEventsPopupComponent {
426
+ visible = false;
427
+ events = [];
428
+ hasBirthdays = false;
429
+ hasHolidays = false;
430
+ isLoading = false;
431
+ selectedLanguage = 'en';
432
+ showProperty = true;
433
+ weekendWarningDescription = null;
434
+ popupTitle = '';
435
+ selectedEventType = null;
436
+ labels;
437
+ tabSelectedClass = 'selected-event-option';
438
+ tabNotSelectedClass = 'not-selected-event-option';
439
+ tabTextSelectedClass = 'text-white';
440
+ tabTextNotSelectedClass = 'text-primary';
441
+ tabContainerClass = 'd-flex gap-2 mb-3';
442
+ tabItemClass = 'col-1 align-items-center rounded rounded-3 cursor-pointer text-center d-flex justify-content-center py-2 px-3';
443
+ tabTextClass = 'fs-16';
444
+ tabIconClass = 'fs-6';
445
+ eventIconClass = 'fs-6 text-primary pe-2';
446
+ eventNameBoldClass = 'fw-medium';
447
+ eventDescriptionClass = 'text-primary fw-medium';
448
+ propertyBadgeClass = 'property-badge cursor-pointer me-1';
449
+ noEventsTextClass = 'text-center my-4 text-light-gray';
450
+ warningTextClass = 'text-center my-2 text-light-gray';
451
+ dateFormat = 'dd/MM/yyyy';
452
+ visibleChange = new EventEmitter();
453
+ tabSelected = new EventEmitter();
454
+ closed = new EventEmitter();
455
+ onTabSelected(eventType) {
456
+ this.tabSelected.emit(eventType);
457
+ }
458
+ onPopupClose() {
459
+ this.closed.emit();
460
+ }
461
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventsPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
462
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: HrEventsPopupComponent, isStandalone: true, selector: "hr-upcoming-events-popup", inputs: { visible: "visible", events: "events", hasBirthdays: "hasBirthdays", hasHolidays: "hasHolidays", isLoading: "isLoading", selectedLanguage: "selectedLanguage", showProperty: "showProperty", weekendWarningDescription: "weekendWarningDescription", popupTitle: "popupTitle", selectedEventType: "selectedEventType", labels: "labels", tabSelectedClass: "tabSelectedClass", tabNotSelectedClass: "tabNotSelectedClass", tabTextSelectedClass: "tabTextSelectedClass", tabTextNotSelectedClass: "tabTextNotSelectedClass", tabContainerClass: "tabContainerClass", tabItemClass: "tabItemClass", tabTextClass: "tabTextClass", tabIconClass: "tabIconClass", eventIconClass: "eventIconClass", eventNameBoldClass: "eventNameBoldClass", eventDescriptionClass: "eventDescriptionClass", propertyBadgeClass: "propertyBadgeClass", noEventsTextClass: "noEventsTextClass", warningTextClass: "warningTextClass", dateFormat: "dateFormat" }, outputs: { visibleChange: "visibleChange", tabSelected: "tabSelected", closed: "closed" }, ngImport: i0, template: "<dx-popup id=\"popup\"\r\n [(visible)]=\"visible\"\r\n [height]=\"'400'\"\r\n [maxHeight]=\"400\"\r\n [width]=\"'650'\"\r\n shadingColor=\"rgba(0,0,0,0.4)\"\r\n contentTemplate=\"popup-content\"\r\n [showCloseButton]=\"true\"\r\n [title]=\"popupTitle\"\r\n (onHiding)=\"onPopupClose()\"\r\n (visibleChange)=\"visibleChange.emit($event)\">\r\n\r\n <div class=\"text-dark\" *dxTemplate=\"let data of 'popup-content'\">\r\n <dx-scroll-view #upcomingEventsScrollView\r\n id=\"upcomingEventsScrollView\"\r\n [scrollByContent]=\"true\"\r\n [scrollByThumb]=\"true\"\r\n [showScrollbar]=\"'onScroll'\"\r\n [bounceEnabled]=\"false\">\r\n\r\n @if (hasBirthdays || hasHolidays) {\r\n <hr-event-tab-bar [selectedType]=\"selectedEventType\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [containerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n (tabSelected)=\"onTabSelected($event)\">\r\n </hr-event-tab-bar>\r\n\r\n <hr-event-item [events]=\"events\"\r\n [showDates]=\"true\"\r\n [showProperty]=\"showProperty\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [selectedEventType]=\"selectedEventType\"\r\n [weekendWarningDescription]=\"weekendWarningDescription\"\r\n [labels]=\"labels\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\">\r\n </hr-event-item>\r\n } @else {\r\n <div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n }\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popup>\r\n\r\n<dx-load-panel shadingColor=\"rgba(0,0,0,0.4)\"\r\n [visible]=\"isLoading\"\r\n [showIndicator]=\"true\" [showPane]=\"true\"\r\n [shading]=\"true\" [hideOnOutsideClick]=\"false\">\r\n</dx-load-panel>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DxPopupModule }, { kind: "component", type: i1$1.DxPopupComponent, selector: "dx-popup", inputs: ["accessKey", "animation", "closeOnOutsideClick", "container", "contentTemplate", "deferRendering", "disabled", "dragAndResizeArea", "dragEnabled", "dragOutsideBoundary", "enableBodyScroll", "focusStateEnabled", "fullScreen", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "resizeEnabled", "restorePosition", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showTitle", "tabIndex", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onResize", "onResizeEnd", "onResizeStart", "onShowing", "onShown", "onTitleRendered", "accessKeyChange", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "deferRenderingChange", "disabledChange", "dragAndResizeAreaChange", "dragEnabledChange", "dragOutsideBoundaryChange", "enableBodyScrollChange", "focusStateEnabledChange", "fullScreenChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "resizeEnabledChange", "restorePositionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showTitleChange", "tabIndexChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "directive", type: i2.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "ngmodule", type: DxScrollViewModule }, { kind: "component", type: i1$1.DxScrollViewComponent, selector: "dx-scroll-view", inputs: ["bounceEnabled", "direction", "disabled", "elementAttr", "height", "pulledDownText", "pullingDownText", "reachBottomText", "refreshingText", "rtlEnabled", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onPullDown", "onReachBottom", "onScroll", "onUpdated", "bounceEnabledChange", "directionChange", "disabledChange", "elementAttrChange", "heightChange", "pulledDownTextChange", "pullingDownTextChange", "reachBottomTextChange", "refreshingTextChange", "rtlEnabledChange", "scrollByContentChange", "scrollByThumbChange", "showScrollbarChange", "useNativeChange", "widthChange"] }, { kind: "ngmodule", type: DxLoadPanelModule }, { kind: "component", type: i1$1.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "deferRendering", "delay", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "deferRenderingChange", "delayChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: HrEventItemComponent, selector: "hr-event-item", inputs: ["events", "showDates", "showProperty", "selectedLanguage", "selectedEventType", "weekendWarningDescription", "labels", "eventIconClass", "eventNameBoldClass", "eventDescriptionClass", "propertyBadgeClass", "noEventsTextClass", "warningTextClass", "dateFormat"] }, { kind: "component", type: HrEventTabBarComponent, selector: "hr-event-tab-bar", inputs: ["selectedType", "selectedLanguage", "labels", "tabSelectedClass", "tabNotSelectedClass", "tabTextSelectedClass", "tabTextNotSelectedClass", "containerClass", "tabItemClass", "tabTextClass", "tabIconClass"], outputs: ["tabSelected"] }] });
463
+ }
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HrEventsPopupComponent, decorators: [{
465
+ type: Component,
466
+ args: [{ selector: 'hr-upcoming-events-popup', standalone: true, imports: [CommonModule, DxPopupModule, DxScrollViewModule, DxLoadPanelModule, HrEventItemComponent, HrEventTabBarComponent], template: "<dx-popup id=\"popup\"\r\n [(visible)]=\"visible\"\r\n [height]=\"'400'\"\r\n [maxHeight]=\"400\"\r\n [width]=\"'650'\"\r\n shadingColor=\"rgba(0,0,0,0.4)\"\r\n contentTemplate=\"popup-content\"\r\n [showCloseButton]=\"true\"\r\n [title]=\"popupTitle\"\r\n (onHiding)=\"onPopupClose()\"\r\n (visibleChange)=\"visibleChange.emit($event)\">\r\n\r\n <div class=\"text-dark\" *dxTemplate=\"let data of 'popup-content'\">\r\n <dx-scroll-view #upcomingEventsScrollView\r\n id=\"upcomingEventsScrollView\"\r\n [scrollByContent]=\"true\"\r\n [scrollByThumb]=\"true\"\r\n [showScrollbar]=\"'onScroll'\"\r\n [bounceEnabled]=\"false\">\r\n\r\n @if (hasBirthdays || hasHolidays) {\r\n <hr-event-tab-bar [selectedType]=\"selectedEventType\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [containerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n (tabSelected)=\"onTabSelected($event)\">\r\n </hr-event-tab-bar>\r\n\r\n <hr-event-item [events]=\"events\"\r\n [showDates]=\"true\"\r\n [showProperty]=\"showProperty\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [selectedEventType]=\"selectedEventType\"\r\n [weekendWarningDescription]=\"weekendWarningDescription\"\r\n [labels]=\"labels\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\">\r\n </hr-event-item>\r\n } @else {\r\n <div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n }\r\n </dx-scroll-view>\r\n </div>\r\n</dx-popup>\r\n\r\n<dx-load-panel shadingColor=\"rgba(0,0,0,0.4)\"\r\n [visible]=\"isLoading\"\r\n [showIndicator]=\"true\" [showPane]=\"true\"\r\n [shading]=\"true\" [hideOnOutsideClick]=\"false\">\r\n</dx-load-panel>\r\n" }]
467
+ }], propDecorators: { visible: [{
468
+ type: Input
469
+ }], events: [{
470
+ type: Input
471
+ }], hasBirthdays: [{
472
+ type: Input
473
+ }], hasHolidays: [{
474
+ type: Input
475
+ }], isLoading: [{
476
+ type: Input
477
+ }], selectedLanguage: [{
478
+ type: Input
479
+ }], showProperty: [{
480
+ type: Input
481
+ }], weekendWarningDescription: [{
482
+ type: Input
483
+ }], popupTitle: [{
484
+ type: Input
485
+ }], selectedEventType: [{
486
+ type: Input
487
+ }], labels: [{
488
+ type: Input
489
+ }], tabSelectedClass: [{
490
+ type: Input
491
+ }], tabNotSelectedClass: [{
492
+ type: Input
493
+ }], tabTextSelectedClass: [{
494
+ type: Input
495
+ }], tabTextNotSelectedClass: [{
496
+ type: Input
497
+ }], tabContainerClass: [{
498
+ type: Input
499
+ }], tabItemClass: [{
500
+ type: Input
501
+ }], tabTextClass: [{
502
+ type: Input
503
+ }], tabIconClass: [{
504
+ type: Input
505
+ }], eventIconClass: [{
506
+ type: Input
507
+ }], eventNameBoldClass: [{
508
+ type: Input
509
+ }], eventDescriptionClass: [{
510
+ type: Input
511
+ }], propertyBadgeClass: [{
512
+ type: Input
513
+ }], noEventsTextClass: [{
514
+ type: Input
515
+ }], warningTextClass: [{
516
+ type: Input
517
+ }], dateFormat: [{
518
+ type: Input
519
+ }], visibleChange: [{
520
+ type: Output
521
+ }], tabSelected: [{
522
+ type: Output
523
+ }], closed: [{
524
+ type: Output
525
+ }] } });
526
+
527
+ class MyUpcomingEventsWidgetComponent {
528
+ http;
529
+ alertToastService;
530
+ baseUrl = '';
531
+ weekendWarningDescription = 'WeekendDayNotDefined';
532
+ selectedLanguage = 'en';
533
+ showProperty = true;
534
+ cardClass = 'bg-light-gray border-0 card p-3 card-shadow rounded rounded-4 mt-3';
535
+ noEventsTextClass = 'text-center my-4 text-light-gray';
536
+ viewAllLinkClass = 'fs-14 mt-2';
537
+ viewAllContainerClass = 'd-flex justify-content-end cursor-pointer';
538
+ warningTextClass = 'text-center my-2 text-light-gray';
539
+ tabSelectedClass = 'selected-event-option';
540
+ tabNotSelectedClass = 'not-selected-event-option';
541
+ tabTextSelectedClass = 'text-white';
542
+ tabTextNotSelectedClass = 'text-primary';
543
+ tabContainerClass = 'd-flex gap-2 mb-3';
544
+ tabItemClass = 'col-1 align-items-center rounded rounded-3 cursor-pointer text-center d-flex justify-content-center py-2 px-3';
545
+ tabTextClass = 'fs-16';
546
+ tabIconClass = 'fs-6';
547
+ eventIconClass = 'fs-6 text-primary pe-2';
548
+ eventNameBoldClass = 'fw-medium';
549
+ eventDescriptionClass = 'text-primary fw-medium';
550
+ propertyBadgeClass = 'property-badge cursor-pointer me-1';
551
+ dateFormat = 'dd/MM/yyyy';
552
+ labels = {
553
+ upcomingEvents: 'Upcoming Events',
554
+ birthday: 'Birthday',
555
+ publicHoliday: 'Public Holiday',
556
+ during: 'During',
557
+ isIn: 'is in',
558
+ is: 'is',
559
+ in: 'In',
560
+ noEvents: 'There are no events',
561
+ all: 'All',
562
+ viewAll: 'View All',
563
+ };
564
+ isLoadingChanged = new EventEmitter();
565
+ viewAllClicked = new EventEmitter();
566
+ externalViewAll = false;
567
+ selectedEventType = null;
568
+ selectedPopupEventType = null;
569
+ calendarStar = faCalendarStar;
570
+ filteredEvents = [];
571
+ birthdays = [];
572
+ holidays = [];
573
+ popupEvents = [];
574
+ popupVisible = false;
575
+ weekendWarning = null;
576
+ constructor(http, alertToastService) {
577
+ this.http = http;
578
+ this.alertToastService = alertToastService;
579
+ }
580
+ ngOnInit() {
581
+ this.loadEvents(EventOption.All);
582
+ }
583
+ onTabClick(eventType) {
584
+ this.selectedEventType = eventType;
585
+ this.filteredEvents = this.buildEvents(this.cardData, eventType, 2);
586
+ }
587
+ onPopupTabClick(eventType) {
588
+ this.selectedPopupEventType = eventType;
589
+ this.popupEvents = this.buildEvents(this.cardData, eventType);
590
+ }
591
+ showPopup() {
592
+ if (this.externalViewAll) {
593
+ this.viewAllClicked.emit();
594
+ return;
595
+ }
596
+ this.popupEvents = this.buildEvents(this.cardData, this.selectedPopupEventType);
597
+ this.popupVisible = true;
598
+ }
599
+ onPopupClose() {
600
+ this.popupVisible = false;
601
+ this.selectedPopupEventType = null;
602
+ }
603
+ // --- Private ---
604
+ cardData;
605
+ getUpcomingEvents(eventOption) {
606
+ let params = new HttpParams().set('EventOption', eventOption);
607
+ return this.http.get(`${this.baseUrl}/hr/employee-portal/upcoming-events`, {
608
+ params,
609
+ headers: { 'api-version': '2' }
610
+ });
611
+ }
612
+ loadEvents(eventOption) {
613
+ this.isLoadingChanged.emit(true);
614
+ this.getUpcomingEvents(eventOption).subscribe({
615
+ next: (response) => {
616
+ this.cardData = response.ResponseData;
617
+ this.birthdays = this.cardData?.Birthdays || [];
618
+ this.holidays = this.cardData?.PublicHolidays || [];
619
+ this.weekendWarning = this.cardData?.IsWeekendConfigured === false
620
+ ? this.weekendWarningDescription
621
+ : null;
622
+ this.filteredEvents = this.buildEvents(this.cardData, null, 2);
623
+ this.isLoadingChanged.emit(false);
624
+ },
625
+ error: (error) => {
626
+ this.isLoadingChanged.emit(false);
627
+ if (error.status == 401)
628
+ return;
629
+ this.alertToastService.toastInformation(error.error.ResponseData.Errors[0].Message, SkyAlertType.Error);
630
+ },
631
+ });
632
+ }
633
+ buildEvents(source, eventType, limit) {
634
+ const birthdays = source?.Birthdays || [];
635
+ const holidays = source?.PublicHolidays || [];
636
+ let filtered;
637
+ if (eventType === EventTypeEnum.Birthdays) {
638
+ filtered = birthdays.map(b => this.mapBirthday(b));
639
+ }
640
+ else if (eventType === EventTypeEnum.PublicHolidays) {
641
+ filtered = holidays.map(h => this.mapHoliday(h));
642
+ }
643
+ else {
644
+ if (birthdays.length > 0 && holidays.length > 0) {
645
+ if (limit) {
646
+ filtered = [this.mapBirthday(birthdays[0]), this.mapHoliday(holidays[0])];
647
+ }
648
+ else {
649
+ filtered = [
650
+ ...birthdays.map(b => this.mapBirthday(b)),
651
+ ...holidays.map(h => this.mapHoliday(h))
652
+ ];
653
+ }
654
+ }
655
+ else if (birthdays.length > 0) {
656
+ filtered = birthdays.map(b => this.mapBirthday(b));
657
+ }
658
+ else {
659
+ filtered = holidays.map(h => this.mapHoliday(h));
660
+ }
661
+ }
662
+ if (limit) {
663
+ filtered = filtered.slice(0, limit);
664
+ }
665
+ return filtered.sort((a, b) => new Date(a.EventDate).getTime() - new Date(b.EventDate).getTime());
666
+ }
667
+ mapBirthday(b) {
668
+ return {
669
+ EventDate: new Date(b.Birthdate),
670
+ Name: b.EmployeeShortName,
671
+ EventType: EventTypeEnum.Birthdays,
672
+ Description: b.RelativeDay.toString(),
673
+ IsIn2Days: RelativeDay[b.RelativeDay] === RelativeDay.TwoDays,
674
+ PropertyName: b.EmployeePropertyName,
675
+ PropertySymbol: b.EmployeePropertySymbol
676
+ };
677
+ }
678
+ mapHoliday(h) {
679
+ return {
680
+ EventDate: new Date(h.StartDate),
681
+ StartDate: new Date(h.StartDate),
682
+ EndDate: new Date(h.EndDate),
683
+ Name: h.Description,
684
+ EventType: EventTypeEnum.PublicHolidays,
685
+ Description: h.WeekContext.toString()
686
+ };
687
+ }
688
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MyUpcomingEventsWidgetComponent, deps: [{ token: i1.HttpClient }, { token: i2$1.SkyAlertToastService }], target: i0.ɵɵFactoryTarget.Component });
689
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: MyUpcomingEventsWidgetComponent, isStandalone: true, selector: "hr-my-upcoming-events-widget", inputs: { baseUrl: "baseUrl", weekendWarningDescription: "weekendWarningDescription", selectedLanguage: "selectedLanguage", showProperty: "showProperty", cardClass: "cardClass", noEventsTextClass: "noEventsTextClass", viewAllLinkClass: "viewAllLinkClass", viewAllContainerClass: "viewAllContainerClass", warningTextClass: "warningTextClass", tabSelectedClass: "tabSelectedClass", tabNotSelectedClass: "tabNotSelectedClass", tabTextSelectedClass: "tabTextSelectedClass", tabTextNotSelectedClass: "tabTextNotSelectedClass", tabContainerClass: "tabContainerClass", tabItemClass: "tabItemClass", tabTextClass: "tabTextClass", tabIconClass: "tabIconClass", eventIconClass: "eventIconClass", eventNameBoldClass: "eventNameBoldClass", eventDescriptionClass: "eventDescriptionClass", propertyBadgeClass: "propertyBadgeClass", dateFormat: "dateFormat", labels: "labels", externalViewAll: "externalViewAll" }, outputs: { isLoadingChanged: "isLoadingChanged", viewAllClicked: "viewAllClicked" }, ngImport: i0, template: "<!-- Card View -->\r\n<div [class]=\"cardClass\">\r\n <hr-card-header [icon]=\"calendarStar\" [title]=\"labels.upcomingEvents\"></hr-card-header>\r\n\r\n @if (birthdays.length > 0 || holidays.length > 0) {\r\n <hr-event-tab-bar\r\n [selectedType]=\"selectedEventType\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [containerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n (tabSelected)=\"onTabClick($event)\">\r\n </hr-event-tab-bar>\r\n\r\n <hr-event-item\r\n [events]=\"filteredEvents\"\r\n [showDates]=\"false\"\r\n [showProperty]=\"showProperty\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [selectedEventType]=\"selectedEventType\"\r\n [weekendWarningDescription]=\"weekendWarning\"\r\n [labels]=\"labels\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\">\r\n </hr-event-item>\r\n\r\n <div [class]=\"viewAllContainerClass\">\r\n <a [class]=\"viewAllLinkClass\" (click)=\"showPopup()\">{{ labels.viewAll }}</a>\r\n </div>\r\n } @else {\r\n <div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n }\r\n</div>\r\n\r\n<!-- Popup -->\r\n<hr-upcoming-events-popup\r\n [visible]=\"popupVisible\"\r\n [events]=\"popupEvents\"\r\n [hasBirthdays]=\"birthdays.length > 0\"\r\n [hasHolidays]=\"holidays.length > 0\"\r\n [isLoading]=\"false\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [showProperty]=\"showProperty\"\r\n [weekendWarningDescription]=\"weekendWarning\"\r\n [popupTitle]=\"labels.upcomingEvents\"\r\n [selectedEventType]=\"selectedPopupEventType\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [tabContainerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\"\r\n (visibleChange)=\"popupVisible = $event\"\r\n (tabSelected)=\"onPopupTabClick($event)\"\r\n (closed)=\"onPopupClose()\">\r\n</hr-upcoming-events-popup>\r\n", dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: HrCardHeaderComponent, selector: "hr-card-header", inputs: ["icon", "title", "containerClass", "iconClass", "titleClass"] }, { kind: "component", type: HrEventItemComponent, selector: "hr-event-item", inputs: ["events", "showDates", "showProperty", "selectedLanguage", "selectedEventType", "weekendWarningDescription", "labels", "eventIconClass", "eventNameBoldClass", "eventDescriptionClass", "propertyBadgeClass", "noEventsTextClass", "warningTextClass", "dateFormat"] }, { kind: "component", type: HrEventTabBarComponent, selector: "hr-event-tab-bar", inputs: ["selectedType", "selectedLanguage", "labels", "tabSelectedClass", "tabNotSelectedClass", "tabTextSelectedClass", "tabTextNotSelectedClass", "containerClass", "tabItemClass", "tabTextClass", "tabIconClass"], outputs: ["tabSelected"] }, { kind: "component", type: HrEventsPopupComponent, selector: "hr-upcoming-events-popup", inputs: ["visible", "events", "hasBirthdays", "hasHolidays", "isLoading", "selectedLanguage", "showProperty", "weekendWarningDescription", "popupTitle", "selectedEventType", "labels", "tabSelectedClass", "tabNotSelectedClass", "tabTextSelectedClass", "tabTextNotSelectedClass", "tabContainerClass", "tabItemClass", "tabTextClass", "tabIconClass", "eventIconClass", "eventNameBoldClass", "eventDescriptionClass", "propertyBadgeClass", "noEventsTextClass", "warningTextClass", "dateFormat"], outputs: ["visibleChange", "tabSelected", "closed"] }] });
690
+ }
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MyUpcomingEventsWidgetComponent, decorators: [{
692
+ type: Component,
693
+ args: [{ selector: 'hr-my-upcoming-events-widget', standalone: true, imports: [FontAwesomeModule, HrCardHeaderComponent, HrEventItemComponent, HrEventTabBarComponent, HrEventsPopupComponent], template: "<!-- Card View -->\r\n<div [class]=\"cardClass\">\r\n <hr-card-header [icon]=\"calendarStar\" [title]=\"labels.upcomingEvents\"></hr-card-header>\r\n\r\n @if (birthdays.length > 0 || holidays.length > 0) {\r\n <hr-event-tab-bar\r\n [selectedType]=\"selectedEventType\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [containerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n (tabSelected)=\"onTabClick($event)\">\r\n </hr-event-tab-bar>\r\n\r\n <hr-event-item\r\n [events]=\"filteredEvents\"\r\n [showDates]=\"false\"\r\n [showProperty]=\"showProperty\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [selectedEventType]=\"selectedEventType\"\r\n [weekendWarningDescription]=\"weekendWarning\"\r\n [labels]=\"labels\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\">\r\n </hr-event-item>\r\n\r\n <div [class]=\"viewAllContainerClass\">\r\n <a [class]=\"viewAllLinkClass\" (click)=\"showPopup()\">{{ labels.viewAll }}</a>\r\n </div>\r\n } @else {\r\n <div [class]=\"noEventsTextClass\">{{ labels.noEvents }}</div>\r\n }\r\n</div>\r\n\r\n<!-- Popup -->\r\n<hr-upcoming-events-popup\r\n [visible]=\"popupVisible\"\r\n [events]=\"popupEvents\"\r\n [hasBirthdays]=\"birthdays.length > 0\"\r\n [hasHolidays]=\"holidays.length > 0\"\r\n [isLoading]=\"false\"\r\n [selectedLanguage]=\"selectedLanguage\"\r\n [showProperty]=\"showProperty\"\r\n [weekendWarningDescription]=\"weekendWarning\"\r\n [popupTitle]=\"labels.upcomingEvents\"\r\n [selectedEventType]=\"selectedPopupEventType\"\r\n [labels]=\"labels\"\r\n [tabSelectedClass]=\"tabSelectedClass\"\r\n [tabNotSelectedClass]=\"tabNotSelectedClass\"\r\n [tabTextSelectedClass]=\"tabTextSelectedClass\"\r\n [tabTextNotSelectedClass]=\"tabTextNotSelectedClass\"\r\n [tabContainerClass]=\"tabContainerClass\"\r\n [tabItemClass]=\"tabItemClass\"\r\n [tabTextClass]=\"tabTextClass\"\r\n [tabIconClass]=\"tabIconClass\"\r\n [eventIconClass]=\"eventIconClass\"\r\n [eventNameBoldClass]=\"eventNameBoldClass\"\r\n [eventDescriptionClass]=\"eventDescriptionClass\"\r\n [propertyBadgeClass]=\"propertyBadgeClass\"\r\n [noEventsTextClass]=\"noEventsTextClass\"\r\n [warningTextClass]=\"warningTextClass\"\r\n [dateFormat]=\"dateFormat\"\r\n (visibleChange)=\"popupVisible = $event\"\r\n (tabSelected)=\"onPopupTabClick($event)\"\r\n (closed)=\"onPopupClose()\">\r\n</hr-upcoming-events-popup>\r\n" }]
694
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$1.SkyAlertToastService }], propDecorators: { baseUrl: [{
695
+ type: Input
696
+ }], weekendWarningDescription: [{
697
+ type: Input
698
+ }], selectedLanguage: [{
699
+ type: Input
700
+ }], showProperty: [{
701
+ type: Input
702
+ }], cardClass: [{
703
+ type: Input
704
+ }], noEventsTextClass: [{
705
+ type: Input
706
+ }], viewAllLinkClass: [{
707
+ type: Input
708
+ }], viewAllContainerClass: [{
709
+ type: Input
710
+ }], warningTextClass: [{
711
+ type: Input
712
+ }], tabSelectedClass: [{
713
+ type: Input
714
+ }], tabNotSelectedClass: [{
715
+ type: Input
716
+ }], tabTextSelectedClass: [{
717
+ type: Input
718
+ }], tabTextNotSelectedClass: [{
719
+ type: Input
720
+ }], tabContainerClass: [{
721
+ type: Input
722
+ }], tabItemClass: [{
723
+ type: Input
724
+ }], tabTextClass: [{
725
+ type: Input
726
+ }], tabIconClass: [{
727
+ type: Input
728
+ }], eventIconClass: [{
729
+ type: Input
730
+ }], eventNameBoldClass: [{
731
+ type: Input
732
+ }], eventDescriptionClass: [{
733
+ type: Input
734
+ }], propertyBadgeClass: [{
735
+ type: Input
736
+ }], dateFormat: [{
737
+ type: Input
738
+ }], labels: [{
739
+ type: Input
740
+ }], isLoadingChanged: [{
741
+ type: Output
742
+ }], viewAllClicked: [{
743
+ type: Output
744
+ }], externalViewAll: [{
745
+ type: Input
746
+ }] } });
747
+
748
+ /*
749
+ * Public API Surface of shared-ui
750
+ */
751
+
752
+ /**
753
+ * Generated bundle index. Do not edit.
754
+ */
755
+
756
+ export { EventOption, EventTypeEnum, HrConstantsService, HrMyMainDetailsWidgetComponent, MainWidgetShortcut, MyUpcomingEventsWidgetComponent, PublicHolidayWeekContext, RelativeDay };
757
+ //# sourceMappingURL=skysoftware-co-bayan-hr-widgets-ui.mjs.map