@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
|
@@ -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) {
|
|
756
|
-
|
|
757
|
-
|
|
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 = __assign({}, item);
|
|
767
|
+
// Aplicar maxLength nos campos que possuem a configuração
|
|
768
|
+
fieldsWithMaxLength.forEach(function (maxLength, fieldName) {
|
|
769
|
+
if (processedItem[fieldName] && typeof processedItem[fieldName] === 'string'
|
|
770
|
+
&& processedItem[fieldName].length > maxLength) {
|
|
771
|
+
processedItem[fieldName] = processedItem[fieldName].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
|
});
|