Giter VIP home page Giter VIP logo

aura-picklist's Introduction

Aura Picklist

Build and Deploy to Scratch Org CodeQL

Picklist is a Salesforce lightning aura component which let's you create single-select and multi-select picklist from a single component.

Demo

Single select picklist:


Multi select picklist:

Installation

Deploy to Production/Sandbox: Deploy to Salesforce

Deploy to Scratch org: Deploy

Screenshot(s)

Sample Code

Single Select cmp code:

<c:Picklist options="{!v.options}" label="{!v.label}" variant="label-stacked" onChange="{!c.handleOnChange}" />

Multi Select cmp code:

<c:Picklist options="{!v.options}" label="{!v.label}" variant="label-stacked" multiple="true" allOption="true" onChange="{!c.handleOnChange}" />

Controller code to handle the change event:

handleOnChange: function (component, event, helper) {
   console.log(event.getParam('selectedValues'));
}

API Specifications

Attributes

NAME TYPE REQUIRED DEFAULT DESCRIPTION
label String ✔️ Text label for the picklist.
placeholder String Select an Option Text that is displayed before an option is selected, to prompt the user to select an option.
options Object[] ✔️ A list of options that are available for selection. Each option has the following attributes: label and value.
selectedValues String[] This stores the list of all the selected option's value.
variant String The variant changes the appearance of an input field. Accepted variants include label-inline, label-hidden, and label-stacked. This value defaults to label-stacked, which displays the label above the field. Use label-hidden to hide the label but make it available to assistive technology. Use label-inline to horizontally align the label and input field.
multiple Boolean false This will handle the multi-select functionality. If true, multi-select will be enabled.
allOption Boolean true If true, 'All' option will be provided in multi-select picklist.
onChange action The action triggered when the value is changed. The event will have an 'selectedValues' param which contains all the selected option's value. In case of single-select only one value will be there in the array.

Contributing to Aura Picklist

To contribute follow these steps:

  1. Fork this repository.
  2. Create a branch with your username: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push the changes to your forked branch: git push origin <branch_name>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

License

This project is MIT licensed, as found in LICENSE.md file.

aura-picklist's People

Contributors

dependabot[bot] avatar hemendrarajawat avatar

Watchers

 avatar  avatar

aura-picklist's Issues

Implement multi-select functionality

Let's user select multiple options. Use the 'multiple' attribute to handle this.

Also, add 'allOption' attribute to provide an 'All' option which will select and de-select all the options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.