monkey-front-core 0.0.45 → 0.0.49

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.
@@ -1174,7 +1174,7 @@ function emailValidator(control) {
1174
1174
  if (test)
1175
1175
  return null;
1176
1176
  return {
1177
- email: true
1177
+ email: true,
1178
1178
  };
1179
1179
  }
1180
1180
  function dateRangeValidator(control) {
@@ -1187,7 +1187,7 @@ function dateRangeValidator(control) {
1187
1187
  (!MonkeyEcxUtils.persistNullEmptyUndefined(dates === null || dates === void 0 ? void 0 : dates.startDate) ||
1188
1188
  !MonkeyEcxUtils.persistNullEmptyUndefined(dates === null || dates === void 0 ? void 0 : dates.endDate))) {
1189
1189
  return {
1190
- dateRange: true
1190
+ dateRange: true,
1191
1191
  };
1192
1192
  }
1193
1193
  return null;
@@ -1198,7 +1198,7 @@ function registerValidator(control, type) {
1198
1198
  }
1199
1199
  if (control && control.value !== `#MONKEY${type}`.toUpperCase()) {
1200
1200
  return {
1201
- invalidUnlockRegister: true
1201
+ invalidUnlockRegister: true,
1202
1202
  };
1203
1203
  }
1204
1204
  return null;
@@ -1223,7 +1223,7 @@ function dateStartEndValidator(control) {
1223
1223
  return null;
1224
1224
  if (dateStart > dateEnd) {
1225
1225
  return {
1226
- dateStartMustBeLessThanAnd: true
1226
+ dateStartMustBeLessThanAnd: true,
1227
1227
  };
1228
1228
  }
1229
1229
  return null;
@@ -1233,7 +1233,7 @@ function urlValidator(control) {
1233
1233
  return null;
1234
1234
  if (!MonkeyEcxUtils.isValidUrl(control.value)) {
1235
1235
  return {
1236
- url: true
1236
+ url: true,
1237
1237
  };
1238
1238
  }
1239
1239
  return null;
@@ -1250,7 +1250,7 @@ function passwordConfirmValidator(control) {
1250
1250
  if (password === passwordConfirm)
1251
1251
  return null;
1252
1252
  return {
1253
- passwordsNotMatching: true
1253
+ passwordsNotMatching: true,
1254
1254
  };
1255
1255
  }
1256
1256
  function trueValidator(control) {
@@ -1259,7 +1259,7 @@ function trueValidator(control) {
1259
1259
  if (control && control.value !== false)
1260
1260
  return null;
1261
1261
  return {
1262
- invalidTrue: true
1262
+ invalidTrue: true,
1263
1263
  };
1264
1264
  }
1265
1265
  function comboValidator(control) {
@@ -1268,7 +1268,7 @@ function comboValidator(control) {
1268
1268
  if (control && control.value !== '0')
1269
1269
  return null;
1270
1270
  return {
1271
- invalidCombo: true
1271
+ invalidCombo: true,
1272
1272
  };
1273
1273
  }
1274
1274
  function zipCodeValidator(control) {
@@ -1277,7 +1277,7 @@ function zipCodeValidator(control) {
1277
1277
  if (control && control.value) {
1278
1278
  if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
1279
1279
  return {
1280
- invalidZipCode: true
1280
+ invalidZipCode: true,
1281
1281
  };
1282
1282
  }
1283
1283
  }
@@ -1289,14 +1289,14 @@ function documentValidator(control, country) {
1289
1289
  if (country === 'BR') {
1290
1290
  if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
1291
1291
  return {
1292
- invalidCpfCnpj: true
1292
+ invalidCpfCnpj: true,
1293
1293
  };
1294
1294
  }
1295
1295
  }
1296
1296
  else if (country === 'CL') {
1297
1297
  if (!MonkeyEcxUtils.isValidRUT(control.value)) {
1298
1298
  return {
1299
- invalidCpfCnpj: true
1299
+ invalidCpfCnpj: true,
1300
1300
  };
1301
1301
  }
1302
1302
  }
@@ -1308,7 +1308,17 @@ function dateValidator(control) {
1308
1308
  const dateFormat = 'MM-DD-YYYY';
1309
1309
  if (!moment(moment(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true).isValid()) {
1310
1310
  return {
1311
- invalidDate: true
1311
+ invalidDate: true,
1312
+ };
1313
+ }
1314
+ return null;
1315
+ }
1316
+ function valueGreaterThanZero(control) {
1317
+ if (!control.parent || !control || isEmptyInputValue(control.value))
1318
+ return null;
1319
+ if (control && `${control === null || control === void 0 ? void 0 : control.value}` === '0') {
1320
+ return {
1321
+ invalidValueGreaterThanZero: true,
1312
1322
  };
1313
1323
  }
1314
1324
  return null;
@@ -1353,6 +1363,9 @@ class Validators {
1353
1363
  static date(control) {
1354
1364
  return dateValidator(control);
1355
1365
  }
1366
+ static greaterThanZero(control) {
1367
+ return dateValidator(control);
1368
+ }
1356
1369
  }
1357
1370
 
1358
1371
  /* eslint-disable object-curly-newline */
@@ -1722,11 +1735,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1722
1735
  }] } });
1723
1736
 
1724
1737
  class MonkeyEcxRequestPagedHandling {
1725
- constructor(_url, _pagedParams) {
1738
+ constructor(_url, _pagedParams, _links) {
1726
1739
  this.url = _url;
1727
1740
  this.pagedParams = _pagedParams || {
1728
- page: {}
1741
+ page: {},
1729
1742
  };
1743
+ this.links = _links;
1730
1744
  }
1731
1745
  handlePagedValuesFromApi(url = '') {
1732
1746
  if (url.search('\\?') < 0)
@@ -1734,8 +1748,11 @@ class MonkeyEcxRequestPagedHandling {
1734
1748
  const params = url.substring(url.search('\\?') + 1, url.length);
1735
1749
  url = url.substring(0, url.search('\\?'));
1736
1750
  return `${url}?${new HttpParams({
1737
- fromString: params
1738
- }).delete('size').delete('page').toString()}`;
1751
+ fromString: params,
1752
+ })
1753
+ .delete('size')
1754
+ .delete('page')
1755
+ .toString()}`;
1739
1756
  }
1740
1757
  getUrlParams(url) {
1741
1758
  const { pagedParams } = this;
@@ -1744,7 +1761,10 @@ class MonkeyEcxRequestPagedHandling {
1744
1761
  return `${!hasInitialQueryParams ? '?' : '&'}page=${number || 0}&size=${size || 20}`;
1745
1762
  }
1746
1763
  getRequestWithPagedParams() {
1747
- const { url } = this;
1764
+ const { url, links } = this;
1765
+ if (links && links.next) {
1766
+ return links.next.href;
1767
+ }
1748
1768
  const handled = this.handlePagedValuesFromApi(url);
1749
1769
  return `${handled}${this.getUrlParams(handled)}`;
1750
1770
  }
@@ -1759,6 +1779,7 @@ class MonkeyEcxCommonsService {
1759
1779
  this.__error = null;
1760
1780
  this.__handledError = null;
1761
1781
  this.__page = null;
1782
+ this.__links = null;
1762
1783
  this.__requestPaged = null;
1763
1784
  this.__onSearchChanged$ = new BehaviorSubject(null);
1764
1785
  this.__onDataChanged$ = new BehaviorSubject(null);
@@ -1850,6 +1871,10 @@ class MonkeyEcxCommonsService {
1850
1871
  return this;
1851
1872
  }
1852
1873
  nextPage() {
1874
+ var _a;
1875
+ if (this.__links) {
1876
+ return !!((_a = this.__links) === null || _a === void 0 ? void 0 : _a.next);
1877
+ }
1853
1878
  if (!this.__requestPaged)
1854
1879
  return false;
1855
1880
  const { page } = this.__requestPaged;
@@ -1865,8 +1890,8 @@ class MonkeyEcxCommonsService {
1865
1890
  return _embedded ? _embedded[field] : null;
1866
1891
  }
1867
1892
  getNormalizedUrl(url) {
1868
- const { __requestPaged } = this;
1869
- return new MonkeyEcxRequestPagedHandling(url, __requestPaged || {}).getRequestWithPagedParams();
1893
+ const { __requestPaged, __links } = this;
1894
+ return new MonkeyEcxRequestPagedHandling(url, __requestPaged || {}, __links).getRequestWithPagedParams();
1870
1895
  }
1871
1896
  clear(clearData) {
1872
1897
  var _a, _b, _c, _d, _e, _f;
@@ -1875,6 +1900,7 @@ class MonkeyEcxCommonsService {
1875
1900
  this.__requestPaged = null;
1876
1901
  this.__params = null;
1877
1902
  this.__page = null;
1903
+ this.__links = null;
1878
1904
  if (this.__schedule) {
1879
1905
  const { queue } = this.__schedule;
1880
1906
  if (queue) {
@@ -2601,8 +2627,8 @@ class MonkeyEcxTokenStorageService {
2601
2627
  programType: '',
2602
2628
  role: '',
2603
2629
  _clearIgnore: {
2604
- ignore: ['username', 'program']
2605
- }
2630
+ ignore: ['username', 'program'],
2631
+ },
2606
2632
  };
2607
2633
  this.token$ = new BehaviorSubject(null);
2608
2634
  this.me$ = new BehaviorSubject(null);
@@ -2633,7 +2659,7 @@ class MonkeyEcxTokenStorageService {
2633
2659
  }
2634
2660
  setAllMe(me) {
2635
2661
  const { me$ } = this;
2636
- let previousMe = JSON.parse((localStorage === null || localStorage === void 0 ? void 0 : localStorage.getItem('me')) || '');
2662
+ let previousMe = JSON.parse((localStorage === null || localStorage === void 0 ? void 0 : localStorage.getItem('me')) || '{}');
2637
2663
  Object.entries(me).forEach(([key, value]) => {
2638
2664
  if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
2639
2665
  previousMe = Object.assign(Object.assign({}, previousMe), { [key]: value });
@@ -2644,7 +2670,7 @@ class MonkeyEcxTokenStorageService {
2644
2670
  }
2645
2671
  getAllMe() {
2646
2672
  const me = localStorage.getItem('me');
2647
- return JSON.parse(me || '');
2673
+ return JSON.parse(me || '{}');
2648
2674
  }
2649
2675
  tokenHasChanged() {
2650
2676
  return this.token$.asObservable();
@@ -2697,7 +2723,7 @@ MonkeyEcxTokenStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "
2697
2723
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxTokenStorageService, decorators: [{
2698
2724
  type: Injectable,
2699
2725
  args: [{
2700
- providedIn: 'root'
2726
+ providedIn: 'root',
2701
2727
  }]
2702
2728
  }], ctorParameters: function () { return [{ type: MonkeyEcxConfigService }]; } });
2703
2729
 
@@ -4173,5 +4199,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4173
4199
  * Generated bundle index. Do not edit.
4174
4200
  */
4175
4201
 
4176
- export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDatePipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, 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, zipCodeValidator };
4202
+ export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDatePipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, 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 };
4177
4203
  //# sourceMappingURL=monkey-front-core.mjs.map