@skysoftware-co/bayan-core-widgets-ui 0.0.8 → 0.0.10
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 +520 -1
- package/fesm2022/skysoftware-co-bayan-core-widgets-ui.mjs +4125 -0
- package/fesm2022/skysoftware-co-bayan-core-widgets-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/shared/common-methods/navigation.utils.d.ts +3 -0
- package/lib/shared/menu.dtos.d.ts +90 -0
- package/lib/shared/menu.service.d.ts +23 -0
- package/lib/shared/pipes/translate.pipe.d.ts +10 -0
- package/lib/shared/services/translate.service.d.ts +12 -0
- package/lib/top-menu-widget/components/about-dialog-widget/about-dialog-widget.component.d.ts +36 -0
- package/lib/top-menu-widget/components/change-password-widget/change-password-widget.component.d.ts +32 -0
- package/lib/top-menu-widget/components/global-search-widget/global-search-widget.component.d.ts +58 -0
- package/lib/top-menu-widget/components/item-widget/item-widget.component.d.ts +28 -0
- package/lib/top-menu-widget/components/notifications-widget/notifications-widget.component.d.ts +22 -0
- package/lib/top-menu-widget/components/settings-widget/settings-widget.component.d.ts +73 -0
- package/lib/top-menu-widget/components/user-panel-widget/user-panel-widget.component.d.ts +42 -0
- package/lib/top-menu-widget/top-menu-widget.component.d.ts +61 -0
- package/lib/top-menu-widget/top-menu-widget.models.d.ts +24 -0
- package/package.json +56 -59
- package/{projects/bayan-core-ui/src/public-api.ts → public-api.d.ts} +10 -14
- package/.editorconfig +0 -17
- package/.github/copilot/WidgetDevelopmentGuide.md +0 -632
- package/.github/copilot/WidgetProjectStructure.md +0 -81
- package/.github/copilot/git.md +0 -176
- package/.github/copilot/guideline.md +0 -466
- package/.github/copilot-instructions.md +0 -697
- package/.github/prompts/As world class developer, create unit tests for.prompt.md +0 -7
- package/Web.config +0 -7
- package/angular.json +0 -43
- package/projects/bayan-core-ui/README.md +0 -522
- package/projects/bayan-core-ui/ng-package.json +0 -7
- package/projects/bayan-core-ui/package.json +0 -36
- package/projects/bayan-core-ui/src/assets/i18n/ar.json +0 -725
- package/projects/bayan-core-ui/src/assets/i18n/en.json +0 -683
- package/projects/bayan-core-ui/src/assets/i18n/fr.json +0 -687
- package/projects/bayan-core-ui/src/lib/shared/common-methods/navigation.utils.ts +0 -21
- package/projects/bayan-core-ui/src/lib/shared/menu.dtos.ts +0 -107
- package/projects/bayan-core-ui/src/lib/shared/menu.service.ts +0 -157
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/about-dialog-widget/about-dialog-widget.component.html +0 -37
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/about-dialog-widget/about-dialog-widget.component.ts +0 -68
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/change-password-widget/change-password-widget.component.html +0 -56
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/change-password-widget/change-password-widget.component.ts +0 -158
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/global-search-widget/global-search-widget.component.html +0 -39
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/global-search-widget/global-search-widget.component.ts +0 -152
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/item-widget/item-widget.component.html +0 -39
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/item-widget/item-widget.component.ts +0 -80
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/notifications-widget/notifications-widget.component.html +0 -10
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/notifications-widget/notifications-widget.component.ts +0 -89
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/settings-widget/settings-widget.component.html +0 -111
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/settings-widget/settings-widget.component.ts +0 -235
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/user-panel-widget/user-panel-widget.component.html +0 -54
- package/projects/bayan-core-ui/src/lib/top-menu-widget/components/user-panel-widget/user-panel-widget.component.ts +0 -140
- package/projects/bayan-core-ui/src/lib/top-menu-widget/top-menu-widget.component.html +0 -107
- package/projects/bayan-core-ui/src/lib/top-menu-widget/top-menu-widget.component.ts +0 -164
- package/projects/bayan-core-ui/src/lib/top-menu-widget/top-menu-widget.models.ts +0 -29
- package/projects/bayan-core-ui/src/lib/top-menu-widget/top-menu-widget.styles.css +0 -1378
- package/projects/bayan-core-ui/tsconfig.lib.json +0 -16
- package/projects/bayan-core-ui/tsconfig.lib.prod.json +0 -9
- package/projects/bayan-core-ui/tsconfig.spec.json +0 -13
- package/tsconfig.json +0 -40
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { BayanCoreTopMenuService } from '../shared/menu.service';
|
|
2
|
-
import { TopMenuShortcut, PropertyOption, SystemModule, EmployeeNamesModeOption } from '../shared/menu.dtos';
|
|
3
|
-
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
4
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, inject, signal } from '@angular/core';
|
|
5
|
-
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
6
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
7
|
-
import { faQuestionCircle } from '@fortawesome/pro-solid-svg-icons';
|
|
8
|
-
import { Router } from '@angular/router';
|
|
9
|
-
import { DxToolbarModule } from 'devextreme-angular';
|
|
10
|
-
import { TranslatePipe } from '@skysoftware-co/sky-components-ui';
|
|
11
|
-
import { isExternalNavigation, resolveUrl } from '../shared/common-methods/navigation.utils';
|
|
12
|
-
import {
|
|
13
|
-
TopMenuWidgetAboutDialogConfig,
|
|
14
|
-
TopMenuWidgetChangePasswordDialogConfig,
|
|
15
|
-
TopMenuWidgetChangePasswordPayload
|
|
16
|
-
} from './top-menu-widget.models';
|
|
17
|
-
import { BayanCoreAboutDialogWidgetComponent } from './components/about-dialog-widget/about-dialog-widget.component';
|
|
18
|
-
import { BayanCoreChangePasswordWidgetComponent } from './components/change-password-widget/change-password-widget.component';
|
|
19
|
-
import { BayanCoreGlobalSearchWidgetComponent } from './components/global-search-widget/global-search-widget.component';
|
|
20
|
-
import { BayanCoreItemWidgetComponent } from './components/item-widget/item-widget.component';
|
|
21
|
-
import { BayanCoreNotificationsWidgetComponent } from './components/notifications-widget/notifications-widget.component';
|
|
22
|
-
import { BayanCoreSettingsWidgetComponent } from './components/settings-widget/settings-widget.component';
|
|
23
|
-
import { BayanCoreUserPanelWidgetComponent } from './components/user-panel-widget/user-panel-widget.component';
|
|
24
|
-
|
|
25
|
-
@Component({
|
|
26
|
-
selector: 'bayan-core-top-menu-widget',
|
|
27
|
-
standalone: true,
|
|
28
|
-
imports: [
|
|
29
|
-
CommonModule,
|
|
30
|
-
DxToolbarModule,
|
|
31
|
-
FontAwesomeModule,
|
|
32
|
-
TranslatePipe,
|
|
33
|
-
BayanCoreItemWidgetComponent,
|
|
34
|
-
BayanCoreGlobalSearchWidgetComponent,
|
|
35
|
-
BayanCoreUserPanelWidgetComponent,
|
|
36
|
-
BayanCoreSettingsWidgetComponent,
|
|
37
|
-
BayanCoreNotificationsWidgetComponent,
|
|
38
|
-
],
|
|
39
|
-
templateUrl: './top-menu-widget.component.html',
|
|
40
|
-
styleUrls: ['./top-menu-widget.styles.css'],
|
|
41
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
42
|
-
})
|
|
43
|
-
export class BayanCoreTopMenuWidgetComponent implements OnInit {
|
|
44
|
-
globalSearchWidget?: BayanCoreGlobalSearchWidgetComponent;
|
|
45
|
-
private readonly document = inject(DOCUMENT);
|
|
46
|
-
private readonly router = inject(Router);
|
|
47
|
-
private readonly menuService = inject(BayanCoreTopMenuService);
|
|
48
|
-
|
|
49
|
-
openDropdownIndex: number|null = null;
|
|
50
|
-
|
|
51
|
-
@Input() baseUrl = '';
|
|
52
|
-
@Input() systemModule : SystemModule | null =null;
|
|
53
|
-
menuItems: TopMenuShortcut[] = [];
|
|
54
|
-
|
|
55
|
-
@Input() sidebarCollapsed = false;
|
|
56
|
-
@Input() homeUrl: string | null = null;
|
|
57
|
-
@Input() logoUrl = 'https://cdn-dev.skysoftware.cloud/bayan/images/logo-enterprise-dark.png';
|
|
58
|
-
@Input() collapsedLogoUrl = 'https://cdn-dev.skysoftware.cloud/bayan/images/logo-collapsed.png';
|
|
59
|
-
@Output() logoClick = new EventEmitter<void>();
|
|
60
|
-
|
|
61
|
-
@Input() isSsoLogin = false;
|
|
62
|
-
|
|
63
|
-
// Removed useInternalDialogs and all related logic
|
|
64
|
-
|
|
65
|
-
@Input() showGlobalSearch = true;
|
|
66
|
-
@Input() showUserPanel = true;
|
|
67
|
-
@Input() showSettings = true;
|
|
68
|
-
@Input() showShortcutMenus = true;
|
|
69
|
-
@Input() showNotifications = true;
|
|
70
|
-
@Input() notificationsTitle = 'Notifications';
|
|
71
|
-
|
|
72
|
-
@Input() showHelp = true;
|
|
73
|
-
@Input() helpTitle = 'Help';
|
|
74
|
-
@Input() helpUrl: string | null = 'https://docs.bayan.solutions/Bayan/index.html';
|
|
75
|
-
@Input() helpIcon: IconDefinition = faQuestionCircle;
|
|
76
|
-
@Input() helpAnchorClass = 'menu-icon-btn';
|
|
77
|
-
@Input() helpUrlTarget: '_self' | '_blank' | string = '_blank';
|
|
78
|
-
@Input() licenseUrl = '';
|
|
79
|
-
@Input() releaseNotesUrl = '';
|
|
80
|
-
@Input() supportUrl = 'https://skyits.com/contact';
|
|
81
|
-
|
|
82
|
-
@Output() helpClick = new EventEmitter<void>();
|
|
83
|
-
@Output() menuItemClick = new EventEmitter<TopMenuShortcut>();
|
|
84
|
-
@Output() searchSubmit = new EventEmitter<string>();
|
|
85
|
-
@Output() propertyChanged = new EventEmitter<PropertyOption>();
|
|
86
|
-
@Output() signOutClick = new EventEmitter<void>();
|
|
87
|
-
@Output() alternateNamesChange = new EventEmitter<boolean>();
|
|
88
|
-
@Output() employeeNameModeChange = new EventEmitter<EmployeeNamesModeOption>();
|
|
89
|
-
|
|
90
|
-
readonly aboutVisible = signal(false);
|
|
91
|
-
readonly changePasswordVisible = signal(false);
|
|
92
|
-
|
|
93
|
-
ActivePropertyChanged = false;
|
|
94
|
-
ActivePropertyId: number = 0;
|
|
95
|
-
|
|
96
|
-
ngOnInit(): void {
|
|
97
|
-
this.loadShortcutMenus();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
ngOnChanges(changes: any): void {
|
|
101
|
-
if (
|
|
102
|
-
(changes['baseUrl'] && !changes['baseUrl'].firstChange && changes['baseUrl'].previousValue !== changes['baseUrl'].currentValue) ||
|
|
103
|
-
(changes['ActivePropertyId'] && !changes['ActivePropertyId'].firstChange && changes['ActivePropertyId'].previousValue !== changes['ActivePropertyId'].currentValue) ||
|
|
104
|
-
(changes['systemModule'] && !changes['systemModule'].firstChange && changes['systemModule'].previousValue !== changes['systemModule'].currentValue)
|
|
105
|
-
) {
|
|
106
|
-
this.globalSearchWidget?.reset();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
onEmployeeNameModeChange(event: any): void {
|
|
111
|
-
this.employeeNameModeChange.emit(event);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
getLogoSrc(): string | null {
|
|
115
|
-
if (this.sidebarCollapsed) {
|
|
116
|
-
return this.collapsedLogoUrl || null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return this.logoUrl || null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
onLogoClicked(event?: Event): void {
|
|
123
|
-
event?.preventDefault();
|
|
124
|
-
if(this.homeUrl){
|
|
125
|
-
window.location.href = this.homeUrl;
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
this.logoClick.emit();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
onHelpClicked(event?: Event): void {
|
|
133
|
-
event?.preventDefault();
|
|
134
|
-
if(this.helpUrl){
|
|
135
|
-
window.open(this.helpUrl, this.helpUrlTarget);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
this.helpClick.emit();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
onPropertyChanged(property: PropertyOption): void {
|
|
142
|
-
this.ActivePropertyChanged = !this.ActivePropertyChanged;
|
|
143
|
-
this.ActivePropertyId = property.PropertyId;
|
|
144
|
-
this.loadShortcutMenus();
|
|
145
|
-
this.propertyChanged.emit(property);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private loadShortcutMenus(): void {
|
|
149
|
-
this.menuItems=[];
|
|
150
|
-
if(!this.showShortcutMenus) return;
|
|
151
|
-
if(!this.baseUrl) return;
|
|
152
|
-
if(!this.systemModule) return;
|
|
153
|
-
|
|
154
|
-
if (this.ActivePropertyId > 0) {
|
|
155
|
-
this.menuService.getMicroserviceTopMenusShortcut(this.baseUrl, this.ActivePropertyId, this.systemModule)
|
|
156
|
-
.subscribe({
|
|
157
|
-
next: (menus: any) => this.menuItems = menus ?? [],
|
|
158
|
-
error: () => this.menuItems = []
|
|
159
|
-
});
|
|
160
|
-
} else {
|
|
161
|
-
this.menuItems = [];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { SystemModule } from '../shared/menu.dtos';
|
|
2
|
-
|
|
3
|
-
export interface TopMenuWidgetAboutDialogConfig {
|
|
4
|
-
title?: string;
|
|
5
|
-
logoUrl?: string;
|
|
6
|
-
version?: string;
|
|
7
|
-
versionLabel?: string;
|
|
8
|
-
copyright?: string;
|
|
9
|
-
statusLabel?: string;
|
|
10
|
-
licenseButtonLabel?: string;
|
|
11
|
-
releaseNotesButtonLabel?: string;
|
|
12
|
-
supportButtonLabel?: string;
|
|
13
|
-
closeButtonLabel?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface TopMenuWidgetChangePasswordPayload {
|
|
17
|
-
currentPassword: string;
|
|
18
|
-
newPassword: string;
|
|
19
|
-
confirmNewPassword: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TopMenuWidgetChangePasswordDialogConfig {
|
|
23
|
-
title: string;
|
|
24
|
-
currentPasswordLabel: string;
|
|
25
|
-
newPasswordLabel: string;
|
|
26
|
-
confirmNewPasswordLabel: string;
|
|
27
|
-
primaryButtonText: string;
|
|
28
|
-
}
|
|
29
|
-
|