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

@j2only/pincode

v0.4.2

Published

Vue.js pincode input component. Written entirely on Vue 3 Composition API with Typescript and Vite.

Downloads

21

Readme

vue-pincode

npm publish npm npm bundle size (scoped) CodeFactor Grade TypeScript contributions welcome GitHub

Vue.js pincode input component. :lock: Written entirely on Vue 3 Composition API with Typescript and Vite. Compatible only with Vue.js 3.x.

  • Simple pincode input field
  • Minimal style
  • Customizable
  • Smooth animations

You can check a DEMO HERE

Installation

Install this component via package manager:

yarn add @j2only/pincode

https://nodei.co/npm/@j2only/pincode.png?downloads=true&downloadRank=true&stars=true

Usage

Import the component in your app and pass some settings:

<template>
    <VuePincode
        name="pincode"
        ref="pincodeInput"
        :length="4"
        :releaseSuccess="true"
        :releaseSuccessDelay="2500"
        :releaseErrorDelay="500"
        :customButton="true"
        @clickButton="cButtonFn"
        @pincode="checkPincode"
    />
</template>

<script setup lang="ts">
import VuePincode from "./components/VuePincode";

const pincodeInput = ref()
const cButtonFn = ref(() => alert("the custom button clicked!"))
const answer = "1234"


function checkPincode(pincode: string) {
    setTimeout(() => {
        if (pincode === answer)
            pincodeInput.value.triggerSuccess()
        else
            pincodeInput.value.triggerMiss()
    }, 300)
}
</script>

Props

As you can see, the component accepts some props:

| Prop | Type | Default | Description | | ------------------- | ------- | --------- | -------------------------------------------------------------------- | | name | String | "pincode" | Unique ID, in case of using several components on one page | | length | Number | 4 | Required pincode length, minimum 2, maximum 8 | | releaseSuccess | Boolean | true | Reset state after delay when entered pincode is correct | | releaseSuccessDelay | Number | 2500 | Delay to reset state after entered pincode is correct (milliseconds) | | releaseErrorDelay | Number | 500 | Delay to reset state after entered pincode is invalid (milliseconds) | | customButton | Boolean | false | Show custom button |

CSS Variables

Also, you can customize some styles via CSS Variables:

| Variable | Default | Description | | ------------------------ | ------- | --------------------------------------- | | --pc-color-button | #000000 | Color of digits | | --pc-color-field-normal | #234567 | Color of fields | | --pc-color-field-success | #42b983 | Color of fields when pincode is correct | | --pc-color-field-error | #eb0c0c | Color of fields when pincode is invalid | | --pc-custom-button-icon | base64 | Custom button icon |

Events

| Event | Description | | ----------- | -------------------------------------------------------------------- | | pincode | Is triggered when the entered pincode length is equal to length prop | | clickButton | Is triggered when the custom button is pressed |

Project development

  • yarn dev compiles and hot-reloads demo for development
  • yarn lint lints and fixes files
  • yarn build compiles and minifies production files and demo

Licensing

MIT License Forked from @weslinkde/vue-pincode, Dominik Lenz :copyright: 2020 Weslink GmbH, MIT License