Closed flourigh closed 2 years ago
Might be a good feature to add at some point. I may not have the time atm to implement it. I will accept a PR if anyone wants to attempt it.
Might I suggest a secondary addition to this... greedy symbols (or a way to make them greedy) so that on could do a mask like: $#+.##
that works with $0.35
, $100.35
, and $1.35
but $.35
would fail since its missing the leading numeric.
Its basically the same principal, adding an additional modifier, if its acceptable I can probably work up a PR for these.
@ktiedt certainly, contributions are welcomed.
I'm interested in this functionality as well. Was there any progress made on a PR?
@killroyboy unfortunately I got pulled away from my need for this due to changes in our project, so I never got to take a stab at this.
Thanks to @dima-bzz this has now been released under the beta tag. I also started adding support for wildcard support using his approach as base. That should be pushed soon as well.
Our approach is a little different than v-mask as we kept the optional character placement as a suffix rather than prefix (same as when using regex):
for example.
If you want to try it out you can install the package with npm install vue-input-facade@beta
Describe the solution you'd like Add a token optional to use on telephone or other on character not required, example (021) 98689-2332 - (0?##) #####-#### (21) 98689-2332 - (##) #####-#### ? | Optional (next character)
Describe alternatives you've considered https://www.npmjs.com/package/v-mask