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

tb-multi-select-dropdown

v0.0.5

Published

An Angular(11+cd) Multi-Select Dropdown Component with search option

Downloads

1

Readme

Multi-Select DropDown Option Component

An Angular(11+cd) Multi-Select Dropdown Component with search option

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
  • ability to disable
  • return all event action result in a single event
  • responsive with quality ui/ux
  • customizable item color and background color

Demo

Here is a Demo

Install

npm i tb-multi-select-dropdown

after inistallation, include it in your module (see app.modules.ts)

import { TbMultiSelectDropdownModule } from 'tb-multi-select-dropdown';
//...

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

Usage

import { Component, OnInit } from '@angular/core';
import { dropDownSetting } from 'tb-multi-select-dropdown';

export class AppComponent implements OnInit {
  dropdownSettings:dropDownSetting = {};
   selectedVal: any = "";
   listData = [];
ngOnInit() {
    this.dropdownSettings = {
    singleSelection: true,
    selectAllText: 'Select All',
    unSelectAllText: 'UnSelect All',
    itemsShowLimit: 3,
    allowSearchFilter: true,
  };
  this.listData = [
    { id: 1, name: "Codecademy" },
    { id: 2, name: "Coursera" },
    { id: 3, name: "Khan Academy" },
    { id: 4, name: "LinkedIn Learning" },
    { id: 5, name: "Open Culture" },
    { id: 6 , name: "Sophia" },
    { id: 7, name: "Teacher Training Videos" },
    { id: 8, name: "Udemy" },
    { id: 9, name: "Virtual Nerd Mobile Math" },
    { id: 10, name: "Techsmith" },

  ]
}

  getDropdownValue(selectedItems) {
    console.log(selectedItems)
  }
}


<tb-multi-select-dropdown           
[placeholder]="'Lookup Type Placeholder'"
[dropDownSettings]="dropdownSettings"
[data]="allgenericdropdown"
[(value)]="dropdown_id"
(change)="getDropdownValue($event)"
[idField] = "'id'"
[textField] = "'name'"
[disabled]="false"
[itemColor] = "#4847E0"
[itemBackgroundColor] = "rgba(72, 71, 224, 0.08)"
></tb-multi-select-dropdown>

Settings

| Setting | Type | Description | Default Value| | ------------- |-------------| -----| -------------| | data | Array | Array of items to select from. Should be an array of objects,the id and text properties must be as it is in the component settings. | [] | | idField | String | Name of the id field as it is in the data value | "id" | | textField | String | Name of the dispaly field as it is in the data value | "name" | |disabled| boolean | optional disable component | false| |itemColor| String | color of the selected items | "#4847E0"| |itemBackgroundColor| String| background color of the selected items with opacity level in RGBA | "rgba(72, 71, 224, 0.08)"| |placeholder| String | component placeholder | select option | |dropDownSettings.singleSelection| boolean | Component mode. If set true user can select more than one option. | false | |dropDownSettings.selectAllText| String | Text to display as the label of select all option | "Select All" | |dropDownSettings.unSelectAllText| String | Text to display as the label of unselect all option | "UnSelect All" |dropDownSettings.itemsShowLimit| number | Limit the number of items to show in the input field. | 3 | |dropDownSettings.allowSearchFilter| boolean | optional settings to toggle search filter feature | true|

Callback ()

change - Return the selected item(s) id(s) when an item or multiple items is/are checked/selected. Example : (change)="itemSelect($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.

Running unit tests

Run yarn test to execute the unit tests.

Development

This project was generated with Angular CLI version 11.0.7.

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.