CEC-3912 VIN input (#293)

* CEC-3912 VIN input

* Revert
This commit is contained in:
John Wu
2023-03-16 15:13:47 -07:00
committed by GitHub
parent 27ea9f8eea
commit 19bc054343
4 changed files with 34 additions and 16 deletions

View File

@@ -0,0 +1,9 @@
export const regExVIN = /^[A-HJ-NPR-Z0-9]{0,17}$/;
export const getVINOnChangeHandler = (setFn) => {
return (e) => {
const value = e?.target?.value.toUpperCase() ?? "";
if (!value.match(regExVIN)) return;
setFn(value.toUpperCase());
}
}