Home Reference Source

Function

Static Public Summary
public

findCaretPosition(maskedValue: String, mask: String): *

Given the masked string , find the next caret position depending on what is missing to complete the mask

public

Generate a regex patter based on the give task

public

Check if the given value is masked with the given mask or not

public

Mask the given value with the given mask in case the value is not already masked with the given mask

public

unmask(maskedValue: String, mask: String): *

Unmask the given value

Static Public

public findCaretPosition(maskedValue: String, mask: String): * source

import {findCaretPosition} from 'basis-input-masking/src/TextInput/tools.js'

Given the masked string , find the next caret position depending on what is missing to complete the mask

Params:

NameTypeAttributeDescription
maskedValue String

masked string

mask String

the used mask to produce the masked string

Return:

*

public generatePatternFromMask(mask: String): String source

import {generatePatternFromMask} from 'basis-input-masking/src/TextInput/tools.js'

Generate a regex patter based on the give task

Params:

NameTypeAttributeDescription
mask String

bbj string mask

Return:

String

regex for the give mask

public isMaskedValue(value: String, mask: String): Boolean source

import {isMaskedValue} from 'basis-input-masking/src/TextInput/tools.js'

Check if the given value is masked with the given mask or not

Params:

NameTypeAttributeDescription
value String

masked or unmasked value

mask String

a bbj mask

Return:

Boolean

true when the value is masked with given mask , false otherwise

public maskIfNotMasked(value: String, mask: String): String source

import {maskIfNotMasked} from 'basis-input-masking/src/TextInput/tools.js'

Mask the given value with the given mask in case the value is not already masked with the given mask

Params:

NameTypeAttributeDescription
value String

masked or unmasked value

mask String

a bbj mask

Return:

String

a masked value

public unmask(maskedValue: String, mask: String): * source

Unmask the given value

Params:

NameTypeAttributeDescription
maskedValue String

masked string

mask String

the used mask to produce the masked string

Return:

*