@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
|
@@ -557,12 +557,12 @@ var ErpLookups = /** @class */ (function () {
|
|
|
557
557
|
});
|
|
558
558
|
return {
|
|
559
559
|
gridData: list.contents.map(function (item) {
|
|
560
|
-
var processedItem =
|
|
560
|
+
var processedItem = JSON.parse(JSON.stringify(item));
|
|
561
561
|
// Aplicar maxLength nos campos que possuem a configuração
|
|
562
562
|
fieldsWithMaxLength.forEach(function (maxLength, fieldName) {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
processedItem
|
|
563
|
+
var fieldValue = _this.getNestedValue(processedItem, fieldName);
|
|
564
|
+
if (fieldValue && typeof fieldValue === 'string' && fieldValue.length > maxLength) {
|
|
565
|
+
_this.setNestedValue(processedItem, fieldName, fieldValue.substring(0, maxLength) + '...');
|
|
566
566
|
}
|
|
567
567
|
});
|
|
568
568
|
return __assign(__assign({}, processedItem), { label: _this.getItemLabel(processedItem, prefix, lookupDisplayFields) });
|
|
@@ -586,6 +586,21 @@ var ErpLookups = /** @class */ (function () {
|
|
|
586
586
|
})
|
|
587
587
|
.join(" - ");
|
|
588
588
|
};
|
|
589
|
+
ErpLookups.prototype.getNestedValue = function (obj, path) {
|
|
590
|
+
return path.split(".").reduce(function (current, key) {
|
|
591
|
+
return current && current[key] !== undefined ? current[key] : undefined;
|
|
592
|
+
}, obj);
|
|
593
|
+
};
|
|
594
|
+
ErpLookups.prototype.setNestedValue = function (obj, path, value) {
|
|
595
|
+
var keys = path.split(".");
|
|
596
|
+
var lastKey = keys.pop();
|
|
597
|
+
var target = keys.reduce(function (current, key) {
|
|
598
|
+
return current && current[key] !== undefined ? current[key] : undefined;
|
|
599
|
+
}, obj);
|
|
600
|
+
if (target && lastKey) {
|
|
601
|
+
target[lastKey] = value;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
589
604
|
ErpLookups.ctorParameters = function () { return [
|
|
590
605
|
{ type: ErpLookupsService },
|
|
591
606
|
{ type: TranslateService },
|