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
 
@@ -1855,6 +1858,239 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1855
1858
  args: ['input', ['$event']]
1856
1859
  }] } });
1857
1860
 
1861
+ const POPOVER_OPTIONS = new InjectionToken('POPOVER_OPTIONS');
1862
+ class MonkeyEcxPopoverOptionsDirective {
1863
+ set options(options) {
1864
+ Object.entries(options).forEach(([k, v]) => {
1865
+ this[k] = v;
1866
+ });
1867
+ }
1868
+ }
1869
+ MonkeyEcxPopoverOptionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1870
+ MonkeyEcxPopoverOptionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxPopoverOptionsDirective, selector: "[monkeyecxPopoverOptions]", inputs: { options: ["monkeyecxPopoverOptions", "options"] }, providers: [
1871
+ {
1872
+ provide: POPOVER_OPTIONS,
1873
+ useExisting: forwardRef(() => {
1874
+ // eslint-disable-next-line no-use-before-define
1875
+ return MonkeyEcxPopoverOptionsDirective;
1876
+ })
1877
+ }
1878
+ ], ngImport: i0 });
1879
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverOptionsDirective, decorators: [{
1880
+ type: Directive,
1881
+ args: [{
1882
+ selector: '[monkeyecxPopoverOptions]',
1883
+ providers: [
1884
+ {
1885
+ provide: POPOVER_OPTIONS,
1886
+ useExisting: forwardRef(() => {
1887
+ // eslint-disable-next-line no-use-before-define
1888
+ return MonkeyEcxPopoverOptionsDirective;
1889
+ })
1890
+ }
1891
+ ]
1892
+ }]
1893
+ }], propDecorators: { options: [{
1894
+ type: Input,
1895
+ args: ['monkeyecxPopoverOptions']
1896
+ }] } });
1897
+
1898
+ class MonkeyEcxPopoverDirective {
1899
+ constructor(tpl, vcr, el, zone, _viewContainerRef, _cd, overlay, overlayPositionBuilder, options) {
1900
+ this.tpl = tpl;
1901
+ this.vcr = vcr;
1902
+ this.el = el;
1903
+ this.zone = zone;
1904
+ this._viewContainerRef = _viewContainerRef;
1905
+ this._cd = _cd;
1906
+ this.overlay = overlay;
1907
+ this.overlayPositionBuilder = overlayPositionBuilder;
1908
+ this.options = options;
1909
+ this.minwidth = false;
1910
+ this.backdrop = true;
1911
+ this.watch = false;
1912
+ this.dir = 'ltr';
1913
+ this.contextmenu = false;
1914
+ this.subs = new Subscription();
1915
+ // not to do
1916
+ }
1917
+ get popover() {
1918
+ return this._popover;
1919
+ }
1920
+ set popover(show) {
1921
+ this._popover = show;
1922
+ if (show) {
1923
+ this.createPopover();
1924
+ }
1925
+ else if (this.overlayRef) {
1926
+ this.overlayRef.dispose();
1927
+ }
1928
+ }
1929
+ get target() {
1930
+ return this._target;
1931
+ }
1932
+ set target(target) {
1933
+ this._target = target;
1934
+ }
1935
+ getDirPositions(dir) {
1936
+ var _a;
1937
+ const revert = {
1938
+ start: 'end', end: 'start', bottom: 'top', top: 'bottom', center: 'center'
1939
+ };
1940
+ const centerY = (pos) => {
1941
+ return {
1942
+ originX: 'center', originY: pos, overlayX: 'center', overlayY: revert[pos]
1943
+ };
1944
+ };
1945
+ const centerX = (pos) => {
1946
+ return {
1947
+ originX: revert[pos], originY: 'center', overlayX: pos, overlayY: 'center'
1948
+ };
1949
+ };
1950
+ const ltr = (axis) => {
1951
+ return {
1952
+ originX: 'start', originY: axis, overlayX: 'start', overlayY: revert[axis]
1953
+ };
1954
+ };
1955
+ const rtl = (axis) => {
1956
+ return {
1957
+ originX: 'end', originY: axis, overlayX: 'end', overlayY: revert[axis]
1958
+ };
1959
+ };
1960
+ const side = (axis, axis2) => {
1961
+ return {
1962
+ originX: axis, originY: axis2, overlayX: revert[axis], overlayY: axis2
1963
+ };
1964
+ };
1965
+ const cmp = dir || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.dir) || this.dir;
1966
+ if (cmp === 'ct') {
1967
+ return [centerY('top'), centerY('bottom'), centerX('start'), centerX('end')];
1968
+ }
1969
+ if (cmp === 'cr') {
1970
+ return [centerX('end'), centerX('start'), centerY('top'), centerY('bottom')];
1971
+ }
1972
+ if (cmp === 'cc') {
1973
+ return [centerX('center')];
1974
+ }
1975
+ if (cmp === 'ltr') {
1976
+ return [ltr('bottom'), ltr('top')];
1977
+ }
1978
+ if (cmp === 'rtl') {
1979
+ return [rtl('bottom'), rtl('top')];
1980
+ }
1981
+ if (cmp === 'tltr') {
1982
+ return [ltr('top'), ltr('bottom')];
1983
+ }
1984
+ if (cmp === 'trtl') {
1985
+ return [rtl('top'), rtl('bottom')];
1986
+ }
1987
+ if (cmp === 'rt') {
1988
+ return [side('end', 'top'), side('end', 'bottom'), ltr('top')];
1989
+ }
1990
+ if (cmp === 'rb') {
1991
+ return [side('end', 'bottom'), side('end', 'top'), ltr('bottom'), rtl('bottom')];
1992
+ }
1993
+ if (cmp === 'lt') {
1994
+ return [side('start', 'top'), side('start', 'bottom'), rtl('top')];
1995
+ }
1996
+ if (cmp === 'lb') {
1997
+ return [side('start', 'bottom'), side('start', 'top'), rtl('bottom')];
1998
+ }
1999
+ return [];
2000
+ }
2001
+ createPopover(origin, options) {
2002
+ var _a;
2003
+ this.templatePortal = new TemplatePortal(this.tpl, this._viewContainerRef);
2004
+ this.positionStrategy = this.overlayPositionBuilder
2005
+ .flexibleConnectedTo(origin || this.target)
2006
+ .withPush(true)
2007
+ .withGrowAfterOpen(true)
2008
+ .withPositions(this.getDirPositions(options === null || options === void 0 ? void 0 : options.dir));
2009
+ this.overlayRef = this.overlay.create({
2010
+ positionStrategy: this.positionStrategy,
2011
+ disposeOnNavigation: true,
2012
+ direction: 'ltr',
2013
+ hasBackdrop: this.backdrop,
2014
+ scrollStrategy: this.overlay.scrollStrategies.reposition({}),
2015
+ backdropClass: 'cdk-overlay-transparent-backdrop',
2016
+ width: (((_a = this.options) === null || _a === void 0 ? void 0 : _a.minwidth) || this.minwidth) ? (this.target.offsetWidth - 2) : undefined,
2017
+ maxHeight: '95%',
2018
+ height: this.height
2019
+ });
2020
+ let resizeObserver;
2021
+ const subs = this.overlayRef.backdropClick().subscribe((e) => {
2022
+ this.popover = false;
2023
+ subs.unsubscribe();
2024
+ resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
2025
+ this.zone.run(() => {
2026
+ if (this.closed) {
2027
+ this.closed(e);
2028
+ }
2029
+ });
2030
+ });
2031
+ const attached = this.overlayRef.attach(this.templatePortal);
2032
+ if (this.watch) {
2033
+ try {
2034
+ if ('ResizeObserver' in window) {
2035
+ resizeObserver = new ResizeObserver(([{ contentRect }]) => {
2036
+ this.overlayRef.updatePosition();
2037
+ })
2038
+ .observe(attached.rootNodes[0]);
2039
+ }
2040
+ }
2041
+ catch (e) {
2042
+ // not to do
2043
+ }
2044
+ }
2045
+ }
2046
+ ngOnDestroy() {
2047
+ this.popover = false;
2048
+ this.subs.unsubscribe();
2049
+ }
2050
+ }
2051
+ 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 });
2052
+ 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 });
2053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, decorators: [{
2054
+ type: Directive,
2055
+ args: [{
2056
+ selector: '[monkeyecxPopover]'
2057
+ }]
2058
+ }], ctorParameters: function () {
2059
+ 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: [{
2060
+ type: Inject,
2061
+ args: [POPOVER_OPTIONS]
2062
+ }, {
2063
+ type: Optional
2064
+ }] }];
2065
+ }, propDecorators: { popover: [{
2066
+ type: Input,
2067
+ args: ['monkeyecxPopover']
2068
+ }], closed: [{
2069
+ type: Input,
2070
+ args: ['monkeyecxPopoverClosed']
2071
+ }], target: [{
2072
+ type: Input,
2073
+ args: ['monkeyecxPopoverTarget']
2074
+ }], minwidth: [{
2075
+ type: Input,
2076
+ args: ['monkeyecxPopoverMinwidth']
2077
+ }], backdrop: [{
2078
+ type: Input,
2079
+ args: ['monkeyecxPopoverBackdrop']
2080
+ }], watch: [{
2081
+ type: Input,
2082
+ args: ['monkeyecxPopoverWatch']
2083
+ }], dir: [{
2084
+ type: Input,
2085
+ args: ['monkeyecxPopoverDir']
2086
+ }], contextmenu: [{
2087
+ type: Input,
2088
+ args: ['monkeyecxPopoverContextmenu']
2089
+ }], height: [{
2090
+ type: Input,
2091
+ args: ['monkeyecxPopoverHeight']
2092
+ }] } });
2093
+
1858
2094
  class MonkeyEcxRequestPagedHandling {
1859
2095
  constructor(url, pagedParams, links, samePage = false) {
1860
2096
  this.samePage = false;
@@ -2339,14 +2575,14 @@ class MonkeyEcxService {
2339
2575
  }));
2340
2576
  }
2341
2577
  }
2342
- 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 });
2578
+ 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 });
2343
2579
  MonkeyEcxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, providedIn: 'root' });
2344
2580
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxService, decorators: [{
2345
2581
  type: Injectable,
2346
2582
  args: [{
2347
2583
  providedIn: 'root',
2348
2584
  }]
2349
- }], ctorParameters: function () { return [{ type: i1$4.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2585
+ }], ctorParameters: function () { return [{ type: i1$5.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2350
2586
 
2351
2587
  let window$1;
2352
2588
  const text = {
@@ -2560,14 +2796,14 @@ class MonkeyEcxServiceWorkerConfigService {
2560
2796
  this.verify();
2561
2797
  }
2562
2798
  }
2563
- 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 });
2564
2800
  MonkeyEcxServiceWorkerConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, providedIn: 'root' });
2565
2801
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, decorators: [{
2566
2802
  type: Injectable,
2567
2803
  args: [{
2568
2804
  providedIn: 'root'
2569
2805
  }]
2570
- }], 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 }]; } });
2571
2807
 
2572
2808
  /* eslint-disable no-console */
2573
2809
  class MonkeyEcxSecurityConsoleConfigService extends MonkeyEcxCommonsService {
@@ -3170,15 +3406,19 @@ MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0
3170
3406
  MonkeyEcxOnlyAlphaNumericDirective,
3171
3407
  MonkeyEcxOnlyNumbersDirective,
3172
3408
  MonkeyEcxSecurityDirective,
3173
- MonkeyEcxTooltipDirective], exports: [MonkeyEcxDragDropDirective,
3409
+ MonkeyEcxTooltipDirective,
3410
+ MonkeyEcxPopoverDirective,
3411
+ MonkeyEcxPopoverOptionsDirective], imports: [CommonModule, OverlayModule], exports: [MonkeyEcxDragDropDirective,
3174
3412
  MonkeyEcxFormatCurrency,
3175
3413
  MonkeyEcxFeatureDirective,
3176
3414
  MonkeyEcxFormatUpper,
3177
3415
  MonkeyEcxOnlyAlphaNumericDirective,
3178
3416
  MonkeyEcxOnlyNumbersDirective,
3179
3417
  MonkeyEcxSecurityDirective,
3180
- MonkeyEcxTooltipDirective] });
3181
- MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule });
3418
+ MonkeyEcxTooltipDirective,
3419
+ MonkeyEcxPopoverDirective,
3420
+ MonkeyEcxPopoverOptionsDirective] });
3421
+ MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, imports: [[CommonModule, OverlayModule]] });
3182
3422
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
3183
3423
  type: NgModule,
3184
3424
  args: [{
@@ -3190,8 +3430,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3190
3430
  MonkeyEcxOnlyAlphaNumericDirective,
3191
3431
  MonkeyEcxOnlyNumbersDirective,
3192
3432
  MonkeyEcxSecurityDirective,
3193
- MonkeyEcxTooltipDirective
3433
+ MonkeyEcxTooltipDirective,
3434
+ MonkeyEcxPopoverDirective,
3435
+ MonkeyEcxPopoverOptionsDirective
3194
3436
  ],
3437
+ imports: [CommonModule, OverlayModule],
3195
3438
  exports: [
3196
3439
  MonkeyEcxDragDropDirective,
3197
3440
  MonkeyEcxFormatCurrency,
@@ -3200,7 +3443,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3200
3443
  MonkeyEcxOnlyAlphaNumericDirective,
3201
3444
  MonkeyEcxOnlyNumbersDirective,
3202
3445
  MonkeyEcxSecurityDirective,
3203
- MonkeyEcxTooltipDirective
3446
+ MonkeyEcxTooltipDirective,
3447
+ MonkeyEcxPopoverDirective,
3448
+ MonkeyEcxPopoverOptionsDirective
3204
3449
  ]
3205
3450
  }]
3206
3451
  }] });
@@ -3422,17 +3667,25 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
3422
3667
  }
3423
3668
  }
3424
3669
  handleError(error, mkc) {
3425
- const { router } = this;
3670
+ const { router, tokenStorage } = this;
3426
3671
  const { status } = error;
3672
+ const { companyType } = (tokenStorage === null || tokenStorage === void 0 ? void 0 : tokenStorage.getToken()) || { companyType: '' };
3427
3673
  const routes = {
3428
3674
  403: 'forbidden',
3429
3675
  500: 'service-problems',
3430
3676
  503: 'service-problems'
3431
3677
  };
3678
+ let route = '/app';
3679
+ if (companyType) {
3680
+ route = `${route}/${companyType}/pages`;
3681
+ }
3682
+ else {
3683
+ route = `${route}/pages`;
3684
+ }
3432
3685
  const found = routes[status];
3433
3686
  let timeout = 0;
3434
3687
  if (found && !this.isHttpCodeIgnoreRedirect(mkc, error === null || error === void 0 ? void 0 : error.status)) {
3435
- const route = `/app/pages/${found}`.toLowerCase();
3688
+ route = `${route}/${found}`.toLowerCase();
3436
3689
  timeout = 800;
3437
3690
  router.navigate([route]);
3438
3691
  }
@@ -3955,6 +4208,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
3955
4208
  class MonkeyEcxLoggedHandlingService {
3956
4209
  constructor() {
3957
4210
  this.schedules = [];
4211
+ this.genericSchedules = [];
3958
4212
  // not to do
3959
4213
  }
3960
4214
  destroySchedule() {
@@ -3963,11 +4217,21 @@ class MonkeyEcxLoggedHandlingService {
3963
4217
  });
3964
4218
  this.schedules = [];
3965
4219
  }
4220
+ destroyGenericSchedule() {
4221
+ this.genericSchedules.forEach((sch) => {
4222
+ clearInterval(sch.interval);
4223
+ });
4224
+ this.genericSchedules = [];
4225
+ }
3966
4226
  addSchedule(sch) {
3967
4227
  this.schedules = sch;
3968
4228
  }
4229
+ addGenericSchedule(sch) {
4230
+ this.genericSchedules = sch;
4231
+ }
3969
4232
  destroy() {
3970
4233
  this.destroySchedule();
4234
+ this.destroyGenericSchedule();
3971
4235
  }
3972
4236
  }
3973
4237
  MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -4157,15 +4421,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4157
4421
  }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
4158
4422
 
4159
4423
  class MonkeyEcxRequestScheduleService {
4160
- constructor(monkeyecxService, monkeyecxLoggedHandlingService) {
4424
+ constructor(monkeyecxService, monkeyLoggedHandlingService) {
4161
4425
  this.monkeyecxService = monkeyecxService;
4162
- this.monkeyecxLoggedHandlingService = monkeyecxLoggedHandlingService;
4426
+ this.monkeyLoggedHandlingService = monkeyLoggedHandlingService;
4163
4427
  this.schedule = [];
4428
+ this.genericSchedule = [];
4164
4429
  // not to do
4165
4430
  }
4166
4431
  addToSchedule(q) {
4167
4432
  this.schedule.push(q);
4168
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4433
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4434
+ }
4435
+ addToGenericSchedule(q) {
4436
+ this.genericSchedule.push(q);
4437
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4169
4438
  }
4170
4439
  removeFromSchedule(q) {
4171
4440
  clearInterval(q.interval);
@@ -4177,35 +4446,63 @@ class MonkeyEcxRequestScheduleService {
4177
4446
  return null;
4178
4447
  }
4179
4448
  return savedLocal;
4180
- }),
4449
+ })
4181
4450
  ].filter((_) => {
4182
4451
  return _;
4183
4452
  });
4184
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4453
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4454
+ }
4455
+ removeFromGenericSchedule(q) {
4456
+ clearInterval(q.interval);
4457
+ const saved = [...this.genericSchedule];
4458
+ this.genericSchedule = [
4459
+ ...saved.map((sch) => {
4460
+ const savedLocal = Object.assign({}, sch);
4461
+ if (sch.id === q.id) {
4462
+ return null;
4463
+ }
4464
+ return savedLocal;
4465
+ })
4466
+ ].filter((_) => {
4467
+ return _;
4468
+ });
4469
+ this.monkeyLoggedHandlingService.addGenericSchedule(this.genericSchedule);
4185
4470
  }
4186
4471
  removeFromScheduleById(id) {
4187
4472
  const q = this.getScheduleById(id);
4188
- clearInterval(q.interval);
4473
+ clearInterval(q === null || q === void 0 ? void 0 : q.interval);
4189
4474
  const saved = [...this.schedule];
4190
4475
  this.schedule = [
4191
4476
  ...saved.map((sch) => {
4192
4477
  const savedLocal = Object.assign({}, sch);
4193
- if (sch.id === q.id) {
4478
+ if (sch.id === (q === null || q === void 0 ? void 0 : q.id)) {
4194
4479
  return null;
4195
4480
  }
4196
4481
  return savedLocal;
4197
- }),
4482
+ })
4198
4483
  ].filter((_) => {
4199
4484
  return _;
4200
4485
  });
4201
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4486
+ this.monkeyLoggedHandlingService.addSchedule(this.schedule);
4202
4487
  }
4203
4488
  doCall(sch) {
4204
- const { url, method, params, data, action } = sch;
4489
+ const { url, method, params, data, action, errorAction } = sch;
4490
+ const errAction = errorAction || ((...args) => { });
4205
4491
  this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
4206
4492
  action(Object.assign(Object.assign({}, data), resp), sch);
4207
- }, () => {
4493
+ }, (err) => {
4208
4494
  this.removeFromSchedule(sch);
4495
+ errAction(Object.assign({}, data), sch, err);
4496
+ });
4497
+ }
4498
+ doGenericCall(sch) {
4499
+ const { url, method, params, data, action, errorAction } = sch;
4500
+ const errAction = errorAction || ((...args) => { });
4501
+ this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
4502
+ action(Object.assign(Object.assign({}, data), resp), sch);
4503
+ }, (err) => {
4504
+ this.removeFromGenericSchedule(sch);
4505
+ errAction(Object.assign({}, data), sch, err);
4209
4506
  });
4210
4507
  }
4211
4508
  setSchedule(q, delay = 3000) {
@@ -4216,9 +4513,20 @@ class MonkeyEcxRequestScheduleService {
4216
4513
  this.addToSchedule(sch);
4217
4514
  return sch;
4218
4515
  }
4516
+ setGenericSchedule(q, delay = 3000) {
4517
+ const interval = setInterval(() => {
4518
+ this.doGenericCall(Object.assign(Object.assign({}, q), { interval }));
4519
+ }, delay);
4520
+ const sch = Object.assign(Object.assign({}, q), { id: `${MonkeyEcxUtils.getRandomString(40)}`, interval });
4521
+ this.addToGenericSchedule(sch);
4522
+ return sch;
4523
+ }
4219
4524
  removeSchedule(q) {
4220
4525
  this.removeFromSchedule(q);
4221
4526
  }
4527
+ removeGenericSchedule(q) {
4528
+ this.removeFromGenericSchedule(q);
4529
+ }
4222
4530
  removeScheduleById(id) {
4223
4531
  this.removeFromScheduleById(id);
4224
4532
  }
@@ -4234,19 +4542,30 @@ MonkeyEcxRequestScheduleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion
4234
4542
  __decorate([
4235
4543
  MonkeyEcxCoreService({
4236
4544
  httpResponse: {
4237
- httpCodeIgnore: [400, 403, 404, 500, 503],
4545
+ httpCodeIgnore: [400, 403, 404, 500, 503]
4238
4546
  },
4239
4547
  requestInProgress: {
4240
- showProgress: false,
4241
- },
4548
+ showProgress: false
4549
+ }
4242
4550
  })
4243
4551
  ], MonkeyEcxRequestScheduleService.prototype, "doCall", null);
4552
+ __decorate([
4553
+ MonkeyEcxCoreService({
4554
+ httpResponse: {
4555
+ httpCodeIgnore: [400, 401, 403, 404, 500, 503],
4556
+ httpCodeIgnoreRedirect: [503]
4557
+ },
4558
+ requestInProgress: {
4559
+ showProgress: false
4560
+ }
4561
+ })
4562
+ ], MonkeyEcxRequestScheduleService.prototype, "doGenericCall", null);
4244
4563
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxRequestScheduleService, decorators: [{
4245
4564
  type: Injectable,
4246
4565
  args: [{
4247
- providedIn: 'root',
4566
+ providedIn: 'root'
4248
4567
  }]
4249
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [] } });
4568
+ }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [], doGenericCall: [] } });
4250
4569
 
4251
4570
  /* eslint-disable no-unused-vars */
4252
4571
  var OpSearch;
@@ -4346,13 +4665,13 @@ class MonkeyEcxSpecificationSearch {
4346
4665
  }
4347
4666
  }
4348
4667
 
4349
- class MonkeyFrontCoreModuleModule {
4668
+ class MonkeyFrontCoreModule {
4350
4669
  }
4351
- MonkeyFrontCoreModuleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4352
- MonkeyFrontCoreModuleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, imports: [CommonModule,
4353
- HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$5.ServiceWorkerModule, ClosedToMaintenanceModule,
4670
+ MonkeyFrontCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4671
+ MonkeyFrontCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, imports: [CommonModule,
4672
+ HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$6.ServiceWorkerModule, ClosedToMaintenanceModule,
4354
4673
  VersionChangedModule] });
4355
- MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, providers: [
4674
+ MonkeyFrontCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, providers: [
4356
4675
  MonkeyStyleGuideModalService,
4357
4676
  MonkeyStyleGuideSettingsService,
4358
4677
  MonkeyStyleGuideSnackbarService
@@ -4368,7 +4687,7 @@ MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0
4368
4687
  ClosedToMaintenanceModule,
4369
4688
  VersionChangedModule
4370
4689
  ]] });
4371
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModuleModule, decorators: [{
4690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyFrontCoreModule, decorators: [{
4372
4691
  type: NgModule,
4373
4692
  args: [{
4374
4693
  imports: [
@@ -4399,5 +4718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4399
4718
  * Generated bundle index. Do not edit.
4400
4719
  */
4401
4720
 
4402
- 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 };
4721
+ 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 };
4403
4722
  //# sourceMappingURL=monkey-front-core.mjs.map