@elite.framework/ng.core 2.0.29 → 2.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/models/index.d.ts CHANGED
@@ -300,7 +300,6 @@ interface NavigationMenuItem {
300
300
  displayName: string | null;
301
301
  order: number;
302
302
  icon: string | null;
303
- key: string;
304
303
  url: string;
305
304
  target: string | null;
306
305
  permission: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elite.framework/ng.core",
3
- "version": "2.0.29",
3
+ "version": "2.0.31",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.0",
6
6
  "@angular/core": "^20.1.0"
@@ -2,13 +2,12 @@ import * as rxjs from 'rxjs';
2
2
  import { Observable, Subscription, PartialObserver, BehaviorSubject } from 'rxjs';
3
3
  import { HttpClient, HttpRequest, HttpErrorResponse } from '@angular/common/http';
4
4
  import * as _elite_framework_ng_core_models from '@elite.framework/ng.core/models';
5
- import { Root, Rest, PaginatedResult, ApplicationLocalizationRequestDto, ApplicationLocalizationDto, ApplicationConfigurationRequestOptions, ApplicationConfigurationDto, Navigation, ApplicationGlobalFeatureConfigurationDto, RedirectTo, RedirectToFn, CurrentTenantDto, Session, Localization, LocalizationWithDefault, ApplicationLocalizationResourceDto, Nav, Route as Route$1, Environment, TenantLoginInfoDto, NavItem, SortableItem, UserMenu, ReplaceableComponents } from '@elite.framework/ng.core/models';
5
+ import { Root, Rest, PaginatedResult, ApplicationLocalizationRequestDto, ApplicationLocalizationDto, ApplicationConfigurationRequestOptions, ApplicationConfigurationDto, Navigation, ApplicationGlobalFeatureConfigurationDto, CurrentTenantDto, Session, Localization, LocalizationWithDefault, ApplicationLocalizationResourceDto, RedirectTo, RedirectToFn, Nav, Route as Route$1, Environment, TenantLoginInfoDto, NavItem, SortableItem, UserMenu, ReplaceableComponents } from '@elite.framework/ng.core/models';
6
6
  import * as i0 from '@angular/core';
7
7
  import { InjectionToken, Injector, OnDestroy, Type, NgZone } from '@angular/core';
8
8
  import * as qs from 'qs';
9
9
  import * as express_serve_static_core from 'express-serve-static-core';
10
10
  import { Request } from 'express';
11
- import { TranslateService } from '@ngx-translate/core';
12
11
  import { SweetAlertResult, SweetAlertOptions, SweetAlertIcon } from 'sweetalert2';
13
12
  import { CanActivateFn, CanActivateChildFn, CanMatchFn, Router, ActivatedRouteSnapshot, RouterStateSnapshot, Route, TitleStrategy, RouterEvent, Event, NavigationCancel, NavigationEnd, NavigationError, NavigationStart } from '@angular/router';
14
13
  import { Title } from '@angular/platform-browser';
@@ -236,27 +235,6 @@ declare class SsrCookieService {
236
235
  static ɵprov: i0.ɵɵInjectableDeclaration<SsrCookieService>;
237
236
  }
238
237
 
239
- declare class SwalService {
240
- private translate;
241
- private defaultClass;
242
- constructor(translate: TranslateService);
243
- private t;
244
- /** رسالة تأكيد */
245
- confirm(title?: string, text?: string, confirmButtonText?: string, cancelButtonText?: string): Promise<SweetAlertResult>;
246
- /** رسالة نجاح */
247
- success(title: string, text?: string, timer?: number): Promise<SweetAlertResult>;
248
- /** رسالة خطأ */
249
- error(title: string, text?: string, footer?: string): Promise<SweetAlertResult>;
250
- /** رسالة معلومات */
251
- info(title: string, text?: string): Promise<SweetAlertResult>;
252
- /** أي خيارات مخصصة */
253
- alert(options: SweetAlertOptions): Promise<SweetAlertResult>;
254
- /** Toast */
255
- toast(title: string, icon?: SweetAlertIcon, position?: SweetAlertOptions['position'], timer?: number): void;
256
- static ɵfac: i0.ɵɵFactoryDeclaration<SwalService, never>;
257
- static ɵprov: i0.ɵɵInjectableDeclaration<SwalService>;
258
- }
259
-
260
238
  declare class ApplicationLocalizationService {
261
239
  private restService;
262
240
  apiName: string;
@@ -802,150 +780,6 @@ declare class ConfigStateService {
802
780
  static ɵprov: i0.ɵɵInjectableDeclaration<ConfigStateService>;
803
781
  }
804
782
 
805
- declare class PermissionCheckerService {
806
- protected configState: ConfigStateService;
807
- constructor(configState: ConfigStateService);
808
- protected isPolicyGranted(key: string | undefined, grantedPolicies: Record<string, boolean>): boolean;
809
- getGrantedPolicy$(key: string): rxjs.Observable<boolean>;
810
- isGrantedAsync(permissionName: string | any): true | rxjs.Observable<boolean>;
811
- isGranted(permissionName: string | any): boolean;
812
- getGrantedPolicy(key: string | undefined): boolean;
813
- protected getStream(): rxjs.Observable<Record<string, boolean>>;
814
- protected getSnapshot(): Record<string, boolean>;
815
- protected mapToPolicies(applicationConfiguration: ApplicationConfigurationDto): Record<string, boolean>;
816
- protected getPolicy(key: string, grantedPolicies: Record<string, boolean>): boolean;
817
- static ɵfac: i0.ɵɵFactoryDeclaration<PermissionCheckerService, never>;
818
- static ɵprov: i0.ɵɵInjectableDeclaration<PermissionCheckerService>;
819
- }
820
-
821
- interface NgxPermissionsData {
822
- only?: string | string[];
823
- except?: string | string[];
824
- redirectTo?: RedirectTo | RedirectToFn | any;
825
- }
826
- declare const ngxPermissionsGuard: CanActivateFn | CanActivateChildFn | CanMatchFn;
827
- declare class NgxPermissionsGuard {
828
- private permissions;
829
- private router;
830
- constructor(permissions: PermissionCheckerService, router: Router);
831
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
832
- canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
833
- canLoad(route: Route): Promise<boolean>;
834
- canMatch(route: Route): Promise<boolean>;
835
- hasPermissions(route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot): Promise<boolean>;
836
- private handleRedirect;
837
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxPermissionsGuard, never>;
838
- static ɵprov: i0.ɵɵInjectableDeclaration<NgxPermissionsGuard>;
839
- }
840
-
841
- declare enum LogLevel {
842
- DEBUG = 0,
843
- INFO = 1,
844
- WARN = 2,
845
- ERROR = 3,
846
- OFF = 4
847
- }
848
- interface ILoggerService {
849
- debug(message: string, ...args: any[]): void;
850
- info(message: string, ...args: any[]): void;
851
- warn(message: string, ...args: any[]): void;
852
- error(message: string, ...args: any[]): void;
853
- setLogLevel(level: LogLevel): void;
854
- }
855
-
856
- declare class LoggerService implements ILoggerService {
857
- private level;
858
- private enableConsole;
859
- private prefix;
860
- private timestamp;
861
- private environmentService;
862
- private environment;
863
- constructor();
864
- private configureFromEnvironment;
865
- private mapLogLevel;
866
- debug(message: string, ...args: any[]): void;
867
- info(message: string, ...args: any[]): void;
868
- warn(message: string, ...args: any[]): void;
869
- error(message: string, ...args: any[]): void;
870
- setLogLevel(level: LogLevel): void;
871
- private shouldLog;
872
- private log;
873
- private sendToExternalService;
874
- static ɵfac: i0.ɵɵFactoryDeclaration<LoggerService, never>;
875
- static ɵprov: i0.ɵɵInjectableDeclaration<LoggerService>;
876
- }
877
-
878
- declare class IdParserService {
879
- /**
880
- * Extract IDs from a model based on comma-separated field names.
881
- * Example: "id,biId" => [model.id, model.biId]
882
- */
883
- parseIds(model: any, idField: string): string | (string | number)[] | any;
884
- static ɵfac: i0.ɵɵFactoryDeclaration<IdParserService, never>;
885
- static ɵprov: i0.ɵɵInjectableDeclaration<IdParserService>;
886
- }
887
-
888
- interface FilterCondition {
889
- field: string;
890
- operator: string;
891
- value: any;
892
- }
893
- interface FilterGroup {
894
- logicalOperator: 'and' | 'or';
895
- groupLogicalOperator?: 'and' | 'or';
896
- conditions: FilterCondition[];
897
- }
898
- interface GroupingConfig {
899
- propertyName: string;
900
- displayName?: string;
901
- showTotal?: boolean;
902
- totalBackground?: string;
903
- groupHeaderBackground?: string;
904
- order?: number;
905
- }
906
- interface SelectConfig {
907
- propertyName: string;
908
- displayName?: string;
909
- aggregateFunction?: string;
910
- isVisible?: boolean;
911
- order?: number;
912
- }
913
- interface AggregateConfig {
914
- propertyName: string;
915
- aggregateFunction: string;
916
- alias?: string;
917
- }
918
- interface QueryParameters {
919
- filters: FilterGroup[];
920
- orderBy?: {
921
- field: string;
922
- direction: 'asc' | 'desc';
923
- }[];
924
- groupBy?: GroupingConfig[];
925
- select?: SelectConfig[];
926
- aggregates?: AggregateConfig[];
927
- top?: number;
928
- skip?: number;
929
- expand?: string[];
930
- includeCount?: boolean;
931
- }
932
- declare class QueryParser {
933
- static parse(queryString: string): QueryParameters;
934
- static toString(params: QueryParameters): string;
935
- private static buildFilterString;
936
- private static buildGroupByString;
937
- private static buildSelectString;
938
- private static buildAggregateString;
939
- private static parseFilter;
940
- private static parseConditions;
941
- private static parseOrderBy;
942
- private static parseGroupBy;
943
- private static parseSelect;
944
- private static parseAggregate;
945
- static toODataQueryParameters(params: QueryParameters): any;
946
- static fromUIModel(model: any): QueryParameters;
947
- }
948
-
949
783
  declare class SessionStateService {
950
784
  private configState;
951
785
  private localStorageService;
@@ -1159,6 +993,7 @@ declare class LocalizationService {
1159
993
  /**
1160
994
  * Returns localized text with the given interpolation parameters in current language.
1161
995
  * @param key Localization key to replace with localized text
996
+ // const translateService = inject(TranslateService);// from '@ngx-translate/core'; // use it for fallback
1162
997
  * @param interpolateParams Values to intepolate.
1163
998
  */
1164
999
  instant(key: string | LocalizationWithDefault, ...interpolateParams: string[]): string;
@@ -1175,6 +1010,171 @@ declare class LocalizationService {
1175
1010
  type LegacyLanguageDto = Record<string, Record<string, string>>;
1176
1011
  type ResourceDto = Record<string, ApplicationLocalizationResourceDto>;
1177
1012
 
1013
+ declare class SwalService {
1014
+ private translate;
1015
+ private defaultClass;
1016
+ constructor(translate: LocalizationService);
1017
+ private t;
1018
+ /** رسالة تأكيد */
1019
+ confirm(title?: string, text?: string, confirmButtonText?: string, cancelButtonText?: string): Promise<SweetAlertResult>;
1020
+ /** رسالة نجاح */
1021
+ success(title: string, text?: string, timer?: number): Promise<SweetAlertResult>;
1022
+ /** رسالة خطأ */
1023
+ error(title: string, text?: string, footer?: string): Promise<SweetAlertResult>;
1024
+ /** رسالة معلومات */
1025
+ info(title: string, text?: string): Promise<SweetAlertResult>;
1026
+ /** أي خيارات مخصصة */
1027
+ alert(options: SweetAlertOptions): Promise<SweetAlertResult>;
1028
+ /** Toast */
1029
+ toast(title: string, icon?: SweetAlertIcon, position?: SweetAlertOptions['position'], timer?: number): void;
1030
+ static ɵfac: i0.ɵɵFactoryDeclaration<SwalService, never>;
1031
+ static ɵprov: i0.ɵɵInjectableDeclaration<SwalService>;
1032
+ }
1033
+
1034
+ declare class PermissionCheckerService {
1035
+ protected configState: ConfigStateService;
1036
+ constructor(configState: ConfigStateService);
1037
+ protected isPolicyGranted(key: string | undefined, grantedPolicies: Record<string, boolean>): boolean;
1038
+ getGrantedPolicy$(key: string): rxjs.Observable<boolean>;
1039
+ isGrantedAsync(permissionName: string | any): true | rxjs.Observable<boolean>;
1040
+ isGranted(permissionName: string | any): boolean;
1041
+ getGrantedPolicy(key: string | undefined): boolean;
1042
+ protected getStream(): rxjs.Observable<Record<string, boolean>>;
1043
+ protected getSnapshot(): Record<string, boolean>;
1044
+ protected mapToPolicies(applicationConfiguration: ApplicationConfigurationDto): Record<string, boolean>;
1045
+ protected getPolicy(key: string, grantedPolicies: Record<string, boolean>): boolean;
1046
+ static ɵfac: i0.ɵɵFactoryDeclaration<PermissionCheckerService, never>;
1047
+ static ɵprov: i0.ɵɵInjectableDeclaration<PermissionCheckerService>;
1048
+ }
1049
+
1050
+ interface NgxPermissionsData {
1051
+ only?: string | string[];
1052
+ except?: string | string[];
1053
+ redirectTo?: RedirectTo | RedirectToFn | any;
1054
+ }
1055
+ declare const ngxPermissionsGuard: CanActivateFn | CanActivateChildFn | CanMatchFn;
1056
+ declare class NgxPermissionsGuard {
1057
+ private permissions;
1058
+ private router;
1059
+ constructor(permissions: PermissionCheckerService, router: Router);
1060
+ canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
1061
+ canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
1062
+ canLoad(route: Route): Promise<boolean>;
1063
+ canMatch(route: Route): Promise<boolean>;
1064
+ hasPermissions(route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot): Promise<boolean>;
1065
+ private handleRedirect;
1066
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxPermissionsGuard, never>;
1067
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxPermissionsGuard>;
1068
+ }
1069
+
1070
+ declare enum LogLevel {
1071
+ DEBUG = 0,
1072
+ INFO = 1,
1073
+ WARN = 2,
1074
+ ERROR = 3,
1075
+ OFF = 4
1076
+ }
1077
+ interface ILoggerService {
1078
+ debug(message: string, ...args: any[]): void;
1079
+ info(message: string, ...args: any[]): void;
1080
+ warn(message: string, ...args: any[]): void;
1081
+ error(message: string, ...args: any[]): void;
1082
+ setLogLevel(level: LogLevel): void;
1083
+ }
1084
+
1085
+ declare class LoggerService implements ILoggerService {
1086
+ private level;
1087
+ private enableConsole;
1088
+ private prefix;
1089
+ private timestamp;
1090
+ private environmentService;
1091
+ private environment;
1092
+ constructor();
1093
+ private configureFromEnvironment;
1094
+ private mapLogLevel;
1095
+ debug(message: string, ...args: any[]): void;
1096
+ info(message: string, ...args: any[]): void;
1097
+ warn(message: string, ...args: any[]): void;
1098
+ error(message: string, ...args: any[]): void;
1099
+ setLogLevel(level: LogLevel): void;
1100
+ private shouldLog;
1101
+ private log;
1102
+ private sendToExternalService;
1103
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoggerService, never>;
1104
+ static ɵprov: i0.ɵɵInjectableDeclaration<LoggerService>;
1105
+ }
1106
+
1107
+ declare class IdParserService {
1108
+ /**
1109
+ * Extract IDs from a model based on comma-separated field names.
1110
+ * Example: "id,biId" => [model.id, model.biId]
1111
+ */
1112
+ parseIds(model: any, idField: string): string | (string | number)[] | any;
1113
+ static ɵfac: i0.ɵɵFactoryDeclaration<IdParserService, never>;
1114
+ static ɵprov: i0.ɵɵInjectableDeclaration<IdParserService>;
1115
+ }
1116
+
1117
+ interface FilterCondition {
1118
+ field: string;
1119
+ operator: string;
1120
+ value: any;
1121
+ }
1122
+ interface FilterGroup {
1123
+ logicalOperator: 'and' | 'or';
1124
+ groupLogicalOperator?: 'and' | 'or';
1125
+ conditions: FilterCondition[];
1126
+ }
1127
+ interface GroupingConfig {
1128
+ propertyName: string;
1129
+ displayName?: string;
1130
+ showTotal?: boolean;
1131
+ totalBackground?: string;
1132
+ groupHeaderBackground?: string;
1133
+ order?: number;
1134
+ }
1135
+ interface SelectConfig {
1136
+ propertyName: string;
1137
+ displayName?: string;
1138
+ aggregateFunction?: string;
1139
+ isVisible?: boolean;
1140
+ order?: number;
1141
+ }
1142
+ interface AggregateConfig {
1143
+ propertyName: string;
1144
+ aggregateFunction: string;
1145
+ alias?: string;
1146
+ }
1147
+ interface QueryParameters {
1148
+ filters: FilterGroup[];
1149
+ orderBy?: {
1150
+ field: string;
1151
+ direction: 'asc' | 'desc';
1152
+ }[];
1153
+ groupBy?: GroupingConfig[];
1154
+ select?: SelectConfig[];
1155
+ aggregates?: AggregateConfig[];
1156
+ top?: number;
1157
+ skip?: number;
1158
+ expand?: string[];
1159
+ includeCount?: boolean;
1160
+ }
1161
+ declare class QueryParser {
1162
+ static parse(queryString: string): QueryParameters;
1163
+ static toString(params: QueryParameters): string;
1164
+ private static buildFilterString;
1165
+ private static buildGroupByString;
1166
+ private static buildSelectString;
1167
+ private static buildAggregateString;
1168
+ private static parseFilter;
1169
+ private static parseConditions;
1170
+ private static parseOrderBy;
1171
+ private static parseGroupBy;
1172
+ private static parseSelect;
1173
+ private static parseAggregate;
1174
+ static toODataQueryParameters(params: QueryParameters): any;
1175
+ static fromUIModel(model: any): QueryParameters;
1176
+ }
1177
+
1178
1178
  declare class LocalStorageListenerService {
1179
1179
  protected readonly window: (Window & typeof globalThis) | null;
1180
1180
  constructor();
@@ -1246,8 +1246,6 @@ declare abstract class AbstractNavTreeService<T extends Nav> extends AbstractTre
1246
1246
  readonly hide: (item: T) => boolean;
1247
1247
  readonly sort: (a: T, b: T) => number;
1248
1248
  constructor(injector: Injector);
1249
- private convertNavigationToRoutes;
1250
- private extractPathFromUrl;
1251
1249
  protected isGranted({ requiredPolicy }: T): boolean;
1252
1250
  hasChildren(identifier: string): boolean;
1253
1251
  hasInvisibleChild(identifier: string): boolean;
@@ -1256,6 +1254,12 @@ declare abstract class AbstractNavTreeService<T extends Nav> extends AbstractTre
1256
1254
  static ɵprov: i0.ɵɵInjectableDeclaration<AbstractNavTreeService<any>>;
1257
1255
  }
1258
1256
  declare class RoutesService extends AbstractNavTreeService<Route$1> {
1257
+ /**
1258
+ *
1259
+ */
1260
+ constructor(injector: Injector);
1261
+ private convertNavigationToRoutes;
1262
+ private extractPathFromUrl;
1259
1263
  private hasPathOrChild;
1260
1264
  get groupedVisible(): RouteGroup<Route$1>[] | undefined;
1261
1265
  get groupedVisible$(): Observable<RouteGroup<Route$1>[] | undefined>;
@@ -1553,7 +1557,7 @@ declare class WindowService {
1553
1557
  }
1554
1558
 
1555
1559
  declare const SORT_COMPARE_FUNC: InjectionToken<(a: SortableItem, b: SortableItem) => number>;
1556
- declare function compareFuncFactory(): (a: SortableItem | any, b: SortableItem | any) => 0 | 1 | -1;
1560
+ declare function compareFuncFactory(): (a: SortableItem | any, b: SortableItem | any) => 1 | -1 | 0;
1557
1561
 
1558
1562
  declare function getRemoteEnv(injector: Injector, environment: Partial<Environment>): Promise<void> | Promise<Environment | null | undefined>;
1559
1563