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

ng-number-picker

v1.1.9

Published

[![Build Status](https://api.travis-ci.org/wajdibeltaifa/ng-number-picker.svg?branch=master)](https://travis-ci.org/wajdibeltaifa/ng-number-picker) [![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](http://www.opensource.org/

Downloads

464

Readme

ng-number-picker

Build Status License NPM Release NPM Monthly Downloads

A number picker input for angular 2+ & bootstrap 4+. It supports the mousewheel and the up/down keys and increase/decrease input value continuously by long tap the up/down buttons.

Getting Started

These instructions will get you an copy of the ng-number-picker module up and running on your local machine for development purposes. See Options & Events for more details.

Try it

Try it on: Plunker or stackblitz

Requirements

  1. Angular2.x
  2. Bootstrap4.x

Installation

Run npm install --save ng-number-picker from the command line, then import the NgNumberPickerModule into your appModule :

import {NumberPickerModule} from 'ng-number-picker';

@NgModule({
  imports: [
    NumberPickerModule
  ],
  ...
  ...
})

Run npm install --save bootstrap from the command line to install Bootstrap4.x, then include the style into your angular.json file (or angular-cli.json for angular version < 6.0) similar to the following:

"styles": [
  "node_modules/bootstrap/dist/css/bootstrap.min.css"
],
...

Usage

Add the following line into your html template :

<ng-number-picker [(value)]="value"></ng-number-picker>

Options

The following options are the available component inputs :

| INPUT | TYPE | DEFAULT | DISCRIPTION | | ------------- | :-------------: | :-------------: |:-------------| | min | number | 0 | Minimum value | | max | number | 100 | Maximum value | | step | number | 1 | The step value for up/down change | | value | number | null | Initial input value | | pickStartAfter | number | 500 | The time in milliseconds before start picking values. Used when holding click on up/down buttons. | | pickTimer | number | 100 | The time in milliseconds for step auto incrementation/decrementation. Used when holding click on up/down buttons. | | prefix | string | null | Text value before the input | | postfix | string | null | Text value after the input | | placeholder | string | null | Input placeholder | | size | sizeType | md | The input size. Please take a look at the available size types. | | buttonsOrientation | buttonsOrientationType | h | The orientation strategy for up/down buttons. Please take a look at the available orientation types.| | customClass | CustomClasses | {} | Set custom css classes around the component. Please take a look at the available custom classes options.| | | mouseWheel | boolean | false | Enable/disable change input value with mouseWheel| | arrowKeys | boolean | true | Enable/disable change input value with up/down arrow keys | | inputReadOnly | boolean | false | Readonly input | | showUpButton | boolean | true | Show/hide upward button | | showDownButton | boolean | true | Show/hide downword button |

Default options

You can change the default options values exist in the NumberPickerService by creating a CustomNumberPickerService similar to the following:

import {NumberPickerModule, NumberPickerService} from 'dist/number-picker';

export class CustomNumberPickerService {
  min = 10;
  max = 50;
  step = 5;
  precision = 1;
  pickStartAfter = 100;
  pickTimer = 100;
  value = 15;
}

@NgModule({
  imports: [
    NumberPickerModule
  ],
  providers: [{provide: NumberPickerService, useClass: CustomNumberPickerService}],
  ...
  ...
  ...
})

Events

Triggered events

The following events are triggered on the input and can be listened on.

| EVENT | DISCRIPTION | | ------------- |:-------------| | valueChange | Triggered when the value is changed with one of the +/- buttons | | minReached | Triggered when the input value hit the limit set by the min option | | maxReached | Triggered when the input value hit the limit set by the max option | | pickStarted | Triggered when start picking numbers upwards or downwards | | pickStoped | Triggered when stop picking numbers upwards or downwards | | pickUpStarted | Triggered when start picking numbers upwards | | pickUpStoped | Triggered when stop picking numbers upwards | | pickDownStarted | Triggered when start picking numbers downwards | | pickDownStoped | Triggered when stop picking numbers downwards |