Skip to content

Commit

Permalink
work for #4842
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Mar 7, 2024
1 parent 33c676d commit e396afa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mask/mask_pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { settings } from "../settings";
import { Serializer, property } from "../jsonobject";
import { InputMaskBase } from "./mask_base";
import { IMaskedInputResult, ITextInputParams } from "./mask_utils";
import { ILoadFromJSONOptions } from "../base-interfaces";

export interface IMaskLiteral {
type: "const" | "regex" | "fixed";
Expand Down Expand Up @@ -115,6 +116,11 @@ export class InputMaskPattern extends InputMaskBase {
return "patternmask";
}

public fromJSON(json: any, options?: ILoadFromJSONOptions): void {
super.fromJSON(json, options);
this.updateLiterals();
}

public _getMaskedValue(src: string, matchWholeMask: boolean = false): string {
const input = (src === undefined || src === null) ? "" : src;
return getMaskedValueByPattern(input, this.literals, matchWholeMask);
Expand Down

0 comments on commit e396afa

Please sign in to comment.