Form Solution

Separate UI event and data processing

Cover most of functionalities in real-world form requirement.

Form Spec

Separate UI event and data processing

UI Components should only care about emitting user event and the binding state

UI Components

No validation handler, No detailed input updating

Form Spec

Separate UI event and data processing

UI Components can annotate the form schema anyway we want

UI Components

No UI coupling with domain objects

Form Spec

Separate UI event and data processing

Dynamic rules should only depend on current form state.

Dynamic Validation Rules

No flag, No intermediate state in UI component

Form Spec

Separate UI event and data processing

Validator should be self-satisfaction having fully access to form state in current scope

Cross Field Validations

Do not process validation by depending on any UI component or extra params

Validation should be pure

Form Spec

Separate UI event and data processing

Async Validations

Form Spec

Separate UI event and data processing

Dynamic Inputs/Fields

We should have a single source of truth to decide what UIs show, do the form validations, and even do submit.

Form Spec

Separate UI event and data processing

The root component should be able to do "submit", "validate", "getError" ... through handy method without relying on any component life cycle or any detail of state.

Unified Interface for Form Actions

Form Spec

Separate UI event and data processing

We can ...

Form Spec

Separate UI event and data processing

Domain

Form Spec

By guansunyata

Form Spec

  • 323