Implements text field input masks.
<input [textMask]="{mask: mask, isReversed: isMaskReversed}">
Name | Type | Default value | Description |
---|---|---|---|
inputMask | Function | Object defining mask and "reversed" status. |
The Text Mask directive implements the "input mask" feature defined in the Process Services form editor. The mask restricts the way that text data can be added to the field and also adds formatting as you type. A common example of this feature is seen in text boxes that accept credit card numbers. The number is printed on the card as groups of four digits separated by spaces:
1234 5678 9012 3456
When you type into the field, you can only enter digits and spaces (spaces are only valid if you type them in the position they occur in the mask; otherwise, they are added automatically as you type digits). The equivalent text mask in ADF would be:
0000 0000 0000 0000
The following characters have special meaning within a mask; all other characters are included in the text as they are:
The mask is passed to the directive in the mask
field of the parameter object. The
reversed
field indicates that digits in the mask are "filled up" in
right-to-left order rather than the usual left-to-right. For example, with the
following mask:
#0.0
...if the user typed the digits "23" in sequence, the normal left-to-right ordering would show
23
...in the textbox. To get the decimal point, the user would have to type it explicitly. However, with reversed (right-to-left) ordering, the textbox would show
2.3
...and these digits would slide leftward as the user typed more.
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.