Created
September 13, 2018 12:18
-
-
Save Szandor72/0a069143de825e689b3b3d3d4b86bc54 to your computer and use it in GitHub Desktop.
A rough sketch how to make individual fields pretty in a flow using a lightning card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="lightning:availableForFlowScreens" access="global"> | |
<aura:attribute name="valueProvidedByFlow" type="String" /> | |
<aura:attribute name="labelForValue" type="String" /> | |
<aura:attribute name="type" type="String" description="currency, decimal, text supported"/> | |
<aura:attribute name="icon" type="String" default="standard:account" description="any icon from slds"/> | |
<lightning:card iconName="{!v.icon}" > | |
<aura:set attribute="title"> | |
{!v.labelForValue} | |
<aura:if isTrue="{!v.type == 'currency'}"> | |
<lightning:formattedNumber value="{!v.valueProvidedByFlow}" maximumFractionDigits="2" style="currency" class="slds-p-around_medium" /> | |
</aura:if> | |
<aura:if isTrue="{!v.type == 'decimal'}"> | |
<lightning:formattedNumber value="{!v.valueProvidedByFlow}" maximumFractionDigits="0" style="decimal" class="slds-p-around_medium" /> | |
</aura:if> | |
<aura:if isTrue="{!v.type == 'text'}"> | |
<lightning:formattedText value="{!v.valueProvidedByFlow}" class="slds-p-around_medium"/> | |
</aura:if> | |
</aura:set> | |
</lightning:card> | |
</aura:component> | |
<design:component > | |
<design:attribute name="valueProvidedByFlow" label="value" /> | |
<design:attribute name="labelForValue" label="title" /> | |
<design:attribute name="type" label="type"/> | |
<design:attribute name="icon" label="icon"/> | |
</design:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment