@elite.framework/ng.core 2.0.4 → 2.0.6

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,56 @@
1
+ import * as i0 from '@angular/core';
2
+ import { NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+
5
+ class UtilsModule {
6
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: UtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
7
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: UtilsModule, imports: [CommonModule] });
8
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: UtilsModule, imports: [CommonModule] });
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: UtilsModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ imports: [CommonModule],
14
+ }]
15
+ }] });
16
+
17
+ function isFunction(value) {
18
+ return typeof value === 'function';
19
+ }
20
+ function isPlainObject(value) {
21
+ if (Object.prototype.toString.call(value) !== '[object Object]') {
22
+ return false;
23
+ }
24
+ else {
25
+ const prototype = Object.getPrototypeOf(value);
26
+ return prototype === null || prototype === Object.prototype;
27
+ }
28
+ }
29
+ function isString(value) {
30
+ return !!value && typeof value === 'string';
31
+ }
32
+ function isBoolean(value) {
33
+ return typeof value === 'boolean';
34
+ }
35
+ function isPromise(promise) {
36
+ return Object.prototype.toString.call(promise) === '[object Promise]';
37
+ }
38
+ function notEmptyValue(value) {
39
+ if (Array.isArray(value)) {
40
+ return value.length > 0;
41
+ }
42
+ return !!value;
43
+ }
44
+ function transformStringToArray(value) {
45
+ if (isString(value)) {
46
+ return [value];
47
+ }
48
+ return value;
49
+ }
50
+
51
+ /**
52
+ * Generated bundle index. Do not edit.
53
+ */
54
+
55
+ export { UtilsModule, isBoolean, isFunction, isPlainObject, isPromise, isString, notEmptyValue, transformStringToArray };
56
+ //# sourceMappingURL=elite.framework-ng.core-utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elite.framework-ng.core-utils.mjs","sources":["../tmp-esm2022/utils/lib/utils-module.js","../tmp-esm2022/utils/lib/utils.js","../tmp-esm2022/utils/elite.framework-ng.core-utils.js"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport * as i0 from \"@angular/core\";\nexport class UtilsModule {\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: UtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\n static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"20.1.8\", ngImport: i0, type: UtilsModule, imports: [CommonModule] });\n static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: UtilsModule, imports: [CommonModule] });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: UtilsModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMtbW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9uZy5jb3JlL3V0aWxzL3NyYy9saWIvdXRpbHMtbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDOztBQUsvQyxNQUFNLE9BQU8sV0FBVzt1R0FBWCxXQUFXO3dHQUFYLFdBQVcsWUFGWixZQUFZO3dHQUVYLFdBQVcsWUFGWixZQUFZOzsyRkFFWCxXQUFXO2tCQUh2QixRQUFRO21CQUFDO29CQUNSLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQztpQkFDeEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuQE5nTW9kdWxlKHtcbiAgaW1wb3J0czogW0NvbW1vbk1vZHVsZV0sXG59KVxuZXhwb3J0IGNsYXNzIFV0aWxzTW9kdWxlIHt9XG4iXX0=","export function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isPlainObject(value) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n else {\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n }\n}\nexport function isString(value) {\n return !!value && typeof value === 'string';\n}\nexport function isBoolean(value) {\n return typeof value === 'boolean';\n}\nexport function isPromise(promise) {\n return Object.prototype.toString.call(promise) === '[object Promise]';\n}\nexport function notEmptyValue(value) {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return !!value;\n}\nexport function transformStringToArray(value) {\n if (isString(value)) {\n return [value];\n }\n return value;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL25nLmNvcmUvdXRpbHMvc3JjL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsVUFBVSxDQUFJLEtBQVU7SUFDcEMsT0FBTyxPQUFPLEtBQUssS0FBSyxVQUFVLENBQUM7QUFDdkMsQ0FB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HBvcnQgZnVuY3Rpb24gaXNQcm9taXNlKHByb21pc2U6IGFueSkge1xyXG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChwcm9taXNlKSA9PT0gJ1tvYmplY3QgUHJvbWlzZV0nO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gbm90RW1wdHlWYWx1ZSh2YWx1ZTogc3RyaW5nIHwgc3RyaW5nW10pOiBib29sZWFuIHtcclxuICAgIGlmIChBcnJheS5pc0FycmF5KHZhbHVlKSkge1xyXG4gICAgICAgIHJldHVybiB2YWx1ZS5sZW5ndGggPiAwO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuICEhdmFsdWU7XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiB0cmFuc2Zvcm1TdHJpbmdUb0FycmF5KHZhbHVlOiBzdHJpbmcgfCBzdHJpbmdbXSk6IHN0cmluZ1tdIHtcclxuICAgIGlmIChpc1N0cmluZyh2YWx1ZSkpIHtcclxuICAgICAgICByZXR1cm4gW3ZhbHVlXTtcclxuICAgIH1cclxuICAgIHJldHVybiB2YWx1ZTtcclxufVxyXG4iXX0=","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxpdGUuZnJhbWV3b3JrLW5nLmNvcmUtdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL25nLmNvcmUvdXRpbHMvc3JjL2VsaXRlLmZyYW1ld29yay1uZy5jb3JlLXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9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C,KAAK,CAAC,KAAK,iBAAiB,EAAE;AACrE,QAAQ,OAAO,KAAK;AACpB;AACA,SAAS;AACT,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC;AACtD,QAAQ,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS;AACnE;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;AAC/C;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,OAAO,OAAO,KAAK,KAAK,SAAS;AACrC;AACO,SAAS,SAAS,CAAC,OAAO,EAAE;AACnC,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB;AACzE;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAQ,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;AAC/B;AACA,IAAI,OAAO,CAAC,CAAC,KAAK;AAClB;AACO,SAAS,sBAAsB,CAAC,KAAK,EAAE;AAC9C,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;AACzB,QAAQ,OAAO,CAAC,KAAK,CAAC;AACtB;AACA,IAAI,OAAO,KAAK;AAChB;;AChCA;AACA;AACA;;;;"}
package/models/index.d.ts CHANGED
@@ -1,11 +1,16 @@
1
+ import { MenuItem } from 'primeng/api';
1
2
  import { HttpParameterCodec, HttpParams, HttpHeaders } from '@angular/common/http';
3
+ import { ActivatedRouteSnapshot, Route, RouterStateSnapshot, NavigationExtras } from '@angular/router';
2
4
 
3
5
  interface ActionDef<T> {
4
6
  name: string;
5
7
  icon?: string;
6
8
  label?: string;
7
9
  styleClass?: string;
10
+ order?: number;
11
+ permissions?: string[];
8
12
  action?: (item: T) => void | Promise<void>;
13
+ visible?: boolean;
9
14
  }
10
15
 
11
16
  declare class AttachmentDto {
@@ -26,8 +31,11 @@ interface ButtonConfig {
26
31
  variant: 'text' | 'outlined' | 'raised' | 'rounded';
27
32
  severity: 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'help' | 'contrast';
28
33
  size: 'small' | 'normal' | 'large';
29
- actionName?: string;
30
34
  permission?: string;
35
+ visible?: boolean;
36
+ splitActions?: MenuItem[];
37
+ actionName?: string;
38
+ action?: (item: any) => void | Promise<void>;
31
39
  }
32
40
 
33
41
  interface ColumnDef<T> {
@@ -131,5 +139,30 @@ declare namespace Rest {
131
139
  }
132
140
  }
133
141
 
134
- export { AttachmentDto, GeneralResponse, ListResultDto, PagedResultDto, Rest, checkHasProp };
135
- export type { ActionDef, ButtonConfig, ColumnDef, FilterDef, FilterType, PaginatedResult, Root };
142
+ interface NgxPermissionsRouterData {
143
+ only?: string | string[] | OnlyFn | any;
144
+ except?: string | string[] | ExceptFn | any;
145
+ redirectTo?: RedirectTo | RedirectToFn;
146
+ }
147
+ interface NgxRedirectToNavigationParameters {
148
+ navigationCommands: any[] | NavigationCommandsFn;
149
+ navigationExtras?: NavigationExtras | NavigationExtrasFn;
150
+ }
151
+ declare type OnlyFn = (route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot) => string | string[];
152
+ declare type ExceptFn = (route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot) => string | string[];
153
+ declare type RedirectTo = string | {
154
+ [name: string]: NgxRedirectToNavigationParameters | string | RedirectToFn;
155
+ } | NgxRedirectToNavigationParameters;
156
+ declare type RedirectToFn = (rejectedPermissionName?: string, route?: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot) => RedirectTo;
157
+ declare type NavigationCommandsFn = (route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot) => any[];
158
+ declare type NavigationExtrasFn = (route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot) => NavigationExtras;
159
+ declare type ValidationFn = ((name?: string, store?: any) => Promise<void | string | boolean> | boolean | string[]);
160
+ declare const DEFAULT_REDIRECT_KEY = "default";
161
+
162
+ interface NgxPermission {
163
+ name: string;
164
+ validationFunction?: ValidationFn;
165
+ }
166
+
167
+ export { AttachmentDto, DEFAULT_REDIRECT_KEY, GeneralResponse, ListResultDto, PagedResultDto, Rest, checkHasProp };
168
+ export type { ActionDef, ButtonConfig, ColumnDef, ExceptFn, FilterDef, FilterType, NavigationCommandsFn, NavigationExtrasFn, NgxPermission, NgxPermissionsRouterData, NgxRedirectToNavigationParameters, OnlyFn, PaginatedResult, RedirectTo, RedirectToFn, Root, ValidationFn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elite.framework/ng.core",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.0",
6
6
  "@angular/core": "^20.1.0"
@@ -43,6 +43,10 @@
43
43
  "./tokens": {
44
44
  "types": "./tokens/index.d.ts",
45
45
  "default": "./fesm2022/elite.framework-ng.core-tokens.mjs"
46
+ },
47
+ "./utils": {
48
+ "types": "./utils/index.d.ts",
49
+ "default": "./fesm2022/elite.framework-ng.core-utils.mjs"
46
50
  }
47
51
  },
48
52
  "dependencies": {
package/pipes/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { PipeTransform } from '@angular/core';
3
3
  import { DatePipe } from '@angular/common';
4
+ import { PermissionsService } from '@elite.framework/ng.core/services';
4
5
 
5
6
  declare class TafqeetPipe implements PipeTransform {
6
7
  transform(value: number, currencyName?: string): string;
@@ -17,4 +18,12 @@ declare class TimeAgoWithFullDatePipe implements PipeTransform {
17
18
  static ɵpipe: i0.ɵɵPipeDeclaration<TimeAgoWithFullDatePipe, "timeAgoWithFullDate", true>;
18
19
  }
19
20
 
20
- export { TafqeetPipe, TimeAgoWithFullDatePipe };
21
+ declare class PermissionPipe implements PipeTransform {
22
+ private permissionChecker;
23
+ constructor(permissionChecker: PermissionsService);
24
+ transform(permission: string): boolean;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<PermissionPipe, never>;
26
+ static ɵpipe: i0.ɵɵPipeDeclaration<PermissionPipe, "permission", true>;
27
+ }
28
+
29
+ export { PermissionPipe, TafqeetPipe, TimeAgoWithFullDatePipe };
@@ -1,13 +1,14 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable } from 'rxjs';
3
3
  import { HttpClient, HttpRequest } from '@angular/common/http';
4
- import { Root, Rest, PaginatedResult } from '@elite.framework/ng.core/models';
4
+ import { Root, Rest, PaginatedResult, RedirectTo, RedirectToFn } from '@elite.framework/ng.core/models';
5
5
  import * as i0 from '@angular/core';
6
6
  import { InjectionToken } from '@angular/core';
7
7
  import * as qs from 'qs';
8
8
  import * as express_serve_static_core from 'express-serve-static-core';
9
9
  import { Request } from 'express';
10
10
  import { SweetAlertResult, SweetAlertOptions, SweetAlertIcon } from 'sweetalert2';
11
+ import { CanActivateFn, CanActivateChildFn, CanMatchFn, Router, ActivatedRouteSnapshot, RouterStateSnapshot, Route } from '@angular/router';
11
12
 
12
13
  declare class RestService {
13
14
  protected options: Root;
@@ -246,5 +247,35 @@ declare class SwalService {
246
247
  static ɵprov: i0.ɵɵInjectableDeclaration<SwalService>;
247
248
  }
248
249
 
249
- export { BaseService, GenericService, REQUEST, RestService, SsrCookieService, SwalService, isUndefinedOrEmptyString };
250
- export type { CrudService };
250
+ declare class PermissionsService {
251
+ private _permissions$;
252
+ setPermissions(permissions: string[]): void;
253
+ getPermissions(): string[];
254
+ isGranted(permissionName: string): boolean;
255
+ isGrantedAsync(permissionName: string): Promise<boolean>;
256
+ static ɵfac: i0.ɵɵFactoryDeclaration<PermissionsService, never>;
257
+ static ɵprov: i0.ɵɵInjectableDeclaration<PermissionsService>;
258
+ }
259
+
260
+ interface NgxPermissionsData {
261
+ only?: string | string[];
262
+ except?: string | string[];
263
+ redirectTo?: RedirectTo | RedirectToFn | any;
264
+ }
265
+ declare const ngxPermissionsGuard: CanActivateFn | CanActivateChildFn | CanMatchFn;
266
+ declare class NgxPermissionsGuard {
267
+ private permissions;
268
+ private router;
269
+ constructor(permissions: PermissionsService, router: Router);
270
+ canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
271
+ canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
272
+ canLoad(route: Route): Promise<boolean>;
273
+ canMatch(route: Route): Promise<boolean>;
274
+ hasPermissions(route: ActivatedRouteSnapshot | Route, state?: RouterStateSnapshot): Promise<boolean>;
275
+ private handleRedirect;
276
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxPermissionsGuard, never>;
277
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxPermissionsGuard>;
278
+ }
279
+
280
+ export { BaseService, GenericService, NgxPermissionsGuard, PermissionsService, REQUEST, RestService, SsrCookieService, SwalService, isUndefinedOrEmptyString, ngxPermissionsGuard };
281
+ export type { CrudService, NgxPermissionsData };
@@ -0,0 +1,3 @@
1
+ # @elite.framework/ng.core/utils
2
+
3
+ Secondary entry point of `@elite.framework/ng.core`. It can be used by importing from `@elite.framework/ng.core/utils`.
@@ -0,0 +1,18 @@
1
+ import * as i0 from '@angular/core';
2
+ import * as i1 from '@angular/common';
3
+
4
+ declare class UtilsModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<UtilsModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UtilsModule, never, [typeof i1.CommonModule], never>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<UtilsModule>;
8
+ }
9
+
10
+ declare function isFunction<T>(value: any): value is T;
11
+ declare function isPlainObject(value: any): boolean;
12
+ declare function isString(value: any): value is string;
13
+ declare function isBoolean(value: any): value is boolean;
14
+ declare function isPromise(promise: any): boolean;
15
+ declare function notEmptyValue(value: string | string[]): boolean;
16
+ declare function transformStringToArray(value: string | string[]): string[];
17
+
18
+ export { UtilsModule, isBoolean, isFunction, isPlainObject, isPromise, isString, notEmptyValue, transformStringToArray };