npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-multi-single-dropdown

v2.1.7

Published

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

Downloads

7

Readme

angular-multi-single-select-dropdown

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

Getting Started

Features

  • dropdown with single/multiple selction option
  • bind to any custom data source
  • search filter for searching list of data
  • show or hide select all/deselect All button
  • select/de-select all items
  • textKey of array, example- name: 'santosh', here name is the text key
  • valueKey of array, example- name: 'santosh', here name is the value key
  • itemsShowLimit in select button
  • addCssClass, add css class in multi-select-dropdown
  • multi-select-dropdown custom placeholder
  • multi-select-dropdown custom change close button name
  • multi-select-dropdown custom change select-all/de-select-all button name
  • custom search filter placeholder

Installation

npm i angular-multi-single-dropdown


```ts
import { multiSingleDropDownModule } from 'angular-multi-single-dropdown';
// ...

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

Usage

import { Component, OnInit } from '@angular/core';

export class AppComponent implements OnInit {
  userArray: any[] = [];
  selectedItems = [];
  options: object;
  
  ngOnInit () {
    this.userArray = [{ name: 'santosh', id: 1 },
    { name: 'nitin', id: 2 },
    { name: 'riya', id: 3 },
    { name: 'rishi', id: 4 },
	{ name: 'muskan', id: 5 },
	{ name: 'nandini', id: 6 }, 
    { name: 'krishna', id: 7 }]; // in array, Id is optional
  
  this.options = {
      allowSearchFilter: true,  // boolean option if user want to show or hide search box in drop-down
      isSelect: true,  // option if user want to show or hide selectAll/DeSelectAll button in drop-down
      isMultiSelectOrSingleSelect: true,  // if set true then you can use Multi-select drop-down else you can use single select drop-down
      textKey: 'name',  // this is the text-Key of your array, example- name: 'santosh', here name is the text key
      valueKey: 'name',  // this is the value-Key of your array, example- name: 'santosh' or id: 1
      array: this.userArray,  // This is User Array
      itemsShowLimit: 3,  // option if user want to show minimum 3 selected data in drop-down button
      addCssClass: '',  // By using this user can add CSS class in drop-down
      texts: {
        selectPlaceHolder: '',  // This is placeholder of drop-down, if user set empty then default placeholder will be showed
        closeButtonName: '',  // user can change close button name by passing name, default it set close
        selectAllButtonName: 'Select All',  // user can change or edit select All button name
        unSelectAllButtonName: 'UnSelect All',  // user can change or edit Unselect All button name
        searchPlaceHolder: 'Search drop-down items' // user can change or edit search placehoder
      },
      disableDropdown: false // disable dropdown
    };
  }
  
  

     onItemSelect(event): void {
      this.selectedItems = event;  // getArrayData is your selected checkbox data array
      console.log(this.selectedItems);
  }
	
}
<ng-multi-select-dropdown [option] = options 
                          (messageEvent)='onItemSelect($event)'>
</ng-multi-select-dropdown>

options


| options | Type | Description | Default Value | | :----------------------- | :--------- | :----------------------------------------------------------------------------------------------------------- | :-------------------------| | allowSearchFilter | Boolean | If set true then search filter will be show in multi-select-dropdown else hide. | true |
| isSelect | Boolean | if you want to show or hide selectAll/DeSelectAll button in drop-down. | true |
| isMultiSelectOrSingleSelect| Boolean | if set true then you can use Multi-select drop-down else you can use single select drop-down | true |
| textKey | String | this is the text-Key of your array, example- name: 'santosh', here name is the text key | 'name' | | valueKey | String | this is the value-Key of your array, example- name: 'santosh' or id: 1 | 'name' |
| array | Array | This is User Array | user Array |
| itemsShowLimit | Number | Limit the number of items to show in the input select button. If not set will show number of selected. | 3 |
| addCssClass | String | By using this user can add CSS class in drop-down | '' |
| selectPlaceHolder | String | This is placeholder of drop-down, if you set empty then default placeholder will be showed | '' |
| closeButtonName | String | user can change close button name by passing name, default it set close. | '' |
| selectAllButtonName | String | user can change or edit select All button name | 'Select All' |
| unSelectAllButtonName | String | user can change or edit Unselect All button name | 'UnSelect All' |
| searchPlaceHolder | String | user can change or edit search placehoder. | 'Search drop-down items' | | disableDropdown | boolean | disable dropdown checkbox | false |

Callback Methods

  • messageEvent - Return the selected item when an item is checked. Example : (messageEvent)="onItemSelect($event)"

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.

Development

This project was generated with Angular CLI version 6.0.8.

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.