@senior-gestao-empresarial/angular-components 7.18.0 → 7.18.1
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 +19 -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 +2 -0
- package/esm2015/components/lookups/erp-lookups.js +20 -5
- package/esm5/components/lookups/erp-lookups.js +20 -5
- package/fesm2015/senior-gestao-empresarial-angular-components.js +19 -4
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +19 -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
|
@@ -525,12 +525,12 @@ class ErpLookups {
|
|
|
525
525
|
});
|
|
526
526
|
return {
|
|
527
527
|
gridData: list.contents.map((item) => {
|
|
528
|
-
const processedItem =
|
|
528
|
+
const processedItem = JSON.parse(JSON.stringify(item));
|
|
529
529
|
// Aplicar maxLength nos campos que possuem a configuração
|
|
530
530
|
fieldsWithMaxLength.forEach((maxLength, fieldName) => {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
processedItem
|
|
531
|
+
const fieldValue = this.getNestedValue(processedItem, fieldName);
|
|
532
|
+
if (fieldValue && typeof fieldValue === 'string' && fieldValue.length > maxLength) {
|
|
533
|
+
this.setNestedValue(processedItem, fieldName, fieldValue.substring(0, maxLength) + '...');
|
|
534
534
|
}
|
|
535
535
|
});
|
|
536
536
|
return Object.assign(Object.assign({}, processedItem), { label: this.getItemLabel(processedItem, prefix, lookupDisplayFields) });
|
|
@@ -553,6 +553,21 @@ class ErpLookups {
|
|
|
553
553
|
})
|
|
554
554
|
.join(" - ");
|
|
555
555
|
}
|
|
556
|
+
getNestedValue(obj, path) {
|
|
557
|
+
return path.split(".").reduce((current, key) => {
|
|
558
|
+
return current && current[key] !== undefined ? current[key] : undefined;
|
|
559
|
+
}, obj);
|
|
560
|
+
}
|
|
561
|
+
setNestedValue(obj, path, value) {
|
|
562
|
+
const keys = path.split(".");
|
|
563
|
+
const lastKey = keys.pop();
|
|
564
|
+
const target = keys.reduce((current, key) => {
|
|
565
|
+
return current && current[key] !== undefined ? current[key] : undefined;
|
|
566
|
+
}, obj);
|
|
567
|
+
if (target && lastKey) {
|
|
568
|
+
target[lastKey] = value;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
556
571
|
};
|
|
557
572
|
ErpLookups.ctorParameters = () => [
|
|
558
573
|
{ type: ErpLookupsService },
|