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

v-quantity-box

v1.0.5

Published

Vuetify combo input box for adding quantity values with description

Downloads

23

Readme

v-quantity-box

Vuetify combo input box for adding Quantity values with Description

Features

  • This package contains two text-fields - 1) Quantity 2) Description
  • Add each Quantity values with Description
  • Better use in inventory software where additional description needs while adding/updating each quantity
  • Shows sum total of quantity as hint under quantity text-field
  • Update & Delete quantity via v-chip component
  • Reverse/swap text fields

Installation

Use npm: npm install v-quantity-box

Prepare

At first make sure your project is Vue project, and has Vuetify as UI framework:

  1. Install Vuetify:
npm install vuetify --save-dev
  1. Add Vuetify to app.js or main.js:
import Vuetify from 'vuetify';
import 'vuetify/dist/vuetify.min.css';

Vue.use(Vuetify);

You also can use Vue plugin to install Vuetify by only one line command:

vue add vuetify

Note: Make sure you are using the default Vuetify iconfont (mdi)

Demo Images

alt text alt text

Below code in the <template>:

<VQuantityBox 
dense 
dark 
:quantity-array="quantity" 
@on-add="addToQuantity" 
@on-update="updateQuantity" 
@on-input="onQuantityInput" 
@on-chip-close="removeQuantity" 
></VQuantityBox>

Reverse text fields, change text field labels, add margin between chip content & chip close icon

enter image description here

<VQuantityBox 
dense 
dark 
outlined 
reverse-fields 
color="info" 
:chip-close-margin="4" 
:quantity-array="quantity" 
@on-add="addToQuantity" 
@on-update="updateQuantity" 
@on-input="onQuantityInput" 
@on-chip-close="removeQuantity" 
quantity-label="Pieces" 
description-label="Information"
></VQuantityBox>

Usage

Add below code into your <script>:

import VQuantityBox from 'v-quantity-box'

export default {
    components: {
        VQuantityBox,
    },
    data: () => ({
        quantity: []
    }),
    methods: {
        addToQuantity(item) {
            this.quantity.push(item)
        },
        updateQuantity(obj) {
            const { index, item } = obj
            this.quantity[index] = Object.assign(this.quantity[index], item)
        },
        onQuantityInput(obj) {
            const { index, item } = obj
            this.quantity[index] = Object.assign(this.quantity[index], item)
        },
        removeQuantity(index) {
            this.quantity.splice(index, 1)
        }
    }
}

Attributes

  • dense (boolean): Reduces the input height (Default: false)
  • dark (boolean): Applies the dark theme (Default: false)
  • outlined (boolean): Applies the outlined style to the input (Default: false)
  • color (String): Applies specified color (Default: teal)
  • quantity-array (Array): Array property to store values.
  • quantity-label (String): Label for Quantity field. (Default: Quantity)
  • description-label (String): Label for Description field. (Default: Description)
  • chip-close-margin (Number): Margin between chip content & chip close icon.
  • reverse-fields (Number): Reverse/Swap text fields. (Default: false)

Methods

(See Above script example to get better idea about methods)

Buy a Tea

License

MIT