wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 167 forks source link

Maskable Input : allow regex #856

Open ZARk-be opened 3 months ago

ZARk-be commented 3 months ago

Is your feature request related to a problem? Please describe. Creating a custom Maskable input by extending BaseMaskable is really cool. But it would be great if we could define our own regex instead of using the InputMask

Describe the solution you'd like We could have a getInputRegex() method that will return directly the regex string, bypassing the mask.

Describe alternatives you've considered Well i'll just run realtime validation with ->validateOnly() in my livewire

Additional context I needed a form input to input an ipv4, the input mask ###.###.###.### is wrong because it forces you to pad with 0, which isn't very nice to look at. Also it means you could offload the mask generation to php and have your TS component just apply the given regex.