monkey-front-core 0.0.618 → 0.0.620
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/esm2020/lib/core/interfaces/monkeyecx-store.mjs +1 -1
- package/esm2020/lib/core/services/store/monkeyecx-store-base.service.mjs +31 -7
- package/esm2020/lib/core/utils/utils.mjs +5 -1
- package/fesm2015/monkey-front-core.mjs +35 -7
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +34 -7
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interfaces/monkeyecx-store.d.ts +2 -0
- package/lib/core/services/store/monkeyecx-store-base.service.d.ts +3 -1
- package/monkey-front-core-0.0.620.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.618.tgz +0 -0
|
@@ -8,8 +8,8 @@ import * as i1$1 from '@ngx-translate/core';
|
|
|
8
8
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import * as moment_ from 'moment';
|
|
10
10
|
import { datadogLogs } from '@datadog/browser-logs';
|
|
11
|
-
import { map, catchError, filter, takeWhile, take, first, takeUntil,
|
|
12
|
-
import { throwError, BehaviorSubject, Subscription, interval, concat, Subject, of, from } from 'rxjs';
|
|
11
|
+
import { map, catchError, filter, takeWhile, take, first, takeUntil, finalize, tap, mergeMap } from 'rxjs/operators';
|
|
12
|
+
import { throwError, BehaviorSubject, Subscription, interval, concat, Subject, of, EMPTY, from } from 'rxjs';
|
|
13
13
|
import * as i1$2 from '@angular/common/http';
|
|
14
14
|
import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
|
15
15
|
import * as i2$1 from '@angular/platform-browser';
|
|
@@ -303,6 +303,10 @@ class MonkeyEcxUtils {
|
|
|
303
303
|
MX: {
|
|
304
304
|
CPF: CountryMasks.RFC1,
|
|
305
305
|
CNPJ: CountryMasks.RFC2
|
|
306
|
+
},
|
|
307
|
+
US: {
|
|
308
|
+
CPF: CountryMasks.EIN,
|
|
309
|
+
CNPJ: CountryMasks.EIN
|
|
306
310
|
}
|
|
307
311
|
}[country.toUpperCase()]?.[type];
|
|
308
312
|
}
|
|
@@ -6529,18 +6533,30 @@ class MonkeyEcxCommonsStoreBaseService extends MonkeyEcxCommonsService {
|
|
|
6529
6533
|
throw new Error(`${e?.message}`);
|
|
6530
6534
|
}
|
|
6531
6535
|
}
|
|
6532
|
-
|
|
6533
|
-
|
|
6536
|
+
loadDataStream(url) {
|
|
6537
|
+
this.updateControl({ isLoading: true });
|
|
6538
|
+
return (this.monkeyecxService?.get(url).pipe(finalize(() => {
|
|
6539
|
+
this.updateControl({ isLoading: false });
|
|
6540
|
+
}), tap((resp) => {
|
|
6541
|
+
this.handleResponseData(resp);
|
|
6542
|
+
})) || EMPTY);
|
|
6543
|
+
}
|
|
6544
|
+
async loadPageData(pagination, dispatchLoadAction = false) {
|
|
6545
|
+
const { store, selector, action } = this;
|
|
6534
6546
|
const data = await store
|
|
6535
6547
|
.select(selector.selectLinks())
|
|
6536
6548
|
.pipe(take(1))
|
|
6537
6549
|
.toPromise();
|
|
6538
|
-
const {
|
|
6539
|
-
const { href } = new MonkeyEcxLinksModel({ _links: data }).getAction(action) || {
|
|
6550
|
+
const { href } = new MonkeyEcxLinksModel({ _links: data }).getAction(pagination?.action) || {
|
|
6540
6551
|
href: ''
|
|
6541
6552
|
};
|
|
6542
6553
|
if (href) {
|
|
6543
|
-
|
|
6554
|
+
if (dispatchLoadAction) {
|
|
6555
|
+
this.store.dispatch(action.load({ url: href, skipClear: true }));
|
|
6556
|
+
}
|
|
6557
|
+
else {
|
|
6558
|
+
this.loadData(href);
|
|
6559
|
+
}
|
|
6544
6560
|
}
|
|
6545
6561
|
}
|
|
6546
6562
|
/**
|
|
@@ -6576,6 +6592,17 @@ __decorate([
|
|
|
6576
6592
|
}
|
|
6577
6593
|
})
|
|
6578
6594
|
], MonkeyEcxCommonsStoreBaseService.prototype, "loadData", null);
|
|
6595
|
+
__decorate([
|
|
6596
|
+
MonkeyEcxCoreService({
|
|
6597
|
+
httpResponse: {
|
|
6598
|
+
httpCodeIgnore: [412],
|
|
6599
|
+
httpCodeIgnoreRedirect: [412]
|
|
6600
|
+
},
|
|
6601
|
+
requestInProgress: {
|
|
6602
|
+
showProgress: true
|
|
6603
|
+
}
|
|
6604
|
+
})
|
|
6605
|
+
], MonkeyEcxCommonsStoreBaseService.prototype, "loadDataStream", null);
|
|
6579
6606
|
|
|
6580
6607
|
class MonkeyEcxCommonsActions {
|
|
6581
6608
|
static getActions(actionName) {
|