@mediusinc/mng-commons 6.0.0-rc.6 → 6.0.0-rc.8

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.
Files changed (27) hide show
  1. package/README.md +6 -6
  2. package/core/data-list/data-list-params-helpers.d.ts +1 -0
  3. package/core/directives/component.directive.d.ts +11 -13
  4. package/core/directives/rerender.directive.d.ts +1 -1
  5. package/core/directives/template.directive.d.ts +3 -7
  6. package/core/i18n/i18n-common.d.ts +2 -2
  7. package/core/security/permission.service.d.ts +3 -3
  8. package/core/security/permissions.model.d.ts +5 -3
  9. package/fesm2022/mediusinc-mng-commons-core.mjs +109 -130
  10. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  11. package/fesm2022/mediusinc-mng-commons-form.mjs +10 -11
  12. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  13. package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-DTSBP9WQ.mjs → mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs} +5 -6
  14. package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs.map +1 -0
  15. package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-JZpyiDIL.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-C2vrMoNL.mjs} +33 -21
  16. package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-C2vrMoNL.mjs.map +1 -0
  17. package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
  18. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  19. package/fesm2022/mediusinc-mng-commons-tableview.mjs +39 -36
  20. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  21. package/package.json +11 -11
  22. package/table/provide.d.ts +7 -0
  23. package/tableview/api/action/descriptors/action.descriptor.d.ts +3 -3
  24. package/tableview/api/action/models/action-confirmation.model.d.ts +4 -2
  25. package/version-info.json +6 -6
  26. package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-DTSBP9WQ.mjs.map +0 -1
  27. package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-JZpyiDIL.mjs.map +0 -1
package/README.md CHANGED
@@ -50,7 +50,7 @@ export function i18nHttpLoaderFactory(http: HttpBackend ) {
50
50
  - Konfiguracija v `main.ts` (v primeru uporabe modulov: `AppModule`):
51
51
 
52
52
  ```ts
53
- TranslateModule.forRoot({
53
+ provideTranslateService({
54
54
  loader: {
55
55
  provide: TranslateLoader,
56
56
  useFactory: i18nHttpLoaderFactory,
@@ -59,12 +59,12 @@ TranslateModule.forRoot({
59
59
  })
60
60
  ```
61
61
 
62
- - Definicijo jezikov podamo preko konfiguracije `MngCommonsModule`:
62
+ - Definicijo jezikov podamo preko konfiguracije `provideCommons()`:
63
63
  ```ts
64
- MngCommonsModule.forRoot({
65
- app: {
66
- languages: ['en', 'sl']
67
- }
64
+ provideCommons({
65
+ app: {
66
+ locales: ['en', 'sl']
67
+ }
68
68
  })
69
69
  ```
70
70
 
@@ -21,6 +21,7 @@ export declare function fromTableLoadToDataListParams(event: TableLazyLoadEvent)
21
21
  */
22
22
  export declare function dataListParamsToUrlQuery(params: DataListParams<any, any>, defaults?: DataListParams<any, any> | null, opts?: {
23
23
  prependFilterName?: string;
24
+ skipPresetDefaultsLimit?: boolean;
24
25
  }): Params;
25
26
  /**
26
27
  * Merges the provided parameters with default values and returns the merged object.
@@ -1,20 +1,18 @@
1
- import { ComponentRef, InjectionToken, Injector, OnInit, Type } from '@angular/core';
1
+ import { ComponentRef, InjectionToken, Injector, Type } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class ComponentDirective<C> implements OnInit {
3
+ export declare class ComponentDirective<C> {
4
4
  private readonly injector;
5
5
  private readonly elementRef;
6
6
  private readonly applicationRef;
7
7
  private readonly viewContainerRef;
8
- component?: Type<C>;
9
- componentIt?: InjectionToken<Type<C>>;
10
- inputs?: {
11
- [key: string]: any;
12
- };
13
- attachToHost: boolean;
14
- parentInjector?: Injector;
15
- private componentInstanceEventEmitter;
16
- componentRef: ComponentRef<C>;
17
- ngOnInit(): void;
8
+ readonly component: import("@angular/core").InputSignal<Type<C> | undefined>;
9
+ readonly componentIt: import("@angular/core").InputSignal<InjectionToken<Type<C>> | undefined>;
10
+ readonly inputs: import("@angular/core").InputSignal<Record<string, any> | undefined>;
11
+ readonly attachToHost: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
12
+ readonly parentInjector: import("@angular/core").InputSignal<Injector | undefined>;
13
+ readonly instanceCreated: import("@angular/core").OutputEmitterRef<C>;
14
+ componentRef?: ComponentRef<C>;
15
+ constructor();
18
16
  static ɵfac: i0.ɵɵFactoryDeclaration<ComponentDirective<any>, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<ComponentDirective<any>, "[mngComponent]", never, { "component": { "alias": "mngComponent"; "required": false; }; "componentIt": { "alias": "injectionToken"; "required": false; }; "inputs": { "alias": "inputs"; "required": false; }; "attachToHost": { "alias": "attachToHost"; "required": false; }; "parentInjector": { "alias": "parentInjector"; "required": false; }; }, { "componentInstanceEventEmitter": "instanceCreated"; }, never, never, true, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComponentDirective<any>, "[mngComponent]", never, { "component": { "alias": "mngComponent"; "required": false; "isSignal": true; }; "componentIt": { "alias": "injectionToken"; "required": false; "isSignal": true; }; "inputs": { "alias": "inputs"; "required": false; "isSignal": true; }; "attachToHost": { "alias": "attachToHost"; "required": false; "isSignal": true; }; "parentInjector": { "alias": "parentInjector"; "required": false; "isSignal": true; }; }, { "instanceCreated": "instanceCreated"; }, never, never, true, never>;
20
18
  }
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  export declare class RerenderDirective {
3
3
  private readonly templateRef;
4
4
  private readonly viewContainerRef;
5
- mngRerender: import("@angular/core").InputSignal<unknown>;
5
+ readonly mngRerender: import("@angular/core").InputSignal<unknown>;
6
6
  constructor();
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<RerenderDirective, never>;
8
8
  static ɵdir: i0.ɵɵDirectiveDeclaration<RerenderDirective, "[mngRerender]", never, { "mngRerender": { "alias": "mngRerender"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -1,12 +1,8 @@
1
- import { TemplateRef, ViewContainerRef } from '@angular/core';
1
+ import { TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class TemplateDirective {
4
4
  readonly template: TemplateRef<any>;
5
- private readonly viewContainerRef;
6
- type: string;
7
- name: string;
8
- getType(): string;
9
- getViewContainerRef(): ViewContainerRef;
5
+ readonly name: import("@angular/core").InputSignal<string>;
10
6
  static ɵfac: i0.ɵɵFactoryDeclaration<TemplateDirective, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<TemplateDirective, "[mngTemplate]", never, { "type": { "alias": "type"; "required": false; }; "name": { "alias": "mngTemplate"; "required": true; }; }, {}, never, never, true, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TemplateDirective, "[mngTemplate]", never, { "name": { "alias": "mngTemplate"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
12
8
  }
@@ -1,6 +1,6 @@
1
- import { TranslateService } from '@ngx-translate/core';
1
+ import { TranslateService, TranslationObject } from '@ngx-translate/core';
2
2
  import { Observable } from 'rxjs';
3
3
  export declare function getI18nAsync(translate: TranslateService, params?: any, ...keys: Array<string>): Observable<string | null>;
4
4
  export declare function getI18n(translate: TranslateService, params?: any, ...keys: Array<string>): string | null;
5
5
  export declare function populateI18nParams(item?: any, params?: any): any;
6
- export declare function selectI18n(keys: string[], i18n: any): string | null;
6
+ export declare function selectI18n(keys: string[], i18n: TranslationObject): string | null;
@@ -1,4 +1,4 @@
1
- import { ActivatedRouteSnapshot } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
2
  import { Observable } from 'rxjs';
3
3
  import { CommonsMenuItem } from '../models/menu.model';
4
4
  import { APermissions, IActionContextValidation } from './permissions.model';
@@ -8,7 +8,7 @@ export declare class PermissionService {
8
8
  private readonly commons;
9
9
  private readonly logger;
10
10
  private userRoles$;
11
- canActivateRoute(permissions: APermissions, route?: ActivatedRouteSnapshot): Observable<boolean>;
11
+ canActivateRoute(permissions: APermissions, route?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Observable<boolean>;
12
12
  private canActivateRouteAll;
13
13
  private canActivateRouteAny;
14
14
  private canActivateRouteService;
@@ -16,7 +16,7 @@ export declare class PermissionService {
16
16
  private isMenuItemVisibleAll;
17
17
  private isMenuItemVisibleAny;
18
18
  private isMenuItemVisibleService;
19
- isActionVisible(permissions: APermissions, actionCtx?: IActionContextValidation<any, any>, route?: ActivatedRouteSnapshot): Observable<boolean>;
19
+ isActionVisible(permissions: APermissions, actionCtx?: IActionContextValidation<any, any>, route?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Observable<boolean>;
20
20
  private isActionVisibleAll;
21
21
  private isActionVisibleAny;
22
22
  private isActionVisibleService;
@@ -1,5 +1,5 @@
1
1
  import { Type } from '@angular/core';
2
- import { ActivatedRouteSnapshot } from '@angular/router';
2
+ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
3
3
  import { Observable } from 'rxjs';
4
4
  import { ActionParameters } from '../action/action-parameters.model';
5
5
  import { IDataProvider } from '../data-providers/base.data-provider';
@@ -22,10 +22,11 @@ export interface IPermissionService {
22
22
  * Determines whether a route can be activated.
23
23
  *
24
24
  * @param {ActivatedRouteSnapshot} route - The route snapshot object representing the current route for activation.
25
+ * @param {RouterStateSnapshot} state - The router state snapshot
25
26
  *
26
27
  * @returns {Observable<boolean>} - An observable that emits a boolean value indicating whether the route can be activated.
27
28
  */
28
- canActivateRoute(route?: ActivatedRouteSnapshot): Observable<boolean>;
29
+ canActivateRoute(route?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Observable<boolean>;
29
30
  /**
30
31
  * Determines the visibility of menu item.
31
32
  *
@@ -39,10 +40,11 @@ export interface IPermissionService {
39
40
  *
40
41
  * @param {IActionContextValidation<any, any>} [actionCtx] - The action context object containing the necessary information for validation.
41
42
  * @param {ActivatedRouteSnapshot} [route] - The current route snapshot containing the necessary information for validation.
43
+ * @param {RouterStateSnapshot} state - The router state snapshot
42
44
  *
43
45
  * @return {Observable<boolean>} - An Observable that emits the visibility status of the action.
44
46
  */
45
- isActionVisible(actionCtx?: IActionContextValidation<any, any>, route?: ActivatedRouteSnapshot): Observable<boolean>;
47
+ isActionVisible(actionCtx?: IActionContextValidation<any, any>, route?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Observable<boolean>;
46
48
  }
47
49
  export declare abstract class APermissions {
48
50
  private readonly _authorizationType;
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { computed, signal, Component, ChangeDetectionStrategy, inject, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, EnvironmentInjector, createComponent, Directive, Input, Output, TemplateRef, input, effect, booleanAttribute, numberAttribute, Pipe, untracked, InjectionToken, DestroyRef, Injectable, provideAppInitializer, ErrorHandler } from '@angular/core';
3
- import * as i1 from '@ngx-translate/core';
4
- import { TranslateModule, TranslateService } from '@ngx-translate/core';
2
+ import { computed, signal, Component, ChangeDetectionStrategy, effect, untracked, inject, Injector, ElementRef, ApplicationRef, ViewContainerRef, input, booleanAttribute, output, EnvironmentInjector, createComponent, Directive, TemplateRef, numberAttribute, Pipe, InjectionToken, DestroyRef, Injectable, provideAppInitializer, ErrorHandler } from '@angular/core';
3
+ import { TranslatePipe, TranslateService } from '@ngx-translate/core';
5
4
  import { ConfirmDialog } from 'primeng/confirmdialog';
6
5
  import { Dialog } from 'primeng/dialog';
7
6
  import { Toast } from 'primeng/toast';
@@ -49,11 +48,11 @@ class NotificationWrapperComponent {
49
48
  }
50
49
  }
51
50
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: NotificationWrapperComponent, isStandalone: true, selector: "mng-notification-wrapper", ngImport: i0, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template #message let-message>\n <span [class]=\"'p-toast-message-icon pi ' + getMessageIcon(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'mng-dialog mng-dialog-xs mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\"\n appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template #header>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\n"], dependencies: [{ kind: "component", type: ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
51
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: NotificationWrapperComponent, isStandalone: true, selector: "mng-notification-wrapper", ngImport: i0, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template #message let-message>\n <span [class]=\"'p-toast-message-icon pi ' + getMessageIcon(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'mng-dialog mng-dialog-xs mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\"\n appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template #header>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\n"], dependencies: [{ kind: "component", type: ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
53
52
  }
54
53
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
55
54
  type: Component,
56
- args: [{ selector: 'mng-notification-wrapper', imports: [ConfirmDialog, TranslateModule, Dialog, Toast], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template #message let-message>\n <span [class]=\"'p-toast-message-icon pi ' + getMessageIcon(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'mng-dialog mng-dialog-xs mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\"\n appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template #header>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\n"] }]
55
+ args: [{ selector: 'mng-notification-wrapper', imports: [ConfirmDialog, TranslatePipe, Dialog, Toast], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template #message let-message>\n <span [class]=\"'p-toast-message-icon pi ' + getMessageIcon(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'mng-dialog mng-dialog-xs mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\"\n appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template #header>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\n"] }]
57
56
  }] });
58
57
 
59
58
  class ACommonsErrorBase extends Error {
@@ -379,6 +378,9 @@ function dataListParamsToUrlQuery(params, defaults = {
379
378
  if (params.limit && params.limit !== defaults?.limit) {
380
379
  urlParams['limit'] = params.limit;
381
380
  }
381
+ else if (!opts?.skipPresetDefaultsLimit) {
382
+ urlParams['limit'] = defaults?.limit;
383
+ }
382
384
  if (params.offset && params.offset !== defaults?.offset) {
383
385
  urlParams['offset'] = params.offset;
384
386
  }
@@ -791,85 +793,99 @@ class DataProviderInst {
791
793
  }
792
794
  }
793
795
 
796
+ /**
797
+ * Effect function with explicit declaration of dependencies. Dependencies will be tracked, whereas the main execution will not be.
798
+ *
799
+ * @param deps Array of dependencies to be tracked.
800
+ * @param fn Function where dependencies will no longer be tracked.
801
+ * @param opts Additional options:
802
+ * - firstOnly Executes effect only once, then destroy it.
803
+ */
804
+ function effectWithDeps(deps, fn, opts) {
805
+ let execCnt = 0;
806
+ const ref = effect(() => {
807
+ if (opts?.firstOnly) {
808
+ if (execCnt > 0) {
809
+ return;
810
+ }
811
+ ref.destroy();
812
+ }
813
+ const depsValues = deps.map(s => s());
814
+ execCnt++;
815
+ untracked(() => {
816
+ fn(depsValues);
817
+ });
818
+ });
819
+ return ref;
820
+ }
821
+
794
822
  class ComponentDirective {
795
823
  constructor() {
796
824
  this.injector = inject(Injector);
797
825
  this.elementRef = inject(ElementRef);
798
826
  this.applicationRef = inject(ApplicationRef);
799
827
  this.viewContainerRef = inject(ViewContainerRef);
800
- this.attachToHost = false;
801
- this.componentInstanceEventEmitter = new EventEmitter();
802
- }
803
- ngOnInit() {
804
- let component = null;
805
- if (this.component) {
806
- component = this.component;
807
- }
808
- else if (this.componentIt) {
809
- component = this.injector.get(this.componentIt, null, { optional: true });
810
- }
811
- if (!component) {
812
- throw new CommonsInternalError(`Component cannot be created, no component (${this.component}) or no or invalid injection token provided (${this.componentIt}).`);
813
- }
814
- const elementInjector = this.parentInjector ?? this.injector;
815
- const environmentInjector = elementInjector.get(EnvironmentInjector, null, { optional: true }) ?? this.applicationRef.injector;
816
- if (this.attachToHost) {
817
- this.componentRef = createComponent(component, {
818
- hostElement: this.elementRef.nativeElement,
819
- environmentInjector: environmentInjector,
820
- elementInjector: elementInjector
821
- });
822
- }
823
- else {
824
- this.viewContainerRef.clear();
825
- this.componentRef = this.viewContainerRef.createComponent(component, {
826
- environmentInjector: environmentInjector,
827
- injector: elementInjector
828
- });
829
- }
830
- if (this.inputs) {
831
- for (const input in this.inputs) {
832
- this.componentRef.setInput(input, this.inputs[input]);
828
+ this.component = input(undefined, { alias: 'mngComponent' });
829
+ this.componentIt = input(undefined, { alias: 'injectionToken' });
830
+ this.inputs = input();
831
+ this.attachToHost = input(false, { transform: booleanAttribute });
832
+ this.parentInjector = input();
833
+ this.instanceCreated = output();
834
+ effectWithDeps([this.component, this.componentIt], ([componentInput, componentItInput]) => {
835
+ let component = componentInput;
836
+ const componentIt = componentItInput;
837
+ if (!component && componentIt) {
838
+ component = this.injector.get(componentIt, null, { optional: true }) ?? undefined;
839
+ }
840
+ if (!component) {
841
+ throw new CommonsInternalError(`Component cannot be created, no component (${component}) or no or invalid injection token provided (${componentIt}).`);
842
+ }
843
+ const elementInjector = this.parentInjector() ?? this.injector;
844
+ const environmentInjector = elementInjector.get(EnvironmentInjector, null, { optional: true }) ?? this.applicationRef.injector;
845
+ if (this.attachToHost()) {
846
+ this.componentRef = createComponent(component, {
847
+ hostElement: this.elementRef.nativeElement,
848
+ environmentInjector: environmentInjector,
849
+ elementInjector: elementInjector
850
+ });
833
851
  }
834
- }
835
- if (this.attachToHost) {
836
- this.applicationRef.attachView(this.componentRef.hostView);
837
- }
838
- this.componentInstanceEventEmitter.next(this.componentRef.instance);
852
+ else {
853
+ this.viewContainerRef.clear();
854
+ this.componentRef = this.viewContainerRef.createComponent(component, {
855
+ environmentInjector: environmentInjector,
856
+ injector: elementInjector
857
+ });
858
+ }
859
+ const inputs = this.inputs();
860
+ if (inputs) {
861
+ for (const input in inputs) {
862
+ this.componentRef.setInput(input, inputs[input]);
863
+ }
864
+ }
865
+ if (this.attachToHost()) {
866
+ this.applicationRef.attachView(this.componentRef.hostView);
867
+ }
868
+ if (this.componentRef) {
869
+ this.instanceCreated.emit(this.componentRef.instance);
870
+ }
871
+ });
839
872
  }
840
873
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
841
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost", parentInjector: "parentInjector" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 }); }
874
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.7", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: { classPropertyName: "component", publicName: "mngComponent", isSignal: true, isRequired: false, transformFunction: null }, componentIt: { classPropertyName: "componentIt", publicName: "injectionToken", isSignal: true, isRequired: false, transformFunction: null }, inputs: { classPropertyName: "inputs", publicName: "inputs", isSignal: true, isRequired: false, transformFunction: null }, attachToHost: { classPropertyName: "attachToHost", publicName: "attachToHost", isSignal: true, isRequired: false, transformFunction: null }, parentInjector: { classPropertyName: "parentInjector", publicName: "parentInjector", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { instanceCreated: "instanceCreated" }, ngImport: i0 }); }
842
875
  }
843
876
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: ComponentDirective, decorators: [{
844
877
  type: Directive,
845
878
  args: [{
846
879
  selector: '[mngComponent]'
847
880
  }]
848
- }], propDecorators: { component: [{
849
- type: Input,
850
- args: [{ alias: 'mngComponent' }]
851
- }], componentIt: [{
852
- type: Input,
853
- args: [{ alias: 'injectionToken' }]
854
- }], inputs: [{
855
- type: Input
856
- }], attachToHost: [{
857
- type: Input
858
- }], parentInjector: [{
859
- type: Input
860
- }], componentInstanceEventEmitter: [{
861
- type: Output,
862
- args: ['instanceCreated']
863
- }] } });
881
+ }], ctorParameters: () => [] });
864
882
 
865
883
  class RerenderDirective {
866
884
  constructor() {
867
885
  this.templateRef = inject((TemplateRef));
868
886
  this.viewContainerRef = inject(ViewContainerRef);
869
887
  this.mngRerender = input.required();
870
- effect(() => {
871
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
872
- const doRerender = this.mngRerender();
888
+ effectWithDeps([this.mngRerender], () => {
873
889
  this.viewContainerRef.clear();
874
890
  this.viewContainerRef.createEmbeddedView(this.templateRef);
875
891
  });
@@ -887,28 +903,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
887
903
  class TemplateDirective {
888
904
  constructor() {
889
905
  this.template = inject((TemplateRef));
890
- this.viewContainerRef = inject(ViewContainerRef);
891
- }
892
- getType() {
893
- return this.name;
894
- }
895
- getViewContainerRef() {
896
- return this.viewContainerRef;
906
+ this.name = input.required({ alias: 'mngTemplate' });
897
907
  }
898
908
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
899
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: TemplateDirective, isStandalone: true, selector: "[mngTemplate]", inputs: { type: "type", name: ["mngTemplate", "name"] }, ngImport: i0 }); }
909
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.7", type: TemplateDirective, isStandalone: true, selector: "[mngTemplate]", inputs: { name: { classPropertyName: "name", publicName: "mngTemplate", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
900
910
  }
901
911
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TemplateDirective, decorators: [{
902
912
  type: Directive,
903
913
  args: [{
904
914
  selector: '[mngTemplate]'
905
915
  }]
906
- }], propDecorators: { type: [{
907
- type: Input
908
- }], name: [{
909
- type: Input,
910
- args: [{ required: true, alias: 'mngTemplate' }]
911
- }] } });
916
+ }] });
912
917
 
913
918
  /**
914
919
  * Returns array of names for constants in enum.
@@ -1779,11 +1784,11 @@ function adjustRouteMenuLazyChildrenRouterLinks(rootMenuItem, lazyChildren) {
1779
1784
  }
1780
1785
 
1781
1786
  function findTemplateByName(templates, name) {
1782
- return templates.find(t => t.getType() === name)?.template ?? null;
1787
+ return templates.find(t => t.name() === name)?.template ?? null;
1783
1788
  }
1784
1789
 
1785
1790
  function getI18nAsync(translate, params, ...keys) {
1786
- return translate.stream(keys, params).pipe(map(i18n => selectI18n(keys, i18n)));
1791
+ return translate.stream(keys, params).pipe(map((i18n) => selectI18n(keys, i18n)));
1787
1792
  }
1788
1793
  function getI18n(translate, params, ...keys) {
1789
1794
  const i18n = translate.instant(keys, params);
@@ -2286,32 +2291,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
2286
2291
  }]
2287
2292
  }] });
2288
2293
 
2289
- /**
2290
- * Effect function with explicit declaration of dependencies. Dependencies will be tracked, whereas the main execution will not be.
2291
- *
2292
- * @param deps Array of dependencies to be tracked.
2293
- * @param fn Function where dependencies will no longer be tracked.
2294
- * @param opts Additional options:
2295
- * - firstOnly Executes effect only once, then destroy it.
2296
- */
2297
- function effectWithDeps(deps, fn, opts) {
2298
- let execCnt = 0;
2299
- const ref = effect(() => {
2300
- if (opts?.firstOnly) {
2301
- if (execCnt > 0) {
2302
- return;
2303
- }
2304
- ref.destroy();
2305
- }
2306
- const depsValues = deps.map(s => s());
2307
- execCnt++;
2308
- untracked(() => {
2309
- fn(depsValues);
2310
- });
2311
- });
2312
- return ref;
2313
- }
2314
-
2315
2294
  function TypeName(typeName) {
2316
2295
  return function (target) {
2317
2296
  defineReflectTypeName(target, typeName);
@@ -2533,7 +2512,7 @@ class CommonsService {
2533
2512
  this.translate
2534
2513
  .stream('mngPrime')
2535
2514
  .pipe(takeUntilDestroyed())
2536
- .subscribe(value => this.primengConfig.setTranslation(value));
2515
+ .subscribe((value) => this.primengConfig.setTranslation(value));
2537
2516
  }
2538
2517
  initialize() {
2539
2518
  this.logger.debug('Initialize');
@@ -2605,7 +2584,7 @@ class CommonsService {
2605
2584
  this.breadcrumbHomeTranslateSubscription = this.translate
2606
2585
  .get(homeBreadcrumb.label)
2607
2586
  .pipe(takeUntilDestroyed(this.destroyRef))
2608
- .subscribe(i18n => {
2587
+ .subscribe((i18n) => {
2609
2588
  homeBreadcrumb.label = i18n;
2610
2589
  this.breadcrumbHome.set(homeBreadcrumb);
2611
2590
  });
@@ -2624,7 +2603,7 @@ class CommonsService {
2624
2603
  this.breadcrumbsTranslateSubscription = this.translate
2625
2604
  .get(i18nKeys)
2626
2605
  .pipe(takeUntilDestroyed(this.destroyRef))
2627
- .subscribe(i18n => {
2606
+ .subscribe((i18n) => {
2628
2607
  // Construct the breadcrumb hierarchy
2629
2608
  breadcrumbs.forEach(b => {
2630
2609
  if (b.label && i18n[b.label]) {
@@ -2853,31 +2832,31 @@ class PermissionService {
2853
2832
  this.logger = inject(LoggerService).create('AuthorizationService');
2854
2833
  this.userRoles$ = toObservable$1(this.commons.userRoles);
2855
2834
  }
2856
- canActivateRoute(permissions, route) {
2835
+ canActivateRoute(permissions, route, state) {
2857
2836
  switch (permissions.authorizationType) {
2858
2837
  case PermissionTypeEnum.All:
2859
- return this.canActivateRouteAll(permissions, route);
2838
+ return this.canActivateRouteAll(permissions, route, state);
2860
2839
  case PermissionTypeEnum.Any:
2861
- return this.canActivateRouteAny(permissions, route);
2840
+ return this.canActivateRouteAny(permissions, route, state);
2862
2841
  case PermissionTypeEnum.Service:
2863
- return this.canActivateRouteService(permissions, route);
2842
+ return this.canActivateRouteService(permissions, route, state);
2864
2843
  default:
2865
2844
  return this.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
2866
2845
  }
2867
2846
  }
2868
- canActivateRouteAll(permission, route) {
2869
- return combineLatest(permission.permissions.map(p => this.canActivateRoute(p, route))).pipe(map(res => res.every(ip => ip === true)));
2847
+ canActivateRouteAll(permission, route, state) {
2848
+ return combineLatest(permission.permissions.map(p => this.canActivateRoute(p, route, state))).pipe(map(res => res.every(ip => ip === true)));
2870
2849
  }
2871
- canActivateRouteAny(permissions, route) {
2872
- return combineLatest(permissions.permissions.map(p => this.canActivateRoute(p, route))).pipe(map(res => res.some(ip => ip === true)));
2850
+ canActivateRouteAny(permissions, route, state) {
2851
+ return combineLatest(permissions.permissions.map(p => this.canActivateRoute(p, route, state))).pipe(map(res => res.some(ip => ip === true)));
2873
2852
  }
2874
- canActivateRouteService(permission, route) {
2853
+ canActivateRouteService(permission, route, state) {
2875
2854
  const serviceInstance = this.injector.get(permission.service);
2876
2855
  if (!serviceInstance) {
2877
2856
  this.logger.debug(`WARNING: Service instance could not be retrieved for type ${permission.service}`);
2878
2857
  return of(false);
2879
2858
  }
2880
- return serviceInstance.canActivateRoute(route);
2859
+ return serviceInstance.canActivateRoute(route, state);
2881
2860
  }
2882
2861
  isMenuItemVisible(permissions, menuItem) {
2883
2862
  switch (permissions.authorizationType) {
@@ -2905,31 +2884,31 @@ class PermissionService {
2905
2884
  }
2906
2885
  return serviceInstance.isMenuitemVisible(menuItem);
2907
2886
  }
2908
- isActionVisible(permissions, actionCtx, route) {
2887
+ isActionVisible(permissions, actionCtx, route, state) {
2909
2888
  switch (permissions.authorizationType) {
2910
2889
  case PermissionTypeEnum.All:
2911
- return this.isActionVisibleAll(permissions, actionCtx, route);
2890
+ return this.isActionVisibleAll(permissions, actionCtx, route, state);
2912
2891
  case PermissionTypeEnum.Any:
2913
- return this.isActionVisibleAny(permissions, actionCtx, route);
2892
+ return this.isActionVisibleAny(permissions, actionCtx, route, state);
2914
2893
  case PermissionTypeEnum.Service:
2915
- return this.isActionVisibleService(permissions, actionCtx, route);
2894
+ return this.isActionVisibleService(permissions, actionCtx, route, state);
2916
2895
  default:
2917
2896
  return this.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
2918
2897
  }
2919
2898
  }
2920
- isActionVisibleAll(permission, actionCtx, route) {
2921
- return combineLatest(permission.permissions.map(p => this.isActionVisible(p, actionCtx, route))).pipe(map(res => res.every(ip => ip === true)));
2899
+ isActionVisibleAll(permission, actionCtx, route, state) {
2900
+ return combineLatest(permission.permissions.map(p => this.isActionVisible(p, actionCtx, route, state))).pipe(map(res => res.every(ip => ip === true)));
2922
2901
  }
2923
- isActionVisibleAny(permission, actionCtx, route) {
2924
- return combineLatest(permission.permissions.map(p => this.isActionVisible(p, actionCtx, route))).pipe(map(res => res.some(ip => ip === true)));
2902
+ isActionVisibleAny(permission, actionCtx, route, state) {
2903
+ return combineLatest(permission.permissions.map(p => this.isActionVisible(p, actionCtx, route, state))).pipe(map(res => res.some(ip => ip === true)));
2925
2904
  }
2926
- isActionVisibleService(permission, actionCtx, route) {
2905
+ isActionVisibleService(permission, actionCtx, route, state) {
2927
2906
  const serviceInstance = this.injector.get(permission.service);
2928
2907
  if (!serviceInstance) {
2929
2908
  this.logger.debug(`WARNING: Service instance could not be retreived for type ${permission.service}`);
2930
2909
  return of(false);
2931
2910
  }
2932
- return serviceInstance.isActionVisible(actionCtx, route);
2911
+ return serviceInstance.isActionVisible(actionCtx, route, state);
2933
2912
  }
2934
2913
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2935
2914
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PermissionService }); }
@@ -2938,11 +2917,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
2938
2917
  type: Injectable
2939
2918
  }] });
2940
2919
 
2941
- const permissionGuard = (route) => {
2920
+ const permissionGuard = (route, state) => {
2942
2921
  const permission = inject(PermissionService);
2943
2922
  const data = route.data;
2944
2923
  if (data.permissions) {
2945
- return permission.canActivateRoute(data.permissions, route).pipe(first());
2924
+ return permission.canActivateRoute(data.permissions, route, state).pipe(first());
2946
2925
  }
2947
2926
  else {
2948
2927
  return of(true);