Skip to content

Commit 72b562f

Browse files
committed
add buttonClass attribute
1 parent 42e1935 commit 72b562f

File tree

7 files changed

+44
-59
lines changed

7 files changed

+44
-59
lines changed

datasets/mapping.yml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1 @@
1-
Insert Accounts:
2-
sf_object: Account
3-
table: Account
4-
fields:
5-
Name: Name
6-
Description: Description
7-
BillingStreet: BillingStreet
8-
BillingCity: BillingCity
9-
BillingState: BillingState
10-
BillingPostalCode: BillingPostalCode
11-
BillingCountry: BillingCountry
12-
ShippingStreet: ShippingStreet
13-
ShippingCity: ShippingCity
14-
ShippingState: ShippingState
15-
ShippingPostalCode: ShippingPostalCode
16-
ShippingCountry: ShippingCountry
17-
Phone: Phone
18-
Fax: Fax
19-
Website: Website
20-
NumberOfEmployees: NumberOfEmployees
21-
AccountNumber: AccountNumber
22-
Site: Site
23-
Type: Type
24-
Insert Contacts:
25-
sf_object: Contact
26-
table: Contact
27-
fields:
28-
Salutation: Salutation
29-
FirstName: FirstName
30-
LastName: LastName
31-
Email: Email
32-
Phone: Phone
33-
MobilePhone: MobilePhone
34-
OtherPhone: OtherPhone
35-
HomePhone: HomePhone
36-
Title: Title
37-
Birthdate: Birthdate
38-
MailingStreet: MailingStreet
39-
MailingCity: MailingCity
40-
MailingState: MailingState
41-
MailingPostalCode: MailingPostalCode
42-
MailingCountry: MailingCountry
43-
lookups:
44-
AccountId:
45-
table: accounts
1+
{}

datasets/sample.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BEGIN TRANSACTION;
2+
COMMIT;

force-app/main/default/aura/RC_FlowButton/RC_FlowButton.cmp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<!-- component styling -->
66
<aura:attribute name="buttonLabel" type="String" access="global" default="Create Contact"/>
77
<aura:attribute name="variant" type="String" access="global" default="BRAND" description="BASE, NEUTRAL, BRAND, BRAND-OUTLINE, DESTRUCTIVE, DESTRUCTIVE-TEXT, INVERSE, and SUCCESS"/>
8-
<aura:attribute name="class" type="String" access="global" default="slds-size_12-of-12" description="css class"/>
8+
<aura:attribute name="class" type="String" access="global" default="slds-size_12-of-12" description="component css class. If this component launches an inline flow, this class will control the area that contains the flow."/>
99
<aura:attribute name="padding" type="String" access="global" default="10px 10px 10px 10px" description="style padding: top right bottom left"/>
1010
<aura:attribute name="horizontalAlign" type="String" access="global" default="" description="center, space, spread, end" />
11+
<aura:attribute name="buttonClass" type="String" access="global" default="" description="CSS class applied to the button (example: slds-align_absolute-center)"/>
1112

1213
<!-- component actions -->
1314
<aura:attribute name="flowToLaunch" type="String" access="global" description="Flow API Name. If empty, the button is used to fire the flow action."/>
@@ -36,8 +37,9 @@
3637

3738
<aura:if isTrue="{!v.showButton}">
3839
<lightning:button label="{!v.buttonLabel}"
39-
class="slds-size_12-of-12"
40-
variant="{!v.variant}" onclick="{!c.handleNavigation}"/>
40+
class="{!v.buttonClass}"
41+
variant="{!v.variant}"
42+
onclick="{!c.handleNavigation}"/>
4143
</aura:if>
4244

4345
<aura:if isTrue="{!v.showFlow}">

force-app/main/default/aura/RC_FlowButton/RC_FlowButton.design

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<!-- component styling -->
66
<design:attribute name="buttonLabel" label="Button Label" />
77
<design:attribute name="variant" label="Button Variant" description="BASE, NEUTRAL, BRAND, BRAND-OUTLINE, DESTRUCTIVE, DESTRUCTIVE-TEXT, INVERSE, and SUCCESS" />
8-
<design:attribute name="class" label="CSS class" description="default: slds-size_12-of-12" />
8+
<design:attribute name="class" label="Component CSS class" description="Component CSS class (default: slds-size_12-of-12). If this component launches an inline flow, this class will control the area that contains the flow. " />
99
<design:attribute name="padding" label="Style Padding" description="padding format: top right bottom left; default: 10px 10px 10px 10px" />
1010
<design:attribute name="horizontalAlign" label="Horizontal Align" description="center, space, spread, end"/>
11+
<design:attribute name="buttonClass" label="Button CSS class" description="CSS class applied to the button (example: slds-align_absolute-center)"/>
1112

1213
<!-- component actions -->
1314
<design:attribute name="flowToLaunch" label="Flow to Launch (API Name)" description="Flow API Name. If empty, the button is used to fire the flow action." />

force-app/main/default/aura/RC_FlowButtonApp/RC_FlowButtonApp.app

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,40 @@
88

99
<c:RC_FlowButton buttonLabel="Submit" variant="success" />
1010

11-
<p>Set CSS class. For example, control size with SLDS classes: slds-size_3-of-12</p>
11+
<p>Set padding around the button. For example, "50px 50px 50px 50px" (format: top right bottom left) </p>
1212

1313
<c:RC_FlowButton buttonLabel="Submit" variant="brand"
14-
class="slds-size_3-of-12"
14+
padding="50px 50px 50px 50px"
1515
buttonFlowAction="NEXT"
1616
/>
17-
18-
<p>Set padding around the button. For example, "50px 50px 50px 50px" (format: top right bottom left) </p>
17+
18+
<p>Set CSS for button to center it using SLDS class "slds-align_absolute-center slds-size_3-of-12"</p>
1919

2020
<c:RC_FlowButton buttonLabel="Submit" variant="brand"
21-
class="slds-size_6-of-12" padding="50px 50px 50px 50px"
21+
buttonClass="slds-align_absolute-center slds-size_3-of-12"
2222
buttonFlowAction="NEXT"
2323
/>
2424

25-
<p>Set horizontal alignment to center button.</p>
25+
<p>Set CSS for button to center it and size it using SLDS class "slds-align_absolute-center"</p>
2626

2727
<c:RC_FlowButton buttonLabel="Submit" variant="brand"
28-
padding="20px 100px 20px 100px"
29-
horizontalAlign="center"
28+
buttonClass="slds-align_absolute-center"
29+
buttonFlowAction="NEXT"
30+
/>
31+
32+
<p>Set CSS for button to position to the right using SLDS class "slds-float_right"</p>
33+
34+
<c:RC_FlowButton buttonLabel="Submit" variant="brand"
35+
buttonClass="slds-float_right"
36+
buttonFlowAction="NEXT"
37+
/>
38+
39+
<p>Set CSS for button to make it fill the width of the component width: "slds-size_12-of-12"</p>
40+
41+
<c:RC_FlowButton buttonLabel="Submit" variant="brand"
42+
buttonClass="slds-size_12-of-12"
3043
buttonFlowAction="NEXT"
3144
/>
32-
3345

3446
<p>Launch Flow Inline</p>
3547

force-app/main/default/flexipages/RC_Account_Record_Page.flexipage-meta.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
</flexiPageRegions>
5959
<flexiPageRegions>
6060
<componentInstances>
61+
<componentInstanceProperties>
62+
<name>buttonClass</name>
63+
<value>slds-size_12-of-12</value>
64+
</componentInstanceProperties>
6165
<componentInstanceProperties>
6266
<name>buttonClicked</name>
6367
<value>false</value>
@@ -99,7 +103,7 @@
99103
</componentInstanceProperties>
100104
<componentInstanceProperties>
101105
<name>variant</name>
102-
<value>brand</value>
106+
<value>BRAND</value>
103107
</componentInstanceProperties>
104108
<componentName>RC_FlowButton</componentName>
105109
</componentInstances>

force-app/main/default/flexipages/Test_Flow_Button.flexipage-meta.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<componentName>flexipage:richText</componentName>
1414
</componentInstances>
1515
<componentInstances>
16+
<componentInstanceProperties>
17+
<name>buttonClass</name>
18+
<value>slds-size_6-of-12</value>
19+
</componentInstanceProperties>
1620
<componentInstanceProperties>
1721
<name>buttonClicked</name>
1822
<value>false</value>
@@ -71,6 +75,10 @@
7175
<componentName>flexipage:richText</componentName>
7276
</componentInstances>
7377
<componentInstances>
78+
<componentInstanceProperties>
79+
<name>buttonClass</name>
80+
<value>slds-size_12-of-12</value>
81+
</componentInstanceProperties>
7482
<componentInstanceProperties>
7583
<name>buttonClicked</name>
7684
<value>false</value>

0 commit comments

Comments
 (0)