Import

import-mask.ts
import { nuiCardMask, nuiIbanMask, NuiMask } from '@needless-ui/angular/mask';

NuiMask

A mask on a native text field.

Selector
input[nuiMask]
Exported as
nuiMask
NuiMask: Properties
NameTypeDefaultDescription
nuiMaskInputstring | ((raw: string) => string)The mask, or a function that picks one for the data typed.
tokensInputRecord<string, NuiMaskToken>Mask characters to add or replace.
unmaskInputbooleanfalseThe value is only the data, without the literals.
valueTwo-waystring''The value: what’s shown, or the data with unmask.
rawPropertySignal<string>The data typed, without the literals.
completePropertySignal<boolean>Every place in the mask is filled.

Helpers

Functions to format, check and build masks.

Helpers: Properties
NameTypeDefaultDescription
nuiMaskFormat, nuiUnmaskMethod(value, mask) => stringFormat a value with a mask, or read the data out of one.
nuiCardMaskMethod(raw: string) => stringA mask for card numbers, grouped as their brand prints them.
nuiCardBrandMethod(number: string) => NuiCardBrand | nullThe brand of a card number, from its first digits.
nuiCardValid, nuiLuhnMethod(number: string) => booleanWhether a card number has its brand’s length and passes the Luhn check.
nuiIbanMaskMethod(raw: string) => stringA mask for IBANs, as long as the country’s.
nuiIbanValidMethod(iban: string) => booleanWhether an IBAN has its country’s length and the right check digits.