SiPhoneNumberInputComponent documentation¶
selector
si-phone-number-input Common interface for form item controls. Controls that should be connected to SiFormItemComponent must implement this interface and must be provided using the SI_FORM_ITEM_CONTROL token.
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| country ¶ | string | ISO_3166-2 Code of the selected country. | |
| defaultCountry ¶ | string | ISO_3166-2 Code of the country which shall be used on form-control reset. | |
| disabled ¶ | boolean | false | Whether the input is disabled. |
| errormessageId ¶ | string | ${this.id()}-errormessage | This ID will be bound to the aria-describedby attribute of the phone-number-input. Use this to reference the element containing the error message(s) for the phone-number-input. It will be picked by the SiFormItemComponent if the phone-number-input is used inside a form item. |
| id ¶ | string | __si-phone-number-input-${SiPhoneNumberInputComponent.idCounter++} | Unique identifier. |
| labelledby ¶ | string | ${this.id()}-label | ID of the element that labels the phone number input. |
| phoneNumberAriaLabel ¶ | TranslatableString | $localize`:@@SI_PHONE_NUMBER_INPUT.PHONE_NUMBER_INPUT_LABEL:Enter phone number` | Text for the phone number input aria-label attribute. |
| placeholderForSearch ¶ | TranslatableString | $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_PLACEHOLDER:Search` | Placeholder text for country search input. |
| readonly ¶ | boolean | false | Whether the input can be focused but not edited. |
| scrollStrategy ¶ | ScrollStrategy | defaultConnectedOverlayScrollStrategy() | Optional CDK scroll strategy used for the country selection overlay. |
| searchNoResultsFoundLabel ¶ | TranslatableString | $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_NO-RESULTS_FOUND:No results found` | Text shown when the country search returns no results. |
| selectCountryAriaLabel ¶ | TranslatableString | $localize`:@@SI_PHONE_NUMBER_INPUT.SELECT_COUNTRY:Select country` | Text for the country dropdown aria-label attribute. |
| supportedCountries ¶ | (readonly string[] | null) | List of countries in ISO2 format, from which the user is allowed to select one. If no values are provided, the dropdown will show all known countries. |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| countryChange ¶ | string | ISO_3166-2 Code of the selected country. |
| valueChange ¶ | PhoneDetails | Emits the selected country, formatted phone number, and its validity when the value changes. |
Types Documentation¶
| Variable |
|---|
| Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit . Equivalent to a normal string in usage and functionality. |
|---|
| Describes the phone number, its validity and associated country information. | ||||
|---|---|---|---|---|
|
| Common interface for form item controls. Controls that should be connected to SiFormItemComponent must implement this interface and must be provided using the SI_FORM_ITEM_CONTROL token. | |||||
|---|---|---|---|---|---|
|
| | ||||
|---|---|---|---|---|
|
| Interface for form error mapper. It resolves a key to either a translatable string or function which is called with the validation error for its key and should return a translatable string. | |
|---|---|
| |
| Describes the country information of the phone number. | ||||
|---|---|---|---|---|
|
| Function The error mapper is used to resolve an angular validation error to a TranslatableString . It will be merged with already existing error mappers. | ||
|---|---|---|
|
| | ||||||
|---|---|---|---|---|---|---|
|
| | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
|
| Deprecated: This component should no longer be used. When providing a form wide error mapper, use the provideFormValidationErrorMapper . When using the column layout, use the form-col-layout classes.For a custom breakpoint use the SCSS mixin: | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
| |||||||||||
| |||||||||||
|
| | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.