@senior-gestao-empresarial/angular-components 7.17.0 → 7.18.1-feature-erppeq-19475-ce290633

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.
@@ -752,10 +752,30 @@
752
752
  this.lookupService
753
753
  .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields }, this.entity, options.domain || this.domain, options.service || this.service)
754
754
  .pipe(operators.takeUntil(this.ngUnsubscribe))
755
- .pipe(operators.map(function (list) { return ({
756
- gridData: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.getItemLabel(item, prefix, lookupDisplayFields) })); }),
757
- totalRecords: list.totalElements
758
- }); }))
755
+ .pipe(operators.map(function (list) {
756
+ // Criar um mapa de campos com maxLength definido
757
+ var fieldsWithMaxLength = new Map();
758
+ __spread((options.searchFields || _this.searchFields), (options.searchGridFields || _this.searchGridFields)).forEach(function (field) {
759
+ if (field.maxLength &&
760
+ (field.type === angularComponents.FieldType.String || field.type === angularComponents.FieldType.Text)) {
761
+ fieldsWithMaxLength.set(field.name, field.maxLength);
762
+ }
763
+ });
764
+ return {
765
+ gridData: list.contents.map(function (item) {
766
+ var processedItem = JSON.parse(JSON.stringify(item));
767
+ // Aplicar maxLength nos campos que possuem a configuração
768
+ fieldsWithMaxLength.forEach(function (maxLength, fieldName) {
769
+ var fieldValue = _this.getNestedValue(processedItem, fieldName);
770
+ if (fieldValue && typeof fieldValue === 'string' && fieldValue.length > maxLength) {
771
+ _this.setNestedValue(processedItem, fieldName, fieldValue.substring(0, maxLength) + '...');
772
+ }
773
+ });
774
+ return __assign(__assign({}, processedItem), { label: _this.getItemLabel(processedItem, prefix, lookupDisplayFields) });
775
+ }),
776
+ totalRecords: list.totalElements
777
+ };
778
+ }))
759
779
  .subscribe(function (data) {
760
780
  _this.lookupSearchObservable.next(data);
761
781
  });
@@ -772,6 +792,21 @@
772
792
  })
773
793
  .join(" - ");
774
794
  };
795
+ ErpLookups.prototype.getNestedValue = function (obj, path) {
796
+ return path.split(".").reduce(function (current, key) {
797
+ return current && current[key] !== undefined ? current[key] : undefined;
798
+ }, obj);
799
+ };
800
+ ErpLookups.prototype.setNestedValue = function (obj, path, value) {
801
+ var keys = path.split(".");
802
+ var lastKey = keys.pop();
803
+ var target = keys.reduce(function (current, key) {
804
+ return current && current[key] !== undefined ? current[key] : undefined;
805
+ }, obj);
806
+ if (target && lastKey) {
807
+ target[lastKey] = value;
808
+ }
809
+ };
775
810
  ErpLookups.ctorParameters = function () { return [
776
811
  { type: ErpLookupsService },
777
812
  { type: core$1.TranslateService },
@@ -6762,6 +6797,7 @@
6762
6797
  EnumImpostoCadastro["VCBS"] = "VCBS";
6763
6798
  EnumImpostoCadastro["VIBS"] = "VIBS";
6764
6799
  EnumImpostoCadastro["VIS"] = "VIS";
6800
+ EnumImpostoCadastro["VCBS_IBS_CREDITO_PRESUMIDO"] = "VCBS_IBS_CREDITO_PRESUMIDO";
6765
6801
  })(EnumImpostoCadastro || (EnumImpostoCadastro = {}));
6766
6802
 
6767
6803
  var ComposicaoBaseCalculoLookup = /** @class */ (function (_super) {
@@ -6834,6 +6870,10 @@
6834
6870
  label: translate.instant("erpx_cpl_imp.impostos.enum_imposto_cadastro_vibs"),
6835
6871
  value: EnumImpostoCadastro.VIBS,
6836
6872
  },
6873
+ {
6874
+ label: translate.instant("erpx_cpl_imp.impostos.enum_imposto_cadastro_vcbs_ibs_credito_presumido"),
6875
+ value: EnumImpostoCadastro.VCBS_IBS_CREDITO_PRESUMIDO,
6876
+ },
6837
6877
  {
6838
6878
  label: translate.instant("erpx_cpl_imp.impostos.enum_imposto_cadastro_vis"),
6839
6879
  value: EnumImpostoCadastro.VIS,