fix: complete field and OTP public contracts (HD-07)

This commit is contained in:
maoyingjie
2026-10-29 09:30:58 +08:00
parent 27cc62e36f
commit 2d7e3d4e1e
26 changed files with 1067 additions and 100 deletions
@@ -0,0 +1,16 @@
/** Snapshot native readonly validity flags without retaining a live DOM object. */
export function validitySnapshot(value?: ValidityState): ValidityState {
return {
badInput: value?.badInput ?? false,
customError: value?.customError ?? false,
patternMismatch: value?.patternMismatch ?? false,
rangeOverflow: value?.rangeOverflow ?? false,
rangeUnderflow: value?.rangeUnderflow ?? false,
stepMismatch: value?.stepMismatch ?? false,
tooLong: value?.tooLong ?? false,
tooShort: value?.tooShort ?? false,
typeMismatch: value?.typeMismatch ?? false,
valid: value?.valid ?? true,
valueMissing: value?.valueMissing ?? false,
};
}