Home/Documentation/Core Package

Core Architecture

Flow

ValidationPolicy
  -> ValidatorHelper
  -> Validator rule chains
  -> ValidationResult and RequiredResult metadata
  -> Adapter-specific UI

Policies

Policies describe model paths and rule chains. They should not know about Angular templates, React components, browser focus, or store updates.

class BillingPolicy implements ValidationPolicy {
  addValidations(helper: ValidatorHelper): Validator[] {
    return [
      helper.validateFor('billing.city', '!billing.sameAsShipping')
        .isRequired('Billing city is required')
    ];
  }
}

Validators

ValidatorHelper.validateFor(path) creates a Validator. The validator stores the target path, optional dependency, and ordered rules.

Metadata

Core writes standardized metadata:

  • validationResults
  • requiredResults
  • touched-field metadata
  • show-all-errors metadata
  • group status fields registered by adapters

Dependency expressions

helper.validateFor('secondaryEmail', 'hasSecondaryEmail').isRequired('Required');
helper.validateFor('billing.city', '!billing.sameAsShipping').isRequired('Required');

Keep expressions small. For complex domain conditions, prefer a function dependency where the adapter supports it.

Continue in the live platform

Open Vanilla JS ShowcaseRun the same Core policies with framework-free TypeScript forms →Open PortalLaunch documentation and every showcase from one place →