From 2cca75f93c797a81d7deacea6da8c8e2f093d7fb Mon Sep 17 00:00:00 2001 From: tschug Date: Fri, 22 Nov 2024 22:29:58 -0500 Subject: [PATCH] Supported Extensions with Badges --- .../default/lwc/indicatorBundle/indicatorBundle.js | 12 ++++++++---- .../lwc/indicatorBundleBadge/indicatorBundleBadge.js | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/force-app/main/default/lwc/indicatorBundle/indicatorBundle.js b/force-app/main/default/lwc/indicatorBundle/indicatorBundle.js index 08f80e1..0aad55d 100644 --- a/force-app/main/default/lwc/indicatorBundle/indicatorBundle.js +++ b/force-app/main/default/lwc/indicatorBundle/indicatorBundle.js @@ -317,7 +317,9 @@ export default class IndicatorBundle extends LightningElement { "HoverValue" : extension.ExtensionHoverText, "Priority" : extension.PriorityOrder, "IconBackground" : extension.BackgroundColor, - "IconForeground" : extension.ForegroundColor + "IconForeground" : extension.ForegroundColor, + "BadgeTextColor" : extension.BadgeTextColor, + "BadgeIconPosition" : extension.BadgeIconPosition }; // However, if multiple matching is enabled, immediately assign the Extension for use in the Bundle. @@ -328,12 +330,14 @@ export default class IndicatorBundle extends LightningElement { fName: item.FieldApiName, fTextValue: dataValue, fImageURL: matchedExtension.ImageUrl, - fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : assignedHoverValue, + fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : dataValue, fShowAvatar: true, fIconName : matchedExtension.IconName, fIconBackground : matchedExtension.IconBackground, fIconForeground : matchedExtension.IconForeground, - fTextShown: matchedExtension.TextValue + fTextShown: matchedExtension.TextValue, + fTextColor: matchedExtension.BadgeTextColor, + fIconPosition: matchedExtension.BadgeIconPosition } ); } @@ -363,7 +367,7 @@ export default class IndicatorBundle extends LightningElement { }, // ! If value is false, the false hover will be set. ...dataValue || dataValue === 0 ? { - fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : assignedHoverValue + fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : dataValue } : { fHoverValue: item.DisplayFalse ? item.FalseHoverValue : '' }, diff --git a/force-app/main/default/lwc/indicatorBundleBadge/indicatorBundleBadge.js b/force-app/main/default/lwc/indicatorBundleBadge/indicatorBundleBadge.js index 3c46fab..753ed3c 100644 --- a/force-app/main/default/lwc/indicatorBundleBadge/indicatorBundleBadge.js +++ b/force-app/main/default/lwc/indicatorBundleBadge/indicatorBundleBadge.js @@ -27,10 +27,10 @@ export default class IndicatorBundleBadge extends LightningElement { if(this.indBackgroundColor || this.indForegroundColor || this.indTextColor){ var css = this.template.querySelector(".indicatorBadge").style; - - css.setProperty('--backgroundColor', this.indBackgroundColor); - css.setProperty('--foregroundColor', this.indForegroundColor); - css.setProperty('--textColor', this.indTextColor); + + css.setProperty('--backgroundColor', this.indBackgroundColor ? this.indBackgroundColor : '#f3f3f3'); + css.setProperty('--foregroundColor', this.indForegroundColor ? this.indForegroundColor : '#747474'); + css.setProperty('--textColor', this.indTextColor ? this.indText : '#181818'); } }