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

vuetify-numeric

v0.2.1

Published

Numeric input components for use with vuetifyjs

Downloads

817

Readme

vuetify-numeric

Numeric input components for use with vuetifyjs.

Features

  • Built-in calculator
  • Smart numeric input
  • Locale support number format
  • Adjustable text color
  • Groupping digits
  • Right number alignement
  • Show prefix (currency ...) near your number
  • No thirdpatry solutions is used
  • Vuetify VTextField compatible

Keyboard shortcuts

| Key | Action | | ---- | -------- | | Enter | Activate calculator or calculate your expression and close the calculator. (Note) You can change calculator's activation key | | Delete | Reset calculator | | . or , | Swich your input between integer and fraction part of number | | - | Change your input number sign |

Demo & Playground

See Live demo . or Codesandbox example codesandbox

The v-numeric component

The component extends the Vuetify v-text-field component.

How to use

Install the package:

yarn add vuetify-numeric

Add the package to your app entry point:

import VNumeric from 'vuetify-numeric/vuetify-numeric.umd.min'

Or (in develop case)

import VNumeric from 'vuetify-numeric/vuetify-numeric.umd'

Than, register this plugin

Vue.use(VNumeric)

Once the plugin has been installed, you can now use the v-numeric component in your templates. Use v-model to bind to the value.

<template>
	<v-numeric text outlined v-model="amount"></v-numeric>
</template>

<script>
export default {
	data() {
		return {
			amount: 0,
		};
	},
};
</script>

Props:

| Prop | description | type | default | | ---- | ---- | ------- | --- | | min | Sets minimum value | Number | - Number.MAX (infinity) | | max | Sets maximum value | Number | Number.MAX (infinity)| | length | Sets maximum number of digits | Number | 10 | | precision | Number of digits after decimal point | Number | 0 | | negativeTextColor | Text color when number is negative | String | red | | locale | Current locale | String | en-US | | useGrouping | use grouping digits | Boolean | true | | elevation | Sets the calculator elevation | Number | 10 | | fab | FAB-kind calculator's button | Boolean | false | | text | use transparent background in calculator | Boolean | false | | calcStyle | You can customize calculator's button style separately from input field. This is not mandatory.| object | undefined | | calcIcon | You can customize calculator's icon. If it's undefined, the calculator icon does not appear.| string | 'mdi-calculator' | | useCalculator | Turn on/off calculator usage.| boolean | true | | openKey | Key for open build-in calculator | String |'Enter' | calcNoTabindex | Set or not tabindex attribute in calc icon | Boolean | false |

calcStyle object properties:

This object uses for customizing calculator buttons, and consist of the same Vuetify v-btn properies. For details, see official documentation

calcStyle: {
  fab: false,
  outlined: false,
  rounded: false,
  text: false,
  tile: false,
  large: false,
  small: false
}

Anover props are derived from v-text-field component

Events:

@input: Emitted when value is changed after user input. @change: Emitted formatted value as string when that is changed after user input.

CDN example:

You can use this library without installation, via cdn provider

<!DOCTYPE html>
<html>
<head>
  <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
  <div id="app">
    <v-app>
      <v-main>
        <v-container>
          <v-row>
            <v-numeric text outlined ></v-numeric>
          </v-row>
          <v-row>
            <v-numeric text ></v-numeric>
        </v-row>
        </v-container>
      </v-main>
    </v-app>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/vuetify-numeric.umd.min.js"></script>
  <script>
    new Vue({
      el: '#app',
      vuetify: new Vuetify({})
    })
  </script>

</body>
</html>