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

chip-autocomplete

v1.0.6

Published

Angular chip-autocomplete Reactive Form Control where you can create chips with autocomplete with clientside and server side option filtering

Downloads

115

Readme

ChipAutocomplete

Angular chip-autocomplete is a Formcontrol where you can create chips with autocomplete with clientside and server side option filtering which can be used with Reactive Forms as a normal formcontrol like <input> <select>

Demo

check out Live Demo

code: stackblitz

Getting Started

npm i chip-autocomplete

Configuration

Install @angular/material, if you didn't installed already:

npm add @angular/material

Ensure you import the module and the dependencies:

import { ChipAutocompleteModule } from 'chips-autocomplete';
import { BrowserModule } from '@angular/platform-browser'; 
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
   imports: [
       BrowserModule,
       FormsModule,
       ReactiveFormsModule,
       ChipAutocompleteModule
       ...OtherModules 
   ] // along with your other modules
})
export class AppModule {}

Implementation

Use the component in any component:

app.component.html

<chip-autocomplete><chip-autocomplete>

You don't need <mat-form-field> around this control. It was given under the hood.

API

| Features | Type | Default | Description | | ------ | ------ | -----| ------| | placeholder | string | 'Select' | String that sets the placeholder | | maxItems | number | null | Sets the maximum number of chips | | removable | boolean | true | whether the chips are removable | | required | boolean | true | whether the field is required | | clientSideFilter | boolean | true | whether the dropdown is filtered by client side or server side. If the value is true (clientside), options is required. If the value is false (serverside), filteredOptions$ Observable and isOptionString, changeSearchKey eventEmitter | | options | Array | | dropdown Options: Array of strings Or Array of Object| | isOptionString | boolean | true | Whether the options are Strings or Object. In Cleint side filtering, it is not required, it can select automatically from options. But in server side filtering, it is required. | | displayWith | string | 'value' | If the options are objects, display property of that objects is required | | itemId | string | 'key' | if the options are objects, key property of that objects is required | | filteredOptions$ | Observable<any[]> | | Observable that fetch filtered Options from the server. It is required if it is server side filtering | | changeSearchKey | EventEmitter | | Eventemitter with every key stroke, useful for server side filtering | | debounceTime | number | 500 | DebounceTime for server side filtering | | isChipAddFromInput | boolean | false | whether the text not found in dropdown is allowed to add to chips | | isOptionCheckable | boolean | false | whether Options can be added to chips with checkbox | | disabledSelected | boolean | true | Whether previously selected options will be disabled and prevent to select |