All Projects → NileshPatel17 → Ng Multiselect Dropdown

NileshPatel17 / Ng Multiselect Dropdown

Multiple Select Dropdown Component

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ng Multiselect Dropdown

react-picky
Yet another React multiselect. With checkbox support instead of tags.
Stars: ✭ 78 (-60.8%)
Mutual labels:  multiselect, dropdown
React Selectrix
A beautiful, materialized and flexible React Select control
Stars: ✭ 166 (-16.58%)
Mutual labels:  dropdown, multiselect
Angular2 Multiselect Dropdown
Angular 2 Dropdown Multiselect
Stars: ✭ 225 (+13.07%)
Mutual labels:  dropdown, multiselect
Multiselect
Vue 3 multiselect component with single select, multiselect and tagging options.
Stars: ✭ 92 (-53.77%)
Mutual labels:  dropdown, multiselect
Nb Choices
Angular wrapper for choices.js, vanilla, lightweight, configurable select box/text input plugin
Stars: ✭ 32 (-83.92%)
Mutual labels:  dropdown, multiselect
multiselect
Angular Multiselect
Stars: ✭ 29 (-85.43%)
Mutual labels:  multiselect, dropdown
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+1297.49%)
Mutual labels:  dropdown, multiselect
react-multi-select-component
Lightweight (~5KB gzipped) multiple selection dropdown component
Stars: ✭ 279 (+40.2%)
Mutual labels:  multiselect, dropdown
Ngx Select Dropdown
Custom Dropdown for Angular 4+ with multiple and single selection options
Stars: ✭ 91 (-54.27%)
Mutual labels:  dropdown, multiselect
Downshift
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.
Stars: ✭ 10,183 (+5017.09%)
Mutual labels:  dropdown, multiselect
Bootstrap Dropdown Hover
Bootstrap based responsive mulltilevel dropdown navigation menu with fascinating animations
Stars: ✭ 115 (-42.21%)
Mutual labels:  dropdown
React Select Me
Fast 🐆. Lightweight 🐜. Configurable 🐙. Easy to use 🦄. Give it a shot 👉🏼
Stars: ✭ 119 (-40.2%)
Mutual labels:  dropdown
V Tooltip
💬 Easy tooltips, popovers, dropdown for Vue
Stars: ✭ 2,109 (+959.8%)
Mutual labels:  dropdown
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (-10.05%)
Mutual labels:  dropdown
React Multi Select
A Multi Select component built with and for React
Stars: ✭ 111 (-44.22%)
Mutual labels:  multiselect
React Layer Stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 152 (-23.62%)
Mutual labels:  dropdown
Custom Reactjs Dropdown Components
Custom dropdown components for ReactJS
Stars: ✭ 110 (-44.72%)
Mutual labels:  dropdown
Smartmaterialspinner
The powerful android spinner library for your application
Stars: ✭ 108 (-45.73%)
Mutual labels:  dropdown
Multiselectpopwindow
链式多选弹窗,轻松集成
Stars: ✭ 152 (-23.62%)
Mutual labels:  multiselect
Materialspinner
Implementation of a Material Spinner for Android with TextInputLayout functionalities
Stars: ✭ 107 (-46.23%)
Mutual labels:  dropdown

Angular Multiselect Dropdown

All Contributors

npm version downloads downloads

Angular multiselect dropdown component for web applications. Easy to integrate and use. It can be bind to any custom data source.

Demo

demo

Getting Started

Features

  • dropdown with single/multiple selction option
  • bind to any custom data source
  • search item with custom placeholder text
  • limit selection
  • select/de-select all items
  • custom theme

Installation

npm install ng-multiselect-dropdown

And then include it in your module (see app.module.ts):

import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
// ...

@NgModule({
  imports: [
    NgMultiSelectDropDownModule.forRoot()
    // ...
  ]
  // ...
})
export class AppModule {}

Usage

import { Component, OnInit } from '@angular/core';
import { IDropdownSettings } from 'ng-multiselect-dropdown';

export class AppComponent implements OnInit {
  dropdownList = [];
  selectedItems = [];
  dropdownSettings = {};
  ngOnInit() {
    this.dropdownList = [
      { item_id: 1, item_text: 'Mumbai' },
      { item_id: 2, item_text: 'Bangaluru' },
      { item_id: 3, item_text: 'Pune' },
      { item_id: 4, item_text: 'Navsari' },
      { item_id: 5, item_text: 'New Delhi' }
    ];
    this.selectedItems = [
      { item_id: 3, item_text: 'Pune' },
      { item_id: 4, item_text: 'Navsari' }
    ];
    this.dropdownSettings:IDropdownSettings = {
      singleSelection: false,
      idField: 'item_id',
      textField: 'item_text',
      selectAllText: 'Select All',
      unSelectAllText: 'UnSelect All',
      itemsShowLimit: 3,
      allowSearchFilter: true
    };
  }
  onItemSelect(item: any) {
    console.log(item);
  }
  onSelectAll(items: any) {
    console.log(items);
  }
}
<ng-multiselect-dropdown
  [placeholder]="'custom placeholder'"
  [settings]="dropdownSettings"
  [data]="dropdownList"
  [(ngModel)]="selectedItems"
  (onSelect)="onItemSelect($event)"
  (onSelectAll)="onSelectAll($event)"
>
</ng-multiselect-dropdown>

Settings

Setting Type Description Default Value
singleSelection Boolean Mode of this component. If set true user can select more than one option. false
placeholder String Text to be show in the dropdown, when no items are selected. 'Select'
disabled Boolean Disable the dropdown false
data Array Array of items from which to select. Should be an array of objects with id and text properties. You can also use custom properties. In that case you need to map idField and textField properties. As convenience, you may also pass an array of strings, in which case the same string is used for both the ID and the text(no mapping is required) n/a
idField String map id field in case of custom array of object 'id'
textField String map text field in case of custom array of object 'text'
enableCheckAll Boolean Enable the option to select all items in list false
selectAllText String Text to display as the label of select all option Select All
unSelectAllText String Text to display as the label of unSelect option UnSelect All
allowSearchFilter Boolean Enable filter option for the list. false
searchPlaceholderText String custom search placeholder Search
clearSearchFilter Boolean clear search filter on dropdown close true
maxHeight Number Set maximum height of the dropdown list in px. 197
itemsShowLimit Number Limit the number of items to show in the input field. If not set will show all selected. All
limitSelection Number Limit the selection of number of items from the dropdown list. Once the limit is reached, all unselected items gets disabled. none
searchPlaceholderText String Custom text for the search placeholder text. Default value would be 'Search' 'Search'
noDataAvailablePlaceholderText String Custom text when no data is available. 'No data available'
closeDropDownOnSelection Boolean Closes the dropdown when item is selected. applicable only in cas of single selection false
defaultOpen Boolean open state of dropdown false
allowRemoteDataSearch Boolean allow search remote api if no data is present. false

Callback Methods

  • onSelect - Return the selected item when an item is checked. Example : (onSelect)="onItemSelect($event)"
  • onSelectAll - Return the all items. Example : (onSelectAll)="onSelectAll($event)".
  • onDeSelect - Return the unselected item when an item is unchecked. Example : (onDeSelect)="onItemDeSelect($event)"
  • onFilterChange - Return the key press. Example : (onFilterChange)="onFilterChange($event)"
  • onDropDownClose- Example : (onDropDownClose)="onDropDownClose()"

Custom Theme

  • The component package has a themes folder in node_modules at ng-multiselet-dropdown\themes\ng-multiselect-dropdown.theme.scss
  • Include the ng-multiselet-dropdown.theme.css in angular-cli.json (for versions below angular 6) and angular.json (for version 6 or more).
  • Refer this file on how to add the css file to your angular project.

Custom Template(in beta):

Variables can be used in template

  1. id: return id as number
  2. option: return option text. return string
  3. isSelected: determine if item is selected or not. returns boolean

Template for each item

<ng-template #optionsTemplate let-item let-option="option" let-id="id" let-isSelected="isSelected">
  {{option}}
</ng-template>

Template for selected item

<ng-template #optionSelectedTemplate optionSelectedTemplate let-option="option"  let-id="id">
  {{option}}
</ng-template>

Demo

Run locally

  • Clone the repository or downlod the .zip,.tar files.
  • Run npm install
  • Run ng serve for a dev server
  • Navigate to http://localhost:4200/

Library Build / NPM Package

Run yarn build:lib to build the library and generate an NPM package. The build artifacts will be stored in the dist-lib/ folder.

Running unit tests

Run yarn test to execute the unit tests.

Development

This project was generated with Angular CLI version 1.7.1.

Contributions

Contributions are welcome, please open an issue and preferrably file a pull request.

Opening Issue

Please share sample code using codesandbox.com or stackblitz.com to help me re-produce the issue.

License

MIT License.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Tom Saleeba

💻

Simon Pinfold

💻

Sushil Suthar

💻

Sachin Grover

💻

Mike Roberts

💻

David Sosa

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].