@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
@@ -360,10 +360,7 @@
360
360
  * Validação de Placa de Veículo Antiga
361
361
  * Formato: AAA-0000
362
362
  */
363
- isOldLicensePlate: /^[A-Z]{3}\d{4}$/,
364
- isISODate: /^\d{4}-\d{2}-\d{2}$/,
365
- isISOTime: /^\d{2}:\d{2}:\d{2}$/,
366
- isISODateTime: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/,
363
+ isOldLicensePlate: /^[A-Z]{3}[0-9]{4}$/
367
364
  };
368
365
 
369
366
 
@@ -2266,19 +2263,13 @@
2266
2263
  */
2267
2264
  AgroStringUtils.isEmpty = function (str) {
2268
2265
  var _a;
2269
- if (str && AgroStringUtils.isString(str)) {
2270
- return ((_a = str === null || str === void 0 ? void 0 : str.trim()) === null || _a === void 0 ? void 0 : _a.length) === exports.AGRO_NUMBERS.ZERO;
2271
- }
2272
- return true;
2266
+ return !str || ((_a = str.trim()) === null || _a === void 0 ? void 0 : _a.length) === exports.AGRO_NUMBERS.ZERO;
2273
2267
  };
2274
2268
  /**
2275
2269
  * Verifica se a string não está vazia.
2276
2270
  */
2277
2271
  AgroStringUtils.isNotEmpty = function (str) {
2278
- if (str && AgroStringUtils.isString(str)) {
2279
- return !AgroStringUtils.isEmpty(str);
2280
- }
2281
- return false;
2272
+ return !AgroStringUtils.isEmpty(str);
2282
2273
  };
2283
2274
  /** Verifica se a string é nula, indefinida ou contém apenas espaços em branco */
2284
2275
  AgroStringUtils.isBlank = function (str) {
@@ -2333,7 +2324,7 @@
2333
2324
  return AGRO_REGEX.isUUID.test(str);
2334
2325
  };
2335
2326
  AgroStringUtils.isNumber = function (str) {
2336
- return [AGRO_REGEX.isNumber.test(str), AGRO_REGEX.isDecimal.test(str)].includes(true);
2327
+ return AGRO_REGEX.isNumber.test(str);
2337
2328
  };
2338
2329
  AgroStringUtils.validateCPF = function (cpf) {
2339
2330
  cpf = cpf.replace(/\D/g, "");
@@ -2350,7 +2341,7 @@
2350
2341
  };
2351
2342
  var digit1 = calcVerifier(cpf, exports.AGRO_NUMBERS.NINE);
2352
2343
  var digit2 = calcVerifier(cpf, exports.AGRO_NUMBERS.TEN);
2353
- return (digit1 === parseInt(cpf[exports.AGRO_NUMBERS.NINE], exports.AGRO_NUMBERS.TEN) && digit2 === parseInt(cpf[exports.AGRO_NUMBERS.TEN], exports.AGRO_NUMBERS.TEN));
2344
+ return digit1 === parseInt(cpf[exports.AGRO_NUMBERS.NINE], exports.AGRO_NUMBERS.TEN) && digit2 === parseInt(cpf[exports.AGRO_NUMBERS.TEN], exports.AGRO_NUMBERS.TEN);
2354
2345
  };
2355
2346
  /**
2356
2347
  * Detecta automaticamente se é CNPJ antigo ou novo formato.
@@ -2393,8 +2384,7 @@
2393
2384
  }
2394
2385
  resto = soma % exports.AGRO_NUMBERS.ELEVEN;
2395
2386
  var digito2 = resto < exports.AGRO_NUMBERS.TWO ? exports.AGRO_NUMBERS.ZERO : exports.AGRO_NUMBERS.ELEVEN - resto;
2396
- return (parseInt(cnpj.charAt(exports.AGRO_NUMBERS.TWELVE), exports.AGRO_NUMBERS.TEN) === digito1 &&
2397
- parseInt(cnpj.charAt(exports.AGRO_NUMBERS.THIRTEEN), exports.AGRO_NUMBERS.TEN) === digito2);
2387
+ return parseInt(cnpj.charAt(exports.AGRO_NUMBERS.TWELVE), exports.AGRO_NUMBERS.TEN) === digito1 && parseInt(cnpj.charAt(exports.AGRO_NUMBERS.THIRTEEN), exports.AGRO_NUMBERS.TEN) === digito2;
2398
2388
  };
2399
2389
  /**
2400
2390
  * Valida o CNPJ em formato alfanumérico (padrão 2026)
@@ -2497,7 +2487,7 @@
2497
2487
  */
2498
2488
  AgroStringUtils.applyMask = function (value, mask) {
2499
2489
  var e_1, _a;
2500
- var valueChars = value.replace(/[^A-Za-z0-9]/g, "");
2490
+ var valueChars = value.toString().split("");
2501
2491
  var maskChars = mask.split("");
2502
2492
  var maskedValue = "";
2503
2493
  var j = exports.AGRO_NUMBERS.ZERO;
@@ -2531,15 +2521,6 @@
2531
2521
  AgroStringUtils.isInvalid = function (str) {
2532
2522
  return !AgroStringUtils.isValid(str);
2533
2523
  };
2534
- AgroStringUtils.isISODate = function (value) {
2535
- return AGRO_REGEX.isISODate.test(value);
2536
- };
2537
- AgroStringUtils.isISOTime = function (value) {
2538
- return AGRO_REGEX.isISOTime.test(value);
2539
- };
2540
- AgroStringUtils.isISODatetime = function (value) {
2541
- return AGRO_REGEX.isISODateTime.test(value);
2542
- };
2543
2524
  AgroStringUtils.CNPJ_TRADICIONAL_PESOS_1 = [
2544
2525
  exports.AGRO_NUMBERS.FIVE,
2545
2526
  exports.AGRO_NUMBERS.FOUR,
@@ -2552,7 +2533,7 @@
2552
2533
  exports.AGRO_NUMBERS.FIVE,
2553
2534
  exports.AGRO_NUMBERS.FOUR,
2554
2535
  exports.AGRO_NUMBERS.THREE,
2555
- exports.AGRO_NUMBERS.TWO,
2536
+ exports.AGRO_NUMBERS.TWO
2556
2537
  ];
2557
2538
  AgroStringUtils.CNPJ_TRADICIONAL_PESOS_2 = [
2558
2539
  exports.AGRO_NUMBERS.SIX,
@@ -2567,7 +2548,7 @@
2567
2548
  exports.AGRO_NUMBERS.FIVE,
2568
2549
  exports.AGRO_NUMBERS.FOUR,
2569
2550
  exports.AGRO_NUMBERS.THREE,
2570
- exports.AGRO_NUMBERS.TWO,
2551
+ exports.AGRO_NUMBERS.TWO
2571
2552
  ];
2572
2553
  // Pesos utilizados para cálculo de dígitos verificadores do CNPJ alfanumérico (2026)
2573
2554
  AgroStringUtils.CNPJ_ALFANUMERICO_PESOS_1 = [
@@ -2582,7 +2563,7 @@
2582
2563
  exports.AGRO_NUMBERS.FIVE,
2583
2564
  exports.AGRO_NUMBERS.FOUR,
2584
2565
  exports.AGRO_NUMBERS.THREE,
2585
- exports.AGRO_NUMBERS.TWO,
2566
+ exports.AGRO_NUMBERS.TWO
2586
2567
  ];
2587
2568
  AgroStringUtils.CNPJ_ALFANUMERICO_PESOS_2 = [
2588
2569
  exports.AGRO_NUMBERS.SIX,
@@ -2597,7 +2578,7 @@
2597
2578
  exports.AGRO_NUMBERS.FIVE,
2598
2579
  exports.AGRO_NUMBERS.FOUR,
2599
2580
  exports.AGRO_NUMBERS.THREE,
2600
- exports.AGRO_NUMBERS.TWO,
2581
+ exports.AGRO_NUMBERS.TWO
2601
2582
  ];
2602
2583
  return AgroStringUtils;
2603
2584
  }());
@@ -2615,7 +2596,7 @@
2615
2596
  * @returns
2616
2597
  */
2617
2598
  AgroPlatformUtils.getCurrentTenant = function () {
2618
- var tenant = AgroPlatformUtils.getTokenField("tenantName");
2599
+ var tenant = AgroPlatformUtils.getTokenField('tenantName');
2619
2600
  if (tenant) {
2620
2601
  return tenant;
2621
2602
  }
@@ -2627,18 +2608,17 @@
2627
2608
  * @returns
2628
2609
  */
2629
2610
  AgroPlatformUtils.getCurrentTenantLocale = function () {
2630
- var locale = AgroPlatformUtils.getTokenField("locale");
2611
+ var locale = AgroPlatformUtils.getTokenField('locale');
2631
2612
  if (locale) {
2632
2613
  return locale;
2633
2614
  }
2634
- throw new Error("'locale' n\u00E3o encontrado para o tenant atual.");
2615
+ throw new Error("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2635
2616
  };
2636
2617
  /**
2637
2618
  * @deprecated Use getCurrentTenantLocale()
2638
2619
  * Mantido por compatibilidade retroativa.
2639
2620
  */
2640
2621
  AgroPlatformUtils.getCurrenTenantLocale = function () {
2641
- // legacy typo retained
2642
2622
  return AgroPlatformUtils.getCurrentTenantLocale();
2643
2623
  };
2644
2624
  /**
@@ -2647,7 +2627,7 @@
2647
2627
  * @returns string || null
2648
2628
  */
2649
2629
  AgroPlatformUtils.getCurrentUserName = function () {
2650
- var name = AgroPlatformUtils.getTokenField("fullName");
2630
+ var name = AgroPlatformUtils.getTokenField('fullName');
2651
2631
  return name || null;
2652
2632
  };
2653
2633
  /**
@@ -2656,7 +2636,7 @@
2656
2636
  * @returns string
2657
2637
  */
2658
2638
  AgroPlatformUtils.getCurrentUserEmail = function () {
2659
- var email = AgroPlatformUtils.getTokenField("email");
2639
+ var email = AgroPlatformUtils.getTokenField('email');
2660
2640
  if (!email) {
2661
2641
  console.info("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2662
2642
  }
@@ -2691,7 +2671,7 @@
2691
2671
  * Caso contrário, retorna uma instância de Error
2692
2672
  */
2693
2673
  AgroPlatformUtils.getCurrentAccessToken = function () {
2694
- var token = AgroPlatformUtils.getTokenField("access_token");
2674
+ var token = AgroPlatformUtils.getTokenField('access_token');
2695
2675
  if (!token) {
2696
2676
  console.info("Cookie: \"" + COOKIE_TOKEN + "\" n\u00E3o encontrado.");
2697
2677
  }
@@ -3827,7 +3807,7 @@
3827
3807
  "agro.angular_components.save": "Salvar",
3828
3808
  "agro.angular_components.select": "Selecione",
3829
3809
  "agro.angular_components.updated_by": "Atualizado por",
3830
- error_invalid: "Valor inválido",
3810
+ "error_invalid": "Valor inválido",
3831
3811
  "agro.angular_components.choose_label": "Escolha",
3832
3812
  "agro.angular_components.remove_label": "Remover",
3833
3813
  "agro.angular_components.cancel_label": "Cancelar",
@@ -3931,16 +3911,8 @@
3931
3911
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Produto",
3932
3912
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidade de medida",
3933
3913
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectare",
3914
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de dados do NovoReceituário",
3934
3915
  "agro.angular_components.agronomic_prescription_origin_event": "Receituário Agronômico",
3935
- "agro.angular_components.number_or_series": "Número ou série",
3936
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
3937
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
3938
- "agro.angular_components.number": "Número",
3939
- "agro.angular_components.series": "Série",
3940
- "agro.angular_components.itens": "Itens",
3941
- "agro.angular_components.quantity": "Quantidade",
3942
- "agro.angular_components.issuance_date": "Data de emissão",
3943
- "agro.angular_components.no_register_found_for_external_invoices_summary": "Nenhuma nota encontrada",
3944
3916
  };
3945
3917
 
3946
3918
  var enUS = {
@@ -4196,15 +4168,8 @@
4196
4168
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Cidasc Load - Product",
4197
4169
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Cidasc Load - Unit of measure",
4198
4170
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Cidasc Load - Measure per hectare",
4171
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Prescription data load",
4199
4172
  "agro.angular_components.agronomic_prescription_origin_event": "Agronomic Prescription",
4200
- "agro.angular_components.number_or_series": "Número ou série",
4201
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
4202
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
4203
- "agro.angular_components.number": "Número",
4204
- "agro.angular_components.series": "Série",
4205
- "agro.angular_components.itens": "Itens",
4206
- "agro.angular_components.quantity": "Quantidade",
4207
- "agro.angular_components.issuance_date": "Data de emissão",
4208
4173
  };
4209
4174
 
4210
4175
  var esCO = {
@@ -4362,7 +4327,7 @@
4362
4327
  "agro.angular_components.save": "Guardar",
4363
4328
  "agro.angular_components.select": "Seleccione",
4364
4329
  "agro.angular_components.updated_by": "Actualizado por",
4365
- error_invalid: "Valor inválido",
4330
+ "error_invalid": "Valor inválido",
4366
4331
  "agro.angular_components.choose_label": "Elegir",
4367
4332
  "agro.angular_components.remove_label": "Eliminar",
4368
4333
  "agro.angular_components.cancel_label": "Cancelar",
@@ -4460,15 +4425,8 @@
4460
4425
  "agro.angular_components.CIDASC_DATA_LOAD_PRODUCT": "Carga Cidasc - Producto",
4461
4426
  "agro.angular_components.CIDASC_DATA_LOAD_MEASURE_UNIT": "Carga Cidasc - Unidad de medida",
4462
4427
  "agro.angular_components.CIDASC_DATA_LOAD_COMPOSED_MEASURE_UNIT": "Carga Cidasc - Medida por hectárea",
4428
+ "agro.angular_components.PRESCRIPTION_DATA_LOAD": "Carga de datos de la Nueva Receta",
4463
4429
  "agro.angular_components.agronomic_prescription_origin_event": "Recetario Agronómico",
4464
- "agro.angular_components.number_or_series": "Número ou série",
4465
- "agro.angular_components.panel_title_external_invoice_add_external_invoice": "Adicionar nota fiscal",
4466
- "agro.angular_components.add_pj_invoice_modal_no_invoices_found": "Nenhuma nota fiscal disponível para este produtor",
4467
- "agro.angular_components.number": "Número",
4468
- "agro.angular_components.series": "Série",
4469
- "agro.angular_components.itens": "Itens",
4470
- "agro.angular_components.quantity": "Quantidade",
4471
- "agro.angular_components.issuance_date": "Data de emissão",
4472
4430
  };
4473
4431
 
4474
4432
  var LibTranslationService = /** @class */ (function () {
@@ -4479,10 +4437,10 @@
4479
4437
  "es-CO": esCO,
4480
4438
  };
4481
4439
  this.currentTranslation = {};
4482
- this.setLang("pt-BR");
4440
+ this.setLang(this.getLangOfUser());
4483
4441
  }
4484
4442
  LibTranslationService.prototype.getLangOfUser = function () {
4485
- return AgroPlatformUtils.getCurrentTenantLocale() || "pt-BR";
4443
+ return AgroPlatformUtils.getCurrenTenantLocale() || "pt-BR";
4486
4444
  };
4487
4445
  LibTranslationService.prototype.setLang = function (lang) {
4488
4446
  this.currentTranslation = this.availableTranslations[lang] || {};
@@ -4522,288 +4480,6 @@
4522
4480
  return LibTranslationService;
4523
4481
  }());
4524
4482
 
4525
- var KilogramPipe = /** @class */ (function () {
4526
- function KilogramPipe(decimalPipe) {
4527
- this.decimalPipe = decimalPipe;
4528
- }
4529
- KilogramPipe.prototype.transform = function (value, format, kgCaseInsensitive) {
4530
- if (format === void 0) { format = "1.3-3"; }
4531
- if (kgCaseInsensitive === void 0) { kgCaseInsensitive = "UPPER"; }
4532
- if (value == null || isNaN(value)) {
4533
- return "";
4534
- }
4535
- var str = this.decimalPipe.transform(value, format);
4536
- var kgStr = "kg";
4537
- if (!str) {
4538
- console.info("Formato do peso inválido para transformação");
4539
- return "";
4540
- }
4541
- str = str.replace(/,/g, ".");
4542
- return this.replaceLastDotWithComma(str) + " " + (kgCaseInsensitive === "UPPER" ? kgStr.toUpperCase() : kgStr.toLowerCase());
4543
- };
4544
- KilogramPipe.prototype.replaceLastDotWithComma = function (value) {
4545
- var lastDotIndex = value.lastIndexOf(".");
4546
- if (lastDotIndex === -1) {
4547
- return value;
4548
- }
4549
- return value.substring(0, lastDotIndex) + "," + value.substring(lastDotIndex + 1);
4550
- };
4551
- KilogramPipe.ctorParameters = function () { return [
4552
- { type: common.DecimalPipe }
4553
- ]; };
4554
- KilogramPipe = __decorate([
4555
- core.Pipe({
4556
- name: "kilogram",
4557
- })
4558
- ], KilogramPipe);
4559
- return KilogramPipe;
4560
- }());
4561
-
4562
- var KilogramModule = /** @class */ (function () {
4563
- function KilogramModule() {
4564
- }
4565
- KilogramModule = __decorate([
4566
- core.NgModule({
4567
- declarations: [KilogramPipe],
4568
- imports: [
4569
- common.CommonModule
4570
- ],
4571
- exports: [KilogramPipe]
4572
- })
4573
- ], KilogramModule);
4574
- return KilogramModule;
4575
- }());
4576
-
4577
- var CnpjCpfPipe = /** @class */ (function () {
4578
- function CnpjCpfPipe() {
4579
- }
4580
- CnpjCpfPipe.prototype.transform = function (value) {
4581
- var args = [];
4582
- for (var _i = 1; _i < arguments.length; _i++) {
4583
- args[_i - 1] = arguments[_i];
4584
- }
4585
- if (typeof value !== "string" && typeof value === "number") {
4586
- value = value === null || value === void 0 ? void 0 : value.toString();
4587
- }
4588
- if (typeof value !== "string") {
4589
- return value;
4590
- }
4591
- if (AgroStringUtils.validateCNPJ(value)) {
4592
- return AgroStringUtils.applyMask(value, exports.AgroStringMasks.CNPJ);
4593
- }
4594
- if (AgroStringUtils.validateCPF(value)) {
4595
- return AgroStringUtils.applyMask(value, exports.AgroStringMasks.CPF);
4596
- }
4597
- return value;
4598
- };
4599
- CnpjCpfPipe = __decorate([
4600
- core.Pipe({
4601
- name: "cnpjCpf",
4602
- })
4603
- ], CnpjCpfPipe);
4604
- return CnpjCpfPipe;
4605
- }());
4606
-
4607
- var CnpjCpfPipeModule = /** @class */ (function () {
4608
- function CnpjCpfPipeModule() {
4609
- }
4610
- CnpjCpfPipeModule = __decorate([
4611
- core.NgModule({
4612
- declarations: [CnpjCpfPipe],
4613
- imports: [common.CommonModule],
4614
- exports: [CnpjCpfPipe],
4615
- })
4616
- ], CnpjCpfPipeModule);
4617
- return CnpjCpfPipeModule;
4618
- }());
4619
-
4620
- var AgroObjectStringifier = /** @class */ (function () {
4621
- function AgroObjectStringifier() {
4622
- }
4623
- /**
4624
- * Formata um objeto concatenando valores segundo as chaves e pipes informados.
4625
- *
4626
- * @param separator Separador entre os valores (ex: "-")
4627
- * @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
4628
- * @param obj Objeto origem
4629
- */
4630
- AgroObjectStringifier.formatObject = function (separator, fields, obj, usePipes) {
4631
- function mapField(field) {
4632
- var value = AgroObjectStringifier.resolvePath(obj, field);
4633
- if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
4634
- return usePipes[field].transform(value);
4635
- }
4636
- return value !== null && value !== void 0 ? value : "";
4637
- }
4638
- function filterValid(v) {
4639
- return typeof v === "number" || AgroStringUtils.isValid(v);
4640
- }
4641
- return fields.map(mapField).filter(filterValid).join(" " + separator + " ");
4642
- };
4643
- /** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
4644
- AgroObjectStringifier.resolvePath = function (obj, path) {
4645
- function reducer(acc, key) {
4646
- return acc === null || acc === void 0 ? void 0 : acc[key];
4647
- }
4648
- return path.split(".").reduce(reducer, obj);
4649
- };
4650
- return AgroObjectStringifier;
4651
- }());
4652
-
4653
- var StringifierPipe = /** @class */ (function () {
4654
- function StringifierPipe() {
4655
- }
4656
- StringifierPipe.prototype.transform = function (value, separator, paths, pipes) {
4657
- return AgroObjectStringifier.formatObject(separator, paths, value, pipes);
4658
- };
4659
- StringifierPipe = __decorate([
4660
- core.Pipe({ name: "stringifier" })
4661
- ], StringifierPipe);
4662
- return StringifierPipe;
4663
- }());
4664
-
4665
- var StringifierPipeModule = /** @class */ (function () {
4666
- function StringifierPipeModule() {
4667
- }
4668
- StringifierPipeModule = __decorate([
4669
- core.NgModule({
4670
- declarations: [StringifierPipe],
4671
- imports: [common.CommonModule],
4672
- exports: [StringifierPipe],
4673
- })
4674
- ], StringifierPipeModule);
4675
- return StringifierPipeModule;
4676
- }());
4677
-
4678
- var TelephonePipe = /** @class */ (function () {
4679
- function TelephonePipe() {
4680
- }
4681
- /**
4682
- * Transforma um número de telefone aplicando máscara automaticamente.
4683
- * @param value Valor do telefone.
4684
- * @param withDDI Define se deve forçar formatação com DDI (mesmo que não exista).
4685
- */
4686
- TelephonePipe.prototype.transform = function (value, withDDI) {
4687
- if (withDDI === void 0) { withDDI = false; }
4688
- if (!value) {
4689
- return "";
4690
- }
4691
- var digits = this.cleanDigits(value);
4692
- if (!digits) {
4693
- return value.toString();
4694
- }
4695
- var _a = this.extractParts(digits, withDDI), ddi = _a.ddi, ddd = _a.ddd, number = _a.number;
4696
- return this.formatPhone(ddi, ddd, number, value.toString(), withDDI);
4697
- };
4698
- /** Remove todos os caracteres não numéricos */
4699
- TelephonePipe.prototype.cleanDigits = function (value) {
4700
- return value.toString().replace(/\D+/g, "");
4701
- };
4702
- /** Extrai DDI, DDD e número, considerando se deve aplicar DDI forçado */
4703
- TelephonePipe.prototype.extractParts = function (digits, withDDI) {
4704
- var len = digits.length;
4705
- if (withDDI) {
4706
- return this.extractWithDDI(digits);
4707
- }
4708
- if (len <= exports.AGRO_NUMBERS.NINE) {
4709
- return { ddi: "", ddd: "", number: digits };
4710
- }
4711
- if (len <= exports.AGRO_NUMBERS.ELEVEN) {
4712
- return this.extractWithDDD(digits);
4713
- }
4714
- return this.extractWithDDI(digits);
4715
- };
4716
- /** Extrai DDD e número (sem DDI) */
4717
- TelephonePipe.prototype.extractWithDDD = function (digits) {
4718
- var ddd = digits.slice(0, 2);
4719
- var number = digits.slice(2);
4720
- return { ddi: "", ddd: ddd, number: number };
4721
- };
4722
- /** Extrai DDI, DDD e número */
4723
- TelephonePipe.prototype.extractWithDDI = function (digits) {
4724
- var len = digits.length;
4725
- var ddiLen = exports.AGRO_NUMBERS.ONE;
4726
- if (len >= exports.AGRO_NUMBERS.FOURTEEN) {
4727
- ddiLen = exports.AGRO_NUMBERS.THREE;
4728
- }
4729
- if (len >= exports.AGRO_NUMBERS.TWELVE) {
4730
- ddiLen = exports.AGRO_NUMBERS.TWO;
4731
- }
4732
- var ddi = digits.slice(exports.AGRO_NUMBERS.ZERO, ddiLen);
4733
- var ddd = digits.slice(ddiLen, ddiLen + exports.AGRO_NUMBERS.TWO);
4734
- var number = digits.slice(ddiLen + exports.AGRO_NUMBERS.TWO);
4735
- return { ddi: ddi, ddd: ddd, number: number };
4736
- };
4737
- /** Monta o número formatado */
4738
- TelephonePipe.prototype.formatPhone = function (ddi, ddd, number, fallback, withDDI) {
4739
- if (!number) {
4740
- return fallback;
4741
- }
4742
- var formatted = "";
4743
- if (withDDI || ddi) {
4744
- formatted += "+" + (ddi || "55") + " ";
4745
- }
4746
- if (ddd) {
4747
- formatted += "(" + ddd + ") ";
4748
- }
4749
- formatted += this.formatNumber(number);
4750
- return formatted;
4751
- };
4752
- /** Aplica máscara de 8 ou 9 dígitos */
4753
- TelephonePipe.prototype.formatNumber = function (number) {
4754
- var len = number.length;
4755
- if (len === exports.AGRO_NUMBERS.NINE) {
4756
- return number.slice(exports.AGRO_NUMBERS.ZERO, exports.AGRO_NUMBERS.FIVE) + "-" + number.slice(exports.AGRO_NUMBERS.FIVE);
4757
- }
4758
- if (len === exports.AGRO_NUMBERS.EIGHT) {
4759
- return number.slice(exports.AGRO_NUMBERS.ZERO, exports.AGRO_NUMBERS.FOUR) + "-" + number.slice(exports.AGRO_NUMBERS.FOUR);
4760
- }
4761
- return number;
4762
- };
4763
- TelephonePipe = __decorate([
4764
- core.Pipe({ name: "telephone" })
4765
- ], TelephonePipe);
4766
- return TelephonePipe;
4767
- }());
4768
-
4769
- var TelephonePipeModule = /** @class */ (function () {
4770
- function TelephonePipeModule() {
4771
- }
4772
- TelephonePipeModule = __decorate([
4773
- core.NgModule({
4774
- declarations: [TelephonePipe],
4775
- imports: [common.CommonModule],
4776
- exports: [TelephonePipe],
4777
- })
4778
- ], TelephonePipeModule);
4779
- return TelephonePipeModule;
4780
- }());
4781
-
4782
- var LibTranslatePipe = /** @class */ (function () {
4783
- function LibTranslatePipe(translateService) {
4784
- this.translateService = translateService;
4785
- }
4786
- LibTranslatePipe.prototype.transform = function (value) {
4787
- var args = [];
4788
- for (var _i = 1; _i < arguments.length; _i++) {
4789
- args[_i - 1] = arguments[_i];
4790
- }
4791
- if (args.length > 0) {
4792
- return this.translateService.instant(value, args[0]);
4793
- }
4794
- return this.translateService.instant(value);
4795
- };
4796
- LibTranslatePipe.ctorParameters = function () { return [
4797
- { type: LibTranslationService }
4798
- ]; };
4799
- LibTranslatePipe = __decorate([
4800
- core.Pipe({
4801
- name: 'libTranslate'
4802
- })
4803
- ], LibTranslatePipe);
4804
- return LibTranslatePipe;
4805
- }());
4806
-
4807
4483
  var CancelEventDialogComponent = /** @class */ (function () {
4808
4484
  function CancelEventDialogComponent(formBuilder, config, ref, translate) {
4809
4485
  this.formBuilder = formBuilder;
@@ -6836,6 +6512,31 @@
6836
6512
  return TicketModule;
6837
6513
  }());
6838
6514
 
6515
+ var LibTranslatePipe = /** @class */ (function () {
6516
+ function LibTranslatePipe(translateService) {
6517
+ this.translateService = translateService;
6518
+ }
6519
+ LibTranslatePipe.prototype.transform = function (value) {
6520
+ var args = [];
6521
+ for (var _i = 1; _i < arguments.length; _i++) {
6522
+ args[_i - 1] = arguments[_i];
6523
+ }
6524
+ if (args.length > 0) {
6525
+ return this.translateService.instant(value, args[0]);
6526
+ }
6527
+ return this.translateService.instant(value);
6528
+ };
6529
+ LibTranslatePipe.ctorParameters = function () { return [
6530
+ { type: LibTranslationService }
6531
+ ]; };
6532
+ LibTranslatePipe = __decorate([
6533
+ core.Pipe({
6534
+ name: 'libTranslate'
6535
+ })
6536
+ ], LibTranslatePipe);
6537
+ return LibTranslatePipe;
6538
+ }());
6539
+
6839
6540
  var LibTranslationModule = /** @class */ (function () {
6840
6541
  function LibTranslationModule() {
6841
6542
  }
@@ -6847,7 +6548,6 @@
6847
6548
  imports: [
6848
6549
  common.CommonModule
6849
6550
  ],
6850
- providers: [LibTranslationService],
6851
6551
  exports: [
6852
6552
  LibTranslatePipe
6853
6553
  ]
@@ -6956,440 +6656,6 @@
6956
6656
  return EventControlBoardModule;
6957
6657
  }());
6958
6658
 
6959
- var AgroEntityService = /** @class */ (function () {
6960
- function AgroEntityService(http, messageService, entityUrl, actionsUrl, queriesUrl, translate) {
6961
- this.http = http;
6962
- this.messageService = messageService;
6963
- this.entityUrl = entityUrl;
6964
- this.actionsUrl = actionsUrl;
6965
- this.queriesUrl = queriesUrl;
6966
- this.translate = translate;
6967
- this.http = http;
6968
- this.messageService = messageService;
6969
- this.entityUrl = entityUrl;
6970
- this.actionsUrl = actionsUrl;
6971
- this.queriesUrl = queriesUrl;
6972
- this.translate = translate;
6973
- this.defaultCatch = this.defaultCatch.bind(this);
6974
- }
6975
- AgroEntityService.prototype.getListQueryParams = function (listParams) {
6976
- var ten = 10;
6977
- 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;
6978
- var params = new http.HttpParams();
6979
- params = params.append("size", String(size));
6980
- params = params.append("offset", String(page));
6981
- if (sort && sort.length) {
6982
- params = params.append("orderby", sort.map(this.getBodyFilters()).join(", "));
6983
- }
6984
- if (filterQuery) {
6985
- params = params.append("filter", filterQuery);
6986
- }
6987
- if (displayFields && displayFields.length) {
6988
- params = params.append("displayfields", displayFields.join());
6989
- }
6990
- return params;
6991
- };
6992
- AgroEntityService.prototype.getBodyParams = function (listParams) {
6993
- var ten = 10;
6994
- 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;
6995
- var bodyParams = {};
6996
- bodyParams.size = size;
6997
- bodyParams.offset = page;
6998
- if (sort && sort.length) {
6999
- bodyParams.orderBy = sort.map(this.getBodyFilters()).join(", ");
7000
- }
7001
- if (filterQuery) {
7002
- bodyParams.filter = filterQuery;
7003
- }
7004
- if (displayFields && displayFields.length) {
7005
- bodyParams.displayfields = displayFields.join();
7006
- }
7007
- return bodyParams;
7008
- };
7009
- AgroEntityService.prototype.getBodyFilters = function () {
7010
- return function (s) {
7011
- var order = "";
7012
- if (s.order === 1) {
7013
- order = " asc";
7014
- }
7015
- if (s.order === -1) {
7016
- order = " desc";
7017
- }
7018
- return "" + s.field + order;
7019
- };
7020
- };
7021
- AgroEntityService.prototype.defaultCatch = function (errorMsgs) {
7022
- var _this = this;
7023
- if (errorMsgs === void 0) { errorMsgs = []; }
7024
- var unauthorized_401 = 401;
7025
- // errorMsgs = [...errorMsgs, ...DefaultErrorMessages];
7026
- errorMsgs = __spread(errorMsgs);
7027
- var zero = 0;
7028
- return operators.catchError(function (err) {
7029
- if (err) {
7030
- var errorMessage = errorMsgs.find(function (eMsg) { return eMsg.status === (err === null || err === void 0 ? void 0 : err.status) || zero; });
7031
- var summary = err.status ? String(err.status) : "Error";
7032
- var detail = _this.getErrorMessage(err);
7033
- if (err.status === unauthorized_401) {
7034
- summary = _this.translate.instant("agro.angular_components.error_unauthorized_title");
7035
- detail = _this.translate.instant("agro.angular_components.error_unauthorized_description");
7036
- }
7037
- if (errorMessage) {
7038
- summary = errorMessage.summary ? _this.translate.instant(errorMessage.summary) : summary;
7039
- detail = errorMessage.detail ? _this.translate.instant(errorMessage.detail) : detail;
7040
- }
7041
- _this.messageService.add({
7042
- severity: "error",
7043
- summary: summary,
7044
- detail: detail,
7045
- });
7046
- }
7047
- return rxjs.throwError(err);
7048
- });
7049
- };
7050
- AgroEntityService.prototype.getErrorMessage = function (err) {
7051
- if (err.error && err.error.message) {
7052
- return err.error.message;
7053
- }
7054
- if (err.statusText) {
7055
- return err.statusText;
7056
- }
7057
- if (err.message) {
7058
- return err.message;
7059
- }
7060
- return "Error";
7061
- };
7062
- AgroEntityService.prototype.list = function (listParams, errorMessage) {
7063
- if (errorMessage === void 0) { errorMessage = []; }
7064
- return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch(errorMessage));
7065
- };
7066
- AgroEntityService.prototype.get = function (id, errorMessage) {
7067
- if (errorMessage === void 0) { errorMessage = []; }
7068
- return this.http.get(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
7069
- };
7070
- AgroEntityService.prototype.insert = function (entity, errorMessage) {
7071
- if (errorMessage === void 0) { errorMessage = []; }
7072
- return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch(errorMessage));
7073
- };
7074
- AgroEntityService.prototype.update = function (id, entity, errorMessage) {
7075
- if (errorMessage === void 0) { errorMessage = []; }
7076
- return this.http.put(this.entityUrl + "/" + id, entity).pipe(this.defaultCatch(errorMessage));
7077
- };
7078
- AgroEntityService.prototype.delete = function (id, errorMessage) {
7079
- if (errorMessage === void 0) { errorMessage = []; }
7080
- return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch(errorMessage));
7081
- };
7082
- AgroEntityService.prototype.listCustomFilter = function (listParams, action, errorMessage) {
7083
- if (errorMessage === void 0) { errorMessage = []; }
7084
- return this.http.post(this.actionsUrl + "/" + action, this.getBodyParams(listParams)).pipe(this.defaultCatch(errorMessage));
7085
- };
7086
- return AgroEntityService;
7087
- }());
7088
-
7089
- var statusLookup;
7090
- (function (statusLookup) {
7091
- statusLookup["PENDING"] = "PENDING";
7092
- statusLookup["FINISHED"] = "FINISHED";
7093
- statusLookup["ERROR"] = "ERROR";
7094
- })(statusLookup || (statusLookup = {}));
7095
- var statusIntegration;
7096
- (function (statusIntegration) {
7097
- statusIntegration["SUCCESS"] = "SUCCESS";
7098
- statusIntegration["IN_PROGRESS"] = "IN_PROGRESS";
7099
- statusIntegration["ERROR"] = "ERROR";
7100
- })(statusIntegration || (statusIntegration = {}));
7101
-
7102
- var AgroInvoiceService = /** @class */ (function (_super) {
7103
- __extends(AgroInvoiceService, _super);
7104
- function AgroInvoiceService(http, messageService, translate) {
7105
- var _this = _super.call(this, http, messageService, "agro/invoice/entities/invoice", "agro/invoice/actions", "agro/invoice/queries", translate) || this;
7106
- _this.http = http;
7107
- _this.messageService = messageService;
7108
- _this.translate = translate;
7109
- _this.pooling = new rxjs.Subject();
7110
- return _this;
7111
- }
7112
- AgroInvoiceService.prototype.invoiceLookupFilter = function (data) {
7113
- var _this = this;
7114
- return this.http
7115
- .post(this.queriesUrl + "/invoiceLookup", data)
7116
- .pipe(operators.switchMap(function (res) { return _this.pollInvoiceResult(res.requestId); }));
7117
- };
7118
- AgroInvoiceService.prototype.cancelActivePooling = function () {
7119
- this.pooling.next();
7120
- };
7121
- AgroInvoiceService.prototype.pollInvoiceResult = function (requestId) {
7122
- var _this = this;
7123
- var delays = Array.from({ length: 10 }, function (_, index) {
7124
- if (index === 0) {
7125
- return 1000;
7126
- }
7127
- return (index + 1) * 1000;
7128
- });
7129
- return rxjs.scheduled(delays, rxjs.asyncScheduler).pipe(operators.concatMap(function (delay) {
7130
- return rxjs.timer(delay).pipe(operators.switchMap(function () { return _this.http.post(_this.queriesUrl + "/getInvoiceLookup", { requestId: requestId }); }), operators.tap(function (res) {
7131
- if (res.status === statusLookup.ERROR) {
7132
- throw new Error(res.message);
7133
- }
7134
- }));
7135
- }), operators.scan(function (_, curr) { return curr; }, null), operators.filter(function (res) { return (res === null || res === void 0 ? void 0 : res.status) === statusLookup.FINISHED; }), operators.take(1), operators.defaultIfEmpty(null), operators.takeUntil(this.pooling));
7136
- };
7137
- AgroInvoiceService.ctorParameters = function () { return [
7138
- { type: http.HttpClient },
7139
- { type: api.MessageService },
7140
- { type: LibTranslationService }
7141
- ]; };
7142
- AgroInvoiceService = __decorate([
7143
- core.Injectable()
7144
- ], AgroInvoiceService);
7145
- return AgroInvoiceService;
7146
- }(AgroEntityService));
7147
-
7148
- var INVOICE_ITEMS = "invoiceItems.*";
7149
- var ModalInvoicePjSelectorComponent = /** @class */ (function () {
7150
- function ModalInvoicePjSelectorComponent(translate, invoiceService) {
7151
- this.translate = translate;
7152
- this.invoiceService = invoiceService;
7153
- this.whenSelectInvoices = new core.EventEmitter();
7154
- this.buttonPriority = angularComponents.ButtonPriority;
7155
- this.gridColumns = [
7156
- { field: "number", header: this.translate.instant("agro.angular_components.number") },
7157
- { field: "series", header: this.translate.instant("agro.angular_components.series") },
7158
- { field: "invoiceItems", header: this.translate.instant("agro.angular_components.itens") },
7159
- { field: "quantity", header: this.translate.instant("agro.angular_components.quantity") },
7160
- { field: "issuanceDate", header: this.translate.instant("agro.angular_components.issuance_date") },
7161
- ];
7162
- this.dontHaveAnyInvoice = false;
7163
- this.gridLoading = true;
7164
- this.gridTotalRecords = exports.AGRO_NUMBERS.ZERO;
7165
- this.selected = [];
7166
- this.unselectedIds = new Set();
7167
- this.visible = false;
7168
- this.searchValue = new forms.FormControl("", []);
7169
- this.ngUnsubscribe = new rxjs.Subject();
7170
- this.currentParams = {
7171
- page: 0,
7172
- size: 10,
7173
- sort: [{ field: "issuanceDate", order: 1 }],
7174
- displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
7175
- filterQuery: "",
7176
- };
7177
- }
7178
- ModalInvoicePjSelectorComponent.prototype.ngOnDestroy = function () {
7179
- this.ngUnsubscribe.next();
7180
- this.ngUnsubscribe.complete();
7181
- };
7182
- ModalInvoicePjSelectorComponent.prototype.ngOnInit = function () {
7183
- this.whenSearchValueChanges();
7184
- };
7185
- ModalInvoicePjSelectorComponent.prototype.whenSearchValueChanges = function () {
7186
- var _this = this;
7187
- this.searchValue.valueChanges
7188
- .pipe(operators.takeUntil(this.ngUnsubscribe))
7189
- .pipe(operators.debounceTime(exports.AGRO_NUMBERS.THREE_HUNDRED))
7190
- .subscribe(function (value) {
7191
- if (value) {
7192
- _this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] }, value);
7193
- }
7194
- else {
7195
- _this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7196
- }
7197
- });
7198
- };
7199
- ModalInvoicePjSelectorComponent.prototype.tryToSearchAgain = function () {
7200
- this.gridLoading = true;
7201
- this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7202
- };
7203
- ModalInvoicePjSelectorComponent.prototype.open = function () {
7204
- if (this.checkIfOptionsIsValid()) {
7205
- this.visible = true;
7206
- this.gridData = [];
7207
- this.gridLoading = true;
7208
- this.gridTotalRecords = 0;
7209
- this.selected = [];
7210
- this.unselectedIds.clear();
7211
- this.currentParams = {
7212
- page: 0,
7213
- size: 10,
7214
- sort: [],
7215
- filterQuery: "",
7216
- displayFields: ["*", INVOICE_ITEMS],
7217
- };
7218
- this.updateGridData({ first: 0, rows: 10, multiSortMeta: [{ field: "issuanceDate", order: 1 }] });
7219
- this.selected = [];
7220
- }
7221
- };
7222
- ModalInvoicePjSelectorComponent.prototype.checkIfOptionsIsValid = function () {
7223
- if (!this.options) {
7224
- return false;
7225
- }
7226
- if (!this.options.companyId || !this.options.branchId) {
7227
- return false;
7228
- }
7229
- return true;
7230
- };
7231
- ModalInvoicePjSelectorComponent.prototype.updateGridData = function (event, searchValue) {
7232
- var _this = this;
7233
- var _a;
7234
- this.cancelPooling();
7235
- var _b = this.options, companyId = _b.companyId, branchId = _b.branchId;
7236
- var producerId = this.options.producersIds[0];
7237
- var ruralEstateId = this.options.ruralEstateIds[0];
7238
- var size = event.rows;
7239
- var page = event.first / size;
7240
- var sizePage = event.rows;
7241
- this.currentParams = {
7242
- page: page,
7243
- size: size,
7244
- sort: ((_a = event.multiSortMeta) === null || _a === void 0 ? void 0 : _a.length) ? event.multiSortMeta : [{ field: "issuanceDate", order: 1 }],
7245
- displayFields: ["*", INVOICE_ITEMS, "issuanceDate"],
7246
- };
7247
- this.gridLoading = true;
7248
- this.dontHaveAnyInvoice = false;
7249
- var filterBody = {
7250
- filter: {
7251
- companyId: companyId,
7252
- branchId: branchId,
7253
- producerIds: [producerId],
7254
- ruralEstateIds: [ruralEstateId],
7255
- multiProducts: false,
7256
- productId: this.options.productId,
7257
- },
7258
- pageRequest: {
7259
- offset: page,
7260
- size: sizePage,
7261
- orderBy: this.currentParams.sort.map(function (sort) { return ({ field: sort.field, order: sort.order === 1 ? "asc" : "desc" }); }),
7262
- },
7263
- };
7264
- this.invoiceService
7265
- .invoiceLookupFilter(filterBody)
7266
- .pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () {
7267
- _this.gridLoading = false;
7268
- }))
7269
- .subscribe(function (result) {
7270
- var _a;
7271
- _this.gridData = ((_a = result === null || result === void 0 ? void 0 : result.result) === null || _a === void 0 ? void 0 : _a.invoices) || [];
7272
- if (_this.gridData.length === 0 && !searchValue) {
7273
- _this.dontHaveAnyInvoice = true;
7274
- }
7275
- _this.gridTotalRecords = result.result.totalElements;
7276
- }, function (error) {
7277
- console.info("Erro ao buscar notas fiscais: ", error);
7278
- }, function () {
7279
- _this.gridLoading = false;
7280
- });
7281
- };
7282
- ModalInvoicePjSelectorComponent.prototype.cancelPooling = function () {
7283
- this.invoiceService.cancelActivePooling();
7284
- };
7285
- ModalInvoicePjSelectorComponent.prototype.add = function () {
7286
- return __awaiter(this, void 0, void 0, function () {
7287
- return __generator(this, function (_a) {
7288
- try {
7289
- this.whenSelectInvoices.emit(this.selected);
7290
- this.resetSpecs();
7291
- }
7292
- catch (error) {
7293
- console.info("Erro ao selecionar notas fiscais: ", error);
7294
- }
7295
- return [2 /*return*/];
7296
- });
7297
- });
7298
- };
7299
- ModalInvoicePjSelectorComponent.prototype.resetSpecs = function () {
7300
- this.selected = [];
7301
- this.dontHaveAnyInvoice = false;
7302
- this.visible = false;
7303
- this.gridData = [];
7304
- this.gridLoading = false;
7305
- this.gridTotalRecords = 0;
7306
- };
7307
- ModalInvoicePjSelectorComponent.prototype.cancel = function () {
7308
- return __awaiter(this, void 0, void 0, function () {
7309
- return __generator(this, function (_a) {
7310
- this.resetSpecs();
7311
- return [2 /*return*/];
7312
- });
7313
- });
7314
- };
7315
- ModalInvoicePjSelectorComponent.ctorParameters = function () { return [
7316
- { type: LibTranslationService },
7317
- { type: AgroInvoiceService }
7318
- ]; };
7319
- __decorate([
7320
- core.Input()
7321
- ], ModalInvoicePjSelectorComponent.prototype, "options", void 0);
7322
- __decorate([
7323
- core.Output()
7324
- ], ModalInvoicePjSelectorComponent.prototype, "whenSelectInvoices", void 0);
7325
- ModalInvoicePjSelectorComponent = __decorate([
7326
- core.Component({
7327
- selector: "s-modal-invoice-pj-selector",
7328
- 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",
7329
- 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}"]
7330
- })
7331
- ], ModalInvoicePjSelectorComponent);
7332
- return ModalInvoicePjSelectorComponent;
7333
- }());
7334
-
7335
- var AgroInvoiceModule = /** @class */ (function () {
7336
- function AgroInvoiceModule() {
7337
- }
7338
- AgroInvoiceModule = __decorate([
7339
- core.NgModule({
7340
- imports: [
7341
- http.HttpClientModule,
7342
- platformComponents.PermissionsModule.forChild([
7343
- {
7344
- name: 'invoice',
7345
- actions: ['Visualizar', 'Incluir', 'Editar', 'Excluir'],
7346
- uri: "res://senior.com.br/agro/origination/entities/invoice",
7347
- },
7348
- ]),
7349
- ],
7350
- providers: [
7351
- AgroInvoiceService,
7352
- ],
7353
- declarations: [],
7354
- exports: [],
7355
- })
7356
- ], AgroInvoiceModule);
7357
- return AgroInvoiceModule;
7358
- }());
7359
-
7360
- var ModalInvoicePjSelectorModule = /** @class */ (function () {
7361
- function ModalInvoicePjSelectorModule() {
7362
- }
7363
- ModalInvoicePjSelectorModule = __decorate([
7364
- core.NgModule({
7365
- declarations: [ModalInvoicePjSelectorComponent],
7366
- providers: [common.DecimalPipe, common.DatePipe],
7367
- imports: [
7368
- common.CommonModule,
7369
- forms.ReactiveFormsModule,
7370
- angularComponents.LocaleModule.forChild(),
7371
- angularComponents.EmptyStateModule,
7372
- angularComponents.BignumberInputModule,
7373
- primeng.InputTextModule,
7374
- angularComponents.ButtonModule,
7375
- angularComponents.TableModule,
7376
- primeng.SharedModule,
7377
- table.TableModule,
7378
- AgroInvoiceModule,
7379
- primeng.DialogModule,
7380
- KilogramModule,
7381
- angularComponents.LoadingStateModule,
7382
- primeng.ConfirmDialogModule,
7383
- LibTranslationModule,
7384
- KilogramModule,
7385
- angularComponents.TableHeaderCheckboxModule,
7386
- ],
7387
- exports: [ModalInvoicePjSelectorComponent],
7388
- })
7389
- ], ModalInvoicePjSelectorModule);
7390
- return ModalInvoicePjSelectorModule;
7391
- }());
7392
-
7393
6659
  var HostProjectConfigsInjectionToken = new core.InjectionToken("hostProjectConfigs");
7394
6660
  var AgroAngularComponentsModule = /** @class */ (function () {
7395
6661
  function AgroAngularComponentsModule() {
@@ -7419,8 +6685,6 @@
7419
6685
  exports.AgroCookieUtils = AgroCookieUtils;
7420
6686
  exports.AgroDateUtils = AgroDateUtils;
7421
6687
  exports.AgroFormValidator = AgroFormValidator;
7422
- exports.AgroInvoiceModule = AgroInvoiceModule;
7423
- exports.AgroInvoiceService = AgroInvoiceService;
7424
6688
  exports.AgroLogics = AgroLogics;
7425
6689
  exports.AgroNameUtils = AgroNameUtils;
7426
6690
  exports.AgroNumberUtils = AgroNumberUtils;
@@ -7430,8 +6694,6 @@
7430
6694
  exports.AsyncLock = AsyncLock;
7431
6695
  exports.CancelEventDialogComponent = CancelEventDialogComponent;
7432
6696
  exports.CancelEventDialogModule = CancelEventDialogModule;
7433
- exports.CnpjCpfPipe = CnpjCpfPipe;
7434
- exports.CnpjCpfPipeModule = CnpjCpfPipeModule;
7435
6697
  exports.Colors = Colors;
7436
6698
  exports.E001TnsModule = E001TnsModule;
7437
6699
  exports.E001pesModule = E001pesModule;
@@ -7450,30 +6712,21 @@
7450
6712
  exports.FixationModule = FixationModule;
7451
6713
  exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
7452
6714
  exports.InvoiceModule = InvoiceModule;
7453
- exports.KilogramModule = KilogramModule;
7454
- exports.KilogramPipe = KilogramPipe;
7455
6715
  exports.LibTranslatePipe = LibTranslatePipe;
7456
6716
  exports.LibTranslationModule = LibTranslationModule;
7457
6717
  exports.LibTranslationService = LibTranslationService;
7458
- exports.ModalInvoicePjSelectorComponent = ModalInvoicePjSelectorComponent;
7459
- exports.ModalInvoicePjSelectorModule = ModalInvoicePjSelectorModule;
7460
6718
  exports.OriginationModule = OriginationModule;
7461
6719
  exports.PaginatorStorageService = PaginatorStorageService;
7462
6720
  exports.PrimitiveManager = PrimitiveManager;
7463
6721
  exports.ProducerInvoiceModule = ProducerInvoiceModule;
7464
6722
  exports.RuralEstateModule = RuralEstateModule;
7465
6723
  exports.SharedModule = SharedModule;
7466
- exports.StringifierPipe = StringifierPipe;
7467
- exports.StringifierPipeModule = StringifierPipeModule;
7468
- exports.TelephonePipe = TelephonePipe;
7469
- exports.TelephonePipeModule = TelephonePipeModule;
7470
6724
  exports.TicketModule = TicketModule;
7471
6725
  exports.TransferModule = TransferModule;
7472
6726
  exports.UserInformationService = UserInformationService;
7473
6727
  exports.WebsocketModule = WebsocketModule;
7474
6728
  exports.WebsocketService = WebsocketService;
7475
- exports.ɵa = LibTranslatePipe;
7476
- exports.ɵb = LibTranslationService;
6729
+ exports.ɵa = LibTranslationService;
7477
6730
 
7478
6731
  Object.defineProperty(exports, '__esModule', { value: true });
7479
6732