All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.12.1 - 2019-12-04
- Fixed a bug in
mergePaths
that was omitting0
because it was falsy. Now0
will be included in the path.
v0.12.0 - 2018-11-29
⚠️ [Breaking] Changed the way that data is scoped- You can now specify
globalScope
next to aquestionId
in either field or conditional objects to change the base scope. By default the scope will be prefixed based on it's parent (such as anarray
orsection
type)
- You can now specify
- Using an polyfill for
React.Fragment
so now the library should work in React < 16
- Issue where
FormGenerator
andGenField
were blocking context updates for components using the old context API (beforeReact.createContext()
) #36
consumeReduxFormContext()
now takes a second parameter to subscribe to select parts of the_reduxForm
context. #36
v0.12.0-rc.1 - 2018-11-6
- Issue where
FormGenerator
andGenField
were blocking context updates for components using the old context API (beforeReact.createContext()
) #36
consumeReduxFormContext()
now takes a second parameter to subscribe to select parts of the_reduxForm
context. #36
v0.12.0-rc.0 - 2018-10-17
⚠️ [Breaking] Changed the way that data is scoped- You can now specify
globalScope
next to aquestionId
in either field or conditional objects to change the base scope. By default the scope will be prefixed based on it's parent (such as anarray
orsection
type)
- You can now specify
- Using an polyfill for
React.Fragment
so now the library should work in React < 16
- The
section
type can now accept aquestionId
in order to wrap it's children in a<FormSection>
. This will prefix all it's childFields.
v0.11.0 - 2018-10-11
⚠️ [Breaking] evalCondValid() now returnstrue
if the value isnil
or empty string #31- This should create more consistency in the usage of operators between
conditionalValid
and other conditional props
- This should create more consistency in the usage of operators between
v0.10.0 - 2018-08-28
⚠️ [Breaking] For number comparison operators, return false for nil or empty string values #28- This change effects the following conditional operators:
lessThan
,greaterThan
,lessThanEqual
,greaterThanEqual
v0.9.12 - 2018-07-16
excludeInvalid
&excludeRequired
options forgetSectionErrors()
#22
v0.9.11 - 2018-06-27
- New
onSetError
event listener for thegetSectionErrors()
function. #21 - replaced a custom shallow diff function with
react-fast-compare
for better performance.
v0.9.10 - 2018-05-02
- Internal values cache will now clear if form is reset.
- Performance has been increased by adding some update checks
- Moved internal values cache out of state (perf)
- Moved context into state (perf)
v0.9.9 - 2018-04-10
- Prevented internal bleed of
fieldOptions
between util functions - Fixed detection of
_genHidden
inisFieldVisible()
v0.9.8 - 2018-03-06
- Allow
_genSectionErrors
to run for any field, regardless of if it has aquestionId
#20 - Check for
!isNil
before running_genIsFilled
and_genIsValid
v0.9.7 - 2018-02-15
isFieldValid()
now runs both_genIsValid
andconditionalValid
and logical ANDs the results
v0.9.6 - 2018-02-15
- make sure all
Gen...
components extract options from gen context
v0.9.5 - 2018-02-14
- pass
customOperators
andlookupTable
down togetFieldOptions()
v0.9.4 - 2018-02-14
_genSkipCache
field option to opt-out of the clear/restore functionality when a field changes visibility #17compare
operator to compare the value of one questionId to another questionId #18cond
operator to run conditional objects (useful in combination withcompare
) #18customOperators
prop for<FormGenerator />
and all utils. Allows you to specify you own operators for conditional objects. #18
v0.9.3 - 2018-02-13
- Fixed issue where
filled
wperator was not executing iflookupTable
was provided, but the remote field was not in the table.
v0.9.2 - 2018-02-13
- FormGenerator now passes down
lookupTable
toGenCondEval
via context. #16
v0.9.1 - 2018-02-11
- Moved
create-react-context
from devDependencies to dependencies
v0.9.0 - 2018-02-11
🚨 Use v0.9.1 🚨
⚠️ [Breaking]isFieldFilled()
has been renamed toisSectionFilledIterator()
⚠️ [Breaking]isFieldEmpty()
has been renamed toisSectionEmptyIterator()
⚠️ [Breaking]getFieldErrors()
has been renamed togetSectionErrorsIterator()
- New context API
- new export
GenContext
follows the newcreateReactContext()
pattern
- new export
- New util functions #13
isFieldVisible(options)
- runsfield.conditionalVisible
isFieldHidden(options)
- checks for_genHidden
isFieldDisabled(options)
- checksfield.disabled
or runsfield.conditionalDisabled
isFieldRequired(options)
- checksfield.required
or runsfield.conditionalRequired
. also takes into account the disabled state. a field that is disabled can't be required.isFieldFilled(options)
- checks for_genIsFilled
or runs!isNilOrEmpty(value)
isFieldEmpty(options)
- checks for!_genIsFilled
or runsisNilOrEmpty(value)
isFieldValid(options)
- checks for_genIsValid
or runsfield.conditionalValid
mapFieldChildren(options, iterator)
- maps over all children (field.childFields
,_genChildren
, and_genTraverseChildren
)
v0.8.1 - 2018-01-17
- Fix accidental omission of
_field
prop.
v0.8.0 - 2018-01-17
⚠️ [Breaking] No more default export. please destructureimport {FormGenerator} from '@isobar-us/redux-form-generator'
#5⚠️ [Breaking] RenamedisSectionValid
togetSectionErrors
#7⚠️ [Breaking] RenamedisFieldValid
togetFieldErrors
#7
- New
_genWrapperComponent
api for field types. #6 - Field level validation messages. #9
- Fix bugs around
getDefaultValues
in combination withGenCondClearField
#8
v0.7.2 - 2017-12-20
injectGenProps()
now merges the providedvalidate
errors with the generated errors
v0.7.1 - 2017-12-15
- Codesandbox links are now versioned within this repo.
- new Wizard Example
- Fix a bug where conditional properties for array items were broken.
v0.7.0 - 2017-12-11
- 🎉 Flow Types! 🎉 #1
- Open Source Guidelines #2
- Fixed bug where the
not
conditional operator wasn't working. - There may be some other bugs that were fixed by adding Flow.
v0.6.0 - 2017-11-21
- Add support for custom global required and invalid error messages to
isSectionValid()
&isFieldValid()
- Major refactor of
evalCond()
data flow. see Breaking Changes below.
- Fixed a bug where when using
<FormGenerator ... disabled />
, fields were childFields wouldn't re-enable
⚠️ [Breaking]evalCond()
&evalCondValid()
no longer take_parentValue
mixed in with data. You now usevalueKey
option to pass the questionId of the value data, and it willget(data, valueKey)
. (is affected by reduxFormDeep option).⚠️ [Breaking]_value
is the new defaultvalueKey
forevalCond()
&evalCondValid()
⚠️ [Breaking] When running any validation helpers likeisSectionValid()
,evalCondValid()
defaults thevalueKey
to the current field questionId, not the parent like it used to.
⚠️ [Breaking] Officially remove field level validation operators in favor of usingconditionalValid
operators⚠️ [Breaking] RemovedevalCondRequired()
from default exports, since it's equal toevalCond()
v0.5.3 - 2017-11-21
- fixed a bug where when using
<FormGenerator ... disabled />
, fields with conditional operations wouldn't re-enable.
v0.5.2 - 2017-11-20
- added
injectGenProps
HOC to take care of passingvalidate
andinitialValues
to thereduxForm
decorated component.
- gracefully return
null
if requiredfields
prop isn't passed to<FormGenerator />
v0.5.1 - 2017-11-20
- add missing dependencies (classnames, lodash, prop-types)
- import Frag explicitly instead of using webpack.ProvidePlugin
- 🎉 First open source release 🎉
- Change package name to
@isobar-us/redux-form-gen
isFieldValid
now checks forname
from the field options before attempting to validate (previously checked forquestionId
on the field object)- added
_genSectionErrors
api to allow field types to set multiple errors, only used in advanced cases. - added error/warning validation messages to default field types
genericFieldProps
now takes all options object, instead of justfields
- refactor storybook examples.
⚠️ [Breaking] remove the following field types from defaultFieldTypes, moved to storybook examples.arrayControl
arrayControlSelect
checkboxArray
columns
divider
sectionArray
static
- export
GenField
as a named export. - add
disabled
prop support for<Form Generator />
to disable all fields in the form. - use prettier for code formatting.
- refactored classnames/dom and stylesheet to be more lightweight
- removed unneeded
div
s using the<Frag>
component pattern - upgrade eslint and babel-eslint
- upgrade to react v16
- upgrade to redux-form v7
- use
_.get()
when retrieving fields from the lookupTable. added tests.
- fix clear/restore for arrays with default values
- fix clear/restore bug where conditional fields inside array items were causing duplicate items.
- make
isNilOrEmpty
work for Objects.
- conditional operators greaterThan(gt), lessThan(lt), greaterThanEqual(min), lessThanEqual(max) now treat nil as 0
- regex operators (regex, pobox, email) will return true if value is not a string.
- add support for
conditionalVisible
in theisSectionValid
/isFieldValid
logic. - throw additional errors for invalid conditional object props.
- add
itemProps: {item, array}
to the options passed down by thearray
field type_genTraverseChildren
function. useful for static rendering.
- fix the
maxLengh
,minLength
, andlength
conditional operators, and default totrue
if the value doesn't have a length property.
- use
_genIsFilled
when checkingisSectionValid
/isFieldValid
and a field is required.
⚠️ [Breaking] splitarray
type intoarray
andarrayItem
. includes a newGenArrayItem
component, and modification toGenArray
.⚠️ [Possibly Breaking]value
andequals
cond ops use_.isEqual
for deep equal comparison.- merge validation operators into evalCond() operators. supports
regex
andlength
comparisons among others.
- remove flex from
--inline
- fix display classnames
- fix the
display
prop for<FormGenerator />
- add flex to the
--inline
style
- support for
conditionalDisabled
! - isSectionValid will not validate fields that are disabled
- [Broken: Fixed in v0.2.4] added a
display
prop to<FormGenerator display='stacked' />
. can be eitherstacked
orinline
and applies to the whole form. will be overridden bydisplay
on fields. - export
omitGenOptions
fromGenField
- remove
maxLength
from the defaulttext
field type. leaving this to app implementations.
- add
_genHidden
support for field Type definitions. if set totrue
, it prevents the field and it's children from rendering. - fix clear/restore functionality for array-like fields.
- add styling for metadata
- add
defaultValue
support for overriding_genDefaultValue
on all field types via FML
⚠️ [Breaking] change_genNoChildren
to_genSkipChildren
⚠️ [Breaking] change_genDisplayComponent
to_genComponent
⚠️ [Breaking] use_genDisplayComponent
for static rendering only
array
field type no longer requiredlookupTable
as an option for_genTraverseChildren
- export
reduxFormContext
fromcontextUtils.js
- added support for
display
stacked/inline
orientation for fields - css refactor and flex grid scaffolding
- broke out
GenArray
into member function components - export
GenArrayUnrwrapped
fromGenArray.js
for easy class inheritance
- added
isSectionValid
andisFieldValid
to exports - added
isSectionEmpty
to exports - removed
disableFieldValidate
from<FormGenerator />
propTypes
- fix bug with remove & restore of field values with
CondClearField
CondClearField
working by caching hidden field values inFormGenerator
local state [broken. fixed inv0.1.3
]- added
getDefaultValues
- new version of
buildLookupTable
- fix bug where
_gen*
field props weren't getting stripped - export
GenericRequiredLabel
- export
genericFieldProps
- first release