v-phone-input
Version:
International phone field for Vuetify 3 and Vue 3.
321 lines (320 loc) • 25.8 kB
TypeScript
import { VSelect } from 'vuetify/components';
import { VPhoneCountryInputComponent, VPhoneInputCountryObject, VPhoneInputExposed } from '../types';
declare const _default: <Country extends VPhoneInputCountryObject = VPhoneInputCountryObject, CountryInputComponent extends VPhoneCountryInputComponent = typeof VSelect>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
props: __VLS_PrettifyLocal<Pick<Partial<{
type: string;
active: boolean;
autofocus: boolean;
centerAffix: boolean;
clearIcon: import('vuetify/lib/composables/icons.mjs').IconValue;
clearable: boolean;
density: import('vuetify/lib/composables/density.mjs').Density;
dirty: boolean;
disabled: boolean;
error: boolean;
errorMessages: string | readonly string[] | null;
flat: boolean;
focused: boolean;
glow: boolean;
hideSpinButtons: boolean;
maxErrors: string | number;
messages: string | readonly string[];
persistentClear: boolean;
persistentCounter: boolean;
persistentHint: boolean;
persistentPlaceholder: boolean;
readonly: boolean | null;
reverse: boolean;
rounded: string | number | boolean;
rules: readonly (string | boolean | PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult> | [string, any, (string | undefined)?] | ((value: any) => import('vuetify/lib/composables/validation.mjs').ValidationResult) | ((value: any) => PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult>))[];
singleLine: boolean;
style: import('vue').StyleValue;
tile: boolean;
variant: "filled" | "outlined" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
displayFormatDelay: number | boolean;
displayFormatOnBlur: boolean;
readonly guessLoading: boolean;
}> & Omit<{
readonly type: string;
readonly active: boolean;
readonly autofocus: boolean;
readonly clearIcon: import('vuetify/lib/composables/icons.mjs').IconValue;
readonly clearable: boolean;
readonly density: import('vuetify/lib/composables/density.mjs').Density;
readonly dirty: boolean;
readonly disabled: boolean;
readonly error: boolean;
readonly errorMessages: string | readonly string[] | null;
readonly flat: boolean;
readonly focused: boolean;
readonly glow: boolean;
readonly hideSpinButtons: boolean;
readonly maxErrors: string | number;
readonly messages: string | readonly string[];
readonly persistentClear: boolean;
readonly persistentCounter: boolean;
readonly persistentHint: boolean;
readonly persistentPlaceholder: boolean;
readonly readonly: boolean | null;
readonly reverse: boolean;
readonly rules: readonly (string | boolean | PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult> | [string, any, (string | undefined)?] | ((value: any) => import('vuetify/lib/composables/validation.mjs').ValidationResult) | ((value: any) => PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult>))[];
readonly singleLine: boolean;
readonly style: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
readonly tile: boolean;
readonly variant: "filled" | "outlined" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
readonly displayFormatDelay: number | boolean;
readonly displayFormatOnBlur: boolean;
readonly guessLoading: boolean;
readonly ariaLabel?: import('../types').VPhoneInputMessage<Country, undefined> | null | undefined;
readonly autocomplete?: string | undefined;
readonly centerAffix?: boolean | undefined;
readonly id?: string | undefined;
readonly name?: string | undefined;
readonly placeholder?: import('../types').VPhoneInputMessage<Country> | null | undefined;
readonly prefix?: string | undefined;
readonly role?: string | undefined;
readonly rounded?: string | number | boolean | undefined;
readonly validate?: ((phone: import('awesome-phonenumber').ParsedPhoneNumber | null, country: Country) => boolean) | null | undefined;
readonly width?: string | number | undefined;
readonly theme?: string | undefined;
readonly class?: any;
readonly "onUpdate:focused"?: ((args_0: boolean) => void) | undefined;
readonly modelValue?: any;
readonly validateOn?: "blur" | "eager" | "blur eager" | "blur lazy" | "eager blur" | "eager input" | "eager invalid-input" | "eager submit" | "input eager" | "input lazy" | "invalid-input eager" | "invalid-input lazy" | "lazy" | "lazy blur" | "lazy input" | "lazy invalid-input" | "lazy submit" | "submit eager" | "submit lazy" | "input" | "invalid-input" | "submit" | undefined;
readonly validationValue?: any;
readonly maxWidth?: string | number | undefined;
readonly minWidth?: string | number | undefined;
readonly loading?: string | boolean | undefined;
readonly appendIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
readonly prependIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
readonly hideDetails?: boolean | "auto" | undefined;
readonly hint?: import('../types').VPhoneInputMessage<Country> | undefined;
readonly "onClick:prepend"?: ((args_0: MouseEvent) => void) | undefined;
readonly "onClick:append"?: ((args_0: MouseEvent) => void) | undefined;
readonly appendInnerIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
readonly bgColor?: string | undefined;
readonly color?: string | undefined;
readonly baseColor?: string | undefined;
readonly iconColor?: string | boolean | undefined;
readonly label?: import('../types').VPhoneInputMessage<Country, undefined> | undefined;
readonly prependInnerIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
readonly "onClick:clear"?: ((args_0: MouseEvent) => void) | undefined;
readonly "onClick:appendInner"?: ((args_0: MouseEvent) => void) | undefined;
readonly "onClick:prependInner"?: ((args_0: MouseEvent) => void) | undefined;
readonly counter?: string | number | boolean | undefined;
readonly counterValue?: number | ((value: any) => number) | undefined;
readonly suffix?: string | undefined;
readonly modelModifiers?: Record<string, boolean> | undefined;
readonly countryLocale?: string | undefined;
readonly countryName?: ((iso2: string) => string) | undefined;
readonly countries?: Country[] | undefined;
readonly preferCountries?: import('../types').VPhoneInputCountryObjectOrIso2[] | undefined;
readonly includeCountries?: import('../types').VPhoneInputCountryObjectOrIso2[] | undefined;
readonly excludeCountries?: import('../types').VPhoneInputCountryObjectOrIso2[] | undefined;
readonly defaultCountry?: import('../types').VPhoneInputCountryObjectOrIso2 | undefined;
readonly exampleFormat?: import('awesome-phonenumber').PhoneNumberFormat | null | undefined;
readonly example?: import('../types').VPhoneInputMessage<Country, undefined, undefined> | undefined;
readonly countryLabel?: import('../types').VPhoneInputMessage<Country> | null | undefined;
readonly countryAriaLabel?: import('../types').VPhoneInputMessage<Country> | null | undefined;
readonly invalidMessage?: import('../types').VPhoneInputMessage<Country> | null | undefined;
readonly guessCountry?: import('../types').VPhoneInputCountryGuesser | undefined;
readonly modelFormat?: import('awesome-phonenumber').PhoneNumberFormat | null | undefined;
readonly displayFormat?: import('awesome-phonenumber').PhoneNumberFormat | null | undefined;
readonly countryInputComponent?: ([{
readonly type: import('vue').PropType<CountryInputComponent>;
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
readonly type: import('vue').PropType<CountryInputComponent>;
}) | undefined;
readonly countryInputComponentProps?: ([{
readonly type: import('vue').PropType<import('vue-component-type-helpers').ComponentProps<CountryInputComponent>>;
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
readonly type: import('vue').PropType<import('vue-component-type-helpers').ComponentProps<CountryInputComponent>>;
}) | undefined;
readonly countryDisplayComponent?: import('vue').Component<import('../types').VPhoneCountryDisplayProps<Country>> | undefined;
readonly wrapperAttrs?: (import('vue').HTMLAttributes & import('vue').ReservedProps & Record<string, unknown>) | undefined;
readonly countryProps?: ([{
readonly type: import('vue').PropType<import('vue-component-type-helpers').ComponentProps<CountryInputComponent>>;
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
readonly type: import('vue').PropType<import('vue-component-type-helpers').ComponentProps<CountryInputComponent>>;
}) | undefined;
readonly phoneProps?: NonNullable<Partial<{
style: import('vue').StyleValue;
focused: boolean;
errorMessages: string | readonly string[] | null;
maxErrors: string | number;
readonly: boolean | null;
rules: readonly (string | boolean | PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult> | ((value: any) => import('vuetify/lib/composables/validation.mjs').ValidationResult) | ((value: any) => PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult>) | [string, any, (string | undefined)?])[];
density: import('vuetify/lib/composables/density.mjs').Density;
rounded: string | number | boolean;
tile: boolean;
hideSpinButtons: boolean;
persistentHint: boolean;
messages: string | readonly string[];
clearable: boolean;
clearIcon: import('vuetify/lib/composables/icons.mjs').IconValue;
active: boolean;
centerAffix: boolean;
dirty: boolean;
disabled: boolean;
glow: boolean;
error: boolean;
flat: boolean;
persistentClear: boolean;
reverse: boolean;
singleLine: boolean;
variant: "filled" | "outlined" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
autofocus: boolean;
persistentPlaceholder: boolean;
persistentCounter: boolean;
type: string;
}> & Omit<{
style: string | false | import('vue').StyleValue[] | import('vue').CSSProperties | null;
focused: boolean;
errorMessages: string | readonly string[] | null;
maxErrors: string | number;
readonly: boolean | null;
rules: readonly (string | boolean | PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult> | ((value: any) => import('vuetify/lib/composables/validation.mjs').ValidationResult) | ((value: any) => PromiseLike<import('vuetify/lib/composables/validation.mjs').ValidationResult>) | [string, any, (string | undefined)?])[];
density: import('vuetify/lib/composables/density.mjs').Density;
tile: boolean;
hideSpinButtons: boolean;
persistentHint: boolean;
messages: string | readonly string[];
clearable: boolean;
clearIcon: import('vuetify/lib/composables/icons.mjs').IconValue;
active: boolean;
dirty: boolean;
disabled: boolean;
glow: boolean;
error: boolean;
flat: boolean;
persistentClear: boolean;
reverse: boolean;
singleLine: boolean;
variant: "filled" | "outlined" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
autofocus: boolean;
persistentPlaceholder: boolean;
persistentCounter: boolean;
type: string;
theme?: string | undefined | undefined;
class?: any;
"onUpdate:focused"?: (((args_0: boolean) => void) & ((focused: boolean) => any)) | undefined;
name?: string | undefined | undefined;
modelValue?: any;
validateOn?: ("blur eager" | "blur lazy" | "eager" | "eager blur" | "eager input" | "eager invalid-input" | "eager submit" | "input eager" | "input lazy" | "invalid-input eager" | "invalid-input lazy" | "lazy" | "lazy blur" | "lazy input" | "lazy invalid-input" | "lazy submit" | "submit eager" | "submit lazy" | ("blur" | "input" | "invalid-input" | "submit")) | undefined | undefined;
validationValue?: any;
rounded?: string | number | boolean | undefined | undefined;
maxWidth?: string | number | undefined | undefined;
minWidth?: string | number | undefined | undefined;
width?: string | number | undefined | undefined;
loading?: string | boolean | undefined | undefined;
id?: string | undefined | undefined;
appendIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
prependIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
hideDetails?: "auto" | boolean | undefined | undefined;
hint?: string | undefined | undefined;
"onClick:prepend"?: ((args_0: MouseEvent) => void) | undefined | undefined;
"onClick:append"?: ((args_0: MouseEvent) => void) | undefined | undefined;
appendInnerIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
bgColor?: string | undefined | undefined;
centerAffix?: boolean | undefined | undefined;
color?: string | undefined | undefined;
baseColor?: string | undefined | undefined;
iconColor?: string | boolean | undefined | undefined;
label?: string | undefined | undefined;
prependInnerIcon?: import('vuetify/lib/composables/icons.mjs').IconValue | undefined;
"onClick:clear"?: ((args_0: MouseEvent) => void) | undefined | undefined;
"onClick:appendInner"?: ((args_0: MouseEvent) => void) | undefined | undefined;
"onClick:prependInner"?: ((args_0: MouseEvent) => void) | undefined | undefined;
autocomplete?: string | undefined | undefined;
counter?: string | number | boolean | undefined | undefined;
counterValue?: number | ((value: any) => number) | undefined | undefined;
prefix?: string | undefined | undefined;
placeholder?: string | undefined | undefined;
suffix?: string | undefined | undefined;
role?: string | undefined | undefined;
modelModifiers?: Record<string, boolean> | undefined;
$children?: import('vue').VNodeChild | {
prepend?: ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
append?: ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
details?: ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
message?: ((arg: import('vuetify/lib/components/VMessages/VMessages.mjs').VMessageSlot) => import('vue').VNodeChild) | undefined;
clear?: ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined;
"prepend-inner"?: ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined;
"append-inner"?: ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined;
label?: ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
label: string | undefined;
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined;
loader?: ((arg: import('vuetify/lib/composables/loader.mjs').LoaderSlotProps) => import('vue').VNodeChild) | undefined;
default?: ((arg: {
id: Readonly<import('vue').Ref<string, string>>;
}) => import('vue').VNodeChild) | undefined;
counter?: ((arg: import('vuetify/lib/components/VCounter/VCounter.mjs').VCounterSlot) => import('vue').VNodeChild) | undefined;
} | {
$stable?: boolean | undefined;
} | ((arg: {
id: Readonly<import('vue').Ref<string, string>>;
}) => import('vue').VNodeChild);
"v-slots"?: {
prepend?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
append?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
details?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined;
message?: false | ((arg: import('vuetify/lib/components/VMessages/VMessages.mjs').VMessageSlot) => import('vue').VNodeChild) | undefined;
clear?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined;
"prepend-inner"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined;
"append-inner"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined;
label?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
label: string | undefined;
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined;
loader?: false | ((arg: import('vuetify/lib/composables/loader.mjs').LoaderSlotProps) => import('vue').VNodeChild) | undefined;
default?: false | ((arg: {
id: Readonly<import('vue').Ref<string, string>>;
}) => import('vue').VNodeChild) | undefined;
counter?: false | ((arg: import('vuetify/lib/components/VCounter/VCounter.mjs').VCounterSlot) => import('vue').VNodeChild) | undefined;
} | undefined | undefined;
"v-slot:append"?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:append-inner"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:clear"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:counter"?: false | ((arg: import('vuetify/lib/components/VCounter/VCounter.mjs').VCounterSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:default"?: false | ((arg: {
id: Readonly<import('vue').Ref<string, string>>;
}) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:details"?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:label"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot & {
label: string | undefined;
props: Record<string, any>;
}) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:loader"?: false | ((arg: import('vuetify/lib/composables/loader.mjs').LoaderSlotProps) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:message"?: false | ((arg: import('vuetify/lib/components/VMessages/VMessages.mjs').VMessageSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:prepend"?: false | ((arg: import('vuetify/lib/components/VInput/VInput.mjs').VInputSlot) => import('vue').VNodeChild) | undefined | undefined;
"v-slot:prepend-inner"?: false | ((arg: import('vuetify/lib/components/VField/VField.mjs').DefaultInputSlot) => import('vue').VNodeChild) | undefined | undefined;
"onClick:control"?: ((e: MouseEvent) => any) | undefined | undefined;
"onMousedown:control"?: ((e: MouseEvent) => any) | undefined | undefined;
"onUpdate:modelValue"?: ((val: string) => any) | undefined | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "type" | "active" | "autofocus" | "centerAffix" | "clearIcon" | "clearable" | "density" | "dirty" | "disabled" | "error" | "errorMessages" | "flat" | "focused" | "glow" | "hideSpinButtons" | "maxErrors" | "messages" | "persistentClear" | "persistentCounter" | "persistentHint" | "persistentPlaceholder" | "readonly" | "reverse" | "rounded" | "rules" | "singleLine" | "style" | "tile" | "variant">> | undefined;
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
readonly "onUpdate:country"?: ((value: string) => any) | undefined;
readonly "onUpdate:country-object"?: ((value: Country) => any) | undefined;
readonly "onUpdate:phone-object"?: ((value: import('awesome-phonenumber').ParsedPhoneNumber | null) => any) | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "type" | "active" | "autofocus" | "centerAffix" | "clearIcon" | "clearable" | "density" | "dirty" | "disabled" | "error" | "errorMessages" | "flat" | "focused" | "glow" | "hideSpinButtons" | "maxErrors" | "messages" | "persistentClear" | "persistentCounter" | "persistentHint" | "persistentPlaceholder" | "readonly" | "reverse" | "rounded" | "rules" | "singleLine" | "style" | "tile" | "variant" | "displayFormatDelay" | "displayFormatOnBlur" | "guessLoading">, "type" | "active" | "ariaLabel" | "autocomplete" | "autofocus" | "centerAffix" | "clearIcon" | "clearable" | "density" | "dirty" | "disabled" | "error" | "errorMessages" | "flat" | "focused" | "glow" | "hideSpinButtons" | "id" | "maxErrors" | "messages" | "name" | "persistentClear" | "persistentCounter" | "persistentHint" | "persistentPlaceholder" | "placeholder" | "prefix" | "readonly" | "reverse" | "role" | "rounded" | "rules" | "singleLine" | "tile" | "validate" | "variant" | "width" | "theme" | "onUpdate:focused" | "modelValue" | "validateOn" | "validationValue" | "maxWidth" | "minWidth" | "loading" | "appendIcon" | "prependIcon" | "hideDetails" | "hint" | "onClick:prepend" | "onClick:append" | "appendInnerIcon" | "bgColor" | "color" | "baseColor" | "iconColor" | "label" | "prependInnerIcon" | "onClick:clear" | "onClick:appendInner" | "onClick:prependInner" | "counter" | "counterValue" | "suffix" | "modelModifiers" | "onUpdate:modelValue" | "countryLocale" | "countryName" | "countries" | "preferCountries" | "includeCountries" | "excludeCountries" | "defaultCountry" | "exampleFormat" | "example" | "countryLabel" | "countryAriaLabel" | "invalidMessage" | "guessCountry" | "modelFormat" | "displayFormat" | "displayFormatDelay" | "displayFormatOnBlur" | "countryInputComponent" | "countryInputComponentProps" | "countryDisplayComponent" | "guessLoading" | "wrapperAttrs" | "countryProps" | "phoneProps" | "onUpdate:country" | "onUpdate:country-object" | "onUpdate:phone-object"> & {
modelValue?: string;
country?: string;
} & Partial<{}>> & import('vue').PublicProps;
expose(exposed: import('vue').ShallowUnwrapRef<VPhoneInputExposed<Country, CountryInputComponent>>): void;
attrs: any;
slots: any;
emit: (((evt: "update:country-object", value: Country) => void) & ((evt: "update:phone-object", value: import('awesome-phonenumber').ParsedPhoneNumber | null) => void)) & (((evt: "update:modelValue", value: string) => void) & ((evt: "update:country", value: string) => void));
}>) => import('vue').VNode & {
__ctx?: Awaited<typeof __VLS_setup>;
};
export default _default;
type __VLS_PrettifyLocal<T> = {
[K in keyof T]: T[K];
} & {};