This should be improved to add more information, at least:
description or help text
type (so the input type can be defined)
due to the above setting, additional props for the input may be defined too
The current implementation uses meta.census.specs as an object of patterns as react-hook-form expects them, but it should be refactored to allow other settings (hence the name "specs"), to something like:
interface Specs {
type: string // or maybe more specific to 'number' | 'text' | '[...]'
pattern: {
value: string // shall be converted to regexp (as we already do)
message: string
}
description: string
props: any // ? or maybe Record<string,any> ?
}
With version 0.7.9 we added dynamic validations for the spreadsheet census strategy, allowing people creating elections to add custom validations to the input fields.
This should be improved to add more information, at least:
The current implementation uses
meta.census.specs
as an object of patterns as react-hook-form expects them, but it should be refactored to allow other settings (hence the name "specs"), to something like: