@senior-gestao-empresarial/angular-components 7.17.0 → 7.18.0
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.
- package/bundles/senior-gestao-empresarial-angular-components.umd.js +24 -4
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/lookups/erp-lookups.d.ts +5 -2
- package/esm2015/components/lookups/erp-lookups.js +26 -5
- package/esm5/components/lookups/erp-lookups.js +25 -5
- package/fesm2015/senior-gestao-empresarial-angular-components.js +25 -4
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +24 -4
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -513,10 +513,31 @@ class ErpLookups {
|
|
|
513
513
|
this.lookupService
|
|
514
514
|
.list({ page, sort, filterQuery, displayFields }, this.entity, options.domain || this.domain, options.service || this.service)
|
|
515
515
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
516
|
-
.pipe(map((list) =>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
516
|
+
.pipe(map((list) => {
|
|
517
|
+
// Criar um mapa de campos com maxLength definido
|
|
518
|
+
const fieldsWithMaxLength = new Map();
|
|
519
|
+
[...(options.searchFields || this.searchFields), ...(options.searchGridFields || this.searchGridFields)]
|
|
520
|
+
.forEach((field) => {
|
|
521
|
+
if (field.maxLength &&
|
|
522
|
+
(field.type === FieldType.String || field.type === FieldType.Text)) {
|
|
523
|
+
fieldsWithMaxLength.set(field.name, field.maxLength);
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
return {
|
|
527
|
+
gridData: list.contents.map((item) => {
|
|
528
|
+
const processedItem = Object.assign({}, item);
|
|
529
|
+
// Aplicar maxLength nos campos que possuem a configuração
|
|
530
|
+
fieldsWithMaxLength.forEach((maxLength, fieldName) => {
|
|
531
|
+
if (processedItem[fieldName] && typeof processedItem[fieldName] === 'string'
|
|
532
|
+
&& processedItem[fieldName].length > maxLength) {
|
|
533
|
+
processedItem[fieldName] = processedItem[fieldName].substring(0, maxLength) + '...';
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
return Object.assign(Object.assign({}, processedItem), { label: this.getItemLabel(processedItem, prefix, lookupDisplayFields) });
|
|
537
|
+
}),
|
|
538
|
+
totalRecords: list.totalElements
|
|
539
|
+
};
|
|
540
|
+
}))
|
|
520
541
|
.subscribe((data) => {
|
|
521
542
|
this.lookupSearchObservable.next(data);
|
|
522
543
|
});
|