@skysoftware-co/bayan-core-widgets-ui 0.0.22 → 0.0.24
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 +226 -410
- package/fesm2022/skysoftware-co-bayan-core-widgets-ui.mjs +27 -17
- package/fesm2022/skysoftware-co-bayan-core-widgets-ui.mjs.map +1 -1
- package/lib/shared/pipes/translate.pipe.d.ts +1 -0
- package/lib/side-menu-widget/side-menu-widget.component.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,71 @@
|
|
|
1
1
|
# @skysoftware-co/bayan-core-widgets-ui
|
|
2
2
|
|
|
3
|
-
Reusable Angular widgets for Bayan top
|
|
3
|
+
Reusable Angular widgets for Bayan portals — top menu, side menu, and shared services.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @skysoftware-co/bayan-core-widgets-ui
|
|
9
|
+
```
|
|
4
10
|
|
|
5
11
|
## Package Surface
|
|
6
12
|
|
|
7
|
-
This package
|
|
13
|
+
This package exports:
|
|
8
14
|
|
|
9
|
-
- `BayanCoreTopMenuWidgetComponent`
|
|
10
|
-
- `
|
|
11
|
-
-
|
|
15
|
+
- `BayanCoreTopMenuWidgetComponent` — full horizontal top bar
|
|
16
|
+
- `BayanCoreSideMenuWidgetComponent` — collapsible vertical side navigation
|
|
17
|
+
- `BayanCoreTopMenuService` — API service for menu/search data
|
|
18
|
+
- `BayanCoreTranslatePipe` / `BayanCoreTranslateService` — built-in i18n
|
|
19
|
+
- Shared DTOs from `menu.dtos`
|
|
20
|
+
- Internal child widgets (see below) for advanced composition
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
---
|
|
14
23
|
|
|
15
|
-
##
|
|
24
|
+
## Top Menu Widget
|
|
16
25
|
|
|
17
|
-
|
|
18
|
-
npm install @skysoftware-co/bayan-core-widgets-ui
|
|
19
|
-
```
|
|
26
|
+
Selector: `bayan-core-top-menu-widget`
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
### Inputs
|
|
29
|
+
|
|
30
|
+
| Name | Type | Default | Description |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| `baseUrl` | `string` | `''` | Base URL for all API calls. |
|
|
33
|
+
| `systemModule` | `SystemModule \| null` | `null` | Current system module context. |
|
|
34
|
+
| `sidebarCollapsed` | `boolean` | `false` | Switches the brand logo to its collapsed state. |
|
|
35
|
+
| `homeUrl` | `string \| null` | `null` | Navigation target when the logo is clicked. |
|
|
36
|
+
| `logoUrl` | `string` | Bayan CDN URL | Expanded logo source. |
|
|
37
|
+
| `collapsedLogoUrl` | `string` | Bayan CDN URL | Collapsed logo source. |
|
|
38
|
+
| `isSsoLogin` | `boolean` | `false` | Hides sign-out when true. |
|
|
39
|
+
| `showGlobalSearch` | `boolean` | `true` | Shows the global search widget. |
|
|
40
|
+
| `showUserPanel` | `boolean` | `true` | Shows the user panel (employee + property switcher). |
|
|
41
|
+
| `showSettings` | `boolean` | `true` | Shows the settings dropdown. |
|
|
42
|
+
| `showShortcutMenus` | `boolean` | `true` | Shows shortcut navigation items loaded from the API. |
|
|
43
|
+
| `showNotifications` | `boolean` | `true` | Shows the notifications bell. |
|
|
44
|
+
| `notificationsTitle` | `string` | `'Notifications'` | Notification icon title / translation key. |
|
|
45
|
+
| `showHelp` | `boolean` | `true` | Shows the help icon link. |
|
|
46
|
+
| `helpTitle` | `string` | `'Help'` | Help icon title / translation key. |
|
|
47
|
+
| `helpUrl` | `string \| null` | Bayan docs URL | Help navigation target. |
|
|
48
|
+
| `helpIcon` | `IconDefinition` | `faQuestionCircle` | Help icon (FontAwesome). |
|
|
49
|
+
| `helpAnchorClass` | `string` | `'menu-icon-btn'` | CSS classes for the help anchor. |
|
|
50
|
+
| `helpUrlTarget` | `'_self' \| '_blank' \| string` | `'_blank'` | Anchor target for help. |
|
|
51
|
+
| `licenseUrl` | `string` | `''` | URL passed to the About dialog license button. |
|
|
52
|
+
| `releaseNotesUrl` | `string` | `''` | URL passed to the About dialog release-notes button. |
|
|
53
|
+
| `supportUrl` | `string` | `'https://skyits.com/contact'` | URL passed to the About dialog support button. |
|
|
54
|
+
|
|
55
|
+
### Outputs
|
|
56
|
+
|
|
57
|
+
| Name | Type | Description |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `logoClick` | `EventEmitter<void>` | Fired when the logo is clicked (only when `homeUrl` is null). |
|
|
60
|
+
| `helpClick` | `EventEmitter<void>` | Fired when help is clicked (only when `helpUrl` is null). |
|
|
61
|
+
| `menuItemClick` | `EventEmitter<TopMenuShortcut>` | Fired when a shortcut menu leaf item is activated. |
|
|
62
|
+
| `searchSubmit` | `EventEmitter<string>` | Fired when free-text search is submitted. |
|
|
63
|
+
| `propertyChanged` | `EventEmitter<PropertyOption>` | Fired when the active property changes in the user panel. |
|
|
64
|
+
| `signOutClick` | `EventEmitter<void>` | Fired when sign out is requested. |
|
|
65
|
+
| `alternateNamesChange` | `EventEmitter<boolean>` | Fired when alternate names toggle changes. |
|
|
66
|
+
| `employeeNameModeChange` | `EventEmitter<EmployeeNamesModeOption>` | Fired when the employee name mode is changed. |
|
|
67
|
+
|
|
68
|
+
### Usage Example
|
|
22
69
|
|
|
23
70
|
```html
|
|
24
71
|
<bayan-core-top-menu-widget
|
|
@@ -28,495 +75,264 @@ npm install @skysoftware-co/bayan-core-widgets-ui
|
|
|
28
75
|
[homeUrl]="homeUrl"
|
|
29
76
|
[logoUrl]="logoUrl"
|
|
30
77
|
[collapsedLogoUrl]="collapsedLogoUrl"
|
|
31
|
-
[menuItems]="menuItems"
|
|
32
|
-
[searchItems]="searchItems"
|
|
33
|
-
[nameModeItems]="nameModeItems"
|
|
34
78
|
[showGlobalSearch]="true"
|
|
35
79
|
[showUserPanel]="true"
|
|
36
80
|
[showSettings]="true"
|
|
81
|
+
[showShortcutMenus]="true"
|
|
37
82
|
[showNotifications]="true"
|
|
38
83
|
[showHelp]="true"
|
|
39
|
-
[useInternalDialogs]="true"
|
|
40
|
-
[aboutDialog]="aboutDialog"
|
|
41
|
-
[changePasswordDialog]="changePasswordDialog"
|
|
42
|
-
(menuItemClick)="onMenuItemClick($event)"
|
|
43
|
-
(searchSubmit)="onSearchSubmit($event)"
|
|
44
|
-
(searchItemNavigate)="onSearchItemNavigate($event)"
|
|
45
84
|
(propertyChanged)="onPropertyChange($event)"
|
|
46
85
|
(signOutClick)="onSignOut()"
|
|
47
|
-
(
|
|
86
|
+
(menuItemClick)="onMenuItemClick($event)"
|
|
87
|
+
(searchSubmit)="onSearchSubmit($event)">
|
|
48
88
|
</bayan-core-top-menu-widget>
|
|
49
89
|
```
|
|
50
90
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
interface TopMenuWidgetItem {
|
|
55
|
-
id?: string | number;
|
|
56
|
-
menuName: string;
|
|
57
|
-
menuUrl?: string | null;
|
|
58
|
-
children?: TopMenuWidgetItem[];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface TopMenuWidgetSearchItem {
|
|
62
|
-
id?: string | number;
|
|
63
|
-
menuTitle: string;
|
|
64
|
-
menuSubTitle: string;
|
|
65
|
-
menuUrl?: string | null;
|
|
66
|
-
iconClass?: string | null;
|
|
67
|
-
isTranslatable?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface TopMenuWidgetNameModeItem {
|
|
71
|
-
id: string;
|
|
72
|
-
text: string;
|
|
73
|
-
selected: boolean;
|
|
74
|
-
}
|
|
91
|
+
---
|
|
75
92
|
|
|
76
|
-
|
|
77
|
-
title?: string;
|
|
78
|
-
logoUrl?: string;
|
|
79
|
-
version?: string;
|
|
80
|
-
versionLabel?: string;
|
|
81
|
-
copyright?: string;
|
|
82
|
-
statusLabel?: string;
|
|
83
|
-
licenseButtonLabel?: string;
|
|
84
|
-
releaseNotesButtonLabel?: string;
|
|
85
|
-
supportButtonLabel?: string;
|
|
86
|
-
closeButtonLabel?: string;
|
|
87
|
-
}
|
|
93
|
+
## Side Menu Widget
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
title: string;
|
|
91
|
-
currentPasswordLabel: string;
|
|
92
|
-
newPasswordLabel: string;
|
|
93
|
-
confirmNewPasswordLabel: string;
|
|
94
|
-
primaryButtonText: string;
|
|
95
|
-
}
|
|
95
|
+
Selector: `bayan-core-side-menu-widget`
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
currentPassword: string;
|
|
99
|
-
newPassword: string;
|
|
100
|
-
confirmNewPassword: string;
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Top Menu Widget
|
|
105
|
-
|
|
106
|
-
Selector: `bayan-core-top-menu-widget`
|
|
97
|
+
Loads side navigation from the API and renders a collapsible tree. Reacts automatically when `activePropertyId` or `ActivePropertyChanged` changes.
|
|
107
98
|
|
|
108
99
|
### Inputs
|
|
109
100
|
|
|
110
101
|
| Name | Type | Default | Description |
|
|
111
102
|
|---|---|---|---|
|
|
112
|
-
| `baseUrl` | `string` | `''` | Base URL
|
|
113
|
-
| `systemModule` | `SystemModule \| null` | `null` | Current system module
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `searchItems` | `TopMenuWidgetSearchItem[]` | `[]` | Autocomplete items for global search. |
|
|
121
|
-
| `isSsoLogin` | `boolean` | `false` | Fallback SSO flag when the user panel does not provide one. |
|
|
122
|
-
| `useAlternateNames` | `boolean` | `false` | Enables alternate-names behavior in settings. |
|
|
123
|
-
| `displayAlternateNames` | `boolean` | `false` | Marks alternate names as active. |
|
|
124
|
-
| `hrBlocked` | `boolean` | `false` | Current HR block state. |
|
|
125
|
-
| `hrCanBlock` | `boolean` | `false` | Enables HR block and release actions. |
|
|
126
|
-
| `tkBlocked` | `boolean` | `false` | Current Timekeeping block state. |
|
|
127
|
-
| `tkCanBlock` | `boolean` | `false` | Enables Timekeeping block and release actions. |
|
|
128
|
-
| `employeeNamesMode` | `AppFramePreferences` | | Name display mode option from preferences. |
|
|
129
|
-
| `settingsEnabled` | `boolean` | `true` | Enables settings interactions. |
|
|
130
|
-
| `useInternalDialogs` | `boolean` | `false` | Shows built-in About and Change Password dialogs. |
|
|
131
|
-
| `changePasswordLoading` | `boolean` | `false` | Loading state for the built-in Change Password dialog. |
|
|
132
|
-
| `changePasswordDialog` | `TopMenuWidgetChangePasswordDialogConfig` | default labels | Built-in Change Password dialog labels. |
|
|
133
|
-
| `aboutDialog` | `TopMenuWidgetAboutDialogConfig` | default labels | Built-in About dialog content and labels. |
|
|
134
|
-
| `showGlobalSearch` | `boolean` | `false` | Shows the global search widget. |
|
|
135
|
-
| `showUserPanel` | `boolean` | `false` | Shows the user panel widget. |
|
|
136
|
-
| `showSettings` | `boolean` | `false` | Shows the settings widget. |
|
|
137
|
-
| `showNotifications` | `boolean` | `true` | Shows the notifications widget. |
|
|
138
|
-
| `notificationsTitle` | `string` | `'Notifications'` | Notification link title text or translation key. |
|
|
139
|
-
| `showHelp` | `boolean` | `true` | Shows the help action. |
|
|
140
|
-
| `helpTitle` | `string` | `'Help'` | Help link title text or translation key. |
|
|
141
|
-
| `helpUrl` | `string \| null` | `null` | Help navigation target. |
|
|
142
|
-
| `helpIcon` | `IconDefinition` | `faQuestionCircle` | Help icon. |
|
|
143
|
-
| `helpAnchorClass` | `string` | `'menu-icon-btn top-menu-widget__help-link'` | CSS classes for the help anchor. |
|
|
144
|
-
| `helpUrlTarget` | `'_self' \| '_blank' \| string` | `'_blank'` | Anchor target for the help action. |
|
|
103
|
+
| `baseUrl` | `string` | `''` | Base URL for API calls. |
|
|
104
|
+
| `systemModule` | `SystemModule \| null` | `null` | Current system module — used to scope menu loading. |
|
|
105
|
+
| `activePropertyId` | `number` | `0` | Active property ID. Menu reloads when this changes. |
|
|
106
|
+
| `ActivePropertyChanged` | `boolean` | `false` | Toggle this flag (flip true/false) when the property changes to force a menu reload. Pair with `BayanCoreConfigService` to read the new property ID. |
|
|
107
|
+
| `collapsed` | `boolean` | `false` | Collapsed sidebar state. |
|
|
108
|
+
| `logoUrl` | `string` | Bayan CDN URL | Logo shown in expanded state. |
|
|
109
|
+
| `collapsedLogoUrl` | `string` | Bayan CDN URL | Logo shown in collapsed state. |
|
|
110
|
+
| `showFooter` | `boolean` | `true` | Shows/hides the sidebar footer (copyright, Terms, Privacy, toggle button). |
|
|
145
111
|
|
|
146
112
|
### Outputs
|
|
147
113
|
|
|
148
114
|
| Name | Type | Description |
|
|
149
115
|
|---|---|---|
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
| `menuItemClick` | `EventEmitter<TopMenuWidgetItem>` | Fired when a leaf menu item is activated. |
|
|
153
|
-
| `searchSubmit` | `EventEmitter<string>` | Fired when free-text search is submitted. |
|
|
154
|
-
| `searchItemNavigate` | `EventEmitter<TopMenuWidgetSearchItem>` | Fired when an autocomplete result is chosen. |
|
|
155
|
-
| `propertyChanged` | `EventEmitter<PropertyOption>` | Fired when the active property changes. |
|
|
156
|
-
| `signOutClick` | `EventEmitter<void>` | Fired when sign out is requested. |
|
|
157
|
-
| `alternateNamesChange` | `EventEmitter<void>` | Fired when alternate names are toggled. |
|
|
158
|
-
| `nameModeChange` | `EventEmitter<number>` | Fired when a name mode item is selected. |
|
|
159
|
-
| `blockHrClick` | `EventEmitter<void>` | Fired when HR block is requested. |
|
|
160
|
-
| `releaseHrClick` | `EventEmitter<void>` | Fired when HR release is requested. |
|
|
161
|
-
| `blockTkClick` | `EventEmitter<void>` | Fired when Timekeeping block is requested. |
|
|
162
|
-
| `releaseTkClick` | `EventEmitter<void>` | Fired when Timekeeping release is requested. |
|
|
163
|
-
| `changePasswordClick` | `EventEmitter<void>` | Fired when Change Password is requested from settings. |
|
|
164
|
-
| `openAboutClick` | `EventEmitter<void>` | Fired when About is requested from settings. |
|
|
165
|
-
| `aboutLicenseClick` | `EventEmitter<void>` | Fired when the About dialog license action is clicked. |
|
|
166
|
-
| `aboutReleaseNotesClick` | `EventEmitter<void>` | Fired when the About dialog release-notes action is clicked. |
|
|
167
|
-
| `aboutSupportClick` | `EventEmitter<void>` | Fired when the About dialog support action is clicked. |
|
|
168
|
-
| `submitPasswordChange` | `EventEmitter<TopMenuWidgetChangePasswordPayload>` | Fired when the built-in Change Password dialog is submitted. |
|
|
116
|
+
| `collapsedChange` | `EventEmitter<boolean>` | Fired when the sidebar toggle is clicked. Use with `[(collapsed)]`. |
|
|
117
|
+
| `itemClick` | `EventEmitter<SystemMenu>` | Fired when a menu item is activated. |
|
|
169
118
|
|
|
170
|
-
|
|
119
|
+
### Connecting Top Menu Property Changes to Side Menu
|
|
171
120
|
|
|
172
|
-
|
|
121
|
+
When the user switches property in the top menu, pass `ActivePropertyChanged` to the side menu so it reloads:
|
|
173
122
|
|
|
174
|
-
|
|
123
|
+
```ts
|
|
124
|
+
// In your component
|
|
125
|
+
activePropertyId = 0;
|
|
126
|
+
activePropertyChanged = false;
|
|
175
127
|
|
|
176
|
-
|
|
128
|
+
onPropertyChange(property: PropertyOption) {
|
|
129
|
+
this.activePropertyId = property.PropertyId;
|
|
130
|
+
this.activePropertyChanged = !this.activePropertyChanged; // toggle to trigger reload
|
|
131
|
+
}
|
|
132
|
+
```
|
|
177
133
|
|
|
178
|
-
|
|
134
|
+
```html
|
|
135
|
+
<bayan-core-top-menu-widget
|
|
136
|
+
...
|
|
137
|
+
(propertyChanged)="onPropertyChange($event)">
|
|
138
|
+
</bayan-core-top-menu-widget>
|
|
179
139
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
140
|
+
<bayan-core-side-menu-widget
|
|
141
|
+
[baseUrl]="appBaseUrl"
|
|
142
|
+
[systemModule]="systemModule"
|
|
143
|
+
[activePropertyId]="activePropertyId"
|
|
144
|
+
[ActivePropertyChanged]="activePropertyChanged"
|
|
145
|
+
[(collapsed)]="sidebarCollapsed"
|
|
146
|
+
(itemClick)="onMenuItemClick($event)">
|
|
147
|
+
</bayan-core-side-menu-widget>
|
|
148
|
+
```
|
|
186
149
|
|
|
187
|
-
|
|
150
|
+
Alternatively, inject `BayanCoreConfigService` in your service layer to read the current property ID reactively:
|
|
188
151
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
| `search` | `EventEmitter<string>` | Fired when the user submits free-text search with Enter. |
|
|
192
|
-
| `itemNavigate` | `EventEmitter<TopMenuWidgetSearchItem>` | Fired when the user selects a result item. |
|
|
152
|
+
```ts
|
|
153
|
+
import { BayanCoreConfigService } from '@skysoftware-co/bayan-core-widgets-ui';
|
|
193
154
|
|
|
194
|
-
|
|
155
|
+
constructor(private propertyState: BayanCoreConfigService) {
|
|
156
|
+
this.propertyState.getActivePropertyId$().subscribe(id => {
|
|
157
|
+
this.activePropertyId = id;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
```
|
|
195
161
|
|
|
196
|
-
|
|
162
|
+
### Usage Example (with footer hidden)
|
|
163
|
+
|
|
164
|
+
```html
|
|
165
|
+
<bayan-core-side-menu-widget
|
|
166
|
+
[baseUrl]="appBaseUrl"
|
|
167
|
+
[systemModule]="systemModule"
|
|
168
|
+
[activePropertyId]="activePropertyId"
|
|
169
|
+
[ActivePropertyChanged]="activePropertyChanged"
|
|
170
|
+
[showFooter]="false"
|
|
171
|
+
[(collapsed)]="sidebarCollapsed"
|
|
172
|
+
(itemClick)="onMenuItemClick($event)">
|
|
173
|
+
</bayan-core-side-menu-widget>
|
|
174
|
+
```
|
|
197
175
|
|
|
198
|
-
|
|
176
|
+
---
|
|
199
177
|
|
|
200
|
-
|
|
201
|
-
|---|---|---|---|
|
|
202
|
-
| `baseUrl` | `string` | `''` | Base URL used to resolve item URLs. |
|
|
203
|
-
| `ActivePropertyChanged` | `boolean` | `false` | Boolean change token used to close open menu branches after a property switch. |
|
|
204
|
-
| `item` | `TopMenuWidgetItem` | required | Menu item to render. |
|
|
178
|
+
## Child Widgets (Internal Composition)
|
|
205
179
|
|
|
206
|
-
|
|
180
|
+
These are exported for advanced scenarios but are composed automatically by the top-menu and side-menu widgets.
|
|
207
181
|
|
|
208
|
-
|
|
182
|
+
### BayanCoreItemWidgetComponent
|
|
183
|
+
|
|
184
|
+
Selector: `bayan-core-item-widget`
|
|
185
|
+
|
|
186
|
+
| Input | Type | Default | Description |
|
|
187
|
+
|---|---|---|---|
|
|
188
|
+
| `baseUrl` | `string` | `''` | Base URL. |
|
|
189
|
+
| `ActivePropertyChanged` | `boolean` | `false` | Toggle to reset open dropdowns on property switch. |
|
|
190
|
+
| `item` | `TopMenuShortcut` | required | Menu item to render. |
|
|
191
|
+
| `navItemClass` | `string` | `'nav-item'` | CSS class for `<li>`. |
|
|
192
|
+
| `navLinkClass` | `string` | `'nav-link'` | CSS class for leaf `<a>`. |
|
|
193
|
+
| `dropdownClass` | `string` | `'nav-item dropdown'` | CSS class for dropdown `<li>`. |
|
|
194
|
+
| `dropdownOpenClass` | `string` | `'open'` | CSS class added when dropdown is open. |
|
|
195
|
+
| `dropdownToggleClass` | `string` | `'nav-link dropdown-toggle'` | CSS class for the dropdown toggle `<a>`. |
|
|
196
|
+
| `caretClass` | `string` | `'caret'` | CSS class for the caret `<span>`. |
|
|
197
|
+
| `dropdownMenuClass` | `string` | `'dropdown-menu menu-dropdown-panel'` | CSS class for the dropdown `<ul>`. |
|
|
198
|
+
|
|
199
|
+
| Output | Type | Description |
|
|
209
200
|
|---|---|---|
|
|
210
|
-
| `itemClick` | `EventEmitter<
|
|
201
|
+
| `itemClick` | `EventEmitter<TopMenuShortcut>` | Fired when a leaf item is clicked. |
|
|
211
202
|
|
|
212
|
-
|
|
203
|
+
---
|
|
213
204
|
|
|
214
|
-
|
|
205
|
+
### BayanCoreUserPanelWidgetComponent
|
|
215
206
|
|
|
216
|
-
|
|
207
|
+
Selector: `bayan-core-user-panel-widget`
|
|
217
208
|
|
|
218
|
-
|
|
|
209
|
+
| Input | Type | Default | Description |
|
|
219
210
|
|---|---|---|---|
|
|
220
|
-
| `baseUrl` | `string` | `''` | Base URL
|
|
221
|
-
| `
|
|
222
|
-
| `wrapperClass` | `string` | `'notifications-icon-wrap menu-dropdown-host'` | Wrapper CSS classes. |
|
|
223
|
-
| `linkClass` | `string` | `'menu-icon-btn cursor-pointer top-menu-widget__notification-btn'` | Anchor CSS classes. |
|
|
224
|
-
| `iconClass` | `string` | `'fs-6'` | Bell icon CSS classes. |
|
|
225
|
-
| `badgeClass` | `string` | `'top-menu-widget__notification-badge'` | Badge CSS classes. |
|
|
211
|
+
| `baseUrl` | `string` | `''` | Base URL for user panel API. |
|
|
212
|
+
| `showSignOutIcon` | `boolean` | `true` | Shows/hides the sign-out icon. |
|
|
226
213
|
|
|
227
|
-
|
|
214
|
+
| Output | Type | Description |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `propertyChanged` | `EventEmitter<PropertyOption>` | Fired after property switch succeeds. |
|
|
217
|
+
| `signOutClick` | `EventEmitter<void>` | Fired when sign out is requested. |
|
|
228
218
|
|
|
229
|
-
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### BayanCoreSettingsWidgetComponent
|
|
230
222
|
|
|
231
223
|
Selector: `bayan-core-settings-widget`
|
|
232
224
|
|
|
233
|
-
|
|
225
|
+
| Input | Type | Default | Description |
|
|
226
|
+
|---|---|---|---|
|
|
227
|
+
| `baseUrl` | `string` | `''` | Base URL. |
|
|
228
|
+
| `ActivePropertyChanged` | `boolean` | `false` | Closes the settings menu on property switch. |
|
|
229
|
+
| `systemModule` | `SystemModule \| null` | `null` | Module context for settings. |
|
|
230
|
+
| `licenseUrl` | `string` | `''` | License URL shown in the About dialog. |
|
|
231
|
+
| `releaseNotesUrl` | `string` | `''` | Release notes URL. |
|
|
232
|
+
| `supportUrl` | `string` | `''` | Support URL. |
|
|
233
|
+
|
|
234
|
+
| Output | Type | Description |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| `alternateNamesChange` | `EventEmitter<boolean>` | Fired when alternate names toggle changes. |
|
|
237
|
+
| `employeeNameModeChange` | `EventEmitter<EmployeeNamesModeOption>` | Fired when name mode changes. |
|
|
234
238
|
|
|
235
|
-
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### BayanCoreGlobalSearchWidgetComponent
|
|
242
|
+
|
|
243
|
+
Selector: `bayan-core-global-search-widget`
|
|
244
|
+
|
|
245
|
+
| Input | Type | Default | Description |
|
|
236
246
|
|---|---|---|---|
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `hrBlocked` | `boolean` | `false` | Current HR block state. |
|
|
241
|
-
| `hrCanBlock` | `boolean` | `false` | Enables HR block and release actions. |
|
|
242
|
-
| `tkBlocked` | `boolean` | `false` | Current Timekeeping block state. |
|
|
243
|
-
| `tkCanBlock` | `boolean` | `false` | Enables Timekeeping block and release actions. |
|
|
244
|
-
| `employeeNamesMode` | `AppFramePreferences` | | Name mode option from preferences. |
|
|
245
|
-
| `settingsEnabled` | `boolean` | `true` | Enables settings interactions. |
|
|
246
|
-
|
|
247
|
-
Outputs:
|
|
247
|
+
| `baseUrl` | `string` | `''` | Base URL. |
|
|
248
|
+
| `ActivePropertyChanged` | `boolean` | `false` | Resets the search input on property switch. |
|
|
249
|
+
| `dataSource` | `GlobalSearchMenu[]` | `[]` | Search results for the autocomplete. |
|
|
248
250
|
|
|
249
|
-
|
|
|
251
|
+
| Output | Type | Description |
|
|
250
252
|
|---|---|---|
|
|
251
|
-
| `
|
|
252
|
-
| `nameModeChange` | `EventEmitter<number>` | Fired when a name mode item is selected. |
|
|
253
|
-
| `blockHrClick` | `EventEmitter<void>` | Fired when HR block is requested. |
|
|
254
|
-
| `releaseHrClick` | `EventEmitter<void>` | Fired when HR release is requested. |
|
|
255
|
-
| `blockTkClick` | `EventEmitter<void>` | Fired when Timekeeping block is requested. |
|
|
256
|
-
| `releaseTkClick` | `EventEmitter<void>` | Fired when Timekeeping release is requested. |
|
|
257
|
-
| `changePasswordClick` | `EventEmitter<void>` | Fired when Change Password is requested. |
|
|
258
|
-
| `openAboutClick` | `EventEmitter<void>` | Fired when About is requested. |
|
|
253
|
+
| `search` | `EventEmitter<string>` | Fired on free-text search submit. |
|
|
259
254
|
|
|
260
|
-
|
|
255
|
+
---
|
|
261
256
|
|
|
262
|
-
|
|
257
|
+
### BayanCoreNotificationsWidgetComponent
|
|
263
258
|
|
|
264
|
-
|
|
259
|
+
Selector: `bayan-core-notifications-widget`
|
|
265
260
|
|
|
266
|
-
|
|
|
261
|
+
| Input | Type | Default | Description |
|
|
267
262
|
|---|---|---|---|
|
|
268
|
-
| `baseUrl` | `string` | `''` | Base URL
|
|
269
|
-
| `
|
|
270
|
-
| `dropdownOpenClass` | `string` | `'open'` | CSS class added while the dropdown is open. |
|
|
271
|
-
| `toggleButtonClass` | `string` | `'employee-toggle'` | Toggle button CSS classes. |
|
|
272
|
-
| `employeeInfoClass` | `string` | `'employee-info'` | Employee info wrapper CSS classes. |
|
|
273
|
-
| `userNameClass` | `string` | `'user-name'` | User name text CSS classes. |
|
|
274
|
-
| `propertyNameClass` | `string` | `'property-name'` | Active property text CSS classes. |
|
|
275
|
-
| `caretClass` | `string` | `'employee-caret'` | Caret CSS classes. |
|
|
276
|
-
| `menuClass` | `string` | `'employee-menu menu-dropdown-panel'` | Dropdown menu CSS classes. |
|
|
277
|
-
| `sectionLabelClass` | `string` | `'menu-section-label'` | Section label CSS classes. |
|
|
278
|
-
| `menuItemClass` | `string` | `'menu-item'` | Property row CSS classes. |
|
|
279
|
-
| `menuItemActiveClass` | `string` | `'menu-item-active'` | Active property CSS class. |
|
|
280
|
-
| `indicatorClass` | `string` | `'menu-indicator'` | Selection indicator CSS classes. |
|
|
281
|
-
| `invisibleIndicatorClass` | `string` | `'invisible'` | Hidden indicator CSS class. |
|
|
282
|
-
| `dividerClass` | `string` | `'menu-divider'` | Divider CSS classes. |
|
|
283
|
-
| `signOutButtonClass` | `string` | `'menu-item menu-item-signout'` | Sign-out button CSS classes. |
|
|
284
|
-
| `showSignOutIcon` | `boolean` | `true` | Shows or hides the sign-out icon. |
|
|
285
|
-
| `signOutIconClass` | `string` | `'mx-2'` | Sign-out icon CSS classes. |
|
|
286
|
-
|
|
287
|
-
Outputs:
|
|
263
|
+
| `baseUrl` | `string` | `''` | Base URL for notifications API. |
|
|
264
|
+
| `title` | `string` | `'Notifications'` | Icon title / translation key. |
|
|
288
265
|
|
|
289
|
-
|
|
290
|
-
|---|---|---|
|
|
291
|
-
| `propertyChanged` | `EventEmitter<PropertyOption>` | Fired after `switchProperty` succeeds and the widget refetches the user panel. |
|
|
292
|
-
| `signOutClick` | `EventEmitter<void>` | Fired when sign out is requested. |
|
|
266
|
+
---
|
|
293
267
|
|
|
294
|
-
###
|
|
268
|
+
### BayanCoreChangePasswordWidgetComponent
|
|
295
269
|
|
|
296
270
|
Selector: `bayan-core-change-password-widget`
|
|
297
271
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
| Name | Type | Default | Description |
|
|
272
|
+
| Input | Type | Default | Description |
|
|
301
273
|
|---|---|---|---|
|
|
302
|
-
| `baseUrl` | `string` | `''` |
|
|
274
|
+
| `baseUrl` | `string` | `''` | Base URL. |
|
|
303
275
|
| `visible` | `boolean` | `false` | Controls popup visibility. |
|
|
304
|
-
| `config` | `TopMenuWidgetChangePasswordDialogConfig` | required | Dialog labels and title. |
|
|
305
|
-
| `isSubmitting` | `boolean` | `false` | Disables editing while submission is in progress. |
|
|
306
276
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
| Name | Type | Description |
|
|
277
|
+
| Output | Type | Description |
|
|
310
278
|
|---|---|---|
|
|
311
|
-
| `visibleChange` | `EventEmitter<boolean>` |
|
|
312
|
-
| `submitPasswordChange` | `EventEmitter<TopMenuWidgetChangePasswordPayload>` | Fired with the form payload when save succeeds validation. |
|
|
279
|
+
| `visibleChange` | `EventEmitter<boolean>` | Two-way binding support for `[(visible)]`. |
|
|
313
280
|
|
|
314
|
-
|
|
281
|
+
---
|
|
315
282
|
|
|
316
|
-
|
|
283
|
+
### BayanCoreAboutDialogWidgetComponent
|
|
317
284
|
|
|
318
|
-
|
|
285
|
+
Selector: `bayan-core-about-dialog-widget`
|
|
319
286
|
|
|
320
|
-
|
|
|
287
|
+
| Input | Type | Default | Description |
|
|
321
288
|
|---|---|---|---|
|
|
322
|
-
| `baseUrl` | `string` | `''` |
|
|
289
|
+
| `baseUrl` | `string` | `''` | Base URL. |
|
|
323
290
|
| `visible` | `boolean` | `false` | Controls dialog visibility. |
|
|
324
|
-
| `
|
|
291
|
+
| `licenseUrl` | `string` | `''` | License button URL. |
|
|
292
|
+
| `releaseNotesUrl` | `string` | `''` | Release notes button URL. |
|
|
293
|
+
| `supportUrl` | `string` | `''` | Support button URL. |
|
|
325
294
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
| Name | Type | Description |
|
|
295
|
+
| Output | Type | Description |
|
|
329
296
|
|---|---|---|
|
|
330
|
-
| `visibleChange` | `EventEmitter<boolean>` |
|
|
331
|
-
| `licenseClick` | `EventEmitter<void>` | Fired when the license action is clicked. |
|
|
332
|
-
| `releaseNotesClick` | `EventEmitter<void>` | Fired when the release-notes action is clicked. |
|
|
333
|
-
| `supportClick` | `EventEmitter<void>` | Fired when the support action is clicked. |
|
|
334
|
-
|
|
335
|
-
## Widget API Reference
|
|
336
|
-
|
|
337
|
-
### BayanCoreTopMenuWidgetComponent
|
|
338
|
-
**Inputs:**
|
|
339
|
-
- `baseUrl: string`
|
|
340
|
-
- `systemModule: SystemModule | null`
|
|
341
|
-
- `sidebarCollapsed: boolean`
|
|
342
|
-
- `homeUrl: string | null`
|
|
343
|
-
- `logoUrl: string`
|
|
344
|
-
- `collapsedLogoUrl: string`
|
|
345
|
-
- `isSsoLogin: boolean`
|
|
346
|
-
- `showGlobalSearch: boolean`
|
|
347
|
-
- `showUserPanel: boolean`
|
|
348
|
-
- `showSettings: boolean`
|
|
349
|
-
- `ShowShourtcutMenus: boolean`
|
|
350
|
-
- `showNotifications: boolean`
|
|
351
|
-
- `notificationsTitle: string`
|
|
352
|
-
- `showHelp: boolean`
|
|
353
|
-
- `helpTitle: string`
|
|
354
|
-
- `helpUrl: string | null`
|
|
355
|
-
- `helpIcon: IconDefinition`
|
|
356
|
-
- `helpAnchorClass: string`
|
|
357
|
-
- `helpUrlTarget: '_self' | '_blank' | string`
|
|
358
|
-
- `licenseUrl: string`
|
|
359
|
-
- `releaseNotesUrl: string`
|
|
360
|
-
- `supportUrl: string`
|
|
361
|
-
|
|
362
|
-
**Outputs:**
|
|
363
|
-
- `logoClick: EventEmitter<void>`
|
|
364
|
-
- `helpClick: EventEmitter<void>`
|
|
365
|
-
- `menuItemClick: EventEmitter<TopMenuShortcut>`
|
|
366
|
-
- `searchSubmit: EventEmitter<string>`
|
|
367
|
-
- `propertyChanged: EventEmitter<PropertyOption>`
|
|
368
|
-
- `signOutClick: EventEmitter<void>`
|
|
369
|
-
- `alternateNamesChange: EventEmitter<boolean>`
|
|
370
|
-
- `employeeNameModeChange: EventEmitter<EmployeeNamesModeOption>`
|
|
297
|
+
| `visibleChange` | `EventEmitter<boolean>` | Two-way binding support for `[(visible)]`. |
|
|
371
298
|
|
|
372
299
|
---
|
|
373
300
|
|
|
374
|
-
|
|
375
|
-
**Inputs:**
|
|
376
|
-
- `baseUrl: string`
|
|
377
|
-
- `licenseUrl: string`
|
|
378
|
-
- `releaseNotesUrl: string`
|
|
379
|
-
- `supportUrl: string`
|
|
380
|
-
- `ActivePropertyChanged: boolean`
|
|
381
|
-
- `checkIcon: any`
|
|
382
|
-
- `cogIcon: any`
|
|
383
|
-
- `infoIcon: any`
|
|
384
|
-
- `dropdownOpen: Signal<boolean>`
|
|
385
|
-
- `dropdownHostClass: string`
|
|
386
|
-
- `toggleBtnClass: string`
|
|
387
|
-
- `menuPanelClass: string`
|
|
388
|
-
- `sectionLabelClass: string`
|
|
389
|
-
- `menuRowClass: string`
|
|
390
|
-
- `dividerClass: string`
|
|
391
|
-
- `indicatorClass: string`
|
|
392
|
-
- `indicatorActiveClass: string`
|
|
393
|
-
- `indicatorInvisibleClass: string`
|
|
394
|
-
- `alternateNamesLinkClass: string`
|
|
395
|
-
|
|
396
|
-
**Outputs:**
|
|
397
|
-
- `alternateNamesChange: EventEmitter<boolean>`
|
|
398
|
-
- `nameModeChange: EventEmitter<EmployeeNamesModeOption>`
|
|
399
|
-
|
|
400
|
-
---
|
|
301
|
+
## Shared Services
|
|
401
302
|
|
|
402
|
-
###
|
|
403
|
-
**Inputs:**
|
|
404
|
-
- `baseUrl: string`
|
|
405
|
-
- `visible: boolean`
|
|
406
|
-
- `config: TopMenuWidgetAboutDialogConfig`
|
|
407
|
-
- `licenseUrl: string`
|
|
408
|
-
- `releaseNotesUrl: string`
|
|
409
|
-
- `supportUrl: string`
|
|
410
|
-
- `backdropClass: string`
|
|
411
|
-
- `modalClass: string`
|
|
412
|
-
- `headerClass: string`
|
|
413
|
-
- `titleClass: string`
|
|
414
|
-
- `closeBtnClass: string`
|
|
415
|
-
- `bodyClass: string`
|
|
416
|
-
- `logoClass: string`
|
|
417
|
-
- `productNameClass: string`
|
|
418
|
-
- `versionTextClass: string`
|
|
419
|
-
- `upToDateClass: string`
|
|
420
|
-
- `copyrightClass: string`
|
|
421
|
-
- `actionsClass: string`
|
|
422
|
-
- `actionBtnClass: string`
|
|
423
|
-
|
|
424
|
-
**Outputs:**
|
|
425
|
-
- `visibleChange: EventEmitter<boolean>`
|
|
426
|
-
- `licenseClick: EventEmitter<void>`
|
|
427
|
-
- `releaseNotesClick: EventEmitter<void>`
|
|
428
|
-
- `supportClick: EventEmitter<void>`
|
|
303
|
+
### BayanCoreConfigService
|
|
429
304
|
|
|
430
|
-
|
|
305
|
+
A singleton service (`providedIn: 'root'`) for sharing the active property ID across widgets without explicit prop-drilling.
|
|
431
306
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
- `baseUrl: string`
|
|
435
|
-
- `visible: boolean`
|
|
436
|
-
- `config: TopMenuWidgetChangePasswordDialogConfig`
|
|
437
|
-
- `isSubmitting: boolean`
|
|
307
|
+
```ts
|
|
308
|
+
import { BayanCoreConfigService } from '@skysoftware-co/bayan-core-widgets-ui';
|
|
438
309
|
|
|
439
|
-
|
|
440
|
-
|
|
310
|
+
// Set (e.g. after property switch)
|
|
311
|
+
configService.setActivePropertyId(propertyId);
|
|
441
312
|
|
|
442
|
-
|
|
313
|
+
// Read (reactive)
|
|
314
|
+
configService.getActivePropertyId$().subscribe(id => { ... });
|
|
315
|
+
```
|
|
443
316
|
|
|
444
|
-
###
|
|
445
|
-
**Inputs:**
|
|
446
|
-
- `baseUrl: string`
|
|
447
|
-
- `ActivePropertyChanged: boolean`
|
|
448
|
-
- `ActivePropertyId: number`
|
|
449
|
-
- `placeholder: string`
|
|
450
|
-
- `searchMode: 'contains' | 'startswith'`
|
|
451
|
-
- `stylingMode: 'filled' | 'outlined' | 'underlined'`
|
|
452
|
-
- `searchWrapperClass: string`
|
|
453
|
-
- `searchItemClass: string`
|
|
454
|
-
- `searchItemTitleClass: string`
|
|
455
|
-
- `searchItemSubtitleClass: string`
|
|
456
|
-
- `iconClass: string`
|
|
457
|
-
|
|
458
|
-
**Outputs:**
|
|
459
|
-
- `search: EventEmitter<string>`
|
|
460
|
-
- `itemNavigate: EventEmitter<GlobalSearchMenu>`
|
|
317
|
+
### BayanCoreTranslatePipe / BayanCoreTranslateService
|
|
461
318
|
|
|
462
|
-
|
|
319
|
+
Built-in i18n pipe and service that checks a built-in lexicon first, then a runtime lexicon.
|
|
463
320
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
- `wrapperClass: string`
|
|
468
|
-
- `dropdownOpenClass: string`
|
|
469
|
-
- `toggleButtonClass: string`
|
|
470
|
-
- `employeeInfoClass: string`
|
|
471
|
-
- `userNameClass: string`
|
|
472
|
-
- `propertyNameClass: string`
|
|
473
|
-
- `caretClass: string`
|
|
474
|
-
- `menuClass: string`
|
|
475
|
-
- `sectionLabelClass: string`
|
|
476
|
-
- `menuItemClass: string`
|
|
477
|
-
- `menuItemActiveClass: string`
|
|
478
|
-
- `indicatorClass: string`
|
|
479
|
-
- `invisibleIndicatorClass: string`
|
|
480
|
-
- `dividerClass: string`
|
|
481
|
-
- `signOutButtonClass: string`
|
|
482
|
-
- `showSignOutIcon: boolean`
|
|
483
|
-
- `signOutIconClass: string`
|
|
484
|
-
|
|
485
|
-
**Outputs:**
|
|
486
|
-
- `propertyChanged: EventEmitter<PropertyOption>`
|
|
487
|
-
- `signOutClick: EventEmitter<void>`
|
|
321
|
+
```html
|
|
322
|
+
{{ 'SomeKey' | translate }}
|
|
323
|
+
```
|
|
488
324
|
|
|
489
325
|
---
|
|
490
326
|
|
|
491
|
-
|
|
492
|
-
**Inputs:**
|
|
493
|
-
- `baseUrl: string`
|
|
494
|
-
- `ActivePropertyChanged: boolean`
|
|
495
|
-
- `item: TopMenuShortcut`
|
|
496
|
-
- `navItemClass: string`
|
|
497
|
-
- `navLinkClass: string`
|
|
498
|
-
- `dropdownClass: string`
|
|
499
|
-
- `dropdownOpenClass: string`
|
|
500
|
-
- `dropdownToggleClass: string`
|
|
501
|
-
- `caretClass: string`
|
|
502
|
-
- `dropdownMenuClass: string`
|
|
503
|
-
|
|
504
|
-
**Outputs:**
|
|
505
|
-
- `itemClick: EventEmitter<TopMenuShortcut>`
|
|
506
|
-
|
|
507
|
-
---
|
|
327
|
+
## Build
|
|
508
328
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
- `title: string`
|
|
513
|
-
- `wrapperClass: string`
|
|
514
|
-
- `linkClass: string`
|
|
515
|
-
- `iconClass: string`
|
|
516
|
-
- `badgeClass: string`
|
|
329
|
+
```bash
|
|
330
|
+
ng build BayanCoreComponents
|
|
331
|
+
```
|
|
517
332
|
|
|
518
|
-
##
|
|
333
|
+
## Publish
|
|
519
334
|
|
|
520
335
|
```bash
|
|
521
|
-
|
|
336
|
+
cd dist/bayan-core-ui
|
|
337
|
+
npm publish --access public
|
|
522
338
|
```
|