@desource/phone-mask-nuxt 0.2.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/LICENSE +1 -1
- package/README.md +18 -10
- package/dist/module.json +1 -1
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @desource/phone-mask-nuxt
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Core Upgrades:
|
|
8
|
+
- Refactored core architecture for better separation of concerns and reusability
|
|
9
|
+
- Added zero-config browser script support path
|
|
10
|
+
- Improved Intl.DisplayNames caching for performance
|
|
11
|
+
- Fixed various edge cases in formatting and event handling
|
|
12
|
+
- Added comprehensive unit tests for core utilities and handlers
|
|
13
|
+
|
|
14
|
+
- React Upgrades:
|
|
15
|
+
- Major internal refactor to a controlled pattern with consistent hooks
|
|
16
|
+
- Improved React 18/19 compatibility for ref behavior
|
|
17
|
+
- Added and expanded unit/e2e tests for React components and behavior
|
|
18
|
+
|
|
19
|
+
- Vue Upgrades:
|
|
20
|
+
- Refactored to align composable structure and reuse core utilities
|
|
21
|
+
- Fixed directive behavior for external value updates and dropdown close logic
|
|
22
|
+
- Added substantial unit/e2e test coverage for Vue composables and directive
|
|
23
|
+
|
|
24
|
+
- 🚀 Svelte Upgrades:
|
|
25
|
+
- Introduced Svelte version of phone-mask library
|
|
26
|
+
|
|
27
|
+
- Nuxt Upgrades:
|
|
28
|
+
- Added full test foundation with @nuxt/test-utils
|
|
29
|
+
- Added unit tests for module and runtime behavior
|
|
30
|
+
- Added e2e fixtures/tests and shared e2e utilities
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies []:
|
|
35
|
+
- @desource/phone-mask-vue@1.0.0
|
|
36
|
+
|
|
37
|
+
## 0.3.0
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- React: Design React version of phone-mask library
|
|
42
|
+
- Core: Add geoip reusable service for country detection based on IP address
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies []:
|
|
47
|
+
- @desource/phone-mask-vue@0.3.0
|
|
48
|
+
|
|
3
49
|
## 0.2.3
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -92,12 +92,19 @@ const onCountryChange = (country) => {
|
|
|
92
92
|
</div>
|
|
93
93
|
</template>
|
|
94
94
|
|
|
95
|
-
<script setup>
|
|
95
|
+
<script setup lang="ts">
|
|
96
|
+
import { ref } from 'vue';
|
|
97
|
+
import type { PMaskPhoneNumber } from '#imports';
|
|
98
|
+
|
|
96
99
|
const selectedCountry = ref('US');
|
|
97
|
-
const phone = ref(
|
|
100
|
+
const phone = ref<PMaskPhoneNumber>({
|
|
101
|
+
full: '',
|
|
102
|
+
fullFormatted: '',
|
|
103
|
+
digits: ''
|
|
104
|
+
});
|
|
98
105
|
|
|
99
|
-
const handleChange = (
|
|
100
|
-
phone.value =
|
|
106
|
+
const handleChange = (nextPhone: PMaskPhoneNumber) => {
|
|
107
|
+
phone.value = nextPhone;
|
|
101
108
|
};
|
|
102
109
|
</script>
|
|
103
110
|
```
|
|
@@ -170,10 +177,9 @@ Then import manually where needed:
|
|
|
170
177
|
|
|
171
178
|
## 🔧 TypeScript
|
|
172
179
|
|
|
173
|
-
The module provides automatic TypeScript support.
|
|
180
|
+
The module provides automatic TypeScript support. You can import Nuxt-registered types from `#imports`:
|
|
174
181
|
|
|
175
182
|
```ts
|
|
176
|
-
// Auto-imported types
|
|
177
183
|
import type {
|
|
178
184
|
PCountryKey,
|
|
179
185
|
PMaskBase,
|
|
@@ -185,7 +191,7 @@ import type {
|
|
|
185
191
|
PMaskFull,
|
|
186
192
|
PMaskFullMap,
|
|
187
193
|
PMaskPhoneNumber
|
|
188
|
-
} from '#
|
|
194
|
+
} from '#imports';
|
|
189
195
|
```
|
|
190
196
|
|
|
191
197
|
## 📚 Examples
|
|
@@ -307,7 +313,7 @@ const submit = async () => {
|
|
|
307
313
|
|
|
308
314
|
```vue
|
|
309
315
|
<template>
|
|
310
|
-
<PhoneInput v-model="phone" :locale="$i18n.locale" :placeholder="$t('phone.
|
|
316
|
+
<PhoneInput v-model="phone" :locale="$i18n.locale" :search-placeholder="$t('phone.searchPlaceholder')" />
|
|
311
317
|
</template>
|
|
312
318
|
|
|
313
319
|
<script setup>
|
|
@@ -354,7 +360,7 @@ If you're migrating from the Vue plugin:
|
|
|
354
360
|
```ts
|
|
355
361
|
// main.ts
|
|
356
362
|
import PhoneMaskPlugin from '@desource/phone-mask-vue';
|
|
357
|
-
import '@desource/phone-mask-vue/
|
|
363
|
+
import '@desource/phone-mask-vue/assets/lib.css';
|
|
358
364
|
|
|
359
365
|
app.use(PhoneMaskPlugin);
|
|
360
366
|
```
|
|
@@ -382,10 +388,12 @@ No changes needed in your components!
|
|
|
382
388
|
|
|
383
389
|
- [@desource/phone-mask](../phone-mask) — Core library
|
|
384
390
|
- [@desource/phone-mask-vue](../phone-mask-vue) — Vue 3 component
|
|
391
|
+
- [@desource/phone-mask-react](../phone-mask-react) — React bindings
|
|
392
|
+
- [@desource/phone-mask-svelte](../phone-mask-svelte) — Svelte bindings
|
|
385
393
|
|
|
386
394
|
## 📄 License
|
|
387
395
|
|
|
388
|
-
[MIT](../../LICENSE) ©
|
|
396
|
+
[MIT](../../LICENSE) © 2026 DeSource Labs
|
|
389
397
|
|
|
390
398
|
## 🤝 Contributing
|
|
391
399
|
|
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desource/phone-mask-nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "🎯 Zero-config Nuxt module for international phone masking. Powered by @desource/phone-mask with Google libphonenumber sync.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -54,17 +54,22 @@
|
|
|
54
54
|
"vue": "^3.4.33"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@desource/phone-mask-vue": "0.
|
|
57
|
+
"@desource/phone-mask-vue": "1.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@nuxt/kit": "^4.3.1",
|
|
61
61
|
"@nuxt/module-builder": "^1.0.2",
|
|
62
|
+
"@nuxt/test-utils": "^4.0.0",
|
|
62
63
|
"nuxt": "^4.3.1",
|
|
63
|
-
"vue": "^3.5.
|
|
64
|
+
"vue": "^3.5.29"
|
|
64
65
|
},
|
|
65
66
|
"scripts": {
|
|
66
67
|
"dev:prepare": "nuxt prepare",
|
|
67
|
-
"clean": "rimraf dist",
|
|
68
|
-
"build": "pnpm dev:prepare && nuxt-module-build build"
|
|
68
|
+
"clean": "rimraf dist .nuxt coverage",
|
|
69
|
+
"build:internal": "pnpm dev:prepare && nuxt-module-build build",
|
|
70
|
+
"build": "pnpm clean && pnpm build:internal",
|
|
71
|
+
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
72
|
+
"test:unit:coverage": "vitest run --config vitest.unit.config.ts --coverage.enabled --coverage.provider=v8 --coverage.reporter=lcov --coverage.reportsDirectory=coverage",
|
|
73
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts"
|
|
69
74
|
}
|
|
70
75
|
}
|