{"analyzedAt":"2022-07-12T21:12:07.600Z","collected":{"metadata":{"name":"@handcrafted-market/vue3-numeric","scope":"handcrafted-market","version":"1.0.4","description":"Input field component to display currency value based on vue-numeric.","keywords":["component","currency","input","text","number","numeric","separator","vue","vue.js"],"date":"2022-03-29T22:35:51.947Z","publisher":{"username":"mrweiner","email":"mrweiner@gmail.com"},"maintainers":[{"username":"mrweiner","email":"mrweiner@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/handcrafted-market/vue3-numeric.git"},"links":{"npm":"https://www.npmjs.com/package/%40handcrafted-market%2Fvue3-numeric","homepage":"https://github.com/handcrafted-market/vue3-numeric#readme","repository":"https://github.com/handcrafted-market/vue3-numeric","bugs":"https://github.com/handcrafted-market/vue3-numeric/issues"},"license":"MIT","dependencies":{"accounting-js":"^1.1.1","vue":"^3.2.16"},"devDependencies":{"@vitejs/plugin-vue":"^1.9.3","vite":"^2.6.4"},"releases":[{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":5},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":5},{"from":"2020-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":5}],"hasSelectiveFiles":true,"readme":"# vue3-numeric\r\n\r\n[![npm](https://img.shields.io/npm/v/vue3-numeric.svg?style=flat-square)](https://www.npmjs.com/package/vue3-numeric)\r\n[![npm](https://img.shields.io/npm/dt/vue3-numeric.svg?style=flat-square)](https://www.npmjs.com/package/vue3-numeric)\r\n[![npm](https://img.shields.io/npm/dm/vue3-numeric.svg?style=flat-square)](https://www.npmjs.com/package/vue3-numeric)\r\n[![npm](https://img.shields.io/npm/l/vue3-numeric.svg?style=flat-square)](http://opensource.org/licenses/MIT)\r\n\r\nThis is an implementation for Vue 3 of the Original project [vue-numeric](https://github.com/kevinongko/vue-numeric) in its version 2.4.3.\r\n\r\nIt initially existed at https://github.com/flvportafolio/vue3-numeric but seems to have been deleted. Since it has an MIT license, it's been reuploaded here in the state that it last existed in our deployments. We may or may not be able to actually support issues that are raised for the project.\r\n\r\n## Installation\r\n\r\n```sh\r\n# NPM\r\n$ npm install @handcrafted-market/vue3-numeric\r\n```\r\n## CDN\r\n```html\r\n<html>\r\n  <head>\r\n    <script src=\"https://unpkg.com/vue@next\"></script>\r\n  </head>\r\n  <body>\r\n    <div id=\"app\">\r\n       {{price}}\r\n      <hr>\r\n      <vue-numeric\r\n        currency=\"$\"\r\n        separator=\",\"\r\n        v-model=\"price\"\r\n        :precision=\"2\"\r\n      ></vue-numeric>\r\n    </div>\r\n    <script src=\"https://unpkg.com/vue3-numeric@1.0.1/dist/vue3-numeric.umd.js\"></script>\r\n    <script type=\"module\">\r\n      const VueNumeric = window[\"vue3-numeric\"];\r\n      Vue.createApp({\r\n        setup() {\r\n          const price = Vue.ref(\"123\");\r\n          return { price };\r\n        }\r\n      })\r\n      .component(\"vue-numeric\", VueNumeric)\r\n      .mount(\"#app\");\r\n    </script>\r\n  </body>\r\n</html>\r\n```\r\n#### Register globally\r\n\r\n```js\r\nimport { createApp } from 'vue';\r\nimport App from './App.vue';\r\nimport VueNumeric from 'vue3-numeric';\r\n\r\ncreateApp(App)\r\n  .component(\"vue-numeric\", VueNumeric)\r\n  .mount('#app');\r\n```\r\n\r\n#### Register as Component (Composition Api)\r\n\r\n```html\r\n<script>\r\nimport { ref } from 'vue';\r\nimport VueNumeric from 'vue3-numeric';\r\nexport default {\r\n  components: { VueNumeric },\r\n  setup() {\r\n    const price = ref('');\r\n    return { price };\r\n  },\r\n};\r\n</script>\r\n<template>\r\n  <vue-numeric\r\n    separator=\",\"\r\n    v-model=\"price\"\r\n    :precision=\"2\"\r\n  ></vue-numeric>\r\n</template>\r\n```\r\n\r\n#### Register as Component (Composition Api - setup sugar)\r\n\r\n```html\r\n<script setup>\r\nimport { ref } from 'vue';\r\nimport VueNumeric from 'vue3-numeric';\r\nconst price = ref('');\r\n</script>\r\n<template>\r\n  <vue-numeric\r\n    separator=\",\"\r\n    v-model=\"price\"\r\n    :precision=\"2\"\r\n  ></vue-numeric>\r\n</template>\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Quick example\r\n```vue\r\n<script>\r\nimport { ref } from 'vue';\r\nimport VueNumeric from 'vue3-numeric';\r\nexport default {\r\n  components: { VueNumeric },\r\n  setup() {\r\n    const price = ref('');\r\n    return { price };\r\n  },\r\n};\r\n</script>\r\n<template>\r\n  <vue-numeric\r\n    currency=\"$\" \r\n    separator=\",\"\r\n    v-model=\"price\"\r\n    :precision=\"2\"\r\n  ></vue-numeric>\r\n</template>\r\n```\r\n\r\n### Currency symbol\r\n\r\nSet the `currency` prop to add a currency symbol within the input.\r\n\r\n```vue\r\n<vue-numeric currency=\"$\"></vue-numeric>\r\n```\r\n### Currency symbol Spacing\r\n\r\nSet the `currencySymbolSpacing` prop to false to show `$2.00.` instead of `$ 2.00`.\r\nBy default the value is true\r\n\r\n```vue\r\n<vue-numeric\r\n  currency=\"$\"\r\n  :currencySymbolSpacing=\"false\"\r\n></vue-numeric>\r\n```\r\n\r\n### Minimum & maximum constraint\r\n\r\nLimit the minimum and maximum value by using `min` and `max` props.\r\n\r\n- `min` defaults to `0`.\r\n- `min` and `max` accept `String` or `Number` values.\r\n\r\n```vue\r\n<vue-numeric v-bind:min=\"2000\" v-bind:max=\"10000\"></vue-numeric>\r\n```\r\n\r\n### Disable/enable negative values\r\n\r\n`minus` defaults to `false` (no negative numbers).\r\n\r\n```vue\r\n<vue-numeric v-bind:minus=\"false\"></vue-numeric>\r\n```\r\n\r\n### Enable decimal precision\r\n\r\nBy default the decimal value is disabled. To use decimals in the value, add the `precision` prop.\r\n- `precision` accept a `String` or `Number` numeric value.\r\n\r\n```vue\r\n<vue-numeric v-bind:precision=\"2\"></vue-numeric>\r\n```\r\n\r\n### Thousands separator\r\n- Default thousand separator's symbol is `,`.\r\n- Use the `separator` prop to change the thousands separator.\r\n- `separator` only accepts `space`, `,` or `.`.\r\n- When using the `.` or `space` as thousand separator, the decimal separator will be `,`.\r\n\r\n```vue\r\n<vue-numeric separator=\".\"></vue-numeric>\r\n```\r\n\r\n\r\n### Input placeholder when empty\r\n```vue\r\n<vue-numeric placeholder=\"only number allowed\"></vue-numeric>\r\n```\r\n\r\n### Value when empty\r\nBy default, when you clean the input the value is set to `0`. You can change this value to fit your needs.\r\n```vue\r\n<vue-numeric :empty-value=\"1\"></vue-numeric>\r\n```\r\n\r\n### Output Type\r\nBy default the value emitted for the input event is of type `Number`. However you may choose to get a `String` instead\r\nby setting the property `output-type` to `String`.\r\n```vue\r\n<vue-numeric output-type=\"String\"></vue-numeric>\r\n```\r\n\r\n## Props\r\n|Props|Description|Required|Type|Default|\r\n|-----|-----------|--------|----|-------|\r\n|currency|Currency prefix|false|String|-|\r\n|currency-symbol-position|Position of the symbol (accepted values: `prefix` or `suffix`)|false|String|`prefix`|\r\n|max|Maximum value allowed|false|Number|9007199254740991|\r\n|min|Minimum value allowed|false|Number|-9007199254740991|\r\n|minus|Enable/disable negative values|false|Boolean|`false`|\r\n|placeholder|Input placeholder|false|String|-|\r\n|empty-value|Value when input is empty|false|Number|0|\r\n|output-type|Output Type for input event|false|String|`String`|\r\n|precision|Number of decimals|false|Number|-|\r\n|separator|Thousand separator symbol (accepts `space`, `.` or `,`)|false|String|`,`|\r\n|decimal-separator|Custom decimal separator|false|String|-|\r\n|thousand-separator|Custom thousand separator|false|String|-|\r\n|read-only|Hide input field and show the value as text|false|Boolean|false|\r\n|read-only-class|Class for read-only element|false|String|''|\r\n\r\n## License\r\n[MIT license](http://opensource.org/licenses/MIT)\r\n\r\n## Recommended IDE Setup\r\n\r\n- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)"},"npm":{"downloads":[{"from":"2022-07-11T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":4},{"from":"2022-07-05T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":34},{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":152},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":223},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":375},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":375}],"starsCount":0},"github":{"starsCount":0,"forksCount":0,"subscribersCount":1,"issues":{"count":0,"openCount":0,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"mrweiner","commitsCount":3}],"commits":[{"from":"2022-07-05T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":8},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":8}]},"source":{"files":{"readmeSize":6266,"testsSize":0},"badges":[{"urls":{"original":"https://img.shields.io/npm/v/vue3-numeric.svg?style=flat-square","shields":"https://img.shields.io/npm/v/vue3-numeric.svg","content":"https://img.shields.io/npm/v/vue3-numeric.json"},"info":{"service":"npm","type":"version","modifiers":{"type":"v"}}},{"urls":{"original":"https://img.shields.io/npm/dt/vue3-numeric.svg?style=flat-square","shields":"https://img.shields.io/npm/dt/vue3-numeric.svg","content":"https://img.shields.io/npm/dt/vue3-numeric.json"},"info":{"service":"npm","type":"downloads","modifiers":{"type":"dt"}}},{"urls":{"original":"https://img.shields.io/npm/dm/vue3-numeric.svg?style=flat-square","shields":"https://img.shields.io/npm/dm/vue3-numeric.svg","content":"https://img.shields.io/npm/dm/vue3-numeric.json"},"info":{"service":"npm","type":"downloads","modifiers":{"type":"dm"}}},{"urls":{"original":"https://img.shields.io/npm/l/vue3-numeric.svg?style=flat-square","shields":"https://img.shields.io/npm/l/vue3-numeric.svg","content":"https://img.shields.io/npm/l/vue3-numeric.json"},"info":{"service":"npm","type":"license","modifiers":{"type":"l"}}}]}},"evaluation":{"quality":{"carefulness":0.7899999999999999,"tests":0,"health":1,"branding":0.6},"popularity":{"communityInterest":2,"downloadsCount":74.33333333333333,"downloadsAcceleration":1.2738013698630137,"dependentsCount":0},"maintenance":{"releasesFrequency":0.858304794520548,"commitsFrequency":0.5120547945205479,"openIssues":0.7,"issuesDistribution":0.7}},"score":{"final":0.5460768061236329,"detail":{"quality":0.6228219427943767,"popularity":0.02890353715490395,"maintenance":0.9974685293745815}}}