Import
import { nuiCardMask, nuiIbanMask, NuiMask } from '@needless-ui/angular/mask';NuiMask
A mask on a native text field.
| Name | Type | Default | Description |
|---|---|---|---|
nuiMaskInput | string | ((raw: string) => string) | The mask, or a function that picks one for the data typed. | |
tokensInput | Record<string, NuiMaskToken> | Mask characters to add or replace. | |
unmaskInput | boolean | false | The value is only the data, without the literals. |
valueTwo-way | string | '' | The value: what’s shown, or the data with unmask. |
rawProperty | Signal<string> | The data typed, without the literals. | |
completeProperty | Signal<boolean> | Every place in the mask is filled. |
Helpers
Functions to format, check and build masks.
| Name | Type | Default | Description |
|---|---|---|---|
nuiMaskFormat, nuiUnmaskMethod | (value, mask) => string | Format a value with a mask, or read the data out of one. | |
nuiCardMaskMethod | (raw: string) => string | A mask for card numbers, grouped as their brand prints them. | |
nuiCardBrandMethod | (number: string) => NuiCardBrand | null | The brand of a card number, from its first digits. | |
nuiCardValid, nuiLuhnMethod | (number: string) => boolean | Whether a card number has its brand’s length and passes the Luhn check. | |
nuiIbanMaskMethod | (raw: string) => string | A mask for IBANs, as long as the country’s. | |
nuiIbanValidMethod | (iban: string) => boolean | Whether an IBAN has its country’s length and the right check digits. |