@senior-gestao-empresarial/angular-components 7.14.1 → 7.15.0-09167df2-59df-4982-8a40-f0024103e502

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.
@@ -223,6 +223,19 @@ var EnumLogicalOperator;
223
223
  /** Contains string value (Ex: /Products?$filter=containing(lower(name), lower('my name'))) */
224
224
  EnumLogicalOperator["Contains"] = "containing";
225
225
  })(EnumLogicalOperator || (EnumLogicalOperator = {}));
226
+ var ErpLookupsFormField = /** @class */ (function (_super) {
227
+ __extends(ErpLookupsFormField, _super);
228
+ function ErpLookupsFormField(erpLookupsFormField) {
229
+ var args = [];
230
+ for (var _i = 1; _i < arguments.length; _i++) {
231
+ args[_i - 1] = arguments[_i];
232
+ }
233
+ var _this = _super.apply(this, __spread(args)) || this;
234
+ _this.erpLookupsFormField = erpLookupsFormField;
235
+ return _this;
236
+ }
237
+ return ErpLookupsFormField;
238
+ }(FormField));
226
239
  var ErpLookups = /** @class */ (function () {
227
240
  /**
228
241
  * Criação de um lookup.
@@ -265,6 +278,9 @@ var ErpLookups = /** @class */ (function () {
265
278
  translationKey = prefix + ".lookup_" + _this.toSnakeCase(_this.entity) + "_" + _this.toSnakeCase(fieldName);
266
279
  label = _this.translate.instant(translationKey);
267
280
  }
281
+ if ("searchOptions" in field) {
282
+ return new ErpLookupsFormField(field.searchOptions, __assign(__assign({}, field), { label: label }));
283
+ }
268
284
  return new FormField(__assign(__assign({}, field), { label: label }));
269
285
  });
270
286
  };
@@ -299,6 +315,26 @@ var ErpLookups = /** @class */ (function () {
299
315
  }).join(" and ");
300
316
  }
301
317
  };
318
+ ErpLookups.prototype.mountCustomFilter = function (_a) {
319
+ var erpLookupsSearchField = _a.erpLookupsSearchField, filterData = _a.filterData;
320
+ var searchOptions = erpLookupsSearchField.erpLookupsFormField, name = erpLookupsSearchField.name;
321
+ return searchOptions.customFilters
322
+ .map(function (_a) {
323
+ var operator = _a.operator, value = _a.value;
324
+ value = typeof value === "function" ? value({
325
+ value: filterData[name],
326
+ filterData: filterData,
327
+ }) : value;
328
+ if (operator === EnumLogicalOperator.Contains) {
329
+ return "containing(lower(" + name + "), lower('" + value + "'))";
330
+ }
331
+ if ((operator === EnumLogicalOperator.IsNot || operator === EnumLogicalOperator.Is) && !value) {
332
+ return name + " " + operator + " null";
333
+ }
334
+ return name + " " + operator + " '" + value + "'";
335
+ })
336
+ .join(" and ");
337
+ };
302
338
  ErpLookups.prototype.mountFilterQuery = function (value, lookupFields, defaultFilter, dynamicFilter) {
303
339
  var filterQuery;
304
340
  if (Number.isInteger(Number(value))) {
@@ -448,9 +484,15 @@ var ErpLookups = /** @class */ (function () {
448
484
  var name = _a.name;
449
485
  return filterData[name] != undefined && filterData[name] != "";
450
486
  })
451
- .map(function (_a) {
452
- var name = _a.name, type = _a.type, multiple = _a.multiple;
487
+ .map(function (formField) {
488
+ var _a = formField, name = _a.name, type = _a.type, multiple = _a.multiple, searchOptions = _a.erpLookupsFormField;
453
489
  var value = filterData[name];
490
+ if (searchOptions) {
491
+ return _this.mountCustomFilter({
492
+ erpLookupsSearchField: formField,
493
+ filterData: filterData,
494
+ });
495
+ }
454
496
  if (typeof value == "number")
455
497
  return name + " eq " + value;
456
498
  else if (type == FieldType.Date)
@@ -465,8 +507,7 @@ var ErpLookups = /** @class */ (function () {
465
507
  return "(containing(lower(" + name + "), lower('" + value + "')))";
466
508
  else if (type === FieldType.Lookup)
467
509
  return "(" + name + " eq '" + value.id + "')";
468
- else
469
- return name + " eq '" + value + "'";
510
+ return name + " eq '" + value + "'";
470
511
  })
471
512
  .join(" and ");
472
513
  if (options.entityDependency) {
@@ -7094,6 +7135,36 @@ var IndOperacaoFornecimentoLookup = /** @class */ (function (_super) {
7094
7135
  return IndOperacaoFornecimentoLookup;
7095
7136
  }(ErpLookups));
7096
7137
 
7138
+ var lookupFields$3 = [
7139
+ {
7140
+ name: "codigo",
7141
+ type: FieldType.String,
7142
+ },
7143
+ {
7144
+ name: "descricao",
7145
+ type: FieldType.String,
7146
+ },
7147
+ ];
7148
+ var searchFields$1 = __spread(lookupFields$3);
7149
+ var searchGridFields = __spread(lookupFields$3);
7150
+ var ListaServicoNacionalLookup = /** @class */ (function (_super) {
7151
+ __extends(ListaServicoNacionalLookup, _super);
7152
+ function ListaServicoNacionalLookup(lookupService, translate) {
7153
+ var _this = _super.call(this, lookupService, translate, "listaServicoNacional", lookupFields$3, searchFields$1, searchGridFields, "erpx_cpl_imp", "cadastros") || this;
7154
+ _this.lookupService = lookupService;
7155
+ _this.translate = translate;
7156
+ return _this;
7157
+ }
7158
+ ListaServicoNacionalLookup.ctorParameters = function () { return [
7159
+ { type: ErpLookupsService },
7160
+ { type: TranslateService }
7161
+ ]; };
7162
+ ListaServicoNacionalLookup = __decorate([
7163
+ Injectable()
7164
+ ], ListaServicoNacionalLookup);
7165
+ return ListaServicoNacionalLookup;
7166
+ }(ErpLookups));
7167
+
7097
7168
  var ErpLookupsModule = /** @class */ (function () {
7098
7169
  function ErpLookupsModule() {
7099
7170
  }
@@ -7225,6 +7296,7 @@ var ErpLookupsModule = /** @class */ (function () {
7225
7296
  OrigemMercadoriaLookup,
7226
7297
  E095HfoSupGerLookup,
7227
7298
  IndOperacaoFornecimentoLookup,
7299
+ ListaServicoNacionalLookup
7228
7300
  ],
7229
7301
  declarations: [],
7230
7302
  exports: [],
@@ -8670,5 +8742,5 @@ var ModulesEnum;
8670
8742
  * Generated bundle index. Do not edit.
8671
8743
  */
8672
8744
 
8673
- export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CaracteristicaFiscalLookup, ClassificacaoTributariaLookup, ComposicaoBaseCalculoLookup, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E006PaiLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E034TccLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E041CebLookup, E043MpcLookup, E043PcmLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E076MarLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfLookup, E095HfoSupGerLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpLookupsService, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, IndOperacaoFornecimentoLookup, LeiComplementar1162003Lookup, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NbsLookup, NcmLookup, NotaFiscalEntradaLookup, NpsService, OperacoesLookup, OrigemDestinoLookup, OrigemMercadoriaLookup, ParametersLookup, PrimitiveManager, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ɵ1, ɵ2, EnumAnaSin as ɵa, EnumNatCtb as ɵb, StorageService as ɵc, UserInformationService as ɵd, VerifyModulePermissionService as ɵe, VerifyModulePermissionsService as ɵf };
8745
+ export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CaracteristicaFiscalLookup, ClassificacaoTributariaLookup, ComposicaoBaseCalculoLookup, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E006PaiLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E034TccLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E041CebLookup, E043MpcLookup, E043PcmLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E076MarLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfLookup, E095HfoSupGerLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsFormField, ErpLookupsModule, ErpLookupsService, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, IndOperacaoFornecimentoLookup, LeiComplementar1162003Lookup, LigacaoItemFornecedorLookup, ListaServicoNacionalLookup, LookupValidationUtils, ModulesEnum, NbsLookup, NcmLookup, NotaFiscalEntradaLookup, NpsService, OperacoesLookup, OrigemDestinoLookup, OrigemMercadoriaLookup, ParametersLookup, PrimitiveManager, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ɵ1, ɵ2, EnumAnaSin as ɵa, EnumNatCtb as ɵb, StorageService as ɵc, UserInformationService as ɵd, VerifyModulePermissionService as ɵe, VerifyModulePermissionsService as ɵf };
8674
8746
  //# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map