Skip to content

Commit

Permalink
feature: rewrite to Composition API (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil4udo committed Mar 31, 2024
1 parent 734646e commit a23eab5
Show file tree
Hide file tree
Showing 11 changed files with 1,106 additions and 943 deletions.
8 changes: 4 additions & 4 deletions docs/others/v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ Read more on `vue-form-generator`'s [instruction page](https://icebob.gitbooks.i
| ----- | --------- | ----------- | ----- |
| `input` | `String`, `Object` | Fires when the input changes with the argument is the object includes `{ number, isValid, country }` | `onInput` deprecated |
| `validate` | `Object` | Fires when the correctness of the phone number changes (from `true` to `false` or vice-versa) and when the component is mounted `{ number, isValid, country }` | `onValidate` deprecated |
| `blur` | | Fires on blur event | `onBlur` deprecated |
| `focus` | | Fires on focus event | |
| `space` | | Fires on keyup.space event | `onSpace` deprecated |
| `enter` | | Fires on keyup.enter event | `onEnter` deprecated |
| `blur` | `FocusEvent` | Fires on blur event | `onBlur` deprecated |
| `focus` | `FocusEvent` | Fires on focus event | |
| `space` | `KeyboardEvent` | Fires on keyup.space event | `onSpace` deprecated |
| `enter` | `KeyboardEvent` | Fires on keyup.enter event | `onEnter` deprecated |
| `open` | | Fires when the flags dropdown opens | |
| `close` | | Fires when the flags dropdown closes | |
| `country-changed` | `Object` | Fires when country changed (even for the first time) | Available from [v2.4.2](https://github.com/iamstevendao/vue-tel-input/releases/tag/v2.4.2) |
Expand Down
330 changes: 152 additions & 178 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"module": "./dist/vue-tel-input.js",
"scripts": {
"dev": "vitepress dev docs",
"test": "vitest --ui",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"docs:dev": "vitepress dev docs",
Expand All @@ -29,17 +30,21 @@
},
"dependencies": {
"libphonenumber-js": "^1.10.51",
"vue": "^3.3.9"
"vue": "^3.4.21"
},
"files": [
"dist"
],
"devDependencies": {
"@vitejs/plugin-vue": "^4.5.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vitest/ui": "^1.4.0",
"@vue/test-utils": "^2.4.5",
"jsdom": "^24.0.0",
"typescript": "^5.3.2",
"vite": "^5.0.2",
"vitepress": "^1.0.0-rc.31",
"vue-tsc": "^1.8.22"
"vitest": "^1.4.0",
"vue-tsc": "^2.0.6"
},
"keywords": [
"vue",
Expand Down
8 changes: 6 additions & 2 deletions src/assets/all-countries.js → src/assets/all-countries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// A fork of https://github.com/jackocnr/intl-tel-input/blob/master/src/js/data.js

import type { Country, CountryObject } from "../types";


// Array of country objects for the flag dropdown.

// Here is the criteria for the plugin to support a given country/territory
Expand All @@ -16,7 +19,8 @@
// Order (if >1 country with same dial code),
// Area codes
// ]
const allCountries = [

const allCountries: Country[] = [
[
'Afghanistan (‫افغانستان‬‎)',
'af',
Expand Down Expand Up @@ -1330,4 +1334,4 @@ export default allCountries.map(([name, iso2, dialCode, priority = 0, areaCodes
dialCode,
priority,
areaCodes,
}));
})) as CountryObject[];
261 changes: 0 additions & 261 deletions src/components/vue-tel-input.test.js

This file was deleted.

0 comments on commit a23eab5

Please sign in to comment.