@senior-agronegocio/angular-components 1.0.8 → 1.0.9

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 (139) hide show
  1. package/LLM_LIBRARY_GUIDES.md +9 -1
  2. package/README.md +5 -0
  3. package/agro-angular-components.module.d.ts +4 -6
  4. package/esm2022/agro-angular-components.module.mjs +4 -3
  5. package/esm2022/fields/lookups/config/lookup-host-project-config.mjs +7 -0
  6. package/esm2022/fields/lookups/core/agro-base-lookup-field.mjs +385 -0
  7. package/esm2022/fields/lookups/core/agro-branch-lookup.mjs +26 -0
  8. package/esm2022/fields/lookups/core/agro-company-lookup.mjs +24 -0
  9. package/esm2022/fields/lookups/core/agro-currency-lookup.mjs +23 -0
  10. package/esm2022/fields/lookups/core/agro-deposit-balance-lookup.mjs +24 -0
  11. package/esm2022/fields/lookups/core/agro-deposit-lookup.mjs +24 -0
  12. package/esm2022/fields/lookups/core/agro-driver-lookup.mjs +24 -0
  13. package/esm2022/fields/lookups/core/agro-e095-pes-lookup.mjs +24 -0
  14. package/esm2022/fields/lookups/core/agro-family-group-lookup.mjs +24 -0
  15. package/esm2022/fields/lookups/core/agro-family-lookup.mjs +24 -0
  16. package/esm2022/fields/lookups/core/agro-harvest-lookup.mjs +24 -0
  17. package/esm2022/fields/lookups/core/agro-increase-product-lookup.mjs +30 -0
  18. package/esm2022/fields/lookups/core/agro-lookup-base.mjs +39 -0
  19. package/esm2022/fields/lookups/core/agro-producer-lookup.mjs +24 -0
  20. package/esm2022/fields/lookups/core/agro-product-lookup.mjs +24 -0
  21. package/esm2022/fields/lookups/core/agro-product-variety-lookup.mjs +24 -0
  22. package/esm2022/fields/lookups/core/agro-romaneo-lookup.mjs +23 -0
  23. package/esm2022/fields/lookups/core/agro-rural-estate-lookup.mjs +24 -0
  24. package/esm2022/fields/lookups/core/agro-ticket-lookup.mjs +24 -0
  25. package/esm2022/fields/lookups/core/index.mjs +21 -0
  26. package/esm2022/fields/lookups/core/lookup-field.handlers.mjs +82 -0
  27. package/esm2022/fields/lookups/core/lookup-field.types.mjs +2 -0
  28. package/esm2022/fields/lookups/index.mjs +5 -0
  29. package/esm2022/fields/lookups/services/agro-lookup-entity.service.mjs +122 -0
  30. package/esm2022/fields/lookups/services/driver/agro-lookup-driver.service.mjs +34 -0
  31. package/esm2022/fields/lookups/services/driver/driver-dto.mjs +2 -0
  32. package/esm2022/fields/lookups/services/e-001-pes/agro-lookup-e001-pes.service.mjs +41 -0
  33. package/esm2022/fields/lookups/services/e-001-pes/e-001-pes-dto.mjs +2 -0
  34. package/esm2022/fields/lookups/services/e-012-fam/agro-lookup-e012-fam.service.mjs +34 -0
  35. package/esm2022/fields/lookups/services/e-012-fam/e-012-fam-dto.mjs +2 -0
  36. package/esm2022/fields/lookups/services/e-031-moe/agro-lookup-e031-moe.service.mjs +41 -0
  37. package/esm2022/fields/lookups/services/e-031-moe/e-031-moe-dto.mjs +2 -0
  38. package/esm2022/fields/lookups/services/e-070-emp/agro-lookup-e070-emp.service.mjs +41 -0
  39. package/esm2022/fields/lookups/services/e-070-emp/e-070-emp-dto.mjs +2 -0
  40. package/esm2022/fields/lookups/services/e-070-fil/agro-lookup-e070-fil.service.mjs +41 -0
  41. package/esm2022/fields/lookups/services/e-070-fil/e-070-fil-dto.mjs +2 -0
  42. package/esm2022/fields/lookups/services/e-075-der/agro-lookup-e075-der.service.mjs +41 -0
  43. package/esm2022/fields/lookups/services/e-075-der/e-075-der-dto.mjs +2 -0
  44. package/esm2022/fields/lookups/services/e-095-pes/agro-lookup-e095-pes.service.mjs +41 -0
  45. package/esm2022/fields/lookups/services/e-095-pes/e-095-pes-dto.mjs +2 -0
  46. package/esm2022/fields/lookups/services/e-113-saf/agro-lookup-e113-saf.service.mjs +41 -0
  47. package/esm2022/fields/lookups/services/e-113-saf/e-113-saf-dto.mjs +2 -0
  48. package/esm2022/fields/lookups/services/e-205-dep/agro-lookup-e205-dep.service.mjs +41 -0
  49. package/esm2022/fields/lookups/services/e-205-dep/e-205-dep-dto.mjs +2 -0
  50. package/esm2022/fields/lookups/services/e-210-dxp/agro-lookup-e210-dxp.service.mjs +41 -0
  51. package/esm2022/fields/lookups/services/e-210-dxp/e-210-dxp-dto.mjs +2 -0
  52. package/esm2022/fields/lookups/services/family-group/agro-lookup-family-group.service.mjs +41 -0
  53. package/esm2022/fields/lookups/services/family-group/family-group-dto.mjs +2 -0
  54. package/esm2022/fields/lookups/services/increase-product/agro-lookup-increase-product.service.mjs +41 -0
  55. package/esm2022/fields/lookups/services/increase-product/increase-product-dto.mjs +2 -0
  56. package/esm2022/fields/lookups/services/index.mjs +18 -0
  57. package/esm2022/fields/lookups/services/product-variety/agro-lookup-product-variety.service.mjs +41 -0
  58. package/esm2022/fields/lookups/services/product-variety/product-variety-dto.mjs +2 -0
  59. package/esm2022/fields/lookups/services/rural-estate/agro-lookup-rural-estate.service.mjs +41 -0
  60. package/esm2022/fields/lookups/services/rural-estate/rural-estate-dto.mjs +2 -0
  61. package/esm2022/fields/lookups/services/ticket/agro-lookup-ticket.service.mjs +34 -0
  62. package/esm2022/fields/lookups/services/ticket/ticket-dto.mjs +2 -0
  63. package/esm2022/fields/lookups/utils/agro-lookup-utils.mjs +303 -0
  64. package/esm2022/fields/lookups/utils/cpf-cnpj-formatter.mjs +23 -0
  65. package/esm2022/fields/lookups/utils/index.mjs +3 -0
  66. package/esm2022/lib-config.token.mjs +3 -0
  67. package/esm2022/public-api.mjs +3 -1
  68. package/esm2022/services/i18n/en-US.mjs +58 -1
  69. package/esm2022/services/i18n/es-CO.mjs +58 -1
  70. package/esm2022/services/i18n/pt-BR.mjs +58 -1
  71. package/fesm2022/senior-agronegocio-angular-components.mjs +2007 -4
  72. package/fesm2022/senior-agronegocio-angular-components.mjs.map +1 -1
  73. package/fields/lookups/config/lookup-host-project-config.d.ts +2 -0
  74. package/fields/lookups/core/agro-base-lookup-field.d.ts +30 -0
  75. package/fields/lookups/core/agro-branch-lookup.d.ts +7 -0
  76. package/fields/lookups/core/agro-company-lookup.d.ts +7 -0
  77. package/fields/lookups/core/agro-currency-lookup.d.ts +7 -0
  78. package/fields/lookups/core/agro-deposit-balance-lookup.d.ts +7 -0
  79. package/fields/lookups/core/agro-deposit-lookup.d.ts +7 -0
  80. package/fields/lookups/core/agro-driver-lookup.d.ts +7 -0
  81. package/fields/lookups/core/agro-e095-pes-lookup.d.ts +7 -0
  82. package/fields/lookups/core/agro-family-group-lookup.d.ts +7 -0
  83. package/fields/lookups/core/agro-family-lookup.d.ts +7 -0
  84. package/fields/lookups/core/agro-harvest-lookup.d.ts +7 -0
  85. package/fields/lookups/core/agro-increase-product-lookup.d.ts +7 -0
  86. package/fields/lookups/core/agro-lookup-base.d.ts +24 -0
  87. package/fields/lookups/core/agro-producer-lookup.d.ts +7 -0
  88. package/fields/lookups/core/agro-product-lookup.d.ts +7 -0
  89. package/fields/lookups/core/agro-product-variety-lookup.d.ts +7 -0
  90. package/fields/lookups/core/agro-romaneo-lookup.d.ts +7 -0
  91. package/fields/lookups/core/agro-rural-estate-lookup.d.ts +7 -0
  92. package/fields/lookups/core/agro-ticket-lookup.d.ts +7 -0
  93. package/fields/lookups/core/index.d.ts +22 -0
  94. package/fields/lookups/core/lookup-field.handlers.d.ts +12 -0
  95. package/fields/lookups/core/lookup-field.types.d.ts +39 -0
  96. package/fields/lookups/index.d.ts +4 -0
  97. package/fields/lookups/services/agro-lookup-entity.service.d.ts +40 -0
  98. package/fields/lookups/services/driver/agro-lookup-driver.service.d.ts +15 -0
  99. package/fields/lookups/services/driver/driver-dto.d.ts +10 -0
  100. package/fields/lookups/services/e-001-pes/agro-lookup-e001-pes.service.d.ts +16 -0
  101. package/fields/lookups/services/e-001-pes/e-001-pes-dto.d.ts +14 -0
  102. package/fields/lookups/services/e-012-fam/agro-lookup-e012-fam.service.d.ts +15 -0
  103. package/fields/lookups/services/e-012-fam/e-012-fam-dto.d.ts +11 -0
  104. package/fields/lookups/services/e-031-moe/agro-lookup-e031-moe.service.d.ts +16 -0
  105. package/fields/lookups/services/e-031-moe/e-031-moe-dto.d.ts +22 -0
  106. package/fields/lookups/services/e-070-emp/agro-lookup-e070-emp.service.d.ts +16 -0
  107. package/fields/lookups/services/e-070-emp/e-070-emp-dto.d.ts +12 -0
  108. package/fields/lookups/services/e-070-fil/agro-lookup-e070-fil.service.d.ts +16 -0
  109. package/fields/lookups/services/e-070-fil/e-070-fil-dto.d.ts +16 -0
  110. package/fields/lookups/services/e-075-der/agro-lookup-e075-der.service.d.ts +16 -0
  111. package/fields/lookups/services/e-075-der/e-075-der-dto.d.ts +14 -0
  112. package/fields/lookups/services/e-095-pes/agro-lookup-e095-pes.service.d.ts +16 -0
  113. package/fields/lookups/services/e-095-pes/e-095-pes-dto.d.ts +10 -0
  114. package/fields/lookups/services/e-113-saf/agro-lookup-e113-saf.service.d.ts +16 -0
  115. package/fields/lookups/services/e-113-saf/e-113-saf-dto.d.ts +15 -0
  116. package/fields/lookups/services/e-205-dep/agro-lookup-e205-dep.service.d.ts +16 -0
  117. package/fields/lookups/services/e-205-dep/e-205-dep-dto.d.ts +14 -0
  118. package/fields/lookups/services/e-210-dxp/agro-lookup-e210-dxp.service.d.ts +16 -0
  119. package/fields/lookups/services/e-210-dxp/e-210-dxp-dto.d.ts +13 -0
  120. package/fields/lookups/services/family-group/agro-lookup-family-group.service.d.ts +16 -0
  121. package/fields/lookups/services/family-group/family-group-dto.d.ts +14 -0
  122. package/fields/lookups/services/increase-product/agro-lookup-increase-product.service.d.ts +16 -0
  123. package/fields/lookups/services/increase-product/increase-product-dto.d.ts +16 -0
  124. package/fields/lookups/services/index.d.ts +34 -0
  125. package/fields/lookups/services/product-variety/agro-lookup-product-variety.service.d.ts +16 -0
  126. package/fields/lookups/services/product-variety/product-variety-dto.d.ts +14 -0
  127. package/fields/lookups/services/rural-estate/agro-lookup-rural-estate.service.d.ts +16 -0
  128. package/fields/lookups/services/rural-estate/rural-estate-dto.d.ts +28 -0
  129. package/fields/lookups/services/ticket/agro-lookup-ticket.service.d.ts +15 -0
  130. package/fields/lookups/services/ticket/ticket-dto.d.ts +15 -0
  131. package/fields/lookups/utils/agro-lookup-utils.d.ts +37 -0
  132. package/fields/lookups/utils/cpf-cnpj-formatter.d.ts +12 -0
  133. package/fields/lookups/utils/index.d.ts +2 -0
  134. package/lib-config.token.d.ts +6 -0
  135. package/package.json +5 -1
  136. package/public-api.d.ts +2 -0
  137. package/services/i18n/en-US.d.ts +57 -0
  138. package/services/i18n/es-CO.d.ts +57 -0
  139. package/services/i18n/pt-BR.d.ts +57 -0
@@ -2,7 +2,7 @@ import moment from 'moment';
2
2
  import * as i6 from '@angular/common';
3
3
  import { CommonModule, registerLocaleData, DecimalPipe, DatePipe, CurrencyPipe } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { NgModule, EventEmitter, Component, Input, Output, Injectable, Pipe, LOCALE_ID, Directive, ViewChild, inject, ChangeDetectorRef, ChangeDetectionStrategy, InjectionToken } from '@angular/core';
5
+ import { NgModule, EventEmitter, Component, Input, Output, Injectable, Pipe, LOCALE_ID, Directive, ViewChild, inject, ChangeDetectorRef, ChangeDetectionStrategy, InjectionToken, Optional, Inject } from '@angular/core';
6
6
  import * as i11 from '@angular/forms';
7
7
  import { FormsModule, ReactiveFormsModule, Validators, FormControl, FormGroup, FormArray } from '@angular/forms';
8
8
  import * as i18 from '@seniorsistemas/angular-components/badge';
@@ -50,7 +50,7 @@ import { trigger, state, style, transition, animate } from '@angular/animations'
50
50
  import localePt from '@angular/common/locales/pt';
51
51
  import { StepState as StepState$1 } from '@seniorsistemas/angular-components/stepper';
52
52
  import { of, Subject, BehaviorSubject, throwError, scheduled, asyncScheduler, timer, EMPTY, filter as filter$1, firstValueFrom } from 'rxjs';
53
- import { filter, take, finalize, switchMap, map, catchError, takeUntil, concatMap, tap, scan, defaultIfEmpty, debounceTime } from 'rxjs/operators';
53
+ import { filter, take, finalize, switchMap, map, catchError, takeUntil, concatMap, tap, scan, defaultIfEmpty, debounceTime, distinctUntilChanged, startWith, pairwise } from 'rxjs/operators';
54
54
  import * as i2$1 from 'primeng/dynamicdialog';
55
55
  import { Client, FrameImpl } from '@stomp/stompjs';
56
56
  import SockJS from 'sockjs-client';
@@ -3775,6 +3775,63 @@ const ptBR = {
3775
3775
  "agro.angular_components.link_invoice": "Vincular nota fiscal",
3776
3776
  "agro.grain_classification.label_number": "Ticket",
3777
3777
  "agro.grain_classification.origination_create_stock_movement": "Movimentação de estoque",
3778
+ "agro.angular_components.lookup_nothing_found": "Nenhum registro encontrado",
3779
+ "agro.angular_components.lookup_filter": "Filtrar",
3780
+ "agro.angular_components.lookup_filters": "Filtros",
3781
+ "agro.angular_components.lookup_clear": "Limpar",
3782
+ "agro.angular_components.lookup_cancel": "Cancelar",
3783
+ "agro.angular_components.lookup_select": "Selecione",
3784
+ "agro.angular_components.lookup_list_grid_boolean_true": "Sim",
3785
+ "agro.angular_components.lookup_list_grid_boolean_false": "Não",
3786
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_title": "Erro de exclusão",
3787
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_description": "Não é possível excluir este registro pois existem vínculos relacionados.",
3788
+ "agro.angular_components.lookup_label_code": "Código",
3789
+ "agro.angular_components.lookup_label_code_company": "Código da empresa",
3790
+ "agro.angular_components.lookup_label_name": "Nome",
3791
+ "agro.angular_components.lookup_label_description": "Descrição",
3792
+ "agro.angular_components.lookup_label_branch": "Filial",
3793
+ "agro.angular_components.lookup_label_city": "Cidade",
3794
+ "agro.angular_components.lookup_cnpj_cpf": "CNPJ/CPF",
3795
+ "agro.angular_components.lookup_e_070_emp_sig_emp": "Nome fantasia / Sigla da empresa",
3796
+ "agro.angular_components.lookup_e_070_fil_num_cgc": "CNPJ",
3797
+ "agro.angular_components.lookup_e_031_moe_cod_moe": "Código da moeda",
3798
+ "agro.angular_components.lookup_e_031_moe_des_moe": "Descrição da moeda",
3799
+ "agro.angular_components.lookup_rural_estate_sequential": "Sequencial",
3800
+ "agro.angular_components.lookup_rural_estate_name": "Nome do imóvel",
3801
+ "agro.angular_components.lookup_contract_company": "Empresa",
3802
+ "agro.angular_components.lookup_contract_company_search_title": "Selecione a empresa",
3803
+ "agro.angular_components.lookup_contract_branch": "Filial",
3804
+ "agro.angular_components.lookup_contract_branch_search_title": "Selecione a filial",
3805
+ "agro.angular_components.lookup_product": "Produto",
3806
+ "agro.angular_components.lookup_contract_product_product_search_title": "Selecione o produto",
3807
+ "agro.angular_components.lookup_producer": "Produtor",
3808
+ "agro.angular_components.lookup_contract_product_producer_producer_search_title": "Selecione o produtor",
3809
+ "agro.angular_components.lookup_contract_product_harvest": "Safra",
3810
+ "agro.angular_components.lookup_contract_product_harvest_search_title": "Selecione a safra",
3811
+ "agro.angular_components.lookup_contract_product_currency": "Moeda",
3812
+ "agro.angular_components.lookup_contract_product_currency_search_title": "Selecione a moeda",
3813
+ "agro.angular_components.lookup_contract_product_producer_rural_estate": "Imóvel rural",
3814
+ "agro.angular_components.lookup_contract_product_producer_rural_estate_search_title": "Selecione o imóvel rural",
3815
+ "agro.angular_components.lookup_contract_financial_increase": "Acréscimo",
3816
+ "agro.angular_components.lookup_contract_financial_increase_search_title": "Selecione o acréscimo",
3817
+ "agro.angular_components.lookup_contract_family_group": "Grupo familiar",
3818
+ "agro.angular_components.lookup_contract_family_group_search_title": "Selecione o grupo familiar",
3819
+ "agro.angular_components.lookup_family": "Família",
3820
+ "agro.angular_components.lookup_family_search_title": "Selecione a família",
3821
+ "agro.angular_components.lookup_driver": "Motorista",
3822
+ "agro.angular_components.lookup_driver_search_title": "Selecione o motorista",
3823
+ "agro.angular_components.lookup_deposit": "Depósito",
3824
+ "agro.angular_components.lookup_deposit_search_title": "Selecione o depósito",
3825
+ "agro.angular_components.lookup_e095_pes": "Produtor (E095)",
3826
+ "agro.angular_components.lookup_e095_pes_search_title": "Selecione o produtor (E095)",
3827
+ "agro.angular_components.lookup_ticket": "Ticket",
3828
+ "agro.angular_components.lookup_ticket_search_title": "Selecione o ticket",
3829
+ "agro.angular_components.lookup_romaneo": "Romaneio",
3830
+ "agro.angular_components.lookup_romaneo_search_title": "Selecione o romaneio",
3831
+ "agro.angular_components.lookup_product_variety": "Variedade do produto",
3832
+ "agro.angular_components.lookup_product_variety_search_title": "Selecione a variedade do produto",
3833
+ "agro.angular_components.lookup_license_plate": "Placa",
3834
+ "agro.angular_components.lookup_royalties_percentage": "Percentual de royalties",
3778
3835
  };
3779
3836
 
3780
3837
  const enUS = {
@@ -4096,6 +4153,63 @@ const enUS = {
4096
4153
  "agro.angular_components.invoice_created_successfully": "Invoice created successfully.",
4097
4154
  "agro.angular_components.invoice_already_linked": "Invoice is already fully linked to another item",
4098
4155
  "agro.angular_components.link_invoice": "Link invoice",
4156
+ "agro.angular_components.lookup_nothing_found": "No records found",
4157
+ "agro.angular_components.lookup_filter": "Filter",
4158
+ "agro.angular_components.lookup_filters": "Filters",
4159
+ "agro.angular_components.lookup_clear": "Clear",
4160
+ "agro.angular_components.lookup_cancel": "Cancel",
4161
+ "agro.angular_components.lookup_select": "Select",
4162
+ "agro.angular_components.lookup_list_grid_boolean_true": "Yes",
4163
+ "agro.angular_components.lookup_list_grid_boolean_false": "No",
4164
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_title": "Delete error",
4165
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_description": "This record cannot be deleted because it has related links.",
4166
+ "agro.angular_components.lookup_label_code": "Code",
4167
+ "agro.angular_components.lookup_label_code_company": "Company code",
4168
+ "agro.angular_components.lookup_label_name": "Name",
4169
+ "agro.angular_components.lookup_label_description": "Description",
4170
+ "agro.angular_components.lookup_label_branch": "Branch",
4171
+ "agro.angular_components.lookup_label_city": "City",
4172
+ "agro.angular_components.lookup_cnpj_cpf": "CNPJ/CPF",
4173
+ "agro.angular_components.lookup_e_070_emp_sig_emp": "Trade name / Company abbreviation",
4174
+ "agro.angular_components.lookup_e_070_fil_num_cgc": "CNPJ",
4175
+ "agro.angular_components.lookup_e_031_moe_cod_moe": "Currency code",
4176
+ "agro.angular_components.lookup_e_031_moe_des_moe": "Currency description",
4177
+ "agro.angular_components.lookup_rural_estate_sequential": "Sequential",
4178
+ "agro.angular_components.lookup_rural_estate_name": "Rural estate name",
4179
+ "agro.angular_components.lookup_contract_company": "Company",
4180
+ "agro.angular_components.lookup_contract_company_search_title": "Select company",
4181
+ "agro.angular_components.lookup_contract_branch": "Branch",
4182
+ "agro.angular_components.lookup_contract_branch_search_title": "Select branch",
4183
+ "agro.angular_components.lookup_product": "Product",
4184
+ "agro.angular_components.lookup_contract_product_product_search_title": "Select product",
4185
+ "agro.angular_components.lookup_producer": "Producer",
4186
+ "agro.angular_components.lookup_contract_product_producer_producer_search_title": "Select producer",
4187
+ "agro.angular_components.lookup_contract_product_harvest": "Harvest",
4188
+ "agro.angular_components.lookup_contract_product_harvest_search_title": "Select harvest",
4189
+ "agro.angular_components.lookup_contract_product_currency": "Currency",
4190
+ "agro.angular_components.lookup_contract_product_currency_search_title": "Select currency",
4191
+ "agro.angular_components.lookup_contract_product_producer_rural_estate": "Rural estate",
4192
+ "agro.angular_components.lookup_contract_product_producer_rural_estate_search_title": "Select rural estate",
4193
+ "agro.angular_components.lookup_contract_financial_increase": "Increase",
4194
+ "agro.angular_components.lookup_contract_financial_increase_search_title": "Select increase",
4195
+ "agro.angular_components.lookup_contract_family_group": "Family group",
4196
+ "agro.angular_components.lookup_contract_family_group_search_title": "Select family group",
4197
+ "agro.angular_components.lookup_family": "Family",
4198
+ "agro.angular_components.lookup_family_search_title": "Select family",
4199
+ "agro.angular_components.lookup_driver": "Driver",
4200
+ "agro.angular_components.lookup_driver_search_title": "Select driver",
4201
+ "agro.angular_components.lookup_deposit": "Deposit",
4202
+ "agro.angular_components.lookup_deposit_search_title": "Select deposit",
4203
+ "agro.angular_components.lookup_e095_pes": "Producer (E095)",
4204
+ "agro.angular_components.lookup_e095_pes_search_title": "Select producer (E095)",
4205
+ "agro.angular_components.lookup_ticket": "Ticket",
4206
+ "agro.angular_components.lookup_ticket_search_title": "Select ticket",
4207
+ "agro.angular_components.lookup_romaneo": "Romaneo",
4208
+ "agro.angular_components.lookup_romaneo_search_title": "Select romaneo",
4209
+ "agro.angular_components.lookup_product_variety": "Product variety",
4210
+ "agro.angular_components.lookup_product_variety_search_title": "Select product variety",
4211
+ "agro.angular_components.lookup_license_plate": "License plate",
4212
+ "agro.angular_components.lookup_royalties_percentage": "Royalties percentage",
4099
4213
  };
4100
4214
 
4101
4215
  const esCO = {
@@ -4417,6 +4531,63 @@ const esCO = {
4417
4531
  "agro.angular_components.invoice_created_successfully": "Factura creada con éxito.",
4418
4532
  "agro.angular_components.invoice_already_linked": "La factura ya está totalmente vinculada a otro ítem",
4419
4533
  "agro.angular_components.link_invoice": "Vincular factura",
4534
+ "agro.angular_components.lookup_nothing_found": "Ningún registro encontrado",
4535
+ "agro.angular_components.lookup_filter": "Filtrar",
4536
+ "agro.angular_components.lookup_filters": "Filtros",
4537
+ "agro.angular_components.lookup_clear": "Limpiar",
4538
+ "agro.angular_components.lookup_cancel": "Cancelar",
4539
+ "agro.angular_components.lookup_select": "Seleccionar",
4540
+ "agro.angular_components.lookup_list_grid_boolean_true": "Sí",
4541
+ "agro.angular_components.lookup_list_grid_boolean_false": "No",
4542
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_title": "Error al eliminar",
4543
+ "agro.angular_components.lookup_error_delete_entity_constraint_violation_description": "No se puede eliminar este registro porque tiene vínculos relacionados.",
4544
+ "agro.angular_components.lookup_label_code": "Código",
4545
+ "agro.angular_components.lookup_label_code_company": "Código de la empresa",
4546
+ "agro.angular_components.lookup_label_name": "Nombre",
4547
+ "agro.angular_components.lookup_label_description": "Descripción",
4548
+ "agro.angular_components.lookup_label_branch": "Sucursal",
4549
+ "agro.angular_components.lookup_label_city": "Ciudad",
4550
+ "agro.angular_components.lookup_cnpj_cpf": "CNPJ/CPF",
4551
+ "agro.angular_components.lookup_e_070_emp_sig_emp": "Nombre comercial / Sigla de la empresa",
4552
+ "agro.angular_components.lookup_e_070_fil_num_cgc": "CNPJ",
4553
+ "agro.angular_components.lookup_e_031_moe_cod_moe": "Código de moneda",
4554
+ "agro.angular_components.lookup_e_031_moe_des_moe": "Descripción de moneda",
4555
+ "agro.angular_components.lookup_rural_estate_sequential": "Secuencial",
4556
+ "agro.angular_components.lookup_rural_estate_name": "Nombre del inmueble rural",
4557
+ "agro.angular_components.lookup_contract_company": "Empresa",
4558
+ "agro.angular_components.lookup_contract_company_search_title": "Seleccione la empresa",
4559
+ "agro.angular_components.lookup_contract_branch": "Sucursal",
4560
+ "agro.angular_components.lookup_contract_branch_search_title": "Seleccione la sucursal",
4561
+ "agro.angular_components.lookup_product": "Producto",
4562
+ "agro.angular_components.lookup_contract_product_product_search_title": "Seleccione el producto",
4563
+ "agro.angular_components.lookup_producer": "Productor",
4564
+ "agro.angular_components.lookup_contract_product_producer_producer_search_title": "Seleccione el productor",
4565
+ "agro.angular_components.lookup_contract_product_harvest": "Cosecha",
4566
+ "agro.angular_components.lookup_contract_product_harvest_search_title": "Seleccione la cosecha",
4567
+ "agro.angular_components.lookup_contract_product_currency": "Moneda",
4568
+ "agro.angular_components.lookup_contract_product_currency_search_title": "Seleccione la moneda",
4569
+ "agro.angular_components.lookup_contract_product_producer_rural_estate": "Inmueble rural",
4570
+ "agro.angular_components.lookup_contract_product_producer_rural_estate_search_title": "Seleccione el inmueble rural",
4571
+ "agro.angular_components.lookup_contract_financial_increase": "Incremento",
4572
+ "agro.angular_components.lookup_contract_financial_increase_search_title": "Seleccione el incremento",
4573
+ "agro.angular_components.lookup_contract_family_group": "Grupo familiar",
4574
+ "agro.angular_components.lookup_contract_family_group_search_title": "Seleccione el grupo familiar",
4575
+ "agro.angular_components.lookup_family": "Familia",
4576
+ "agro.angular_components.lookup_family_search_title": "Seleccione la familia",
4577
+ "agro.angular_components.lookup_driver": "Conductor",
4578
+ "agro.angular_components.lookup_driver_search_title": "Seleccione el conductor",
4579
+ "agro.angular_components.lookup_deposit": "Depósito",
4580
+ "agro.angular_components.lookup_deposit_search_title": "Seleccione el depósito",
4581
+ "agro.angular_components.lookup_e095_pes": "Productor (E095)",
4582
+ "agro.angular_components.lookup_e095_pes_search_title": "Seleccione el productor (E095)",
4583
+ "agro.angular_components.lookup_ticket": "Ticket",
4584
+ "agro.angular_components.lookup_ticket_search_title": "Seleccione el ticket",
4585
+ "agro.angular_components.lookup_romaneo": "Romaneo",
4586
+ "agro.angular_components.lookup_romaneo_search_title": "Seleccione el romaneo",
4587
+ "agro.angular_components.lookup_product_variety": "Variedad del producto",
4588
+ "agro.angular_components.lookup_product_variety_search_title": "Seleccione la variedad del producto",
4589
+ "agro.angular_components.lookup_license_plate": "Placa",
4590
+ "agro.angular_components.lookup_royalties_percentage": "Porcentaje de regalías",
4420
4591
  };
4421
4592
 
4422
4593
  class LibTranslationService {
@@ -9509,7 +9680,1839 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
9509
9680
  }]
9510
9681
  }] });
9511
9682
 
9512
- const LIB_CONFIG = new InjectionToken("AgroAngularComponentsConfig");
9683
+ /**
9684
+ * Formats CPF or CNPJ using AgroStringUtils.applyMask().
9685
+ * Automatically detects whether the input is a valid CPF or CNPJ and applies the appropriate mask.
9686
+ *
9687
+ * @param value - The unformatted CPF/CNPJ string (digits only or with formatting)
9688
+ * @returns Formatted string with CPF or CNPJ mask, or original value if validation fails
9689
+ *
9690
+ * @example
9691
+ * formatCPFCNPJWithMask('12345678901') // Returns '123.456.789-01' (CPF)
9692
+ * formatCPFCNPJWithMask('12345678901234') // Returns '12.345.678/0001-34' (CNPJ)
9693
+ */
9694
+ function formatCPFCNPJWithMask(value) {
9695
+ if (AgroStringUtils.validateCNPJ(value)) {
9696
+ return AgroStringUtils.applyMask(value, AgroStringMasks.CNPJ);
9697
+ }
9698
+ if (AgroStringUtils.validateCPF(value)) {
9699
+ return AgroStringUtils.applyMask(value, AgroStringMasks.CPF);
9700
+ }
9701
+ return value;
9702
+ }
9703
+
9704
+ const numberTypes = ['integer', 'double'];
9705
+ const numberPattern = /^\d+\b$/;
9706
+ const YYYY_MM_DD_FORMAT = 'YYYY-MM-DD';
9707
+ const LOOKUP_DOCUMENT_FIELDS = ['cnpCpf', 'numCgc'];
9708
+ const mergeUnique = (array, otherArray) => array.concat(otherArray.filter((item) => !array.includes(item)));
9709
+ const getTypeInformation = (type, value) => {
9710
+ switch (type) {
9711
+ case 'time':
9712
+ case 'date':
9713
+ case 'localDateTime':
9714
+ case 'dateTime':
9715
+ return { isValidValue: false, typeExists: true };
9716
+ case 'integer':
9717
+ case 'double':
9718
+ return {
9719
+ isValidValue: value.match(numberPattern),
9720
+ typeExists: numberTypes.includes(type),
9721
+ };
9722
+ default:
9723
+ return {
9724
+ isValidValue: false,
9725
+ typeExists: false,
9726
+ };
9727
+ }
9728
+ };
9729
+ const getSuggestionValue = (displayFields, ownerEntity, value, separator) => {
9730
+ if (!displayFields || displayFields.length === 0) {
9731
+ return '';
9732
+ }
9733
+ return displayFields
9734
+ .map((field) => {
9735
+ if (LOOKUP_DOCUMENT_FIELDS.includes(field)) {
9736
+ return formatCPFCNPJWithMask(getProp(value, `${ownerEntity}.${field}`));
9737
+ }
9738
+ return getProp(value, `${ownerEntity}.${field}`);
9739
+ })
9740
+ .filter(f => {
9741
+ return AgroStringUtils.isValid(String(f));
9742
+ })
9743
+ .join(separator);
9744
+ };
9745
+ const buildEnumClause = (name, selected) => `${name} eq '${selected}'`;
9746
+ const getEnumQuery = (name, value, multiple = false) => {
9747
+ if (multiple) {
9748
+ return `(${value.map((selected) => buildEnumClause(name, selected)).join(' or ')})`;
9749
+ }
9750
+ return `${name} eq '${value}'`;
9751
+ };
9752
+ const createFilterString = (any, value) => {
9753
+ const { name, type, multiple } = any;
9754
+ if (typeof value == 'number') {
9755
+ return `${name} eq ${value}`;
9756
+ }
9757
+ switch (type) {
9758
+ case 'date':
9759
+ return `${name} eq '${moment(value).format(YYYY_MM_DD_FORMAT)}'`;
9760
+ case 'time':
9761
+ return `${name} eq '${moment(value).format('HH:mm:ss')}'`;
9762
+ case 'dateTime':
9763
+ return `${name} eq '${moment(value).format()}'`;
9764
+ case 'localDateTime':
9765
+ return `${name} eq '${moment(value).format('YYYY-MM-DD[T]HH:mm:ss.SSS')}'`;
9766
+ case 'enum':
9767
+ return getEnumQuery(name, value, multiple);
9768
+ case 'string':
9769
+ return `upper(${name}) like upper('%${value.replace(/'/g, "'")}%')`;
9770
+ case 'lookup':
9771
+ return `${name} eq '${value.id}'`;
9772
+ default:
9773
+ return `${name} eq '${value}'`;
9774
+ }
9775
+ };
9776
+ const createFilterTokens = (any, value, translate) => {
9777
+ const { name, type, label, searchFields, options } = any;
9778
+ let labelValue = value;
9779
+ switch (type) {
9780
+ case 'date':
9781
+ labelValue = moment(value).format('L');
9782
+ break;
9783
+ case 'time':
9784
+ labelValue = moment(value).format('LTS');
9785
+ break;
9786
+ case 'localDateTime':
9787
+ case 'dateTime':
9788
+ labelValue = moment(value).format('L LTS');
9789
+ break;
9790
+ case 'lookup':
9791
+ labelValue = searchFields.map((field) => getProp(value, field.name)).join(' - ');
9792
+ break;
9793
+ case 'enum':
9794
+ labelValue = options.filter((option) => option.value === labelValue)[0].label;
9795
+ break;
9796
+ case 'boolean':
9797
+ if (value) {
9798
+ labelValue = translate.instant('agro.angular_components.lookup_list_grid_boolean_true');
9799
+ }
9800
+ else {
9801
+ labelValue = translate.instant('agro.angular_components.lookup_list_grid_boolean_false');
9802
+ }
9803
+ break;
9804
+ default:
9805
+ break;
9806
+ }
9807
+ return { id: name, label: `${label}: ${labelValue}` };
9808
+ };
9809
+ const resolveRefs = (payload) => {
9810
+ const getDataFromRef = (ref, rootObj) => {
9811
+ const regex = /\["(.*?)"\]/g;
9812
+ const result = [];
9813
+ let match;
9814
+ while ((match = regex.exec(ref)) !== null) {
9815
+ result.push(match[1]);
9816
+ }
9817
+ return result.reduce((acc, part) => acc?.[part], rootObj);
9818
+ };
9819
+ const resolve = (obj, rootObj, visited = new Set()) => {
9820
+ if (obj === null || typeof obj !== 'object' || visited.has(obj)) {
9821
+ return;
9822
+ }
9823
+ visited.add(obj);
9824
+ if (Array.isArray(obj)) {
9825
+ obj.forEach((item) => resolve(item, rootObj, visited));
9826
+ }
9827
+ else {
9828
+ Object.keys(obj).forEach((key) => {
9829
+ if (key === '$ref' && obj[key]) {
9830
+ const refPath = obj[key];
9831
+ Object.assign(obj, getDataFromRef(refPath, rootObj));
9832
+ delete obj[key];
9833
+ }
9834
+ else {
9835
+ resolve(obj[key], rootObj, visited);
9836
+ }
9837
+ });
9838
+ }
9839
+ };
9840
+ resolve(payload, payload);
9841
+ return payload;
9842
+ };
9843
+ const applyRelationTransforms = (entity, originEntity, relations) => {
9844
+ relations.forEach(({ origin, key, transform }) => {
9845
+ if (originEntity !== origin && entity[key]) {
9846
+ entity[key] = transform(entity[key]);
9847
+ }
9848
+ });
9849
+ return entity;
9850
+ };
9851
+ const datePatternYYYYMMDD = /^\d{4}-\d{2}-\d{2}$/;
9852
+ const isValidFilter = (type, value) => {
9853
+ const { isValidValue, typeExists } = getTypeInformation(type, value);
9854
+ return !(typeExists && !isValidValue);
9855
+ };
9856
+ const getProp = (obj, path, APPLY_CPFCNPJ_FILTER = false) => {
9857
+ let r = path.split(".").reduce((result, prop) => (result[prop] === undefined ? "" : result[prop]), obj);
9858
+ const normalizedPath = typeof path === 'string' ? path : '';
9859
+ const fieldName = normalizedPath.split('.').pop() ?? normalizedPath;
9860
+ if (datePatternYYYYMMDD.test(r)) {
9861
+ r = moment(r, YYYY_MM_DD_FORMAT).format("DD/MM/YYYY");
9862
+ }
9863
+ if ((APPLY_CPFCNPJ_FILTER || LOOKUP_DOCUMENT_FIELDS.includes(fieldName)) && AgroStringUtils.isValid(r)) {
9864
+ return formatCPFCNPJWithMask(r);
9865
+ }
9866
+ return r;
9867
+ };
9868
+ const getLabelValueRequest = (contents, displayFields, APPLY_CPFCNPJ_FILTER = false) => {
9869
+ const r = contents.map((item) => {
9870
+ const numberPatternToTest = /^\d+(\.\d{1,2})?$/;
9871
+ const formattedItem = { ...item };
9872
+ // Format currency fields (vlrCot)
9873
+ ["vlrCot"].forEach((field) => {
9874
+ if (formattedItem[field] && numberPatternToTest.test(formattedItem[field])) {
9875
+ formattedItem[field] = parseFloat(formattedItem[field]).toLocaleString("pt-BR", {
9876
+ minimumFractionDigits: 2,
9877
+ maximumFractionDigits: 2
9878
+ });
9879
+ }
9880
+ });
9881
+ LOOKUP_DOCUMENT_FIELDS.forEach((fieldName) => {
9882
+ if (formattedItem[fieldName] !== null && formattedItem[fieldName] !== undefined && formattedItem[fieldName] !== '') {
9883
+ formattedItem[fieldName] = formatCPFCNPJWithMask(String(formattedItem[fieldName]));
9884
+ }
9885
+ });
9886
+ return {
9887
+ ...formattedItem,
9888
+ label: displayFields.map(field => getProp(formattedItem, field, APPLY_CPFCNPJ_FILTER)).join(" - ")
9889
+ };
9890
+ });
9891
+ return r;
9892
+ };
9893
+ function formatFilters(filters, value, statusFilter, columnName) {
9894
+ return filters
9895
+ .filter(({ type }) => isValidFilter(type, value))
9896
+ .filter(({ name }) => name !== "status")
9897
+ .map(({ name, type }) => {
9898
+ return convertValueByType(name, value, type);
9899
+ })
9900
+ .join(" or ")
9901
+ .concat(`and ${columnName} eq 'VA' `);
9902
+ }
9903
+ function formatFiltersAdvanced(filters, filterData, statusFilter, columnName, e070empId) {
9904
+ return filters
9905
+ .filter(({ name }) => filterData[name] !== undefined && filterData[name] !== "")
9906
+ .map(({ name, type }) => {
9907
+ const value = filterData[name];
9908
+ return convertValueByType(name, value, type);
9909
+ })
9910
+ .concat(statusFilter ? [`${columnName} eq 'VA' and e070emp eq '${e070empId}'`] : [])
9911
+ .join(" and ");
9912
+ }
9913
+ function convertValueByType(name, value, type) {
9914
+ if (value == null) {
9915
+ value = "";
9916
+ }
9917
+ if (typeof value == "number") {
9918
+ return `${name} eq ${value}`;
9919
+ }
9920
+ else if (type === 'date') {
9921
+ return `${name} eq '${moment(value).format(YYYY_MM_DD_FORMAT)}'`;
9922
+ }
9923
+ else if (type === 'time') {
9924
+ return `${name} eq '${moment(value).format("HH:mm:ss")}'`;
9925
+ }
9926
+ else if (type === 'dateTime') {
9927
+ return `${name} eq '${moment(value).format()}'`;
9928
+ }
9929
+ else if (type === 'string') {
9930
+ return `containing(upper(${name}), upper('${String(value).replace(/'/g, "\\'")}'))`;
9931
+ }
9932
+ else {
9933
+ return `${name} eq '${value}'`;
9934
+ }
9935
+ }
9936
+ function formatFiltersWithoutStatus(filters, value) {
9937
+ return filters
9938
+ .filter(({ type }) => isValidFilter(type, value))
9939
+ .filter(({ name }) => name !== "status")
9940
+ .map(({ name, type }) => {
9941
+ if (typeof value == "number") {
9942
+ return `${name} eq ${value}`;
9943
+ }
9944
+ else if (type === 'date') {
9945
+ return `${name} eq '${moment(value).format(YYYY_MM_DD_FORMAT)}'`;
9946
+ }
9947
+ else if (type === 'time') {
9948
+ return `${name} eq '${moment(value).format("HH:mm:ss")}'`;
9949
+ }
9950
+ else if (type === 'dateTime') {
9951
+ return `${name} eq '${moment(value).format()}'`;
9952
+ }
9953
+ else if (type === 'string') {
9954
+ return `containing(upper(${name}), upper('${value.replace(/'/g, "\\'")}'))`;
9955
+ }
9956
+ else {
9957
+ return `${name} eq '${value}'`;
9958
+ }
9959
+ })
9960
+ .join(" and ");
9961
+ }
9962
+ function roundToThree(num) {
9963
+ return Math.round(num * 1000) / 1000;
9964
+ }
9965
+ function calculateAdjustedPercentagesAndWeights(total, maxPercentage, maxWeight) {
9966
+ const calculatedPercentages = calculateAdjustedPercentages(total, maxPercentage);
9967
+ const calculatedWeights = calculateAdjustedWeights(calculatedPercentages, maxWeight);
9968
+ return { calculatedPercentages, calculatedWeights };
9969
+ }
9970
+ function calculateAdjustedPercentages(total, maxPercentage) {
9971
+ const basePercentage = roundToThree(maxPercentage / total);
9972
+ const calculatedPercentages = Array(total).fill(basePercentage);
9973
+ return adjustValuesIfNecessary(calculatedPercentages, maxPercentage);
9974
+ }
9975
+ function calculateAdjustedWeights(calculatedPercentages, maxWeight) {
9976
+ const totalPercentage = calculatedPercentages.reduce((sum, percentage) => sum + percentage, 0);
9977
+ const calculatedWeights = calculatedPercentages.map(percentage => roundToThree((percentage / 100) * maxWeight));
9978
+ if (roundToThree(totalPercentage) === 100) {
9979
+ return adjustValuesIfNecessary(calculatedWeights, maxWeight);
9980
+ }
9981
+ return calculatedWeights;
9982
+ }
9983
+ function adjustValuesIfNecessary(values, total) {
9984
+ const adjustedValues = values.slice();
9985
+ const currentTotal = adjustedValues.reduce((sum, value) => sum + value, 0);
9986
+ const difference = roundToThree(total - currentTotal);
9987
+ if (difference !== 0) {
9988
+ adjustedValues[0] += difference;
9989
+ }
9990
+ return adjustedValues;
9991
+ }
9992
+ function formatBrlCurrency(currencyPipe, value) {
9993
+ if (!currencyPipe || !value) {
9994
+ return null;
9995
+ }
9996
+ return currencyPipe
9997
+ .transform(value, "BRL", "symbol", `1.2-2`)
9998
+ ?.replace(".", "#")
9999
+ .replace(",", ".")
10000
+ .replace("#", ",")
10001
+ .replace(/^(.{2})/, "$1 ");
10002
+ }
10003
+
10004
+ const DEBOUNCE_MS = 300;
10005
+ const buildDependencyQuery = (formGroup, dependencies = []) => {
10006
+ const clauses = dependencies
10007
+ .map(({ formControlName, apiField }) => {
10008
+ const dependencyId = formGroup.get(formControlName)?.value?.id;
10009
+ return dependencyId ? `${apiField} eq '${dependencyId}'` : '';
10010
+ })
10011
+ .filter(Boolean);
10012
+ return clauses.join(' and ');
10013
+ };
10014
+ const combineQueries = (baseQuery, dependencyQuery) => {
10015
+ if (dependencyQuery && baseQuery) {
10016
+ return `${dependencyQuery} and (${baseQuery})`;
10017
+ }
10018
+ return dependencyQuery || baseQuery;
10019
+ };
10020
+ const getCustomFilterQuery = (config) => {
10021
+ const query = config.customFilterQuery?.();
10022
+ return typeof query === 'string' ? query.trim() : '';
10023
+ };
10024
+ const combineAllQueries = (baseQuery, dependencyQuery, customQuery) => {
10025
+ const firstMerge = combineQueries(baseQuery, dependencyQuery);
10026
+ return combineQueries(firstMerge, customQuery);
10027
+ };
10028
+ const createGenericOnLookupRequest = (ctx) => (value) => {
10029
+ const { config, suggestionsSubject } = ctx;
10030
+ const sort = config.lookupDisplayFields.map((field) => ({ field, order: 1 }));
10031
+ const baseQuery = config.searchFields
10032
+ .filter(({ type }) => type !== undefined && isValidFilter(type, value))
10033
+ .map((field) => createFilterString(field, value))
10034
+ .join(' or ');
10035
+ const dependencyQuery = buildDependencyQuery(ctx.config.formGroup, ctx.config.dependencies);
10036
+ const customQuery = getCustomFilterQuery(config);
10037
+ const filterQuery = combineAllQueries(baseQuery, dependencyQuery, customQuery);
10038
+ const displayFields = mergeUnique(config.lookupDisplayFields, config.advancedDisplayFields);
10039
+ config.service
10040
+ .list({ sort, filterQuery, displayFields })
10041
+ .pipe(debounceTime(DEBOUNCE_MS), distinctUntilChanged((prev, curr) => JSON.stringify(prev) === JSON.stringify(curr)))
10042
+ .subscribe((list) => suggestionsSubject.next(getLabelValueRequest(list.contents, config.lookupDisplayFields, config.applyCPFCNPJFormat ?? false)));
10043
+ };
10044
+ const createGenericOnSearchRequest = (ctx) => (event) => {
10045
+ const { config, searchSubject } = ctx;
10046
+ const { first, rows, multiSortMeta, filterData } = event;
10047
+ const page = first / rows;
10048
+ const sort = multiSortMeta;
10049
+ const baseQuery = config.searchFields
10050
+ .filter(({ name }) => filterData[name] !== undefined && filterData[name] !== null && filterData[name] !== '')
10051
+ .map((field) => createFilterString(field, filterData[field.name]))
10052
+ .join(' and ');
10053
+ const dependencyQuery = buildDependencyQuery(config.formGroup, config.dependencies);
10054
+ const customQuery = getCustomFilterQuery(config);
10055
+ const filterQuery = combineAllQueries(baseQuery, dependencyQuery, customQuery);
10056
+ const displayFields = mergeUnique(config.lookupDisplayFields, config.advancedDisplayFields);
10057
+ config.service
10058
+ .list({ page, sort, filterQuery, displayFields })
10059
+ .subscribe((list) => searchSubject.next({
10060
+ gridData: getLabelValueRequest(list.contents, config.lookupDisplayFields, config.applyCPFCNPJFormat ?? false),
10061
+ totalRecords: list.totalElements,
10062
+ }));
10063
+ };
10064
+ const isLookupValueValid = (value, dataKey) => {
10065
+ if (value === null || value === undefined || value === '') {
10066
+ return true;
10067
+ }
10068
+ if (Array.isArray(value)) {
10069
+ return value.every((item) => item && typeof item === 'object' && item[dataKey] !== undefined && item[dataKey] !== null);
10070
+ }
10071
+ return typeof value === 'object' && value[dataKey] !== undefined && value[dataKey] !== null;
10072
+ };
10073
+ const createGenericOnBlur = (formGroup, fieldName, dataKey = 'id') => () => {
10074
+ const control = formGroup.get(fieldName);
10075
+ if (!control) {
10076
+ return;
10077
+ }
10078
+ if (!isLookupValueValid(control.value, dataKey)) {
10079
+ control.patchValue(null, { emitEvent: true });
10080
+ control.updateValueAndValidity({ emitEvent: true });
10081
+ }
10082
+ };
10083
+
10084
+ const LOOKUP_DEBOUNCE_MS = 300;
10085
+ const LOOKUP_DOCUMENT_FIELDS_TO_FORMAT = ['cnpCpf', 'numCgc'];
10086
+ class AgroBaseLookupField {
10087
+ config;
10088
+ translate;
10089
+ suggestionsSubject = new Subject();
10090
+ searchSubject = new Subject();
10091
+ hasDependencyListenerStarted = false;
10092
+ constructor(config, translate) {
10093
+ this.config = config;
10094
+ this.translate = translate;
10095
+ }
10096
+ isLookupValueValid(value) {
10097
+ if (value === null || value === undefined || value === '') {
10098
+ return false;
10099
+ }
10100
+ if (Array.isArray(value)) {
10101
+ return value.length > 0 && value.every((item) => item && typeof item === 'object' && item.id !== undefined && item.id !== null);
10102
+ }
10103
+ return typeof value === 'object' && value.id !== undefined && value.id !== null;
10104
+ }
10105
+ formatEntityDocumentFields(entity) {
10106
+ if (!entity || typeof entity !== 'object' || Array.isArray(entity)) {
10107
+ return entity;
10108
+ }
10109
+ let formattedEntity = entity;
10110
+ LOOKUP_DOCUMENT_FIELDS_TO_FORMAT.forEach((fieldName) => {
10111
+ if (!Object.hasOwn(entity, fieldName)) {
10112
+ return;
10113
+ }
10114
+ const originalValue = entity[fieldName];
10115
+ if (originalValue === null || originalValue === undefined || originalValue === '') {
10116
+ return;
10117
+ }
10118
+ const formattedValue = formatCPFCNPJWithMask(originalValue);
10119
+ if (formattedValue !== originalValue) {
10120
+ if (formattedEntity === entity) {
10121
+ formattedEntity = { ...entity };
10122
+ }
10123
+ formattedEntity[fieldName] = formattedValue;
10124
+ }
10125
+ });
10126
+ return formattedEntity;
10127
+ }
10128
+ normalizeLookupValue(value) {
10129
+ if (Array.isArray(value)) {
10130
+ let hasChanges = false;
10131
+ const normalizedArray = value.map((item) => {
10132
+ const normalizedItem = this.normalizeLookupValue(item);
10133
+ hasChanges = hasChanges || normalizedItem !== item;
10134
+ return normalizedItem;
10135
+ });
10136
+ return hasChanges ? normalizedArray : value;
10137
+ }
10138
+ return this.formatEntityDocumentFields(value);
10139
+ }
10140
+ syncControlValueWithNormalization(control) {
10141
+ if (!control) {
10142
+ return null;
10143
+ }
10144
+ const normalizedValue = this.normalizeLookupValue(control.value);
10145
+ if (normalizedValue !== control.value) {
10146
+ control.setValue(normalizedValue, { emitEvent: false });
10147
+ }
10148
+ return normalizedValue;
10149
+ }
10150
+ hasUserInteraction(control) {
10151
+ if (!control) {
10152
+ return false;
10153
+ }
10154
+ return control.dirty || control.touched;
10155
+ }
10156
+ markControlAsUserInteracted(control) {
10157
+ if (!control) {
10158
+ return;
10159
+ }
10160
+ if (!control.dirty) {
10161
+ control.markAsDirty({ onlySelf: true });
10162
+ }
10163
+ if (!control.touched) {
10164
+ control.markAsTouched({ onlySelf: true });
10165
+ }
10166
+ }
10167
+ isControlFilled(value) {
10168
+ if (value === null || value === undefined) {
10169
+ return false;
10170
+ }
10171
+ if (typeof value === 'string') {
10172
+ return value.trim() !== '';
10173
+ }
10174
+ if (Array.isArray(value)) {
10175
+ return value.length > 0;
10176
+ }
10177
+ return true;
10178
+ }
10179
+ areDependenciesReady() {
10180
+ const dependsOf = this.config.dependsOf ?? [];
10181
+ if (dependsOf.length === 0) {
10182
+ return true;
10183
+ }
10184
+ return dependsOf.every((fieldName) => {
10185
+ const control = this.config.formGroup.get(fieldName);
10186
+ return this.isLookupValueValid(this.syncControlValueWithNormalization(control));
10187
+ });
10188
+ }
10189
+ isAutofillEnabled() {
10190
+ return this.config.autofill !== false;
10191
+ }
10192
+ buildDependencyQuery() {
10193
+ const dependencies = this.config.dependencies ?? [];
10194
+ return dependencies
10195
+ .map(({ formControlName, apiField }) => {
10196
+ const dependencyId = this.config.formGroup.get(formControlName)?.value?.id;
10197
+ return dependencyId ? `${apiField} eq '${dependencyId}'` : '';
10198
+ })
10199
+ .filter(Boolean)
10200
+ .join(' and ');
10201
+ }
10202
+ buildCustomFilterQuery() {
10203
+ const query = this.config.customFilterQuery?.();
10204
+ return typeof query === 'string' ? query.trim() : '';
10205
+ }
10206
+ combineFilterQueries(...queries) {
10207
+ return queries.filter((query) => !!query).join(' and ');
10208
+ }
10209
+ tryAutofillWhenSingleResult() {
10210
+ if (!this.isAutofillEnabled()) {
10211
+ return;
10212
+ }
10213
+ const dependsOf = this.config.dependsOf ?? [];
10214
+ if (dependsOf.length === 0) {
10215
+ return;
10216
+ }
10217
+ const targetControl = this.config.formGroup.get(this.config.name);
10218
+ if (!targetControl || targetControl.disabled || this.isLookupValueValid(targetControl.value)) {
10219
+ return;
10220
+ }
10221
+ const dependencyQuery = this.buildDependencyQuery();
10222
+ const customQuery = this.buildCustomFilterQuery();
10223
+ const filterQuery = this.combineFilterQueries(dependencyQuery, customQuery);
10224
+ if (!filterQuery) {
10225
+ return;
10226
+ }
10227
+ const sort = this.config.lookupDisplayFields.map((field) => ({ field, order: 1 }));
10228
+ const displayFields = mergeUnique(this.config.lookupDisplayFields, this.config.advancedDisplayFields);
10229
+ this.config.service
10230
+ .list({ page: 0, size: 2, sort, filterQuery, displayFields })
10231
+ .subscribe((list) => {
10232
+ const contents = list?.contents ?? [];
10233
+ if (contents.length !== 1) {
10234
+ return;
10235
+ }
10236
+ const [singleValue] = getLabelValueRequest(contents, this.config.lookupDisplayFields);
10237
+ if (singleValue) {
10238
+ targetControl.setValue(this.normalizeLookupValue(singleValue), { emitEvent: true });
10239
+ }
10240
+ });
10241
+ }
10242
+ isPrefilledAndIndependent(hasAnyUserInteraction, targetIsValid, targetIsFilled) {
10243
+ return !hasAnyUserInteraction && (targetIsValid || targetIsFilled);
10244
+ }
10245
+ handleDependenciesState(forceReset = false) {
10246
+ const targetControl = this.config.formGroup.get(this.config.name);
10247
+ if (!targetControl) {
10248
+ return;
10249
+ }
10250
+ const dependsOf = this.config.dependsOf ?? [];
10251
+ if (dependsOf.length === 0) {
10252
+ return;
10253
+ }
10254
+ const hasAnyUserInteraction = dependsOf.some((fieldName) => this.hasUserInteraction(this.config.formGroup.get(fieldName)));
10255
+ const targetValue = this.syncControlValueWithNormalization(targetControl);
10256
+ const targetIsValid = this.isLookupValueValid(targetValue);
10257
+ const targetIsFilled = this.isControlFilled(targetValue);
10258
+ if (forceReset) {
10259
+ targetControl.setValue(null, { emitEvent: false });
10260
+ targetControl.disable({ emitEvent: false });
10261
+ return;
10262
+ }
10263
+ // Rule: dependent fields start disabled, except when already filled/valid (prefilled scenario).
10264
+ if (this.isPrefilledAndIndependent(hasAnyUserInteraction, targetIsValid, targetIsFilled)) {
10265
+ targetControl.enable({ emitEvent: false });
10266
+ this.tryAutofillWhenSingleResult();
10267
+ return;
10268
+ }
10269
+ if (this.areDependenciesReady()) {
10270
+ targetControl.enable({ emitEvent: false });
10271
+ this.tryAutofillWhenSingleResult();
10272
+ return;
10273
+ }
10274
+ // Keep prefilled values; clear only when there is user interaction or value is invalid for lookup.
10275
+ if (hasAnyUserInteraction || (targetIsFilled && !targetIsValid)) {
10276
+ targetControl.setValue(null, { emitEvent: false });
10277
+ }
10278
+ targetControl.disable({ emitEvent: false });
10279
+ }
10280
+ clearTargetKeepingEnabled() {
10281
+ const targetControl = this.config.formGroup.get(this.config.name);
10282
+ if (!targetControl) {
10283
+ return;
10284
+ }
10285
+ targetControl.setValue(null, { emitEvent: true });
10286
+ if (this.areDependenciesReady()) {
10287
+ targetControl.enable({ emitEvent: false });
10288
+ this.tryAutofillWhenSingleResult();
10289
+ }
10290
+ }
10291
+ getComparableLookupValue(value) {
10292
+ const normalizedValue = this.normalizeLookupValue(value);
10293
+ if (normalizedValue === null || normalizedValue === undefined || normalizedValue === '') {
10294
+ return null;
10295
+ }
10296
+ if (Array.isArray(normalizedValue)) {
10297
+ return normalizedValue.map((item) => this.getComparableLookupValue(item));
10298
+ }
10299
+ if (typeof normalizedValue === 'object') {
10300
+ if (normalizedValue.id !== undefined && normalizedValue.id !== null) {
10301
+ return normalizedValue.id;
10302
+ }
10303
+ return JSON.stringify(normalizedValue);
10304
+ }
10305
+ return normalizedValue;
10306
+ }
10307
+ didDependencyValueChange(previousComparable, currentComparable) {
10308
+ return JSON.stringify(previousComparable) !== JSON.stringify(currentComparable);
10309
+ }
10310
+ startDependenciesListener() {
10311
+ if (this.hasDependencyListenerStarted) {
10312
+ return;
10313
+ }
10314
+ const dependsOf = this.config.dependsOf ?? [];
10315
+ if (dependsOf.length === 0) {
10316
+ return;
10317
+ }
10318
+ this.hasDependencyListenerStarted = true;
10319
+ // Observe each dependency directly and compare previous/current values.
10320
+ dependsOf.forEach((fieldName) => {
10321
+ const control = this.config.formGroup.get(fieldName);
10322
+ control?.valueChanges.pipe(startWith(control.value), debounceTime(LOOKUP_DEBOUNCE_MS), pairwise()).subscribe(([previousValue, currentValue]) => {
10323
+ const normalizedPreviousValue = this.normalizeLookupValue(previousValue);
10324
+ const normalizedCurrentValue = this.normalizeLookupValue(currentValue);
10325
+ if (normalizedCurrentValue !== currentValue) {
10326
+ control.setValue(normalizedCurrentValue, { emitEvent: false });
10327
+ }
10328
+ const previousValidity = this.isLookupValueValid(normalizedPreviousValue);
10329
+ const currentValidity = this.isLookupValueValid(normalizedCurrentValue);
10330
+ const previousComparable = this.getComparableLookupValue(normalizedPreviousValue);
10331
+ const currentComparable = this.getComparableLookupValue(normalizedCurrentValue);
10332
+ const didValueChange = this.didDependencyValueChange(previousComparable, currentComparable);
10333
+ if (previousValidity && !currentValidity) {
10334
+ this.handleDependenciesState(true);
10335
+ return;
10336
+ }
10337
+ if (previousValidity && currentValidity && didValueChange) {
10338
+ this.clearTargetKeepingEnabled();
10339
+ return;
10340
+ }
10341
+ if (!previousValidity && currentValidity) {
10342
+ this.handleDependenciesState(false);
10343
+ }
10344
+ });
10345
+ control?.statusChanges.subscribe(() => {
10346
+ if (this.areDependenciesReady()) {
10347
+ this.handleDependenciesState(false);
10348
+ }
10349
+ });
10350
+ });
10351
+ // Evaluate once after init to honor prefilled valid dependencies without forcing resets.
10352
+ this.handleDependenciesState(false);
10353
+ }
10354
+ makeIt() {
10355
+ this.startDependenciesListener();
10356
+ return {
10357
+ name: this.config.name,
10358
+ formControlName: this.config.name, // Explicitly set formControlName for s-dynamic-form binding
10359
+ filterFieldName: this.config.filterFieldName ?? this.config.name,
10360
+ required: this.config.required ?? (() => false),
10361
+ size: this.config.size ?? { sm: 4, md: 4, lg: 4, xl: 4 },
10362
+ dependsOf: this.config.dependsOf ?? [],
10363
+ label: this.translate.instant(this.config.labelKey),
10364
+ type: 'lookup',
10365
+ dataKey: 'id',
10366
+ lookupDisplayField: 'label',
10367
+ searchTitle: this.translate.instant(this.config.searchTitleKey),
10368
+ searchEmptyTitle: this.translate.instant('agro.angular_components.lookup_nothing_found'),
10369
+ filterLabel: this.translate.instant('agro.angular_components.lookup_filter'),
10370
+ filterTitle: this.translate.instant('agro.angular_components.lookup_filters'),
10371
+ clearLabel: this.translate.instant('agro.angular_components.lookup_clear'),
10372
+ cancelLabel: this.translate.instant('agro.angular_components.lookup_cancel'),
10373
+ selectLabel: this.translate.instant('agro.angular_components.lookup_select'),
10374
+ suggestionsObservable: this.suggestionsSubject.asObservable(),
10375
+ searchObservable: this.searchSubject.asObservable(),
10376
+ onLookupRequest: createGenericOnLookupRequest({
10377
+ config: this.config,
10378
+ suggestionsSubject: this.suggestionsSubject,
10379
+ searchSubject: this.searchSubject,
10380
+ }),
10381
+ onSearchRequest: createGenericOnSearchRequest({
10382
+ config: this.config,
10383
+ suggestionsSubject: this.suggestionsSubject,
10384
+ searchSubject: this.searchSubject,
10385
+ }),
10386
+ onBlur: (event) => {
10387
+ const control = this.config.formGroup.get(this.config.name);
10388
+ if (control) {
10389
+ this.markControlAsUserInteracted(control);
10390
+ const uiRawValue = event?.target?.value ?? event?.value ?? '';
10391
+ const uiTextValue = typeof uiRawValue === 'string' ? uiRawValue.trim() : uiRawValue;
10392
+ const isUiEmpty = !uiTextValue;
10393
+ const currentValue = this.syncControlValueWithNormalization(control);
10394
+ const isValueValid = this.isLookupValueValid(currentValue);
10395
+ // If UI was cleared but control still has a value, force sync to null.
10396
+ if (isUiEmpty && currentValue != null && currentValue !== '') {
10397
+ control.setValue(null, { emitEvent: true });
10398
+ control.updateValueAndValidity({ emitEvent: true });
10399
+ return;
10400
+ }
10401
+ // If the control has a value but it's not a valid lookup object, clear it
10402
+ // This catches cases where the UI cleared the field but the FormControl wasn't updated
10403
+ if (currentValue && !isValueValid) {
10404
+ this.config.formGroup.patchValue({ [this.config.name]: null }, { emitEvent: true });
10405
+ }
10406
+ }
10407
+ },
10408
+ onSelectHandler: (event) => {
10409
+ const actualValue = event?.value || event;
10410
+ const control = this.config.formGroup.get(this.config.name);
10411
+ if (control && actualValue && typeof actualValue === 'object' && actualValue.id) {
10412
+ const normalizedValue = this.normalizeLookupValue(actualValue);
10413
+ this.markControlAsUserInteracted(control);
10414
+ control.setValue(normalizedValue, { emitEvent: true });
10415
+ }
10416
+ },
10417
+ onSelect: (event) => {
10418
+ const actualValue = event?.value || event;
10419
+ const control = this.config.formGroup.get(this.config.name);
10420
+ if (control && actualValue && typeof actualValue === 'object' && actualValue.id) {
10421
+ const normalizedValue = this.normalizeLookupValue(actualValue);
10422
+ this.markControlAsUserInteracted(control);
10423
+ control.setValue(normalizedValue, { emitEvent: true });
10424
+ }
10425
+ },
10426
+ onClear: () => {
10427
+ const control = this.config.formGroup.get(this.config.name);
10428
+ if (control) {
10429
+ this.markControlAsUserInteracted(control);
10430
+ control.setValue(null, { emitEvent: true });
10431
+ }
10432
+ },
10433
+ onChange: (event) => {
10434
+ const control = this.config.formGroup.get(this.config.name);
10435
+ const actualValue = event?.value || event;
10436
+ if (control && actualValue && typeof actualValue === 'object') {
10437
+ const normalizedValue = this.normalizeLookupValue(actualValue);
10438
+ if (normalizedValue !== actualValue) {
10439
+ this.markControlAsUserInteracted(control);
10440
+ control.setValue(normalizedValue, { emitEvent: true });
10441
+ return;
10442
+ }
10443
+ }
10444
+ if (control && !actualValue) {
10445
+ this.markControlAsUserInteracted(control);
10446
+ control.setValue(null, { emitEvent: true });
10447
+ }
10448
+ },
10449
+ onUnselect: () => {
10450
+ const control = this.config.formGroup.get(this.config.name);
10451
+ if (control) {
10452
+ this.markControlAsUserInteracted(control);
10453
+ control.setValue(null, { emitEvent: true });
10454
+ }
10455
+ },
10456
+ searchFields: this.config.searchFields,
10457
+ searchGridFields: this.config.searchFields,
10458
+ appendTo: 'body',
10459
+ baseZIndex: 10000,
10460
+ };
10461
+ }
10462
+ }
10463
+
10464
+ class AgroLookupBase {
10465
+ translate;
10466
+ formGroup;
10467
+ formFieldName;
10468
+ filterFieldName;
10469
+ required;
10470
+ dependsOf;
10471
+ size;
10472
+ autofill;
10473
+ customFilterQuery;
10474
+ constructor(config, defaults) {
10475
+ const { formGroup, injector, formFieldName, filterFieldName, required, dependsOf, size, autofill, customFilterQuery } = config;
10476
+ this.formGroup = formGroup;
10477
+ this.formFieldName = formFieldName ?? defaults.defaultFieldName;
10478
+ this.filterFieldName = filterFieldName ?? defaults.defaultFilterFieldName;
10479
+ this.required = required ?? (() => false);
10480
+ this.dependsOf = dependsOf ?? [];
10481
+ this.size = size ?? 4;
10482
+ this.autofill = autofill ?? (defaults.defaultAutofill ?? true);
10483
+ this.customFilterQuery = customFilterQuery;
10484
+ this.translate = injector.get(LibTranslationService);
10485
+ }
10486
+ makeIt() {
10487
+ return new AgroBaseLookupField({
10488
+ formGroup: this.formGroup,
10489
+ name: this.formFieldName,
10490
+ filterFieldName: this.filterFieldName,
10491
+ required: this.required,
10492
+ size: this.size,
10493
+ autofill: this.autofill,
10494
+ customFilterQuery: this.customFilterQuery,
10495
+ dependsOf: this.dependsOf,
10496
+ ...this.getLookupConfig(),
10497
+ }, this.translate).makeIt();
10498
+ }
10499
+ }
10500
+
10501
+ const LIB_CONFIG = new InjectionToken('AgroAngularComponentsConfig');
10502
+
10503
+ function resolveLookupHostProjectConfig(config, serviceName) {
10504
+ if (config?.domain && config?.service) {
10505
+ return config;
10506
+ }
10507
+ throw new Error(`${serviceName}: HostProjectConfigs is required. Configure AgroAngularComponentsModule.forRoot({ domain, service }).`);
10508
+ }
10509
+
10510
+ const HTTP_STATUS_UNAUTHORIZED = 401;
10511
+ class AgroLookupEntityService {
10512
+ http;
10513
+ messageService;
10514
+ entityUrl;
10515
+ actionsUrl;
10516
+ translate;
10517
+ constructor(http, messageService, entityUrl, actionsUrl, translate) {
10518
+ this.http = http;
10519
+ this.messageService = messageService;
10520
+ this.entityUrl = entityUrl;
10521
+ this.actionsUrl = actionsUrl;
10522
+ this.translate = translate;
10523
+ this.http = http;
10524
+ this.messageService = messageService;
10525
+ this.entityUrl = entityUrl;
10526
+ this.actionsUrl = actionsUrl;
10527
+ this.translate = translate;
10528
+ this.defaultCatch = this.defaultCatch.bind(this);
10529
+ }
10530
+ getSortOrderSuffix(order) {
10531
+ if (order === 1) {
10532
+ return ' asc';
10533
+ }
10534
+ else if (order === -1) {
10535
+ return ' desc';
10536
+ }
10537
+ else {
10538
+ return '';
10539
+ }
10540
+ }
10541
+ getListQueryParams(listParams) {
10542
+ const { page = 0, size = 10, sort = [], filterQuery = '', displayFields = [] } = listParams;
10543
+ let params = new HttpParams();
10544
+ params = params.append('size', String(size));
10545
+ params = params.append('offset', String(page));
10546
+ if (sort?.length) {
10547
+ params = params.append('orderby', sort
10548
+ .map((s) => `${s.field}${this.getSortOrderSuffix(s.order)}`)
10549
+ .join(', '));
10550
+ }
10551
+ if (filterQuery) {
10552
+ params = params.append('filter', filterQuery);
10553
+ }
10554
+ if (displayFields?.length) {
10555
+ params = params.append('displayfields', displayFields.join());
10556
+ }
10557
+ return params;
10558
+ }
10559
+ getBodyParams(listParams) {
10560
+ const { page = 0, size = 10, sort = [], filterQuery = '', displayFields = [] } = listParams;
10561
+ const bodyParams = {};
10562
+ bodyParams.size = size;
10563
+ bodyParams.offset = page;
10564
+ if (sort?.length) {
10565
+ bodyParams.orderBy = sort
10566
+ .map((s) => `${s.field}${this.getSortOrderSuffix(s.order)}`)
10567
+ .join(', ');
10568
+ }
10569
+ if (filterQuery) {
10570
+ bodyParams.filter = filterQuery;
10571
+ }
10572
+ if (displayFields?.length) {
10573
+ bodyParams.displayfields = displayFields.join();
10574
+ }
10575
+ return bodyParams;
10576
+ }
10577
+ defaultCatch(options) {
10578
+ return catchError((err) => {
10579
+ const suppressStatuses = options?.suppressStatuses ?? [];
10580
+ if (suppressStatuses.includes(err?.status)) {
10581
+ return throwError(err);
10582
+ }
10583
+ if (err) {
10584
+ let title = 'Error';
10585
+ if (err.status) {
10586
+ title = String(err.status);
10587
+ }
10588
+ let text = err?.error?.message ?? err?.statusText ?? err?.message ?? 'Error';
10589
+ if (text.includes('delete_entity_constraint_violation_')) {
10590
+ title = this.translate.instant('agro.angular_components.lookup_error_delete_entity_constraint_violation_title');
10591
+ text = this.translate.instant('agro.angular_components.lookup_error_delete_entity_constraint_violation_description');
10592
+ }
10593
+ else if (err.status === HTTP_STATUS_UNAUTHORIZED) {
10594
+ title = this.translate.instant('agro.angular_components.error_unauthorized_title');
10595
+ text = this.translate.instant('agro.angular_components.error_unauthorized_description');
10596
+ }
10597
+ else {
10598
+ // no additional error handling
10599
+ }
10600
+ this.messageService.add({
10601
+ severity: 'error',
10602
+ summary: title,
10603
+ detail: text,
10604
+ });
10605
+ }
10606
+ return throwError(err);
10607
+ });
10608
+ }
10609
+ list(listParams) {
10610
+ return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch());
10611
+ }
10612
+ get(id) {
10613
+ return this.http.get(`${this.entityUrl}/${id}`).pipe(this.defaultCatch());
10614
+ }
10615
+ insert(entity) {
10616
+ return this.http.post(`${this.entityUrl}`, entity).pipe(this.defaultCatch());
10617
+ }
10618
+ update(id, entity) {
10619
+ return this.http.put(`${this.entityUrl}/${id}`, entity).pipe(this.defaultCatch());
10620
+ }
10621
+ delete(id, options) {
10622
+ return this.http.delete(`${this.entityUrl}/${id}`).pipe(this.defaultCatch(options));
10623
+ }
10624
+ listCustomFilter(listParams, action) {
10625
+ return this.http.post(`${this.actionsUrl}/${action}`, this.getBodyParams(listParams)).pipe(this.defaultCatch());
10626
+ }
10627
+ }
10628
+
10629
+ class AgroLookupE070EmpService extends AgroLookupEntityService {
10630
+ http;
10631
+ messageService;
10632
+ translate;
10633
+ constructor(http, messageService, translate, config) {
10634
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE070EmpService');
10635
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e070emp`, `${resolved.domain}/${resolved.service}/actions`, translate);
10636
+ this.http = http;
10637
+ this.messageService = messageService;
10638
+ this.translate = translate;
10639
+ }
10640
+ listExternalE070Emp(listParams) {
10641
+ return this.http
10642
+ .get('erpx_fnd/empresa/entities/e070emp', {
10643
+ params: this.getListQueryParams(listParams),
10644
+ })
10645
+ .pipe(this.defaultCatch());
10646
+ }
10647
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070EmpService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10648
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070EmpService, providedIn: 'root' });
10649
+ }
10650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070EmpService, decorators: [{
10651
+ type: Injectable,
10652
+ args: [{
10653
+ providedIn: 'root',
10654
+ }]
10655
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10656
+ type: Optional
10657
+ }, {
10658
+ type: Inject,
10659
+ args: [LIB_CONFIG]
10660
+ }] }] });
10661
+
10662
+ class AgroCompanyLookup extends AgroLookupBase {
10663
+ e070EmpService;
10664
+ constructor(config) {
10665
+ super(config, { defaultFieldName: 'company', defaultFilterFieldName: 'company.id' });
10666
+ this.e070EmpService = config.injector.get(AgroLookupE070EmpService);
10667
+ }
10668
+ getLookupConfig() {
10669
+ return {
10670
+ labelKey: 'agro.angular_components.lookup_contract_company',
10671
+ searchTitleKey: 'agro.angular_components.lookup_contract_company_search_title',
10672
+ lookupDisplayFields: ['codEmp', 'nomEmp'],
10673
+ advancedDisplayFields: ['codEmp', 'nomEmp'],
10674
+ searchFields: [
10675
+ { name: 'codEmp', label: this.translate.instant('agro.angular_components.lookup_label_code_company'), type: 'integer', allowNegative: false, precision: 11, scale: 0 },
10676
+ { name: 'nomEmp', label: this.translate.instant('agro.angular_components.lookup_label_name'), type: 'string', maxLength: 100 },
10677
+ { name: 'sigEmp', label: this.translate.instant('agro.angular_components.lookup_e_070_emp_sig_emp'), type: 'string', maxLength: 100 },
10678
+ ],
10679
+ service: this.e070EmpService,
10680
+ };
10681
+ }
10682
+ }
10683
+
10684
+ class AgroLookupE070FilService extends AgroLookupEntityService {
10685
+ http;
10686
+ messageService;
10687
+ translate;
10688
+ constructor(http, messageService, translate, config) {
10689
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE070FilService');
10690
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e070fil`, `${resolved.domain}/${resolved.service}/actions`, translate);
10691
+ this.http = http;
10692
+ this.messageService = messageService;
10693
+ this.translate = translate;
10694
+ }
10695
+ listExternalE070Fil(listParams) {
10696
+ return this.http
10697
+ .get('erpx_fnd/empresa/entities/e070fil', {
10698
+ params: this.getListQueryParams(listParams),
10699
+ })
10700
+ .pipe(this.defaultCatch());
10701
+ }
10702
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070FilService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10703
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070FilService, providedIn: 'root' });
10704
+ }
10705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE070FilService, decorators: [{
10706
+ type: Injectable,
10707
+ args: [{
10708
+ providedIn: 'root',
10709
+ }]
10710
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10711
+ type: Optional
10712
+ }, {
10713
+ type: Inject,
10714
+ args: [LIB_CONFIG]
10715
+ }] }] });
10716
+
10717
+ class AgroBranchLookup extends AgroLookupBase {
10718
+ e070FilService;
10719
+ constructor(config) {
10720
+ super(config, { defaultFieldName: 'branch', defaultFilterFieldName: 'branch.id' });
10721
+ this.e070FilService = config.injector.get(AgroLookupE070FilService);
10722
+ }
10723
+ getLookupConfig() {
10724
+ return {
10725
+ labelKey: 'agro.angular_components.lookup_contract_branch',
10726
+ searchTitleKey: 'agro.angular_components.lookup_contract_branch_search_title',
10727
+ lookupDisplayFields: ['codFil', 'nomFil', 'numCgc', 'cidFil'],
10728
+ advancedDisplayFields: ['codFil', 'nomFil', 'sigFil', 'numCgc'],
10729
+ searchFields: [
10730
+ { name: 'codFil', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'integer', allowNegative: false, precision: 11, scale: 0 },
10731
+ { name: 'nomFil', label: this.translate.instant('agro.angular_components.lookup_label_branch'), type: 'string' },
10732
+ { name: 'numCgc', label: this.translate.instant('agro.angular_components.lookup_e_070_fil_num_cgc'), type: 'string' },
10733
+ { name: 'cidFil', label: this.translate.instant('agro.angular_components.lookup_label_city'), type: 'string' },
10734
+ ],
10735
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
10736
+ service: this.e070FilService,
10737
+ };
10738
+ }
10739
+ }
10740
+
10741
+ class AgroLookupE205DepService extends AgroLookupEntityService {
10742
+ http;
10743
+ messageService;
10744
+ translate;
10745
+ constructor(http, messageService, translate, config) {
10746
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE205DepService');
10747
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e205dep`, `${resolved.domain}/${resolved.service}/actions`, translate);
10748
+ this.http = http;
10749
+ this.messageService = messageService;
10750
+ this.translate = translate;
10751
+ }
10752
+ listExternalE205Dep(listParams) {
10753
+ return this.http
10754
+ .get('erpx_sup/foundation/entities/e205dep', {
10755
+ params: this.getListQueryParams(listParams),
10756
+ })
10757
+ .pipe(this.defaultCatch());
10758
+ }
10759
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE205DepService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10760
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE205DepService, providedIn: 'root' });
10761
+ }
10762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE205DepService, decorators: [{
10763
+ type: Injectable,
10764
+ args: [{
10765
+ providedIn: 'root',
10766
+ }]
10767
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10768
+ type: Optional
10769
+ }, {
10770
+ type: Inject,
10771
+ args: [LIB_CONFIG]
10772
+ }] }] });
10773
+
10774
+ class AgroDepositLookup extends AgroLookupBase {
10775
+ e205DepService;
10776
+ constructor(config) {
10777
+ super(config, { defaultFieldName: 'e205dep', defaultFilterFieldName: 'e205dep.id' });
10778
+ this.e205DepService = config.injector.get(AgroLookupE205DepService);
10779
+ }
10780
+ getLookupConfig() {
10781
+ return {
10782
+ labelKey: 'agro.angular_components.lookup_deposit',
10783
+ searchTitleKey: 'agro.angular_components.lookup_deposit_search_title',
10784
+ lookupDisplayFields: ['codDep', 'desDep'],
10785
+ advancedDisplayFields: ['codDep', 'desDep'],
10786
+ searchFields: [
10787
+ { name: 'codDep', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
10788
+ { name: 'desDep', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
10789
+ ],
10790
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
10791
+ service: this.e205DepService,
10792
+ };
10793
+ }
10794
+ }
10795
+
10796
+ class AgroLookupE210DxpService extends AgroLookupEntityService {
10797
+ http;
10798
+ messageService;
10799
+ translate;
10800
+ constructor(http, messageService, translate, config) {
10801
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE210DxpService');
10802
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e210dxp`, `${resolved.domain}/${resolved.service}/actions`, translate);
10803
+ this.http = http;
10804
+ this.messageService = messageService;
10805
+ this.translate = translate;
10806
+ }
10807
+ listExternalE210Dxp(listParams) {
10808
+ return this.http
10809
+ .get('erpx_sup/foundation/entities/e210dxp', {
10810
+ params: this.getListQueryParams(listParams),
10811
+ })
10812
+ .pipe(this.defaultCatch());
10813
+ }
10814
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE210DxpService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10815
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE210DxpService, providedIn: 'root' });
10816
+ }
10817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE210DxpService, decorators: [{
10818
+ type: Injectable,
10819
+ args: [{
10820
+ providedIn: 'root',
10821
+ }]
10822
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10823
+ type: Optional
10824
+ }, {
10825
+ type: Inject,
10826
+ args: [LIB_CONFIG]
10827
+ }] }] });
10828
+
10829
+ class AgroDepositBalanceLookup extends AgroLookupBase {
10830
+ e210DxpService;
10831
+ constructor(config) {
10832
+ super(config, { defaultFieldName: 'e210dxp', defaultFilterFieldName: 'e210dxp.id' });
10833
+ this.e210DxpService = config.injector.get(AgroLookupE210DxpService);
10834
+ }
10835
+ getLookupConfig() {
10836
+ return {
10837
+ labelKey: 'agro.angular_components.lookup_deposit',
10838
+ searchTitleKey: 'agro.angular_components.lookup_deposit_search_title',
10839
+ lookupDisplayFields: ['e205dep.codDep', 'e205dep.desDep'],
10840
+ advancedDisplayFields: ['e205dep.codDep', 'e205dep.desDep'],
10841
+ searchFields: [
10842
+ { name: 'e205dep.codDep', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
10843
+ { name: 'e205dep.desDep', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
10844
+ ],
10845
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
10846
+ service: this.e210DxpService,
10847
+ };
10848
+ }
10849
+ }
10850
+
10851
+ class AgroLookupDriverService extends AgroLookupEntityService {
10852
+ http;
10853
+ messageService;
10854
+ translate;
10855
+ constructor(http, messageService, translate, config) {
10856
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupDriverService');
10857
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/driver`, `${resolved.domain}/${resolved.service}/actions`, translate);
10858
+ this.http = http;
10859
+ this.messageService = messageService;
10860
+ this.translate = translate;
10861
+ }
10862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupDriverService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10863
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupDriverService, providedIn: 'root' });
10864
+ }
10865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupDriverService, decorators: [{
10866
+ type: Injectable,
10867
+ args: [{
10868
+ providedIn: 'root',
10869
+ }]
10870
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10871
+ type: Optional
10872
+ }, {
10873
+ type: Inject,
10874
+ args: [LIB_CONFIG]
10875
+ }] }] });
10876
+
10877
+ class AgroDriverLookup extends AgroLookupBase {
10878
+ driverService;
10879
+ constructor(config) {
10880
+ super(config, { defaultFieldName: 'driver', defaultFilterFieldName: 'driver.id', defaultAutofill: false });
10881
+ this.driverService = config.injector.get(AgroLookupDriverService);
10882
+ }
10883
+ getLookupConfig() {
10884
+ return {
10885
+ labelKey: 'agro.angular_components.lookup_driver',
10886
+ searchTitleKey: 'agro.angular_components.lookup_driver_search_title',
10887
+ lookupDisplayFields: ['cnpjCpf', 'name'],
10888
+ advancedDisplayFields: ['cnpjCpf', 'name'],
10889
+ searchFields: [
10890
+ { name: 'cnpjCpf', label: this.translate.instant('agro.angular_components.lookup_cnpj_cpf'), type: 'string' },
10891
+ { name: 'name', label: this.translate.instant('agro.angular_components.lookup_label_name'), type: 'string' },
10892
+ ],
10893
+ service: this.driverService,
10894
+ applyCPFCNPJFormat: true,
10895
+ };
10896
+ }
10897
+ }
10898
+
10899
+ class AgroLookupE095PesService extends AgroLookupEntityService {
10900
+ http;
10901
+ messageService;
10902
+ translate;
10903
+ constructor(http, messageService, translate, config) {
10904
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE095PesService');
10905
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e095pes`, `${resolved.domain}/${resolved.service}/actions`, translate);
10906
+ this.http = http;
10907
+ this.messageService = messageService;
10908
+ this.translate = translate;
10909
+ }
10910
+ listExternalE095Pes(listParams) {
10911
+ return this.http
10912
+ .get('erpx_fnd/pessoa/entities/e095pes', {
10913
+ params: this.getListQueryParams(listParams),
10914
+ })
10915
+ .pipe(this.defaultCatch());
10916
+ }
10917
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE095PesService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10918
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE095PesService, providedIn: 'root' });
10919
+ }
10920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE095PesService, decorators: [{
10921
+ type: Injectable,
10922
+ args: [{
10923
+ providedIn: 'root',
10924
+ }]
10925
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10926
+ type: Optional
10927
+ }, {
10928
+ type: Inject,
10929
+ args: [LIB_CONFIG]
10930
+ }] }] });
10931
+
10932
+ class AgroE095PesLookup extends AgroLookupBase {
10933
+ e095PesService;
10934
+ constructor(config) {
10935
+ super(config, { defaultFieldName: 'e095pes', defaultFilterFieldName: 'e095pes.id', defaultAutofill: false });
10936
+ this.e095PesService = config.injector.get(AgroLookupE095PesService);
10937
+ }
10938
+ getLookupConfig() {
10939
+ return {
10940
+ labelKey: 'agro.angular_components.lookup_e095_pes',
10941
+ searchTitleKey: 'agro.angular_components.lookup_e095_pes_search_title',
10942
+ lookupDisplayFields: ['e001pes.cnpCpf', 'e001pes.nomPes'],
10943
+ advancedDisplayFields: ['e001pes.cnpCpf', 'e001pes.nomPes'],
10944
+ applyCPFCNPJFormat: true,
10945
+ searchFields: [
10946
+ { name: 'e001pes.cnpCpf', label: this.translate.instant('agro.angular_components.lookup_cnpj_cpf'), type: 'string' },
10947
+ { name: 'e001pes.nomPes', label: this.translate.instant('agro.angular_components.lookup_label_name'), type: 'string' },
10948
+ ],
10949
+ service: this.e095PesService,
10950
+ };
10951
+ }
10952
+ }
10953
+
10954
+ class AgroLookupE012FamService extends AgroLookupEntityService {
10955
+ http;
10956
+ messageService;
10957
+ translate;
10958
+ constructor(http, messageService, translate, config) {
10959
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE012FamService');
10960
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e012fam`, `${resolved.domain}/${resolved.service}/actions`, translate);
10961
+ this.http = http;
10962
+ this.messageService = messageService;
10963
+ this.translate = translate;
10964
+ }
10965
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE012FamService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
10966
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE012FamService, providedIn: 'root' });
10967
+ }
10968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE012FamService, decorators: [{
10969
+ type: Injectable,
10970
+ args: [{
10971
+ providedIn: 'root',
10972
+ }]
10973
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
10974
+ type: Optional
10975
+ }, {
10976
+ type: Inject,
10977
+ args: [LIB_CONFIG]
10978
+ }] }] });
10979
+
10980
+ class AgroFamilyLookup extends AgroLookupBase {
10981
+ e012FamService;
10982
+ constructor(config) {
10983
+ super(config, { defaultFieldName: 'e012fam', defaultFilterFieldName: 'e012fam.id' });
10984
+ this.e012FamService = config.injector.get(AgroLookupE012FamService);
10985
+ }
10986
+ getLookupConfig() {
10987
+ return {
10988
+ labelKey: 'agro.angular_components.lookup_family',
10989
+ searchTitleKey: 'agro.angular_components.lookup_family_search_title',
10990
+ lookupDisplayFields: ['codFam', 'desFam'],
10991
+ advancedDisplayFields: ['codFam', 'desFam'],
10992
+ searchFields: [
10993
+ { name: 'codFam', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
10994
+ { name: 'desFam', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
10995
+ ],
10996
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
10997
+ service: this.e012FamService,
10998
+ };
10999
+ }
11000
+ }
11001
+
11002
+ class AgroLookupE075DerService extends AgroLookupEntityService {
11003
+ http;
11004
+ messageService;
11005
+ translate;
11006
+ constructor(http, messageService, translate, config) {
11007
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE075DerService');
11008
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e075der`, `${resolved.domain}/${resolved.service}/actions`, translate);
11009
+ this.http = http;
11010
+ this.messageService = messageService;
11011
+ this.translate = translate;
11012
+ }
11013
+ listExternalE075Der(listParams) {
11014
+ return this.http
11015
+ .get('erpx_fnd/produto/entities/e075der', {
11016
+ params: this.getListQueryParams(listParams),
11017
+ })
11018
+ .pipe(this.defaultCatch());
11019
+ }
11020
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE075DerService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11021
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE075DerService, providedIn: 'root' });
11022
+ }
11023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE075DerService, decorators: [{
11024
+ type: Injectable,
11025
+ args: [{
11026
+ providedIn: 'root',
11027
+ }]
11028
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11029
+ type: Optional
11030
+ }, {
11031
+ type: Inject,
11032
+ args: [LIB_CONFIG]
11033
+ }] }] });
11034
+
11035
+ class AgroProductLookup extends AgroLookupBase {
11036
+ e075DerService;
11037
+ constructor(config) {
11038
+ super(config, { defaultFieldName: 'contractProducts', defaultFilterFieldName: 'contractProducts.product.id' });
11039
+ this.e075DerService = config.injector.get(AgroLookupE075DerService);
11040
+ }
11041
+ getLookupConfig() {
11042
+ return {
11043
+ labelKey: 'agro.angular_components.lookup_product',
11044
+ searchTitleKey: 'agro.angular_components.lookup_contract_product_product_search_title',
11045
+ lookupDisplayFields: ['codDer', 'desDer'],
11046
+ advancedDisplayFields: ['codDer', 'desDer'],
11047
+ searchFields: [
11048
+ { name: 'codDer', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
11049
+ { name: 'desDer', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
11050
+ ],
11051
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
11052
+ service: this.e075DerService,
11053
+ };
11054
+ }
11055
+ }
11056
+
11057
+ class AgroLookupE001PesService extends AgroLookupEntityService {
11058
+ http;
11059
+ messageService;
11060
+ translate;
11061
+ constructor(http, messageService, translate, config) {
11062
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE001PesService');
11063
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e001pes`, `${resolved.domain}/${resolved.service}/actions`, translate);
11064
+ this.http = http;
11065
+ this.messageService = messageService;
11066
+ this.translate = translate;
11067
+ }
11068
+ listExternalE001Pes(listParams) {
11069
+ return this.http
11070
+ .get('erpx_fnd/pessoa/entities/e001pes', {
11071
+ params: this.getListQueryParams(listParams),
11072
+ })
11073
+ .pipe(this.defaultCatch());
11074
+ }
11075
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE001PesService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11076
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE001PesService, providedIn: 'root' });
11077
+ }
11078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE001PesService, decorators: [{
11079
+ type: Injectable,
11080
+ args: [{
11081
+ providedIn: 'root',
11082
+ }]
11083
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11084
+ type: Optional
11085
+ }, {
11086
+ type: Inject,
11087
+ args: [LIB_CONFIG]
11088
+ }] }] });
11089
+
11090
+ class AgroProducerLookup extends AgroLookupBase {
11091
+ e001PesService;
11092
+ constructor(config) {
11093
+ super(config, { defaultFieldName: 'e001pes', defaultFilterFieldName: 'contractProducts.contractProductProducers.producer.id' });
11094
+ this.e001PesService = config.injector.get(AgroLookupE001PesService);
11095
+ }
11096
+ getLookupConfig() {
11097
+ return {
11098
+ labelKey: 'agro.angular_components.lookup_producer',
11099
+ searchTitleKey: 'agro.angular_components.lookup_contract_product_producer_producer_search_title',
11100
+ lookupDisplayFields: ['cnpCpf', 'nomPes'],
11101
+ advancedDisplayFields: ['cnpCpf', 'nomPes', 'sitPes', 'extIntSts', 'extIntMsg'],
11102
+ searchFields: [
11103
+ { name: 'cnpCpf', label: this.translate.instant('agro.angular_components.lookup_cnpj_cpf'), type: 'string' },
11104
+ { name: 'nomPes', label: this.translate.instant('agro.angular_components.lookup_label_name'), type: 'string' },
11105
+ ],
11106
+ service: this.e001PesService,
11107
+ applyCPFCNPJFormat: true,
11108
+ };
11109
+ }
11110
+ }
11111
+
11112
+ class AgroLookupE113SafService extends AgroLookupEntityService {
11113
+ http;
11114
+ messageService;
11115
+ translate;
11116
+ constructor(http, messageService, translate, config) {
11117
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE113SafService');
11118
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e113saf`, `${resolved.domain}/${resolved.service}/actions`, translate);
11119
+ this.http = http;
11120
+ this.messageService = messageService;
11121
+ this.translate = translate;
11122
+ }
11123
+ listExternalE113Saf(listParams) {
11124
+ return this.http
11125
+ .get('agro/harvest/entities/e113saf', {
11126
+ params: this.getListQueryParams(listParams),
11127
+ })
11128
+ .pipe(this.defaultCatch());
11129
+ }
11130
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE113SafService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11131
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE113SafService, providedIn: 'root' });
11132
+ }
11133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE113SafService, decorators: [{
11134
+ type: Injectable,
11135
+ args: [{
11136
+ providedIn: 'root',
11137
+ }]
11138
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11139
+ type: Optional
11140
+ }, {
11141
+ type: Inject,
11142
+ args: [LIB_CONFIG]
11143
+ }] }] });
11144
+
11145
+ class AgroHarvestLookup extends AgroLookupBase {
11146
+ e113SafService;
11147
+ constructor(config) {
11148
+ super(config, { defaultFieldName: 'e113saf', defaultFilterFieldName: 'contractProducts.harvest.id' });
11149
+ this.e113SafService = config.injector.get(AgroLookupE113SafService);
11150
+ }
11151
+ getLookupConfig() {
11152
+ return {
11153
+ labelKey: 'agro.angular_components.lookup_contract_product_harvest',
11154
+ searchTitleKey: 'agro.angular_components.lookup_contract_product_harvest_search_title',
11155
+ lookupDisplayFields: ['codSaf', 'desSaf'],
11156
+ advancedDisplayFields: ['codSaf', 'desSaf'],
11157
+ searchFields: [
11158
+ { name: 'codSaf', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
11159
+ { name: 'desSaf', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
11160
+ ],
11161
+ dependencies: [{ formControlName: 'company', apiField: 'e070emp.id' }],
11162
+ service: this.e113SafService,
11163
+ };
11164
+ }
11165
+ }
11166
+
11167
+ class AgroLookupE031MoeService extends AgroLookupEntityService {
11168
+ http;
11169
+ messageService;
11170
+ translate;
11171
+ constructor(http, messageService, translate, config) {
11172
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupE031MoeService');
11173
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/e031moe`, `${resolved.domain}/${resolved.service}/actions`, translate);
11174
+ this.http = http;
11175
+ this.messageService = messageService;
11176
+ this.translate = translate;
11177
+ }
11178
+ listExternalE031Moe(listParams) {
11179
+ return this.http
11180
+ .get('erpx_fnd/financeiro/entities/e031moe', {
11181
+ params: this.getListQueryParams(listParams),
11182
+ })
11183
+ .pipe(this.defaultCatch());
11184
+ }
11185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE031MoeService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11186
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE031MoeService, providedIn: 'root' });
11187
+ }
11188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupE031MoeService, decorators: [{
11189
+ type: Injectable,
11190
+ args: [{
11191
+ providedIn: 'root',
11192
+ }]
11193
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11194
+ type: Optional
11195
+ }, {
11196
+ type: Inject,
11197
+ args: [LIB_CONFIG]
11198
+ }] }] });
11199
+
11200
+ class AgroCurrencyLookup extends AgroLookupBase {
11201
+ e031MoeService;
11202
+ constructor(config) {
11203
+ super(config, { defaultFieldName: 'currency', defaultFilterFieldName: 'currency.id' });
11204
+ this.e031MoeService = config.injector.get(AgroLookupE031MoeService);
11205
+ }
11206
+ getLookupConfig() {
11207
+ return {
11208
+ labelKey: 'agro.angular_components.lookup_contract_product_currency',
11209
+ searchTitleKey: 'agro.angular_components.lookup_contract_product_currency_search_title',
11210
+ lookupDisplayFields: ['codMoe', 'desMoe'],
11211
+ advancedDisplayFields: ['codMoe', 'desMoe', 'sigMoe'],
11212
+ searchFields: [
11213
+ { name: 'codMoe', label: this.translate.instant('agro.angular_components.lookup_e_031_moe_cod_moe'), type: 'string' },
11214
+ { name: 'desMoe', label: this.translate.instant('agro.angular_components.lookup_e_031_moe_des_moe'), type: 'string' },
11215
+ ],
11216
+ service: this.e031MoeService,
11217
+ };
11218
+ }
11219
+ }
11220
+
11221
+ class AgroLookupTicketService extends AgroLookupEntityService {
11222
+ http;
11223
+ messageService;
11224
+ translate;
11225
+ constructor(http, messageService, translate, config) {
11226
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupTicketService');
11227
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/ticket`, `${resolved.domain}/${resolved.service}/actions`, translate);
11228
+ this.http = http;
11229
+ this.messageService = messageService;
11230
+ this.translate = translate;
11231
+ }
11232
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupTicketService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11233
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupTicketService, providedIn: 'root' });
11234
+ }
11235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupTicketService, decorators: [{
11236
+ type: Injectable,
11237
+ args: [{
11238
+ providedIn: 'root',
11239
+ }]
11240
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11241
+ type: Optional
11242
+ }, {
11243
+ type: Inject,
11244
+ args: [LIB_CONFIG]
11245
+ }] }] });
11246
+
11247
+ const LICENSE_PLATE_FIELD = 'balanceEntryControl.licensePlate';
11248
+ class AgroTicketLookup extends AgroLookupBase {
11249
+ ticketService;
11250
+ constructor(config) {
11251
+ super(config, { defaultFieldName: 'ticket', defaultFilterFieldName: 'ticket.id', defaultAutofill: false });
11252
+ this.ticketService = config.injector.get(AgroLookupTicketService);
11253
+ }
11254
+ getLookupConfig() {
11255
+ return {
11256
+ labelKey: 'agro.angular_components.lookup_ticket',
11257
+ searchTitleKey: 'agro.angular_components.lookup_ticket_search_title',
11258
+ lookupDisplayFields: ['number', LICENSE_PLATE_FIELD],
11259
+ advancedDisplayFields: ['number', LICENSE_PLATE_FIELD],
11260
+ searchFields: [
11261
+ { name: 'number', label: this.translate.instant('agro.angular_components.lookup_ticket'), type: 'integer', allowNegative: false, precision: 11, scale: 0 },
11262
+ { name: LICENSE_PLATE_FIELD, label: this.translate.instant('agro.angular_components.lookup_license_plate'), type: 'string' },
11263
+ ],
11264
+ service: this.ticketService,
11265
+ };
11266
+ }
11267
+ }
11268
+
11269
+ class AgroRomaneoLookup extends AgroLookupBase {
11270
+ ticketService;
11271
+ constructor(config) {
11272
+ super(config, { defaultFieldName: 'romaneo', defaultFilterFieldName: 'romaneo.id', defaultAutofill: false });
11273
+ this.ticketService = config.injector.get(AgroLookupTicketService);
11274
+ }
11275
+ getLookupConfig() {
11276
+ return {
11277
+ labelKey: 'agro.angular_components.lookup_romaneo',
11278
+ searchTitleKey: 'agro.angular_components.lookup_romaneo_search_title',
11279
+ lookupDisplayFields: ['ticket.number', 'licensePlate'],
11280
+ advancedDisplayFields: ['ticket.number', 'licensePlate'],
11281
+ searchFields: [
11282
+ { name: 'ticket.number', label: this.translate.instant('agro.angular_components.lookup_ticket'), type: 'integer', allowNegative: false, precision: 11, scale: 0 },
11283
+ { name: 'licensePlate', label: this.translate.instant('agro.angular_components.lookup_license_plate'), type: 'string' },
11284
+ ],
11285
+ service: this.ticketService,
11286
+ };
11287
+ }
11288
+ }
11289
+
11290
+ class AgroLookupProductVarietyService extends AgroLookupEntityService {
11291
+ http;
11292
+ messageService;
11293
+ translate;
11294
+ constructor(http, messageService, translate, config) {
11295
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupProductVarietyService');
11296
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/productVariety`, `${resolved.domain}/${resolved.service}/actions`, translate);
11297
+ this.http = http;
11298
+ this.messageService = messageService;
11299
+ this.translate = translate;
11300
+ }
11301
+ listExternalProductVariety(listParams) {
11302
+ return this.http
11303
+ .get('erpx_fnd/variety_royalties/entities/productVariety', {
11304
+ params: this.getListQueryParams(listParams),
11305
+ })
11306
+ .pipe(this.defaultCatch());
11307
+ }
11308
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupProductVarietyService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11309
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupProductVarietyService, providedIn: 'root' });
11310
+ }
11311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupProductVarietyService, decorators: [{
11312
+ type: Injectable,
11313
+ args: [{
11314
+ providedIn: 'root',
11315
+ }]
11316
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11317
+ type: Optional
11318
+ }, {
11319
+ type: Inject,
11320
+ args: [LIB_CONFIG]
11321
+ }] }] });
11322
+
11323
+ class AgroProductVarietyLookup extends AgroLookupBase {
11324
+ productVarietyService;
11325
+ constructor(config) {
11326
+ super(config, { defaultFieldName: 'productVariety', defaultFilterFieldName: 'productVariety.id', defaultAutofill: false });
11327
+ this.productVarietyService = config.injector.get(AgroLookupProductVarietyService);
11328
+ }
11329
+ getLookupConfig() {
11330
+ return {
11331
+ labelKey: 'agro.angular_components.lookup_product_variety',
11332
+ searchTitleKey: 'agro.angular_components.lookup_product_variety_search_title',
11333
+ lookupDisplayFields: ['variety.code', 'variety.description', 'royaltiesPercentage'],
11334
+ advancedDisplayFields: ['variety.code', 'variety.description', 'royaltiesPercentage'],
11335
+ searchFields: [
11336
+ { name: 'variety.code', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'integer', allowNegative: false, precision: 11, scale: 0 },
11337
+ { name: 'variety.description', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
11338
+ { name: 'royaltiesPercentage', label: this.translate.instant('agro.angular_components.lookup_royalties_percentage'), type: 'number' },
11339
+ ],
11340
+ service: this.productVarietyService,
11341
+ };
11342
+ }
11343
+ }
11344
+
11345
+ class AgroLookupRuralEstateService extends AgroLookupEntityService {
11346
+ http;
11347
+ messageService;
11348
+ translate;
11349
+ constructor(http, messageService, translate, config) {
11350
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupRuralEstateService');
11351
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/ruralEstate`, `${resolved.domain}/${resolved.service}/actions`, translate);
11352
+ this.http = http;
11353
+ this.messageService = messageService;
11354
+ this.translate = translate;
11355
+ }
11356
+ listExternalRuralEstate(listParams) {
11357
+ return this.http
11358
+ .get('agro/database/entities/ruralEstate', {
11359
+ params: this.getListQueryParams(listParams),
11360
+ })
11361
+ .pipe(this.defaultCatch());
11362
+ }
11363
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupRuralEstateService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11364
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupRuralEstateService, providedIn: 'root' });
11365
+ }
11366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupRuralEstateService, decorators: [{
11367
+ type: Injectable,
11368
+ args: [{
11369
+ providedIn: 'root',
11370
+ }]
11371
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11372
+ type: Optional
11373
+ }, {
11374
+ type: Inject,
11375
+ args: [LIB_CONFIG]
11376
+ }] }] });
11377
+
11378
+ class AgroRuralEstateLookup extends AgroLookupBase {
11379
+ ruralEstateService;
11380
+ constructor(config) {
11381
+ super(config, { defaultFieldName: 'ruralEstate', defaultFilterFieldName: 'ruralEstate.id' });
11382
+ this.ruralEstateService = config.injector.get(AgroLookupRuralEstateService);
11383
+ }
11384
+ getLookupConfig() {
11385
+ return {
11386
+ labelKey: 'agro.angular_components.lookup_contract_product_producer_rural_estate',
11387
+ searchTitleKey: 'agro.angular_components.lookup_contract_product_producer_rural_estate_search_title',
11388
+ lookupDisplayFields: ['sequential', 'name'],
11389
+ advancedDisplayFields: ['sequential', 'name', 'ie'],
11390
+ searchFields: [
11391
+ { name: 'sequential', label: this.translate.instant('agro.angular_components.lookup_rural_estate_sequential'), type: 'integer' },
11392
+ { name: 'name', label: this.translate.instant('agro.angular_components.lookup_rural_estate_name'), type: 'string' },
11393
+ ],
11394
+ dependencies: [{ formControlName: 'producer', apiField: 'producers.id' }],
11395
+ service: this.ruralEstateService,
11396
+ };
11397
+ }
11398
+ }
11399
+
11400
+ class AgroLookupIncreaseProductService extends AgroLookupEntityService {
11401
+ http;
11402
+ messageService;
11403
+ translate;
11404
+ constructor(http, messageService, translate, config) {
11405
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupIncreaseProductService');
11406
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/increaseProduct`, `${resolved.domain}/${resolved.service}/actions`, translate);
11407
+ this.http = http;
11408
+ this.messageService = messageService;
11409
+ this.translate = translate;
11410
+ }
11411
+ listExternalIncreaseProduct(listParams) {
11412
+ return this.http
11413
+ .get('erpx_fnd/financial_increase/entities/increaseProduct', {
11414
+ params: this.getListQueryParams(listParams),
11415
+ })
11416
+ .pipe(this.defaultCatch());
11417
+ }
11418
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupIncreaseProductService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11419
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupIncreaseProductService, providedIn: 'root' });
11420
+ }
11421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupIncreaseProductService, decorators: [{
11422
+ type: Injectable,
11423
+ args: [{
11424
+ providedIn: 'root',
11425
+ }]
11426
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11427
+ type: Optional
11428
+ }, {
11429
+ type: Inject,
11430
+ args: [LIB_CONFIG]
11431
+ }] }] });
11432
+
11433
+ const INCREASE_COD_FIELD = 'increase.codInc';
11434
+ const INCREASE_DES_FIELD = 'increase.desInc';
11435
+ const INCREASE_VALUE_FIELD = 'valInc';
11436
+ class AgroIncreaseProductLookup extends AgroLookupBase {
11437
+ increaseProductService;
11438
+ constructor(config) {
11439
+ super(config, { defaultFieldName: 'increaseProduct', defaultFilterFieldName: 'increaseProduct.id' });
11440
+ this.increaseProductService = config.injector.get(AgroLookupIncreaseProductService);
11441
+ }
11442
+ getLookupConfig() {
11443
+ return {
11444
+ labelKey: 'agro.angular_components.lookup_contract_financial_increase',
11445
+ searchTitleKey: 'agro.angular_components.lookup_contract_financial_increase_search_title',
11446
+ lookupDisplayFields: [INCREASE_COD_FIELD, INCREASE_DES_FIELD],
11447
+ advancedDisplayFields: [INCREASE_COD_FIELD, INCREASE_DES_FIELD, INCREASE_VALUE_FIELD],
11448
+ searchFields: [
11449
+ { name: INCREASE_COD_FIELD, label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'string' },
11450
+ { name: INCREASE_DES_FIELD, label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
11451
+ ],
11452
+ dependencies: [
11453
+ { formControlName: 'company', apiField: 'company.id' },
11454
+ { formControlName: 'product', apiField: 'product.id' },
11455
+ ],
11456
+ service: this.increaseProductService,
11457
+ };
11458
+ }
11459
+ }
11460
+
11461
+ class AgroLookupFamilyGroupService extends AgroLookupEntityService {
11462
+ http;
11463
+ messageService;
11464
+ translate;
11465
+ constructor(http, messageService, translate, config) {
11466
+ const resolved = resolveLookupHostProjectConfig(config, 'AgroLookupFamilyGroupService');
11467
+ super(http, messageService, `${resolved.domain}/${resolved.service}/entities/familyGroup`, `${resolved.domain}/${resolved.service}/actions`, translate);
11468
+ this.http = http;
11469
+ this.messageService = messageService;
11470
+ this.translate = translate;
11471
+ }
11472
+ listExternalFamilyGroup(listParams) {
11473
+ return this.http
11474
+ .get('erpx_fnd/family_group/entities/familyGroup', {
11475
+ params: this.getListQueryParams(listParams),
11476
+ })
11477
+ .pipe(this.defaultCatch());
11478
+ }
11479
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupFamilyGroupService, deps: [{ token: i1.HttpClient }, { token: i2$2.MessageService }, { token: LibTranslationService }, { token: LIB_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11480
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupFamilyGroupService, providedIn: 'root' });
11481
+ }
11482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgroLookupFamilyGroupService, decorators: [{
11483
+ type: Injectable,
11484
+ args: [{
11485
+ providedIn: 'root',
11486
+ }]
11487
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$2.MessageService }, { type: LibTranslationService }, { type: undefined, decorators: [{
11488
+ type: Optional
11489
+ }, {
11490
+ type: Inject,
11491
+ args: [LIB_CONFIG]
11492
+ }] }] });
11493
+
11494
+ class AgroFamilyGroupLookup extends AgroLookupBase {
11495
+ familyGroupService;
11496
+ constructor(config) {
11497
+ super(config, { defaultFieldName: 'familyGroup', defaultFilterFieldName: 'familyGroup.id', defaultAutofill: false });
11498
+ this.familyGroupService = config.injector.get(AgroLookupFamilyGroupService);
11499
+ }
11500
+ getLookupConfig() {
11501
+ return {
11502
+ labelKey: 'agro.angular_components.lookup_contract_family_group',
11503
+ searchTitleKey: 'agro.angular_components.lookup_contract_family_group_search_title',
11504
+ lookupDisplayFields: ['code', 'name'],
11505
+ advancedDisplayFields: ['code', 'name', 'status'],
11506
+ searchFields: [
11507
+ { name: 'code', label: this.translate.instant('agro.angular_components.lookup_label_code'), type: 'integer' },
11508
+ { name: 'name', label: this.translate.instant('agro.angular_components.lookup_label_description'), type: 'string' },
11509
+ ],
11510
+ dependencies: [{ formControlName: 'producer', apiField: 'producers.id' }],
11511
+ service: this.familyGroupService,
11512
+ };
11513
+ }
11514
+ }
11515
+
9513
11516
  class AgroAngularComponentsModule {
9514
11517
  static forRoot(config) {
9515
11518
  return {
@@ -9537,5 +11540,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
9537
11540
  * Generated bundle index. Do not edit.
9538
11541
  */
9539
11542
 
9540
- export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroCookieUtils, AgroDateUtils, AgroEntityStatus, AgroFinancialService, AgroFormValidator, AgroInvoiceModule, AgroInvoiceService, AgroLogics, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroStringMasks, AgroStringUtils, AgroUnitConverter, AgroWorkspaceComponent, AgroWorkspaceModule, AgroWorkspaceSwitchService, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, CnpjCpfPipe, CnpjCpfPipeModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule$1 as E070EmpModule, E070FilModule$1 as E070FilModule, E075DerModule, E205depService, EDLQueryBuilder, EventControlBoardComponent, EventControlBoardModule, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FinancialTitleTableComponent, FinancialTitleTableModule, FixationModule, HttpCodes, InvoiceModule, KilogramModule, KilogramPipe, LIB_CONFIG, LibTranslatePipe, LibTranslationModule, LibTranslationService, ModalBeautyEventsComponent, ModalBeautyEventsService, ModalInvoicePjForContractsComponent, ModalInvoicePjForContractsModule, ModalInvoicePjForFixationComponent, ModalInvoicePjForFixationModule, ModalInvoicePjForOriginationComponent, ModalInvoicePjForOriginationModule, ModalInvoicePjForTransferComponent, ModalInvoicePjForTransferModule, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerListModalComponent, ProducerListModalModule, ProducerListModalService, RuralEstateModule, SharedModule, StatusType, StringifierPipe, StringifierPipeModule, TelephonePipe, TelephonePipeModule, TicketModule, TransferModule, TypeAccount, UnitOfMeasurement, UserInformationService, WebsocketModule, WebsocketService };
11543
+ export { AGRO_NUMBERS, AGRO_REGEX, AgroAngularComponentsModule, AgroArrayUtils, AgroBaseLookupField, AgroBranchLookup, AgroCompanyLookup, AgroCookieUtils, AgroCurrencyLookup, AgroDateUtils, AgroDepositBalanceLookup, AgroDepositLookup, AgroDriverLookup, AgroE095PesLookup, AgroEntityStatus, AgroFamilyGroupLookup, AgroFamilyLookup, AgroFinancialService, AgroFormValidator, AgroHarvestLookup, AgroIncreaseProductLookup, AgroInvoiceModule, AgroInvoiceService, AgroLogics, AgroLookupBase, AgroLookupDriverService, AgroLookupE001PesService, AgroLookupE012FamService, AgroLookupE031MoeService, AgroLookupE070EmpService, AgroLookupE070FilService, AgroLookupE075DerService, AgroLookupE095PesService, AgroLookupE113SafService, AgroLookupE205DepService, AgroLookupE210DxpService, AgroLookupEntityService, AgroLookupFamilyGroupService, AgroLookupIncreaseProductService, AgroLookupProductVarietyService, AgroLookupRuralEstateService, AgroLookupTicketService, AgroNameUtils, AgroNumberUtils, AgroObjectUtils, AgroPlatformUtils, AgroProducerLookup, AgroProductLookup, AgroProductVarietyLookup, AgroRomaneoLookup, AgroRuralEstateLookup, AgroStringMasks, AgroStringUtils, AgroTicketLookup, AgroUnitConverter, AgroWorkspaceComponent, AgroWorkspaceModule, AgroWorkspaceSwitchService, AsyncLock, CancelEventDialogComponent, CancelEventDialogModule, CnpjCpfPipe, CnpjCpfPipeModule, Colors, DateComparisonType, E001TnsModule, E001pesModule, E070EmpModule$1 as E070EmpModule, E070FilModule$1 as E070FilModule, E075DerModule, E205depService, EDLQueryBuilder, EventControlBoardComponent, EventControlBoardModule, EventControlItemModule, EventControlModule, EventStepsComponent, EventStepsModule, ExternalInvoiceModule, FinancialTitleTableComponent, FinancialTitleTableModule, FixationModule, HttpCodes, InvoiceModule, KilogramModule, KilogramPipe, LIB_CONFIG, LibTranslatePipe, LibTranslationModule, LibTranslationService, ModalBeautyEventsComponent, ModalBeautyEventsService, ModalInvoicePjForContractsComponent, ModalInvoicePjForContractsModule, ModalInvoicePjForFixationComponent, ModalInvoicePjForFixationModule, ModalInvoicePjForOriginationComponent, ModalInvoicePjForOriginationModule, ModalInvoicePjForTransferComponent, ModalInvoicePjForTransferModule, NumberComparisonType, OriginationModule, PaginatorStorageService, PrimitiveManager, ProducerListModalComponent, ProducerListModalModule, ProducerListModalService, RuralEstateModule, SharedModule, StatusType, StringifierPipe, StringifierPipeModule, TelephonePipe, TelephonePipeModule, TicketModule, TransferModule, TypeAccount, UnitOfMeasurement, UserInformationService, WebsocketModule, WebsocketService, adjustValuesIfNecessary, applyRelationTransforms, calculateAdjustedPercentages, calculateAdjustedPercentagesAndWeights, calculateAdjustedWeights, convertValueByType, createFilterString, createFilterTokens, createGenericOnBlur, createGenericOnLookupRequest, createGenericOnSearchRequest, formatBrlCurrency, formatCPFCNPJWithMask, formatFilters, formatFiltersAdvanced, formatFiltersWithoutStatus, getEnumQuery, getLabelValueRequest, getProp, getSuggestionValue, getTypeInformation, isValidFilter, mergeUnique, resolveLookupHostProjectConfig, resolveRefs, roundToThree };
9541
11544
  //# sourceMappingURL=senior-agronegocio-angular-components.mjs.map