@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.
- package/README.md +176 -0
- package/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs +757 -0
- package/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/common/constants.service.d.ts +7 -0
- package/lib/my-main-details-widget/my-main-details-widget.component.d.ts +71 -0
- package/lib/my-upcoming-events-widget/card-header/card-header.component.d.ts +11 -0
- package/lib/my-upcoming-events-widget/event-item/event-item.component.d.ts +26 -0
- package/lib/my-upcoming-events-widget/event-tab-bar/event-tab-bar.component.d.ts +29 -0
- package/lib/my-upcoming-events-widget/events-popup/events-popup.component.d.ts +38 -0
- package/lib/my-upcoming-events-widget/my-upcoming-events-widget.component.d.ts +58 -0
- package/lib/types/common.d.ts +84 -0
- package/package.json +23 -0
- package/public-api.d.ts +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# HRComponents
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.2.15.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project HRComponents` to generate a new component.
|
|
8
|
+
You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project HRComponents`.
|
|
9
|
+
> Note: Don't forget to add `--project HRComponents` or else it will be added to the default project in your `angular.json` file.
|
|
10
|
+
|
|
11
|
+
## Build
|
|
12
|
+
|
|
13
|
+
Run `ng build HRComponents` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
14
|
+
|
|
15
|
+
## Publishing
|
|
16
|
+
|
|
17
|
+
After building your library with `ng build HRComponents`, go to the dist folder `cd dist/shared-ui` and run `npm publish`.
|
|
18
|
+
|
|
19
|
+
## Running unit tests
|
|
20
|
+
|
|
21
|
+
Run `ng test HRComponents` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
22
|
+
|
|
23
|
+
## Further help
|
|
24
|
+
|
|
25
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
26
|
+
|
|
27
|
+
## Sky Bayan HR Components
|
|
28
|
+
|
|
29
|
+
This package contains shared HR components used in Bayan HR system, you can find in first installation the below
|
|
30
|
+
components:
|
|
31
|
+
1. My Main Details Widget
|
|
32
|
+
2. My Upcoming Events Widget
|
|
33
|
+
|
|
34
|
+
## Dependencies
|
|
35
|
+
This library depends on `@skysoftware-co/bayan-components-ui` package which provides:
|
|
36
|
+
- Employee Badge Component
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
use npm to install this package by command: @skysoftware-co/bayan-hr-components
|
|
40
|
+
|
|
41
|
+
## Constants Service
|
|
42
|
+
|
|
43
|
+
### Usage
|
|
44
|
+
```typescript
|
|
45
|
+
import { HrConstantsService } from '@skysoftware-co/bayan-hr-components';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This service provides default constant values used across HR components, you can override them at runtime.
|
|
49
|
+
|
|
50
|
+
### Properties
|
|
51
|
+
| Property | Type | Default Value | Description |
|
|
52
|
+
|----------|------|---------------|-------------|
|
|
53
|
+
| `defaultVacationBalanceColor` | string | `'#727070'` | Default color for vacation balance indicator |
|
|
54
|
+
| `defaultVacationColor` | string | `'#DCDCDC'` | Default color for vacation type when no color is assigned |
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## My Main Details Widget Component
|
|
58
|
+
|
|
59
|
+
### Usage
|
|
60
|
+
```html
|
|
61
|
+
<hr-my-main-details-widget></hr-my-main-details-widget>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This component is used in Bayan HR system to show the employee main information widget in the employee portal home page. It displays employee info, shortcuts, reporting info, service years and vacation balances. This component uses `<bayan-employee-badge>` from `@skysoftware-co/bayan-components-ui` package.
|
|
65
|
+
|
|
66
|
+
### Input Properties
|
|
67
|
+
| Input | Type | Default Value | Description |
|
|
68
|
+
|-------|------|---------------|-------------|
|
|
69
|
+
| `badgeClass` | string | `'badge employee-rounded-badge-xl fs-5'` | Badge CSS class |
|
|
70
|
+
| `badgeImageClass` | string | `'rounded-circle shadow-lg'` | Badge image CSS class |
|
|
71
|
+
| `badgeWidth` | string | `'50px'` | Badge width |
|
|
72
|
+
| `badgeHeight` | string | `'50px'` | Badge height |
|
|
73
|
+
| `employeeInfoContainerClass` | string | `'d-flex align-content-center'` | Employee info container CSS class |
|
|
74
|
+
| `employeeDetailsClass` | string | `'ms-3'` | Employee details CSS class |
|
|
75
|
+
| `employeeNameContainerClass` | string | `'d-flex align-items-center'` | Employee name container CSS class |
|
|
76
|
+
| `employeeNameClass` | string | `'fs-14 text-dark-gray fw-medium text-ellipsis-one-line'` | Employee name CSS class |
|
|
77
|
+
| `employeePositionClass` | string | `'fs-12 fw-normal text-dark-gray text-ellipsis-one-line mb-1'` | Employee position CSS class |
|
|
78
|
+
| `employeeGradeClass` | string | `'fs-12 text-dark-gray'` | Employee grade CSS class |
|
|
79
|
+
| `containerClass` | string | `'card rounded rounded-4 card-shadow p-16 border-top-0 mb-4'` | Main container CSS class |
|
|
80
|
+
| `cardBodyClass` | string | `'card-body p-4'` | Card body CSS class |
|
|
81
|
+
| `headerRowClass` | string | `'d-md-flex justify-content-between align-items-center mt-2 mb-3'` | Header row CSS class |
|
|
82
|
+
| `shortcutsContainerClass` | string | `'d-flex justify-content-md-end justify-content-sm-start fs-12 fw-normal text-secondary mt-3 mt-md-0'` | Shortcuts container CSS class |
|
|
83
|
+
| `shortcutItemClass` | string | `'d-flex flex-column align-items-center mx-2 wp-60'` | Shortcut item CSS class |
|
|
84
|
+
| `shortcutIconContainerClass` | string | `'d-flex justify-content-center align-items-center rounded-circle-40 cursor-pointer'` | Shortcut icon container CSS class |
|
|
85
|
+
| `shortcutIconClass` | string | `'fs-4'` | Shortcut icon CSS class |
|
|
86
|
+
| `shortcutTextClass` | string | `'text-center mt-1'` | Shortcut text CSS class |
|
|
87
|
+
| `detailsRowClass` | string | `'d-flex mt-4'` | Details row CSS class |
|
|
88
|
+
| `reportingBlockClass` | string | `'d-flex text-secondary align-items-center mb-2 mx-2'` | Reporting block CSS class |
|
|
89
|
+
| `captionLabelClasses` | string | `'d-flex flex-column align-self-start fs-14 text-dark-gray'` | Caption label CSS class |
|
|
90
|
+
| `captionLabelValueClass` | string | `'fw-medium mt-2'` | Caption label value CSS class |
|
|
91
|
+
| `vacationBalancesContainerClass` | string | `'d-flex text-secondary align-items-center mb-2'` | Vacation balances container CSS class |
|
|
92
|
+
| `vacationBalanceItemClass` | string | `'d-flex flex-column me-4'` | Vacation balance item CSS class |
|
|
93
|
+
| `vacationBalanceHeaderClass` | string | `'d-flex align-items-center'` | Vacation balance header CSS class |
|
|
94
|
+
| `vacationColorDotClass` | string | `'vacation-color-container-sm'` | Vacation color dot CSS class |
|
|
95
|
+
| `vacationTypeNameClass` | string | `'mx-2 fs-14 fw-normal text-dark-gray'` | Vacation type name CSS class |
|
|
96
|
+
| `vacationBalanceValueRowClass` | string | `'d-flex mt-2'` | Vacation balance value row CSS class |
|
|
97
|
+
| `vacationBalanceValueClass` | string | `'mx-2 fw-medium fs-14 text-dark-gray'` | Vacation balance value CSS class |
|
|
98
|
+
| `tooltipTriggerLinkClass` | string | `'d-flex align-items-center cursor-pointer'` | Tooltip trigger link CSS class |
|
|
99
|
+
| `tooltipTriggerTextClass` | string | `'mx-2 fs-14 text-dark-gray'` | Tooltip trigger text CSS class |
|
|
100
|
+
| `tooltipVacationRowClass` | string | `'d-flex align-items-center justify-content-around fs-12 mb-2'` | Tooltip vacation row CSS class |
|
|
101
|
+
| `tooltipVacationNameContainerClass` | string | `'d-flex flex-grow-1 align-items-center me-5'` | Tooltip vacation name container CSS class |
|
|
102
|
+
| `tooltipVacationNameClass` | string | `'mx-2'` | Tooltip vacation name CSS class |
|
|
103
|
+
| `reportingToLabel` | string | `'ReportingTo'` | Reporting to label text |
|
|
104
|
+
| `emptyReportingToLabel` | string | `'NotAnknown'` | Empty reporting to label text |
|
|
105
|
+
| `serviceYearsLabel` | string | `'ServiceYears'` | Service years label text |
|
|
106
|
+
| `moreLabel` | string | `'More'` | More label text |
|
|
107
|
+
| `dayLabel` | string | `'day'` | Day label text |
|
|
108
|
+
| `daysLabel` | string | `'days'` | Days label text |
|
|
109
|
+
| `yearsLabel` | string | `'Years'` | Years label text |
|
|
110
|
+
| `monthsLabel` | string | `'Months'` | Months label text |
|
|
111
|
+
| `defaultVacationBalanceColor` | string | from `HrConstantsService`: `'#727070'` | Default vacation balance color indicator |
|
|
112
|
+
| `defaultVacationColor` | string | from `HrConstantsService`: `'#DCDCDC'` | Default vacation type color when no color assigned |
|
|
113
|
+
| `baseUrl` | string | `''` | Base URL for API calls |
|
|
114
|
+
| `isMobile` | boolean | `false` | Mobile responsive mode |
|
|
115
|
+
| `isTablet` | boolean | `false` | Tablet responsive mode |
|
|
116
|
+
| `shortcuts` | MainWidgetShortcutItem[] | `[]` | List of shortcut items to display |
|
|
117
|
+
|
|
118
|
+
### Output Events
|
|
119
|
+
- `onShortcutClicked: EventEmitter<MainWidgetShortcutItem>` - Emitted when the shortcut is clicked and has no navigation URL
|
|
120
|
+
- `isLoadingChanged: EventEmitter<boolean>` - When loading state changes
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## My Upcoming Events Widget Component
|
|
124
|
+
|
|
125
|
+
### Usage
|
|
126
|
+
```html
|
|
127
|
+
<hr-my-upcoming-events-widget></hr-my-upcoming-events-widget>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This component displays upcoming events (birthdays and public holidays) in a card view with tab filtering and a popup for viewing all events. It uses `SkyAlertToastService` from `@skysoftware-co/sky-components-ui` for error notifications.
|
|
131
|
+
|
|
132
|
+
### Input Properties
|
|
133
|
+
| Input | Type | Default Value | Description |
|
|
134
|
+
|-------|------|---------------|-------------|
|
|
135
|
+
| `baseUrl` | string | `''` | Base URL for API calls |
|
|
136
|
+
| `weekendWarningDescription` | string | `'WeekendDayNotDefined'` | Warning text when weekend is not configured |
|
|
137
|
+
| `selectedLanguage` | string | `'en'` | Selected language (`'en'`, `'ar'`, `'fr'`) |
|
|
138
|
+
| `showProperty` | boolean | `true` | Show employee property badge on birthday events |
|
|
139
|
+
| `externalViewAll` | boolean | `false` | When true, emits `viewAllClicked` instead of opening popup |
|
|
140
|
+
| `cardClass` | string | `'bg-light-gray border-0 card p-3 card-shadow rounded rounded-4 mt-3'` | Card container CSS class |
|
|
141
|
+
| `noEventsTextClass` | string | `'text-center my-4 text-light-gray'` | No events text CSS class |
|
|
142
|
+
| `viewAllLinkClass` | string | `'fs-14 mt-2'` | View all link CSS class |
|
|
143
|
+
| `viewAllContainerClass` | string | `'d-flex justify-content-end cursor-pointer'` | View all container CSS class |
|
|
144
|
+
| `warningTextClass` | string | `'text-center my-2 text-light-gray'` | Warning text CSS class |
|
|
145
|
+
| `tabSelectedClass` | string | `'selected-event-option'` | Selected tab CSS class |
|
|
146
|
+
| `tabNotSelectedClass` | string | `'not-selected-event-option'` | Not selected tab CSS class |
|
|
147
|
+
| `tabTextSelectedClass` | string | `'text-white'` | Selected tab text CSS class |
|
|
148
|
+
| `tabTextNotSelectedClass` | string | `'text-primary'` | Not selected tab text CSS class |
|
|
149
|
+
| `tabContainerClass` | string | `'d-flex gap-2 mb-3'` | Tab bar container CSS class |
|
|
150
|
+
| `tabItemClass` | string | `'col-1 align-items-center rounded rounded-3 cursor-pointer text-center d-flex justify-content-center py-2 px-3'` | Tab item CSS class |
|
|
151
|
+
| `tabTextClass` | string | `'fs-16'` | Tab text CSS class |
|
|
152
|
+
| `tabIconClass` | string | `'fs-6'` | Tab icon CSS class |
|
|
153
|
+
| `eventIconClass` | string | `'fs-6 text-primary pe-2'` | Event icon CSS class |
|
|
154
|
+
| `eventNameBoldClass` | string | `'fw-medium'` | Event name bold CSS class |
|
|
155
|
+
| `eventDescriptionClass` | string | `'text-primary fw-medium'` | Event description CSS class |
|
|
156
|
+
| `propertyBadgeClass` | string | `'property-badge cursor-pointer me-1'` | Property badge CSS class |
|
|
157
|
+
| `dateFormat` | string | `'dd/MM/yyyy'` | Date format for event dates |
|
|
158
|
+
| `labels` | UpcomingEventsLabels | *(see below)* | Localization labels |
|
|
159
|
+
|
|
160
|
+
### Labels Default Values
|
|
161
|
+
| Label | Default |
|
|
162
|
+
|-------|---------|
|
|
163
|
+
| `upcomingEvents` | `'Upcoming Events'` |
|
|
164
|
+
| `birthday` | `'Birthday'` |
|
|
165
|
+
| `publicHoliday` | `'Public Holiday'` |
|
|
166
|
+
| `during` | `'During'` |
|
|
167
|
+
| `isIn` | `'is in'` |
|
|
168
|
+
| `is` | `'is'` |
|
|
169
|
+
| `in` | `'In'` |
|
|
170
|
+
| `noEvents` | `'There are no events'` |
|
|
171
|
+
| `all` | `'All'` |
|
|
172
|
+
| `viewAll` | `'View All'` |
|
|
173
|
+
|
|
174
|
+
### Output Events
|
|
175
|
+
- `isLoadingChanged: EventEmitter<boolean>` - Emitted when loading state changes
|
|
176
|
+
- `viewAllClicked: EventEmitter<void>` - Emitted when view all is clicked (only when `externalViewAll` is true)
|