@citizenplane/pimp 9.7.3 → 9.7.4
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/dist/pimp.es.js +585 -582
- package/dist/pimp.umd.js +15 -15
- package/package.json +1 -1
- package/src/components/CpTelInput.vue +11 -0
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
placeholder="Enter your phone number"
|
|
17
17
|
valid-characters-only
|
|
18
18
|
@close="focusOnInput"
|
|
19
|
+
@country-changed="handleCountryChanged"
|
|
19
20
|
@open="handleDropdownOpen"
|
|
20
21
|
>
|
|
21
22
|
<template #arrow-icon>
|
|
@@ -73,6 +74,12 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
73
74
|
size: Sizes.MD,
|
|
74
75
|
})
|
|
75
76
|
|
|
77
|
+
const emit = defineEmits<Emits>()
|
|
78
|
+
|
|
79
|
+
interface Emits {
|
|
80
|
+
(e: 'countryChanged', countryCode: string): void
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
const inputModel = defineModel<string>()
|
|
77
84
|
const telInputRef = ref<HTMLInputElement | null>(null)
|
|
78
85
|
|
|
@@ -128,6 +135,10 @@ const handleDropdownOpen = async () => {
|
|
|
128
135
|
|
|
129
136
|
setTimeout(() => searchBox.focus(), 1)
|
|
130
137
|
}
|
|
138
|
+
|
|
139
|
+
const handleCountryChanged = (country: { iso2: string }) => {
|
|
140
|
+
emit('countryChanged', country?.iso2 || '')
|
|
141
|
+
}
|
|
131
142
|
</script>
|
|
132
143
|
|
|
133
144
|
<style lang="scss">
|