feat: enhance useFormValidator for flexible field-level control and external state injection #5033
+67
−109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To Reviewers
style
,chore
,ci
, straightforward changes, etc.)Description (optional)
Enhance
useFormValidator
for Flexible Validation and External State ControlSummary
This PR improves
useFormValidator
by allowing external injection of both the reactive state and validation �scenario, providing greater flexibility in form validation scenario. Previously,useFormValidator
created its own reactive object internally and managed validation as a single unit, which limited adaptability when specific form fields required unique validation behavior. By enabling external state injection and acceptinguseFieldValidator
directly for individual fields,useFormValidator
now supports custom validation scenarios within a single form setup without the need for redundant instances.Major Changes
validator
option to acceptuseFieldValidator
instances directly for specific fields, supporting unique validation logic and enabling field-level customization within a single form.Minor Changes
useFormValidator
의 유연한 검증 및 외부 상태 제어 기능 향상요약
이 PR은
useFormValidator
에 외부에서 reactive 상태와 validation을 주입할 수 있는 기능을 추가하여 폼 validation의 유연성을 높입니다. 기존에는useFormValidator
가 내부적으로 reactive 객체를 생성하고 validation을 단일 유닛으로 관리했기 때문에 특정 필드에 고유한 validation 동작이 필요한 경우 적응성이 제한되었습니다. 이제 외부에서 상태를 주입하고, 개별 필드를 위해useFieldValidator
를 직접 받아들일 수 있어, 별도의 인스턴스가 필요하지 않으면서 단일 폼 내에서 맞춤형 validation을 지원합니다.주요 변경 사항
validator
옵션이 특정 필드를 위해useFieldValidator
인스턴스를 직접 허용하도록 수정되어, 필드 단위의 고유한 validation을 지원하고 단일 폼 내에서 필드 수준의 커스터마이징을 가능하게 했습니다.부가 변경 사항
Things to Talk About (optional)