RonaldJerez / vue-input-facade

A lightweight and dependency free input masking library created specific for Vue
https://ronaldjerez.github.io/vue-input-facade/latest/
183 stars 27 forks source link

Transform the masked output #2

Closed bnason closed 4 years ago

bnason commented 4 years ago

Is there any way to hide the true value? For instance, say you have a field asking for a social security number. The mask would be ###-##-####, which normally would show like 123-45-6789. However, I would like it to display like this instead: ***-**-****

I've tried to use both the transform property of the tokens, as well as the pipe feature in the beta branch. However, I don't believe either of them are what I'm looking for.

P.S: This is only a counter measure to simply block someone looking over someones physical shoulder and easily seeing their ssn.

RonaldJerez commented 4 years ago

No that’s not a feature that has been implemented. The pipe feature wouldn’t work either as you pointed out as the value is determined from the inputs true “value” property which would be “*” after the first pass.

RonaldJerez commented 4 years ago

I actually gave this a shot. It’s not easily archivable without changing the fundamental of how the library works.