Skip to main content
cngx-src documentation

MaskTokenDef

Interface

projects/forms/input/input-mask.directive.ts

Import#

import { MaskTokenDef } from '@cngx/forms/input'

Description#

Custom mask token definition. Use with the customTokens input to define characters beyond the built-in 0, 9, A, a, *.

// Allow only uppercase hex digits for a color mask
customTokens = { H: { pattern: /[0-9A-F]/i } };
// mask: '#HHHHHH'

Index#

Instance Properties#

optional#boolean
ReadonlyOptional

Whether this position is optional. Default: false.

pattern#RegExp
Readonly

Regex pattern the character must match.

transform#function
ReadonlyOptional

Transform function applied to matched char (e.g. c => c.toUpperCase()).