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

nice-numeric-input

v1.1.3

Published

A Vue input component for numbers with realtime formating and currency support.

Downloads

75

Readme

Nice-Numeric-Input

npm npm bundle size NPM npm peer dependency version npm

Nice-Numeric-Input is a modern, rich featured and highly customisable numeric input built on Vue. Capable of formatting as the user types, including currency formatting. With no extra dependencies other than Vue itself.

Demo

Basic Demo

nice-numeric-input-demo-gif

Getting Started

Installation

> npm install nice-numeric-input

Usage

Import

import NiceNumericInput from 'nice-numeric-input'

Register

export default Vue.extend({
    //...
    components: { NiceNumericInput }
    //...
});

For a full list of props see the Reference Props section.

<nice-numeric-input v-model="cashValue"
                    placeholder="Enter a cash value"
                    label="Cash"
                    name="example"
                    currency="GBP"
                    locale="en-GB"
                    :max="100"
                    :min="0" />

Reference

Props

| Prop | Type | Required | Default Value | Notes | |---------------------|-----------|----------|------------------------|---------------------------------------------------------------------------------------------------------------| | value | Number | Yes | 0 | Use v-model to get two-way binding | | id | String | No | "nice-numeric-input" | | | name | String | No | "nice-numeric-input" | | | label | String | Yes | | Required for accessibility, use hide-label to remove the visual label | | placeholder | String | No | | | | step | Number | No | 1 | The amount to increase or decrease when using the step buttons | | min | Number | No | NEGATIVE_INFINITY | Anything entered below this will fail the isValid check | | max | Number | No | POSITIVE_INFINITY | Anything entered above this will fail the isValid check | | isValid | Boolean | No | | Basic internal validation, use the .sync modifier to get changes | | disabled | Boolean | No | false | Disable the entire component | | locale | String | No | window.navigator.language \|\| "en-US" | Standard BCP 47 language tag | | currency | String | No | null | When null currency formatting is turned off. Otherwise it can be any currency code e.g. USD, EUR, JPY | | minDecimalPlaces | Number | No | 0 | | | maxDecimalPlaces | Number | No | 2 | | | integerOnly | Boolean | No | false | Prevents decimal numbers being entered, entries are rounded to the nearest integer | | noControls | Boolean | No | false | Removes the step buttons | | hideLabel | Boolean | No | false | Removes the visual label | | decreaseTitle | String | No | "Decrease" | The button title for accessibility | | increaseTitle | String | No | "Increase" | The button title for accessibility | | increaseText | String | No | "+" | The text displayed on the increase step button | | decreaseText | String | No | "-" | The text displayed on the decrease step button | | superIncreaseText | String | No | "++" | The text displayed on the increase step button when super step is active (Ctrl or Alt) | | superDecreaseText | String | No | "--" | The text displayed on the decrease step button when super step is active (Ctrl or Alt) | | ultraIncreaseText | String | No | "+++" | The text displayed on the increase step button when ultra step is active (Ctrl + Alt) | | ultraDecreaseText | String | No | "---" | The text displayed on the decrease step button when ultra step is active (Ctrl + Alt) | | superStep | Number | No | 10 | The amount to change during a super step | | ultraStep | Number | No | 100 | The amount to change during an ultra step | | labelClass | String | No | | A custom class to apply to the visual label | | inputClass | String | No | | A custom class to apply to the input field | | decreaseButtonClass | String | No | | A custom class to apply to the decrease step button | | increaseButtonClass | String | No | | A custom class to apply to the increase step button | | wrapperClass | String | No | | A custom class to apply to the top level component element | | superStepClass | String | No | | A custom class to apply to both step buttons when super step is active | | ultraStepClass | String | No | | A custom class to apply to both step buttons when ultra step is active |


Events

| Event | Emitted Type | Notes | |---------------------|---------------|--------------------------------------------------------------------------------------------------------------------------| | input | Number | Used automatically by a v-model binding. Can be bound manually, fires when the value is changed | | update:isValid | Boolean | Used automatically by the .sync modifier on isValid prop. Can be bound manually, fires when the valid value changes. |

Bug Reporting and Feature Request

If you run into any bugs please open an issue and I'll fix it as soon as possible.

Got an idea for a new feature to add? Open an issue with the title prefixed "Feature Request".

Support This Project

ko-fi

BTC: bc1qpss998j2j06fmdrycn4fvh3vrdu7vttkjsngwd

ETH: 0xab04C5D9Dd7145fFf2dD94db7D7A50ae7Ce4Ab25

ADA: addr1qxhk3mptca7l0qk2p7hhh5tp4qfqvqj5tpj5vcgkcy5zx6d0drkzh3ma77pv5ra000gkr2qjqcp9gkr9ges3dsfgyd5srdnl4c