Added includeFilter
and excludeFilter
options to all functions:
includeFilter
Define a whitelist filter function that inputs an element and outputs a Boolean. The element is included if the function returns true. This option must be a function that accepts an element parameter. This filter does not apply to any elements specially handled invalueFunctions
.excludeFilter
Define a blacklist filter function that inputs an element and outputs a Boolean. The element is excluded if the function returns true. This option must be a function that accepts an element parameter. This filter does not apply to any elements specially handled in valueFunctions. Exclusions take precedence over inclusions.
For example, the following option excludes hidden fields:
FormPersistence.persist(form, { excludeFilter: element => element.type === 'hidden' });
Alternatively, the following option includes all non-hidden fields:
FormPersistence.persist(form, { includeFilter: element => element.type !== 'hidden' });