@senior-agronegocio/angular-components 0.0.9859 → 0.0.9860

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 (109) hide show
  1. package/bundles/senior-agronegocio-angular-components.umd.js +50 -797
  2. package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-agronegocio-angular-components.umd.min.js +2 -2
  4. package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
  5. package/common/agro-regex.constant.d.ts +0 -3
  6. package/common/agro-string-utils.class.d.ts +0 -3
  7. package/components/index.d.ts +0 -1
  8. package/esm2015/common/agro-platform-utils.class.js +7 -8
  9. package/esm2015/common/agro-regex.constant.js +2 -5
  10. package/esm2015/common/agro-string-utils.class.js +11 -27
  11. package/esm2015/components/index.js +1 -2
  12. package/esm2015/lib-translation.module.js +1 -3
  13. package/esm2015/pipe/index.js +1 -5
  14. package/esm2015/public-api.js +3 -3
  15. package/esm2015/senior-agronegocio-angular-components.js +2 -3
  16. package/esm2015/services/i18n/en-US.js +2 -9
  17. package/esm2015/services/i18n/es-CO.js +3 -10
  18. package/esm2015/services/i18n/pt-BR.js +3 -11
  19. package/esm2015/services/lib-translation.service.js +3 -3
  20. package/esm5/common/agro-platform-utils.class.js +7 -8
  21. package/esm5/common/agro-regex.constant.js +2 -5
  22. package/esm5/common/agro-string-utils.class.js +11 -27
  23. package/esm5/components/index.js +1 -2
  24. package/esm5/lib-translation.module.js +1 -3
  25. package/esm5/pipe/index.js +1 -5
  26. package/esm5/public-api.js +3 -3
  27. package/esm5/senior-agronegocio-angular-components.js +2 -3
  28. package/esm5/services/i18n/en-US.js +2 -9
  29. package/esm5/services/i18n/es-CO.js +3 -10
  30. package/esm5/services/i18n/pt-BR.js +3 -11
  31. package/esm5/services/lib-translation.service.js +3 -3
  32. package/fesm2015/senior-agronegocio-angular-components.js +52 -723
  33. package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
  34. package/fesm5/senior-agronegocio-angular-components.js +57 -791
  35. package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
  36. package/package.json +55 -7
  37. package/pipe/index.d.ts +0 -4
  38. package/public-api.d.ts +2 -2
  39. package/senior-agronegocio-angular-components.d.ts +1 -2
  40. package/senior-agronegocio-angular-components.metadata.json +1 -1
  41. package/services/i18n/en-US.d.ts +1 -8
  42. package/services/i18n/es-CO.d.ts +1 -8
  43. package/services/i18n/pt-BR.d.ts +1 -9
  44. package/common/agro-object-stringifier.class.d.ts +0 -16
  45. package/components/modal-invoice-pj-selector/index.d.ts +0 -4
  46. package/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.d.ts +0 -10
  47. package/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.d.ts +0 -40
  48. package/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.d.ts +0 -2
  49. package/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.d.ts +0 -2
  50. package/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.d.ts +0 -16
  51. package/components/modal-invoice-pj-selector/services/agro-invoice/index.d.ts +0 -2
  52. package/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.d.ts +0 -73
  53. package/esm2015/common/agro-object-stringifier.class.js +0 -31
  54. package/esm2015/components/modal-invoice-pj-selector/index.js +0 -4
  55. package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.js +0 -1
  56. package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.js +0 -188
  57. package/esm2015/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.js +0 -42
  58. package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.js +0 -28
  59. package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.js +0 -49
  60. package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/index.js +0 -3
  61. package/esm2015/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.js +0 -13
  62. package/esm2015/pipe/cnpj-cpf/cnpj-cpf.pipe.js +0 -28
  63. package/esm2015/pipe/cnpj-cpf/cnpj-cpf.pipe.module.js +0 -15
  64. package/esm2015/pipe/cnpj-cpf/index.js +0 -3
  65. package/esm2015/pipe/kilogram/index.js +0 -3
  66. package/esm2015/pipe/kilogram/kilogram.module.js +0 -17
  67. package/esm2015/pipe/kilogram/kilogram.pipe.js +0 -38
  68. package/esm2015/pipe/stringifier/index.js +0 -3
  69. package/esm2015/pipe/stringifier/stringifier.pipe.js +0 -13
  70. package/esm2015/pipe/stringifier/stringifier.pipe.module.js +0 -15
  71. package/esm2015/pipe/telephone/index.js +0 -3
  72. package/esm2015/pipe/telephone/telephone.pipe.js +0 -91
  73. package/esm2015/pipe/telephone/telephone.pipe.module.js +0 -15
  74. package/esm2015/services/entity-service.js +0 -124
  75. package/esm5/common/agro-object-stringifier.class.js +0 -35
  76. package/esm5/components/modal-invoice-pj-selector/index.js +0 -4
  77. package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector-options.interface.js +0 -1
  78. package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector.component.js +0 -197
  79. package/esm5/components/modal-invoice-pj-selector/modal-invoice-pj-selector.module.js +0 -45
  80. package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.module.js +0 -31
  81. package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/agro-invoice.service.js +0 -56
  82. package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/index.js +0 -3
  83. package/esm5/components/modal-invoice-pj-selector/services/agro-invoice/interfaces.js +0 -13
  84. package/esm5/pipe/cnpj-cpf/cnpj-cpf.pipe.js +0 -35
  85. package/esm5/pipe/cnpj-cpf/cnpj-cpf.pipe.module.js +0 -18
  86. package/esm5/pipe/cnpj-cpf/index.js +0 -3
  87. package/esm5/pipe/kilogram/index.js +0 -3
  88. package/esm5/pipe/kilogram/kilogram.module.js +0 -20
  89. package/esm5/pipe/kilogram/kilogram.pipe.js +0 -41
  90. package/esm5/pipe/stringifier/index.js +0 -3
  91. package/esm5/pipe/stringifier/stringifier.pipe.js +0 -16
  92. package/esm5/pipe/stringifier/stringifier.pipe.module.js +0 -18
  93. package/esm5/pipe/telephone/index.js +0 -3
  94. package/esm5/pipe/telephone/telephone.pipe.js +0 -95
  95. package/esm5/pipe/telephone/telephone.pipe.module.js +0 -18
  96. package/esm5/services/entity-service.js +0 -135
  97. package/pipe/cnpj-cpf/cnpj-cpf.pipe.d.ts +0 -4
  98. package/pipe/cnpj-cpf/cnpj-cpf.pipe.module.d.ts +0 -2
  99. package/pipe/cnpj-cpf/index.d.ts +0 -2
  100. package/pipe/kilogram/index.d.ts +0 -2
  101. package/pipe/kilogram/kilogram.module.d.ts +0 -2
  102. package/pipe/kilogram/kilogram.pipe.d.ts +0 -8
  103. package/pipe/stringifier/index.d.ts +0 -2
  104. package/pipe/stringifier/stringifier.pipe.d.ts +0 -9
  105. package/pipe/stringifier/stringifier.pipe.module.d.ts +0 -2
  106. package/pipe/telephone/index.d.ts +0 -2
  107. package/pipe/telephone/telephone.pipe.d.ts +0 -21
  108. package/pipe/telephone/telephone.pipe.module.d.ts +0 -2
  109. package/services/entity-service.d.ts +0 -72
@@ -1,17 +1,17 @@
1
1
  import { __assign, __values, __read, __awaiter, __generator, __spread, __decorate, __extends } from 'tslib';
2
2
  import moment from 'moment';
3
- import { Subject, BehaviorSubject, of, throwError, scheduled, asyncScheduler, timer } from 'rxjs';
3
+ import { Subject, BehaviorSubject, of, throwError } from 'rxjs';
4
4
  import sockjsClient from 'sockjs-client';
5
- import { ɵɵdefineInjectable, Injectable, ɵɵinject, NgModule, Pipe, Input, Component, EventEmitter, Output, LOCALE_ID, InjectionToken } from '@angular/core';
6
- import { filter, take, finalize, switchMap, map, catchError, takeUntil, concatMap, tap, scan, defaultIfEmpty, debounceTime } from 'rxjs/operators';
5
+ import { ɵɵdefineInjectable, Injectable, ɵɵinject, NgModule, Input, Component, EventEmitter, Output, LOCALE_ID, Pipe, InjectionToken } from '@angular/core';
6
+ import { filter, take, finalize, switchMap, map, catchError, takeUntil } from 'rxjs/operators';
7
7
  import { Client, FrameImpl } from '@stomp/stompjs';
8
8
  import { get } from 'js-cookie';
9
- import { CommonModule, DecimalPipe, registerLocaleData, DatePipe } from '@angular/common';
9
+ import { CommonModule, registerLocaleData } from '@angular/common';
10
10
  import localePt from '@angular/common/locales/pt';
11
11
  import { Validators, FormControl, FormGroup, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
12
- import { ButtonPriority, FormField, FieldType, BadgeColors, StepState as StepState$1, ButtonModule, CustomFieldsModule, ControlErrorsModule, EmptyStateModule, DynamicFormModule, TokenListModule, SidebarModule, LoadingStateModule, NumberInputModule, TableModule as TableModule$1, ObjectCardModule, LocaleModule, BadgeModule, BignumberInputModule, TableHeaderCheckboxModule } from '@seniorsistemas/angular-components';
13
- import { DynamicDialogConfig, DynamicDialogRef, MessageService as MessageService$1, DialogService, DialogModule, FieldsetModule, InputTextModule as InputTextModule$1, SharedModule as SharedModule$2, ConfirmDialogModule as ConfirmDialogModule$1 } from 'primeng';
14
- import { HttpParams, HttpClient, HttpClientModule } from '@angular/common/http';
12
+ import { ButtonPriority, FormField, FieldType, BadgeColors, StepState as StepState$1, ButtonModule, CustomFieldsModule, ControlErrorsModule, EmptyStateModule, DynamicFormModule, TokenListModule, SidebarModule, LoadingStateModule, NumberInputModule, TableModule as TableModule$1, ObjectCardModule, LocaleModule, BadgeModule } from '@seniorsistemas/angular-components';
13
+ import { DynamicDialogConfig, DynamicDialogRef, MessageService as MessageService$1, DialogService, DialogModule, FieldsetModule } from 'primeng';
14
+ import { HttpParams, HttpClient } from '@angular/common/http';
15
15
  import { MessageService, SharedModule as SharedModule$1 } from 'primeng/api';
16
16
  import { user } from '@seniorsistemas/senior-platform-data';
17
17
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
@@ -184,10 +184,7 @@ var AGRO_REGEX = {
184
184
  * Validação de Placa de Veículo Antiga
185
185
  * Formato: AAA-0000
186
186
  */
187
- isOldLicensePlate: /^[A-Z]{3}\d{4}$/,
188
- isISODate: /^\d{4}-\d{2}-\d{2}$/,
189
- isISOTime: /^\d{2}:\d{2}:\d{2}$/,
190
- isISODateTime: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/,
187
+ isOldLicensePlate: /^[A-Z]{3}[0-9]{4}$/
191
188
  };
192
189
 
193
190
  var NumberComparisonType;
@@ -2090,19 +2087,13 @@ var AgroStringUtils = /** @class */ (function () {
2090
2087
  */
2091
2088
  AgroStringUtils.isEmpty = function (str) {
2092
2089
  var _a;
2093
- if (str && AgroStringUtils.isString(str)) {
2094
- return ((_a = str === null || str === void 0 ? void 0 : str.trim()) === null || _a === void 0 ? void 0 : _a.length) === AGRO_NUMBERS.ZERO;
2095
- }
2096
- return true;
2090
+ return !str || ((_a = str.trim()) === null || _a === void 0 ? void 0 : _a.length) === AGRO_NUMBERS.ZERO;
2097
2091
  };
2098
2092
  /**
2099
2093
  * Verifica se a string não está vazia.
2100
2094
  */
2101
2095
  AgroStringUtils.isNotEmpty = function (str) {
2102
- if (str && AgroStringUtils.isString(str)) {
2103
- return !AgroStringUtils.isEmpty(str);
2104
- }
2105
- return false;
2096
+ return !AgroStringUtils.isEmpty(str);
2106
2097
  };
2107
2098
  /** Verifica se a string é nula, indefinida ou contém apenas espaços em branco */
2108
2099
  AgroStringUtils.isBlank = function (str) {
@@ -2157,7 +2148,7 @@ var AgroStringUtils = /** @class */ (function () {
2157
2148
  return AGRO_REGEX.isUUID.test(str);
2158
2149
  };
2159
2150
  AgroStringUtils.isNumber = function (str) {
2160
- return [AGRO_REGEX.isNumber.test(str), AGRO_REGEX.isDecimal.test(str)].includes(true);
2151
+ return AGRO_REGEX.isNumber.test(str);
2161
2152
  };
2162
2153
  AgroStringUtils.validateCPF = function (cpf) {
2163
2154
  cpf = cpf.replace(/\D/g, "");
@@ -2174,7 +2165,7 @@ var AgroStringUtils = /** @class */ (function () {
2174
2165
  };
2175
2166
  var digit1 = calcVerifier(cpf, AGRO_NUMBERS.NINE);
2176
2167
  var digit2 = calcVerifier(cpf, AGRO_NUMBERS.TEN);
2177
- return (digit1 === parseInt(cpf[AGRO_NUMBERS.NINE], AGRO_NUMBERS.TEN) && digit2 === parseInt(cpf[AGRO_NUMBERS.TEN], AGRO_NUMBERS.TEN));
2168
+ return digit1 === parseInt(cpf[AGRO_NUMBERS.NINE], AGRO_NUMBERS.TEN) && digit2 === parseInt(cpf[AGRO_NUMBERS.TEN], AGRO_NUMBERS.TEN);
2178
2169
  };
2179
2170
  /**
2180
2171
  * Detecta automaticamente se é CNPJ antigo ou novo formato.
@@ -2217,8 +2208,7 @@ var AgroStringUtils = /** @class */ (function () {
2217
2208
  }
2218
2209
  resto = soma % AGRO_NUMBERS.ELEVEN;
2219
2210
  var digito2 = resto < AGRO_NUMBERS.TWO ? AGRO_NUMBERS.ZERO : AGRO_NUMBERS.ELEVEN - resto;
2220
- return (parseInt(cnpj.charAt(AGRO_NUMBERS.TWELVE), AGRO_NUMBERS.TEN) === digito1 &&
2221
- parseInt(cnpj.charAt(AGRO_NUMBERS.THIRTEEN), AGRO_NUMBERS.TEN) === digito2);
2211
+ return parseInt(cnpj.charAt(AGRO_NUMBERS.TWELVE), AGRO_NUMBERS.TEN) === digito1 && parseInt(cnpj.charAt(AGRO_NUMBERS.THIRTEEN), AGRO_NUMBERS.TEN) === digito2;
2222
2212
  };
2223
2213
  /**
2224
2214
  * Valida o CNPJ em formato alfanumérico (padrão 2026)
@@ -2321,7 +2311,7 @@ var AgroStringUtils = /** @class */ (function () {
2321
2311
  */
2322
2312
  AgroStringUtils.applyMask = function (value, mask) {
2323
2313
  var e_1, _a;
2324
- var valueChars = value.replace(/[^A-Za-z0-9]/g, "");
2314
+ var valueChars = value.toString().split("");
2325
2315
  var maskChars = mask.split("");
2326
2316
  var maskedValue = "";
2327
2317
  var j = AGRO_NUMBERS.ZERO;
@@ -2355,15 +2345,6 @@ var AgroStringUtils = /** @class */ (function () {
2355
2345
  AgroStringUtils.isInvalid = function (str) {
2356
2346
  return !AgroStringUtils.isValid(str);
2357
2347
  };
2358
- AgroStringUtils.isISODate = function (value) {
2359
- return AGRO_REGEX.isISODate.test(value);
2360
- };
2361
- AgroStringUtils.isISOTime = function (value) {
2362
- return AGRO_REGEX.isISOTime.test(value);
2363
- };
2364
- AgroStringUtils.isISODatetime = function (value) {
2365
- return AGRO_REGEX.isISODateTime.test(value);
2366
- };
2367
2348
  AgroStringUtils.CNPJ_TRADICIONAL_PESOS_1 = [
2368
2349
  AGRO_NUMBERS.FIVE,
2369
2350
  AGRO_NUMBERS.FOUR,
@@ -2376,7 +2357,7 @@ var AgroStringUtils = /** @class */ (function () {
2376
2357
  AGRO_NUMBERS.FIVE,
2377
2358
  AGRO_NUMBERS.FOUR,
2378
2359
  AGRO_NUMBERS.THREE,
2379
- AGRO_NUMBERS.TWO,
2360
+ AGRO_NUMBERS.TWO
2380
2361
  ];
2381
2362
  AgroStringUtils.CNPJ_TRADICIONAL_PESOS_2 = [
2382
2363
  AGRO_NUMBERS.SIX,
@@ -2391,7 +2372,7 @@ var AgroStringUtils = /** @class */ (function () {
2391
2372
  AGRO_NUMBERS.FIVE,
2392
2373
  AGRO_NUMBERS.FOUR,
2393
2374
  AGRO_NUMBERS.THREE,
2394
- AGRO_NUMBERS.TWO,
2375
+ AGRO_NUMBERS.TWO
2395
2376
  ];
2396
2377
  // Pesos utilizados para cálculo de dígitos verificadores do CNPJ alfanumérico (2026)
2397
2378
  AgroStringUtils.CNPJ_ALFANUMERICO_PESOS_1 = [
@@ -2406,7 +2387,7 @@ var AgroStringUtils = /** @class */ (function () {
2406
2387
  AGRO_NUMBERS.FIVE,
2407
2388
  AGRO_NUMBERS.FOUR,
2408
2389
  AGRO_NUMBERS.THREE,
2409
- AGRO_NUMBERS.TWO,
2390
+ AGRO_NUMBERS.TWO
2410
2391
  ];
2411
2392
  AgroStringUtils.CNPJ_ALFANUMERICO_PESOS_2 = [
2412
2393
  AGRO_NUMBERS.SIX,
@@ -2421,7 +2402,7 @@ var AgroStringUtils = /** @class */ (function () {
2421
2402
  AGRO_NUMBERS.FIVE,
2422
2403
  AGRO_NUMBERS.FOUR,
2423
2404
  AGRO_NUMBERS.THREE,
2424
- AGRO_NUMBERS.TWO,
2405
+ AGRO_NUMBERS.TWO
2425
2406
  ];
2426
2407
  return AgroStringUtils;
2427
2408
  }());
@@ -2439,7 +2420,7 @@ var AgroPlatformUtils = /** @class */ (function () {
2439
2420
  * @returns
2440
2421
  */
2441
2422
  AgroPlatformUtils.getCurrentTenant = function () {
2442
- var tenant = AgroPlatformUtils.getTokenField("tenantName");
2423
+ var tenant = AgroPlatformUtils.getTokenField('tenantName');
2443
2424
  if (tenant) {
2444
2425
  return tenant;
2445
2426
  }
@@ -2451,18 +2432,17 @@ var AgroPlatformUtils = /** @class */ (function () {
2451
2432
  * @returns
2452
2433
  */
2453
2434
  AgroPlatformUtils.getCurrentTenantLocale = function () {
2454
- var locale = AgroPlatformUtils.getTokenField("locale");
2435
+ var locale = AgroPlatformUtils.getTokenField('locale');
2455
2436
  if (locale) {
2456
2437
  return locale;
2457
2438
  }
2458
- throw new Error("'locale' n\u00E3o encontrado para o tenant atual.");
2439
+ throw new Error("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2459
2440
  };
2460
2441
  /**
2461
2442
  * @deprecated Use getCurrentTenantLocale()
2462
2443
  * Mantido por compatibilidade retroativa.
2463
2444
  */
2464
2445
  AgroPlatformUtils.getCurrenTenantLocale = function () {
2465
- // legacy typo retained
2466
2446
  return AgroPlatformUtils.getCurrentTenantLocale();
2467
2447
  };
2468
2448
  /**
@@ -2471,7 +2451,7 @@ var AgroPlatformUtils = /** @class */ (function () {
2471
2451
  * @returns string || null
2472
2452
  */
2473
2453
  AgroPlatformUtils.getCurrentUserName = function () {
2474
- var name = AgroPlatformUtils.getTokenField("fullName");
2454
+ var name = AgroPlatformUtils.getTokenField('fullName');
2475
2455
  return name || null;
2476
2456
  };
2477
2457
  /**
@@ -2480,7 +2460,7 @@ var AgroPlatformUtils = /** @class */ (function () {
2480
2460
  * @returns string
2481
2461
  */
2482
2462
  AgroPlatformUtils.getCurrentUserEmail = function () {
2483
- var email = AgroPlatformUtils.getTokenField("email");
2463
+ var email = AgroPlatformUtils.getTokenField('email');
2484
2464
  if (!email) {
2485
2465
  console.info("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2486
2466
  }
@@ -2515,7 +2495,7 @@ var AgroPlatformUtils = /** @class */ (function () {
2515
2495
  * Caso contrário, retorna uma instância de Error
2516
2496
  */
2517
2497
  AgroPlatformUtils.getCurrentAccessToken = function () {
2518
- var token = AgroPlatformUtils.getTokenField("access_token");
2498
+ var token = AgroPlatformUtils.getTokenField('access_token');
2519
2499
  if (!token) {
2520
2500
  console.info("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2521
2501
  }
@@ -3651,7 +3631,7 @@ var ptBR = {
3651
3631
  "agro.angular_components.save": "Salvar",
3652
3632
  "agro.angular_components.select": "Selecione",
3653
3633
  "agro.angular_components.updated_by": "Atualizado por",
3654
- error_invalid: "Valor inválido",
3634
+ "error_invalid": "Valor inválido",
3655
3635
  "agro.angular_components.choose_label": "Escolha",
3656
3636
  "agro.angular_components.remove_label": "Remover",
3657
3637
  "agro.angular_components.cancel_label": "Cancelar",
@@ -3755,16 +3735,8 @@ var ptBR = {
3755
3735
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Produto",
3756
3736
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidade de medida",
3757
3737
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
3738
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de dados do NovoReceituário",
3758
3739
  "agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
3759
- "agro.angular_components.number_or_series": "Número ou série",
3760
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
3761
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
3762
- "agro.angular_components.number": "Número",
3763
- "agro.angular_components.series": "Série",
3764
- "agro.angular_components.itens": "Itens",
3765
- "agro.angular_components.quantity": "Quantidade",
3766
- "agro.angular_components.issuance_date": "Data de emissão",
3767
- "agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
3768
3740
  };
3769
3741
 
3770
3742
  var enUS = {
@@ -4020,15 +3992,8 @@ var enUS = {
4020
3992
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Cidasc Load - Product",
4021
3993
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Cidasc Load - Unit of measure",
4022
3994
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Cidasc Load - Measure per hectare",
3995
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Prescription data load",
4023
3996
  "agro.angular_components.agronomic_prescription_origin_event": "Agronomic Prescription",
4024
- "agro.angular_components.number_or_series": "Número ou série",
4025
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
4026
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
4027
- "agro.angular_components.number": "Número",
4028
- "agro.angular_components.series": "Série",
4029
- "agro.angular_components.itens": "Itens",
4030
- "agro.angular_components.quantity": "Quantidade",
4031
- "agro.angular_components.issuance_date": "Data de emissão",
4032
3997
  };
4033
3998
 
4034
3999
  var esCO = {
@@ -4186,7 +4151,7 @@ var esCO = {
4186
4151
  "agro.angular_components.save": "Guardar",
4187
4152
  "agro.angular_components.select": "Seleccione",
4188
4153
  "agro.angular_components.updated_by": "Actualizado por",
4189
- error_invalid: "Valor inválido",
4154
+ "error_invalid": "Valor inválido",
4190
4155
  "agro.angular_components.choose_label": "Elegir",
4191
4156
  "agro.angular_components.remove_label": "Eliminar",
4192
4157
  "agro.angular_components.cancel_label": "Cancelar",
@@ -4284,15 +4249,8 @@ var esCO = {
4284
4249
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Producto",
4285
4250
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidad de medida",
4286
4251
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectárea",
4252
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de datos de la Nueva Receta",
4287
4253
  "agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
4288
- "agro.angular_components.number_or_series": "Número ou série",
4289
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
4290
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
4291
- "agro.angular_components.number": "Número",
4292
- "agro.angular_components.series": "Série",
4293
- "agro.angular_components.itens": "Itens",
4294
- "agro.angular_components.quantity": "Quantidade",
4295
- "agro.angular_components.issuance_date": "Data de emissão",
4296
4254
  };
4297
4255
 
4298
4256
  var LibTranslationService = /** @class */ (function () {
@@ -4303,10 +4261,10 @@ var LibTranslationService = /** @class */ (function () {
4303
4261
  "es-CO": esCO,
4304
4262
  };
4305
4263
  this.currentTranslation = {};
4306
- this.setLang("pt-BR");
4264
+ this.setLang(this.getLangOfUser());
4307
4265
  }
4308
4266
  LibTranslationService.prototype.getLangOfUser = function () {
4309
- return AgroPlatformUtils.getCurrentTenantLocale() || "pt-BR";
4267
+ return AgroPlatformUtils.getCurrenTenantLocale() || "pt-BR";
4310
4268
  };
4311
4269
  LibTranslationService.prototype.setLang = function (lang) {
4312
4270
  this.currentTranslation = this.availableTranslations[lang] || {};
@@ -4346,288 +4304,6 @@ var LibTranslationService = /** @class */ (function () {
4346
4304
  return LibTranslationService;
4347
4305
  }());
4348
4306
 
4349
- var KilogramPipe = /** @class */ (function () {
4350
- function KilogramPipe(decimalPipe) {
4351
- this.decimalPipe = decimalPipe;
4352
- }
4353
- KilogramPipe.prototype.transform = function (value, format, kgCaseInsensitive) {
4354
- if (format === void 0) { format = "1.3-3"; }
4355
- if (kgCaseInsensitive === void 0) { kgCaseInsensitive = "UPPER"; }
4356
- if (value == null || isNaN(value)) {
4357
- return "";
4358
- }
4359
- var str = this.decimalPipe.transform(value, format);
4360
- var kgStr = "kg";
4361
- if (!str) {
4362
- console.info("Formato do peso inválido para transformação");
4363
- return "";
4364
- }
4365
- str = str.replace(/,/g, ".");
4366
- return this.replaceLastDotWithComma(str) + " " + (kgCaseInsensitive === "UPPER" ? kgStr.toUpperCase() : kgStr.toLowerCase());
4367
- };
4368
- KilogramPipe.prototype.replaceLastDotWithComma = function (value) {
4369
- var lastDotIndex = value.lastIndexOf(".");
4370
- if (lastDotIndex === -1) {
4371
- return value;
4372
- }
4373
- return value.substring(0, lastDotIndex) + "," + value.substring(lastDotIndex + 1);
4374
- };
4375
- KilogramPipe.ctorParameters = function () { return [
4376
- { type: DecimalPipe }
4377
- ]; };
4378
- KilogramPipe = __decorate([
4379
- Pipe({
4380
- name: "kilogram",
4381
- })
4382
- ], KilogramPipe);
4383
- return KilogramPipe;
4384
- }());
4385
-
4386
- var KilogramModule = /** @class */ (function () {
4387
- function KilogramModule() {
4388
- }
4389
- KilogramModule = __decorate([
4390
- NgModule({
4391
- declarations: [KilogramPipe],
4392
- imports: [
4393
- CommonModule
4394
- ],
4395
- exports: [KilogramPipe]
4396
- })
4397
- ], KilogramModule);
4398
- return KilogramModule;
4399
- }());
4400
-
4401
- var CnpjCpfPipe = /** @class */ (function () {
4402
- function CnpjCpfPipe() {
4403
- }
4404
- CnpjCpfPipe.prototype.transform = function (value) {
4405
- var args = [];
4406
- for (var _i = 1; _i < arguments.length; _i++) {
4407
- args[_i - 1] = arguments[_i];
4408
- }
4409
- if (typeof value !== "string" && typeof value === "number") {
4410
- value = value === null || value === void 0 ? void 0 : value.toString();
4411
- }
4412
- if (typeof value !== "string") {
4413
- return value;
4414
- }
4415
- if (AgroStringUtils.validateCNPJ(value)) {
4416
- return AgroStringUtils.applyMask(value, AgroStringMasks.CNPJ);
4417
- }
4418
- if (AgroStringUtils.validateCPF(value)) {
4419
- return AgroStringUtils.applyMask(value, AgroStringMasks.CPF);
4420
- }
4421
- return value;
4422
- };
4423
- CnpjCpfPipe = __decorate([
4424
- Pipe({
4425
- name: "cnpjCpf",
4426
- })
4427
- ], CnpjCpfPipe);
4428
- return CnpjCpfPipe;
4429
- }());
4430
-
4431
- var CnpjCpfPipeModule = /** @class */ (function () {
4432
- function CnpjCpfPipeModule() {
4433
- }
4434
- CnpjCpfPipeModule = __decorate([
4435
- NgModule({
4436
- declarations: [CnpjCpfPipe],
4437
- imports: [CommonModule],
4438
- exports: [CnpjCpfPipe],
4439
- })
4440
- ], CnpjCpfPipeModule);
4441
- return CnpjCpfPipeModule;
4442
- }());
4443
-
4444
- var AgroObjectStringifier = /** @class */ (function () {
4445
- function AgroObjectStringifier() {
4446
- }
4447
- /**
4448
- * Formata um objeto concatenando valores segundo as chaves e pipes informados.
4449
- *
4450
- * @param separator Separador entre os valores (ex: "-")
4451
- * @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
4452
- * @param obj Objeto origem
4453
- */
4454
- AgroObjectStringifier.formatObject = function (separator, fields, obj, usePipes) {
4455
- function mapField(field) {
4456
- var value = AgroObjectStringifier.resolvePath(obj, field);
4457
- if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
4458
- return usePipes[field].transform(value);
4459
- }
4460
- return value !== null && value !== void 0 ? value : "";
4461
- }
4462
- function filterValid(v) {
4463
- return typeof v === "number" || AgroStringUtils.isValid(v);
4464
- }
4465
- return fields.map(mapField).filter(filterValid).join(" " + separator + " ");
4466
- };
4467
- /** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
4468
- AgroObjectStringifier.resolvePath = function (obj, path) {
4469
- function reducer(acc, key) {
4470
- return acc === null || acc === void 0 ? void 0 : acc[key];
4471
- }
4472
- return path.split(".").reduce(reducer, obj);
4473
- };
4474
- return AgroObjectStringifier;
4475
- }());
4476
-
4477
- var StringifierPipe = /** @class */ (function () {
4478
- function StringifierPipe() {
4479
- }
4480
- StringifierPipe.prototype.transform = function (value, separator, paths, pipes) {
4481
- return AgroObjectStringifier.formatObject(separator, paths, value, pipes);
4482
- };
4483
- StringifierPipe = __decorate([
4484
- Pipe({ name: "stringifier" })
4485
- ], StringifierPipe);
4486
- return StringifierPipe;
4487
- }());
4488
-
4489
- var StringifierPipeModule = /** @class */ (function () {
4490
- function StringifierPipeModule() {
4491
- }
4492
- StringifierPipeModule = __decorate([
4493
- NgModule({
4494
- declarations: [StringifierPipe],
4495
- imports: [CommonModule],
4496
- exports: [StringifierPipe],
4497
- })
4498
- ], StringifierPipeModule);
4499
- return StringifierPipeModule;
4500
- }());
4501
-
4502
- var TelephonePipe = /** @class */ (function () {
4503
- function TelephonePipe() {
4504
- }
4505
- /**
4506
- * Transforma um número de telefone aplicando máscara automaticamente.
4507
- * @param value Valor do telefone.
4508
- * @param withDDI Define se deve forçar formatação com DDI (mesmo que não exista).
4509
- */
4510
- TelephonePipe.prototype.transform = function (value, withDDI) {
4511
- if (withDDI === void 0) { withDDI = false; }
4512
- if (!value) {
4513
- return "";
4514
- }
4515
- var digits = this.cleanDigits(value);
4516
- if (!digits) {
4517
- return value.toString();
4518
- }
4519
- var _a = this.extractParts(digits, withDDI), ddi = _a.ddi, ddd = _a.ddd, number = _a.number;
4520
- return this.formatPhone(ddi, ddd, number, value.toString(), withDDI);
4521
- };
4522
- /** Remove todos os caracteres não numéricos */
4523
- TelephonePipe.prototype.cleanDigits = function (value) {
4524
- return value.toString().replace(/\D+/g, "");
4525
- };
4526
- /** Extrai DDI, DDD e número, considerando se deve aplicar DDI forçado */
4527
- TelephonePipe.prototype.extractParts = function (digits, withDDI) {
4528
- var len = digits.length;
4529
- if (withDDI) {
4530
- return this.extractWithDDI(digits);
4531
- }
4532
- if (len <= AGRO_NUMBERS.NINE) {
4533
- return { ddi: "", ddd: "", number: digits };
4534
- }
4535
- if (len <= AGRO_NUMBERS.ELEVEN) {
4536
- return this.extractWithDDD(digits);
4537
- }
4538
- return this.extractWithDDI(digits);
4539
- };
4540
- /** Extrai DDD e número (sem DDI) */
4541
- TelephonePipe.prototype.extractWithDDD = function (digits) {
4542
- var ddd = digits.slice(0, 2);
4543
- var number = digits.slice(2);
4544
- return { ddi: "", ddd: ddd, number: number };
4545
- };
4546
- /** Extrai DDI, DDD e número */
4547
- TelephonePipe.prototype.extractWithDDI = function (digits) {
4548
- var len = digits.length;
4549
- var ddiLen = AGRO_NUMBERS.ONE;
4550
- if (len >= AGRO_NUMBERS.FOURTEEN) {
4551
- ddiLen = AGRO_NUMBERS.THREE;
4552
- }
4553
- if (len >= AGRO_NUMBERS.TWELVE) {
4554
- ddiLen = AGRO_NUMBERS.TWO;
4555
- }
4556
- var ddi = digits.slice(AGRO_NUMBERS.ZERO, ddiLen);
4557
- var ddd = digits.slice(ddiLen, ddiLen + AGRO_NUMBERS.TWO);
4558
- var number = digits.slice(ddiLen + AGRO_NUMBERS.TWO);
4559
- return { ddi: ddi, ddd: ddd, number: number };
4560
- };
4561
- /** Monta o número formatado */
4562
- TelephonePipe.prototype.formatPhone = function (ddi, ddd, number, fallback, withDDI) {
4563
- if (!number) {
4564
- return fallback;
4565
- }
4566
- var formatted = "";
4567
- if (withDDI || ddi) {
4568
- formatted += "+" + (ddi || "55") + " ";
4569
- }
4570
- if (ddd) {
4571
- formatted += "(" + ddd + ") ";
4572
- }
4573
- formatted += this.formatNumber(number);
4574
- return formatted;
4575
- };
4576
- /** Aplica máscara de 8 ou 9 dígitos */
4577
- TelephonePipe.prototype.formatNumber = function (number) {
4578
- var len = number.length;
4579
- if (len === AGRO_NUMBERS.NINE) {
4580
- return number.slice(AGRO_NUMBERS.ZERO, AGRO_NUMBERS.FIVE) + "-" + number.slice(AGRO_NUMBERS.FIVE);
4581
- }
4582
- if (len === AGRO_NUMBERS.EIGHT) {
4583
- return number.slice(AGRO_NUMBERS.ZERO, AGRO_NUMBERS.FOUR) + "-" + number.slice(AGRO_NUMBERS.FOUR);
4584
- }
4585
- return number;
4586
- };
4587
- TelephonePipe = __decorate([
4588
- Pipe({ name: "telephone" })
4589
- ], TelephonePipe);
4590
- return TelephonePipe;
4591
- }());
4592
-
4593
- var TelephonePipeModule = /** @class */ (function () {
4594
- function TelephonePipeModule() {
4595
- }
4596
- TelephonePipeModule = __decorate([
4597
- NgModule({
4598
- declarations: [TelephonePipe],
4599
- imports: [CommonModule],
4600
- exports: [TelephonePipe],
4601
- })
4602
- ], TelephonePipeModule);
4603
- return TelephonePipeModule;
4604
- }());
4605
-
4606
- var LibTranslatePipe = /** @class */ (function () {
4607
- function LibTranslatePipe(translateService) {
4608
- this.translateService = translateService;
4609
- }
4610
- LibTranslatePipe.prototype.transform = function (value) {
4611
- var args = [];
4612
- for (var _i = 1; _i < arguments.length; _i++) {
4613
- args[_i - 1] = arguments[_i];
4614
- }
4615
- if (args.length > 0) {
4616
- return this.translateService.instant(value, args[0]);
4617
- }
4618
- return this.translateService.instant(value);
4619
- };
4620
- LibTranslatePipe.ctorParameters = function () { return [
4621
- { type: LibTranslationService }
4622
- ]; };
4623
- LibTranslatePipe = __decorate([
4624
- Pipe({
4625
- name: 'libTranslate'
4626
- })
4627
- ], LibTranslatePipe);
4628
- return LibTranslatePipe;
4629
- }());
4630
-
4631
4307
  var CancelEventDialogComponent = /** @class */ (function () {
4632
4308
  function CancelEventDialogComponent(formBuilder, config, ref, translate) {
4633
4309
  this.formBuilder = formBuilder;
@@ -6660,6 +6336,31 @@ var TicketModule = /** @class */ (function () {
6660
6336
  return TicketModule;
6661
6337
  }());
6662
6338
 
6339
+ var LibTranslatePipe = /** @class */ (function () {
6340
+ function LibTranslatePipe(translateService) {
6341
+ this.translateService = translateService;
6342
+ }
6343
+ LibTranslatePipe.prototype.transform = function (value) {
6344
+ var args = [];
6345
+ for (var _i = 1; _i < arguments.length; _i++) {
6346
+ args[_i - 1] = arguments[_i];
6347
+ }
6348
+ if (args.length > 0) {
6349
+ return this.translateService.instant(value, args[0]);
6350
+ }
6351
+ return this.translateService.instant(value);
6352
+ };
6353
+ LibTranslatePipe.ctorParameters = function () { return [
6354
+ { type: LibTranslationService }
6355
+ ]; };
6356
+ LibTranslatePipe = __decorate([
6357
+ Pipe({
6358
+ name: 'libTranslate'
6359
+ })
6360
+ ], LibTranslatePipe);
6361
+ return LibTranslatePipe;
6362
+ }());
6363
+
6663
6364
  var LibTranslationModule = /** @class */ (function () {
6664
6365
  function LibTranslationModule() {
6665
6366
  }
@@ -6671,7 +6372,6 @@ var LibTranslationModule = /** @class */ (function () {
6671
6372
  imports: [
6672
6373
  CommonModule
6673
6374
  ],
6674
- providers: [LibTranslationService],
6675
6375
  exports: [
6676
6376
  LibTranslatePipe
6677
6377
  ]
@@ -6780,440 +6480,6 @@ var EventControlBoardModule = /** @class */ (function () {
6780
6480
  return EventControlBoardModule;
6781
6481
  }());
6782
6482
 
6783
- var AgroEntityService = /** @class */ (function () {
6784
- function AgroEntityService(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
6785
- this.http = http;
6786
- this.messageService = messageService;
6787
- this.entityUrl = entityUrl;
6788
- this.actionsUrl = actionsUrl;
6789
- this.queriesUrl = queriesUrl;
6790
- this.translate = translate;
6791
- this.http = http;
6792
- this.messageService = messageService;
6793
- this.entityUrl = entityUrl;
6794
- this.actionsUrl = actionsUrl;
6795
- this.queriesUrl = queriesUrl;
6796
- this.translate = translate;
6797
- this.defaultCatch = this.defaultCatch.bind(this);
6798
- }
6799
- AgroEntityService.prototype.getListQueryParams = function (listParams) {
6800
- var ten = 10;
6801
- var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? ten : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
6802
- var params = new HttpParams();
6803
- params = params.append("size", String(size));
6804
- params = params.append("offset", String(page));
6805
- if (sort && sort.length) {
6806
- params = params.append("orderby", sort.map(this.getBodyFilters()).join(", "));
6807
- }
6808
- if (filterQuery) {
6809
- params = params.append("filter", filterQuery);
6810
- }
6811
- if (displayFields && displayFields.length) {
6812
- params = params.append("displayfields", displayFields.join());
6813
- }
6814
- return params;
6815
- };
6816
- AgroEntityService.prototype.getBodyParams = function (listParams) {
6817
- var ten = 10;
6818
- var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? ten : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
6819
- var bodyParams = {};
6820
- bodyParams.size = size;
6821
- bodyParams.offset = page;
6822
- if (sort && sort.length) {
6823
- bodyParams.orderBy = sort.map(this.getBodyFilters()).join(", ");
6824
- }
6825
- if (filterQuery) {
6826
- bodyParams.filter = filterQuery;
6827
- }
6828
- if (displayFields && displayFields.length) {
6829
- bodyParams.displayfields = displayFields.join();
6830
- }
6831
- return bodyParams;
6832
- };
6833
- AgroEntityService.prototype.getBodyFilters = function () {
6834
- return function (s) {
6835
- var order = "";
6836
- if (s.order === 1) {
6837
- order = " asc";
6838
- }
6839
- if (s.order === -1) {
6840
- order = " desc";
6841
- }
6842
- return "" + s.field + order;
6843
- };
6844
- };
6845
- AgroEntityService.prototype.defaultCatch = function (errorMsgs) {
6846
- var _this = this;
6847
- if (errorMsgs === void 0) { errorMsgs = []; }
6848
- var unauthorized_401 = 401;
6849
- // errorMsgs = [...errorMsgs, ...DefaultErrorMessages];
6850
- errorMsgs = __spread(errorMsgs);
6851
- var zero = 0;
6852
- return catchError(function (err) {
6853
- if (err) {
6854
- var errorMessage = errorMsgs.find(function (eMsg) { return eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero; });
6855
- var summary = err.status ? String(err.status) : "Error";
6856
- var detail = _this.getErrorMessage(err);
6857
- if (err.status === unauthorized_401) {
6858
- summary = _this.translate.instant("agro.angular_components.error_unauthorized_title");
6859
- detail = _this.translate.instant("agro.angular_components.error_unauthorized_description");
6860
- }
6861
- if (errorMessage) {
6862
- summary = errorMessage.summary ? _this.translate.instant(errorMessage.summary) : summary;
6863
- detail = errorMessage.detail ? _this.translate.instant(errorMessage.detail) : detail;
6864
- }
6865
- _this.messageService.add({
6866
- severity: "error",
6867
- summary: summary,
6868
- detail: detail,
6869
- });
6870
- }
6871
- return throwError(err);
6872
- });
6873
- };
6874
- AgroEntityService.prototype.getErrorMessage = function (err) {
6875
- if (err.error && err.error.message) {
6876
- return err.error.message;
6877
- }
6878
- if (err.statusText) {
6879
- return err.statusText;
6880
- }
6881
- if (err.message) {
6882
- return err.message;
6883
- }
6884
- return "Error";
6885
- };
6886
- AgroEntityService.prototype.list = function (listParams, errorMessage) {
6887
- if (errorMessage === void 0) { errorMessage = []; }
6888
- return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch(errorMessage));
6889
- };
6890
- AgroEntityService.prototype.get = function (id, errorMessage) {
6891
- if (errorMessage === void 0) { errorMessage = []; }
6892
- return this.http.get(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
6893
- };
6894
- AgroEntityService.prototype.insert = function (entity, errorMessage) {
6895
- if (errorMessage === void 0) { errorMessage = []; }
6896
- return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch(errorMessage));
6897
- };
6898
- AgroEntityService.prototype.update = function (id, entity, errorMessage) {
6899
- if (errorMessage === void 0) { errorMessage = []; }
6900
- return this.http.put(this.entityUrl + "/" + id, entity).pipe(this.defaultCatch(errorMessage));
6901
- };
6902
- AgroEntityService.prototype.delete = function (id, errorMessage) {
6903
- if (errorMessage === void 0) { errorMessage = []; }
6904
- return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
6905
- };
6906
- AgroEntityService.prototype.listCustomFilter = function (listParams, action, errorMessage) {
6907
- if (errorMessage === void 0) { errorMessage = []; }
6908
- return this.http.post(this.actionsUrl + "/" + action, this.getBodyParams(listParams)).pipe(this.defaultCatch(errorMessage));
6909
- };
6910
- return AgroEntityService;
6911
- }());
6912
-
6913
- var statusLookup;
6914
- (function (statusLookup) {
6915
- statusLookup["PENDING"] = "PENDING";
6916
- statusLookup["FINISHED"] = "FINISHED";
6917
- statusLookup["ERROR"] = "ERROR";
6918
- })(statusLookup || (statusLookup = {}));
6919
- var statusIntegration;
6920
- (function (statusIntegration) {
6921
- statusIntegration["SUCCESS"] = "SUCCESS";
6922
- statusIntegration["IN_PROGRESS"] = "IN_PROGRESS";
6923
- statusIntegration["ERROR"] = "ERROR";
6924
- })(statusIntegration || (statusIntegration = {}));
6925
-
6926
- var AgroInvoiceService = /** @class */ (function (_super) {
6927
- __extends(AgroInvoiceService, _super);
6928
- function AgroInvoiceService(http, messageService, translate) {
6929
- var _this = _super.call(this, http, messageService, "agro/invoice/entities/invoice", "agro/invoice/actions", "agro/invoice/queries", translate) || this;
6930
- _this.http = http;
6931
- _this.messageService = messageService;
6932
- _this.translate = translate;
6933
- _this.pooling = new Subject();
6934
- return _this;
6935
- }
6936
- AgroInvoiceService.prototype.invoiceLookupFilter = function (data) {
6937
- var _this = this;
6938
- return this.http
6939
- .post(this.queriesUrl + "/invoiceLookup", data)
6940
- .pipe(switchMap(function (res) { return _this.pollInvoiceResult(res.requestId); }));
6941
- };
6942
- AgroInvoiceService.prototype.cancelActivePooling = function () {
6943
- this.pooling.next();
6944
- };
6945
- AgroInvoiceService.prototype.pollInvoiceResult = function (requestId) {
6946
- var _this = this;
6947
- var delays = Array.from({ length: 10 }, function (_, index) {
6948
- if (index === 0) {
6949
- return 1000;
6950
- }
6951
- return (index + 1) * 1000;
6952
- });
6953
- return scheduled(delays, asyncScheduler).pipe(concatMap(function (delay) {
6954
- return timer(delay).pipe(switchMap(function () { return _this.http.post(_this.queriesUrl + "/getInvoiceLookup", { requestId: requestId }); }), tap(function (res) {
6955
- if (res.status === statusLookup.ERROR) {
6956
- throw new Error(res.message);
6957
- }
6958
- }));
6959
- }), scan(function (_, curr) { return curr; }, null), filter(function (res) { return (res === null || res === void 0 ? void 0 : res.status) === statusLookup.FINISHED; }), take(1), defaultIfEmpty(null), takeUntil(this.pooling));
6960
- };
6961
- AgroInvoiceService.ctorParameters = function () { return [
6962
- { type: HttpClient },
6963
- { type: MessageService },
6964
- { type: LibTranslationService }
6965
- ]; };
6966
- AgroInvoiceService = __decorate([
6967
- Injectable()
6968
- ], AgroInvoiceService);
6969
- return AgroInvoiceService;
6970
- }(AgroEntityService));
6971
-
6972
- var INVOICE_ITEMS = "invoiceItems.*";
6973
- var ModalInvoicePjSelectorComponent = /** @class */ (function () {
6974
- function ModalInvoicePjSelectorComponent(translate, invoiceService) {
6975
- this.translate = translate;
6976
- this.invoiceService = invoiceService;
6977
- this.whenSelectInvoices = new EventEmitter();
6978
- this.buttonPriority = ButtonPriority;
6979
- this.gridColumns = [
6980
- { field: "number", header: this.translate.instant("agro.angular_components.number") },
6981
- { field: "series", header: this.translate.instant("agro.angular_components.series") },
6982
- { field: "invoiceItems", header: this.translate.instant("agro.angular_components.itens") },
6983
- { field: "quantity", header: this.translate.instant("agro.angular_components.quantity") },
6984
- { field: "issuanceDate", header: this.translate.instant("agro.angular_components.issuance_date") },
6985
- ];
6986
- this.dontHaveAnyInvoice = false;
6987
- this.gridLoading = true;
6988
- this.gridTotalRecords = AGRO_NUMBERS.ZERO;
6989
- this.selected = [];
6990
- this.unselectedIds = new Set();
6991
- this.visible = false;
6992
- this.searchValue = new FormControl("", []);
6993
- this.ngUnsubscribe = new Subject();
6994
- this.currentParams = {
6995
- page: 0,
6996
- size: 10,
6997
- sort: [{ field: "issuanceDate", order: 1 }],
6998
- displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
6999
- filterQuery: "",
7000
- };
7001
- }
7002
- ModalInvoicePjSelectorComponent.prototype.ngOnDestroy = function () {
7003
- this.ngUnsubscribe.next();
7004
- this.ngUnsubscribe.complete();
7005
- };
7006
- ModalInvoicePjSelectorComponent.prototype.ngOnInit = function () {
7007
- this.whenSearchValueChanges();
7008
- };
7009
- ModalInvoicePjSelectorComponent.prototype.whenSearchValueChanges = function () {
7010
- var _this = this;
7011
- this.searchValue.valueChanges
7012
- .pipe(takeUntil(this.ngUnsubscribe))
7013
- .pipe(debounceTime(AGRO_NUMBERS.THREE_HUNDRED))
7014
- .subscribe(function (value) {
7015
- if (value) {
7016
- _this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] }, value);
7017
- }
7018
- else {
7019
- _this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7020
- }
7021
- });
7022
- };
7023
- ModalInvoicePjSelectorComponent.prototype.tryToSearchAgain = function () {
7024
- this.gridLoading = true;
7025
- this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7026
- };
7027
- ModalInvoicePjSelectorComponent.prototype.open = function () {
7028
- if (this.checkIfOptionsIsValid()) {
7029
- this.visible = true;
7030
- this.gridData = [];
7031
- this.gridLoading = true;
7032
- this.gridTotalRecords = 0;
7033
- this.selected = [];
7034
- this.unselectedIds.clear();
7035
- this.currentParams = {
7036
- page: 0,
7037
- size: 10,
7038
- sort: [],
7039
- filterQuery: "",
7040
- displayFields: ["*", INVOICE_ITEMS],
7041
- };
7042
- this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7043
- this.selected = [];
7044
- }
7045
- };
7046
- ModalInvoicePjSelectorComponent.prototype.checkIfOptionsIsValid = function () {
7047
- if (!this.options) {
7048
- return false;
7049
- }
7050
- if (!this.options.companyId || !this.options.branchId) {
7051
- return false;
7052
- }
7053
- return true;
7054
- };
7055
- ModalInvoicePjSelectorComponent.prototype.updateGridData = function (event, searchValue) {
7056
- var _this = this;
7057
- var _a;
7058
- this.cancelPooling();
7059
- var _b = this.options, companyId = _b.companyId, branchId = _b.branchId;
7060
- var producerId = this.options.producersIds[0];
7061
- var ruralEstateId = this.options.ruralEstateIds[0];
7062
- var size = event.rows;
7063
- var page = event.first / size;
7064
- var sizePage = event.rows;
7065
- this.currentParams = {
7066
- page: page,
7067
- size: size,
7068
- sort: ((_a = event.multiSortMeta) === null || _a === void 0 ? void 0 : _a.length) ? event.multiSortMeta : [{ field: "issuanceDate", order: 1 }],
7069
- displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
7070
- };
7071
- this.gridLoading = true;
7072
- this.dontHaveAnyInvoice = false;
7073
- var filterBody = {
7074
- filter: {
7075
- companyId: companyId,
7076
- branchId: branchId,
7077
- producerIds: [producerId],
7078
- ruralEstateIds: [ruralEstateId],
7079
- multiProducts: false,
7080
- productId: this.options.productId,
7081
- },
7082
- pageRequest: {
7083
- offset: page,
7084
- size: sizePage,
7085
- orderBy: this.currentParams.sort.map(function (sort) { return ({ field: sort.field, order: sort.order === 1 ? "asc" : "desc" }); }),
7086
- },
7087
- };
7088
- this.invoiceService
7089
- .invoiceLookupFilter(filterBody)
7090
- .pipe(takeUntil(this.ngUnsubscribe), finalize(function () {
7091
- _this.gridLoading = false;
7092
- }))
7093
- .subscribe(function (result) {
7094
- var _a;
7095
- _this.gridData = ((_a = result === null || result === void 0 ? void 0 : result.result) === null || _a === void 0 ? void 0 : _a.invoices) || [];
7096
- if (_this.gridData.length === 0 && !searchValue) {
7097
- _this.dontHaveAnyInvoice = true;
7098
- }
7099
- _this.gridTotalRecords = result.result.totalElements;
7100
- }, function (error) {
7101
- console.info("Erro ao buscar notas fiscais: ", error);
7102
- }, function () {
7103
- _this.gridLoading = false;
7104
- });
7105
- };
7106
- ModalInvoicePjSelectorComponent.prototype.cancelPooling = function () {
7107
- this.invoiceService.cancelActivePooling();
7108
- };
7109
- ModalInvoicePjSelectorComponent.prototype.add = function () {
7110
- return __awaiter(this, void 0, void 0, function () {
7111
- return __generator(this, function (_a) {
7112
- try {
7113
- this.whenSelectInvoices.emit(this.selected);
7114
- this.resetSpecs();
7115
- }
7116
- catch (error) {
7117
- console.info("Erro ao selecionar notas fiscais: ", error);
7118
- }
7119
- return [2 /*return*/];
7120
- });
7121
- });
7122
- };
7123
- ModalInvoicePjSelectorComponent.prototype.resetSpecs = function () {
7124
- this.selected = [];
7125
- this.dontHaveAnyInvoice = false;
7126
- this.visible = false;
7127
- this.gridData = [];
7128
- this.gridLoading = false;
7129
- this.gridTotalRecords = 0;
7130
- };
7131
- ModalInvoicePjSelectorComponent.prototype.cancel = function () {
7132
- return __awaiter(this, void 0, void 0, function () {
7133
- return __generator(this, function (_a) {
7134
- this.resetSpecs();
7135
- return [2 /*return*/];
7136
- });
7137
- });
7138
- };
7139
- ModalInvoicePjSelectorComponent.ctorParameters = function () { return [
7140
- { type: LibTranslationService },
7141
- { type: AgroInvoiceService }
7142
- ]; };
7143
- __decorate([
7144
- Input()
7145
- ], ModalInvoicePjSelectorComponent.prototype, "options", void 0);
7146
- __decorate([
7147
- Output()
7148
- ], ModalInvoicePjSelectorComponent.prototype, "whenSelectInvoices", void 0);
7149
- ModalInvoicePjSelectorComponent = __decorate([
7150
- Component({
7151
- selector: "s-modal-invoice-pj-selector",
7152
- template: "<p-dialog\r\n header=\"{{ 'agro.angular_components.panel_title_external_invoice_add_external_invoice' | libTranslate }}\"\r\n [(visible)]=\"visible\"\r\n [modal]=\"true\"\r\n class=\"add-invoice-modal\"\r\n [closeOnEscape]=\"false\"\r\n (onHide)=\"cancelPooling()\"\r\n [dismissableMask]=\"false\"\r\n>\r\n <ng-container *ngIf=\"!dontHaveAnyInvoice\">\r\n <div class=\"ui-g\">\r\n <label for=\"invoiceSearchInput\">{{ 'agro.angular_components.number_or_series' | libTranslate }}</label>\r\n <input\r\n type=\"text\"\r\n id=\"invoiceSearchInput\"\r\n pInputText\r\n [formControl]=\"searchValue\"\r\n [placeholder]=\"'' | libTranslate\"\r\n [required]=\"false\"\r\n />\r\n <div class=\"ui-g-12\">\r\n <p-table\r\n [(selection)]=\"selected\"\r\n [value]=\"gridData\"\r\n [columns]=\"gridColumns\"\r\n [scrollable]=\"true\"\r\n dataKey=\"externalInvoiceId\"\r\n [rows]=\"10\"\r\n [paginator]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [lazy]=\"true\"\r\n (onLazyLoad)=\"updateGridData($event)\"\r\n [resizableColumns]=\"true\"\r\n *sLoadingState=\"gridLoading\"\r\n sortMode=\"multiple\"\r\n [selectionMode]=\"'multiple'\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th class=\"checkbox\" scope=\"col\">\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n </th>\r\n <ng-container *ngFor=\"let col of columns\">\r\n <th class=\"column\" scope=\"col\" *ngIf=\"['invoiceItems', 'quantity'].includes(col.field)\">\r\n {{ col.header }}\r\n </th>\r\n <th\r\n class=\"column\"\r\n [pSortableColumn]=\"col.field\"\r\n scope=\"col\"\r\n *ngIf=\"!['invoiceItems', 'quantity'].includes(col.field)\"\r\n >\r\n {{ col.header }}\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <td class=\"checkbox\" tabindex=\"0\">\r\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\r\n </td>\r\n <td\r\n [pSelectableRow]=\"rowData\"\r\n [pSelectableRowIndex]=\"rowIndex\"\r\n *ngFor=\"let col of columns\"\r\n class=\"column\"\r\n tabindex=\"0\"\r\n >\r\n <ng-container [ngSwitch]=\"col.field\">\r\n <ng-container *ngSwitchCase=\"'issuanceDate'\">\r\n {{ rowData[col.field] | localizedDate: 'L' | async }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'invoiceItems'\">\r\n {{ rowData?.totalItems || 0 }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'quantity'\">\r\n {{ rowData?.totalItemsQuantity || 0 | kilogram }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'series'\">\r\n {{ rowData?.seriesLegal || rowData?.series || rowData[col.field] }}\r\n </ng-container>\r\n <ng-container *ngSwitchDefault> {{ rowData[col.field] }} </ng-container>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"paginatorright\">\r\n <span>{{ gridTotalRecords }} registros encontrados</span>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"dontHaveAnyInvoice\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.add_pj_invoice_modal_no_invoices_found' | libTranslate }}\"\r\n primaryActionLabel=\"{{ 'agro.angular_components.error_server_try_again' | libTranslate }}\"\r\n (primaryAction)=\"tryToSearchAgain()\"\r\n description=\"{{ 'agro.angular_components.no_register_found_for_external_invoices_summary' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </ng-container>\r\n\r\n <p-footer class=\"footer\" *ngIf=\"!dontHaveAnyInvoice\">\r\n <s-button\r\n [priority]=\"buttonPriority.Primary\"\r\n label=\"{{ 'agro.angular_components.panel_title_external_invoice_add_external_invoice' | libTranslate }}\"\r\n [disabled]=\"!selected?.length\"\r\n (click)=\"add()\"\r\n (keydown.enter)=\"add()\"\r\n ></s-button>\r\n <s-button\r\n [priority]=\"buttonPriority.Link\"\r\n label=\"{{ 'agro.angular_components.cancel' | libTranslate }}\"\r\n (click)=\"cancel()\"\r\n (keydown.enter)=\"cancel()\"\r\n ></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n",
7153
- styles: [".footer{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}.add-invoice-modal{width:480px;max-width:480px}.add-invoice-modal input[type=text]{width:100%}.add-invoice-modal .ui-dialog{width:480px!important}.add-invoice-modal .ui-dialog .ui-dialog-content{min-height:175px}td.checkbox,th.checkbox{width:50px}td.column,th.column{min-width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]
7154
- })
7155
- ], ModalInvoicePjSelectorComponent);
7156
- return ModalInvoicePjSelectorComponent;
7157
- }());
7158
-
7159
- var AgroInvoiceModule = /** @class */ (function () {
7160
- function AgroInvoiceModule() {
7161
- }
7162
- AgroInvoiceModule = __decorate([
7163
- NgModule({
7164
- imports: [
7165
- HttpClientModule,
7166
- PermissionsModule.forChild([
7167
- {
7168
- name: 'invoice',
7169
- actions: ['Visualizar', 'Incluir', 'Editar', 'Excluir'],
7170
- uri: "res://senior.com.br/agro/origination/entities/invoice",
7171
- },
7172
- ]),
7173
- ],
7174
- providers: [
7175
- AgroInvoiceService,
7176
- ],
7177
- declarations: [],
7178
- exports: [],
7179
- })
7180
- ], AgroInvoiceModule);
7181
- return AgroInvoiceModule;
7182
- }());
7183
-
7184
- var ModalInvoicePjSelectorModule = /** @class */ (function () {
7185
- function ModalInvoicePjSelectorModule() {
7186
- }
7187
- ModalInvoicePjSelectorModule = __decorate([
7188
- NgModule({
7189
- declarations: [ModalInvoicePjSelectorComponent],
7190
- providers: [DecimalPipe, DatePipe],
7191
- imports: [
7192
- CommonModule,
7193
- ReactiveFormsModule,
7194
- LocaleModule.forChild(),
7195
- EmptyStateModule,
7196
- BignumberInputModule,
7197
- InputTextModule$1,
7198
- ButtonModule,
7199
- TableModule$1,
7200
- SharedModule$2,
7201
- TableModule,
7202
- AgroInvoiceModule,
7203
- DialogModule,
7204
- KilogramModule,
7205
- LoadingStateModule,
7206
- ConfirmDialogModule$1,
7207
- LibTranslationModule,
7208
- KilogramModule,
7209
- TableHeaderCheckboxModule,
7210
- ],
7211
- exports: [ModalInvoicePjSelectorComponent],
7212
- })
7213
- ], ModalInvoicePjSelectorModule);
7214
- return ModalInvoicePjSelectorModule;
7215
- }());
7216
-
7217
6483
  var HostProjectConfigsInjectionToken = new InjectionToken("hostProjectConfigs");
7218
6484
  var AgroAngularComponentsModule = /** @class */ (function () {
7219
6485
  function AgroAngularComponentsModule() {
@@ -7241,5 +6507,5 @@ var AgroAngularComponentsModule = /** @class */ (function () {
7241
6507
  * Generated bundle index. Do not edit.
7242
6508
  */
7243
6509
 
7244
- export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroCookieUtils, AgroDateUtils, AgroEntityStatus, AgroFormValidator, AgroInvoiceModule, AgroInvoiceService, AgroLogics, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroStringMasks, AgroStringUtils, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, CnpjCpfPipe, CnpjCpfPipeModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule, E070FilModule, E075DerModule, E205depService, EventControlBoardComponent, EventControlBoardModule, EventControlBoardService, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FixationModule, HostProjectConfigsInjectionToken, HttpCodes, InvoiceModule, KilogramModule, KilogramPipe, LibTranslatePipe, LibTranslationModule, LibTranslationService, ModalInvoicePjSelectorComponent, ModalInvoicePjSelectorModule, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerInvoiceModule, RuralEstateModule, SharedModule, StringifierPipe, StringifierPipeModule, TelephonePipe, TelephonePipeModule, TicketModule, TransferModule, UserInformationService, WebsocketModule, WebsocketService, LibTranslatePipe as ɵa, LibTranslationService as ɵb };
6510
+ export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroCookieUtils, AgroDateUtils, AgroEntityStatus, AgroFormValidator, AgroLogics, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroStringMasks, AgroStringUtils, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule, E070FilModule, E075DerModule, E205depService, EventControlBoardComponent, EventControlBoardModule, EventControlBoardService, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FixationModule, HostProjectConfigsInjectionToken, HttpCodes, InvoiceModule, LibTranslatePipe, LibTranslationModule, LibTranslationService, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerInvoiceModule, RuralEstateModule, SharedModule, TicketModule, TransferModule, UserInformationService, WebsocketModule, WebsocketService, LibTranslationService as ɵa };
7245
6511
  //# sourceMappingURL=senior-agronegocio-angular-components.js.map