Coder Social home page Coder Social logo

blandialcani / ngx-material-dual-listbox Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 618 KB

Simple dual list box component to use with your Angular 5 app, along with Angular Material and Flex layout

Home Page: https://blandialcani.github.io/ngx-material-dual-listbox/docs/

TypeScript 67.35% JavaScript 9.50% HTML 22.03% CSS 1.12%
angular angular-material angular5 angular-cli material-design material-components flex-layout

ngx-material-dual-listbox's Introduction

Build Status

NgxMaterialDualListbox

Simple dual list box component to use with your Angular 5 app, along with Angular Material and Flex layout.

Dependencies

You will need:

  • Angular 5
  • Angular Material 5
  • Flex-layout 5
  • lodash
  • Material Icons (optional)

If you don't have these in your package.json, they will be installed when you install this package, just make sure you have the correct versions.

Installation

To install this library, run:

$ npm install @blandium/ngx-material-dual-listbox --save

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the module
import { NgxMaterialDualListboxModule } from '@blandium/ngx-material-dual-listbox';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Add the module in the impots
    NgxMaterialDualListboxModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once the library is imported, you can use the components, directives and pipes in your Angular application:

<ngx-material-duallistbox [items]="items" [descProperty]="'description'" [idProperty]="'id'">
</ngx-material-duallistbox>

If you want to use the component with material icons, make sure you have included them in your project. One way to do that is to include this in your intex.html:

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons"
      rel="stylesheet">

Attributes

  • items - accepts an array of objects which must have an identifying unique property (like 'id')
  • selectedItems - the array of selected objects
  • descProperty - the property of the object which will be displayed, default: 'description'
  • idProperty - the property of the object which will be used to compare the objects. It must be unique, default: 'id'
  • height - the css height property of the dual-listbox, default: '50vh'
  • filterPlaceholder - filter placeholder, default: 'Filter'
  • showIcons - boolean to show or not the material icons, default: 'true'
  • addIcon - the material icon to be displayed on the left side list. If you don't want an icon, pass an empty string to this property, default: 'add'
  • removeIcon - the material icon to be displayed on the right side list. If you don't want an icon, pass an empty string to this property, default: 'delete'
  • addIconColor - color of the icon on the left side list, default: 'black'
  • removeIconColor - color of the icon on the right side list, default: 'black'

License

MIT © Blandi Alcani

ngx-material-dual-listbox's People

Contributors

blandialcani avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ngx-material-dual-listbox's Issues

SelectedItems Observable list not working properly

When the selectedItems on component is populated by an observable or promise (ej. get elements from a HttClient service) the selected view is empty. I have to ensure the request completition in order to prevent to paint the compenent before, using the *ngIF directive

<ngx-material-duallistbox *ngIf='selected' [items]="all" [selectedItems]="selected" [descProperty]="'name'" [idProperty]="'id'" [filterPlaceholder]="'Filtrar'">

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.