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

@shawon3719/vue-bank-card-input

v1.0.17

Published

Vue Component - bank card

Downloads

13

Readme

Vue Bank Card Input

Version (npm) Vue.js version Build Status Coverage License

Vue Component for user data entry of the bank card

Demonstration is available here.

Installation

npm i --save @shawon3719/vue-bank-card-input

or

yarn add @shawon3719/vue-bank-card-input

You can import the library and styles, then use it as a Vue plugin to enable the functionality globally on all components.

import Vue from "vue"
import VueBankCard from "@shawon3719/vue-bank-card-input"
import "@shawon3719/vue-bank-card-input/dist/vue-bank-card-input.css"

Vue.component("VueBankCard", VueBankCard)

Basic usage

<VueBankCard is-new />

Properties

Name | Required | Type | Default | Description :--- | :--- | :--- | :--- | :--- card_number_label | no | String | "Card number" | You can use your locale text expiration_label | no | String | "MM/YY" | You can use your locale text cvv_label | no | String | "CVV" | You can use your locale text card_number_placeholder | no | String | "Enter Card Number" | You can use your locale text number_required | no | String | "You need to fill this field" | You can use your locale text expiration_invalid | no | String | "Date invalid" | You can use your locale text cvv_invalid | no | String | "Invalid data" | You can use your locale text number | no | String, Object | "" | Number of card isSmall | no | Boolean | false | View card controller: base or small isNew | no | Boolean | false | View card controller: saved or new disableDelete | no | Boolean | false | Disable delete option on small card errors | no | Object | {} | Errors from outside the component. From server etc. isReset | no | Boolean | false | Trigger for reset form isFocus | no | Boolean | false | Card number field focus when component mounted (available if isNew is true) imagesBasePath | no | String | default | Base path and banks or payment systems logotypes

Events

Name | Type | Parameters | Description :--- | :--- | :--- | :--- enter | Function | event - Event of keydown | Handler of keydown on enter event clear-errors | Function | errors - Object of errors | Clearing errors from outside reset | Function | isReset - State of isReset property, type Boolean | Turn off isReset property delete-card | Function | event - Event of click | Handler of click on trash button getCardInfo | Function | event - get all input data

Example

<template>
  <VueBankCard
    is-small
    is-new
    is-focus
    :errors="errors"
    :is-reset="resetForm"
    @enter="onEnter"
    @clear-errors="clearErrors"
    @reset="resetForm = $event"
  ></VueBankCard>
</template>

<script>
export default {
  data() {
    return {
      errors: {
          cardNumber: "Enter valid card",
          expDateMonth: "Card has been expired",
          cvv: "Invalid CVV"
      },
      resetForm: false
    }
  },
  methods: {
    onEnter(event) {
      event.preventDefault();
      console.log(event);
    },
    clearErrors(errors) {
      this.errors = { ...errors };
    }
  }
}
</script>

Use your own logotypes

By default banks logos provided from CDN: https://cdn.jsdelivr.net/gh/shawon3719/vue-bank-card-input@master/public/images/%image_path%.

If you want to use your own logotypes you can pass base images path by prop images-base-path. For example:

<template>
  <VueBankCard
    is-new
    :images-base-path="imagesPath"
  ></VueBankCard>
</template>

<script>
export default {
  data() {
    return {
      imagesPath: "//your-own-cdn-or-host.com/path/to/assets/"
    }
  },
}
</script>

Now path to logotype would be //your-own-cdn-or-host.com/path/to/assets/banks-logos/ru-sberbank.png.

So you must have two folders in your defined path:

  • banks-logos - Must contain bank logos;
  • brands-logos - Must contain payment systems (VISA, Master Card, etc) logos.

Name of files with logotypes should be the same that come with this package.

Testing

For package testing we use jest framework and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:

$ make install
$ make test

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.