{"_id":"@awiacek/vue-paycard","name":"@awiacek/vue-paycard","dist-tags":{"latest":"0.7.0"},"versions":{"0.7.0":{"name":"@awiacek/vue-paycard","version":"0.7.0","private":false,"type":"module","description":"Credit card component made with Vue.js","homepage":"https://github.com/guastallaigor/vue-paycard#readme","author":{"name":"Igor Guastalla de Lima","email":"limaguastallaigor@gmail.com"},"scripts":{"delete-dev:css":"rimraf src/assets/css/style.dev.css","build:cleancss":"cleancss src/assets/css/style.dev.css -o src/assets/css/style.min.css --source-map","build:minify":"sass src/assets/css/style.css:src/assets/css/style.dev.css --style=compressed --no-source-map","build:autoprefix":"postcss src/assets/css/style.dev.css --replace --use autoprefixer","build":"npm run build:minify && npm run build:autoprefix && npm run build:cleancss && npm run delete-dev:css","test:unit":"vue-cli-service test:unit","test:watch":"vue-cli-service test:unit --watch","commit":"git-cz","commit:retry":"git-cz --retry","commitmsg":"commitlint -e","lint":"vue-cli-service lint","storybook":"start-storybook -p 6006","build-storybook":"build-storybook"},"dependencies":{"vue":"^3.2.45"},"devDependencies":{"@babel/core":"^7.16.0","@commitlint/cli":"^15.0.0","@commitlint/config-conventional":"^15.0.0","@storybook/addon-a11y":"^6.4.8","@storybook/addon-controls":"^6.4.8","@storybook/addon-docs":"^6.4.8","@storybook/addons":"^6.4.8","@storybook/theming":"^6.4.8","@storybook/vue":"^6.4.8","@vue/cli-plugin-babel":"~5.0.8","@vue/cli-plugin-eslint":"~5.0.8","@vue/cli-plugin-unit-jest":"~5.0.8","@vue/cli-service":"~5.0.8","@vue/eslint-config-standard":"^6.1.0","@vue/test-utils":"^1.3.0","autoprefixer":"^10.4.0","babel-eslint":"^10.1.0","babel-loader":"^8.2.3","babel-preset-vue":"^2.0.2","clean-css-cli":"^5.4.2","commitizen":"^4.2.4","core-js":"^3.19.3","eslint":"^7.32.0","eslint-plugin-import":"^2.25.3","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.2.0","eslint-plugin-standard":"^4.1.0","eslint-plugin-vue":"^8.2.0","husky":"^7.0.4","lint-staged":"^12.1.2","postcss":"^8.4.4","postcss-cli":"^9.0.2","rimraf":"^3.0.2","sass":"^1.44.0","sass-loader":"^12.4.0","vue-template-compiler":"^2.6.14","jest":"^27.1.0","@vue/vue3-jest":"^27.0.0-alpha.3"},"eslintConfig":{"root":true,"env":{"node":true},"extends":["plugin:vue/essential","@vue/standard"],"parserOptions":{"parser":"babel-eslint"},"rules":{"vue/experimental-script-setup-vars":0,"vue/no-async-in-computed-properties":0},"overrides":[{"files":["**/__tests__/*.{j,t}s?(x)","**/tests/unit/**/*.spec.{j,t}s?(x)"],"env":{"jest":true}}]},"browserslist":["> 1%","last 2 versions","not dead"],"jest":{"preset":"@vue/cli-plugin-unit-jest","coverageDirectory":"./coverage/","collectCoverage":true,"coveragePathIgnorePatterns":["/node_modules/","/tests/","/src/assets/"]},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.{js,jsx,vue}":["vue-cli-service lint","git add"]},"bugs":{"url":"https://github.com/guastallaigor/vue-paycard/issues"},"keywords":["vue","vuejs","credit-card","vue-credit-card","paycard","vue-paycard","credit","card"],"license":"MIT","main":"./vue-paycard.js","repository":{"type":"git","url":"git+https://github.com/guastallaigor/vue-paycard.git"},"commitlint":{"extends":["@commitlint/config-conventional"],"rules":{"subject-case":[0,"never","sentence-case"],"subject-full-stop":[0,"never","."]}},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"gitHead":"cd5042b8b70b2420ac4b2a1c3d439d7c69e500ca","_id":"@awiacek/vue-paycard@0.7.0","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-iW2zKiq9RH8BOTIsG0GTlW54Yf4lNTsn++b4cmXtdKDdUCfB8tiFfoYVSalcHFAK/a/vbwYZROxayKbtOW8rhw==","shasum":"797dd8ae67538034b69c2d5f23381405070f44eb","tarball":"https://registry.npmjs.org/@awiacek/vue-paycard/-/vue-paycard-0.7.0.tgz","fileCount":52,"unpackedSize":925349,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGI99bcojmXS5yNfYFL6hhCi4zkZLmfEdhmVdeHekpepAiEAtL/DArciRzQ5D1X2YRbF3pM9EzQEZk3/H42EBwJNCiY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiOQRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxBg/8Dg9CiZz+0QEEDijs0mwQ1wyjHR8df/BZLLK/RfaepCdfdGxx\r\nGKxQ7oeIHmu80Z+vLC/vRfEfC0aEQBjVdIbEiCfQ7xLzsANN+uFihhS1DtXV\r\nhfvTzVQlEB4kKR17xUSEL2XRpp34N+HEjMUtiXPrcLMw1pRfPt8fpC5J1ToO\r\nghDhXauo5lvFs4C00MT8g8nnGC8GH+UYQIzUsH5/fdTLAS7oaCDY5EC95eQV\r\nGCYQosh+l9YL0wnocLIbELLf/uGEdTbzIQopk7Lqc9V+xzBpdOLetn3iY4Kv\r\nOnr8fBotnDwstG5OqhA5H1Ups4/M9QmNeVPgXyEy+ypwZAmHL8M8MFICew+F\r\nTa38x5NJSlbsoPZVCFEYzJMjAzT9XAvPY6b1xIeqthQhmisEWJVUAuqjRycr\r\nIx4MN+k2ccIJFDIgZHMlvCKizlbsWuX+9Aj7rasP1vmjPWcNkHiYNFPt0FcS\r\ny3Ivm3kjEYnJ3npt3NbtYIxwyMNOcBydzG+979vcixlArH4jMME4ME8x3Et+\r\nwoPcMmppBUza5aqDrwSKM5dNRyEtqCMRGpoWlkHe9hbLWFnw3nFSrLpuqHie\r\nQq5pvhgq+F84N3XfW9LvSx4+Z/7hjKduPC5OhHe06SJCKJRblDbF6YPXtD5n\r\nBCrryp3duurtj25XgbJU1nUO8NOoMhIeWCw=\r\n=00/M\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"adwiacek","email":"adriannawiacek@gmail.com"},"directories":{},"maintainers":[{"name":"adwiacek","email":"adriannawiacek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-paycard_0.7.0_1669915665561_0.010871292646859487"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-01T17:27:45.477Z","0.7.0":"2022-12-01T17:27:45.840Z","modified":"2022-12-01T17:27:45.979Z"},"maintainers":[{"name":"adwiacek","email":"adriannawiacek@gmail.com"}],"description":"Credit card component made with Vue.js","homepage":"https://github.com/guastallaigor/vue-paycard#readme","keywords":["vue","vuejs","credit-card","vue-credit-card","paycard","vue-paycard","credit","card"],"repository":{"type":"git","url":"git+https://github.com/guastallaigor/vue-paycard.git"},"author":{"name":"Igor Guastalla de Lima","email":"limaguastallaigor@gmail.com"},"bugs":{"url":"https://github.com/guastallaigor/vue-paycard/issues"},"license":"MIT","readme":"<div align=\"center\">\n  <img src=\"./.github/logo.png\" width=\"200px\">\n  <h1>Vue Paycard</h1>\n</div>\n<p align=\"center\">\n  Credit card component made with Vue.js (works with Vue 2 & 3)\n</p>\n\n[![Version](https://img.shields.io/npm/v/vue-paycard.svg)](https://www.npmjs.com/package/vue-paycard)\n[![GithubActions](https://github.com/guastallaigor/vue-paycard/workflows/vue-paycard/badge.svg)](https://github.com/guastallaigor/vue-paycard/actions)\n[![Coverage Status](https://coveralls.io/repos/github/guastallaigor/vue-paycard/badge.svg?branch=master)](https://coveralls.io/github/guastallaigor/vue-paycard?branch=master)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![Downloads](https://img.shields.io/npm/dt/vue-paycard.svg)](https://www.npmjs.com/package/vue-paycard)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/a87b7690-b534-4c67-b4a6-60e586bd79b5/deploy-status)](https://app.netlify.com/sites/vue-paycard/deploys)\n\n> This component is based on <a href=\"https://github.com/muhammederdem/vue-interactive-paycard\" target=\"_blank\">Vue Interactive Paycard</a>. All the credits for the component (idea, design, images, core code) goes to it </br></br>\n> This project only exports the Card component, **you** will need to create your own form\n\n## Reason\n\nThere are a few reasons for creating this project\n\nFirst of all, a few of us developers needed a good and well designed Vue.js lightweight zero dependencies credit card component with **only** the card, no form attached\n\nAlso, Vue Interactive Paycard isn't a Vue.js npm component that you can simply add it to your project, and it doesn't seem to be maintained\n\nSo this project is the Card component from there, but with some differences:\n\n1. This component is in npm, so you can simply install and start using it right away, with only Vue.js as a dependency;\n2. All the images were optimized and have their width exactly as they need;\n3. The name of some of the props were changed and some of the code was refactored;\n4. The prop `labels` was added, so we don't need any i18n library;\n5. This project has a development environment using [Storybook](https://storybook.js.org/docs/guides/guide-vue/), [Github Actions](https://github.com/features/actions), etc.\n\n## Storybook\n\nGo to https://vue-paycard.netlify.app\n\n> **Note**: The form inside is just an example, **you** will need to create yours or copy it from `tests/unit/form.vue`\n\n## How to install\n\n### npm\n\n```bash\n$ npm install vue-paycard --save\n```\n\n### yarn\n\n```bash\n$ yarn add vue-paycard\n```\n\n## Quick start\n\n### Vue.js\n\nYou can import in your `main.js` file\n\n```js\nimport Vue from \"vue\";\nimport VuePaycard from \"vue-paycard\";\n\nVue.use(VuePaycard);\n```\n\nFor Vue 3\n\n```js\nimport { createApp, h } from \"vue\";\nimport VuePaycard from \"vue-paycard\";\n\nconst app = createApp({\n  render: () => h(App),\n});\n\napp.use(VuePaycard);\n\napp.mount(\"#app\");\n```\n\nOr locally in any component\n\n```js\nimport { VuePaycard } from \"vue-paycard\";\n// In v0.5+ you don't need the brackets above\n\nexport default {\n  components: {\n    VuePaycard,\n  },\n};\n```\n\n### Nuxt.js\n\nYou can create a Nuxt.js plugin `vue-paycard.js`\n\n```js\nimport Vue from \"vue\";\nimport VuePaycard from \"vue-paycard\";\n\nVue.use(VuePaycard);\n```\n\nand then import it in your `nuxt.config.js` file\n\n```js\nplugins: [{ src: \"~/plugins/vue-paycard.js\", mode: \"client\" }];\n```\n\n## <a name=\"usage\">Basic usage</a>\n\n```html\n<template>\n  <vue-paycard :value-fields=\"valueFields\" />\n</template>\n\n<script>\n  export default {\n    data: () => ({\n      valueFields: {\n        cardName: \"\",\n        cardNumber: \"\",\n        cardMonth: \"\",\n        cardYear: \"\",\n        cardCvv: \"\",\n      },\n    }),\n  };\n</script>\n```\n\n## Props\n\n| Property name          | Type             | Default                                                                                                                             | Description                                                                                                                                                                                                                                                                                                                                                                          |\n| ---------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| value-fields\\*         | Object           | null                                                                                                                                | A **required** object that let you set the credit card holders name, number, month, year and cvv. Note that is **required** that all the attributes name must be exactly as the example above (see [Basic usage](#usage)). The `cardNumber` attribute value **must** be stored as it's shown: **#### #### #### ####**. The `cardYear` attribute value **must** be stored as **YYYY** |\n| input-fields           | Object           | { cardNumber: 'v-card-number', cardName: 'v-card-name', cardMonth: 'v-card-month', cardYear: 'v-card-year', cardCvv: 'v-card-cvv' } | An object that contains all your input fields id from your form. Each input field must have a valid and unique id to bind focus/blur listeners that this component provides. Note that is **required** that all the attributes name must be exactly as the ones in \"Default\". You need to also add a **data-card-field** attribute for each of those inputs                          |\n| labels                 | Object           | { cardName: 'Full Name', cardHolder: 'Card Holder', cardMonth: 'MM', cardYear: 'YY', cardExpires: 'Expires', cardCvv: 'CVV' }       | Set custom labels for the card if needed. English by default. Note that is **required** that all the attributes name must be exactly as the ones in \"Default\"                                                                                                                                                                                                                        |\n| is-card-number-masked  | Boolean          | true                                                                                                                                | Hides the numbers provided and changes to \"\\*\". Only shows the last four digits                                                                                                                                                                                                                                                                                                      |\n| has-random-backgrounds | Boolean          | true                                                                                                                                | Set a random background image to the card. You can check all the images in `src/assets/images`                                                                                                                                                                                                                                                                                       |\n| background-image       | [String, Number] | ''                                                                                                                                  | Set a background image link to the card (overrides `has-random-backgrounds` prop), or you can pass a single valid number that matches the images name we have in `src/assets/images`                                                                                                                                                                                                 |\n| set-type               | String           | ''                                                                                                                                  | Set a card type from the supported card types ['visaelectron', 'visa', 'elo', 'amex', 'mastercard', 'discover', 'unionpay', 'troy', 'dinersclub', 'jcb', 'laser', 'dankort', 'uatp', 'mir', 'hipercard', 'aura', 'maestro']. Note that this will override the type generated from card number                                                                                        |\n\n## Events\n\n| Event name | Type   | Default | Description                               |\n| ---------- | ------ | ------- | ----------------------------------------- |\n| get-type   | String | null    | Emits the type generated from card number |\n\n## Supported card types\n\n- American Express\n- Aura\n- Dankort\n- Diners Club\n- Discover\n- Elo\n- Hipercard\n- JCB\n- Laser\n- Maestro\n- MasterCard\n- MIR\n- Troy\n- UATP\n- UnionPay\n- Visa\n- Visa Electron\n\n## Development\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/guastallaigor/vue-paycard/issues)\n\n> **Note**: Contributions are very welcomed, however is very important to open a new issue using the issue template **before** you start working on anything, so we can discuss it before hand\n\nFork the project and enter this commands in your terminal\n\n```sh\n$ git clone https://github.com/YOUR_GITHUB_USERNAME/vue-paycard.git\n$ cd vue-paycard\n$ yarn\n```\n\n### Storybook\n\nFor visual testing, this project contains storybook which you can run by running the command\n\n```sh\n$ yarn storybook\n```\n\n### Jest\n\nBefore making the PR, if you changed something that needs to be tested, please make the tests inside the `tests/unit` folder\n\nTo run the tests, you can use the command\n\n```sh\n$ yarn test:watch\n```\n\n### CSS\n\nAll the CSS is at `src/assets/css/style.css`\n\nIf you make any changes in that file, you will need to run `yarn build` to build it, because the component uses the minified version at `src/assets/css/style.min.css`\n\n### Commitlint\n\nThis project follows the [commitlint](https://github.com/conventional-changelog/commitlint) guidelines, with minor changes\n\nYou can commit using `yarn commit` to help you with that\n\nThere's a `pre-push` hook that runs all the unit tests before you can push it\n\nIf an error occurs, you can use the `yarn commit:retry` command that runs the previous `yarn commit` that you already filled\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C1C63QCB8)\n\n## License\n\n[MIT](https://github.com/guastallaigor/vue-paycard/blob/master/LICENSE) © 2020\n","readmeFilename":"README.md"}