@citizenplane/pimp 14.0.1 → 14.0.2
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 +3 -1
- package/dist/pimp.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpTelInput.vue +4 -1
- package/src/stories/CpTelInput.stories.ts +13 -0
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
v-model="inputModel"
|
|
10
10
|
class="cpTelInput__wrapper"
|
|
11
11
|
:class="wrapperDynamicClasses"
|
|
12
|
+
:default-country
|
|
12
13
|
:disabled
|
|
13
14
|
:dropdown-options
|
|
14
15
|
:input-options
|
|
@@ -49,6 +50,7 @@ import { capitalizeFirstLetter } from '@/helpers'
|
|
|
49
50
|
|
|
50
51
|
interface Props {
|
|
51
52
|
autofocus?: boolean
|
|
53
|
+
defaultCountry?: string
|
|
52
54
|
disabled?: boolean
|
|
53
55
|
errorMessage?: string
|
|
54
56
|
help?: string
|
|
@@ -75,6 +77,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
75
77
|
name: '',
|
|
76
78
|
hideSearch: false,
|
|
77
79
|
size: 'md',
|
|
80
|
+
defaultCountry: undefined,
|
|
78
81
|
})
|
|
79
82
|
|
|
80
83
|
const emit = defineEmits<Emits>()
|
|
@@ -383,7 +386,7 @@ const handleOnValidate = (phoneObject: PhoneObject) => {
|
|
|
383
386
|
}
|
|
384
387
|
|
|
385
388
|
&.below {
|
|
386
|
-
top: var(--cp-dimensions-10) + var(--cp-spacing-md);
|
|
389
|
+
top: calc(var(--cp-dimensions-10) + var(--cp-spacing-md));
|
|
387
390
|
}
|
|
388
391
|
|
|
389
392
|
&.above {
|
|
@@ -33,3 +33,16 @@ export const Default: Story = {
|
|
|
33
33
|
template: `<CpTelInput v-bind="args" />`,
|
|
34
34
|
}),
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
export const WithDefaultCountry: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
defaultCountry: 'us',
|
|
40
|
+
},
|
|
41
|
+
render: (args) => ({
|
|
42
|
+
components: { CpTelInput },
|
|
43
|
+
setup() {
|
|
44
|
+
return { args }
|
|
45
|
+
},
|
|
46
|
+
template: `<CpTelInput v-bind="args" />`,
|
|
47
|
+
}),
|
|
48
|
+
}
|