@mediusinc/mng-commons 7.4.0 → 8.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -62
- package/fesm2022/mediusinc-mng-commons-core.mjs +159 -302
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -9
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +4 -4
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +285 -203
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +2 -5
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +1 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs → mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs} +14 -12
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs.map +1 -0
- package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs} +558 -522
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +10 -75
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +460 -326
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/i18n/en.json +1 -1
- package/i18n/sl.json +2 -2
- package/package.json +11 -24
- package/types/mediusinc-mng-commons-core.d.ts +55 -115
- package/types/mediusinc-mng-commons-filter.d.ts +4 -8
- package/types/mediusinc-mng-commons-form-api.d.ts +7 -7
- package/types/mediusinc-mng-commons-form.d.ts +11 -11
- package/types/mediusinc-mng-commons-table-api.d.ts +2 -2
- package/types/mediusinc-mng-commons-table.d.ts +21 -25
- package/types/mediusinc-mng-commons-tableview-api.d.ts +9 -51
- package/types/mediusinc-mng-commons-tableview.d.ts +9 -15
- package/fesm2022/mediusinc-mng-commons-model-class.mjs +0 -97
- package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs +0 -204
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs +0 -374
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +0 -1
- package/model/class/README.md +0 -8
- package/table/api/class/README.md +0 -10
- package/tableview/api/class/README.md +0 -13
- package/types/mediusinc-mng-commons-model-class.d.ts +0 -25
- package/types/mediusinc-mng-commons-table-api-class.d.ts +0 -77
- package/types/mediusinc-mng-commons-tableview-api-class.d.ts +0 -141
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, DestroyRef, signal, afterNextRender, Directive, computed,
|
|
2
|
+
import { inject, ElementRef, DestroyRef, signal, afterNextRender, Directive, computed, Component, effect, untracked, Injector, ApplicationRef, ViewContainerRef, input, booleanAttribute, output, EnvironmentInjector, createComponent, TemplateRef, Pipe, InjectionToken, Injectable, ErrorHandler, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { ConfirmDialog } from '
|
|
5
|
-
import { Dialog } from '
|
|
6
|
-
import { Toast } from '
|
|
4
|
+
import { ConfirmDialog } from '@openng/optimus-ui/confirmdialog';
|
|
5
|
+
import { Dialog } from '@openng/optimus-ui/dialog';
|
|
6
|
+
import { Toast } from '@openng/optimus-ui/toast';
|
|
7
7
|
import { HttpErrorResponse, HttpClient, HttpBackend } from '@angular/common/http';
|
|
8
8
|
import { DatePipe } from '@angular/common';
|
|
9
|
-
import {
|
|
9
|
+
import { isObservable, of, mergeMap, combineLatest, Observable, tap, ReplaySubject, Subject, take, throwError as throwError$1 } from 'rxjs';
|
|
10
10
|
import { map, filter, first, catchError } from 'rxjs/operators';
|
|
11
|
-
import 'reflect-metadata';
|
|
12
11
|
import { takeUntilDestroyed, toObservable as toObservable$1 } from '@angular/core/rxjs-interop';
|
|
13
12
|
import { Title } from '@angular/platform-browser';
|
|
14
13
|
import { Router, NavigationEnd, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
15
|
-
import { FilterService, FilterMatchMode as FilterMatchMode$1, MessageService, ConfirmationService } from '
|
|
16
|
-
import {
|
|
17
|
-
import { DialogService } from '
|
|
14
|
+
import { FilterService, FilterMatchMode as FilterMatchMode$1, MessageService, ConfirmationService } from '@openng/optimus-ui/api';
|
|
15
|
+
import { Optimus } from '@openng/optimus-ui/config';
|
|
16
|
+
import { DialogService } from '@openng/optimus-ui/dynamicdialog';
|
|
18
17
|
|
|
19
18
|
class OverflowDirective {
|
|
20
19
|
#elementRef;
|
|
@@ -23,7 +22,8 @@ class OverflowDirective {
|
|
|
23
22
|
constructor() {
|
|
24
23
|
this.#elementRef = inject(ElementRef);
|
|
25
24
|
this.#destroyRef = inject(DestroyRef);
|
|
26
|
-
this.isOverflowing = signal(false,
|
|
25
|
+
this.isOverflowing = signal(false, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "isOverflowing" }] : /* istanbul ignore next */ []));
|
|
27
27
|
this.#resizeObserver = new ResizeObserver(() => this.#updateOverflow());
|
|
28
28
|
afterNextRender(() => {
|
|
29
29
|
this.#updateOverflow();
|
|
@@ -35,10 +35,10 @@ class OverflowDirective {
|
|
|
35
35
|
const element = this.#elementRef.nativeElement;
|
|
36
36
|
this.isOverflowing.set(element.scrollHeight > element.clientHeight + 1);
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: OverflowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: OverflowDirective, isStandalone: true, selector: "[mngOverflow]", exportAs: ["mngOverflow"], ngImport: i0 }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: OverflowDirective, decorators: [{
|
|
42
42
|
type: Directive,
|
|
43
43
|
args: [{
|
|
44
44
|
selector: '[mngOverflow]',
|
|
@@ -48,9 +48,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
48
48
|
|
|
49
49
|
class NotificationWrapperComponent {
|
|
50
50
|
constructor() {
|
|
51
|
-
this.dialogNotification = signal(null,
|
|
52
|
-
|
|
53
|
-
this.
|
|
51
|
+
this.dialogNotification = signal(null, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "dialogNotification" }] : /* istanbul ignore next */ []));
|
|
53
|
+
this.isDialogNotificationVisible = computed(() => this.dialogNotification() !== null, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "isDialogNotificationVisible" }] : /* istanbul ignore next */ []));
|
|
55
|
+
this.dialogNotificationIconClass = computed(() => this.getMessageIcon(this.dialogNotification()), /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "dialogNotificationIconClass" }] : /* istanbul ignore next */ []));
|
|
54
57
|
}
|
|
55
58
|
getMessageIcon(message) {
|
|
56
59
|
if (message?.icon)
|
|
@@ -76,12 +79,12 @@ class NotificationWrapperComponent {
|
|
|
76
79
|
this.dialogNotification.set(null);
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
80
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
82
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
83
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.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 #message let-message>\n <i [class]=\"'pt-0.5 p-toast-message-icon pi ' + getMessageIcon(message)\" aria-hidden=\"true\"></i>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div #messageDetail=\"mngOverflow\" mngOverflow class=\"p-toast-detail line-clamp-2\">{{ message.detail }}</div>\n @if (messageDetail.isOverflowing()) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center cursor-pointer\">\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: Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "ariaLabelledBy", "appendTo", "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", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: OverflowDirective, selector: "[mngOverflow]", exportAs: ["mngOverflow"] }, { 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", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
81
84
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
|
|
83
86
|
type: Component,
|
|
84
|
-
args: [{ selector: 'mng-notification-wrapper', imports: [
|
|
87
|
+
args: [{ selector: 'mng-notification-wrapper', imports: [TranslatePipe, Dialog, Toast, OverflowDirective, ConfirmDialog], 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 <i [class]=\"'pt-0.5 p-toast-message-icon pi ' + getMessageIcon(message)\" aria-hidden=\"true\"></i>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div #messageDetail=\"mngOverflow\" mngOverflow class=\"p-toast-detail line-clamp-2\">{{ message.detail }}</div>\n @if (messageDetail.isOverflowing()) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"font-semibold text-sm mt-2 flex items-center cursor-pointer\">\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"] }]
|
|
85
88
|
}] });
|
|
86
89
|
|
|
87
90
|
class ACommonsErrorBase extends Error {
|
|
@@ -117,9 +120,9 @@ class CommonsHttpError extends ACommonsErrorBase {
|
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
+
const ngOptimusFormatSupported = [/d{1,2}/g, /E{1,5}/g, /c{1,5}/g, /M{1,5}/g, /L{1,5}/g, /y{1,4}/g, /Y{1,4}/g];
|
|
124
|
+
const ngOptimusFormatOther = [/G{1,5}/g, /w{1,2}/g, /W/g, /a{1,5}/g, /B{1,5}/g, /b{1,5}/g, /h{1,2}/g, /H{1,2}/g, /m{1,2}/g, /s{1,2}/g, /S{1,3}/g, /z{1,4}/g, /Z{1,5}/g, /O{1,4}/g];
|
|
125
|
+
const ngOptimusFormatMap = {
|
|
123
126
|
// days
|
|
124
127
|
d: 'd',
|
|
125
128
|
dd: 'dd',
|
|
@@ -210,24 +213,24 @@ function dateToIsoString(value, type = 'date-time', dateTimeOpts = {}) {
|
|
|
210
213
|
return base;
|
|
211
214
|
}
|
|
212
215
|
}
|
|
213
|
-
function
|
|
214
|
-
let
|
|
215
|
-
for (const regex of
|
|
216
|
-
|
|
216
|
+
function fromAngularDateFormatToOptimus(ngDateFormat) {
|
|
217
|
+
let optimusDateFormat = ngDateFormat;
|
|
218
|
+
for (const regex of ngOptimusFormatOther) {
|
|
219
|
+
optimusDateFormat = optimusDateFormat.replace(regex, ' ');
|
|
217
220
|
}
|
|
218
|
-
for (const regex of
|
|
219
|
-
const matches = [...
|
|
221
|
+
for (const regex of ngOptimusFormatSupported) {
|
|
222
|
+
const matches = [...optimusDateFormat.matchAll(regex)].reverse();
|
|
220
223
|
for (const match of matches) {
|
|
221
224
|
if (match.index) {
|
|
222
225
|
const matchStr = match[0];
|
|
223
|
-
const replacement =
|
|
224
|
-
|
|
226
|
+
const replacement = ngOptimusFormatMap[matchStr] ?? match[0];
|
|
227
|
+
optimusDateFormat = optimusDateFormat.substring(0, match.index) + replacement + optimusDateFormat.substring(match.index + matchStr.length);
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
+
optimusDateFormat = optimusDateFormat.replace(/\s+\W\s+/g, ' ');
|
|
232
|
+
optimusDateFormat = optimusDateFormat.replace(/\s\s+/g, ' ');
|
|
233
|
+
return optimusDateFormat.trim();
|
|
231
234
|
}
|
|
232
235
|
function angularDateFormatHasTime(ngDateFormat) {
|
|
233
236
|
return /[hHmsS]/.test(ngDateFormat);
|
|
@@ -425,6 +428,7 @@ function dataListParamsToUrlQuery(params, defaults = {
|
|
|
425
428
|
urlParams[offsetQpKey] = params.offset;
|
|
426
429
|
}
|
|
427
430
|
if (params.search && params.search !== defaults?.search) {
|
|
431
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
428
432
|
urlParams[searchQpKey] = `${params.searchCaseSensitive ? `cs:` : ''}${params.search}`;
|
|
429
433
|
}
|
|
430
434
|
if (params.sort && Array.isArray(params.sort) && params.sort.length > 0) {
|
|
@@ -577,6 +581,7 @@ function dataListParamsFilterToUrlQuery(paramFilter, allowNull = false) {
|
|
|
577
581
|
const disabledPrefix = paramFilter?.disabled ? 'd:' : '';
|
|
578
582
|
const noVal = paramFilter.matchMode === FilterMatchMode.Exists || paramFilter.matchMode === FilterMatchMode.DoesNotExist;
|
|
579
583
|
const urlValuePart = noVal ? '' : `:${dataListParamsFilterValueToUrlString(filterValueAsArray ?? paramFilter.value, allowNull)}`;
|
|
584
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
580
585
|
return `${disabledPrefix}${paramFilter.caseSensitive ? 'cs:' : paramFilter.caseSensitive === false ? 'ci:' : ''}${FilterMatchMode.getAbbreviation(matchMode) ?? matchMode}${urlValuePart}`;
|
|
581
586
|
}
|
|
582
587
|
/**
|
|
@@ -699,7 +704,7 @@ function fromUrlQueryToDataListParams(urlParams, opts) {
|
|
|
699
704
|
value = null;
|
|
700
705
|
}
|
|
701
706
|
if ((matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn || matchMode === FilterMatchMode.Between) && typeof value === 'string') {
|
|
702
|
-
let arrayVal
|
|
707
|
+
let arrayVal;
|
|
703
708
|
// these match modes expect array
|
|
704
709
|
if (value.indexOf('"') >= 0) {
|
|
705
710
|
const tokens = [];
|
|
@@ -879,7 +884,7 @@ function effectWithDeps(deps, fn, opts) {
|
|
|
879
884
|
untracked(() => {
|
|
880
885
|
fn(depsValues);
|
|
881
886
|
});
|
|
882
|
-
}, { ...(ngDevMode ? { debugName: "ref" } : {}), injector: opts?.injector });
|
|
887
|
+
}, { ...(ngDevMode ? { debugName: "ref" } : /* istanbul ignore next */ {}), injector: opts?.injector });
|
|
883
888
|
return ref;
|
|
884
889
|
}
|
|
885
890
|
|
|
@@ -889,11 +894,13 @@ class ComponentDirective {
|
|
|
889
894
|
this.elementRef = inject(ElementRef);
|
|
890
895
|
this.applicationRef = inject(ApplicationRef);
|
|
891
896
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
892
|
-
this.component = input(undefined, { ...(ngDevMode ? { debugName: "component" } : {}), alias: 'mngComponent' });
|
|
893
|
-
this.componentIt = input(undefined, { ...(ngDevMode ? { debugName: "componentIt" } : {}), alias: 'injectionToken' });
|
|
894
|
-
this.inputs = input(
|
|
895
|
-
|
|
896
|
-
this.
|
|
897
|
+
this.component = input(undefined, { ...(ngDevMode ? { debugName: "component" } : /* istanbul ignore next */ {}), alias: 'mngComponent' });
|
|
898
|
+
this.componentIt = input(undefined, { ...(ngDevMode ? { debugName: "componentIt" } : /* istanbul ignore next */ {}), alias: 'injectionToken' });
|
|
899
|
+
this.inputs = input(/* @ts-ignore */
|
|
900
|
+
...(ngDevMode ? [undefined, { debugName: "inputs" }] : /* istanbul ignore next */ []));
|
|
901
|
+
this.attachToHost = input(false, { ...(ngDevMode ? { debugName: "attachToHost" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
902
|
+
this.parentInjector = input(/* @ts-ignore */
|
|
903
|
+
...(ngDevMode ? [undefined, { debugName: "parentInjector" }] : /* istanbul ignore next */ []));
|
|
897
904
|
this.instanceCreated = output();
|
|
898
905
|
effectWithDeps([this.component, this.componentIt], ([componentInput, componentItInput]) => {
|
|
899
906
|
let component = componentInput;
|
|
@@ -934,10 +941,10 @@ class ComponentDirective {
|
|
|
934
941
|
}
|
|
935
942
|
});
|
|
936
943
|
}
|
|
937
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
938
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
945
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", 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 }); }
|
|
939
946
|
}
|
|
940
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ComponentDirective, decorators: [{
|
|
941
948
|
type: Directive,
|
|
942
949
|
args: [{
|
|
943
950
|
selector: '[mngComponent]'
|
|
@@ -948,16 +955,17 @@ class RerenderDirective {
|
|
|
948
955
|
constructor() {
|
|
949
956
|
this.templateRef = inject((TemplateRef));
|
|
950
957
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
951
|
-
this.mngRerender = input.required(
|
|
958
|
+
this.mngRerender = input.required(/* @ts-ignore */
|
|
959
|
+
...(ngDevMode ? [{ debugName: "mngRerender" }] : /* istanbul ignore next */ []));
|
|
952
960
|
effectWithDeps([this.mngRerender], () => {
|
|
953
961
|
this.viewContainerRef.clear();
|
|
954
962
|
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
955
963
|
});
|
|
956
964
|
}
|
|
957
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
958
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
965
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RerenderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
966
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: RerenderDirective, isStandalone: true, selector: "[mngRerender]", inputs: { mngRerender: { classPropertyName: "mngRerender", publicName: "mngRerender", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
959
967
|
}
|
|
960
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RerenderDirective, decorators: [{
|
|
961
969
|
type: Directive,
|
|
962
970
|
args: [{
|
|
963
971
|
selector: '[mngRerender]'
|
|
@@ -968,10 +976,10 @@ class TemplateDirective {
|
|
|
968
976
|
constructor() {
|
|
969
977
|
this.template = inject((TemplateRef));
|
|
970
978
|
}
|
|
971
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
972
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
979
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
980
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: TemplateDirective, isStandalone: true, ngImport: i0 }); }
|
|
973
981
|
}
|
|
974
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TemplateDirective, decorators: [{
|
|
975
983
|
type: Directive
|
|
976
984
|
}] });
|
|
977
985
|
|
|
@@ -1022,6 +1030,7 @@ function getEnumConstantValuesAsNumber(enumType) {
|
|
|
1022
1030
|
* @param titlePath Base path for title to use as translation (optional).
|
|
1023
1031
|
*/
|
|
1024
1032
|
function fromEnumConstantsAsValueArray(enumType, nameAsValue = false, titlePath) {
|
|
1033
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
1025
1034
|
return getEnumConstantNames(enumType).map(n => ({ name: n, title: `${titlePath ? `${titlePath}.` : ''}${n}`, value: nameAsValue ? n : enumType[n] }));
|
|
1026
1035
|
}
|
|
1027
1036
|
/**
|
|
@@ -1034,6 +1043,7 @@ function fromEnumConstantsAsValueArray(enumType, nameAsValue = false, titlePath)
|
|
|
1034
1043
|
function fromEnumValuesAsValueArray(enumType, values, nameAsValue = false, titlePath) {
|
|
1035
1044
|
return values.map(v => {
|
|
1036
1045
|
const k = getEnumConstantName(enumType, v);
|
|
1046
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
1037
1047
|
return { name: k, title: `${titlePath ? `${titlePath}.` : ''}${k}`, value: nameAsValue ? k : v };
|
|
1038
1048
|
});
|
|
1039
1049
|
}
|
|
@@ -1551,6 +1561,7 @@ function getErrorName(error) {
|
|
|
1551
1561
|
function httpErrorResponseToString(error, opts) {
|
|
1552
1562
|
let str = opts?.hideMessage ? '' : `${error.message}\n`; // message should already include url, status, etc.
|
|
1553
1563
|
if (!opts?.hideHeaders) {
|
|
1564
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
1554
1565
|
str += `Http Response Headers: ${error.headers.keys().reduce((acc, key) => `${acc}[${key}: ${error.headers.get(key)}]`, '')}`;
|
|
1555
1566
|
}
|
|
1556
1567
|
if (!opts?.hideBody) {
|
|
@@ -1610,9 +1621,11 @@ function errorToString(error, opts) {
|
|
|
1610
1621
|
function commonsErrorToString(error, opts) {
|
|
1611
1622
|
const strBlocks = [];
|
|
1612
1623
|
if (!opts?.hideMessage) {
|
|
1624
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
1613
1625
|
strBlocks.push(`${error.message}${error.messageCode ? ` (code: ${error.messageCode})` : ''}`);
|
|
1614
1626
|
}
|
|
1615
1627
|
if (!opts?.hideName) {
|
|
1628
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
1616
1629
|
strBlocks.push(`Error name: ${error.name ?? error.type} ${error.name ? `(${error.type})` : ''}`);
|
|
1617
1630
|
}
|
|
1618
1631
|
if (!opts?.hideLocation && error.location) {
|
|
@@ -1700,6 +1713,7 @@ function errorCauseToString(error, opts) {
|
|
|
1700
1713
|
const needsStringify = opts?.causeAsJson || !(error.cause instanceof Error);
|
|
1701
1714
|
if (!opts?.causeOnErrorOnly || error.cause instanceof Error) {
|
|
1702
1715
|
return ('Caused by: ' +
|
|
1716
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional,sonarjs/no-nested-template-literals
|
|
1703
1717
|
(needsStringify ? stringify(error.cause) : `${error.cause.message}${error.cause.name ? ` (${error.cause.name})` : ''}`));
|
|
1704
1718
|
}
|
|
1705
1719
|
}
|
|
@@ -1742,6 +1756,7 @@ class CommonsErrorHandler {
|
|
|
1742
1756
|
}
|
|
1743
1757
|
|
|
1744
1758
|
function booleanOrUndefinedAttribute(value) {
|
|
1759
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
1745
1760
|
return typeof value === 'boolean' ? value : value == null ? undefined : value !== 'false';
|
|
1746
1761
|
}
|
|
1747
1762
|
/**
|
|
@@ -1751,6 +1766,7 @@ function booleanOrUndefinedAttribute(value) {
|
|
|
1751
1766
|
* @param fallback Fallback (or default) value.
|
|
1752
1767
|
*/
|
|
1753
1768
|
function booleanWithDefaultAttribute(value, fallback = false) {
|
|
1769
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
1754
1770
|
return typeof value === 'boolean' ? value : value !== 'false' && value !== 'true' ? fallback : value !== 'false';
|
|
1755
1771
|
}
|
|
1756
1772
|
const toObservable = (value) => {
|
|
@@ -1796,7 +1812,7 @@ const valueToDefined = (value) => {
|
|
|
1796
1812
|
}
|
|
1797
1813
|
};
|
|
1798
1814
|
|
|
1799
|
-
function
|
|
1815
|
+
function narrowOptimusMessageSeverity(s) {
|
|
1800
1816
|
switch (s) {
|
|
1801
1817
|
case 'success':
|
|
1802
1818
|
case 'info':
|
|
@@ -1831,7 +1847,7 @@ function isMac() {
|
|
|
1831
1847
|
function toastMessage(message, severity = 'success', opts) {
|
|
1832
1848
|
switch (severity) {
|
|
1833
1849
|
case 'warning':
|
|
1834
|
-
//
|
|
1850
|
+
// Optimus UI does not support 'warning', must be 'warn'
|
|
1835
1851
|
severity = 'warn';
|
|
1836
1852
|
break;
|
|
1837
1853
|
}
|
|
@@ -1848,6 +1864,7 @@ function fromAngularNumberFormatToFractions(format) {
|
|
|
1848
1864
|
let int = hasDot || (!hasDot && !hasDash) ? +intPart : 1;
|
|
1849
1865
|
if (!int || isNaN(int))
|
|
1850
1866
|
int = 1;
|
|
1867
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
1851
1868
|
let [fractionsMin, fractionsMax] = !hasDot && !hasDash ? [0, 0] : (hasDot ? decPart : intPart).split('-').map(f => +f);
|
|
1852
1869
|
if (isNaN(fractionsMin))
|
|
1853
1870
|
fractionsMin = 0;
|
|
@@ -2004,6 +2021,7 @@ function getI18nTypePropertyKey(typeName, property) {
|
|
|
2004
2021
|
return getI18nTypeKeyBasePath(typeName, 'properties', property);
|
|
2005
2022
|
}
|
|
2006
2023
|
function getI18nTypeKeyBasePath(typeName, ...path) {
|
|
2024
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
2007
2025
|
return `${typeName.length ? `${typeName}.` : ''}${path.join('.')}`;
|
|
2008
2026
|
}
|
|
2009
2027
|
function getI18nTypeParams(translate, typeName, item, params = {}) {
|
|
@@ -2025,6 +2043,7 @@ function getI18nTypeNameKeys(typeName, singular) {
|
|
|
2025
2043
|
if (typeof singular !== 'undefined') {
|
|
2026
2044
|
keys.push(singular ? `${typeName}.nameSingular` : `${typeName}.namePlural`);
|
|
2027
2045
|
}
|
|
2046
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
2028
2047
|
keys.push(`${typeName.length ? `${typeName}.` : ''}name`);
|
|
2029
2048
|
return keys;
|
|
2030
2049
|
}
|
|
@@ -2036,6 +2055,7 @@ class LogPublisherConsoleService {
|
|
|
2036
2055
|
if (entry.category)
|
|
2037
2056
|
prefix += ` [${entry.category}]`;
|
|
2038
2057
|
prefix += ':';
|
|
2058
|
+
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
2039
2059
|
const message = `${entry.message}${entry.messageDetails ? `\n${entry.messageDetails}` : ''}`;
|
|
2040
2060
|
const logParams = [prefix, message];
|
|
2041
2061
|
if (entry.error) {
|
|
@@ -2087,10 +2107,10 @@ class BooleanPipe {
|
|
|
2087
2107
|
return value;
|
|
2088
2108
|
}
|
|
2089
2109
|
}
|
|
2090
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2091
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2111
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: BooleanPipe, isStandalone: true, name: "mngBoolean" }); }
|
|
2092
2112
|
}
|
|
2093
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BooleanPipe, decorators: [{
|
|
2094
2114
|
type: Pipe,
|
|
2095
2115
|
args: [{
|
|
2096
2116
|
name: 'mngBoolean',
|
|
@@ -2107,10 +2127,10 @@ class ClassMapPipe {
|
|
|
2107
2127
|
return className ?? '';
|
|
2108
2128
|
}
|
|
2109
2129
|
}
|
|
2110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2111
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2131
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: ClassMapPipe, isStandalone: true, name: "mngClassMap" }); }
|
|
2112
2132
|
}
|
|
2113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ClassMapPipe, decorators: [{
|
|
2114
2134
|
type: Pipe,
|
|
2115
2135
|
args: [{
|
|
2116
2136
|
name: 'mngClassMap',
|
|
@@ -2118,66 +2138,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
2118
2138
|
}]
|
|
2119
2139
|
}] });
|
|
2120
2140
|
|
|
2121
|
-
const reflectTypeNameKey = 'typeName';
|
|
2122
|
-
const reflectEnumNameKey = 'enumName';
|
|
2123
|
-
/**
|
|
2124
|
-
* Defines type name decorator.
|
|
2125
|
-
* @param targetType class.
|
|
2126
|
-
* @param typeName Name of the type.
|
|
2127
|
-
*/
|
|
2128
|
-
function defineReflectTypeName(targetType, typeName) {
|
|
2129
|
-
if (!Reflect.hasOwnMetadata(reflectTypeNameKey, targetType)) {
|
|
2130
|
-
Reflect.defineMetadata(reflectTypeNameKey, typeName, targetType);
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
/**
|
|
2134
|
-
* Defines enum name decorator.
|
|
2135
|
-
* @param targetType enum object.
|
|
2136
|
-
* @param enumName Name of the enum.
|
|
2137
|
-
*/
|
|
2138
|
-
function defineReflectEnumName(targetType, enumName) {
|
|
2139
|
-
if (!Reflect.hasOwnMetadata(reflectEnumNameKey, targetType)) {
|
|
2140
|
-
Reflect.defineMetadata(reflectEnumNameKey, enumName, targetType);
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
* Gets type name from reflect metadata.
|
|
2145
|
-
* @param type Class.
|
|
2146
|
-
*/
|
|
2147
|
-
function findReflectTypeName(type) {
|
|
2148
|
-
if (!type) {
|
|
2149
|
-
return null;
|
|
2150
|
-
}
|
|
2151
|
-
const typeName = Reflect.getMetadata(reflectTypeNameKey, type);
|
|
2152
|
-
if (typeName) {
|
|
2153
|
-
return typeName;
|
|
2154
|
-
}
|
|
2155
|
-
LoggerService.get().debug('WARNING: Reflect metadata could not be found for type, you might experience some issues in production build.', type?.name);
|
|
2156
|
-
return type.name;
|
|
2157
|
-
}
|
|
2158
|
-
/**
|
|
2159
|
-
* Gets type name from either decorator or reflect metadata.
|
|
2160
|
-
* @param type Class.
|
|
2161
|
-
*/
|
|
2162
|
-
function reflectTypeNameExists(type) {
|
|
2163
|
-
return Reflect.hasOwnMetadata(reflectTypeNameKey, type);
|
|
2164
|
-
}
|
|
2165
|
-
/**
|
|
2166
|
-
* Gets enum name from either decorator or reflect metadata.
|
|
2167
|
-
* @param enumType Class.
|
|
2168
|
-
*/
|
|
2169
|
-
function findReflectEnumName(enumType) {
|
|
2170
|
-
const enumName = Reflect.getMetadata(reflectEnumNameKey, enumType);
|
|
2171
|
-
if (enumName) {
|
|
2172
|
-
return enumName;
|
|
2173
|
-
}
|
|
2174
|
-
LoggerService.get().debug(`WARNING: Reflect metadata could not be found for enum ${typeof enumType === 'object' ? Object.keys(enumType) : enumType}`, {
|
|
2175
|
-
name: 'TypeUtilsError',
|
|
2176
|
-
enumType: enumType
|
|
2177
|
-
});
|
|
2178
|
-
return null;
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
2141
|
class EnumPipe {
|
|
2182
2142
|
transform(value, enumDesc, i18nPath) {
|
|
2183
2143
|
if (value == null || (typeof value !== 'number' && typeof value !== 'string') || !enumDesc) {
|
|
@@ -2196,14 +2156,14 @@ class EnumPipe {
|
|
|
2196
2156
|
}
|
|
2197
2157
|
}
|
|
2198
2158
|
if (typeof i18nPath === 'undefined' && enumDesc) {
|
|
2199
|
-
i18nPath = enumDesc.i18nBaseKey
|
|
2159
|
+
i18nPath = enumDesc.i18nBaseKey;
|
|
2200
2160
|
}
|
|
2201
2161
|
return i18nPath ? `${i18nPath}.${enumValue}` : enumValue;
|
|
2202
2162
|
}
|
|
2203
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2204
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2164
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: EnumPipe, isStandalone: true, name: "mngEnum" }); }
|
|
2205
2165
|
}
|
|
2206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumPipe, decorators: [{
|
|
2207
2167
|
type: Pipe,
|
|
2208
2168
|
args: [{
|
|
2209
2169
|
name: 'mngEnum',
|
|
@@ -2221,10 +2181,10 @@ class JsonPathPipe {
|
|
|
2221
2181
|
transform(value, path = '') {
|
|
2222
2182
|
return getObjectPropertyByPath(value, path);
|
|
2223
2183
|
}
|
|
2224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2225
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: JsonPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2185
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: JsonPathPipe, isStandalone: true, name: "mngJsonPath" }); }
|
|
2226
2186
|
}
|
|
2227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: JsonPathPipe, decorators: [{
|
|
2228
2188
|
type: Pipe,
|
|
2229
2189
|
args: [{
|
|
2230
2190
|
name: 'mngJsonPath',
|
|
@@ -2250,10 +2210,10 @@ class EnumeratePipe {
|
|
|
2250
2210
|
})
|
|
2251
2211
|
.join(valueSeparator);
|
|
2252
2212
|
}
|
|
2253
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2254
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2213
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumeratePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2214
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: EnumeratePipe, isStandalone: true, name: "mngEnumerate" }); }
|
|
2255
2215
|
}
|
|
2256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumeratePipe, decorators: [{
|
|
2257
2217
|
type: Pipe,
|
|
2258
2218
|
args: [{
|
|
2259
2219
|
name: 'mngEnumerate',
|
|
@@ -2294,10 +2254,10 @@ class EnumerateAsyncPipe {
|
|
|
2294
2254
|
}))));
|
|
2295
2255
|
}), map(i => i.join(valueSeparator)));
|
|
2296
2256
|
}
|
|
2297
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2298
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2257
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumerateAsyncPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2258
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: EnumerateAsyncPipe, isStandalone: true, name: "mngEnumerateAsync" }); }
|
|
2299
2259
|
}
|
|
2300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: EnumerateAsyncPipe, decorators: [{
|
|
2301
2261
|
type: Pipe,
|
|
2302
2262
|
args: [{
|
|
2303
2263
|
name: 'mngEnumerateAsync',
|
|
@@ -2312,10 +2272,10 @@ class GetterPipe {
|
|
|
2312
2272
|
}
|
|
2313
2273
|
return value;
|
|
2314
2274
|
}
|
|
2315
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2316
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: GetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2276
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: GetterPipe, isStandalone: true, name: "mngGetter" }); }
|
|
2317
2277
|
}
|
|
2318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: GetterPipe, decorators: [{
|
|
2319
2279
|
type: Pipe,
|
|
2320
2280
|
args: [{
|
|
2321
2281
|
name: 'mngGetter',
|
|
@@ -2327,10 +2287,10 @@ class I18nPropertyPipe {
|
|
|
2327
2287
|
transform(property, model) {
|
|
2328
2288
|
return getI18nTypePropertyKey(model.i18nBaseKey, property);
|
|
2329
2289
|
}
|
|
2330
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2331
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2290
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: I18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2291
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: I18nPropertyPipe, isStandalone: true, name: "mngI18nProperty" }); }
|
|
2332
2292
|
}
|
|
2333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: I18nPropertyPipe, decorators: [{
|
|
2334
2294
|
type: Pipe,
|
|
2335
2295
|
args: [{
|
|
2336
2296
|
name: 'mngI18nProperty',
|
|
@@ -2408,10 +2368,10 @@ class ParametrizePipe {
|
|
|
2408
2368
|
parametrizeString(s, params) {
|
|
2409
2369
|
return s.replace(/{{\s?([^{}\s]*)\s?}}/g, (subs, key) => this.jsonPath.transform(params, key) ?? subs);
|
|
2410
2370
|
}
|
|
2411
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2412
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2371
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ParametrizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2372
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: ParametrizePipe, isStandalone: true, name: "mngParametrize" }); }
|
|
2413
2373
|
}
|
|
2414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ParametrizePipe, decorators: [{
|
|
2415
2375
|
type: Pipe,
|
|
2416
2376
|
args: [{
|
|
2417
2377
|
name: 'mngParametrize',
|
|
@@ -2429,10 +2389,10 @@ class TemplatePipe {
|
|
|
2429
2389
|
}
|
|
2430
2390
|
return value;
|
|
2431
2391
|
}
|
|
2432
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2433
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
2392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TemplatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2393
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: TemplatePipe, isStandalone: true, name: "template" }); }
|
|
2434
2394
|
}
|
|
2435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TemplatePipe, decorators: [{
|
|
2436
2396
|
type: Pipe,
|
|
2437
2397
|
args: [{
|
|
2438
2398
|
name: 'template',
|
|
@@ -2440,126 +2400,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
2440
2400
|
}]
|
|
2441
2401
|
}] });
|
|
2442
2402
|
|
|
2443
|
-
function TypeName(typeName) {
|
|
2444
|
-
return function (target) {
|
|
2445
|
-
defineReflectTypeName(target, typeName);
|
|
2446
|
-
};
|
|
2447
|
-
}
|
|
2448
|
-
function EnumName(typeName) {
|
|
2449
|
-
return function (target) {
|
|
2450
|
-
defineReflectEnumName(target, typeName);
|
|
2451
|
-
};
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
class TypeRegistry {
|
|
2455
|
-
constructor() {
|
|
2456
|
-
this._logCategory = 'TypeRegistry';
|
|
2457
|
-
this._typeMap = {};
|
|
2458
|
-
this._enumMap = {};
|
|
2459
|
-
}
|
|
2460
|
-
static { this._instance = new TypeRegistry(); }
|
|
2461
|
-
get typeMap() {
|
|
2462
|
-
return this._typeMap;
|
|
2463
|
-
}
|
|
2464
|
-
get enumMap() {
|
|
2465
|
-
return this._enumMap;
|
|
2466
|
-
}
|
|
2467
|
-
/**
|
|
2468
|
-
* Only use one instance of object (out of Angular context)
|
|
2469
|
-
*/
|
|
2470
|
-
static get() {
|
|
2471
|
-
return TypeRegistry._instance;
|
|
2472
|
-
}
|
|
2473
|
-
findAttributeDefinitionByClassType(type, attributeName) {
|
|
2474
|
-
const typeName = findReflectTypeName(type);
|
|
2475
|
-
return typeName ? this.findAttributeDefinition(typeName, attributeName) : null;
|
|
2476
|
-
}
|
|
2477
|
-
findAttributeDefinition(typeName, attributeName) {
|
|
2478
|
-
const attributeDefs = this.findAttributesDefinition(typeName);
|
|
2479
|
-
if (!attributeDefs) {
|
|
2480
|
-
return null;
|
|
2481
|
-
}
|
|
2482
|
-
for (const attribute of attributeDefs) {
|
|
2483
|
-
if (attribute.name === attributeName) {
|
|
2484
|
-
return attribute;
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
return null;
|
|
2488
|
-
}
|
|
2489
|
-
findAttributesDefinitionByClassType(type) {
|
|
2490
|
-
const typeName = findReflectTypeName(type);
|
|
2491
|
-
return typeName ? this.findAttributesDefinition(typeName) : null;
|
|
2492
|
-
}
|
|
2493
|
-
findAttributesDefinition(typeName) {
|
|
2494
|
-
const typeDef = this.findType(typeName);
|
|
2495
|
-
if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
|
|
2496
|
-
return null;
|
|
2497
|
-
}
|
|
2498
|
-
return typeDef.getAttributeTypeMap();
|
|
2499
|
-
}
|
|
2500
|
-
findByClassType(type) {
|
|
2501
|
-
const typeName = findReflectTypeName(type);
|
|
2502
|
-
return typeName ? this.findType(typeName) : null;
|
|
2503
|
-
}
|
|
2504
|
-
findType(typeName) {
|
|
2505
|
-
return this._typeMap[typeName];
|
|
2506
|
-
}
|
|
2507
|
-
findEnum(enumName) {
|
|
2508
|
-
return this._enumMap[enumName];
|
|
2509
|
-
}
|
|
2510
|
-
registerTypes(types) {
|
|
2511
|
-
for (const key in types) {
|
|
2512
|
-
this.registerType(types[key], key);
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
registerType(type, optTypeName) {
|
|
2516
|
-
// try to find name from metadata
|
|
2517
|
-
let typeName;
|
|
2518
|
-
if (reflectTypeNameExists(type)) {
|
|
2519
|
-
// defined name from optional type name
|
|
2520
|
-
typeName = findReflectTypeName(type) ?? undefined;
|
|
2521
|
-
}
|
|
2522
|
-
else if (optTypeName) {
|
|
2523
|
-
typeName = optTypeName;
|
|
2524
|
-
// register metadata
|
|
2525
|
-
defineReflectTypeName(type, typeName);
|
|
2526
|
-
}
|
|
2527
|
-
if (!typeName) {
|
|
2528
|
-
// this._logger.debug(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
|
|
2529
|
-
LoggerService.get().log(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`, LogLevelEnum.Debug, this._logCategory);
|
|
2530
|
-
return;
|
|
2531
|
-
}
|
|
2532
|
-
if (typeof this._typeMap[typeName] !== 'undefined') {
|
|
2533
|
-
// this._logger.debug(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
|
|
2534
|
-
LoggerService.get().log(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`, LogLevelEnum.Debug, this._logCategory);
|
|
2535
|
-
}
|
|
2536
|
-
else {
|
|
2537
|
-
this._typeMap[typeName] = type;
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
clearTypes() {
|
|
2541
|
-
Object.keys(this._typeMap).forEach(key => delete this._typeMap[key]);
|
|
2542
|
-
}
|
|
2543
|
-
registerEnums(enums) {
|
|
2544
|
-
for (const key in enums) {
|
|
2545
|
-
this.registerEnum(enums[key], key);
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
registerEnum(enumType, enumName) {
|
|
2549
|
-
// try to find name from decorator
|
|
2550
|
-
defineReflectEnumName(enumType, enumName);
|
|
2551
|
-
if (typeof this._enumMap[enumName] !== 'undefined') {
|
|
2552
|
-
LoggerService.get().log(`Registering enum ${enumName} skipped, because enum already exists.`, LogLevelEnum.Debug, this._logCategory);
|
|
2553
|
-
}
|
|
2554
|
-
else {
|
|
2555
|
-
this._enumMap[enumName] = enumType;
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
clearEnums() {
|
|
2559
|
-
Object.keys(this._enumMap).forEach(key => delete this._enumMap[key]);
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2563
2403
|
const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
|
|
2564
2404
|
|
|
2565
2405
|
const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
|
|
@@ -2618,7 +2458,7 @@ class CommonsService {
|
|
|
2618
2458
|
// internal
|
|
2619
2459
|
this.logger = inject(LoggerService).create('CommonsService');
|
|
2620
2460
|
this.router = inject(Router);
|
|
2621
|
-
this.
|
|
2461
|
+
this.optimusConfig = inject(Optimus);
|
|
2622
2462
|
this.translate = inject(TranslateService);
|
|
2623
2463
|
this.titleService = inject(Title);
|
|
2624
2464
|
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
@@ -2629,21 +2469,34 @@ class CommonsService {
|
|
|
2629
2469
|
this.breadcrumbHome = signal({
|
|
2630
2470
|
icon: 'pi pi-home',
|
|
2631
2471
|
routerLink: '/'
|
|
2632
|
-
},
|
|
2633
|
-
|
|
2472
|
+
}, /* @ts-ignore */
|
|
2473
|
+
...(ngDevMode ? [{ debugName: "breadcrumbHome" }] : /* istanbul ignore next */ []));
|
|
2474
|
+
this.breadcrumbs = signal([], /* @ts-ignore */
|
|
2475
|
+
...(ngDevMode ? [{ debugName: "breadcrumbs" }] : /* istanbul ignore next */ []));
|
|
2634
2476
|
// user
|
|
2635
|
-
this.user = signal(undefined,
|
|
2636
|
-
|
|
2477
|
+
this.user = signal(undefined, /* @ts-ignore */
|
|
2478
|
+
...(ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []));
|
|
2479
|
+
this.userRoles = signal([], /* @ts-ignore */
|
|
2480
|
+
...(ngDevMode ? [{ debugName: "userRoles" }] : /* istanbul ignore next */ []));
|
|
2637
2481
|
// APP section
|
|
2638
|
-
this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name',
|
|
2639
|
-
|
|
2640
|
-
this.
|
|
2641
|
-
|
|
2642
|
-
this.
|
|
2643
|
-
|
|
2644
|
-
this.
|
|
2645
|
-
|
|
2646
|
-
this.
|
|
2482
|
+
this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name', /* @ts-ignore */
|
|
2483
|
+
...(ngDevMode ? [{ debugName: "appName" }] : /* istanbul ignore next */ []));
|
|
2484
|
+
this.appOwner = signal(this.moduleConfig?.app?.owner ?? 'app.owner', /* @ts-ignore */
|
|
2485
|
+
...(ngDevMode ? [{ debugName: "appOwner" }] : /* istanbul ignore next */ []));
|
|
2486
|
+
this.appLocales = signal(this.moduleConfig?.app?.locales ?? ['en'], /* @ts-ignore */
|
|
2487
|
+
...(ngDevMode ? [{ debugName: "appLocales" }] : /* istanbul ignore next */ []));
|
|
2488
|
+
this._appLocale = signal(this.initAppLocale(), /* @ts-ignore */
|
|
2489
|
+
...(ngDevMode ? [{ debugName: "_appLocale" }] : /* istanbul ignore next */ []));
|
|
2490
|
+
this.appLocale = computed(() => this._appLocale(), /* @ts-ignore */
|
|
2491
|
+
...(ngDevMode ? [{ debugName: "appLocale" }] : /* istanbul ignore next */ []));
|
|
2492
|
+
this.appDataLocales = signal(this.moduleConfig?.app?.dataLocales ?? ['en'], /* @ts-ignore */
|
|
2493
|
+
...(ngDevMode ? [{ debugName: "appDataLocales" }] : /* istanbul ignore next */ []));
|
|
2494
|
+
this._appDataLocale = signal(this.initAppDataLocale(), /* @ts-ignore */
|
|
2495
|
+
...(ngDevMode ? [{ debugName: "_appDataLocale" }] : /* istanbul ignore next */ []));
|
|
2496
|
+
this.appDataLocale = computed(() => this._appDataLocale(), /* @ts-ignore */
|
|
2497
|
+
...(ngDevMode ? [{ debugName: "appDataLocale" }] : /* istanbul ignore next */ []));
|
|
2498
|
+
this.appVersion = signal(this.moduleConfig?.app?.version, /* @ts-ignore */
|
|
2499
|
+
...(ngDevMode ? [{ debugName: "appVersion" }] : /* istanbul ignore next */ []));
|
|
2647
2500
|
effectWithDeps([this.appLocales, this.appDataLocales], ([appLocales, appDataLocales]) => {
|
|
2648
2501
|
if (appLocales) {
|
|
2649
2502
|
this.setAppLocale(this.initAppLocale());
|
|
@@ -2666,9 +2519,9 @@ class CommonsService {
|
|
|
2666
2519
|
this.setPageTitle();
|
|
2667
2520
|
});
|
|
2668
2521
|
this.translate
|
|
2669
|
-
.stream('
|
|
2522
|
+
.stream('optimus')
|
|
2670
2523
|
.pipe(takeUntilDestroyed())
|
|
2671
|
-
.subscribe((value) => this.
|
|
2524
|
+
.subscribe((value) => this.optimusConfig.setTranslation(value));
|
|
2672
2525
|
this.#registerCustomFilters(this.#filterService);
|
|
2673
2526
|
}
|
|
2674
2527
|
initialize() {
|
|
@@ -2685,12 +2538,15 @@ class CommonsService {
|
|
|
2685
2538
|
return items.find(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr) ?? null;
|
|
2686
2539
|
}
|
|
2687
2540
|
else if (item.positionIndex) {
|
|
2541
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2688
2542
|
return items.find(i => i.positionIndex && i.positionIndex === i.positionIndex) ?? null;
|
|
2689
2543
|
}
|
|
2690
2544
|
else if (item.label) {
|
|
2545
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2691
2546
|
return items.find(i => i.label && i.label === i.label) ?? null;
|
|
2692
2547
|
}
|
|
2693
2548
|
else if (item.icon) {
|
|
2549
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2694
2550
|
return items.find(i => i.icon && i.icon === i.icon) ?? null;
|
|
2695
2551
|
}
|
|
2696
2552
|
return null;
|
|
@@ -2706,12 +2562,15 @@ class CommonsService {
|
|
|
2706
2562
|
posIdx = items.findIndex(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr);
|
|
2707
2563
|
}
|
|
2708
2564
|
else if (item.positionIndex) {
|
|
2565
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2709
2566
|
posIdx = items.findIndex(i => i.positionIndex && i.positionIndex === i.positionIndex);
|
|
2710
2567
|
}
|
|
2711
2568
|
else if (item.label) {
|
|
2569
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2712
2570
|
posIdx = items.findIndex(i => i.label && i.label === i.label);
|
|
2713
2571
|
}
|
|
2714
2572
|
else if (item.icon) {
|
|
2573
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
2715
2574
|
posIdx = items.findIndex(i => i.icon && i.icon === i.icon);
|
|
2716
2575
|
}
|
|
2717
2576
|
if (posIdx < 0) {
|
|
@@ -2892,10 +2751,10 @@ class CommonsService {
|
|
|
2892
2751
|
filterService.register(FilterMatchMode.GreaterThan, filterService.filters[FilterMatchMode$1.GREATER_THAN]);
|
|
2893
2752
|
filterService.register(FilterMatchMode.GreaterThanOrEqualTo, filterService.filters[FilterMatchMode$1.GREATER_THAN_OR_EQUAL_TO]);
|
|
2894
2753
|
}
|
|
2895
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2896
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2754
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2755
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsService }); }
|
|
2897
2756
|
}
|
|
2898
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsService, decorators: [{
|
|
2899
2758
|
type: Injectable
|
|
2900
2759
|
}], ctorParameters: () => [] });
|
|
2901
2760
|
|
|
@@ -3089,10 +2948,10 @@ class PermissionService {
|
|
|
3089
2948
|
}
|
|
3090
2949
|
return serviceInstance.isActionVisible(actionCtx, route, state);
|
|
3091
2950
|
}
|
|
3092
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3093
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2951
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2952
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PermissionService }); }
|
|
3094
2953
|
}
|
|
3095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PermissionService, decorators: [{
|
|
3096
2955
|
type: Injectable
|
|
3097
2956
|
}] });
|
|
3098
2957
|
|
|
@@ -3704,6 +3563,7 @@ class CommonsConfigurationService {
|
|
|
3704
3563
|
.filter(source => !source.isLoaded)
|
|
3705
3564
|
.map(sourceInfo => {
|
|
3706
3565
|
let url = sourceInfo.url;
|
|
3566
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
3707
3567
|
sourceInfo.environment = this.projectEnvironment?.name || (this.projectEnvironment?.production ? (sourceInfo.environmentEnableEnvProd ? 'prod' : null) : 'dev');
|
|
3708
3568
|
sourceInfo.isEnvironment = !!sourceInfo.environment;
|
|
3709
3569
|
if (sourceInfo.isEnvironment) {
|
|
@@ -3968,10 +3828,10 @@ class CommonsRouterService {
|
|
|
3968
3828
|
getModulePathFromRouterLink(path) {
|
|
3969
3829
|
return ('/' + (Array.isArray(path) ? path.join('/') : path)).replace(/\/\//g, '/');
|
|
3970
3830
|
}
|
|
3971
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3972
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3831
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsRouterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3832
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsRouterService }); }
|
|
3973
3833
|
}
|
|
3974
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3834
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsRouterService, decorators: [{
|
|
3975
3835
|
type: Injectable
|
|
3976
3836
|
}], ctorParameters: () => [] });
|
|
3977
3837
|
|
|
@@ -4067,10 +3927,10 @@ class CommonsInitService {
|
|
|
4067
3927
|
return throwError$1(() => err);
|
|
4068
3928
|
}));
|
|
4069
3929
|
}
|
|
4070
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4071
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3930
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3931
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsInitService }); }
|
|
4072
3932
|
}
|
|
4073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsInitService, decorators: [{
|
|
4074
3934
|
type: Injectable
|
|
4075
3935
|
}] });
|
|
4076
3936
|
|
|
@@ -4095,10 +3955,10 @@ class CommonsStorageService {
|
|
|
4095
3955
|
removeItem(type, key) {
|
|
4096
3956
|
this.localStorage.removeItem(this.buildLocalStorageKey(type, key));
|
|
4097
3957
|
}
|
|
4098
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4099
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3959
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsStorageService }); }
|
|
4100
3960
|
}
|
|
4101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CommonsStorageService, decorators: [{
|
|
4102
3962
|
type: Injectable
|
|
4103
3963
|
}] });
|
|
4104
3964
|
|
|
@@ -4129,11 +3989,12 @@ var CommonsFeatureTypeEnum;
|
|
|
4129
3989
|
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Form"] = 1] = "Form";
|
|
4130
3990
|
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Table"] = 2] = "Table";
|
|
4131
3991
|
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Tableview"] = 3] = "Tableview";
|
|
4132
|
-
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["
|
|
3992
|
+
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["CommonsClass"] = 4] = "CommonsClass";
|
|
3993
|
+
CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["DataApiAsClassV1"] = 5] = "DataApiAsClassV1";
|
|
4133
3994
|
})(CommonsFeatureTypeEnum || (CommonsFeatureTypeEnum = {}));
|
|
4134
3995
|
function provideCommons(config, ...features) {
|
|
4135
3996
|
const providers = [
|
|
4136
|
-
//
|
|
3997
|
+
// Optimus UI services
|
|
4137
3998
|
DialogService,
|
|
4138
3999
|
MessageService,
|
|
4139
4000
|
ConfirmationService,
|
|
@@ -4147,10 +4008,6 @@ function provideCommons(config, ...features) {
|
|
|
4147
4008
|
provide: COMMONS_MODULE_CONFIG_IT,
|
|
4148
4009
|
useValue: config
|
|
4149
4010
|
},
|
|
4150
|
-
{
|
|
4151
|
-
provide: TypeRegistry,
|
|
4152
|
-
useFactory: () => TypeRegistry.get()
|
|
4153
|
-
},
|
|
4154
4011
|
{
|
|
4155
4012
|
provide: CommonsConfigurationService,
|
|
4156
4013
|
useFactory: () => CommonsConfigurationService.get()
|
|
@@ -4189,5 +4046,5 @@ function provideCommons(config, ...features) {
|
|
|
4189
4046
|
* Generated bundle index. Do not edit.
|
|
4190
4047
|
*/
|
|
4191
4048
|
|
|
4192
|
-
export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProviderInst,
|
|
4049
|
+
export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProviderInst, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RerenderDirective, RouteBuilder, RoutesBuilder, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, booleanOrUndefinedAttribute, booleanWithDefaultAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createChildrenLazyRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, doesUrlMatchRouterLink, effectWithDeps, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToOptimus, fromAngularNumberFormatToFractions, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValues, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getHttpErrorResponseStatusText, getI18n, getI18nAsync, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isMac, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, narrowI18nToTranslation, narrowOptimusMessageSeverity, objectDeepCopy, objectDeepEquals, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
|
|
4193
4050
|
//# sourceMappingURL=mediusinc-mng-commons-core.mjs.map
|