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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ff-select-input

v8.0.0

Published

[![Build Status](https://travis-ci.org/frontendfreelancerdk/ff-select-input.svg?branch=master)](https://travis-ci.org/frontendfreelancerdk/ff-select-input)

Downloads

6

Readme

Build Status

ff-select-input

##Getting started

Installation

#####To install this library, run:

$ npm install ff-select-input --save
Include to your module

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import library
import { FFSelectInputModule } from 'ff-select-input';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    // Specify library as an import
    FFSelectInputModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once ff-select-input is imported, you can use its component in your Angular application:

<!-- Now you can use library component in your.component.html
     Put your options array to [options] property. It's required.   
     Options array should match to 
interface FFOptionsListInterface {
  text: string | number;
  value: string | number | boolean;
} 
-->
<ff-select-input [options]="[{value: 0, text: '1'},
                 {value: 1, text: '2'},
                 {value: 2, text: '3'},
                 {value: 3, text: '4'}]">
</ff-select-input>

API

Selector: ff-select-input

Properties

interface FFOptionsListInterface {
  text: string | number;
  value: string | number | boolean;
}

  @Input() options: FFOptionsListInterface[];

The [options] attribute is required attribute. You should put here array of your options. !IMPORTANT make sure that your options match to FFOptionsListInterface;

  @Input() multiSelect: boolean = false;

The [multiSelect] attribute let you use multi select.

  @Input() parentContainer: HTMLElement;

The [parentContainer] attribute sets max height and position of drop-list regarding parent element. Example: <div class="myWrapper" #wrapper> <ff-select-input [options]=[...] [parentContainer]="wrapper">

  @Input() disabled: boolean = false;

If [disabled] is true - component adds css class "disabled" and disabled this input

  @Input() value: string | number | boolean | (string | number | boolean)[];
  @Input() defaultValue: string | number | boolean | (string | number | boolean)[];

The [value] attribute sets current value. It can be string, number or boolean type and for multi select - arrays of these types.

  @Input() defaultValue: string | number | boolean;

The [defaultValue] attribute works only with multi select. Users will see this value when all options are unchecked.

  @Output() input: EventEmitter<string | number | boolean | (string | number | boolean)[]>;

Event triggered when user selects any option.

Example

app.component.html

<div class="myBorders" #parent>
<!-- Simple select -->
  <ff-select-input [disabled]="disabled" [value]="0"
                   [options]="[{value: 0, text: '1'},
                   {value: 1, text: '2'},
                   {value: 2, text: '3'},
                   {value: 3, text: '4'}]"
                   [parentContainer]="parent"
  ></ff-select-input>
<!-- Multiple select -->
  <ff-select-input [value]="['a','c']" (input)="log($event)" [multiSelect]="true"
                   [defaultValue]="'x'"
<!-- ! Note that OPTION with value equals to defaultValue will be dropped from options list -->
<!-- User will see this option value in select only when nothing selected-->
                   [options]="[{value: 'x', text: 'Nothing selected'},
                               {value: 'a', text: 'A'},
                               {value: 'b', text: 'B'},
                               {value: 'c', text: 'C'},
                               {value: 'd', text: 'D'}]"
                   [parentContainer]="parent"
  ></ff-select-input>
</div>

app.component.css

.myBorders {
  height: 500px;
  border: 2px solid red;
  width: 500px;
  margin: 20px auto;
  position: relative;

  ff-select-input:last-child {
    position: absolute;
    bottom: 0;
    right: 0;
  }
}

app.component.ts

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

@Component({
  selector: 'ff-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  disabled: boolean = false;

  log(e) {
    console.log(e);
  }
}

License

MIT © Frontend Freelancer