Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
lac-mat-tel-input
Advanced tools
An Angular Material package for entering and validating international telephone numbers.
Readme
An Angular Material package for entering and validating international telephone numbers.
This is a partial rewrite of [tanansatpal's ngx-mat-intl-tel-input] (https://github.com/tanansatpal/ngx-mat-intl-tel-input) which was the best angular material component I could find for this purpose but I felt that the structure of the component needded too many changes.
Main features:
Supports:
$ npm install libphonenumber-js --save
$ npm install lac-mat-tel-input --save
Add LacMatTelInputModule
to your module file:
imports: [
LacMatTelInputModule,
]
You can find a complete Stackblitz sample here.
<form [formGroup]="form">
<mat-form-field>
<mat-label>Phone</mat-label>
<lac-mat-country-selector matPrefix [selectorFor]="input"></lac-mat-country-selector>
<lac-mat-tel-input #input formControlName="phone"></lac-mat-tel-input>
<mat-error *ngIf="form.controls['phone']?.errors?.invalidPhone">Invalid phone</mat-error>
</mat-form-field>
</form>
<form [formGroup]="form">
<mat-form-field>
<mat-label>Phone</mat-label>
<lac-mat-country-selector matPrefix [selectorFor]="input"
[preferredCountries]="['us', 'gb']"
[onlyCountries]="['us', 'gb', 'es']"
[showDialCode]="false"
[disableSearch]="false"
searchPlaceholder="Search..."
(change)="onCountryChange($event)">
</lac-mat-country-selector>
<lac-mat-tel-input #input formControlName="phone">
</lac-mat-tel-input>
</mat-form-field>
</form>
Options | Type | Default | Description |
---|---|---|---|
preferredCountries | string[] | [] | List of country abbreviations, which will appear at the top. |
onlyCountries | string[] | [] | List of manually selected country abbreviations, which will appear in the dropdown. |
showDialCode | boolean | false | Shows the country's dial code next to the flag |
disableSearch | boolean | false | Whether to disable the search bar to help filter down the list of countries |
searchPlaceholder | string | null | The placeholder to display in the search bar |
internationalFormat | boolean | false | By default, phone numbers will be formated using the AsYouType formatter. However, if you wish to use INTERNATIONAL format set this to true |
./projects/lac-mat-tel-input
./src/lib
with new functionality.$ npm run build_lib
$ npm run copy-files
$ npm run npm_pack
$ npm run package
After building and creating package, you can use it locally too.
In your project run:
$ npm install --save {{path to your local '*.tgz' package file}}
FAQs
An Angular Material package for entering and validating international telephone numbers.
The npm package lac-mat-tel-input receives a total of 160 weekly downloads. As such, lac-mat-tel-input popularity was classified as not popular.
We found that lac-mat-tel-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.