monkey-front-core 0.0.151 → 0.0.155
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/services/commons/monkeyecx-commons.service.mjs +23 -22
- package/esm2020/lib/core/utils/utils.mjs +4 -1
- package/fesm2015/monkey-front-core.mjs +17 -13
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +24 -20
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +2 -2
- package/monkey-front-core-0.0.155.tgz +0 -0
- package/package.json +4 -4
- package/monkey-front-core-0.0.151.tgz +0 -0
|
@@ -81,6 +81,9 @@ class MonkeyEcxUtils {
|
|
|
81
81
|
}
|
|
82
82
|
static isCPFCNPJValid(document) {
|
|
83
83
|
document = document.replace(/[^\d]/g, '');
|
|
84
|
+
const handled = document.replace(document.charAt(0), '');
|
|
85
|
+
if (!handled)
|
|
86
|
+
return false;
|
|
84
87
|
if (document.length === 11) {
|
|
85
88
|
let base = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
|
|
86
89
|
for (var i = 0, n = 0; i < 9; n += document[i] * base[i++])
|
|
@@ -2129,6 +2132,7 @@ class MonkeyEcxCommonsService {
|
|
|
2129
2132
|
this.__onSearchChanged$ = new BehaviorSubject(null);
|
|
2130
2133
|
this.__onDataChanged$ = new BehaviorSubject(null);
|
|
2131
2134
|
this.__onLoadingInProgress$ = new BehaviorSubject(false);
|
|
2135
|
+
this.__onUploadInProgress$ = new BehaviorSubject(false);
|
|
2132
2136
|
this.__onDataDeleted$ = new BehaviorSubject(null);
|
|
2133
2137
|
this.__onErrorChanged$ = new BehaviorSubject(null);
|
|
2134
2138
|
this.__onGovernmentIdDataChanged$ = new BehaviorSubject(null);
|
|
@@ -2149,7 +2153,7 @@ class MonkeyEcxCommonsService {
|
|
|
2149
2153
|
}
|
|
2150
2154
|
if (this.otherArgs?.router) {
|
|
2151
2155
|
const { clearOnChangeRoute } = this.otherArgs?.schedule?.options || {
|
|
2152
|
-
clearOnChangeRoute: false
|
|
2156
|
+
clearOnChangeRoute: false
|
|
2153
2157
|
};
|
|
2154
2158
|
this.otherArgs.router.events
|
|
2155
2159
|
.pipe(filter((event) => {
|
|
@@ -2165,7 +2169,7 @@ class MonkeyEcxCommonsService {
|
|
|
2165
2169
|
}
|
|
2166
2170
|
navigateToPendencyPage(arg, router) {
|
|
2167
2171
|
const { companyType } = this.__tokenCredentials || {
|
|
2168
|
-
companyType: ''
|
|
2172
|
+
companyType: ''
|
|
2169
2173
|
};
|
|
2170
2174
|
let route = '/app';
|
|
2171
2175
|
if (companyType) {
|
|
@@ -2181,9 +2185,9 @@ class MonkeyEcxCommonsService {
|
|
|
2181
2185
|
else {
|
|
2182
2186
|
router.navigate([`${route}/company-pendency`.toLowerCase()], {
|
|
2183
2187
|
state: {
|
|
2184
|
-
pendencyData: arg
|
|
2188
|
+
pendencyData: arg
|
|
2185
2189
|
},
|
|
2186
|
-
skipLocationChange: true
|
|
2190
|
+
skipLocationChange: true
|
|
2187
2191
|
});
|
|
2188
2192
|
}
|
|
2189
2193
|
}
|
|
@@ -2199,7 +2203,7 @@ class MonkeyEcxCommonsService {
|
|
|
2199
2203
|
allowedSecurityAccessByPendency(args) {
|
|
2200
2204
|
if (!args) {
|
|
2201
2205
|
return {
|
|
2202
|
-
hasPendencies: false
|
|
2206
|
+
hasPendencies: false
|
|
2203
2207
|
};
|
|
2204
2208
|
}
|
|
2205
2209
|
const { service, type } = args;
|
|
@@ -2239,21 +2243,21 @@ class MonkeyEcxCommonsService {
|
|
|
2239
2243
|
403: 'forbidden',
|
|
2240
2244
|
404: 'not-found',
|
|
2241
2245
|
500: 'service-problems',
|
|
2242
|
-
503: 'service-problems'
|
|
2246
|
+
503: 'service-problems'
|
|
2243
2247
|
};
|
|
2244
2248
|
if (!router) {
|
|
2245
2249
|
console.error('Router must be declared');
|
|
2246
2250
|
}
|
|
2247
2251
|
else {
|
|
2248
2252
|
router?.navigate([`/app/pages/${routes[statusCode]}`.toLowerCase()], {
|
|
2249
|
-
skipLocationChange: true
|
|
2253
|
+
skipLocationChange: true
|
|
2250
2254
|
});
|
|
2251
2255
|
}
|
|
2252
2256
|
}
|
|
2253
2257
|
setPage(requestPaged) {
|
|
2254
2258
|
this.__requestPaged = {
|
|
2255
2259
|
...this.__requestPaged,
|
|
2256
|
-
...requestPaged
|
|
2260
|
+
...requestPaged
|
|
2257
2261
|
};
|
|
2258
2262
|
return this;
|
|
2259
2263
|
}
|
|
@@ -2270,8 +2274,8 @@ class MonkeyEcxCommonsService {
|
|
|
2270
2274
|
...this.__requestPaged,
|
|
2271
2275
|
page: {
|
|
2272
2276
|
...page,
|
|
2273
|
-
number: number + 1
|
|
2274
|
-
}
|
|
2277
|
+
number: number + 1
|
|
2278
|
+
}
|
|
2275
2279
|
};
|
|
2276
2280
|
return true;
|
|
2277
2281
|
}
|
|
@@ -2328,8 +2332,8 @@ class MonkeyEcxCommonsService {
|
|
|
2328
2332
|
this.setPage({
|
|
2329
2333
|
page: {
|
|
2330
2334
|
number: 0,
|
|
2331
|
-
size: 10
|
|
2332
|
-
}
|
|
2335
|
+
size: 10
|
|
2336
|
+
}
|
|
2333
2337
|
});
|
|
2334
2338
|
}
|
|
2335
2339
|
if (otherArgs?.translateOptions) {
|
|
@@ -2372,7 +2376,7 @@ class MonkeyEcxCommonsService {
|
|
|
2372
2376
|
getHTTPHeaderApplicationPDF() {
|
|
2373
2377
|
return {
|
|
2374
2378
|
observe: 'response',
|
|
2375
|
-
responseType: 'blob'
|
|
2379
|
+
responseType: 'blob'
|
|
2376
2380
|
};
|
|
2377
2381
|
}
|
|
2378
2382
|
genericMethod(link, data, callback) {
|
|
@@ -2400,8 +2404,8 @@ class MonkeyEcxCommonsService {
|
|
|
2400
2404
|
if (!this.__onLoadingInProgress$.value) {
|
|
2401
2405
|
const hasMorePages = this.setPage({
|
|
2402
2406
|
page: {
|
|
2403
|
-
...this.__page
|
|
2404
|
-
}
|
|
2407
|
+
...this.__page
|
|
2408
|
+
}
|
|
2405
2409
|
}).nextPage();
|
|
2406
2410
|
if (hasMorePages && this.__callbackPagination) {
|
|
2407
2411
|
this.__callbackPagination();
|
|
@@ -2416,24 +2420,24 @@ class MonkeyEcxCommonsService {
|
|
|
2416
2420
|
router.navigate([url], {
|
|
2417
2421
|
queryParams: {
|
|
2418
2422
|
...search,
|
|
2419
|
-
r: MonkeyEcxUtils.getRandomString(30)
|
|
2423
|
+
r: MonkeyEcxUtils.getRandomString(30)
|
|
2420
2424
|
},
|
|
2421
2425
|
queryParamsHandling: 'merge',
|
|
2422
|
-
...extras
|
|
2426
|
+
...extras
|
|
2423
2427
|
});
|
|
2424
2428
|
}
|
|
2425
2429
|
saveState(state) {
|
|
2426
2430
|
this.__savedState = {
|
|
2427
2431
|
page: this.__page,
|
|
2428
|
-
...state
|
|
2432
|
+
...state
|
|
2429
2433
|
};
|
|
2430
2434
|
}
|
|
2431
2435
|
}
|
|
2432
2436
|
__decorate([
|
|
2433
2437
|
MonkeyEcxCoreService({
|
|
2434
2438
|
requestInProgress: {
|
|
2435
|
-
showProgress: true
|
|
2436
|
-
}
|
|
2439
|
+
showProgress: true
|
|
2440
|
+
}
|
|
2437
2441
|
})
|
|
2438
2442
|
], MonkeyEcxCommonsService.prototype, "genericMethod", null);
|
|
2439
2443
|
|