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> | |
<aura:attribute name="title" type="String" /> | |
<div class="slds-section slds-is-open" | |
aura:id="collapsibleSectionContainer"> | |
<h3 class="slds-section__title slds-theme_shade"> | |
<!-- button state defaults to false so state | |
represents "is collapsed" | |
--> | |
<lightning:buttonStateful labelWhenOff="{! v.title }" |
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
({ | |
handleSectionHeaderClick : function(component, event, helper) { | |
var button = event.getSource(); | |
button.set('v.state', !button.get('v.state')); | |
var sectionContainer = component.find('collapsibleSectionContainer'); | |
$A.util.toggleClass(sectionContainer, "slds-is-open"); | |
} | |
}) |
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:attribute name="testBoolean" type="Boolean" default="false" /> | |
<lightning:input name="testBoolean" label="Test Boolean" type="checkbox" checked="{!v.testBoolean}" /> |
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
<!-- | |
I use this setup primarely on jsfiddle where I do not want to open chrome console while testing js code. | |
example: https://jsfiddle.net/wybmxgop/1/ | |
--> | |
<!-- a Mono-spaced font--> | |
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> | |
<style> | |
ul#console { | |
list-style-type: none; |
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
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Reis", | |
"url": "http://adam.reis.nz" | |
}, | |
"license": "UNLICENSED", |
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
import { LightningElement, track, wire, api } from 'lwc'; | |
export default class DynamicFields extends LightningElement { | |
@api recordId; | |
@track fields; | |
@api objectApiName; | |
@wire(getRecord, { recordId: '$recordId', fields: '$fields' }) | |
record; | |