Skip to content
Permalink
Browse files

Added support for helpText attribute

  • Loading branch information
trentchilders committed Mar 1, 2017
1 parent 3f93f7d commit 895e598763ec6f0225afee55d397a634309a087e
@@ -1,5 +1,5 @@
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
<ltng:require scripts="/resource/d3/d3.js" afterScriptsLoaded="{!c.onInit}"/>
<ltng:require scripts="/resource/d3" afterScriptsLoaded="{!c.onInit}"/>
<aura:attribute name="scriptsLoaded" type="Boolean" default="{!false}"/>

<aura:attribute name="chartRendered" type="Boolean" default="{!false}" description="Flag to display the loading spinner."/>
@@ -1,5 +1,6 @@
<aura:component >
<aura:attribute name="title" type="String"/>
<aura:attribute name="title" type="String" required="true"/>

<aura:attribute name="primaryButtonLabel" type="String" default="Ok"/>
<aura:attribute name="secondaryButtonLabel" type="String" default="Cancel"/>
<aura:attribute name="variant" type="String"/>
@@ -10,6 +10,7 @@
<aura:attribute name="disabled" type="Boolean" description="Can be toggled to make the field disabled"/>
<aura:attribute name="required" type="Boolean" description="displays an * indicating that the field is required"/>
<aura:attribute name="error" type="Boolean" description="Specifies whether or not the text area is in an error state. This will trigger errorMessage"/>
<aura:attribute name="helpText" type="String" description="Specifies helper text to be displayed as a tooltip"/>

<!-- Methods -->
<aura:method name="showError" action="{!c.showError}" description="A method which triggers the error state">
@@ -23,9 +24,11 @@
<aura:attribute name="menuIsOpen" type="Boolean" access="private" description="toggles the slds-is-open class for the lookup menu"/>
<aura:attribute name="selectedOptionPills" type="Object[]" access="private" description="pills to be populated when an option is selected from the dropdown"/>
<aura:attribute name="validChildCmps" type="Object[]" access="private" description="stores valid child components to utilize when an iterator is used"/>

<aura:attribute name="alreadyRendered" type="Boolean" access="private" description="is set to true after the initial render"/>

<!-- Event registration and handlers -->
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<aura:handler event="aura:doneRendering" action="{!c.handleDoneRendering}"/>
<aura:handler name="strike_evt_notifyParent" event="c:strike_evt_notifyParent" action="{!c.handleNotifyParent}" includeFacets="true" description="handles when a StrikeOption is clicked"/>
<aura:handler name="strike_evt_componentDestroyed" event="c:strike_evt_componentDestroyed" action="{!c.handleComponentDestroyed}" includeFacets="true" description="handles when a StrikeOption is clicked"/>

@@ -36,7 +39,13 @@
<abbr class="slds-required" title="required">*</abbr>
</aura:if>
{!v.label}
<aura:if isTrue="{!and(v.helpText, v.helpText != '')}">
<c:strike_tooltip placement="top" text="{!v.helpText}" class="slds-m-left--xx-small">
<lightning:icon iconName="utility:info" size="xx-small"/>
</c:strike_tooltip>
</aura:if>
</label>

<div class="{!'slds-form-element__control' + if(v.error, ' slds-has-error', '')}">
<div class="slds-input-has-icon slds-input-has-icon--right">
<lightning:icon iconName="utility:search" class="slds-input__icon" size="x-small"/>
@@ -59,7 +68,7 @@
<div class="slds-form-element__help">{!v.errorMessage}</div>
</aura:if>
</div>

<div class="slds-lookup__menu">
<ul class="slds-lookup__list" role="listbox">
{!v.body}
@@ -18,6 +18,18 @@
var randomNumber = Math.floor(1000 + Math.random() * 9000);

component.set('v.idNumber', randomNumber);

},
handleDoneRendering: function(component,event,helper){
var value = component.get('v.value');
var alreadyRendered = component.get('v.alreadyRendered');

if(!alreadyRendered){
if(value){
helper.handleValueOnInit(component,event,helper);
}
}
component.set('v.alreadyRendered', true);
},
handleOnfocus: function(component, event, helper) {
event.stopPropagation();
@@ -290,4 +290,30 @@
}
})
},
handleValueOnInit: function(component,event,helper){

var value = component.get('v.value');

var valueArray = value.split(';');

var body = component.get('v.body');
var childCmps;
body.forEach(function(child){
if($A.util.isUndefined(child.strike_filterBy)){

childCmps = child.get('v.body');
} else {
childCmps = body;
}
});

childCmps.forEach(function(child){
var childValue = child.get('v.value');

if(valueArray.indexOf(childValue) != -1){
child.strike_optionSelected();
}
})

}
})

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,6 +1,7 @@
<aura:component access="global">
<aura:attribute name="label" type="String" required="true" description="String value displayed above the menu used to describe the component" />

<aura:attribute name="helpText" type="String" description="String value when hovering over the help box"/>
<aura:attribute name="placeholder" type="String" default="Select an Option" description="String value that will appear when no option is selected" />
<aura:attribute name="value" type="String" description="String value of the value of the selected option" />

@@ -39,6 +40,11 @@
<abbr class="slds-required" title="required">*</abbr>
</aura:if>
{!v.label}
<aura:if isTrue="{!not(empty(v.helpText))}">
<c:strike_tooltip placement="top" text="{!v.helpText}" class="slds-m-left--xx-small">
<lightning:icon iconName="utility:info" size="xx-small"/>
</c:strike_tooltip>
</aura:if>
</label>
<div aura:id="dropdown-trigger" class="{!'slds-picklist slds-dropdown-trigger slds-dropdown-trigger--click' + if(v.openMenu, ' slds-is-open', '') + if(v.disabled, ' ss-disabled', '')}" aria-expanded="true">
<div class="slds-form-element__control">
@@ -2,6 +2,7 @@
<!-- Required -->
<aura:attribute name="label" type="String" required="true" description="Text that describes the desired textarea input" default="Strike TextArea"/>

<aura:attribute name="helpText" type="String" description="String value when hovering over the help box"/>
<aura:attribute name="name" type="String" description="Specifies the name of an input element" default="Strike TextArea"/>
<aura:attribute name="class" type="String" description="A CSS class that will be applied to the outer element. This style is in addition to base classes associated with the component"/>
<aura:attribute name="placeholder" type="String" description="Text that is displayed when the field is empty, to prompt the user for a valid entry"/>
@@ -33,6 +34,11 @@
<abbr class="slds-required" title="required">*</abbr>
</aura:if>
{!v.label}
<aura:if isTrue="{!not(empty(v.helpText))}">
<c:strike_tooltip placement="top" text="{!v.helpText}" class="slds-m-left--xx-small">
<lightning:icon iconName="utility:info" size="xx-small"/>
</c:strike_tooltip>
</aura:if>
</label>
<div class="slds-form-element__control">
<textarea aura:id="thisTextArea"
@@ -1,19 +1,16 @@
({
setHeight : function(component, event, helper) {
setHeight: function(component, event, helper) {
var height = component.get('v.height');
var size = component.get('v.size');

if (size !== '' || size !== null) {
if (size == 'small') {
component.set('v.height', "56px");
} else if (size == 'medium') {
component.set('v.height', "72px");
} else if (size == 'large') {

component.set('v.height', "210px");
}
if (size == 'small') {
component.set('v.height', '56px');
} else if (size == 'medium') {
component.set('v.height', '72px');
} else if (size == 'large') {
component.set('v.height', '210px');
} else {
component.set('v.height', height);
}
}
}
})
@@ -2,7 +2,6 @@ public with sharing class strike_lookupController {
@AuraEnabled
public static String getRecentRecords(String jsonString) {
strike_responseData responseData = new strike_responseData();


try {
Map<String, Object> jsonMap = (Map<String, Object>)JSON.deserializeUntyped(jsonString);
BIN -19.5 KB (91%) staticresources/d3.resource
Binary file not shown.
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
<cacheControl>Public</cacheControl>
<contentType>application/zip</contentType>
<contentType>text/javascript</contentType>
<description>4.2.6</description>
</StaticResource>

0 comments on commit 895e598

Please sign in to comment.
You can’t perform that action at this time.