Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 2.4 KB

File metadata and controls

26 lines (18 loc) · 2.4 KB

Example: layout, fields, and controllers (index)

This document is an index to the split examples. Each part is in its own file so you can jump to layout, sanitizers, validators, transforms, implementation, or progress.


Split examples

Part File Content
Layout and fields layout.md SheetLayout, name, version, fields (valueType, sanitizers, validators, transformations by id).
Sanitizers sanitizers.md trim, collapseSpaces; cell-level signature and registerSanitizer.
Validators validators.md required, minLength; SheetError shape and registerValidator.
Transforms transforms.md toUpperCase, capitalize; cell-level signature and registerTransform.
Implementation implementation.md ImporterProvider, useImporter, registration in useEffect, processFile, useImporterStatus, useSheetData.
Progress progress.md useImporterStatus, useImporterEventTarget, useImporterProgressSubscription, phase/percent and progress bar.

Summary

  • Layout → pass to useImporter({ layout }) or Provider; object with name, version, fields.
  • Sanitizers / Validators / Transforms → register with registerSanitizer, registerValidator, registerTransform; layout references ids only. Controllers must be pure and Worker-safe.
  • Flow → wrap with ImporterProvider, register controllers once, call processFile(file), read status and sheet from hooks. For full pipeline (startFullImport, convert), see how-to.md.

For more: How to / Usage, Validators, Sanitizer, Transformers.