@mediusinc/mng-commons 5.0.0-rc.2 → 5.0.0-rc.3
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/core/data-providers/base-data-provider.factory.d.ts +13 -0
- package/core/data-providers/base.data-provider.d.ts +2 -14
- package/core/descriptors/editor.descriptor.d.ts +1 -1
- package/core/descriptors/tableview.descriptor.d.ts +5 -5
- package/core/directives/component.directive.d.ts +2 -2
- package/core/index.d.ts +1 -0
- package/core/security/permission.service.d.ts +1 -0
- package/core/services/commons-router.service.d.ts +3 -3
- package/core/services/commons.service.d.ts +31 -42
- package/core/services/tokens/module-config.token.d.ts +2 -2
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +3 -3
- package/esm2022/core/components/pages/error/error.page.component.mjs +3 -3
- package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +3 -3
- package/esm2022/core/data-providers/base-data-provider.factory.mjs +28 -0
- package/esm2022/core/data-providers/base.data-provider.mjs +1 -31
- package/esm2022/core/descriptors/editor.descriptor.mjs +1 -1
- package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
- package/esm2022/core/directives/component.directive.mjs +10 -7
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/security/permission.service.mjs +4 -2
- package/esm2022/core/services/commons-init.service.mjs +2 -2
- package/esm2022/core/services/commons-router.service.mjs +16 -15
- package/esm2022/core/services/commons.service.mjs +109 -166
- package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +4 -4
- package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +31 -0
- package/esm2022/form/api/data-providers/lookup.data-provider.mjs +1 -31
- package/esm2022/form/api/index.mjs +2 -1
- package/esm2022/form/components/autocomplete/autocomplete.component.mjs +92 -83
- package/esm2022/form/components/dropdown/dropdown.component.mjs +145 -87
- package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +8 -0
- package/esm2022/model/descriptors/enum.descriptor.mjs +3 -6
- package/esm2022/model/descriptors/model.descriptor.mjs +22 -9
- package/esm2022/model/descriptors/type.descriptor.mjs +3 -9
- package/esm2022/model/index.mjs +3 -1
- package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +33 -0
- package/esm2022/table/api/data-providers/table.data-provider.mjs +1 -31
- package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
- package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +89 -0
- package/esm2022/table/api/descriptors/table.descriptor.mjs +4 -139
- package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +97 -0
- package/esm2022/table/api/index.mjs +4 -1
- package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +6 -7
- package/esm2022/table/components/column-value/column-value.component.mjs +2 -2
- package/esm2022/table/components/table/table.component.mjs +5 -5
- package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +2 -2
- package/esm2022/table/services/data-list.service.mjs +1 -1
- package/esm2022/tableview/action/components/action/action.component.mjs +140 -188
- package/esm2022/tableview/action/components/editor/action-editor.component.mjs +56 -66
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +119 -141
- package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +21 -39
- package/esm2022/tableview/action/components/route/action-route.component.mjs +17 -23
- package/esm2022/tableview/action/components/table/action-table.component.mjs +1 -1
- package/esm2022/tableview/action/services/action-executor.service.mjs +9 -9
- package/esm2022/tableview/action/services/navigation.service.mjs +3 -2
- package/esm2022/tableview/action/services/view-container.service.mjs +5 -21
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +119 -0
- package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +77 -0
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +20 -80
- package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +45 -0
- package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -32
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +3 -69
- package/esm2022/tableview/api/action/models/action-component.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +1 -1
- package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +33 -0
- package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +1 -31
- package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +81 -0
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +7 -133
- package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +13 -5
- package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +4 -4
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +3 -3
- package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +95 -0
- package/esm2022/tableview/api/editor/helpers/field-validators.mjs +7 -7
- package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/field-validation.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/field.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
- package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
- package/esm2022/tableview/api/index.mjs +11 -1
- package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +47 -0
- package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +5 -46
- package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +111 -0
- package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +15 -168
- package/esm2022/tableview/api/tableview/helpers/files-export.mjs +2 -2
- package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +5 -5
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +53 -18
- package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +110 -0
- package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +2 -2
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +16 -11
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +6 -2
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +10 -11
- package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +1 -1
- package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +4 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +9 -11
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +4 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +16 -18
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +20 -22
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +18 -20
- package/esm2022/tableview/editor/helpers/editor-formly.mjs +27 -6
- package/esm2022/tableview/editor/services/form-editor.service.mjs +96 -0
- package/esm2022/tableview/index.mjs +2 -1
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +3 -3
- package/fesm2022/mediusinc-mng-commons-core.mjs +155 -210
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -3
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +18 -18
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +236 -169
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +43 -33
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +192 -146
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +11 -12
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +822 -590
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +564 -571
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/form/api/data-providers/lookup-data-provider.factory.d.ts +18 -0
- package/form/api/data-providers/lookup.data-provider.d.ts +2 -14
- package/form/api/index.d.ts +1 -0
- package/form/components/autocomplete/autocomplete.component.d.ts +31 -23
- package/form/components/dropdown/dropdown.component.d.ts +38 -25
- package/model/data-providers/base-from-type-data-provider.factory.d.ts +8 -0
- package/model/descriptors/enum.descriptor.d.ts +1 -2
- package/model/descriptors/model.descriptor.d.ts +11 -4
- package/model/descriptors/type.descriptor.d.ts +2 -4
- package/model/index.d.ts +1 -0
- package/package.json +1 -1
- package/table/api/data-providers/table-data-provider.factory.d.ts +18 -0
- package/table/api/data-providers/table.data-provider.d.ts +2 -14
- package/table/api/descriptors/table-descriptor.factory.d.ts +44 -0
- package/table/api/descriptors/table.descriptor.d.ts +4 -65
- package/table/api/helpers/table-descriptor-helpers.d.ts +44 -0
- package/table/api/index.d.ts +3 -0
- package/table/components/column-filter-full/column-filter-full.component.d.ts +5 -4
- package/table/components/table/table.component.d.ts +11 -11
- package/table/services/data-list.service.d.ts +9 -10
- package/tableview/action/components/action/action.component.d.ts +37 -44
- package/tableview/action/components/editor/action-editor.component.d.ts +20 -18
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +23 -23
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +11 -14
- package/tableview/action/components/route/action-route.component.d.ts +6 -11
- package/tableview/action/components/table/action-table.component.d.ts +3 -3
- package/tableview/action/services/view-container.service.d.ts +3 -9
- package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +36 -0
- package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +31 -0
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +17 -37
- package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +15 -0
- package/tableview/api/action/descriptors/action-link.descriptor.d.ts +1 -9
- package/tableview/api/action/descriptors/action.descriptor.d.ts +4 -27
- package/tableview/api/action/models/action-component.model.d.ts +8 -8
- package/tableview/api/action/models/execution/view-container.model.d.ts +4 -3
- package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +18 -0
- package/tableview/api/editor/data-providers/editor.data-provider.d.ts +2 -14
- package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +44 -0
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +34 -90
- package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +3 -3
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +15 -13
- package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +7 -6
- package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -2
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +8 -8
- package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +6 -6
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +1 -1
- package/tableview/api/editor/helpers/editor-descriptor-helpers.d.ts +43 -0
- package/tableview/api/editor/helpers/field-validators.d.ts +1 -1
- package/tableview/api/editor/models/editor-fields.model.d.ts +24 -22
- package/tableview/api/editor/models/field-action-context.model.d.ts +10 -8
- package/tableview/api/editor/models/field-validation.model.d.ts +26 -0
- package/tableview/api/editor/models/field.model.d.ts +0 -19
- package/tableview/api/editor/models/form-editor.event.d.ts +24 -16
- package/tableview/api/editor/models/form-editor.interface.d.ts +2 -1
- package/tableview/api/editor/models/formly-custom-field.model.d.ts +1 -1
- package/tableview/api/editor/models/formly-field.model.d.ts +4 -4
- package/tableview/api/index.d.ts +10 -0
- package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +25 -0
- package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +3 -20
- package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +49 -0
- package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +40 -100
- package/tableview/api/tableview/helpers/tableview-create.d.ts +2 -2
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +4 -2
- package/tableview/api/tableview/helpers/tableview-descriptor-helpers.d.ts +42 -0
- package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +1 -1
- package/tableview/editor/components/editor/form-editor.component.d.ts +6 -4
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +5 -3
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +1 -0
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +1 -1
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -1
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -4
- package/tableview/editor/helpers/editor-formly.d.ts +1 -1
- package/tableview/editor/services/form-editor.service.d.ts +39 -0
- package/tableview/index.d.ts +1 -0
- package/tableview/tableview/components/route/tableview-route.component.d.ts +1 -1
- package/tableview/tableview/components/tableview/tableview.component.d.ts +1 -1
- package/version-info.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Directive, computed, signal, Component, ChangeDetectionStrategy, InjectionToken, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, createComponent, Input, Output, TemplateRef, booleanAttribute, numberAttribute, Pipe, APP_INITIALIZER, ErrorHandler } from '@angular/core';
|
|
2
|
+
import { inject, Directive, computed, signal, Component, ChangeDetectionStrategy, InjectionToken, DestroyRef, effect, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, EnvironmentInjector, createComponent, Input, Output, TemplateRef, booleanAttribute, numberAttribute, Pipe, APP_INITIALIZER, ErrorHandler } from '@angular/core';
|
|
3
3
|
import * as i3$1 from '@ngx-translate/core';
|
|
4
4
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
5
5
|
import * as i3 from 'primeng/confirmdialog';
|
|
@@ -10,16 +10,16 @@ import * as i1 from 'primeng/toast';
|
|
|
10
10
|
import { ToastModule } from 'primeng/toast';
|
|
11
11
|
import { DialogService, DynamicDialogComponent } from 'primeng/dynamicdialog';
|
|
12
12
|
import * as i2 from 'primeng/api';
|
|
13
|
-
import { PrimeNGConfig,
|
|
14
|
-
import * as i1$1 from '@angular/router';
|
|
13
|
+
import { PrimeNGConfig, MessageService, ConfirmationService } from 'primeng/api';
|
|
15
14
|
import { Router, NavigationEnd, RouterLink, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
16
15
|
import * as i2$1 from 'primeng/button';
|
|
17
16
|
import { ButtonModule } from 'primeng/button';
|
|
17
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
18
18
|
import { Title } from '@angular/platform-browser';
|
|
19
|
-
import { BehaviorSubject, ReplaySubject, distinctUntilChanged, isObservable, of, mergeMap, combineLatest, Observable, tap, Subject, take, throwError } from 'rxjs';
|
|
20
19
|
import { filter, map, first, catchError } from 'rxjs/operators';
|
|
21
20
|
import { DatePipe } from '@angular/common';
|
|
22
21
|
import { HttpErrorResponse, HttpClient, HttpBackend } from '@angular/common/http';
|
|
22
|
+
import { isObservable, of, mergeMap, combineLatest, Observable, tap, ReplaySubject, Subject, take, throwError } from 'rxjs';
|
|
23
23
|
import 'reflect-metadata';
|
|
24
24
|
|
|
25
25
|
class DialogKeydownHandlerDirective {
|
|
@@ -98,11 +98,11 @@ class NotificationWrapperComponent {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", 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 let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", 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 let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(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=\"p-link font-semibold text-sm mt-2 flex align-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]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i3.ConfirmDialog, selector: "p-confirmDialog", 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: i3$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5.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", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: DialogKeydownHandlerDirective, selector: "[mngDialogKeydownHandler]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
102
102
|
}
|
|
103
103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
|
|
104
104
|
type: Component,
|
|
105
|
-
args: [{ selector: 'mng-notification-wrapper', standalone: true, imports: [ToastModule, ConfirmDialogModule, TranslateModule, DialogModule, DialogKeydownHandlerDirective], 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 let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n
|
|
105
|
+
args: [{ selector: 'mng-notification-wrapper', standalone: true, imports: [ToastModule, ConfirmDialogModule, TranslateModule, DialogModule, DialogKeydownHandlerDirective], 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 let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(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=\"p-link font-semibold text-sm mt-2 flex align-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]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n" }]
|
|
106
106
|
}] });
|
|
107
107
|
|
|
108
108
|
class ACommonsErrorBase extends Error {
|
|
@@ -398,190 +398,127 @@ const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
|
|
|
398
398
|
const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
|
|
399
399
|
|
|
400
400
|
class CommonsService {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
this.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
this.
|
|
407
|
-
this.titleService = inject(Title);
|
|
408
|
-
this.filterService = inject(FilterService);
|
|
409
|
-
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
410
|
-
this.localStorage = inject(BROWSER_STORAGE_IT);
|
|
411
|
-
// breadcrumbs
|
|
412
|
-
this.breadcrumbHomeSubject = new BehaviorSubject({
|
|
413
|
-
icon: 'pi pi-home',
|
|
414
|
-
routerLink: '/'
|
|
415
|
-
});
|
|
416
|
-
this.breadcrumbsSubject = new BehaviorSubject([]);
|
|
417
|
-
// visual
|
|
418
|
-
this._colorScheme = 'light';
|
|
419
|
-
this.userSubject = new ReplaySubject(1);
|
|
420
|
-
this._userRoles = [];
|
|
421
|
-
this.userRolesSubject = new BehaviorSubject([]);
|
|
422
|
-
// language
|
|
423
|
-
this.languageSubject = new ReplaySubject(1);
|
|
424
|
-
this.dataLanguageSubject = new ReplaySubject(1);
|
|
425
|
-
}
|
|
426
|
-
// APP section
|
|
427
|
-
get appName() {
|
|
428
|
-
return this.moduleConfig?.app?.name ?? 'app.name';
|
|
429
|
-
}
|
|
430
|
-
get appOwner() {
|
|
431
|
-
return this.moduleConfig?.app?.owner ?? 'app.owner';
|
|
432
|
-
}
|
|
433
|
-
get appLogoLight() {
|
|
434
|
-
return this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
|
|
435
|
-
}
|
|
436
|
-
get appLogoDark() {
|
|
437
|
-
return this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
|
|
438
|
-
}
|
|
439
|
-
get appLogoNameLight() {
|
|
440
|
-
return this.moduleConfig?.app?.logoNamePathLight
|
|
441
|
-
? this.moduleConfig.app.logoNamePathLight
|
|
442
|
-
: this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
|
|
443
|
-
}
|
|
444
|
-
get appLogoNameDark() {
|
|
445
|
-
return this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
|
|
446
|
-
}
|
|
447
|
-
get appLanguages() {
|
|
448
|
-
return this.moduleConfig?.app?.languages ?? ['en'];
|
|
401
|
+
getDefaultLocale() {
|
|
402
|
+
const browserLang = this.translate.getBrowserLang();
|
|
403
|
+
if (browserLang && this.appLocales().some(l => l === browserLang)) {
|
|
404
|
+
return browserLang;
|
|
405
|
+
}
|
|
406
|
+
return this.appLocales()?.length > 0 ? this.appLocales()[0] : 'en';
|
|
449
407
|
}
|
|
450
|
-
|
|
408
|
+
initAppLocale() {
|
|
451
409
|
const lsLang = this.localStorage.getItem('lang');
|
|
452
|
-
if (lsLang && this.
|
|
410
|
+
if (lsLang && this.appLocales().some(l => l === lsLang)) {
|
|
453
411
|
return lsLang;
|
|
454
412
|
}
|
|
455
|
-
return
|
|
413
|
+
return this.getDefaultLocale();
|
|
456
414
|
}
|
|
457
|
-
|
|
458
|
-
if (
|
|
459
|
-
this.localStorage.removeItem('lang');
|
|
460
|
-
this.languageSubject.next(language);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
if (this.appLanguages.some(l => l === language)) {
|
|
464
|
-
this.localStorage.setItem('lang', language);
|
|
465
|
-
this.languageSubject.next(language);
|
|
415
|
+
setAppLocale(language) {
|
|
416
|
+
if (this.appLocales().some(l => l === language)) {
|
|
466
417
|
this.translate.use(language);
|
|
418
|
+
this._appLocale.set(language);
|
|
419
|
+
if (language !== this.getDefaultLocale())
|
|
420
|
+
this.localStorage.setItem('lang', language);
|
|
421
|
+
else
|
|
422
|
+
this.localStorage.removeItem('lang');
|
|
467
423
|
}
|
|
468
424
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
initLanguage() {
|
|
473
|
-
const browserLang = this.translate.getBrowserLang();
|
|
474
|
-
if (browserLang && this.appLanguages.some(l => l === browserLang)) {
|
|
475
|
-
this.appLanguage = browserLang;
|
|
476
|
-
return browserLang;
|
|
477
|
-
}
|
|
478
|
-
const defaultLanguage = this.appLanguages?.length > 0 ? this.appLanguages[0] : 'en';
|
|
479
|
-
this.appLanguage = defaultLanguage;
|
|
480
|
-
return defaultLanguage;
|
|
481
|
-
}
|
|
482
|
-
getOrInitLanguage() {
|
|
483
|
-
return this.appLanguage || this.initLanguage();
|
|
425
|
+
clearAppLocale() {
|
|
426
|
+
this.localStorage.removeItem('lang');
|
|
427
|
+
this._appLocale.set(this.getDefaultLocale());
|
|
484
428
|
}
|
|
485
|
-
|
|
486
|
-
return this.moduleConfig?.app?.dataLanguages ?? ['en'];
|
|
487
|
-
}
|
|
488
|
-
get appDataLanguageDefault() {
|
|
489
|
-
return this.appDataLanguages[0];
|
|
490
|
-
}
|
|
491
|
-
get appDataLanguage() {
|
|
429
|
+
initAppDataLocale() {
|
|
492
430
|
const dataLang = this.localStorage.getItem('dataLang');
|
|
493
|
-
if (dataLang && this.
|
|
431
|
+
if (dataLang && this.appDataLocales().some(dl => dl === dataLang)) {
|
|
494
432
|
return dataLang;
|
|
495
433
|
}
|
|
496
|
-
return this.
|
|
434
|
+
return this.appDataLocales()?.length > 0 ? this.getDefaultLocale() : 'en';
|
|
497
435
|
}
|
|
498
|
-
|
|
499
|
-
if (
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
|
|
436
|
+
setAppDataLocale(dataLocale) {
|
|
437
|
+
if (this.appDataLocales().some(dl => dl === dataLocale)) {
|
|
438
|
+
this._appDataLocale.set(dataLocale);
|
|
439
|
+
if (dataLocale !== this.getDefaultLocale())
|
|
440
|
+
this.localStorage.setItem('dataLang', dataLocale);
|
|
441
|
+
else
|
|
442
|
+
this.localStorage.removeItem('dataLang');
|
|
503
443
|
}
|
|
504
|
-
if (this.appDataLanguages.some(dl => dl === dataLanguage)) {
|
|
505
|
-
this.localStorage.setItem('dataLang', dataLanguage);
|
|
506
|
-
this.dataLanguageSubject.next(dataLanguage);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
get appDataLanguage$() {
|
|
510
|
-
return this.dataLanguageSubject.asObservable().pipe(distinctUntilChanged());
|
|
511
|
-
}
|
|
512
|
-
// We assume, that default data language is the first one from the array of all available data languages
|
|
513
|
-
get defaultDataLanguage() {
|
|
514
|
-
return this.appDataLanguages[0];
|
|
515
|
-
}
|
|
516
|
-
get appVersion() {
|
|
517
|
-
return this.moduleConfig?.app?.version;
|
|
518
|
-
}
|
|
519
|
-
// BREADCRUMB section
|
|
520
|
-
get breadcrumbHome$() {
|
|
521
|
-
return this.breadcrumbHomeSubject.asObservable();
|
|
522
|
-
}
|
|
523
|
-
get breadcrumbs$() {
|
|
524
|
-
return this.breadcrumbsSubject.asObservable();
|
|
525
|
-
}
|
|
526
|
-
// VISUAL section
|
|
527
|
-
get colorSchemeIsLight() {
|
|
528
|
-
return this._colorScheme === 'light';
|
|
529
|
-
}
|
|
530
|
-
get colorSchemeIsDark() {
|
|
531
|
-
return this._colorScheme === 'dark';
|
|
532
|
-
}
|
|
533
|
-
// USER section
|
|
534
|
-
get user() {
|
|
535
|
-
return this._user;
|
|
536
|
-
}
|
|
537
|
-
set user(user) {
|
|
538
|
-
this._user = user;
|
|
539
|
-
this.userSubject.next(user);
|
|
540
|
-
}
|
|
541
|
-
get user$() {
|
|
542
|
-
return this.userSubject.asObservable();
|
|
543
444
|
}
|
|
544
|
-
|
|
545
|
-
|
|
445
|
+
clearAppDataLocale() {
|
|
446
|
+
this.localStorage.removeItem('lang');
|
|
447
|
+
this._appDataLocale.set(this.getDefaultLocale());
|
|
546
448
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
this.
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
449
|
+
constructor() {
|
|
450
|
+
// internal
|
|
451
|
+
this.logger = inject(LoggerService).create('CommonsService');
|
|
452
|
+
this.router = inject(Router);
|
|
453
|
+
this.primengConfig = inject(PrimeNGConfig);
|
|
454
|
+
this.translate = inject(TranslateService);
|
|
455
|
+
this.titleService = inject(Title);
|
|
456
|
+
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
457
|
+
this.localStorage = inject(BROWSER_STORAGE_IT);
|
|
458
|
+
this.destroyRef = inject(DestroyRef);
|
|
459
|
+
// breadcrumbs
|
|
460
|
+
this.breadcrumbHome = signal({
|
|
461
|
+
icon: 'pi pi-home',
|
|
462
|
+
routerLink: '/'
|
|
463
|
+
});
|
|
464
|
+
this.breadcrumbs = signal([]);
|
|
555
465
|
// visual
|
|
556
|
-
this.
|
|
466
|
+
this.colorScheme = signal(this.moduleConfig?.app?.colorScheme ?? 'light');
|
|
467
|
+
this.colorSchemeIsLight = computed(() => this.colorScheme() === 'light');
|
|
468
|
+
// user
|
|
469
|
+
this.user = signal(undefined);
|
|
470
|
+
this.userRoles = signal([]);
|
|
471
|
+
// APP section
|
|
472
|
+
this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name');
|
|
473
|
+
this.appOwner = signal(this.moduleConfig?.app?.owner ?? 'app.owner');
|
|
474
|
+
this.appLogoLight = signal(this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
|
|
475
|
+
this.appLogoDark = signal(this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
|
|
476
|
+
this.appLogo = computed(() => (this.colorSchemeIsLight() ? this.appLogoDark() : this.appLogoLight()));
|
|
477
|
+
this.appLogoNameLight = signal(this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
|
|
478
|
+
this.appLogoNameDark = signal(this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png');
|
|
479
|
+
this.appLogoName = computed(() => (this.colorSchemeIsLight() ? this.appLogoNameDark() : this.appLogoNameLight()));
|
|
480
|
+
this.appLocales = signal(this.moduleConfig?.app?.locales ?? ['en']);
|
|
481
|
+
this._appLocale = signal(this.initAppLocale());
|
|
482
|
+
this.appLocale = computed(() => this._appLocale());
|
|
483
|
+
this.appDataLocales = signal(this.moduleConfig?.app?.dataLocales ?? ['en']);
|
|
484
|
+
this._appDataLocale = signal(this.initAppDataLocale());
|
|
485
|
+
this.appDataLocale = computed(() => this._appDataLocale());
|
|
486
|
+
this.appVersion = signal(this.moduleConfig?.app?.version);
|
|
557
487
|
// ripple
|
|
558
488
|
this.primengConfig.ripple = true;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
489
|
+
effect(() => {
|
|
490
|
+
const appLocales = this.appLocales();
|
|
491
|
+
if (appLocales) {
|
|
492
|
+
this.setAppLocale(this.initAppLocale());
|
|
493
|
+
this.translate.langs = this.appLocales();
|
|
494
|
+
}
|
|
495
|
+
const appDataLocales = this.appDataLocales();
|
|
496
|
+
if (appDataLocales)
|
|
497
|
+
this.setAppDataLocale(this.initAppDataLocale());
|
|
498
|
+
}, { allowSignalWrites: true });
|
|
499
|
+
this.router.events
|
|
568
500
|
.pipe(
|
|
569
501
|
// Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
|
|
570
|
-
filter(event => event instanceof NavigationEnd))
|
|
502
|
+
filter(event => event instanceof NavigationEnd), takeUntilDestroyed())
|
|
571
503
|
.subscribe(() => {
|
|
572
504
|
this.updateBreadcrumbs();
|
|
573
505
|
this.setPageTitle();
|
|
574
506
|
});
|
|
575
|
-
this.
|
|
576
|
-
this.translateLangChangeSubscription = this.translate.onLangChange.subscribe(() => {
|
|
507
|
+
this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
|
|
577
508
|
this.updateBreadcrumbs();
|
|
578
509
|
this.setPageTitle();
|
|
579
510
|
});
|
|
580
|
-
this.
|
|
511
|
+
this.translate
|
|
512
|
+
.stream('mngPrime')
|
|
513
|
+
.pipe(takeUntilDestroyed())
|
|
514
|
+
.subscribe(value => this.primengConfig.setTranslation(value));
|
|
515
|
+
}
|
|
516
|
+
initialize() {
|
|
517
|
+
this.logger.debug('Initialize');
|
|
581
518
|
}
|
|
582
519
|
// BREADCRUMB actions
|
|
583
520
|
findBreadcrumbItem(item) {
|
|
584
|
-
const items = this.
|
|
521
|
+
const items = this.breadcrumbs();
|
|
585
522
|
if (item.id) {
|
|
586
523
|
return items.find(i => i.id && i.id === item.id) ?? null;
|
|
587
524
|
}
|
|
@@ -601,7 +538,7 @@ class CommonsService {
|
|
|
601
538
|
return null;
|
|
602
539
|
}
|
|
603
540
|
updateBreadcrumbItem(item) {
|
|
604
|
-
const items = [...this.
|
|
541
|
+
const items = [...this.breadcrumbs()];
|
|
605
542
|
let posIdx = -1;
|
|
606
543
|
if (item.id) {
|
|
607
544
|
posIdx = items.findIndex(i => i.id && i.id === item.id);
|
|
@@ -627,7 +564,7 @@ class CommonsService {
|
|
|
627
564
|
...item,
|
|
628
565
|
updated: true
|
|
629
566
|
};
|
|
630
|
-
this.
|
|
567
|
+
this.breadcrumbs.set(items);
|
|
631
568
|
return true;
|
|
632
569
|
}
|
|
633
570
|
updateBreadcrumbs() {
|
|
@@ -643,13 +580,16 @@ class CommonsService {
|
|
|
643
580
|
const homeBreadcrumb = this.generateHomeBreadcrumb(rootRoute);
|
|
644
581
|
if (homeBreadcrumb) {
|
|
645
582
|
if (homeBreadcrumb.label) {
|
|
646
|
-
this.breadcrumbHomeTranslateSubscription = this.translate
|
|
583
|
+
this.breadcrumbHomeTranslateSubscription = this.translate
|
|
584
|
+
.get(homeBreadcrumb.label)
|
|
585
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
586
|
+
.subscribe(i18n => {
|
|
647
587
|
homeBreadcrumb.label = i18n;
|
|
648
|
-
this.
|
|
588
|
+
this.breadcrumbHome.set(homeBreadcrumb);
|
|
649
589
|
});
|
|
650
590
|
}
|
|
651
591
|
else {
|
|
652
|
-
this.
|
|
592
|
+
this.breadcrumbHome.set(homeBreadcrumb);
|
|
653
593
|
}
|
|
654
594
|
}
|
|
655
595
|
const breadcrumbs = [];
|
|
@@ -659,7 +599,10 @@ class CommonsService {
|
|
|
659
599
|
});
|
|
660
600
|
const i18nKeys = breadcrumbs.filter(b => typeof b.label === 'string').map(b => b.label);
|
|
661
601
|
if (i18nKeys.length > 0) {
|
|
662
|
-
this.breadcrumbsTranslateSubscription = this.translate
|
|
602
|
+
this.breadcrumbsTranslateSubscription = this.translate
|
|
603
|
+
.get(i18nKeys)
|
|
604
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
605
|
+
.subscribe(i18n => {
|
|
663
606
|
// Construct the breadcrumb hierarchy
|
|
664
607
|
breadcrumbs.forEach(b => {
|
|
665
608
|
if (b.label && i18n[b.label]) {
|
|
@@ -667,11 +610,11 @@ class CommonsService {
|
|
|
667
610
|
}
|
|
668
611
|
});
|
|
669
612
|
// Emit the new breadcrumbs
|
|
670
|
-
this.
|
|
613
|
+
this.breadcrumbs.set(breadcrumbs);
|
|
671
614
|
});
|
|
672
615
|
}
|
|
673
616
|
else {
|
|
674
|
-
this.
|
|
617
|
+
this.breadcrumbs.set(breadcrumbs);
|
|
675
618
|
}
|
|
676
619
|
}
|
|
677
620
|
generateHomeBreadcrumb(route) {
|
|
@@ -774,18 +717,18 @@ class CommonsService {
|
|
|
774
717
|
}
|
|
775
718
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsService, decorators: [{
|
|
776
719
|
type: Injectable
|
|
777
|
-
}] });
|
|
720
|
+
}], ctorParameters: () => [] });
|
|
778
721
|
|
|
779
722
|
class ErrorPageComponent {
|
|
780
723
|
constructor(commons) {
|
|
781
724
|
this.commons = commons;
|
|
782
725
|
}
|
|
783
726
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ErrorPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
784
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.
|
|
727
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
785
728
|
}
|
|
786
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ErrorPageComponent, decorators: [{
|
|
787
730
|
type: Component,
|
|
788
|
-
args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.
|
|
731
|
+
args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
|
|
789
732
|
}], ctorParameters: () => [{ type: CommonsService }] });
|
|
790
733
|
|
|
791
734
|
class NotFoundPageComponent {
|
|
@@ -793,11 +736,11 @@ class NotFoundPageComponent {
|
|
|
793
736
|
this.commons = commons;
|
|
794
737
|
}
|
|
795
738
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotFoundPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
796
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.
|
|
739
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
797
740
|
}
|
|
798
741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotFoundPageComponent, decorators: [{
|
|
799
742
|
type: Component,
|
|
800
|
-
args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.
|
|
743
|
+
args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
|
|
801
744
|
}], ctorParameters: () => [{ type: CommonsService }] });
|
|
802
745
|
|
|
803
746
|
class FilterMatchMode {
|
|
@@ -1334,36 +1277,33 @@ class DataProviderInst {
|
|
|
1334
1277
|
return true;
|
|
1335
1278
|
}
|
|
1336
1279
|
}
|
|
1280
|
+
|
|
1337
1281
|
class DataProvider extends DataProviderInst {
|
|
1338
1282
|
constructor() {
|
|
1339
1283
|
super(undefined, undefined);
|
|
1340
1284
|
}
|
|
1341
1285
|
static create() {
|
|
1342
|
-
return
|
|
1286
|
+
return dataProviderBase();
|
|
1343
1287
|
}
|
|
1344
1288
|
static fromClass(type) {
|
|
1345
|
-
return
|
|
1289
|
+
return dataProviderFromClass(type);
|
|
1346
1290
|
}
|
|
1347
1291
|
static fromClassWithService(type, serviceType) {
|
|
1348
|
-
return
|
|
1292
|
+
return dataProviderFromClass(type, serviceType);
|
|
1349
1293
|
}
|
|
1350
1294
|
static fromService(serviceType) {
|
|
1351
|
-
return
|
|
1352
|
-
}
|
|
1353
|
-
static fromAnyParam(type, serviceType) {
|
|
1354
|
-
if (typeof type !== 'undefined') {
|
|
1355
|
-
return typeof serviceType !== 'undefined'
|
|
1356
|
-
? DataProvider.fromClassWithService(type, serviceType)
|
|
1357
|
-
: DataProvider.fromClass(type);
|
|
1358
|
-
}
|
|
1359
|
-
else if (typeof serviceType !== 'undefined') {
|
|
1360
|
-
return DataProvider.fromService(serviceType);
|
|
1361
|
-
}
|
|
1362
|
-
else {
|
|
1363
|
-
return DataProvider.create();
|
|
1364
|
-
}
|
|
1295
|
+
return dataProviderWithService(serviceType);
|
|
1365
1296
|
}
|
|
1366
1297
|
}
|
|
1298
|
+
function dataProviderBase() {
|
|
1299
|
+
return new DataProviderInst(undefined, undefined);
|
|
1300
|
+
}
|
|
1301
|
+
function dataProviderWithService(serviceType) {
|
|
1302
|
+
return new DataProviderInst(undefined, serviceType);
|
|
1303
|
+
}
|
|
1304
|
+
function dataProviderFromClass(type, serviceType) {
|
|
1305
|
+
return new DataProviderInst(type, serviceType);
|
|
1306
|
+
}
|
|
1367
1307
|
|
|
1368
1308
|
class ComponentDirective {
|
|
1369
1309
|
constructor() {
|
|
@@ -1385,17 +1325,20 @@ class ComponentDirective {
|
|
|
1385
1325
|
if (!component) {
|
|
1386
1326
|
throw new CommonsInternalError(`Component cannot be created, no component (${this.component}) or no or invalid injection token provided (${this.componentIt}).`);
|
|
1387
1327
|
}
|
|
1328
|
+
const elementInjector = this.parentInjector ?? this.injector;
|
|
1329
|
+
const environmentInjector = elementInjector.get(EnvironmentInjector, null, { optional: true }) ?? this.applicationRef.injector;
|
|
1388
1330
|
if (this.attachToHost) {
|
|
1389
1331
|
this.componentRef = createComponent(component, {
|
|
1390
1332
|
hostElement: this.elementRef.nativeElement,
|
|
1391
|
-
environmentInjector:
|
|
1392
|
-
elementInjector:
|
|
1333
|
+
environmentInjector: environmentInjector,
|
|
1334
|
+
elementInjector: elementInjector
|
|
1393
1335
|
});
|
|
1394
1336
|
}
|
|
1395
1337
|
else {
|
|
1396
1338
|
this.viewContainerRef.clear();
|
|
1397
1339
|
this.componentRef = this.viewContainerRef.createComponent(component, {
|
|
1398
|
-
|
|
1340
|
+
environmentInjector: environmentInjector,
|
|
1341
|
+
injector: elementInjector
|
|
1399
1342
|
});
|
|
1400
1343
|
}
|
|
1401
1344
|
if (this.inputs) {
|
|
@@ -1409,7 +1352,7 @@ class ComponentDirective {
|
|
|
1409
1352
|
this.componentInstanceEventEmitter.next(this.componentRef.instance);
|
|
1410
1353
|
}
|
|
1411
1354
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1412
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost",
|
|
1355
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost", parentInjector: "parentInjector" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 }); }
|
|
1413
1356
|
}
|
|
1414
1357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ComponentDirective, decorators: [{
|
|
1415
1358
|
type: Directive,
|
|
@@ -1427,7 +1370,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1427
1370
|
type: Input
|
|
1428
1371
|
}], attachToHost: [{
|
|
1429
1372
|
type: Input
|
|
1430
|
-
}],
|
|
1373
|
+
}], parentInjector: [{
|
|
1431
1374
|
type: Input
|
|
1432
1375
|
}], componentInstanceEventEmitter: [{
|
|
1433
1376
|
type: Output,
|
|
@@ -2869,6 +2812,7 @@ class PermissionService {
|
|
|
2869
2812
|
this.injector = inject(Injector);
|
|
2870
2813
|
this.commons = inject(CommonsService);
|
|
2871
2814
|
this.logger = inject(LoggerService).create('AuthorizationService');
|
|
2815
|
+
this.userRoles$ = toObservable(this.commons.userRoles());
|
|
2872
2816
|
}
|
|
2873
2817
|
isPermitted(permissions, route, actionCtx) {
|
|
2874
2818
|
switch (permissions.authorizationType) {
|
|
@@ -2879,7 +2823,7 @@ class PermissionService {
|
|
|
2879
2823
|
case PermissionTypeEnum.Service:
|
|
2880
2824
|
return this.isPermittedService(permissions, route, actionCtx);
|
|
2881
2825
|
default:
|
|
2882
|
-
return this.
|
|
2826
|
+
return this.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
|
|
2883
2827
|
}
|
|
2884
2828
|
}
|
|
2885
2829
|
isPermittedAll(permission, route, actionCtx) {
|
|
@@ -3608,21 +3552,13 @@ class CommonsConfigurationService {
|
|
|
3608
3552
|
}
|
|
3609
3553
|
|
|
3610
3554
|
class CommonsRouterService {
|
|
3611
|
-
constructor(
|
|
3612
|
-
this.router =
|
|
3555
|
+
constructor() {
|
|
3556
|
+
this.router = inject(Router);
|
|
3613
3557
|
this.logger = inject(LoggerService).create('CommonsRouterService');
|
|
3614
3558
|
this.routesLoadedPropKey = '_loadedRoutes';
|
|
3615
3559
|
this.currentNavigationModuleKeys = [];
|
|
3616
3560
|
this.lazyLoadedRoutesConfig = {};
|
|
3617
|
-
|
|
3618
|
-
getRouteLoadedChildren(path) {
|
|
3619
|
-
return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutes;
|
|
3620
|
-
}
|
|
3621
|
-
getRouteLoadedChildren$(path) {
|
|
3622
|
-
return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutesSubject.asObservable().pipe(first());
|
|
3623
|
-
}
|
|
3624
|
-
initialize() {
|
|
3625
|
-
this.router.events.subscribe(event => {
|
|
3561
|
+
this.router.events.pipe(takeUntilDestroyed()).subscribe(event => {
|
|
3626
3562
|
if (event instanceof NavigationStart) {
|
|
3627
3563
|
this.startNavigation(event.url);
|
|
3628
3564
|
}
|
|
@@ -3637,6 +3573,15 @@ class CommonsRouterService {
|
|
|
3637
3573
|
}
|
|
3638
3574
|
});
|
|
3639
3575
|
}
|
|
3576
|
+
getRouteLoadedChildren(path) {
|
|
3577
|
+
return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutes;
|
|
3578
|
+
}
|
|
3579
|
+
getRouteLoadedChildren$(path) {
|
|
3580
|
+
return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutesSubject.asObservable().pipe(first());
|
|
3581
|
+
}
|
|
3582
|
+
initialize() {
|
|
3583
|
+
this.logger.debug('Initialized.');
|
|
3584
|
+
}
|
|
3640
3585
|
startNavigation(url) {
|
|
3641
3586
|
this.currentNavigationPath = url.split('?')[0].split('#')[0];
|
|
3642
3587
|
this.currentNavigationModuleKeys = [];
|
|
@@ -3773,12 +3718,12 @@ class CommonsRouterService {
|
|
|
3773
3718
|
getModulePathFromRouterLink(path) {
|
|
3774
3719
|
return ('/' + (Array.isArray(path) ? path.join('/') : path)).replace(/\/\//g, '/');
|
|
3775
3720
|
}
|
|
3776
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService, deps: [
|
|
3721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3777
3722
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService }); }
|
|
3778
3723
|
}
|
|
3779
3724
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService, decorators: [{
|
|
3780
3725
|
type: Injectable
|
|
3781
|
-
}], ctorParameters: () => [
|
|
3726
|
+
}], ctorParameters: () => [] });
|
|
3782
3727
|
|
|
3783
3728
|
var CommonsInitEventEnum;
|
|
3784
3729
|
(function (CommonsInitEventEnum) {
|
|
@@ -3863,7 +3808,7 @@ class CommonsInitService {
|
|
|
3863
3808
|
this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitEnd);
|
|
3864
3809
|
this.commonsInitServiceEvents.complete();
|
|
3865
3810
|
this.isInitializedSubject.next(true);
|
|
3866
|
-
return this.commons.
|
|
3811
|
+
return this.commons.initialize();
|
|
3867
3812
|
}), catchError(err => {
|
|
3868
3813
|
ctxLogger.warn('Commons initialization failed with error', err);
|
|
3869
3814
|
this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitError);
|
|
@@ -4003,5 +3948,5 @@ function provideCommons(config, ...features) {
|
|
|
4003
3948
|
* Generated bundle index. Do not edit.
|
|
4004
3949
|
*/
|
|
4005
3950
|
|
|
4006
|
-
export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, ComponentDirective, DataProvider, DataProviderInst, DialogKeydownHandlerDirective, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LocalStorageService, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getI18n, getI18nAsync, getI18nClassGroupKey, getI18nClassKeyBasePath, getI18nClassName, getI18nClassNameAsync, getI18nClassParams, getI18nClassParamsAsync, getI18nClassPropertyKey, getI18nClassTabKey, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
|
|
3951
|
+
export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, ComponentDirective, DataProvider, DataProviderInst, DialogKeydownHandlerDirective, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LocalStorageService, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dataProviderBase, dataProviderFromClass, dataProviderWithService, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getI18n, getI18nAsync, getI18nClassGroupKey, getI18nClassKeyBasePath, getI18nClassName, getI18nClassNameAsync, getI18nClassParams, getI18nClassParamsAsync, getI18nClassPropertyKey, getI18nClassTabKey, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
|
|
4007
3952
|
//# sourceMappingURL=mediusinc-mng-commons-core.mjs.map
|