{"id":20461336,"url":"https://github.com/persian-tools/vue-persian-tools","last_synced_at":"2025-04-13T06:17:13.973Z","repository":{"id":41850809,"uuid":"344896529","full_name":"persian-tools/vue-persian-tools","owner":"persian-tools","description":"Persian tools wrapper for vue.js","archived":false,"fork":false,"pushed_at":"2023-12-15T14:33:36.000Z","size":3614,"stargazers_count":25,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T06:17:01.859Z","etag":null,"topics":["card-number","fuzzy-matching","iban","number-to-words","persian","persian-language","vue","words-to-numbers"],"latest_commit_sha":null,"homepage":"https://persian-tools.github.io/vue-persian-tools/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/persian-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-05T18:16:41.000Z","updated_at":"2024-07-29T12:45:13.000Z","dependencies_parsed_at":"2024-11-15T12:37:55.774Z","dependency_job_id":null,"html_url":"https://github.com/persian-tools/vue-persian-tools","commit_stats":{"total_commits":222,"total_committers":3,"mean_commits":74.0,"dds":"0.24774774774774777","last_synced_commit":"5775bcae7e021caebccf96649f54ab87937d3561"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persian-tools%2Fvue-persian-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persian-tools%2Fvue-persian-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persian-tools%2Fvue-persian-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persian-tools%2Fvue-persian-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/persian-tools","download_url":"https://codeload.github.com/persian-tools/vue-persian-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670437,"owners_count":21142905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["card-number","fuzzy-matching","iban","number-to-words","persian","persian-language","vue","words-to-numbers"],"created_at":"2024-11-15T12:24:50.528Z","updated_at":"2025-04-13T06:17:13.953Z","avatar_url":"https://github.com/persian-tools.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cp align=\"center\"\u003e\n\t\t\u003cimg src=\"https://github.com/persian-tools/react-persian-tools/raw/master/images/logo.png\" width=\"200\"\u003e\n\t\u003c/p\u003e\n  \u003ch1 align=\"center\"\u003eVue persian tools\u003c/h1\u003e\n  \u003cp align=\"center\"\u003ePersian tools wrapper for vue.js\u003c/p\u003e\n\t\n![CI/CD](https://github.com/persian-tools/vue-persian-tools/actions/workflows/storybook.yml/badge.svg)\n![CI/CD](https://github.com/persian-tools/vue-persian-tools/actions/workflows/continuous-integration.yml/badge.svg)\n![codecov](https://codecov.io/gh/persian-tools/vue-persian-tools/branch/master/graph/badge.svg)\n[![GitHub license](https://img.shields.io/github/license/persian-tools/vue-persian-tools)](https://github.com/persian-tools/vue-persian-tools/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](https://github.com/persian-tools/vue-persian-tools/compare) \n[![CodeFactor](https://www.codefactor.io/repository/github/persian-tools/vue-persian-tools/badge)](https://www.codefactor.io/repository/github/persian-tools/vue-persian-tools)\n\u003c/div\u003e\n\n---\n\n### [See demo](https://persian-tools.github.io/vue-persian-tools)\n\n### [Persian tools repo](https://github.com/persian-tools/persian-tools)\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n### Installation\n\nnpm\n\n```bash\nnpm i @persian-tools/vue-persian-tools\n```\n\n**⚠️ If you are using vue2 you need to install composition api alongside the main package**\n\n```bash\nnpm i @vue/composition-api\n```\n\n### Usage\n\n```js\n// in vue 2\nimport Vue from \"vue\";\nimport tools from \"@persian-tools/vue-persian-tools\";\n\nVue.use(tools, {\n    components: true,\n    directives: true\n});\n\n// in vue 3\nimport tools from \"@persian-tools/vue-persian-tools\";\ncreateApp(App).use(tools, options);\n```\n\nthis way, you can install directives \u0026 components globally.\nby default only components will install globally. by passing `directives: true` to plugin options you can also enable directives\n\n```js\n{\n    components: false, // it wont install components\n    directives: true, // install directives globally\n}\n```\n\nYou can also install components \u0026 directives globally by their names.\n\n```js\n{\n    components: ['isPersian', 'addOrdinalSuffix', '...'],\n    directives: ['halfSpace'],\n}\n```\n\nOr import them locally\n\n```js\n// import components from module directory\nimport { halfSpace } from \"@persian-tools/vue-persian-tools/dist/modules\";\n// import directives from directive directory\nimport { numberToWords, removeOrdinalSuffix } from \"@persian-tools/vue-persian-tools/dist/directives\";\n\nexport default {\n    // install locally\n    directives: { numberToWords, removeOrdinalSuffix },\n    components: { halfSpace }\n};\n```\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n## components\n\n### `tag prop`\n\nevery component accept a `tag` prop. you can use it to customize component html tag. default is `span`\n\n```js\n\u003cis-persian tag=\"div\"\u003e\u003c/is-persian\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `isPersian` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-ispersian--default)\n\n**slots**:\n\u003cbr /\u003e\n`isPersian`: boolean\n\n```html\n\u003cis-persian :str=\"text\" :isComplex=\"complex\" :trimPattern=\"trim\" v-slot=\"{isPersian}\"\u003e{{ isPersian }}\u003c/is-persian\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `URLfix` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-urlfix--default)\n\n**slots**:\n\u003cbr /\u003e\n`url`: string\n\n```html\n\u003cURLfix :url=\"your url\" v-slot=\"{ url }\"\u003efixed URL: \u003cb\u003e{{ url }}\u003c/b\u003e\u003c/URLfix\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `Sheba` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-sheba--default)\n\n**slots**:\n\u003cbr /\u003e\n`isValid`: boolean\n\u003cbr /\u003e\n`info`: ShebaResult\n\n```html\n\u003cSheba :shebaCode=\"code\" v-slot=\"{ isValid, info }\"\u003e\n    is sheba valid: {{ isValid }}\n\n    \u003ch3\u003einfo about sheba\u003c/h3\u003e\n    \u003cp\u003enickname: {{ info.nickname }}\u003c/p\u003e\n    \u003cp\u003ename: {{ info.name }}\u003c/p\u003e\n    \u003cp\u003epersianName: {{ info.persianName }}\u003c/p\u003e\n    \u003cp\u003ecode: {{ info.code }}\u003c/p\u003e\n    \u003cp\u003eaccountNumberAvailable: {{ info.accountNumberAvailable }}\u003c/p\u003e\n\u003c/Sheba\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `addOrdinalSuffix` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-addordinalsuffix--default)\n\n**slots**:\n\u003cbr /\u003e\n`text`: string\n\n```html\n\u003caddOrdinalSuffix :number=\"text\" v-slot=\"{ text }\"\u003e{{ text }}\u003c/addOrdinalSuffix\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `bill` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-bill--default)\n\n**slots**:\n\u003cbr /\u003e\n`result`: billResult\n\u003cbr /\u003e\n`amount`: number\n\u003cbr /\u003e\n`type`: billType\n\u003cbr /\u003e\n`isBillValid`: boolean\n\u003cbr /\u003e\n`isBillIdValid`: boolean\n\u003cbr /\u003e\n`isBillPaymentValid`: boolean\n\n```html\n\u003cbill :bill=\"val\" v-slot=\"{ result, amount, type, isBillValid, isBillIdValid, isBillPaymentValid }\"\u003e\n    \u003cp\u003eresult of bill:{{ result }}\u003c/p\u003e\n    \u003cp\u003eamount:{{ amount }}\u003c/p\u003e\n    \u003cp\u003ebill type:{{ type }}\u003c/p\u003e\n    \u003cp\u003eis bill valid:{{ isBillValid }}\u003c/p\u003e\n    \u003cp\u003eis bill id valid:{{ isBillIdValid }}\u003c/p\u003e\n    \u003cp\u003eis bill payment id valid:{{ isBillPaymentValid }}\u003c/p\u003e\n\u003c/bill\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `commas` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-commas--default)\n\n**slots**:\n\u003cbr /\u003e\n`number`: number | string\n\n```html\n\u003cdiv\u003e\n    \u003caddCommas :number=\"your number...\" v-slot=\"{ number }\"\u003e {{ number }}\u003c/addCommas\u003e\n    \u003cremoveCommas :number=\"your number...\" v-slot=\"{ number }\"\u003e{{ number }}\u003c/removeCommas\u003e\n\u003c/div\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `digits` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-digits--default)\n\n**slots**:\n\u003cbr /\u003e\n`value`: string\n\n```html\n\u003cdigits :number=\"input number...\" :convert=\"language to convert...\" v-slot=\"{ value }\"\u003econverted to: {{ value }}\u003c/digits\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `extractCardNumber` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-extractcardnumber--default)\n\n**slots**:\n\u003cbr /\u003e\n`cards`: ExtractCardNumber[]\n\u003cbr /\u003e\n`valid`: ExtractCardNumber[]\n\n```html\n\u003cextractCardNumber :str=\"val\" v-slot=\"{ cards, valid }\"\u003e\n    \u003cul\u003e\n        \u003ch4\u003eall extracted cards:\u003c/h4\u003e\n        \u003cli v-for=\"(card, i) in cards\" :key=\"i\"\u003e\n            \u003cp\u003eindex: {{ card.index }}\u003c/p\u003e\n            \u003cp\u003epure: {{ card.pure }}\u003c/p\u003e\n            \u003cp\u003ebase: {{ card.base }}\u003c/p\u003e\n            \u003cp\u003eisValid: {{ card.isValid }}\u003c/p\u003e\n        \u003c/li\u003e\n        \u003cli v-for=\"(card, i) in valid\" :key=\"i\"\u003e\n            \u003cp\u003eindex: {{ card.index }}\u003c/p\u003e\n            \u003cp\u003epure: {{ card.pure }}\u003c/p\u003e\n            \u003cp\u003ebase: {{ card.base }}\u003c/p\u003e\n            \u003cp\u003eisValid: {{ card.isValid }}\u003c/p\u003e\n        \u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/extractCardNumber\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `getBankNameFromCardNumber` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-getbanknamefromcardnumber--default)\n\n**slots**:\n\u003cbr /\u003e\n`bankName`: string\n\n```html\n\u003cgetBankNameFromCardNumber :digits=\"card_number...\" v-slot=\"{ bankName }\"\u003e {{ bankName }}\u003c/getBankNameFromCardNumber\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `getPlaceByIranNationalId` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-getplacebyirannationalid--default)\n\n**slots**:\n\u003cbr /\u003e\n`city`: string\n\u003cbr /\u003e\n`codes`: string[]\n\u003cbr /\u003e\n`province`: string\n\n```html\n\u003cgetPlaceByIranNationalId :nationalId=\"id...\" v-slot=\"{ city, codes, province }\"\u003e\n    city: \u003cb\u003e {{ city }} \u003c/b\u003e \u003cbr /\u003e\n    province: \u003cb\u003e {{ province}} \u003c/b\u003e codes: \u003cb\u003e {{ codes }} \u003c/b\u003e\n\u003c/getPlaceByIranNationalId\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `halfSpace` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-halfspace--default)\n\n**slots**:\n\u003cbr /\u003e\n`text`: string\n\n```html\n\u003chalfSpace :str=\"text\" v-slot=\"{ text }\"\u003e{{ text }}\u003c/halfSpace\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `hasPersian` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-haspersian--default)\n\n**slots**:\n\u003cbr /\u003e\n`hasPersian`: boolean\n\n```html\n\u003chasPersian :str=\"text\" v-slot=\"{ hasPersian }\"\u003e{{ hasPersian }}\u003c/hasPersian\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `isArabic` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-isarabic--default)\n\n**slots**:\n\u003cbr /\u003e\n`isArabic`: boolean\n\n```html\n\u003cisArabic :str=\"text\" :trimPattern=\"trim\" v-slot=\"{ isArabic }\"\u003e{{ isArabic }}\u003c/isArabic\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `numberToWords` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-numbertowords--default)\n\n**slots**:\n\u003cbr /\u003e\n`words`: string\n\n```html\n\u003cnumberToWords :number=\"val\" v-slot=\"{ words }\"\u003e{{ words }}\u003c/numberToWords\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `phoneNumber` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-phonenumber--default)\n\n**slots**:\n\u003cbr /\u003e\n`details`: OperatorModel | null\n\u003cbr /\u003e\n`isValid`: boolean\n\n```html\n\u003cphoneNumber :number=\"val\" v-slot=\"{ details, isValid }\"\u003e\n    \u003cp\u003edetails: {{ details }}\u003c/p\u003e\n    \u003cp\u003eis phone number valid: {{ isValid }}\u003c/p\u003e\n\u003c/phoneNumber\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `removeOrdinalSuffix` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-removeordinalsuffix--default)\n\n**slots**:\n\u003cbr /\u003e\n`text`: string\n\n```html\n\u003cremoveOrdinalSuffix :number=\"text\" v-slot=\"{ text }\"\u003e\u003cb\u003e{{ text }}\u003c/b\u003e\u003c/removeOrdinalSuffix\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `toPersianChars` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-topersianchars--default)\n\n**slots**:\n\u003cbr /\u003e\n`text`: string\n\n```html\n\u003ctoPersianChars :str=\"val\" v-slot=\"{ text }\"\u003e{{ text }}\u003c/toPersianChars\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `verifyCardNumber` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-verifycardnumber--default)\n\n**slots**:\n\u003cbr /\u003e\n`isValid`: boolean\n\n```html\n\u003cverifyCardNumber :digits=\"text\" v-slot=\"{ isValid }\"\u003e{{ isValid }}\u003c/verifyCardNumber\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `verifyIranianNationalId` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-verifyiraniannationalid--default)\n\n**slots**:\n\u003cbr /\u003e\n`isValid`: boolean\n\n```html\n\u003cverifyIranianNationalId :nationalId=\"text\" v-slot=\"{ isValid }\"\u003e{{ isValid }}\u003c/verifyIranianNationalId\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `wordsToNumber` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-wordstonumber--default)\n\n**slots**:\n\u003cbr /\u003e\n`number`: number\n\n```html\n\u003cwordsToNumber :words=\"val...\" fuzzy addCommas v-slot=\"{ number }\"\u003e{{ number }}\u003c/wordsToNumber\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `plate` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-plate--default)\n\n**slots**:\n\u003cbr /\u003e\n`number`: String | PlateOptions\n\n```html\n\u003cplate number=\"12D45147\" v-slot=\"{ info, isValid }\"\u003e{{ info }} | {{ isValid }}\u003c/plate\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `timeAgo` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/modules-timeago--default)\n\n**slots**:\n\u003cbr /\u003e\n`date`: String\n\n```html\n\u003ctimeAgo date=\"1400/04/07 18:00:00\" v-slot=\"{ time }\"\u003e{{ time }}\u003c/timeAgo\u003e\n```\n\n\u003cbr /\u003e\n\n## directives\n\nall directives have sync modifiers. using this modifier will enable reactive data in your directive.\n\n### `halfSpace directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-halfspace--default)\n\n```html\n\u003cspan v-half-space\u003eyour text\u003c/span\u003e \u003cinput :value=\"text\" v-half-space.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `toPersian directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-topersian--default)\n\n```html\n\u003cspan v-to-persian\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-to-persian.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `URLFix directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-topersian--default)\n\n```html\n\u003cspan v-url-fix\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-url-fix.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `addOrdinalSuffix directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-addordinalsuffix--default)\n\n```html\n\u003cspan v-add-ordinal-suffix\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-add-ordinal-suffix.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `removeOrdinalSuffix directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-removeordinalsuffix--default)\n\n```html\n\u003cspan v-remove-ordinal-suffix\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-remove-ordinal-suffix.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `numberToWords directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-numbertowords--default)\n\n```html\n\u003cspan v-number-to-words\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-number-to-words.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n### `wordsToNumber directive` [See details](https://persian-tools.github.io/vue-persian-tools/?path=/docs/directives-wordsToNumber--default)\n\n**modifires**:\n\u003cbr /\u003e\n`addCommas`, `fuzzy`\n\u003cbr /\u003e\n**argument**:\n\u003cbr /\u003e\n`digits`: 'fa' | 'en' | 'ar'\n\n```html\n\u003cspan v-words-to-number:fa.addCommas\u003e...\u003c/span\u003e \u003cinput :value=\"text\" v-words-to-number:en.fuzzy.sync /\u003e\n```\n\n\u003cbr /\u003e\n\n---\n\n## Contributing\n\ncheck [Contributing.md](https://github.com/persian-tools/vue-persian-tools/blob/master/.github/contributing.md) for more information\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/persian-tools/vue-persian-tools/blob/master/LICENSE) file for details.\n\n## Changelogs\n\n-   [changelog](https://github.com/persian-tools/vue-persian-tools/blob/master/CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersian-tools%2Fvue-persian-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpersian-tools%2Fvue-persian-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersian-tools%2Fvue-persian-tools/lists"}