C

MaskModel

tested

The stateful masking model. Holds the masked value/selection and performs insertions/deletions in unmasked space (fixed characters stripped) before re-calibrating to the masked form — the device that makes backspacing across fixed characters and overwriteMode correct.

Signature

ts
class MaskModel implements ElementState

Properties

PropertyTypeDescription
valuestring
selectionSelectionRange

Methods

addCharacters

Insert characters at the current selection. Throws MASK_NOOP when the result is identical to the current state.

ts
public addCharacters(characters: string): void
ParameterTypeDescription
charactersstring
deleteCharacters

Delete from the current selection. A collapsed caret removes one unmasked character in the given direction (auto-skipping fixed characters); a range removes its unmasked span.

ts
public deleteCharacters(isForward: boolean): void
ParameterTypeDescription
isForwardboolean