monkey-front-core 0.0.148 → 0.0.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/esm2020/lib/core/directives/index.mjs +3 -1
  2. package/esm2020/lib/core/directives/monkeyecx-directives-module.mjs +19 -6
  3. package/esm2020/lib/core/directives/monkeyecx-popover-options.directive.mjs +39 -0
  4. package/esm2020/lib/core/directives/monkeyecx-popover.directive.mjs +198 -0
  5. package/esm2020/lib/core/interfaces/schedules/monkeyecx-request-schedule.mjs +1 -1
  6. package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +11 -3
  7. package/esm2020/lib/core/services/logged/monkeyecx-logged-handling.service.mjs +12 -1
  8. package/esm2020/lib/core/services/schedules/monkeyecx-request-schedule.service.mjs +93 -22
  9. package/esm2020/lib/monkey-front-core.module.mjs +6 -6
  10. package/fesm2015/monkey-front-core.mjs +357 -38
  11. package/fesm2015/monkey-front-core.mjs.map +1 -1
  12. package/fesm2020/monkey-front-core.mjs +374 -43
  13. package/fesm2020/monkey-front-core.mjs.map +1 -1
  14. package/lib/core/directives/index.d.ts +2 -0
  15. package/lib/core/directives/monkeyecx-directives-module.d.ts +5 -1
  16. package/lib/core/directives/monkeyecx-popover-options.directive.d.ts +19 -0
  17. package/lib/core/directives/monkeyecx-popover.directive.d.ts +38 -0
  18. package/lib/core/interfaces/schedules/monkeyecx-request-schedule.d.ts +2 -0
  19. package/lib/core/services/logged/monkeyecx-logged-handling.service.d.ts +3 -0
  20. package/lib/core/services/schedules/monkeyecx-request-schedule.service.d.ts +21 -3
  21. package/lib/monkey-front-core.module.d.ts +4 -4
  22. package/monkey-front-core-0.0.151.tgz +0 -0
  23. package/package.json +2 -1
  24. package/monkey-front-core-0.0.148.tgz +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, NgZone, ErrorHandler, Optional, SkipSelf } from '@angular/core';
2
+ import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, InjectionToken, Inject, Optional, NgZone, ErrorHandler, SkipSelf } from '@angular/core';
3
3
  import * as i1 from 'monkey-style-guide';
4
4
  import { MonkeyButtonModule, MonkeyIconModule, MonkeyInputModule, MonkeyModalModule, MonkeyUtils, MonkeyStyleGuideModule, MonkeyStyleGuideModalService, MonkeyStyleGuideSettingsService, MonkeyStyleGuideSnackbarService } from 'monkey-style-guide';
5
5
  import * as i2 from '@angular/common';
@@ -10,14 +10,17 @@ import * as moment_ from 'moment';
10
10
  import * as i1$2 from 'ngx-cookie-service';
11
11
  import * as i1$3 from '@angular/router';
12
12
  import { NavigationStart, NavigationEnd, NavigationError, NavigationCancel } from '@angular/router';
13
- import { BehaviorSubject, throwError, interval, concat, of, Subject } from 'rxjs';
13
+ import { BehaviorSubject, Subscription, throwError, interval, concat, of, Subject } from 'rxjs';
14
14
  import { filter, take, takeWhile, map, catchError, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
15
15
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
16
+ import { TemplatePortal } from '@angular/cdk/portal';
17
+ import * as i1$4 from '@angular/cdk/overlay';
18
+ import { OverlayModule } from '@angular/cdk/overlay';
16
19
  import { __decorate } from 'tslib';
17
- import * as i1$4 from '@angular/common/http';
20
+ import * as i1$5 from '@angular/common/http';
18
21
  import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
19
22
  import { datadogRum } from '@datadog/browser-rum';
20
- import * as i1$5 from '@angular/service-worker';
23
+ import * as i1$6 from '@angular/service-worker';
21
24
  import { ServiceWorkerModule } from '@angular/service-worker';
22
25
  import { initialize } from 'launchdarkly-js-client-sdk';
23
26
 
@@ -1841,6 +1844,235 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1841
1844
  args: ['input', ['$event']]
1842
1845
  }] } });
1843
1846
 
1847
+ const POPOVER_OPTIONS = new InjectionToken('POPOVER_OPTIONS');
1848
+ class MonkeyEcxPopoverOptionsDirective {
1849
+ set options(options) {
1850
+ Object.entries(options).forEach(([k, v]) => {
1851
+ this[k] = v;
1852
+ });
1853
+ }
1854
+ }
1855
+ MonkeyEcxPopoverOptionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1856
+ MonkeyEcxPopoverOptionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxPopoverOptionsDirective, selector: "[monkeyecxPopoverOptions]", inputs: { options: ["monkeyecxPopoverOptions", "options"] }, providers: [
1857
+ {
1858
+ provide: POPOVER_OPTIONS,
1859
+ useExisting: forwardRef(() => {
1860
+ // eslint-disable-next-line no-use-before-define
1861
+ return MonkeyEcxPopoverOptionsDirective;
1862
+ })
1863
+ }
1864
+ ], ngImport: i0 });
1865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverOptionsDirective, decorators: [{
1866
+ type: Directive,
1867
+ args: [{
1868
+ selector: '[monkeyecxPopoverOptions]',
1869
+ providers: [
1870
+ {
1871
+ provide: POPOVER_OPTIONS,
1872
+ useExisting: forwardRef(() => {
1873
+ // eslint-disable-next-line no-use-before-define
1874
+ return MonkeyEcxPopoverOptionsDirective;
1875
+ })
1876
+ }
1877
+ ]
1878
+ }]
1879
+ }], propDecorators: { options: [{
1880
+ type: Input,
1881
+ args: ['monkeyecxPopoverOptions']
1882
+ }] } });
1883
+
1884
+ class MonkeyEcxPopoverDirective {
1885
+ constructor(tpl, vcr, el, zone, _viewContainerRef, _cd, overlay, overlayPositionBuilder, options) {
1886
+ this.tpl = tpl;
1887
+ this.vcr = vcr;
1888
+ this.el = el;
1889
+ this.zone = zone;
1890
+ this._viewContainerRef = _viewContainerRef;
1891
+ this._cd = _cd;
1892
+ this.overlay = overlay;
1893
+ this.overlayPositionBuilder = overlayPositionBuilder;
1894
+ this.options = options;
1895
+ this.minwidth = false;
1896
+ this.backdrop = true;
1897
+ this.watch = false;
1898
+ this.dir = 'ltr';
1899
+ this.contextmenu = false;
1900
+ this.subs = new Subscription();
1901
+ // not to do
1902
+ }
1903
+ get popover() {
1904
+ return this._popover;
1905
+ }
1906
+ set popover(show) {
1907
+ this._popover = show;
1908
+ if (show) {
1909
+ this.createPopover();
1910
+ }
1911
+ else if (this.overlayRef) {
1912
+ this.overlayRef.dispose();
1913
+ }
1914
+ }
1915
+ get target() {
1916
+ return this._target;
1917
+ }
1918
+ set target(target) {
1919
+ this._target = target;
1920
+ }
1921
+ getDirPositions(dir) {
1922
+ const revert = {
1923
+ start: 'end', end: 'start', bottom: 'top', top: 'bottom', center: 'center'
1924
+ };
1925
+ const centerY = (pos) => {
1926
+ return {
1927
+ originX: 'center', originY: pos, overlayX: 'center', overlayY: revert[pos]
1928
+ };
1929
+ };
1930
+ const centerX = (pos) => {
1931
+ return {
1932
+ originX: revert[pos], originY: 'center', overlayX: pos, overlayY: 'center'
1933
+ };
1934
+ };
1935
+ const ltr = (axis) => {
1936
+ return {
1937
+ originX: 'start', originY: axis, overlayX: 'start', overlayY: revert[axis]
1938
+ };
1939
+ };
1940
+ const rtl = (axis) => {
1941
+ return {
1942
+ originX: 'end', originY: axis, overlayX: 'end', overlayY: revert[axis]
1943
+ };
1944
+ };
1945
+ const side = (axis, axis2) => {
1946
+ return {
1947
+ originX: axis, originY: axis2, overlayX: revert[axis], overlayY: axis2
1948
+ };
1949
+ };
1950
+ const cmp = dir || this.options?.dir || this.dir;
1951
+ if (cmp === 'ct') {
1952
+ return [centerY('top'), centerY('bottom'), centerX('start'), centerX('end')];
1953
+ }
1954
+ if (cmp === 'cr') {
1955
+ return [centerX('end'), centerX('start'), centerY('top'), centerY('bottom')];
1956
+ }
1957
+ if (cmp === 'cc') {
1958
+ return [centerX('center')];
1959
+ }
1960
+ if (cmp === 'ltr') {
1961
+ return [ltr('bottom'), ltr('top')];
1962
+ }
1963
+ if (cmp === 'rtl') {
1964
+ return [rtl('bottom'), rtl('top')];
1965
+ }
1966
+ if (cmp === 'tltr') {
1967
+ return [ltr('top'), ltr('bottom')];
1968
+ }
1969
+ if (cmp === 'trtl') {
1970
+ return [rtl('top'), rtl('bottom')];
1971
+ }
1972
+ if (cmp === 'rt') {
1973
+ return [side('end', 'top'), side('end', 'bottom'), ltr('top')];
1974
+ }
1975
+ if (cmp === 'rb') {
1976
+ return [side('end', 'bottom'), side('end', 'top'), ltr('bottom'), rtl('bottom')];
1977
+ }
1978
+ if (cmp === 'lt') {
1979
+ return [side('start', 'top'), side('start', 'bottom'), rtl('top')];
1980
+ }
1981
+ if (cmp === 'lb') {
1982
+ return [side('start', 'bottom'), side('start', 'top'), rtl('bottom')];
1983
+ }
1984
+ return [];
1985
+ }
1986
+ createPopover(origin, options) {
1987
+ this.templatePortal = new TemplatePortal(this.tpl, this._viewContainerRef);
1988
+ this.positionStrategy = this.overlayPositionBuilder
1989
+ .flexibleConnectedTo(origin || this.target)
1990
+ .withPush(true)
1991
+ .withGrowAfterOpen(true)
1992
+ .withPositions(this.getDirPositions(options?.dir));
1993
+ this.overlayRef = this.overlay.create({
1994
+ positionStrategy: this.positionStrategy,
1995
+ disposeOnNavigation: true,
1996
+ direction: 'ltr',
1997
+ hasBackdrop: this.backdrop,
1998
+ scrollStrategy: this.overlay.scrollStrategies.reposition({}),
1999
+ backdropClass: 'cdk-overlay-transparent-backdrop',
2000
+ width: (this.options?.minwidth || this.minwidth) ? (this.target.offsetWidth - 2) : undefined,
2001
+ maxHeight: '95%',
2002
+ height: this.height
2003
+ });
2004
+ let resizeObserver;
2005
+ const subs = this.overlayRef.backdropClick().subscribe((e) => {
2006
+ this.popover = false;
2007
+ subs.unsubscribe();
2008
+ resizeObserver?.disconnect();
2009
+ this.zone.run(() => {
2010
+ if (this.closed) {
2011
+ this.closed(e);
2012
+ }
2013
+ });
2014
+ });
2015
+ const attached = this.overlayRef.attach(this.templatePortal);
2016
+ if (this.watch) {
2017
+ try {
2018
+ if ('ResizeObserver' in window) {
2019
+ resizeObserver = new ResizeObserver(([{ contentRect }]) => {
2020
+ this.overlayRef.updatePosition();
2021
+ })
2022
+ .observe(attached.rootNodes[0]);
2023
+ }
2024
+ }
2025
+ catch (e) {
2026
+ // not to do
2027
+ }
2028
+ }
2029
+ }
2030
+ ngOnDestroy() {
2031
+ this.popover = false;
2032
+ this.subs.unsubscribe();
2033
+ }
2034
+ }
2035
+ MonkeyEcxPopoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.Overlay }, { token: i1$4.OverlayPositionBuilder }, { token: POPOVER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
2036
+ MonkeyEcxPopoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: { popover: ["monkeyecxPopover", "popover"], closed: ["monkeyecxPopoverClosed", "closed"], target: ["monkeyecxPopoverTarget", "target"], minwidth: ["monkeyecxPopoverMinwidth", "minwidth"], backdrop: ["monkeyecxPopoverBackdrop", "backdrop"], watch: ["monkeyecxPopoverWatch", "watch"], dir: ["monkeyecxPopoverDir", "dir"], contextmenu: ["monkeyecxPopoverContextmenu", "contextmenu"], height: ["monkeyecxPopoverHeight", "height"] }, ngImport: i0 });
2037
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, decorators: [{
2038
+ type: Directive,
2039
+ args: [{
2040
+ selector: '[monkeyecxPopover]'
2041
+ }]
2042
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.Overlay }, { type: i1$4.OverlayPositionBuilder }, { type: undefined, decorators: [{
2043
+ type: Inject,
2044
+ args: [POPOVER_OPTIONS]
2045
+ }, {
2046
+ type: Optional
2047
+ }] }]; }, propDecorators: { popover: [{
2048
+ type: Input,
2049
+ args: ['monkeyecxPopover']
2050
+ }], closed: [{
2051
+ type: Input,
2052
+ args: ['monkeyecxPopoverClosed']
2053
+ }], target: [{
2054
+ type: Input,
2055
+ args: ['monkeyecxPopoverTarget']
2056
+ }], minwidth: [{
2057
+ type: Input,
2058
+ args: ['monkeyecxPopoverMinwidth']
2059
+ }], backdrop: [{
2060
+ type: Input,
2061
+ args: ['monkeyecxPopoverBackdrop']
2062
+ }], watch: [{
2063
+ type: Input,
2064
+ args: ['monkeyecxPopoverWatch']
2065
+ }], dir: [{
2066
+ type: Input,
2067
+ args: ['monkeyecxPopoverDir']
2068
+ }], contextmenu: [{
2069
+ type: Input,
2070
+ args: ['monkeyecxPopoverContextmenu']
2071
+ }], height: [{
2072
+ type: Input,
2073
+ args: ['monkeyecxPopoverHeight']
2074
+ }] } });
2075
+
1844
2076
  class MonkeyEcxRequestPagedHandling {
1845
2077
  constructor(url, pagedParams, links, samePage = false) {
1846
2078
  this.samePage = false;
@@ -2342,14 +2574,14 @@ class MonkeyEcxService {
2342
2574
  }));
2343
2575
  }
2344
2576
  }
2345
- MonkeyEcxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, deps: [{ token: i1$4.HttpClient }, { token: MonkeyEcxHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
2577
+ MonkeyEcxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, deps: [{ token: i1$5.HttpClient }, { token: MonkeyEcxHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
2346
2578
  MonkeyEcxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, providedIn: 'root' });
2347
2579
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, decorators: [{
2348
2580
  type: Injectable,
2349
2581
  args: [{
2350
2582
  providedIn: 'root',
2351
2583
  }]
2352
- }], ctorParameters: function () { return [{ type: i1$4.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2584
+ }], ctorParameters: function () { return [{ type: i1$5.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2353
2585
 
2354
2586
  let window$1;
2355
2587
  const text = {
@@ -2564,14 +2796,14 @@ class MonkeyEcxServiceWorkerConfigService {
2564
2796
  this.verify();
2565
2797
  }
2566
2798
  }
2567
- MonkeyEcxServiceWorkerConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, deps: [{ token: i0.ApplicationRef }, { token: i1$5.SwUpdate }, { token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
2799
+ MonkeyEcxServiceWorkerConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, deps: [{ token: i0.ApplicationRef }, { token: i1$6.SwUpdate }, { token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
2568
2800
  MonkeyEcxServiceWorkerConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, providedIn: 'root' });
2569
2801
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, decorators: [{
2570
2802
  type: Injectable,
2571
2803
  args: [{
2572
2804
  providedIn: 'root'
2573
2805
  }]
2574
- }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i1$5.SwUpdate }, { type: i1.MonkeyStyleGuideModalService }]; } });
2806
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i1$6.SwUpdate }, { type: i1.MonkeyStyleGuideModalService }]; } });
2575
2807
 
2576
2808
  /* eslint-disable no-console */
2577
2809
  class MonkeyEcxSecurityConsoleConfigService extends MonkeyEcxCommonsService {
@@ -3175,15 +3407,19 @@ MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0
3175
3407
  MonkeyEcxOnlyAlphaNumericDirective,
3176
3408
  MonkeyEcxOnlyNumbersDirective,
3177
3409
  MonkeyEcxSecurityDirective,
3178
- MonkeyEcxTooltipDirective], exports: [MonkeyEcxDragDropDirective,
3410
+ MonkeyEcxTooltipDirective,
3411
+ MonkeyEcxPopoverDirective,
3412
+ MonkeyEcxPopoverOptionsDirective], imports: [CommonModule, OverlayModule], exports: [MonkeyEcxDragDropDirective,
3179
3413
  MonkeyEcxFormatCurrency,
3180
3414
  MonkeyEcxFeatureDirective,
3181
3415
  MonkeyEcxFormatUpper,
3182
3416
  MonkeyEcxOnlyAlphaNumericDirective,
3183
3417
  MonkeyEcxOnlyNumbersDirective,
3184
3418
  MonkeyEcxSecurityDirective,
3185
- MonkeyEcxTooltipDirective] });
3186
- MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule });
3419
+ MonkeyEcxTooltipDirective,
3420
+ MonkeyEcxPopoverDirective,
3421
+ MonkeyEcxPopoverOptionsDirective] });
3422
+ MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, imports: [[CommonModule, OverlayModule]] });
3187
3423
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
3188
3424
  type: NgModule,
3189
3425
  args: [{
@@ -3195,8 +3431,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3195
3431
  MonkeyEcxOnlyAlphaNumericDirective,
3196
3432
  MonkeyEcxOnlyNumbersDirective,
3197
3433
  MonkeyEcxSecurityDirective,
3198
- MonkeyEcxTooltipDirective
3434
+ MonkeyEcxTooltipDirective,
3435
+ MonkeyEcxPopoverDirective,
3436
+ MonkeyEcxPopoverOptionsDirective
3199
3437
  ],
3438
+ imports: [CommonModule, OverlayModule],
3200
3439
  exports: [
3201
3440
  MonkeyEcxDragDropDirective,
3202
3441
  MonkeyEcxFormatCurrency,
@@ -3205,7 +3444,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3205
3444
  MonkeyEcxOnlyAlphaNumericDirective,
3206
3445
  MonkeyEcxOnlyNumbersDirective,
3207
3446
  MonkeyEcxSecurityDirective,
3208
- MonkeyEcxTooltipDirective
3447
+ MonkeyEcxTooltipDirective,
3448
+ MonkeyEcxPopoverDirective,
3449
+ MonkeyEcxPopoverOptionsDirective
3209
3450
  ]
3210
3451
  }]
3211
3452
  }] });
@@ -3422,17 +3663,25 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
3422
3663
  }
3423
3664
  }
3424
3665
  handleError(error, mkc) {
3425
- const { router } = this;
3666
+ const { router, tokenStorage } = this;
3426
3667
  const { status } = error;
3668
+ const { companyType } = tokenStorage?.getToken() || { companyType: '' };
3427
3669
  const routes = {
3428
3670
  403: 'forbidden',
3429
3671
  500: 'service-problems',
3430
3672
  503: 'service-problems'
3431
3673
  };
3674
+ let route = '/app';
3675
+ if (companyType) {
3676
+ route = `${route}/${companyType}/pages`;
3677
+ }
3678
+ else {
3679
+ route = `${route}/pages`;
3680
+ }
3432
3681
  const found = routes[status];
3433
3682
  let timeout = 0;
3434
3683
  if (found && !this.isHttpCodeIgnoreRedirect(mkc, error?.status)) {
3435
- const route = `/app/pages/${found}`.toLowerCase();
3684
+ route = `${route}/${found}`.toLowerCase();
3436
3685
  timeout = 800;
3437
3686
  router.navigate([route]);
3438
3687
  }
@@ -3978,6 +4227,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3978
4227
  class MonkeyEcxLoggedHandlingService {
3979
4228
  constructor() {
3980
4229
  this.schedules = [];
4230
+ this.genericSchedules = [];
3981
4231
  // not to do
3982
4232
  }
3983
4233
  destroySchedule() {
@@ -3986,11 +4236,21 @@ class MonkeyEcxLoggedHandlingService {
3986
4236
  });
3987
4237
  this.schedules = [];
3988
4238
  }
4239
+ destroyGenericSchedule() {
4240
+ this.genericSchedules.forEach((sch) => {
4241
+ clearInterval(sch.interval);
4242
+ });
4243
+ this.genericSchedules = [];
4244
+ }
3989
4245
  addSchedule(sch) {
3990
4246
  this.schedules = sch;
3991
4247
  }
4248
+ addGenericSchedule(sch) {
4249
+ this.genericSchedules = sch;
4250
+ }
3992
4251
  destroy() {
3993
4252
  this.destroySchedule();
4253
+ this.destroyGenericSchedule();
3994
4254
  }
3995
4255
  }
3996
4256
  MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -4197,15 +4457,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4197
4457
  }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
4198
4458
 
4199
4459
  class MonkeyEcxRequestScheduleService {
4200
- constructor(monkeyecxService, monkeyecxLoggedHandlingService) {
4460
+ constructor(monkeyecxService, monkeyLoggedHandlingService) {
4201
4461
  this.monkeyecxService = monkeyecxService;
4202
- this.monkeyecxLoggedHandlingService = monkeyecxLoggedHandlingService;
4462
+ this.monkeyLoggedHandlingService = monkeyLoggedHandlingService;
4203
4463
  this.schedule = [];
4464
+ this.genericSchedule = [];
4204
4465
  // not to do
4205
4466
  }
4206
4467
  addToSchedule(q) {
4207
4468
  this.schedule.push(q);
4208
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4469
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4470
+ }
4471
+ addToGenericSchedule(q) {
4472
+ this.genericSchedule.push(q);
4473
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4209
4474
  }
4210
4475
  removeFromSchedule(q) {
4211
4476
  clearInterval(q.interval);
@@ -4213,66 +4478,121 @@ class MonkeyEcxRequestScheduleService {
4213
4478
  this.schedule = [
4214
4479
  ...saved.map((sch) => {
4215
4480
  const savedLocal = {
4216
- ...sch,
4481
+ ...sch
4217
4482
  };
4218
4483
  if (sch.id === q.id) {
4219
4484
  return null;
4220
4485
  }
4221
4486
  return savedLocal;
4222
- }),
4487
+ })
4223
4488
  ].filter((_) => {
4224
4489
  return _;
4225
4490
  });
4226
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4491
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4492
+ }
4493
+ removeFromGenericSchedule(q) {
4494
+ clearInterval(q.interval);
4495
+ const saved = [...this.genericSchedule];
4496
+ this.genericSchedule = [
4497
+ ...saved.map((sch) => {
4498
+ const savedLocal = {
4499
+ ...sch
4500
+ };
4501
+ if (sch.id === q.id) {
4502
+ return null;
4503
+ }
4504
+ return savedLocal;
4505
+ })
4506
+ ].filter((_) => {
4507
+ return _;
4508
+ });
4509
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4227
4510
  }
4228
4511
  removeFromScheduleById(id) {
4229
4512
  const q = this.getScheduleById(id);
4230
- clearInterval(q.interval);
4513
+ clearInterval(q?.interval);
4231
4514
  const saved = [...this.schedule];
4232
4515
  this.schedule = [
4233
4516
  ...saved.map((sch) => {
4234
4517
  const savedLocal = {
4235
- ...sch,
4518
+ ...sch
4236
4519
  };
4237
- if (sch.id === q.id) {
4520
+ if (sch.id === q?.id) {
4238
4521
  return null;
4239
4522
  }
4240
4523
  return savedLocal;
4241
- }),
4524
+ })
4242
4525
  ].filter((_) => {
4243
4526
  return _;
4244
4527
  });
4245
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4528
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4246
4529
  }
4247
4530
  doCall(sch) {
4248
- const { url, method, params, data, action } = sch;
4531
+ const { url, method, params, data, action, errorAction } = sch;
4532
+ const errAction = errorAction || ((...args) => { });
4249
4533
  this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
4250
4534
  action({
4251
4535
  ...data,
4252
- ...resp,
4536
+ ...resp
4253
4537
  }, sch);
4254
- }, () => {
4538
+ }, (err) => {
4255
4539
  this.removeFromSchedule(sch);
4540
+ errAction({
4541
+ ...data
4542
+ }, sch, err);
4543
+ });
4544
+ }
4545
+ doGenericCall(sch) {
4546
+ const { url, method, params, data, action, errorAction } = sch;
4547
+ const errAction = errorAction || ((...args) => { });
4548
+ this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
4549
+ action({
4550
+ ...data,
4551
+ ...resp
4552
+ }, sch);
4553
+ }, (err) => {
4554
+ this.removeFromGenericSchedule(sch);
4555
+ errAction({
4556
+ ...data
4557
+ }, sch, err);
4256
4558
  });
4257
4559
  }
4258
4560
  setSchedule(q, delay = 3000) {
4259
4561
  const interval = setInterval(() => {
4260
4562
  this.doCall({
4261
4563
  ...q,
4262
- interval,
4564
+ interval
4263
4565
  });
4264
4566
  }, delay);
4265
4567
  const sch = {
4266
4568
  ...q,
4267
4569
  id: `${MonkeyEcxUtils.getRandomString(40)}`,
4268
- interval,
4570
+ interval
4269
4571
  };
4270
4572
  this.addToSchedule(sch);
4271
4573
  return sch;
4272
4574
  }
4575
+ setGenericSchedule(q, delay = 3000) {
4576
+ const interval = setInterval(() => {
4577
+ this.doGenericCall({
4578
+ ...q,
4579
+ interval
4580
+ });
4581
+ }, delay);
4582
+ const sch = {
4583
+ ...q,
4584
+ id: `${MonkeyEcxUtils.getRandomString(40)}`,
4585
+ interval
4586
+ };
4587
+ this.addToGenericSchedule(sch);
4588
+ return sch;
4589
+ }
4273
4590
  removeSchedule(q) {
4274
4591
  this.removeFromSchedule(q);
4275
4592
  }
4593
+ removeGenericSchedule(q) {
4594
+ this.removeFromGenericSchedule(q);
4595
+ }
4276
4596
  removeScheduleById(id) {
4277
4597
  this.removeFromScheduleById(id);
4278
4598
  }
@@ -4288,19 +4608,30 @@ MonkeyEcxRequestScheduleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion
4288
4608
  __decorate([
4289
4609
  MonkeyEcxCoreService({
4290
4610
  httpResponse: {
4291
- httpCodeIgnore: [400, 403, 404, 500, 503],
4611
+ httpCodeIgnore: [400, 403, 404, 500, 503]
4292
4612
  },
4293
4613
  requestInProgress: {
4294
- showProgress: false,
4295
- },
4614
+ showProgress: false
4615
+ }
4296
4616
  })
4297
4617
  ], MonkeyEcxRequestScheduleService.prototype, "doCall", null);
4618
+ __decorate([
4619
+ MonkeyEcxCoreService({
4620
+ httpResponse: {
4621
+ httpCodeIgnore: [400, 401, 403, 404, 500, 503],
4622
+ httpCodeIgnoreRedirect: [503]
4623
+ },
4624
+ requestInProgress: {
4625
+ showProgress: false
4626
+ }
4627
+ })
4628
+ ], MonkeyEcxRequestScheduleService.prototype, "doGenericCall", null);
4298
4629
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestScheduleService, decorators: [{
4299
4630
  type: Injectable,
4300
4631
  args: [{
4301
- providedIn: 'root',
4632
+ providedIn: 'root'
4302
4633
  }]
4303
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [] } });
4634
+ }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [], doGenericCall: [] } });
4304
4635
 
4305
4636
  /* eslint-disable no-unused-vars */
4306
4637
  var OpSearch;
@@ -4399,13 +4730,13 @@ class MonkeyEcxSpecificationSearch {
4399
4730
  }
4400
4731
  }
4401
4732
 
4402
- class MonkeyFrontCoreModuleModule {
4733
+ class MonkeyFrontCoreModule {
4403
4734
  }
4404
- MonkeyFrontCoreModuleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4405
- MonkeyFrontCoreModuleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, imports: [CommonModule,
4406
- HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$5.ServiceWorkerModule, ClosedToMaintenanceModule,
4735
+ MonkeyFrontCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4736
+ MonkeyFrontCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, imports: [CommonModule,
4737
+ HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$6.ServiceWorkerModule, ClosedToMaintenanceModule,
4407
4738
  VersionChangedModule] });
4408
- MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, providers: [
4739
+ MonkeyFrontCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, providers: [
4409
4740
  MonkeyStyleGuideModalService,
4410
4741
  MonkeyStyleGuideSettingsService,
4411
4742
  MonkeyStyleGuideSnackbarService
@@ -4421,7 +4752,7 @@ MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0
4421
4752
  ClosedToMaintenanceModule,
4422
4753
  VersionChangedModule
4423
4754
  ]] });
4424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, decorators: [{
4755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, decorators: [{
4425
4756
  type: NgModule,
4426
4757
  args: [{
4427
4758
  imports: [
@@ -4452,5 +4783,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4452
4783
  * Generated bundle index. Do not edit.
4453
4784
  */
4454
4785
 
4455
- export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, Link, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDateUnixTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPipesModule, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModuleModule, OpSearch, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
4786
+ export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, Link, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDateUnixTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPipesModule, MonkeyEcxPopoverDirective, MonkeyEcxPopoverOptionsDirective, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModule, OpSearch, POPOVER_OPTIONS, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
4456
4787
  //# sourceMappingURL=monkey-front-core.mjs.map