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

cm-angular-dual-listbox

v3.0.0

Published

Dual List Box for Angular

Downloads

202

Readme

Angular Dual-Listbox (v14, v15 and v16)

The angular-dual-listbox is an Angular component that provides two lists controls side-by-side that allows items in one list to be selected and moved* to the other list via drag-and-drop and/or a button-based interface. The component supports multiple select options from the list, programatic setting of list sources, and layout with direction and button formatting.

Dual ListBox

Table of Contents

Version

| Angular | angular-dual-listbox | |---|---| |16|3.0.0| |15|2.1.1| |14|1.0.0|

Usege

Installation

$ npm i cm-angular-dual-listbox 

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CmAngularDualListboxModule } from 'cm-angular-dual-listbox';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    CmAngularDualListboxModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html:

  <dual-listbox [source]="source" [(destination)]="confirmed"></dual-listbox>

app.component.ts:

export class AppComponent {

  employeeImage = "assets/employee.png";

  source: any[] = [
    {id:1, name:"one"},
    {id:2, name:"two"},
    {id:3, name:"three"},
    {id:4, name:"four"},
    {id:5, name:"five"},
    {id:6, name:"six"}
    ];

  confirmed: any[] = [];

  format = { 
    add: 'Add', 
    remove: 'Remove', 
    all: 'All', 
    none: 'None', 
    direction: CmAngularDualListboxComponent.LTR, 
    draggable: true 
    };
}

Inputs

| Name | Description |---|---| |key| The unique identifier field of each object in the source and destination arrays, default is _id. (Note: with a source of an array of strings, each string is its own id.) |display| The field of each object for displaying the object each the lists, default is _name. Or, a function that returns a string that can be used for displaying an object. (Note: with a source of an array of strings, each string is its own display.) |height| The height of the lists, default is 100px. |format| A format object, default is { add: 'Add', remove: 'Remove', all: 'All', none: 'None', direction: 'left-to-right', draggable: true, locale: undefined } |filter| A boolean whether or not to display a filter for the lists, default is false. |sort| A boolean whether or not to keep the lists sorted, default is false. |compare| A compare function to be used for sorting the lists. Note if sort is not set and compare is set, then sort will be set true. |source| The source array of objects or strings for the list. (This is the universal, master list of all possible objects.) |destination| The destination array of objects or strings selected from the source. Note, the destination array can have prexisting elements. |disabled| The dual-list is disabled, default is false.

Outputs

|Name | Description |---|---| |destinationChange| An event triggered when the destination array changes.

Final Usage

<dual-listbox [sort]="true" [source]="source" key="id" display="name"
[filter]="true" [(destination)]="confirmed" height="300px"
[format]="format" [disabled]="false"></dual-listbox>

License

MIT

Author