form icon indicating copy to clipboard operation
form copied to clipboard

feat(form-core): add disableFieldMapping option for selective schema validation control

Open jiji-hoon96 opened this issue 3 months ago • 0 comments

This PR introduces the disableFieldMapping feature that allows developers to selectively disable schema validation error mapping for specific fields or globally across all fields in a form.

  • Core Feature: Added disableFieldMapping option to FormOptions interface
  • Type Definitions: Added FieldMappingConfig<TFormData> type supporting boolean or field-specific configuration
  • Core Logic: Implemented shouldApplySchemaToField method in FormApi to determine field-level schema application
  • Validation Filtering: Modified schema validation error mapping to respect disableFieldMapping settings
  • Framework Support: All adapters (React, Angular, Lit) automatically support the new option through existing FormOptions passthrough
  • Documentation: Added comprehensive guide and React example demonstrating usage patterns
  • Tests: Added complete test suite covering all scenarios including runtime configuration changes

How to test the changes?

  • Unit Tests: Run pnpm test:lib - all 385+ existing tests pass + new comprehensive test suite
  • Example: Navigate to examples/react/disable-field-mapping and run pnpm dev
  • Manual Testing: Try different configurations:
    • disableFieldMapping: true (global disable)
    • disableFieldMapping: { fields: { fieldName: true } } (selective disable)
    • Runtime configuration changes via form.update()

jiji-hoon96 avatar Sep 17 '25 00:09 jiji-hoon96