diff --git a/docs/iframe.html b/docs/iframe.html index b72df43b..b1ff9bcf 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -361,4 +361,4 @@ - window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"index.js","importPathMatcher":"^\\.[\\\\/](?:stories\\/index\\.js)$"}]; \ No newline at end of file + window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"index.js","importPathMatcher":"^\\.[\\\\/](?:stories\\/index\\.js)$"}]; \ No newline at end of file diff --git a/docs/main.e87f8f2f.iframe.bundle.js b/docs/main.d979381b.iframe.bundle.js similarity index 96% rename from docs/main.e87f8f2f.iframe.bundle.js rename to docs/main.d979381b.iframe.bundle.js index 3343829b..4df0d792 100644 --- a/docs/main.e87f8f2f.iframe.bundle.js +++ b/docs/main.d979381b.iframe.bundle.js @@ -1306,7 +1306,7 @@ /***/ function(module, __webpack_exports__, __webpack_require__) { 'use strict'; /* harmony default export */ __webpack_exports__['a'] = - '## 4.35.0 (Oct 19th, 2022)\n\n- added ability to setValueQuietly\n\n## 4.34.0 (Oct 13th, 2022)\n\n- added useInformedApi that will allow user to manipulate multiple forms\n\n## 4.33.0 (Oct 11th, 2022)\n\n- added ability to remove specific index from array field api\n\n## 4.32.0 (Sep 30th, 2022)\n\n- added ability to disable and enable the form via formApi\n\n## 4.31.4 (Sep 22nd, 2022)\n\n- array fields dirt now gets set when a user adds or removes\n\n## 4.31.3 (Sep 22nd, 2022)\n\n- Fixed issue where react strict mode and 18 would not cleanup fields values when they were unmounted\n\n## 4.31.2 (Sep 20th, 2022)\n\n- Fixed issue where reseting array fields with new initial values would still use old ones\n\n## 4.31.1 (Sep 19th, 2022)\n\n- When formatting using createIntlNumberFormatter and currencySign being accounting () would not trigger negative\n\n```js\n// When user types -2 or ($2) it would not format correctly\nconst { formatter, parser } = utils.createIntlNumberFormatter(\'en-US\', {\n style: \'currency\',\n currency: \'USD\',\n currencySign: \'accounting\'\n});\n```\n\n## 4.31.0 (Sep 14th, 2022)\n\n- Form now gets set to dirty when a user performs an add operation on an array field\n\n## 4.30.1 (Sep 12th, 2022)\n\n- Fixed issue with mask prop not masking last character\n\n## 4.30.0 (Sep 11th, 2022)\n\n- Added mask prop back to inputs!!!!!\n\n## 4.29.1 (Sep 8th, 2022)\n\n- Fixed useFormStateSelector when using SSR\n\n## 4.29.0 (August 30th, 2022)\n\n- added onValueSet to form that only gets called when the value is explicitly set\n\n## 4.28.9 (August 30th, 2022)\n\n- Fixed issue where validateOnMount would not trigger when the fields were reset to their initial state\n\n## 4.28.8 (August 25th, 2022)\n\n- Fixed issue where async validate would not trigger when you pass relevance prop to input and input becomes relevant\n\n## 4.28.7 (August 24th, 2022)\n\n- Fixed issue where locales that use comma instead of dot for fractions would not properly format for thousands\n\n## 4.28.6 (August 23nd, 2022)\n\n- Fixed issue where if form was reset array field with defualt values would not reset to the default values\n\n## 4.28.5 (August 22nd, 2022)\n\n- Fixed issue where showErrorIfDirty would not show error if touched\n\n## 4.28.4 (August 19th, 2022)\n\n- Fixed issue where useFieldSubscription would not spread fields to the useEffect causing potential infinate loops\n\n## 4.28.3 (August 15th, 2022)\n\n- Fixed issue where user would type the decimalChar in intl number formatter\n\n## 4.28.2 (August 10th, 2022)\n\n- Added mising types https://github.com/teslamotors/informed/pull/415\n\n## 4.28.1 (August 10th, 2022)\n\n- Fixed issue with number formatter when inititial value is number\n\n## 4.28.0 (August 5th, 2022)\n\n- Added ability to pass default values to array fields\n\n## 4.27.0 (August 4th, 2022)\n\n- Added `useFormStateSelector` hook\n\n## 4.26.0 (August 3rd, 2022)\n\n- Added ability to get field name from onValueModified and onValueChange props to form\n\n## 4.25.0 (August 2nd, 2022)\n\n- Added disabled prop back onto form props\n\n## 4.24.0 (August 1st, 2022)\n\n- Added useInformed to get access to any controller\n\n## 4.23.0 (July 31st, 2022)\n\n- Added useArrayFieldState\n\n## 4.22.0 (July 29th, 2022)\n\n- Added ability to pass focusOnInvalid to the form and also added focusFirstError to formApi\n\n## 4.21.0 (July 19th, 2022)\n\n- Added ability to pass clean function to inputs\n\n## 4.20.1 (July 14th, 2022)\n\n- Fixed issue where evaluate in useConditional would not trigger when form was reset\n\n## 4.20.0 (July 11th, 2022)\n\n### Added\n\n- ability to pass oneOf as an if condition to schemas\n- ability to match fields whos values are arrays with enum in schema conditions\n\n```js\nallOf: [\n {\n if: {\n properties: {\n cars: { oneOf: [\'tesla\', \'jeep\'] }\n },\n required: [\'cars\']\n },\n then: {\n properties: {\n carName: {\n type: \'string\',\n title: \'Cars name\',\n \'ui:control\': \'input\'\n }\n }\n }\n }\n];\n```\n\n## 4.19.3 (July 5th, 2022)\n\n### Fixed\n\n- fixes #411 bad type definition for onSubmit\n\n## 4.19.2 (July 5th, 2022)\n\n### Updated\n\n- package.json to allow react 18 as peer dep\n\n## 4.19.1 (June 24th, 2022)\n\n### Fixed\n\n- issue whith useArray field where if initial value was not array it would crash\n\n## 4.19.0 (June 22nd, 2022)\n\n### Added\n\n- onValueChange prop to fields\n\n## 4.18.2 (June 22nd, 2022)\n\n### Fixed\n\n- issue with key in FormField, this issue can be seen when you have changing schema\n\n## 4.18.1 (June 21st, 2022)\n\n### Updated\n\n- README to have correct urls\n\n## 4.18.0 (June15th, 2022)\n\n### Added\n\n- ability to `if: { properties: { status: {const: ["active"]} } },` in schema ( support array conditions )\n\n## 4.17.0 (June 12th, 2022)\n\n### Added\n\n- resetPath to form api to allow user to pass in path to reset all fields that live under that path\n\n## 4.16.2 (June 9th, 2022)\n\n### Fixed\n\n- issue where react 18 with strict mode would kill useStateWithGetter function ( relevance was broken )\n\n## 4.16.1 (June 3rd, 2022)\n\n### Fixed\n\n- issue where changing schema options would not reset value\n\n## 4.16.0 (June 2nd, 2022)\n\n### Added\n\n- ability get formApi formState and scope in validate function\n\n## 4.15.0 (June 2nd, 2022)\n\n### Added\n\n- ability to pass a function as validateWhen\n\n```js\nvalidateWhen={ scope => `${scope.fieldName}`}\n```\n\n## 4.14.0 (May 26th, 2022)\n\n### Added\n\n- `validateModified` prop to form so lib will only perform validation on modified fields\n\n## 4.13.1 (May 25th, 2022)\n\n### Fixed\n\n- issue where decimal was getting added when formatter explicitly was told not to add\n\n```js\nutils.createIntlNumberFormatter(\'en-US\', {\n style: \'decimal\',\n signDisplay: \'never\',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n});\n```\n\n## 4.12.1 (May 12th, 2022)\n\n### Fixed\n\n- issue with missing types Debug and Schema Fields\n\n## 4.12.0 (May 12th, 2022)\n\n### Fixed\n\n- issue with isChild\n\n### Added\n\n- hidden field back to default exported components\n\n## 4.11.4 (May 4th, 2022)\n\n### Fixed\n\n- issue where Relevance inside of Relevance might prevent cleanup on form state\n\n## 4.11.3 (May 2nd, 2022)\n\n### Fixed\n\n- issue where nested array fields removal would break\n\n## 4.11.2 (April 29th, 2022)\n\n### Fixed\n\n- issue where custom error messages did not work in allOf\n- issue where required:[] on allOf was not working\n\n## 4.11.1 (April 28th, 2022)\n\n### Fixed\n\n-issue where zero ( 0 ) would not work for minimum and maximum due to bad falsey check lol classic\n\n## 4.11.0 (April 28th, 2022)\n\n### Added\n\n- onNativeChange handler to useField\n\n## 4.10.0 (April 27th, 2022)\n\n### Added\n\n- onValid and onInvalid to useForm\n\n## 4.9.4 (April 19th, 2022)\n\n### Fixed\n\n- issue where we would not pass all options to intl formatter\n\n## 4.9.3 (April 13th, 2022)\n\n### Fixed\n\n- issue where after a gather data the field-value event would not get triggered so evaluate would never get called\n\n## 4.9.2 (April 13th, 2022)\n\n### Fixed\n\n- issue where FormComponents was not rendering from components option\n\n## 4.9.1 (April 12th, 2022)\n\n### Fixed\n\n- issue where modified would NOT be correct when allowEmptyString was passed\n\n## 4.9.0 (April 12th, 2022)\n\n### Added\n\n- `formState.modified`\n- `fieldState.modified`\n\n## 4.8.1 (April 4th, 2022)\n\n### Fixed\n\n- Issue where errors would get kept when going to previous multistep step\n\n## 4.8.0 (March 31st, 2022)\n\n### Added\n\n- useConditional hook and ability to pass `evaluate` and `evaluateWhen`\n\n## 4.7.0 (March 29th, 2022)\n\n### Added\n\n- ability to pass gatherOnMount to a field\n\n## 4.6.1 (March 22nd, 2022)\n\n### Fixed\n\n- misnamed `gatherData` prop\n\n## 4.6.0 (March 22nd, 2022)\n\n### Added\n\n- `gatherData` prop to allow user to get asnyc information for a field\n\n## 4.5.12 (March 22nd, 2022)\n\n### Fixed\n\n- Missing types for default exported fields\n- Missing type for `required`\n\n## 4.5.11 (March 20th, 2022)\n\n### Fixed\n\n- issue where allowEmptyString and allowEmptyStrings where broken\n\n## 4.5.10 (March 18th, 2022)\n\n### Fixed\n\n- issue where `step` was missing from multistep type\n\n## 4.5.9 (March 18th, 2022)\n\n### Fixed\n\n- issue with propertyOrder in nested schemas\n\n## 4.5.8 (March 18th, 2022)\n\n### Fixed\n\n- issue with more than double nested schemas\n- issue with Multistep.Step types\n\n## 4.5.7 (March 9th, 2022)\n\n### Fixed\n\n- issue with changing options on schema fields ( undefined would clobber defined values in option merge )\n\n## 4.5.6 (March 8th, 2022)\n\n### Fixed\n\n- issue where changing validation params would not rebuild validation function\n\n## 4.5.5 (March 8th, 2022)\n\n### Fixed\n\n- issue where multistep steps would not deregister\n\n## 4.5.4 (Feb 28th, 2022)\n\n### Fixed\n\n- issue where multistep steps would not clean up after themselves\n\n## 4.5.3 (Feb 22th, 2022)\n\n### Fixed\n\n- issue with touchAllFields not touching fields within an array\n\n## 4.5.2 (Feb 18th, 2022)\n\n### Fixed\n\n- Another Issue with debugger in react native that caused crash\n\n## 4.5.1 (Feb 16th, 2022)\n\n### Fixed\n\n- Issue with debugger in react native\n\n## 4.5.0 (Feb 16th, 2022)\n\n### Added\n\n- onValueModified prop to useForm\n\n## 4.4.0 (Feb 15th, 2022)\n\n### Added\n\n- ability to pass reset options to reset field\n\n## 4.3.0 (Feb 15th, 2022)\n\n### Added\n\n- onValueChange prop to useForm\n\n## 4.2.0 (Feb 10th, 2022)\n\n### Added\n\n- Ability to add n items to array field by passing add(3) a number to add\n\n## 4.1.2 (Feb 10th, 2022)\n\n### Fixed\n\n- Missing form level option for keepState and keepStateIfRelevant\n\n## 4.1.1 (Feb 9th, 2022)\n\n### Fixed\n\n- Stupid issue with safari throwing a type error when trying to check for selectionStart on event.target\n\n## 4.1.0 (Feb 8th, 2022)\n\n### Added\n\n- Ability to use state across multiple forms\n\n## 4.0.35 (Feb 8th, 2022)\n\n### Fixed\n\n- missing types for multistep and formApi\n\n## 4.0.34 (Feb 4th, 2022)\n\n### Fixed\n\n- issue with INTL formatter when used with `EUR` and `en-DE`\n\n## 4.0.33 (Feb 3rd, 2022)\n\n### Fixed\n\n- issue with formatter function not allowing full value\n\n## 4.0.32 (January 26th, 2022)\n\n### Fixed\n\n- issue with FormField not allowing conditional fields\n\n## 4.0.31 (January 25th, 2022)\n\n### Fixes https://github.com/teslamotors/informed/issues/381\n\n- autoFocus on Input throws error\n\n## 4.0.30 (January 24th, 2022)\n\n### Added\n\n- propertyOrder back to schema\n\n## 4.0.29 (January 20th, 2022)\n\n### Added\n\n- asyncValidate to formApi\n\n## 4.0.28 (January 18th, 2022)\n\n### Fixed\n\n- issue with cursor offsets when suffix is added\n\n## 4.0.27 (January 14th, 2022)\n\n### Fixed\n\n- issue with negative cursor offsets\n\n### Fixed\n\n- issue with off by one cursor locations on formatter\n\n## 4.0.25 (January 14th, 2022)\n\n### Fixed\n\n- createIntlNumberFormatter not working with negative numbers\n\n## 4.0.24 (January 7th, 2022)\n\n### Added\n\n- clearValue() function to form and field apis\n\n### Fixed\n\n- Issue where validateOnMount would NOT trigger validation when a field was re-rendered\n\n## 4.0.23 (January 5th, 2022)\n\n### Fixed\n\n- issue with array field items being memoized\n\n## 4.0.22 (January 5th, 2022)\n\n### Fixed\n\n- issue with createIntlNumber mask adding random "[]" sometimes\n\n## 4.0.21 (January 5th, 2022)\n\n### Fixed\n\n- issue where returning "" from validation function would not show error state\n\n## 4.0.20 (January 4th, 2022)\n\n### Fixed\n\n- issue where removing item from array field would not make the form dirty\n\n## 4.0.19 (December 31st, 2021)\n\n### Exposed\n\n- useRelevance hook and added type for it in types\n\n## 4.0.18 (December 23rd, 2021)\n\n### Fixed\n\n- issue where values would get cleared on un-mount\n\n## 4.0.17 (December 17th, 2021)\n\n### Fixed\n\n- issue where I forgot to deregister fields when they became irrelevant\n\n## 4.0.16 (December 17th, 2021)\n\n### Fixed\n\n- issue where I forgot to allow relevanceDeps to be passed to multistep step\n\n## 4.0.15 (December 15th, 2021)\n\n### Moved\n\n- The repo to tesla or go needed to re publish to get updated README to npm\n\n## 4.0.14 (December 15th, 2021)\n\n### Fixed\n\n- forgot to add getCurrentStep to multistepApi\n- forgot to add nextStep and previousStep to multistepState\n\n## 4.0.13 (December 15th, 2021)\n\n### Fixed\n\n- issue where set touched did not default meta when field is not there\n\n## 4.0.12 (December 15th, 2021)\n\n### Fixed\n\n- issue where `FormField` could not take field props\n\n## 4.0.11 (December 15th, 2021)\n\n### Fixed\n\n- missing type for Relevant\n\n## 4.0.10 (December 15th, 2021)\n\n### Fixed\n\n- issue where FormProvider was not exported\n\n## 4.0.9 (December 13th, 2021)\n\n### Fixed\n\n- issue where passing showErrorIfTouched={false} would not work\n\n## 4.0.8 (December 10th, 2021)\n\n### Removed\n\n- Empty dependencies object from package.json\n\n## 4.0.7 (December 10th, 2021)\n\n### Fixed\n\n- Issue with relevance subscription when no relevance function\n\n## 4.0.6 (December 9th, 2021)\n\n### Fixed\n\n- Missing functions setValues and setTheseValues\n\n## 4.0.5 (December 9th, 2021)\n\n### Fixed\n\n- Missing types for validate and validateField on FormApi\n\n## 4.0.4 (December 9th, 2021)\n\n### Fixed\n\n- Issue where we forgot to expose form validate\n- Missing utils types\n\n## Added\n\n- useScope and useScoper to exports\n\n## 4.0.3 (December 7th, 2021)\n\n### Fixed\n\n- Issue with forms valid and invalid when relevance changes\n\n## 4.0.2 (December 7th, 2021)\n\n### Fixed\n\n- Issue with schema path util `inverter[12].air_filter_ok` would not work\n\n## 4.0.1 (December 7th, 2021)\n\n### Fixed\n\n- Issue with initializing when becoming relevant\n\n## 4.0 !!!!\n\n### Breaking changes\n\n#### onSubmit signature\n\nOld\n\n```\nconst onSubmit = values => console.log( values );\n```\n\nNew\n\n```\nconst onSubmit = formState => console.log( formState.values );\n```\n\n#### Text --> Input\n\nOld\n\n```jsx\n\n```\n\nNew\n\n```jsx\n\n```\n\n#### apiRef --> formApiRef\n\nOld\n\n```jsx\n
\n// OR\n\n```\n\nNew\n\n```jsx\n\n```\n\n#### informed:props ( schema )\n\n```\ninformed:props is now ui:props when using schema based forms\n```\n\n#### `asField` has been removed\n\nInstead of doing this\n\n```js\nconst CustomField = asField({ fieldState, fieldApi }) => {}\n```\n\nDo this\n\n```js\nconst CustomField = props => {\n const { fieldState, fieldApi } = useField(props);\n};\n```\n\n#### Relevance\n\nThe when function for relevance now has this signature\n\n```\nwhen={({formState, formApi, scope}) => {...} }\n```\n\n#### yupSchema\n\n```\nvalidationSchema ---> is now yupSchema\n```\n\n#### Array Fields\n\n##### Renamed `field` to `name`\n\n```jsx\n\n {({ remove, field }) => (\n <>\n \n \n \n )}\n\n```\n\nIs Now\n\n```jsx\n\n {({ remove, name }) => (\n <>\n \n \n \n )}\n\n```\n\n##### No more array field path prefixing\n\nOld:\n\n```jsx\n\n {({ remove, field }) => (\n <>\n \n \n \n \n )}\n\n```\n\nNew:\n\n```jsx\n\n {({ remove }) => (\n <>\n \n \n \n \n )}\n\n```\n\n##### No more values in array field render prop\n\nOld:\n\n```jsx\n// Some component you need to use state of array field item\nconst FieldState = ({ values }) => {\n return (\n
\n      {JSON.stringify(values, null, 2)}\n    
\n );\n};\n\n\n {({ remove, values }) => (\n <>\n \n \n \n \n \n )}\n;\n```\n\nNew:\n\n```jsx\n// Some component you need to use state of array field item\nconst FieldState = () => {\n const { values } = useArrayFieldItemState();\n return (\n
\n      {JSON.stringify(values, null, 2)}\n    
\n );\n};\n\n\n {({ remove }) => (\n <>\n \n \n \n \n \n )}\n;\n```\n\n#### Debugging with ``\n\nOld:\n\n```jsx\n\n```\n\nNew:\n\n```jsx\n\n```\n\n#### Custom Inputs\n\nMinor changes to custom inputs\n\nNew:\n\n```jsx\nconst CustomInput = props => {\n const { fieldState, fieldApi, render, ref, userProps } = useField(props);\n\n // The field state\n const { value, error, showError } = fieldState;\n\n // The field control\n const { setValue, setTouched } = fieldApi;\n\n // Everything else\n const { label, id, ...rest } = userProps;\n\n return render(\n <>\n {label ? : null}\n {\n setValue(e.target.value, e);\n }}\n onBlur={e => {\n setTouched(true, e);\n }}\n style={showError ? { border: \'solid 1px red\' } : null}\n />\n {showError ? {error} : null}\n \n );\n};\n```\n\n#### Validation\n\nValidation is now controlled via validateOn="validationString"\n\nBy default fields will only validate on blur. To get\nmore granular validation, simply pass in `validateOn` props.\n\nSee table below for mapping:\n\n
\n\n| validateOn | derived | change | blur | submit | default |\n| ------------- | ------------- | ------------ | ------------ | ------------ | ------- |\n| change | change-change | sync + async | sync + async | sync + async | |\n| blur | blur-blur | x | sync + async | sync + async | x |\n| change-blur | change-blur | sync | sync + async | sync + async | |\n| change-submit | change-submit | sync | sync | sync + async | |\n| blur-submit | submit-submit | x | sync | sync + async | |\n| submit | submit-submit | x | x | sync + async | |\n\n
\n\nValidation is controlled via the `validateOn` prop, but in order to control when it shows,\nuse the `showErrorIfError` and `showErrorIfDirty` props. **This is because sometimes you may want the form to be invalid but not show the error to the user yet ( default is `showErrorIfTouched` )**\n\n| prop | description | default |\n| ------------------ | ------------------------------------------------------------------------------------------------------------ | ------- |\n| showErrorIfError | will set `showError` for that field to true whenever there is an error (typically used with validateOnMount) | |\n| showErrorIfTouched | will set `showError` for that field to true whenever there is an error and the field is touched | x |\n| showErrorIfDirty | will set `showError` for that field to true whenever there is an error and the field is dirty | |\n\n
\n\nFinally we have a use case for validating right away ( on mount )\n\n| prop | description | default |\n| --------------- | ------------------------------- | ------- |\n| validateOnMount | will trigger validation onMount | false |\n\n
\n
\n\n---\n\n
\n\n## 3.34.0 (June 22, 2021)\n\n### Added\n\n- ability to control when async validation occurs with props\n\n## 3.33.0 (May 21, 2021)\n\n### Added\n\n- createIntlNumberFormatter\n\n## 3.32.3 (May 21, 2021)\n\n### Fixed\n\n- Issue with useFieldState, now returns empty object by default\n\n## 3.32.2 (May 21, 2021)\n\n### Fixed\n\n- Issue with mounting useFieldStates\n\n## 3.32.1 (May 21, 2021)\n\n### Fixed\n\n- Issue with layoutEffect in SSR\n\n## 3.32.0 (May 19, 2021)\n\n### Added\n\n- Ability to walk down a multistep with step selection.\n\n## 3.31.0 (April 26, 2021)\n\n### Added\n\n- formatter functions `formatter = [()=>{}, ()=>{}]`\n\n## 3.30.3 (April 2, 2021)\n\n### Added\n\n- memoized render back because I never should have removed it\n\n## 3.30.2 (March 15, 2021)\n\n### Refactored\n\n- To no longer use event emitter.\n\n## 3.30.1 (March 5, 2021)\n\n### Fixed\n\n- Issue where keep state in scope was not working.\n\n## 3.30.0 (March 2, 2021)\n\n### Added\n\n- Pristine and Dirty to formFieldState\n\n## 3.29.4 (February 24, 2021)\n\n### Updated\n\n- Peer deps to support react v 17\n\n## 3.29.3 (February 5, 2021)\n\n### Fixed\n\n- Issue where ObjectMap `has` would reference wrong get funciton fixes #327\n\n## 3.29.2 (February 4, 2021)\n\n### Fixed\n\n- Issue where carrot pos would be in the wrong place when formatting\n\n### Updated\n\n- `useField` hook to use the `useCarrotPosition` hook ( removed duplicate code )\n\n## 3.29.1 (February 4, 2021)\n\n### Added\n\n- Ability to call `setValue` function for custom formattedObject Inputs\n\n## 3.29.0 (February 2, 2021)\n\n### Added\n\n- Ability to pass `initialize` function for custom initialization of the initial value\n\n## 3.28.0 (February 2, 2021)\n\n### Exposed\n\n- Utils functions that can be used by end users\n\n## 3.27.0 (December 18, 2020)\n\n### Fixed\n\n- bug with update function in form controller where it would pull instead of delete on swap\n\n## 3.26.0 (December 17, 2020)\n\n### Added\n\n- `swap` to array fields\n\n### Rafactored\n\n- Internal state management\n\n## 3.25.0 (December 8, 2020)\n\n### Added\n\n- `onReset` to form props\n\n## 3.24.4 (December 5, 2020)\n\n### Updated\n\n- README and needed to get it to npm ... again again\n\n## 3.24.3 (December 5, 2020)\n\n### Updated\n\n- README and needed to get it to npm ... again\n\n## 3.24.2 (November 24, 2020)\n\n### Updated\n\n- README and needed to get it to npm\n\n## 3.24.1 (November 23, 2020)\n\n### Fixed\n\n- Type issue ( missing allow empty string from props def )\n\n## 3.24.0 (November 19, 2020)\n\n### Fixed\n\n- Issue where Id was not getting passed to default select field\n\n## 3.23.0 (November 18, 2020)\n\n### Removed\n\n- LODASH!!!!! SEE YA LATER NEVER\n\n## 3.22.0 (November 17, 2020)\n\n### Added\n\n- Ability to pass relevant to array fields!!!\n\n## 3.21.2 (November 14, 2020)\n\n### Fixed\n\n- Bug with field level relevant\n\n### Updated\n\n- Form to always evaluate relevance, and not force the user to pass notify.\n\n## 3.21.1 (November 12, 2020)\n\n### Fixed\n\n- Isssue where state would not update after submit\n\n## 3.21.0 (November 12, 2020)\n\n### Added\n\n- Ability to add async validation functions to inputs\n\n## 3.20.0 (November 11, 2020)\n\n### Added\n\n- Ability to not pass keep state to multistep fields, and also added docs for conditional relevant nested array fields\n\n## 3.19.0 (November 10, 2020)\n\n### Added\n\n- Ability to hide or show fields based on relevant, and notify relevant fields\n\n## 3.18.3 (November 10, 2020)\n\n### Fixed\n\n- bug with resetting array field items\n\n## 3.18.2 (November 9, 2020)\n\n### Fixed\n\n- bug with duplicate fields\n\n## 3.18.1 (November 9, 2020)\n\n### Fixed\n\n- bug with keep state registering phantom fields\n\n## 3.18.0 (November 5, 2020)\n\n### Added\n\n- ability to create custom schema fields\n\n## 3.17.1 (November 3, 2020)\n\n### Fixed\n\n- useField was not adding id to label by default\n\n## 3.17.0 (November 3, 2020)\n\n### Added\n\n- Required attribute to input and automatic type generation for useField hook\n\n## 3.16.1 (November 2, 2020)\n\n### Fixed\n\n- Issue where informed props were not passed down to array fields in schema\n\n## 3.16.0 (November 1, 2020)\n\n### Added\n\n- Ability to have conditional schemas!!!!\n\n## 3.15.0 (October 28, 2020)\n\n### Added\n\n- Ability to add array fields in schema!!!!\n\n## 3.14.0 (October 27, 2020)\n\n### Added\n\n- Formatter and Parser !!!!!\n\n## 3.13.2 (October 27, 2020)\n\n### Fixed\n\n- Issue with strict mode double registering\n\n## 3.13.1 (October 23, 2020)\n\n### Fixed\n\n- Bug where inforemd would crash if schema was missing field that was in JSX ( returns null )\n\n## 3.13.0 (October 23, 2020)\n\n### Added\n\n- Ability to render schema fields in specific paces within JSX!!\n\n## 3.12.0 (October 22, 2020)\n\n### Added\n\n- Added AJV Schema shit!!!\n\n## 3.11.0 (October 21, 2020)\n\n### Added\n\n- Schema shit\n\n## 3.10.1 (October 18, 2020)\n\n### Fixed\n\n- Array fields because I stupidly broke them\n\n#### Added\n\n- Tests for multistep fields\n- Better multistep form syntax\n- Better multistep docs\n\n## 3.10.0 (September 29, 2020)\n\n### Updated\n\n- internals to modify state direct to improve performance!\n\n## 3.9.0 (June 15, 2020)\n\n### Updated\n\n- useArray field to expose a reset that resets to initial values\n\n## 3.8.1 (May 11, 2020)\n\n### Fixed\n\n- Issue with back and next types for multistep fields\n\n## 3.8.0 (May 4, 2020)\n\n### Added\n\n- Array field Api control for ArrayFieldItems\n\n## 3.7.0 (May 4, 2020)\n\n### Refactored\n\n- To use field ids instead of names\n\n### Added\n\n- `` component\n\n## 3.6.1 (March 2, 2020)\n\n### Updated\n\n- Type file to include preventEnter on form props\n\n## 3.6.0 (March 1, 2020)\n\n### Added\n\n- Ability to pass formController to useField hook\n\n## 3.5.2 (February 28, 2020)\n\n### Fixed\n\n- [Issue](https://github.com/joepuzzo/informed/issues/275) where new version of react would throw warnings due to bad code\n\n## 3.5.1 (February 27, 2020)\n\n### Fixed\n\n- [Issue](https://github.com/joepuzzo/informed/issues/272) where dynamic nested array fields with keep state kept too much state :)\n\n## 3.5.0 (February 25, 2020)\n\n### Added\n\n- New multistep abilities via setCurrent in `formApi` and `Current` in `formState`. See compex multistep form in docs\n\n## 3.4.0 (February 22, 2020)\n\n### Added\n\n- Ability to spread `informed` object on inputs via the `useField` hook\n\n## 3.3.5 (February 22, 2020)\n\n### Updated\n\n- Readme to show useForm example\n\n## 3.3.4 (February 20, 2020)\n\n### Added\n\n- FormState component to assist when debugging!\n\n## 3.3.3 (February 18, 2020)\n\n### Added\n\n- Types for multisetp forms\n\n## 3.3.2 (February 16, 2020)\n\n### Added\n\n- Ability to use cursor position in mask function\n\n## 3.3.1 (February 16, 2020)\n\n### Updated\n\n- Intro examples to inculde on submit example\n\n## 3.3.0 (February 10, 2020)\n\n### Added\n\n- Field level Yup support\n\n## 3.2.1 (February 9, 2020)\n\n### Fixed\n\n- Typo in yup docs and readme\n\n## 3.2.0 (February 9, 2020)\n\n### Added\n\n- Yup support\n\n## 3.1.2 (February 9, 2020)\n\n### Updated\n\n- docs and readme to link to dicord channel\n\n## 3.1.1 (February 8, 2020)\n\n### Added\n\n- apiRef so you can just pass a ref to the form\n\n## 3.1.0 (February 5, 2020)\n\n### Added\n\n- Step functionality to support multistep forms\n\n## 3.0.2 (January 24, 2020)\n\n### Fixed\n\n- Issue https://github.com/joepuzzo/informed/issues/267\n\n## 3.0.1 (January 24, 2020)\n\n### Fixed\n\n- README ( I wish there was a way on npm to update readme without publishing version )\n\n## 3.0.0 (January 24, 2020)\n\n### Fixed\n\n- Issue with array field validation https://github.com/joepuzzo/informed/issues/259\n- Issue where informed would throw errors when fields were hidden but referenced\n\n### Added\n\n- Ability to ( in the near future ) add validations to scopes ( Enabled because of code refacotor... will add soon :)\n\n### Changed\n\n- The internals to no longer keep track of giant state object but instead generate it on demand\n\n### Removed\n\n- A bunch of useless code :)\n\n#### Cleaned up\n\n- Large portion of the code .. Mostly the formController!\n\n## 2.11.17 (January 21, 2020)\n\n## Update\n\n- useField to trigger validation when validation related props change\n\n## 2.11.16 (November 18, 2019)\n\n## Fixed\n\n- issue with array field where validation would fail\n\n## 2.11.15 (November 6, 2019)\n\n## Fixed\n\n- issue with array field where removing multiple fields did not remove the data from state\n\n## 2.11.14 (November 5, 2019)\n\n## Removed\n\n- removable prop to inputs because it was a bad idea... now it supports removal nativley\n\n## 2.11.13 (November 4, 2019)\n\n## Added\n\n- removable prop to inputs ( adds support for pairing keep state and array fields such that remove button actually removes field )\n\n## 2.11.12 (November 1, 2019)\n\n## Fixed\n\n- issue with keep state on array fields\n\n## 2.11.11 (November 1, 2019)\n\n## Added\n\n- comp name to useField hook\n\n## 2.11.10 (October 21, 2019)\n\n## Added\n\n- missing setFormError prop to FormApi interface\n\n## 2.11.9 (September 10, 2019)\n\n## Added\n\n- keepState to types\n\n## 2.11.8 (July 16, 2019)\n\n## Adds\n\n- allowEmptyStrings form level prop to types\n\n## 2.11.7 (July 8, 2019)\n\n## Fixes\n\n- issue 227 where allowEmptyStrings form level prop did not work\n\n## 2.11.6 (July 2, 2019)\n\n## Fixes\n\n- issue 219 where array fields would not work with scope\n\n## 2.11.5 (July 2, 2019)\n\n## Fixes\n\n- issue 225 where validation will occur on mount when there are initial values\n\n## 2.11.4 (July 1, 2019)\n\n## Fixes\n\n- issue 215 where selects dont work in Edge becase .. you know.. Microsoft\n\n## 2.11.3 (July 1, 2019)\n\n## Fixes\n\n- warning with useLayoutEffect when using SSR\n\n## 2.11.2 (June 27, 2019)\n\n## Updated\n\n- README file to include minzipped badge\n\n## 2.11.1 (June 18, 2019)\n\n## Fixed\n\n- Issue where initial values changing on multiselects caused looping .. oops\n\n## 2.11.0 (June 14, 2019)\n\n## Updated\n\n- useForm to return user props and a render method\n- Form provider to no longer render a `` IT NEVER SHOULD HAVE.\n\n## 2.10.2 (June 13, 2019)\n\n## Fixed\n\n- Issue where initial values did not change when form was reset\n\n## 2.10.1 (June 11, 2019)\n\n## Fixed\n\n- Issue where array level validation would not trigger for complex nested fields within array field\n\n## Added\n\n- length as a second parameter to arrayFields validate function\n\n## 2.10.0 (June 7, 2019)\n\n## Added\n\n- ability to pass validation function to an array field\n- arrayFields are now treaded as "shadow" fields\n\n## 2.9.0 (June 6, 2019)\n\n## Added\n\n- useArrayField hook\n\n## 2.8.2 (June 5, 2019)\n\n## Added\n\n- ability to change out form options such as validateFields\n\n## 2.8.1 (June 5, 2019)\n\n## Fixed\n\n- issue with addWithInitialValue when using add and then addWithInitialValue\n\n## 2.8.0 (June 5, 2019)\n\n## Added\n\n- addWithInitialValue to the `ArrayField`\n\n## 2.7.8 (May 31, 2019)\n\n## Fixed\n\n- issue where initial values were not being formatted\n\n## 2.7.7 (May 30, 2019)\n\n## Fixed\n\n- issue where initial values were not being masked\n\n## 2.7.6 (May 29, 2019)\n\n## Updated\n\n- Types file to support validate on formApi\n\n## 2.7.5 (May 29, 2019)\n\n## Updated\n\n- Types file to support any type on form errors\n\n## 2.7.4 (May 23, 2019)\n\n### Fixed\n\n- documentation for creating custom inputs\n\n### Added\n\n- the ability to pass your own ref to inputs\n\n## 2.7.3 (May 22, 2019)\n\n### Fixed\n\n- issue with validation triggering when keep state and validate on blur\n\n## 2.7.2 (May 21, 2019)\n\n### Added\n\n- made `maskWithCursorOffset` optional in types\n\n## 2.7.1 (May 21, 2019)\n\n### Added\n\n- `maskWithCursorOffset` to the type defs\n\n## 2.7.0 (May 21, 2019)\n\n### Added\n\n- `maskWithCursorOffset` prop to inputs\n\n## 2.6.15 (May 20, 2019)\n\n### Added\n\n- maintainCursor to types\n\n## 2.6.14 (May 16, 2019)\n\n### Added\n\n- render and userProps to field context types\n\n## 2.6.13 (May 16, 2019)\n\n### Added\n\n- maskedValue to types\n\n## 2.6.12 (May 14, 2019)\n\n### Added\n\n- getters to useFields field api\n\n## 2.6.11 (May 11, 2019)\n\n### Added\n\n- useField hook to the docs\n\n### Updated\n\n- the interface for useField hook\n\n## 2.6.10 (May 10, 2019)\n\n### Fixed\n\n- issue where initialization code in useform was in the effect and not in constructor\n\n## 2.6.9 (May 10, 2019)\n\n### Fixed\n\n- attempting to fix issue that I think is caused by useEffect in useForm hook\n\n## 2.6.8 (May 10, 2019)\n\n### Fixed\n\n- issues cause by using `useMemo` instead of `useState` for initial render stuff\n\n## 2.6.7 (May 9, 2019)\n\n### Added\n\n- exists function to the field api types\n\n## 2.6.6 (May 9, 2019)\n\n### Added\n\n- exists function to the field api so you can check to see if that field exists\n\n## 2.6.5 (May 9, 2019)\n\n### Fixed\n\n- issue where inital render of useFieldApi would fail when field was not registered yet\n\n## 2.6.4 (May 9, 2019)\n\n### Updated\n\n- useForm hook so that the event handlers can change\n\n## 2.6.3 (May 7, 2019)\n\n### Removed\n\n- debug as a dependency and added my own :)\n\n## 2.6.2 (May 3, 2019)\n\n### Fixed\n\n- issue with default register context missin getField function\n\n## 2.6.1 (May 3, 2019)\n\n### Fixed\n\n- issue with `useFieldApi` hook and `withFieldApi` HOC where reset and validate were not there\n\n### Added\n\n- a few more tests to increase test coverage!!!! wooo\n\n## 2.6.0 (May 2, 2019)\n\n### Added\n\n- `useForm` hook!!! and `FormProvider` component!!!\n\n## 2.5.0 (April 30, 2019)\n\n### Updated\n\n- useField hook to useEffect instead of useLayoutEffect\n\n## 2.4.0 (April 30, 2019)\n\n### Added\n\n- preventEnter prop to the form so users can prevent enter key form submission\n\n## 2.3.2 (April 22, 2019)\n\n### Updated\n\n- Issue with dynamic arrays and initial values\n\n## 2.3.1 (April 12, 2019)\n\n### Updated\n\n- Babel build\n\n## 2.3.0 (April 3, 2019)\n\n### Added\n\n- `allowEmtyStrings` prop to the form\n- `allowEmtyString` prop to inputs\n\n### Fixed\n\n- issue where setValues would not allow empty strings\n\n## 2.2.0 (March 29, 2019)\n\n### Added\n\n- `setFormError` function to the form api\n- `validate` function to the form api\n\n## 2.1.15 (March 28, 2019)\n\n### Fixed\n\n- Issue with setValues missing from the default context\n\n## 2.1.14 (March 27, 2019)\n\n### Fixed\n\n- Issue where reset would call validation\n\n## 2.1.13 (March 18, 2019)\n\n### Updated\n\n- Allowing for optional generic on FormValue\n\n## 2.1.12 (March 13, 2019)\n\n### Updated\n\n- ref to be any type in typings\n\n## 2.1.11 (March 12, 2019)\n\n### Fixed\n\n- issue in typings for ref field on FieldContext\n\n## 2.1.10 (March 12, 2019)\n\n### Fixed\n\n- issue when using a field NOT in the context of a form\n\n## 2.1.9 (March 8, 2019)\n\n### Fixed\n\n- another issue where initial values did not work when keep state was passed\n\n## 2.1.8 (March 8, 2019)\n\n### Fixed\n\n- issue where initial values did not work when keep state was passed\n\n## 2.1.7 (March 3, 2019)\n\n### Fixed\n\n- issue where initial values did not work for `ArrayFields`\n\n## 2.1.6 (Feb 21, 2019)\n\n### Updated\n\n- typing files for type script users\n\n## 2.1.5 (Feb 19, 2019)\n\n### Fixed\n\n- Issue with text area input not setting typed value\n\n## 2.1.4 (Feb 19, 2019)\n\n### Added\n\n- `maskOnBlur` prop to inputs\n\n## 2.1.3 (Feb 14, 2019)\n\n### Added\n\n- `fieldExists` api function to check if field exists\n\n## 2.1.2 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where form that is submitted through enter key would try to prevent default\n\n## 2.1.1 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where form values would not get passed to validation function when touched\n\n## 2.1.0 (Feb 14, 2019)\n\n### Updated\n\n- Format and parse to set maskedValue instead of value\n\n## 2.0.5 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where you could NOT set 0 null or false as initial values because they are falsey\n\n## 2.0.4 (Feb 13, 2019)\n\n### Added\n\n- validateFields function to the form!!!\n\n## 2.0.3 (Feb 13, 2019)\n\n### Fixed\n\n- Issue where reset would not work for scoped fields\n\n### Added\n\n- Set Values to the form api!!!\n\n## 2.0.2 (Feb 13, 2019)\n\n### Fixed\n\n- Issue where ArrayField was prefixing all fields with \'field\'\n- Issue where when input fields changed input did not rerender.\n\n## 2.0.1 (Feb 10, 2019)\n\n### Fixed\n\n- Issue where render and component props were getting passed to the dom form\n\n## 2.0.0 (Feb 7, 2019)\n\n### Added\n\n- useFieldApi\n- useFieldState\n- useFormApi\n- useFormState\n- useField\n- format\n- parse\n- maintianCursor ( fixes issue where cursor jumps to end on mask )\n- ArrayField ( Check out the docs! this is sick! )\n- Form Level validation ( function that can invalidate the form as a whole )\n- debug prop that allows you to visually view the rendering!\n\n### Changed\n\n- the field `"siblings.1"` now resolves to `values.siblings[1]`, it used to resolve to `values.siblings.1`\n- the field `"siblings[\'2\']"` now resolves to `values.siblings[2]`, it used to resolve to `values.siblings.2`\n- withFormApi will no longer trigger a rerender if the fomrs state changes. This is a great optimization for those who want to modify but dont care about the form state!\n- the `validate` prop now expects the validation function to return `undefined` if there is no error. Any other returned value (including falsey `null`, `0`, etc will be treated as an error for the field.\n\n### Removed\n\n- The Field Component\n- `fieldExists` not needed\n- `setState` will maybe add later but its complex and out of scope ATM\n- `setValues` will maybe add later but its complex and out of scope ATM ( as of V 2.0.3 its back! )\n- `preSubmit` was never needed.. developers can do this themselves\n- Async Validation. Async validation led to many issues that overcomplicated `informed`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\n\n## 1.10.12 ( December 4, 2018 )\n\n### Updated\n\n- typescript definition file\n\n## 1.10.11 & 1.10.10 I ran version patch twice lol ( December 4, 2018 )\n\n### Updated\n\n- Select forward ref\n\n## 1.10.9 ( November 16, 2018 )\n\n### Updated\n\n- files in package json to include typeigs\n\n## 1.10.8 ( November 8, 2018 )\n\n### Added\n\n- type file for typescript\n\n## 1.10.7 ( October 11, 2018 )\n\n### Updated\n\n- Name of withFormSate\n\n## 1.10.6 ( October 2, 2018 )\n\n### Fixed\n\n- Skipped test for select!!!\n\n### Updated\n\n- Select to use new ref interface\n\n## 1.10.5 ( September 14, 2018 )\n\n### Added\n\n- License\n\n## 1.10.4 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime was the dep when it should have ben @babel/runtime-corejs2\n\n## 1.10.3 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime for real this time\n\n## 1.10.2 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime\n\n## 1.10.1 ( August 13, 2018 )\n\n### Removed\n\n- mistakenly added dev deps that were deps... oops\n\n## 1.10.0 ( August 13, 2018 )\n\n### Added\n\n- submits to the form state\n\n## 1.9.0 ( August 8, 2018 )\n\n### Rebuilt\n\n- Added prettier so all the files have been changed... so i rebuilt to have source maps match code\n\n## 1.8.1 ( August 1, 2018 )\n\n### Rebuilt\n\n- Attempting to simply rebuild lib due to possible build issue\n\n## 1.8.0 ( August 1, 2018 )\n\n### Updated\n\n- initialValue to get exposed as prop to custom fields\n\n## 1.7.5 ( July 31, 2018 )\n\n### Added\n\n- Source maps\n\n## 1.7.4 ( July 26, 2018 )\n\n### Fixed\n\n- Issue where Basic radio group was not getting exported\n\n## 1.7.3 ( July 23, 2018 )\n\n### Fixed\n\n- issue where bind to field did not pass down the field prop.\n\n## 1.7.2 ( July 20, 2018 )\n\n### Fixed\n\n- Issue where element wont get removed from array when deregistering field... this is used when dynamically removing value\n\n## 1.7.1 ( July 20, 2018 )\n\n### Added\n\n- Field prop is now exposed to field elements and default inputs pass field as name to html inputs\n\n## 1.7.0 ( July 18, 2018 )\n\n### Added\n\n- fieldExists method to the formApi\n\n## 1.6.0 ( July 16, 2018 )\n\n### Added\n\n- onValueChange prop to inputs so you can tie into when values change!!\n\n## 1.5.2 ( July 13, 2018 )\n\n### Fixed\n\n- Issue where prop changes to fields would not get recognized\n\n## 1.5.1 ( July 13, 2018 )\n\n### Fixed\n\n- issue where i forgott to add @babel/runtime as dependency\n\n## 1.5.0 ( July 12, 2018 )\n\n### Added\n\n- asyncValidation prop to inputs\n- asyncValidateOnBlur prop to inputs\n\n## 1.4.0 ( July 5, 2018 )\n\n### Added\n\n- Basic input fields so users can more easily create custom inputs\n- Docs for creating custom inputs\n\n## 1.3.11 ( July 9, 2018 )\n\n### Fixed\n\n- issue where you could not nest scope\n\n## 1.3.10 ( July 5, 2018 )\n\n### Fixed\n\n- issue where you could not pass initialValue=false to checkbox\n\n## 1.3.9 ( July 5, 2018 )\n\n### Fixed\n\n- issue where mutable values were getting passed to onSubmit and getState\n\n## 1.3.8 ( July 2, 2018 )\n\n### Fixed\n\n- issue where path array was being build every get and set\n\n## 1.3.7 ( July 2, 2018 )\n\n### Fixed\n\n- issue where onChange was getting passed to internal form element\n\n## 1.3.6 ( June 28, 2018 )\n\n### Added\n\n- globalObject: \'this\' to the webpack dist config to support SSR\n\n## 1.3.5 ( June 28, 2018 )\n\n### Fixed\n\n- Issue with event emitter limit ( need to look into alternative solution )\n- Removed depricated sandbox sinon usage that was causing errors during tests\n\n## 1.3.3 ( June 28, 2018 )\n\n### Updated\n\n- Webpack dist configuration to keep class names\n\n## 1.3.2 ( June 28, 2018 )\n\n### Fixed\n\n- Issue were initialValue was getting passed all the way down to html input\n- Issue where form would not rerender when field was registered\n\n## 1.3.1 ( June 28, 2018 )\n\n### Fixed\n\n- Issue were validateOnMount was getting passed all the way down to html input\n\n## 1.3.0 ( June 28, 2018 )\n\n### Added\n\n- mask so you can mask values at field level. example `value => value + \'!!!\'`\n\n## 1.2.1 ( June 27, 2018 )\n\n### Added\n\n- hook so you can add a button with type=reset and it will reset the form\n\n## 1.2.0 ( June 27, 2018 )\n\n### Added\n\n- validateOnMount to input props\n\n## 1.1.2 ( June 25, 2018 )\n\n### Moved\n\n- React and React-Dom to dev dependencies\n\n## 1.1.1 ( June 18, 2018 )\n\n### Fixed\n\n- Bug where i did not do null check on event within on submit\n\n## 1.0.1 ( June 15, 2018 )\n\n### Added\n\n- Notify prop to inputs that allows you to notify other fields when your error state changes ( see docs )\n\n## 1.0.0 (June 12, 2018)\n\n### Added\n\n- Text\n- TextArea\n- Radio Group\n- Radio\n- Select\n- Select as Multiselect !!!\n- Checkbox\n- withRadioGroup\n- withFieldApi\n- withFieldState\n- withFormApi\n- withFormState\n- asField\n- Form\n- Field\n\n### Changed\n\n**\nNote: this was the first release but i wanted to include changes from\n`react-form` so here they are:\n**\n\n- `formApi` was split into two parts `formApi` ( contains just functions ) `formState` ( contains just form state )\n- Form level validation is gone. You do all validation via field validation.\n- `defaultValues` Form prop is now called `initialValues`\n- `onChange` Form prop only recieves the `formState`. It used to retrieve the form Api as well.\n- `preventDefault` Form prop is now `dontPreventDefault`\n- `getApi` Form prop just returns the formApi, not the state and the api.\n- `Form` component now renders the `form` element internally. So you dont have to "hook it up" anymore!!\n\n### Removed\n\n**\nNote: this was the first release but i wanted to include things that were removed from\n`react-form` so here they are:\n**\n\n- `NestedField` you can use `Scope` instead but all it does is scope internal fields to `scope="your-scope"`\n- validateOnSubmit was removed. Now the form always validates on submit by default and you can opt into sooner validation at field level.\n- `defaultValues` form prop is now called `initialValues`\n- `pure` Form prop. Its not needed anymore due to the use of `React.PureComponent` internally.\n- add, remove, and swap values. The developer can achive this on there own without the use of internal functionality.\n- Array Syntax. In order to keep things simple we now only support the string syntax for field names.\n- Async Validation. Async validation led to many issues that overcomplicated `react-form`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\n- Warning and Success have been removed for now to keep lib lean but we may add additional functions in the future.\n'; + '## 4.37.0 (Nov 29th, 2022)\n\n- added ability to pass `keep` to form fields such that users can specify specific state to keep\n\n```js\n// Example where we only keep value\n\n\n```\n\n## 4.36.2 (Nov 9th, 2022)\n\n- removed console log from FormController\n\n## 4.36.1 (Nov 3rd, 2022)\n\n- added missing type for useArrayFieldItemState\n\n## 4.36.0 (Nov 1st, 2022)\n\n- array fields add and remove now trigger onValueSet\n\n## 4.35.2 (Oct 26th, 2022)\n\n- multistep type improvements\n\n## 4.35.1 (Oct 25th, 2022)\n\n- fixed issue where gatherOnMount would not gather after a reset\n\n## 4.35.0 (Oct 19th, 2022)\n\n- added ability to setValueQuietly\n\n## 4.34.0 (Oct 13th, 2022)\n\n- added useInformedApi that will allow user to manipulate multiple forms\n\n## 4.33.0 (Oct 11th, 2022)\n\n- added ability to remove specific index from array field api\n\n## 4.32.0 (Sep 30th, 2022)\n\n- added ability to disable and enable the form via formApi\n\n## 4.31.4 (Sep 22nd, 2022)\n\n- array fields dirt now gets set when a user adds or removes\n\n## 4.31.3 (Sep 22nd, 2022)\n\n- Fixed issue where react strict mode and 18 would not cleanup fields values when they were unmounted\n\n## 4.31.2 (Sep 20th, 2022)\n\n- Fixed issue where reseting array fields with new initial values would still use old ones\n\n## 4.31.1 (Sep 19th, 2022)\n\n- When formatting using createIntlNumberFormatter and currencySign being accounting () would not trigger negative\n\n```js\n// When user types -2 or ($2) it would not format correctly\nconst { formatter, parser } = utils.createIntlNumberFormatter(\'en-US\', {\n style: \'currency\',\n currency: \'USD\',\n currencySign: \'accounting\'\n});\n```\n\n## 4.31.0 (Sep 14th, 2022)\n\n- Form now gets set to dirty when a user performs an add operation on an array field\n\n## 4.30.1 (Sep 12th, 2022)\n\n- Fixed issue with mask prop not masking last character\n\n## 4.30.0 (Sep 11th, 2022)\n\n- Added mask prop back to inputs!!!!!\n\n## 4.29.1 (Sep 8th, 2022)\n\n- Fixed useFormStateSelector when using SSR\n\n## 4.29.0 (August 30th, 2022)\n\n- added onValueSet to form that only gets called when the value is explicitly set\n\n## 4.28.9 (August 30th, 2022)\n\n- Fixed issue where validateOnMount would not trigger when the fields were reset to their initial state\n\n## 4.28.8 (August 25th, 2022)\n\n- Fixed issue where async validate would not trigger when you pass relevance prop to input and input becomes relevant\n\n## 4.28.7 (August 24th, 2022)\n\n- Fixed issue where locales that use comma instead of dot for fractions would not properly format for thousands\n\n## 4.28.6 (August 23nd, 2022)\n\n- Fixed issue where if form was reset array field with defualt values would not reset to the default values\n\n## 4.28.5 (August 22nd, 2022)\n\n- Fixed issue where showErrorIfDirty would not show error if touched\n\n## 4.28.4 (August 19th, 2022)\n\n- Fixed issue where useFieldSubscription would not spread fields to the useEffect causing potential infinate loops\n\n## 4.28.3 (August 15th, 2022)\n\n- Fixed issue where user would type the decimalChar in intl number formatter\n\n## 4.28.2 (August 10th, 2022)\n\n- Added mising types https://github.com/teslamotors/informed/pull/415\n\n## 4.28.1 (August 10th, 2022)\n\n- Fixed issue with number formatter when inititial value is number\n\n## 4.28.0 (August 5th, 2022)\n\n- Added ability to pass default values to array fields\n\n## 4.27.0 (August 4th, 2022)\n\n- Added `useFormStateSelector` hook\n\n## 4.26.0 (August 3rd, 2022)\n\n- Added ability to get field name from onValueModified and onValueChange props to form\n\n## 4.25.0 (August 2nd, 2022)\n\n- Added disabled prop back onto form props\n\n## 4.24.0 (August 1st, 2022)\n\n- Added useInformed to get access to any controller\n\n## 4.23.0 (July 31st, 2022)\n\n- Added useArrayFieldState\n\n## 4.22.0 (July 29th, 2022)\n\n- Added ability to pass focusOnInvalid to the form and also added focusFirstError to formApi\n\n## 4.21.0 (July 19th, 2022)\n\n- Added ability to pass clean function to inputs\n\n## 4.20.1 (July 14th, 2022)\n\n- Fixed issue where evaluate in useConditional would not trigger when form was reset\n\n## 4.20.0 (July 11th, 2022)\n\n### Added\n\n- ability to pass oneOf as an if condition to schemas\n- ability to match fields whos values are arrays with enum in schema conditions\n\n```js\nallOf: [\n {\n if: {\n properties: {\n cars: { oneOf: [\'tesla\', \'jeep\'] }\n },\n required: [\'cars\']\n },\n then: {\n properties: {\n carName: {\n type: \'string\',\n title: \'Cars name\',\n \'ui:control\': \'input\'\n }\n }\n }\n }\n];\n```\n\n## 4.19.3 (July 5th, 2022)\n\n### Fixed\n\n- fixes #411 bad type definition for onSubmit\n\n## 4.19.2 (July 5th, 2022)\n\n### Updated\n\n- package.json to allow react 18 as peer dep\n\n## 4.19.1 (June 24th, 2022)\n\n### Fixed\n\n- issue whith useArray field where if initial value was not array it would crash\n\n## 4.19.0 (June 22nd, 2022)\n\n### Added\n\n- onValueChange prop to fields\n\n## 4.18.2 (June 22nd, 2022)\n\n### Fixed\n\n- issue with key in FormField, this issue can be seen when you have changing schema\n\n## 4.18.1 (June 21st, 2022)\n\n### Updated\n\n- README to have correct urls\n\n## 4.18.0 (June15th, 2022)\n\n### Added\n\n- ability to `if: { properties: { status: {const: ["active"]} } },` in schema ( support array conditions )\n\n## 4.17.0 (June 12th, 2022)\n\n### Added\n\n- resetPath to form api to allow user to pass in path to reset all fields that live under that path\n\n## 4.16.2 (June 9th, 2022)\n\n### Fixed\n\n- issue where react 18 with strict mode would kill useStateWithGetter function ( relevance was broken )\n\n## 4.16.1 (June 3rd, 2022)\n\n### Fixed\n\n- issue where changing schema options would not reset value\n\n## 4.16.0 (June 2nd, 2022)\n\n### Added\n\n- ability get formApi formState and scope in validate function\n\n## 4.15.0 (June 2nd, 2022)\n\n### Added\n\n- ability to pass a function as validateWhen\n\n```js\nvalidateWhen={ scope => `${scope.fieldName}`}\n```\n\n## 4.14.0 (May 26th, 2022)\n\n### Added\n\n- `validateModified` prop to form so lib will only perform validation on modified fields\n\n## 4.13.1 (May 25th, 2022)\n\n### Fixed\n\n- issue where decimal was getting added when formatter explicitly was told not to add\n\n```js\nutils.createIntlNumberFormatter(\'en-US\', {\n style: \'decimal\',\n signDisplay: \'never\',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n});\n```\n\n## 4.12.1 (May 12th, 2022)\n\n### Fixed\n\n- issue with missing types Debug and Schema Fields\n\n## 4.12.0 (May 12th, 2022)\n\n### Fixed\n\n- issue with isChild\n\n### Added\n\n- hidden field back to default exported components\n\n## 4.11.4 (May 4th, 2022)\n\n### Fixed\n\n- issue where Relevance inside of Relevance might prevent cleanup on form state\n\n## 4.11.3 (May 2nd, 2022)\n\n### Fixed\n\n- issue where nested array fields removal would break\n\n## 4.11.2 (April 29th, 2022)\n\n### Fixed\n\n- issue where custom error messages did not work in allOf\n- issue where required:[] on allOf was not working\n\n## 4.11.1 (April 28th, 2022)\n\n### Fixed\n\n-issue where zero ( 0 ) would not work for minimum and maximum due to bad falsey check lol classic\n\n## 4.11.0 (April 28th, 2022)\n\n### Added\n\n- onNativeChange handler to useField\n\n## 4.10.0 (April 27th, 2022)\n\n### Added\n\n- onValid and onInvalid to useForm\n\n## 4.9.4 (April 19th, 2022)\n\n### Fixed\n\n- issue where we would not pass all options to intl formatter\n\n## 4.9.3 (April 13th, 2022)\n\n### Fixed\n\n- issue where after a gather data the field-value event would not get triggered so evaluate would never get called\n\n## 4.9.2 (April 13th, 2022)\n\n### Fixed\n\n- issue where FormComponents was not rendering from components option\n\n## 4.9.1 (April 12th, 2022)\n\n### Fixed\n\n- issue where modified would NOT be correct when allowEmptyString was passed\n\n## 4.9.0 (April 12th, 2022)\n\n### Added\n\n- `formState.modified`\n- `fieldState.modified`\n\n## 4.8.1 (April 4th, 2022)\n\n### Fixed\n\n- Issue where errors would get kept when going to previous multistep step\n\n## 4.8.0 (March 31st, 2022)\n\n### Added\n\n- useConditional hook and ability to pass `evaluate` and `evaluateWhen`\n\n## 4.7.0 (March 29th, 2022)\n\n### Added\n\n- ability to pass gatherOnMount to a field\n\n## 4.6.1 (March 22nd, 2022)\n\n### Fixed\n\n- misnamed `gatherData` prop\n\n## 4.6.0 (March 22nd, 2022)\n\n### Added\n\n- `gatherData` prop to allow user to get asnyc information for a field\n\n## 4.5.12 (March 22nd, 2022)\n\n### Fixed\n\n- Missing types for default exported fields\n- Missing type for `required`\n\n## 4.5.11 (March 20th, 2022)\n\n### Fixed\n\n- issue where allowEmptyString and allowEmptyStrings where broken\n\n## 4.5.10 (March 18th, 2022)\n\n### Fixed\n\n- issue where `step` was missing from multistep type\n\n## 4.5.9 (March 18th, 2022)\n\n### Fixed\n\n- issue with propertyOrder in nested schemas\n\n## 4.5.8 (March 18th, 2022)\n\n### Fixed\n\n- issue with more than double nested schemas\n- issue with Multistep.Step types\n\n## 4.5.7 (March 9th, 2022)\n\n### Fixed\n\n- issue with changing options on schema fields ( undefined would clobber defined values in option merge )\n\n## 4.5.6 (March 8th, 2022)\n\n### Fixed\n\n- issue where changing validation params would not rebuild validation function\n\n## 4.5.5 (March 8th, 2022)\n\n### Fixed\n\n- issue where multistep steps would not deregister\n\n## 4.5.4 (Feb 28th, 2022)\n\n### Fixed\n\n- issue where multistep steps would not clean up after themselves\n\n## 4.5.3 (Feb 22th, 2022)\n\n### Fixed\n\n- issue with touchAllFields not touching fields within an array\n\n## 4.5.2 (Feb 18th, 2022)\n\n### Fixed\n\n- Another Issue with debugger in react native that caused crash\n\n## 4.5.1 (Feb 16th, 2022)\n\n### Fixed\n\n- Issue with debugger in react native\n\n## 4.5.0 (Feb 16th, 2022)\n\n### Added\n\n- onValueModified prop to useForm\n\n## 4.4.0 (Feb 15th, 2022)\n\n### Added\n\n- ability to pass reset options to reset field\n\n## 4.3.0 (Feb 15th, 2022)\n\n### Added\n\n- onValueChange prop to useForm\n\n## 4.2.0 (Feb 10th, 2022)\n\n### Added\n\n- Ability to add n items to array field by passing add(3) a number to add\n\n## 4.1.2 (Feb 10th, 2022)\n\n### Fixed\n\n- Missing form level option for keepState and keepStateIfRelevant\n\n## 4.1.1 (Feb 9th, 2022)\n\n### Fixed\n\n- Stupid issue with safari throwing a type error when trying to check for selectionStart on event.target\n\n## 4.1.0 (Feb 8th, 2022)\n\n### Added\n\n- Ability to use state across multiple forms\n\n## 4.0.35 (Feb 8th, 2022)\n\n### Fixed\n\n- missing types for multistep and formApi\n\n## 4.0.34 (Feb 4th, 2022)\n\n### Fixed\n\n- issue with INTL formatter when used with `EUR` and `en-DE`\n\n## 4.0.33 (Feb 3rd, 2022)\n\n### Fixed\n\n- issue with formatter function not allowing full value\n\n## 4.0.32 (January 26th, 2022)\n\n### Fixed\n\n- issue with FormField not allowing conditional fields\n\n## 4.0.31 (January 25th, 2022)\n\n### Fixes https://github.com/teslamotors/informed/issues/381\n\n- autoFocus on Input throws error\n\n## 4.0.30 (January 24th, 2022)\n\n### Added\n\n- propertyOrder back to schema\n\n## 4.0.29 (January 20th, 2022)\n\n### Added\n\n- asyncValidate to formApi\n\n## 4.0.28 (January 18th, 2022)\n\n### Fixed\n\n- issue with cursor offsets when suffix is added\n\n## 4.0.27 (January 14th, 2022)\n\n### Fixed\n\n- issue with negative cursor offsets\n\n### Fixed\n\n- issue with off by one cursor locations on formatter\n\n## 4.0.25 (January 14th, 2022)\n\n### Fixed\n\n- createIntlNumberFormatter not working with negative numbers\n\n## 4.0.24 (January 7th, 2022)\n\n### Added\n\n- clearValue() function to form and field apis\n\n### Fixed\n\n- Issue where validateOnMount would NOT trigger validation when a field was re-rendered\n\n## 4.0.23 (January 5th, 2022)\n\n### Fixed\n\n- issue with array field items being memoized\n\n## 4.0.22 (January 5th, 2022)\n\n### Fixed\n\n- issue with createIntlNumber mask adding random "[]" sometimes\n\n## 4.0.21 (January 5th, 2022)\n\n### Fixed\n\n- issue where returning "" from validation function would not show error state\n\n## 4.0.20 (January 4th, 2022)\n\n### Fixed\n\n- issue where removing item from array field would not make the form dirty\n\n## 4.0.19 (December 31st, 2021)\n\n### Exposed\n\n- useRelevance hook and added type for it in types\n\n## 4.0.18 (December 23rd, 2021)\n\n### Fixed\n\n- issue where values would get cleared on un-mount\n\n## 4.0.17 (December 17th, 2021)\n\n### Fixed\n\n- issue where I forgot to deregister fields when they became irrelevant\n\n## 4.0.16 (December 17th, 2021)\n\n### Fixed\n\n- issue where I forgot to allow relevanceDeps to be passed to multistep step\n\n## 4.0.15 (December 15th, 2021)\n\n### Moved\n\n- The repo to tesla or go needed to re publish to get updated README to npm\n\n## 4.0.14 (December 15th, 2021)\n\n### Fixed\n\n- forgot to add getCurrentStep to multistepApi\n- forgot to add nextStep and previousStep to multistepState\n\n## 4.0.13 (December 15th, 2021)\n\n### Fixed\n\n- issue where set touched did not default meta when field is not there\n\n## 4.0.12 (December 15th, 2021)\n\n### Fixed\n\n- issue where `FormField` could not take field props\n\n## 4.0.11 (December 15th, 2021)\n\n### Fixed\n\n- missing type for Relevant\n\n## 4.0.10 (December 15th, 2021)\n\n### Fixed\n\n- issue where FormProvider was not exported\n\n## 4.0.9 (December 13th, 2021)\n\n### Fixed\n\n- issue where passing showErrorIfTouched={false} would not work\n\n## 4.0.8 (December 10th, 2021)\n\n### Removed\n\n- Empty dependencies object from package.json\n\n## 4.0.7 (December 10th, 2021)\n\n### Fixed\n\n- Issue with relevance subscription when no relevance function\n\n## 4.0.6 (December 9th, 2021)\n\n### Fixed\n\n- Missing functions setValues and setTheseValues\n\n## 4.0.5 (December 9th, 2021)\n\n### Fixed\n\n- Missing types for validate and validateField on FormApi\n\n## 4.0.4 (December 9th, 2021)\n\n### Fixed\n\n- Issue where we forgot to expose form validate\n- Missing utils types\n\n## Added\n\n- useScope and useScoper to exports\n\n## 4.0.3 (December 7th, 2021)\n\n### Fixed\n\n- Issue with forms valid and invalid when relevance changes\n\n## 4.0.2 (December 7th, 2021)\n\n### Fixed\n\n- Issue with schema path util `inverter[12].air_filter_ok` would not work\n\n## 4.0.1 (December 7th, 2021)\n\n### Fixed\n\n- Issue with initializing when becoming relevant\n\n## 4.0 !!!!\n\n### Breaking changes\n\n#### onSubmit signature\n\nOld\n\n```\nconst onSubmit = values => console.log( values );\n```\n\nNew\n\n```\nconst onSubmit = formState => console.log( formState.values );\n```\n\n#### Text --> Input\n\nOld\n\n```jsx\n\n```\n\nNew\n\n```jsx\n\n```\n\n#### apiRef --> formApiRef\n\nOld\n\n```jsx\n
\n// OR\n\n```\n\nNew\n\n```jsx\n\n```\n\n#### informed:props ( schema )\n\n```\ninformed:props is now ui:props when using schema based forms\n```\n\n#### `asField` has been removed\n\nInstead of doing this\n\n```js\nconst CustomField = asField({ fieldState, fieldApi }) => {}\n```\n\nDo this\n\n```js\nconst CustomField = props => {\n const { fieldState, fieldApi } = useField(props);\n};\n```\n\n#### Relevance\n\nThe when function for relevance now has this signature\n\n```\nwhen={({formState, formApi, scope}) => {...} }\n```\n\n#### yupSchema\n\n```\nvalidationSchema ---> is now yupSchema\n```\n\n#### Array Fields\n\n##### Renamed `field` to `name`\n\n```jsx\n\n {({ remove, field }) => (\n <>\n \n \n \n )}\n\n```\n\nIs Now\n\n```jsx\n\n {({ remove, name }) => (\n <>\n \n \n \n )}\n\n```\n\n##### No more array field path prefixing\n\nOld:\n\n```jsx\n\n {({ remove, field }) => (\n <>\n \n \n \n \n )}\n\n```\n\nNew:\n\n```jsx\n\n {({ remove }) => (\n <>\n \n \n \n \n )}\n\n```\n\n##### No more values in array field render prop\n\nOld:\n\n```jsx\n// Some component you need to use state of array field item\nconst FieldState = ({ values }) => {\n return (\n
\n      {JSON.stringify(values, null, 2)}\n    
\n );\n};\n\n\n {({ remove, values }) => (\n <>\n \n \n \n \n \n )}\n;\n```\n\nNew:\n\n```jsx\n// Some component you need to use state of array field item\nconst FieldState = () => {\n const { values } = useArrayFieldItemState();\n return (\n
\n      {JSON.stringify(values, null, 2)}\n    
\n );\n};\n\n\n {({ remove }) => (\n <>\n \n \n \n \n \n )}\n;\n```\n\n#### Debugging with ``\n\nOld:\n\n```jsx\n\n```\n\nNew:\n\n```jsx\n\n```\n\n#### Custom Inputs\n\nMinor changes to custom inputs\n\nNew:\n\n```jsx\nconst CustomInput = props => {\n const { fieldState, fieldApi, render, ref, userProps } = useField(props);\n\n // The field state\n const { value, error, showError } = fieldState;\n\n // The field control\n const { setValue, setTouched } = fieldApi;\n\n // Everything else\n const { label, id, ...rest } = userProps;\n\n return render(\n <>\n {label ? : null}\n {\n setValue(e.target.value, e);\n }}\n onBlur={e => {\n setTouched(true, e);\n }}\n style={showError ? { border: \'solid 1px red\' } : null}\n />\n {showError ? {error} : null}\n \n );\n};\n```\n\n#### Validation\n\nValidation is now controlled via validateOn="validationString"\n\nBy default fields will only validate on blur. To get\nmore granular validation, simply pass in `validateOn` props.\n\nSee table below for mapping:\n\n
\n\n| validateOn | derived | change | blur | submit | default |\n| ------------- | ------------- | ------------ | ------------ | ------------ | ------- |\n| change | change-change | sync + async | sync + async | sync + async | |\n| blur | blur-blur | x | sync + async | sync + async | x |\n| change-blur | change-blur | sync | sync + async | sync + async | |\n| change-submit | change-submit | sync | sync | sync + async | |\n| blur-submit | submit-submit | x | sync | sync + async | |\n| submit | submit-submit | x | x | sync + async | |\n\n
\n\nValidation is controlled via the `validateOn` prop, but in order to control when it shows,\nuse the `showErrorIfError` and `showErrorIfDirty` props. **This is because sometimes you may want the form to be invalid but not show the error to the user yet ( default is `showErrorIfTouched` )**\n\n| prop | description | default |\n| ------------------ | ------------------------------------------------------------------------------------------------------------ | ------- |\n| showErrorIfError | will set `showError` for that field to true whenever there is an error (typically used with validateOnMount) | |\n| showErrorIfTouched | will set `showError` for that field to true whenever there is an error and the field is touched | x |\n| showErrorIfDirty | will set `showError` for that field to true whenever there is an error and the field is dirty | |\n\n
\n\nFinally we have a use case for validating right away ( on mount )\n\n| prop | description | default |\n| --------------- | ------------------------------- | ------- |\n| validateOnMount | will trigger validation onMount | false |\n\n
\n
\n\n---\n\n
\n\n## 3.34.0 (June 22, 2021)\n\n### Added\n\n- ability to control when async validation occurs with props\n\n## 3.33.0 (May 21, 2021)\n\n### Added\n\n- createIntlNumberFormatter\n\n## 3.32.3 (May 21, 2021)\n\n### Fixed\n\n- Issue with useFieldState, now returns empty object by default\n\n## 3.32.2 (May 21, 2021)\n\n### Fixed\n\n- Issue with mounting useFieldStates\n\n## 3.32.1 (May 21, 2021)\n\n### Fixed\n\n- Issue with layoutEffect in SSR\n\n## 3.32.0 (May 19, 2021)\n\n### Added\n\n- Ability to walk down a multistep with step selection.\n\n## 3.31.0 (April 26, 2021)\n\n### Added\n\n- formatter functions `formatter = [()=>{}, ()=>{}]`\n\n## 3.30.3 (April 2, 2021)\n\n### Added\n\n- memoized render back because I never should have removed it\n\n## 3.30.2 (March 15, 2021)\n\n### Refactored\n\n- To no longer use event emitter.\n\n## 3.30.1 (March 5, 2021)\n\n### Fixed\n\n- Issue where keep state in scope was not working.\n\n## 3.30.0 (March 2, 2021)\n\n### Added\n\n- Pristine and Dirty to formFieldState\n\n## 3.29.4 (February 24, 2021)\n\n### Updated\n\n- Peer deps to support react v 17\n\n## 3.29.3 (February 5, 2021)\n\n### Fixed\n\n- Issue where ObjectMap `has` would reference wrong get funciton fixes #327\n\n## 3.29.2 (February 4, 2021)\n\n### Fixed\n\n- Issue where carrot pos would be in the wrong place when formatting\n\n### Updated\n\n- `useField` hook to use the `useCarrotPosition` hook ( removed duplicate code )\n\n## 3.29.1 (February 4, 2021)\n\n### Added\n\n- Ability to call `setValue` function for custom formattedObject Inputs\n\n## 3.29.0 (February 2, 2021)\n\n### Added\n\n- Ability to pass `initialize` function for custom initialization of the initial value\n\n## 3.28.0 (February 2, 2021)\n\n### Exposed\n\n- Utils functions that can be used by end users\n\n## 3.27.0 (December 18, 2020)\n\n### Fixed\n\n- bug with update function in form controller where it would pull instead of delete on swap\n\n## 3.26.0 (December 17, 2020)\n\n### Added\n\n- `swap` to array fields\n\n### Rafactored\n\n- Internal state management\n\n## 3.25.0 (December 8, 2020)\n\n### Added\n\n- `onReset` to form props\n\n## 3.24.4 (December 5, 2020)\n\n### Updated\n\n- README and needed to get it to npm ... again again\n\n## 3.24.3 (December 5, 2020)\n\n### Updated\n\n- README and needed to get it to npm ... again\n\n## 3.24.2 (November 24, 2020)\n\n### Updated\n\n- README and needed to get it to npm\n\n## 3.24.1 (November 23, 2020)\n\n### Fixed\n\n- Type issue ( missing allow empty string from props def )\n\n## 3.24.0 (November 19, 2020)\n\n### Fixed\n\n- Issue where Id was not getting passed to default select field\n\n## 3.23.0 (November 18, 2020)\n\n### Removed\n\n- LODASH!!!!! SEE YA LATER NEVER\n\n## 3.22.0 (November 17, 2020)\n\n### Added\n\n- Ability to pass relevant to array fields!!!\n\n## 3.21.2 (November 14, 2020)\n\n### Fixed\n\n- Bug with field level relevant\n\n### Updated\n\n- Form to always evaluate relevance, and not force the user to pass notify.\n\n## 3.21.1 (November 12, 2020)\n\n### Fixed\n\n- Isssue where state would not update after submit\n\n## 3.21.0 (November 12, 2020)\n\n### Added\n\n- Ability to add async validation functions to inputs\n\n## 3.20.0 (November 11, 2020)\n\n### Added\n\n- Ability to not pass keep state to multistep fields, and also added docs for conditional relevant nested array fields\n\n## 3.19.0 (November 10, 2020)\n\n### Added\n\n- Ability to hide or show fields based on relevant, and notify relevant fields\n\n## 3.18.3 (November 10, 2020)\n\n### Fixed\n\n- bug with resetting array field items\n\n## 3.18.2 (November 9, 2020)\n\n### Fixed\n\n- bug with duplicate fields\n\n## 3.18.1 (November 9, 2020)\n\n### Fixed\n\n- bug with keep state registering phantom fields\n\n## 3.18.0 (November 5, 2020)\n\n### Added\n\n- ability to create custom schema fields\n\n## 3.17.1 (November 3, 2020)\n\n### Fixed\n\n- useField was not adding id to label by default\n\n## 3.17.0 (November 3, 2020)\n\n### Added\n\n- Required attribute to input and automatic type generation for useField hook\n\n## 3.16.1 (November 2, 2020)\n\n### Fixed\n\n- Issue where informed props were not passed down to array fields in schema\n\n## 3.16.0 (November 1, 2020)\n\n### Added\n\n- Ability to have conditional schemas!!!!\n\n## 3.15.0 (October 28, 2020)\n\n### Added\n\n- Ability to add array fields in schema!!!!\n\n## 3.14.0 (October 27, 2020)\n\n### Added\n\n- Formatter and Parser !!!!!\n\n## 3.13.2 (October 27, 2020)\n\n### Fixed\n\n- Issue with strict mode double registering\n\n## 3.13.1 (October 23, 2020)\n\n### Fixed\n\n- Bug where inforemd would crash if schema was missing field that was in JSX ( returns null )\n\n## 3.13.0 (October 23, 2020)\n\n### Added\n\n- Ability to render schema fields in specific paces within JSX!!\n\n## 3.12.0 (October 22, 2020)\n\n### Added\n\n- Added AJV Schema shit!!!\n\n## 3.11.0 (October 21, 2020)\n\n### Added\n\n- Schema shit\n\n## 3.10.1 (October 18, 2020)\n\n### Fixed\n\n- Array fields because I stupidly broke them\n\n#### Added\n\n- Tests for multistep fields\n- Better multistep form syntax\n- Better multistep docs\n\n## 3.10.0 (September 29, 2020)\n\n### Updated\n\n- internals to modify state direct to improve performance!\n\n## 3.9.0 (June 15, 2020)\n\n### Updated\n\n- useArray field to expose a reset that resets to initial values\n\n## 3.8.1 (May 11, 2020)\n\n### Fixed\n\n- Issue with back and next types for multistep fields\n\n## 3.8.0 (May 4, 2020)\n\n### Added\n\n- Array field Api control for ArrayFieldItems\n\n## 3.7.0 (May 4, 2020)\n\n### Refactored\n\n- To use field ids instead of names\n\n### Added\n\n- `` component\n\n## 3.6.1 (March 2, 2020)\n\n### Updated\n\n- Type file to include preventEnter on form props\n\n## 3.6.0 (March 1, 2020)\n\n### Added\n\n- Ability to pass formController to useField hook\n\n## 3.5.2 (February 28, 2020)\n\n### Fixed\n\n- [Issue](https://github.com/joepuzzo/informed/issues/275) where new version of react would throw warnings due to bad code\n\n## 3.5.1 (February 27, 2020)\n\n### Fixed\n\n- [Issue](https://github.com/joepuzzo/informed/issues/272) where dynamic nested array fields with keep state kept too much state :)\n\n## 3.5.0 (February 25, 2020)\n\n### Added\n\n- New multistep abilities via setCurrent in `formApi` and `Current` in `formState`. See compex multistep form in docs\n\n## 3.4.0 (February 22, 2020)\n\n### Added\n\n- Ability to spread `informed` object on inputs via the `useField` hook\n\n## 3.3.5 (February 22, 2020)\n\n### Updated\n\n- Readme to show useForm example\n\n## 3.3.4 (February 20, 2020)\n\n### Added\n\n- FormState component to assist when debugging!\n\n## 3.3.3 (February 18, 2020)\n\n### Added\n\n- Types for multisetp forms\n\n## 3.3.2 (February 16, 2020)\n\n### Added\n\n- Ability to use cursor position in mask function\n\n## 3.3.1 (February 16, 2020)\n\n### Updated\n\n- Intro examples to inculde on submit example\n\n## 3.3.0 (February 10, 2020)\n\n### Added\n\n- Field level Yup support\n\n## 3.2.1 (February 9, 2020)\n\n### Fixed\n\n- Typo in yup docs and readme\n\n## 3.2.0 (February 9, 2020)\n\n### Added\n\n- Yup support\n\n## 3.1.2 (February 9, 2020)\n\n### Updated\n\n- docs and readme to link to dicord channel\n\n## 3.1.1 (February 8, 2020)\n\n### Added\n\n- apiRef so you can just pass a ref to the form\n\n## 3.1.0 (February 5, 2020)\n\n### Added\n\n- Step functionality to support multistep forms\n\n## 3.0.2 (January 24, 2020)\n\n### Fixed\n\n- Issue https://github.com/joepuzzo/informed/issues/267\n\n## 3.0.1 (January 24, 2020)\n\n### Fixed\n\n- README ( I wish there was a way on npm to update readme without publishing version )\n\n## 3.0.0 (January 24, 2020)\n\n### Fixed\n\n- Issue with array field validation https://github.com/joepuzzo/informed/issues/259\n- Issue where informed would throw errors when fields were hidden but referenced\n\n### Added\n\n- Ability to ( in the near future ) add validations to scopes ( Enabled because of code refacotor... will add soon :)\n\n### Changed\n\n- The internals to no longer keep track of giant state object but instead generate it on demand\n\n### Removed\n\n- A bunch of useless code :)\n\n#### Cleaned up\n\n- Large portion of the code .. Mostly the formController!\n\n## 2.11.17 (January 21, 2020)\n\n## Update\n\n- useField to trigger validation when validation related props change\n\n## 2.11.16 (November 18, 2019)\n\n## Fixed\n\n- issue with array field where validation would fail\n\n## 2.11.15 (November 6, 2019)\n\n## Fixed\n\n- issue with array field where removing multiple fields did not remove the data from state\n\n## 2.11.14 (November 5, 2019)\n\n## Removed\n\n- removable prop to inputs because it was a bad idea... now it supports removal nativley\n\n## 2.11.13 (November 4, 2019)\n\n## Added\n\n- removable prop to inputs ( adds support for pairing keep state and array fields such that remove button actually removes field )\n\n## 2.11.12 (November 1, 2019)\n\n## Fixed\n\n- issue with keep state on array fields\n\n## 2.11.11 (November 1, 2019)\n\n## Added\n\n- comp name to useField hook\n\n## 2.11.10 (October 21, 2019)\n\n## Added\n\n- missing setFormError prop to FormApi interface\n\n## 2.11.9 (September 10, 2019)\n\n## Added\n\n- keepState to types\n\n## 2.11.8 (July 16, 2019)\n\n## Adds\n\n- allowEmptyStrings form level prop to types\n\n## 2.11.7 (July 8, 2019)\n\n## Fixes\n\n- issue 227 where allowEmptyStrings form level prop did not work\n\n## 2.11.6 (July 2, 2019)\n\n## Fixes\n\n- issue 219 where array fields would not work with scope\n\n## 2.11.5 (July 2, 2019)\n\n## Fixes\n\n- issue 225 where validation will occur on mount when there are initial values\n\n## 2.11.4 (July 1, 2019)\n\n## Fixes\n\n- issue 215 where selects dont work in Edge becase .. you know.. Microsoft\n\n## 2.11.3 (July 1, 2019)\n\n## Fixes\n\n- warning with useLayoutEffect when using SSR\n\n## 2.11.2 (June 27, 2019)\n\n## Updated\n\n- README file to include minzipped badge\n\n## 2.11.1 (June 18, 2019)\n\n## Fixed\n\n- Issue where initial values changing on multiselects caused looping .. oops\n\n## 2.11.0 (June 14, 2019)\n\n## Updated\n\n- useForm to return user props and a render method\n- Form provider to no longer render a `` IT NEVER SHOULD HAVE.\n\n## 2.10.2 (June 13, 2019)\n\n## Fixed\n\n- Issue where initial values did not change when form was reset\n\n## 2.10.1 (June 11, 2019)\n\n## Fixed\n\n- Issue where array level validation would not trigger for complex nested fields within array field\n\n## Added\n\n- length as a second parameter to arrayFields validate function\n\n## 2.10.0 (June 7, 2019)\n\n## Added\n\n- ability to pass validation function to an array field\n- arrayFields are now treaded as "shadow" fields\n\n## 2.9.0 (June 6, 2019)\n\n## Added\n\n- useArrayField hook\n\n## 2.8.2 (June 5, 2019)\n\n## Added\n\n- ability to change out form options such as validateFields\n\n## 2.8.1 (June 5, 2019)\n\n## Fixed\n\n- issue with addWithInitialValue when using add and then addWithInitialValue\n\n## 2.8.0 (June 5, 2019)\n\n## Added\n\n- addWithInitialValue to the `ArrayField`\n\n## 2.7.8 (May 31, 2019)\n\n## Fixed\n\n- issue where initial values were not being formatted\n\n## 2.7.7 (May 30, 2019)\n\n## Fixed\n\n- issue where initial values were not being masked\n\n## 2.7.6 (May 29, 2019)\n\n## Updated\n\n- Types file to support validate on formApi\n\n## 2.7.5 (May 29, 2019)\n\n## Updated\n\n- Types file to support any type on form errors\n\n## 2.7.4 (May 23, 2019)\n\n### Fixed\n\n- documentation for creating custom inputs\n\n### Added\n\n- the ability to pass your own ref to inputs\n\n## 2.7.3 (May 22, 2019)\n\n### Fixed\n\n- issue with validation triggering when keep state and validate on blur\n\n## 2.7.2 (May 21, 2019)\n\n### Added\n\n- made `maskWithCursorOffset` optional in types\n\n## 2.7.1 (May 21, 2019)\n\n### Added\n\n- `maskWithCursorOffset` to the type defs\n\n## 2.7.0 (May 21, 2019)\n\n### Added\n\n- `maskWithCursorOffset` prop to inputs\n\n## 2.6.15 (May 20, 2019)\n\n### Added\n\n- maintainCursor to types\n\n## 2.6.14 (May 16, 2019)\n\n### Added\n\n- render and userProps to field context types\n\n## 2.6.13 (May 16, 2019)\n\n### Added\n\n- maskedValue to types\n\n## 2.6.12 (May 14, 2019)\n\n### Added\n\n- getters to useFields field api\n\n## 2.6.11 (May 11, 2019)\n\n### Added\n\n- useField hook to the docs\n\n### Updated\n\n- the interface for useField hook\n\n## 2.6.10 (May 10, 2019)\n\n### Fixed\n\n- issue where initialization code in useform was in the effect and not in constructor\n\n## 2.6.9 (May 10, 2019)\n\n### Fixed\n\n- attempting to fix issue that I think is caused by useEffect in useForm hook\n\n## 2.6.8 (May 10, 2019)\n\n### Fixed\n\n- issues cause by using `useMemo` instead of `useState` for initial render stuff\n\n## 2.6.7 (May 9, 2019)\n\n### Added\n\n- exists function to the field api types\n\n## 2.6.6 (May 9, 2019)\n\n### Added\n\n- exists function to the field api so you can check to see if that field exists\n\n## 2.6.5 (May 9, 2019)\n\n### Fixed\n\n- issue where inital render of useFieldApi would fail when field was not registered yet\n\n## 2.6.4 (May 9, 2019)\n\n### Updated\n\n- useForm hook so that the event handlers can change\n\n## 2.6.3 (May 7, 2019)\n\n### Removed\n\n- debug as a dependency and added my own :)\n\n## 2.6.2 (May 3, 2019)\n\n### Fixed\n\n- issue with default register context missin getField function\n\n## 2.6.1 (May 3, 2019)\n\n### Fixed\n\n- issue with `useFieldApi` hook and `withFieldApi` HOC where reset and validate were not there\n\n### Added\n\n- a few more tests to increase test coverage!!!! wooo\n\n## 2.6.0 (May 2, 2019)\n\n### Added\n\n- `useForm` hook!!! and `FormProvider` component!!!\n\n## 2.5.0 (April 30, 2019)\n\n### Updated\n\n- useField hook to useEffect instead of useLayoutEffect\n\n## 2.4.0 (April 30, 2019)\n\n### Added\n\n- preventEnter prop to the form so users can prevent enter key form submission\n\n## 2.3.2 (April 22, 2019)\n\n### Updated\n\n- Issue with dynamic arrays and initial values\n\n## 2.3.1 (April 12, 2019)\n\n### Updated\n\n- Babel build\n\n## 2.3.0 (April 3, 2019)\n\n### Added\n\n- `allowEmtyStrings` prop to the form\n- `allowEmtyString` prop to inputs\n\n### Fixed\n\n- issue where setValues would not allow empty strings\n\n## 2.2.0 (March 29, 2019)\n\n### Added\n\n- `setFormError` function to the form api\n- `validate` function to the form api\n\n## 2.1.15 (March 28, 2019)\n\n### Fixed\n\n- Issue with setValues missing from the default context\n\n## 2.1.14 (March 27, 2019)\n\n### Fixed\n\n- Issue where reset would call validation\n\n## 2.1.13 (March 18, 2019)\n\n### Updated\n\n- Allowing for optional generic on FormValue\n\n## 2.1.12 (March 13, 2019)\n\n### Updated\n\n- ref to be any type in typings\n\n## 2.1.11 (March 12, 2019)\n\n### Fixed\n\n- issue in typings for ref field on FieldContext\n\n## 2.1.10 (March 12, 2019)\n\n### Fixed\n\n- issue when using a field NOT in the context of a form\n\n## 2.1.9 (March 8, 2019)\n\n### Fixed\n\n- another issue where initial values did not work when keep state was passed\n\n## 2.1.8 (March 8, 2019)\n\n### Fixed\n\n- issue where initial values did not work when keep state was passed\n\n## 2.1.7 (March 3, 2019)\n\n### Fixed\n\n- issue where initial values did not work for `ArrayFields`\n\n## 2.1.6 (Feb 21, 2019)\n\n### Updated\n\n- typing files for type script users\n\n## 2.1.5 (Feb 19, 2019)\n\n### Fixed\n\n- Issue with text area input not setting typed value\n\n## 2.1.4 (Feb 19, 2019)\n\n### Added\n\n- `maskOnBlur` prop to inputs\n\n## 2.1.3 (Feb 14, 2019)\n\n### Added\n\n- `fieldExists` api function to check if field exists\n\n## 2.1.2 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where form that is submitted through enter key would try to prevent default\n\n## 2.1.1 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where form values would not get passed to validation function when touched\n\n## 2.1.0 (Feb 14, 2019)\n\n### Updated\n\n- Format and parse to set maskedValue instead of value\n\n## 2.0.5 (Feb 14, 2019)\n\n### Fixed\n\n- Issue where you could NOT set 0 null or false as initial values because they are falsey\n\n## 2.0.4 (Feb 13, 2019)\n\n### Added\n\n- validateFields function to the form!!!\n\n## 2.0.3 (Feb 13, 2019)\n\n### Fixed\n\n- Issue where reset would not work for scoped fields\n\n### Added\n\n- Set Values to the form api!!!\n\n## 2.0.2 (Feb 13, 2019)\n\n### Fixed\n\n- Issue where ArrayField was prefixing all fields with \'field\'\n- Issue where when input fields changed input did not rerender.\n\n## 2.0.1 (Feb 10, 2019)\n\n### Fixed\n\n- Issue where render and component props were getting passed to the dom form\n\n## 2.0.0 (Feb 7, 2019)\n\n### Added\n\n- useFieldApi\n- useFieldState\n- useFormApi\n- useFormState\n- useField\n- format\n- parse\n- maintianCursor ( fixes issue where cursor jumps to end on mask )\n- ArrayField ( Check out the docs! this is sick! )\n- Form Level validation ( function that can invalidate the form as a whole )\n- debug prop that allows you to visually view the rendering!\n\n### Changed\n\n- the field `"siblings.1"` now resolves to `values.siblings[1]`, it used to resolve to `values.siblings.1`\n- the field `"siblings[\'2\']"` now resolves to `values.siblings[2]`, it used to resolve to `values.siblings.2`\n- withFormApi will no longer trigger a rerender if the fomrs state changes. This is a great optimization for those who want to modify but dont care about the form state!\n- the `validate` prop now expects the validation function to return `undefined` if there is no error. Any other returned value (including falsey `null`, `0`, etc will be treated as an error for the field.\n\n### Removed\n\n- The Field Component\n- `fieldExists` not needed\n- `setState` will maybe add later but its complex and out of scope ATM\n- `setValues` will maybe add later but its complex and out of scope ATM ( as of V 2.0.3 its back! )\n- `preSubmit` was never needed.. developers can do this themselves\n- Async Validation. Async validation led to many issues that overcomplicated `informed`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\n\n## 1.10.12 ( December 4, 2018 )\n\n### Updated\n\n- typescript definition file\n\n## 1.10.11 & 1.10.10 I ran version patch twice lol ( December 4, 2018 )\n\n### Updated\n\n- Select forward ref\n\n## 1.10.9 ( November 16, 2018 )\n\n### Updated\n\n- files in package json to include typeigs\n\n## 1.10.8 ( November 8, 2018 )\n\n### Added\n\n- type file for typescript\n\n## 1.10.7 ( October 11, 2018 )\n\n### Updated\n\n- Name of withFormSate\n\n## 1.10.6 ( October 2, 2018 )\n\n### Fixed\n\n- Skipped test for select!!!\n\n### Updated\n\n- Select to use new ref interface\n\n## 1.10.5 ( September 14, 2018 )\n\n### Added\n\n- License\n\n## 1.10.4 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime was the dep when it should have ben @babel/runtime-corejs2\n\n## 1.10.3 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime for real this time\n\n## 1.10.2 ( August 13, 2018 )\n\n### Fixed\n\n- Issue with @babel/runtime\n\n## 1.10.1 ( August 13, 2018 )\n\n### Removed\n\n- mistakenly added dev deps that were deps... oops\n\n## 1.10.0 ( August 13, 2018 )\n\n### Added\n\n- submits to the form state\n\n## 1.9.0 ( August 8, 2018 )\n\n### Rebuilt\n\n- Added prettier so all the files have been changed... so i rebuilt to have source maps match code\n\n## 1.8.1 ( August 1, 2018 )\n\n### Rebuilt\n\n- Attempting to simply rebuild lib due to possible build issue\n\n## 1.8.0 ( August 1, 2018 )\n\n### Updated\n\n- initialValue to get exposed as prop to custom fields\n\n## 1.7.5 ( July 31, 2018 )\n\n### Added\n\n- Source maps\n\n## 1.7.4 ( July 26, 2018 )\n\n### Fixed\n\n- Issue where Basic radio group was not getting exported\n\n## 1.7.3 ( July 23, 2018 )\n\n### Fixed\n\n- issue where bind to field did not pass down the field prop.\n\n## 1.7.2 ( July 20, 2018 )\n\n### Fixed\n\n- Issue where element wont get removed from array when deregistering field... this is used when dynamically removing value\n\n## 1.7.1 ( July 20, 2018 )\n\n### Added\n\n- Field prop is now exposed to field elements and default inputs pass field as name to html inputs\n\n## 1.7.0 ( July 18, 2018 )\n\n### Added\n\n- fieldExists method to the formApi\n\n## 1.6.0 ( July 16, 2018 )\n\n### Added\n\n- onValueChange prop to inputs so you can tie into when values change!!\n\n## 1.5.2 ( July 13, 2018 )\n\n### Fixed\n\n- Issue where prop changes to fields would not get recognized\n\n## 1.5.1 ( July 13, 2018 )\n\n### Fixed\n\n- issue where i forgott to add @babel/runtime as dependency\n\n## 1.5.0 ( July 12, 2018 )\n\n### Added\n\n- asyncValidation prop to inputs\n- asyncValidateOnBlur prop to inputs\n\n## 1.4.0 ( July 5, 2018 )\n\n### Added\n\n- Basic input fields so users can more easily create custom inputs\n- Docs for creating custom inputs\n\n## 1.3.11 ( July 9, 2018 )\n\n### Fixed\n\n- issue where you could not nest scope\n\n## 1.3.10 ( July 5, 2018 )\n\n### Fixed\n\n- issue where you could not pass initialValue=false to checkbox\n\n## 1.3.9 ( July 5, 2018 )\n\n### Fixed\n\n- issue where mutable values were getting passed to onSubmit and getState\n\n## 1.3.8 ( July 2, 2018 )\n\n### Fixed\n\n- issue where path array was being build every get and set\n\n## 1.3.7 ( July 2, 2018 )\n\n### Fixed\n\n- issue where onChange was getting passed to internal form element\n\n## 1.3.6 ( June 28, 2018 )\n\n### Added\n\n- globalObject: \'this\' to the webpack dist config to support SSR\n\n## 1.3.5 ( June 28, 2018 )\n\n### Fixed\n\n- Issue with event emitter limit ( need to look into alternative solution )\n- Removed depricated sandbox sinon usage that was causing errors during tests\n\n## 1.3.3 ( June 28, 2018 )\n\n### Updated\n\n- Webpack dist configuration to keep class names\n\n## 1.3.2 ( June 28, 2018 )\n\n### Fixed\n\n- Issue were initialValue was getting passed all the way down to html input\n- Issue where form would not rerender when field was registered\n\n## 1.3.1 ( June 28, 2018 )\n\n### Fixed\n\n- Issue were validateOnMount was getting passed all the way down to html input\n\n## 1.3.0 ( June 28, 2018 )\n\n### Added\n\n- mask so you can mask values at field level. example `value => value + \'!!!\'`\n\n## 1.2.1 ( June 27, 2018 )\n\n### Added\n\n- hook so you can add a button with type=reset and it will reset the form\n\n## 1.2.0 ( June 27, 2018 )\n\n### Added\n\n- validateOnMount to input props\n\n## 1.1.2 ( June 25, 2018 )\n\n### Moved\n\n- React and React-Dom to dev dependencies\n\n## 1.1.1 ( June 18, 2018 )\n\n### Fixed\n\n- Bug where i did not do null check on event within on submit\n\n## 1.0.1 ( June 15, 2018 )\n\n### Added\n\n- Notify prop to inputs that allows you to notify other fields when your error state changes ( see docs )\n\n## 1.0.0 (June 12, 2018)\n\n### Added\n\n- Text\n- TextArea\n- Radio Group\n- Radio\n- Select\n- Select as Multiselect !!!\n- Checkbox\n- withRadioGroup\n- withFieldApi\n- withFieldState\n- withFormApi\n- withFormState\n- asField\n- Form\n- Field\n\n### Changed\n\n**\nNote: this was the first release but i wanted to include changes from\n`react-form` so here they are:\n**\n\n- `formApi` was split into two parts `formApi` ( contains just functions ) `formState` ( contains just form state )\n- Form level validation is gone. You do all validation via field validation.\n- `defaultValues` Form prop is now called `initialValues`\n- `onChange` Form prop only recieves the `formState`. It used to retrieve the form Api as well.\n- `preventDefault` Form prop is now `dontPreventDefault`\n- `getApi` Form prop just returns the formApi, not the state and the api.\n- `Form` component now renders the `form` element internally. So you dont have to "hook it up" anymore!!\n\n### Removed\n\n**\nNote: this was the first release but i wanted to include things that were removed from\n`react-form` so here they are:\n**\n\n- `NestedField` you can use `Scope` instead but all it does is scope internal fields to `scope="your-scope"`\n- validateOnSubmit was removed. Now the form always validates on submit by default and you can opt into sooner validation at field level.\n- `defaultValues` form prop is now called `initialValues`\n- `pure` Form prop. Its not needed anymore due to the use of `React.PureComponent` internally.\n- add, remove, and swap values. The developer can achive this on there own without the use of internal functionality.\n- Array Syntax. In order to keep things simple we now only support the string syntax for field names.\n- Async Validation. Async validation led to many issues that overcomplicated `react-form`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\n- Warning and Success have been removed for now to keep lib lean but we may add additional functions in the future.\n'; /***/ }, @@ -1420,7 +1420,7 @@ /*! exports provided: name, version, description, main, module, types, files, exports, scripts, jest, repository, author, keywords, license, devDependencies, peerDependencies, nyc, husky, lint-staged, dependencies, default */ /*! exports used: version */ /***/ function(module) { - module.exports = JSON.parse('{"a":"4.35.0"}'); + module.exports = JSON.parse('{"a":"4.37.0"}'); /***/ }, @@ -2117,7 +2117,6 @@ } // call mask if passed if (meta.mask) { - console.log('HERE', meta.mask(_val)); _val = meta.mask(_val); _maskedVal = _val; } // // Only parse if parser was passed @@ -2640,29 +2639,52 @@ { key: 'remove', value: function remove(name) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; debug('Remove', name); if (!this.removalLocked) { - debug('Delete Value', name); - _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ - 'delete' - ](this.state.values, name); - debug('Delete Modified', name); - _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ - 'delete' - ](this.state.modified, name); - debug('Delete Masked', name); - _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ - 'delete' - ](this.state.maskedValues, name); - debug('Delete Touched', name); - _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ - 'delete' - ](this.state.touched, name); - debug('Delete Errors', name); - _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ - 'delete' - ](this.state.errors, name); + var _options$value = options.value, + keepValue = + _options$value === void 0 ? false : _options$value, + _options$error = options.error, + keepError = + _options$error === void 0 ? false : _options$error, + _options$touched = options.touched, + keepTouched = + _options$touched === void 0 ? false : _options$touched; + + if (!keepValue) { + debug('Delete Value', name); + _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[ + /* ObjectMap */ 'a' + ]['delete'](this.state.values, name); + debug('Delete Modified', name); + _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[ + /* ObjectMap */ 'a' + ]['delete'](this.state.modified, name); + debug('Delete Masked', name); + _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[ + /* ObjectMap */ 'a' + ]['delete'](this.state.maskedValues, name); + } + + if (!keepTouched) { + debug('Delete Touched', name); + _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[ + /* ObjectMap */ 'a' + ]['delete'](this.state.touched, name); + } + + if (!keepError) { + debug('Delete Errors', name); + _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[ + /* ObjectMap */ 'a' + ]['delete'](this.state.errors, name); + } + debug('Delete Dirt', name); _ObjectMap__WEBPACK_IMPORTED_MODULE_0__[/* ObjectMap */ 'a'][ 'delete' @@ -3322,6 +3344,12 @@ /* ObjectMap */ 'a' ].empty(this.state.errors); this.state.invalid = !this.state.valid; + + if (meta.gatherData && meta.gatherOnMount === true) { + // Get error to determine if we even want to validateAsync + this.debouncedGatherInfo(name); + } + this.emit('field', name); // Special event when fields value changes ( its a reset so it changes ) this.emit('field-value', name); @@ -8938,6 +8966,7 @@ formController.pullOut(''.concat(name, '[').concat(i, ']')); formApi.setDirt(name, []); + formController.emitter.emit('field-value-set', name); }; var swap = function swap(a, b) { @@ -8991,6 +9020,7 @@ formApi.setPristine(false); formApi.setDirt(name, []); + formController.emitter.emit('field-value-set', name); }; var addWithInitialValue = function addWithInitialValue(initialValue) { @@ -10027,6 +10057,7 @@ 'yupSchema', 'multiple', 'field', + 'keep', 'keepState', 'keepStateIfRelevant', 'debug', @@ -10266,6 +10297,7 @@ yupSchema = _ref.yupSchema, multiple = _ref.multiple, field = _ref.field, + keep = _ref.keep, userKeepState = _ref.keepState, userKeepStateIfRelevant = _ref.keepStateIfRelevant, debug = _ref.debug, @@ -10509,6 +10541,7 @@ onFocus: onFocus, onNativeChange: onNativeChange, initialValue: initialValue, + keep: keep, keepState: keepState, keepStateIfRelevant: keepStateIfRelevant, initializeValueIfPristine: initializeValueIfPristine, @@ -10568,7 +10601,7 @@ if (!isRelevant && !keepState) { logger('RELEVANT REMOVING', metaInfo.name); - formController.remove(metaInfo.name); + formController.remove(metaInfo.name, metaInfo.keep); logger('RELEVANT De-Register', metaInfo.name); formController.deregister(metaInfo.name); } @@ -10605,7 +10638,7 @@ } if (!keepIt) { - formController.remove(metaInfo.name); + formController.remove(metaInfo.name, metaInfo.keep); } }; }, []); @@ -30810,6 +30843,7 @@ return _context.abrupt( 'return', new Promise(function(resolve, reject) { + // console.log('GATHER', text); if (!text) { return reject('Need valid text input'); } // for use in things like GatsbyJS where the html is generated first @@ -30873,7 +30907,7 @@ { list: 'addresses', name: 'address', - label: 'Address:', + label: 'Address:', // gatherOnMount gatherData: googleAutocomplete } ), @@ -30897,6 +30931,7 @@ }; var InputExample = function InputExample() { + // const [initialValues, setInitialValues] = useState(); return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( _src__WEBPACK_IMPORTED_MODULE_3__[/* Form */ 'f'], { @@ -30962,7 +30997,7 @@ /***/ function(module, __webpack_exports__, __webpack_require__) { 'use strict'; /* harmony default export */ __webpack_exports__['a'] = - '# Intro\n\nInformed comes with some basic default inputs. All inputs are built utilizing the `useField` hook, and therefore have access to all the properties of an informed\'s field. This design allows you to define your very own Input types if the defaults don\'t suite your needs! For additional information on custom Inputs, see the custom input section. If you are just getting started, or don\'t care to create your own custom inputs, simply take a look at the included input types.\n\n## Input Props\n\nBelow are all the input props that `informed`\'s inputs accept.\n\n| Name | Type | Required | Description |\n| ------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| name | string | YES | Every input must have a name. This is how the form manages the state of this input. See the field syntax section below for additional details on what you can pass in for field. |\n| initialValue | any | NO | An initial value for that field. |\n| defaultValue | any | NO | A default value for that field. |\n| validate | func | NO | Function that gets called when form performs validation. Function accepts the value as a parameter and must return either an error or undefined. By default it only gets called onSubmit. See Validation section for additional details. |\n| validateOn | bool | NO | Tells field when to perform validation. By default it only validates onBlur. |\n| validateOnMount | bool | NO | Tells field to perform validation onMount. | |\n| keepState | bool | NO | Keeps the field state around even when the input itself is unmounted ( see dynamic form docs for example ) |\n| keepStateIfRelevant | bool | NO | Keeps the field state around even when the input itself is not mounted ( only if its also relevant ) |\n| maintainCursor | bool | NO | formatter and parser functions will sometimes cause the cursor position to get lost. By default we informed will maintain cursor position. You can toggle that off here. |\n| allowEmptyString | bool | NO | Enable empty strings in the input value ( by default when you backspace everything in a text field it will remove the value ) |\n| `` props | html-5 | NO | All inputs can accept any props that a native html input, select, textarea, etc. can accept. For example, if you want to disable a text input, you would simply pass `disabled`. |\n\n## Field Syntax\n\nEvery input in `informed` needs an associated field name. In its simplest form, field names are just strings. However, sometimes you may have some complex forms that require special ways of organizing your fields, this is where the special syntax comes in.\n\nFields can be simple strings, strings that contain ".", and strings that contain "[ ]", much like how you access and write to objects and arrays in javascript. Below are some examples of field names and what they resolve to in the forms values object.\n\n| Field | Resolution |\n| ---------------------- | ------------------------ |\n| `"username"` | `values.username` |\n| `"friends[0]"` | `values.friends[0]` |\n| `"siblings.1"` | `values.siblings[1]` |\n| `"siblings[\'2\']"` | `values.siblings[2]` |\n| `"parents[0].name"` | `values.parents[0].name` |\n| `"parents[1][\'name\']"` | `values.parents[1].name` |\n\n\n\n```jsx\nimport { Form, Input, Debug } from \'informed\';\n\nconst Example = () => (\n
\n \n \n \n \n \n \n Values:\n \n \n);\n```\n'; + '# Intro\n\nInformed comes with some basic default inputs. All inputs are built utilizing the `useField` hook, and therefore have access to all the properties of an informed\'s field. This design allows you to define your very own Input types if the defaults don\'t suite your needs! For additional information on custom Inputs, see the custom input section. If you are just getting started, or don\'t care to create your own custom inputs, simply take a look at the included input types.\n\n## Input Props\n\nBelow are all the input props that `informed`\'s inputs accept.\n\n| Name | Type | Required | Description |\n| ------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| name | string | YES | Every input must have a name. This is how the form manages the state of this input. See the field syntax section below for additional details on what you can pass in for field. |\n| initialValue | any | NO | An initial value for that field. |\n| defaultValue | any | NO | A default value for that field. |\n| validate | func | NO | Function that gets called when form performs validation. Function accepts the value as a parameter and must return either an error or undefined. By default it only gets called onSubmit. See Validation section for additional details. |\n| validateOn | bool | NO | Tells field when to perform validation. By default it only validates onBlur. |\n| validateOnMount | bool | NO | Tells field to perform validation onMount. | |\n| keep | object | NO | Keeps specified field state around even when the input itself is unmounted keep={{ value: true }} |\n| keepState | bool | NO | Keeps the field state around even when the input itself is unmounted ( see dynamic form docs for example ) |\n| keepStateIfRelevant | bool | NO | Keeps the field state around even when the input itself is not mounted ( only if its also relevant ) |\n| maintainCursor | bool | NO | formatter and parser functions will sometimes cause the cursor position to get lost. By default we informed will maintain cursor position. You can toggle that off here. |\n| allowEmptyString | bool | NO | Enable empty strings in the input value ( by default when you backspace everything in a text field it will remove the value ) |\n| `` props | html-5 | NO | All inputs can accept any props that a native html input, select, textarea, etc. can accept. For example, if you want to disable a text input, you would simply pass `disabled`. |\n\n## Field Syntax\n\nEvery input in `informed` needs an associated field name. In its simplest form, field names are just strings. However, sometimes you may have some complex forms that require special ways of organizing your fields, this is where the special syntax comes in.\n\nFields can be simple strings, strings that contain ".", and strings that contain "[ ]", much like how you access and write to objects and arrays in javascript. Below are some examples of field names and what they resolve to in the forms values object.\n\n| Field | Resolution |\n| ---------------------- | ------------------------ |\n| `"username"` | `values.username` |\n| `"friends[0]"` | `values.friends[0]` |\n| `"siblings.1"` | `values.siblings[1]` |\n| `"siblings[\'2\']"` | `values.siblings[2]` |\n| `"parents[0].name"` | `values.parents[0].name` |\n| `"parents[1][\'name\']"` | `values.parents[1].name` |\n\n\n\n```jsx\nimport { Form, Input, Debug } from \'informed\';\n\nconst Example = () => (\n
\n \n \n \n \n \n \n Values:\n \n \n);\n```\n'; /***/ }, @@ -33641,6 +33676,528 @@ /***/ }, + /***/ './stories/KeepState/Keep/README.md': + /*!******************************************!*\ + !*** ./stories/KeepState/Keep/README.md ***! + \******************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony default export */ __webpack_exports__['a'] = + '# Keep\n\nSometimes you need to keep the state of a field even when it gets unmounted ( no longer rendered on screen ). In the below example we have a field that gets hidden when the hide button is clicked, when it gets unmounted its state would normally get removed, by passing `keep={{ value: true }}` we can control what state ( if any ) should be kept.\n\nNote: Click on the "Submit" button. See how the state shows an error and the value.\n\nNext: Click on the "Hide" button and note fields error state gets removed but NOT the value.\n\nNext: Click on the "Show" button and note the fields value state comes back but NOT the error state.\n\n\n\n```jsx\nimport { Form, Input, Checkbox, Relevant, Debug } from \'informed\';\n\nconst Example = () => {\n const [show, setShow] = useState(true);\n\n return (\n
\n {show ? (\n \n ) : null}\n \n \n \n \n );\n};\n```\n'; + + /***/ + }, + + /***/ './stories/KeepState/Keep/index.js': + /*!*****************************************!*\ + !*** ./stories/KeepState/Keep/index.js ***! + \*****************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( + /*! react */ './node_modules/react/index.js' + ); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( + /*! ../../utils/withDocs */ './stories/utils/withDocs.js' + ); + /* harmony import */ var _README_md__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( + /*! ./README.md */ './stories/KeepState/Keep/README.md' + ); + /* harmony import */ var _src__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( + /*! ../../../src */ './src/index.js' + ); + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _unsupportedIterableToArray(arr, i) || + _nonIterableRest() + ); + } + + function _nonIterableRest() { + throw new TypeError( + 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' + ); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === 'string') return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === 'Object' && o.constructor) n = o.constructor.name; + if (n === 'Map' || n === 'Set') return Array.from(o); + if ( + n === 'Arguments' || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ) + return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + function _iterableToArrayLimit(arr, i) { + var _i = + arr == null + ? null + : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || + arr['@@iterator']; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + var Example = function Example() { + var _useState = Object( + react__WEBPACK_IMPORTED_MODULE_0__['useState'] + )(true), + _useState2 = _slicedToArray(_useState, 2), + show = _useState2[0], + setShow = _useState2[1]; + + var toggle = function toggle() { + return setShow(function(prev) { + return !prev; + }); + }; + + return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Form */ 'f'], + null, + show + ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Input */ 'l'], + { + name: 'name', + label: 'Name:', + defaultValue: 'Hello', + minLength: 10, + keep: { + value: true + } + } + ) + : null, + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + 'button', + { + type: 'button', + onClick: toggle + }, + show ? 'Hide' : 'Show' + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + 'button', + { + type: 'submit' + }, + 'Submit' + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Debug */ 'c'], + { + values: true, + errors: true + } + ) + ); + }; + + /* harmony default export */ __webpack_exports__['a'] = Object( + _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__[/* default */ 'a'] + )(_README_md__WEBPACK_IMPORTED_MODULE_2__[/* default */ 'a'], Example); + + /***/ + }, + + /***/ './stories/KeepState/KeepState/README.md': + /*!***********************************************!*\ + !*** ./stories/KeepState/KeepState/README.md ***! + \***********************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony default export */ __webpack_exports__['a'] = + '# Keep State\n\nSometimes you need to keep the state of a field even when it gets unmounted ( no longer rendered on screen ). In the below example, when you toggle showing the fields the `name1` field will get removed from the form state but the name2 fields state will be kept.\n\nNote: Fill in both fields then click on the hide button and then show. Pay attention to how name2\'s state stays but name1\'s gets removed\n\n\n\n```jsx\nimport { Form, Input, Debug } from \'informed\';\n\nconst Example = () => {\n const [show, setShow] = useState(true);\n\n return (\n
\n {show ? : null}\n {show ? : null}\n \n \n \n );\n};\n```\n'; + + /***/ + }, + + /***/ './stories/KeepState/KeepState/index.js': + /*!**********************************************!*\ + !*** ./stories/KeepState/KeepState/index.js ***! + \**********************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( + /*! react */ './node_modules/react/index.js' + ); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( + /*! ../../utils/withDocs */ './stories/utils/withDocs.js' + ); + /* harmony import */ var _README_md__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( + /*! ./README.md */ './stories/KeepState/KeepState/README.md' + ); + /* harmony import */ var _src__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( + /*! ../../../src */ './src/index.js' + ); + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _unsupportedIterableToArray(arr, i) || + _nonIterableRest() + ); + } + + function _nonIterableRest() { + throw new TypeError( + 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' + ); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === 'string') return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === 'Object' && o.constructor) n = o.constructor.name; + if (n === 'Map' || n === 'Set') return Array.from(o); + if ( + n === 'Arguments' || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ) + return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + function _iterableToArrayLimit(arr, i) { + var _i = + arr == null + ? null + : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || + arr['@@iterator']; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + var Example = function Example() { + var _useState = Object( + react__WEBPACK_IMPORTED_MODULE_0__['useState'] + )(true), + _useState2 = _slicedToArray(_useState, 2), + show = _useState2[0], + setShow = _useState2[1]; + + var toggle = function toggle() { + return setShow(function(prev) { + return !prev; + }); + }; + + return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Form */ 'f'], + null, + show + ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Input */ 'l'], + { + name: 'name1', + label: 'Name:' + } + ) + : null, + show + ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Input */ 'l'], + { + name: 'name2', + label: 'Name:', + keepState: true + } + ) + : null, + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + 'button', + { + type: 'button', + onClick: toggle + }, + show ? 'Hide' : 'Show' + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Debug */ 'c'], + { + values: true + } + ) + ); + }; + + /* harmony default export */ __webpack_exports__['a'] = Object( + _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__[/* default */ 'a'] + )(_README_md__WEBPACK_IMPORTED_MODULE_2__[/* default */ 'a'], Example); + + /***/ + }, + + /***/ './stories/KeepState/KeepStateIfRelevant/README.md': + /*!*********************************************************!*\ + !*** ./stories/KeepState/KeepStateIfRelevant/README.md ***! + \*********************************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony default export */ __webpack_exports__['a'] = + '# Keep State If Relevant\n\nSometimes you need to keep the state of a field even when it gets unmounted ( no longer rendered on screen ). In the below example, when you toggle showing the fields the `name1` field will get removed from the form state but the name2 fields state will be kept. However if that field is irrelevant it will NOT be kept.\n\nNote: Fill in both fields then click on the hide button and then show. Pay attention to how name2\'s state stays but name1\'s gets removed\n\nNext: Click on the toggle input and note how name2\'s state gets removed as its irrelevant.\n\n\n\n```jsx\nimport { Form, Input, Checkbox, Relevant, Debug } from \'informed\';\n\nconst Example = () => {\n const [show, setShow] = useState(true);\n\n return (\n
\n {show ? : null}\n \n formState.values.show}>\n {show ? : null}\n \n
\n \n \n \n );\n};\n```\n'; + + /***/ + }, + + /***/ './stories/KeepState/KeepStateIfRelevant/index.js': + /*!********************************************************!*\ + !*** ./stories/KeepState/KeepStateIfRelevant/index.js ***! + \********************************************************/ + /*! exports provided: default */ + /*! exports used: default */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + 'use strict'; + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( + /*! react */ './node_modules/react/index.js' + ); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( + /*! ../../utils/withDocs */ './stories/utils/withDocs.js' + ); + /* harmony import */ var _README_md__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( + /*! ./README.md */ './stories/KeepState/KeepStateIfRelevant/README.md' + ); + /* harmony import */ var _src__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( + /*! ../../../src */ './src/index.js' + ); + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _unsupportedIterableToArray(arr, i) || + _nonIterableRest() + ); + } + + function _nonIterableRest() { + throw new TypeError( + 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' + ); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === 'string') return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === 'Object' && o.constructor) n = o.constructor.name; + if (n === 'Map' || n === 'Set') return Array.from(o); + if ( + n === 'Arguments' || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ) + return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + function _iterableToArrayLimit(arr, i) { + var _i = + arr == null + ? null + : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || + arr['@@iterator']; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + var Example = function Example() { + var _useState = Object( + react__WEBPACK_IMPORTED_MODULE_0__['useState'] + )(true), + _useState2 = _slicedToArray(_useState, 2), + show = _useState2[0], + setShow = _useState2[1]; + + var toggle = function toggle() { + return setShow(function(prev) { + return !prev; + }); + }; + + return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Form */ 'f'], + null, + show + ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Input */ 'l'], + { + name: 'name1', + label: 'Name:' + } + ) + : null, + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Checkbox */ 'b'], + { + name: 'show', + label: 'Show', + defaultValue: true + } + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Relevant */ 'q'], + { + when: function when(_ref) { + var formState = _ref.formState; + return formState.values.show; + } + }, + show + ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Input */ 'l'], + { + name: 'name2', + label: 'Name:', + keepStateIfRelevant: true + } + ) + : null + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + 'br', + null + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + 'button', + { + type: 'button', + onClick: toggle + }, + show ? 'Hide' : 'Show' + ), + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( + _src__WEBPACK_IMPORTED_MODULE_3__[/* Debug */ 'c'], + { + values: true + } + ) + ); + }; + + /* harmony default export */ __webpack_exports__['a'] = Object( + _utils_withDocs__WEBPACK_IMPORTED_MODULE_1__[/* default */ 'a'] + )(_README_md__WEBPACK_IMPORTED_MODULE_2__[/* default */ 'a'], Example); + + /***/ + }, + /***/ './stories/Multistep/Actions/README.md': /*!*********************************************!*\ !*** ./stories/Multistep/Actions/README.md ***! @@ -35783,7 +36340,7 @@ /***/ function(module, __webpack_exports__, __webpack_require__) { 'use strict'; /* harmony default export */ __webpack_exports__['a'] = - '# Relevance Component\n\nSometimes you need to conditionally render fields. Below is a simple\nexample the shows or hides a spouse depending on a checkbox.\n\n\n\n```jsx\nimport { Form, Input, Checkbox, Relevant } from \'informed\';\n\nconst RelevantComonent = () => (\n
\n \n \n formState.values.married}>\n \n \n \n \n);\n```\n'; + '# Relevance Component\n\nSometimes you need to conditionally render fields. Below is a simple\nexample the shows or hides a spouse depending on a checkbox.\n\n\n\n```jsx\nimport { Form, Input, Checkbox, Relevant } from \'informed\';\n\nconst RelevantComonent = () => (\n
\n \n \n formState.values.married}>\n \n \n \n \n);\n```\n'; /***/ }, @@ -43186,45 +43743,54 @@ /* harmony import */ var _Relevance_ScopedRelevance__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__( /*! ./Relevance/ScopedRelevance */ './stories/Relevance/ScopedRelevance/index.js' ); - /* harmony import */ var _Scope_ScopeComponent__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__( + /* harmony import */ var _KeepState_KeepState__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__( + /*! ./KeepState/KeepState */ './stories/KeepState/KeepState/index.js' + ); + /* harmony import */ var _Scope_ScopeComponent__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__( /*! ./Scope/ScopeComponent */ './stories/Scope/ScopeComponent/index.js' ); - /* harmony import */ var _Hooks__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__( + /* harmony import */ var _Hooks__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__( /*! ./Hooks */ './stories/Hooks/index.js' ); - /* harmony import */ var _Schema_ConditionalSchema__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__( + /* harmony import */ var _Schema_ConditionalSchema__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__( /*! ./Schema/ConditionalSchema */ './stories/Schema/ConditionalSchema/index.js' ); - /* harmony import */ var _Schema_ConditionalSchemaControl__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__( + /* harmony import */ var _Schema_ConditionalSchemaControl__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__( /*! ./Schema/ConditionalSchemaControl */ './stories/Schema/ConditionalSchemaControl/index.js' ); - /* harmony import */ var _Schema_ConditionalOptions__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__( + /* harmony import */ var _Schema_ConditionalOptions__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__( /*! ./Schema/ConditionalOptions */ './stories/Schema/ConditionalOptions/index.js' ); - /* harmony import */ var _Schema_SchemaComponents__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__( + /* harmony import */ var _Schema_SchemaComponents__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__( /*! ./Schema/SchemaComponents */ './stories/Schema/SchemaComponents/index.js' ); - /* harmony import */ var _Form_FormatDependent__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__( + /* harmony import */ var _Form_FormatDependent__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__( /*! ./Form/FormatDependent */ './stories/Form/FormatDependent/index.js' ); - /* harmony import */ var _CustomInputs_FormattedObjectInput__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__( + /* harmony import */ var _CustomInputs_FormattedObjectInput__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__( /*! ./CustomInputs/FormattedObjectInput */ './stories/CustomInputs/FormattedObjectInput/index.js' ); - /* harmony import */ var _CustomInputs_ObjectInput__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__( + /* harmony import */ var _CustomInputs_ObjectInput__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__( /*! ./CustomInputs/ObjectInput */ './stories/CustomInputs/ObjectInput/index.js' ); - /* harmony import */ var _Formatting_NumberFormatter__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__( + /* harmony import */ var _Formatting_NumberFormatter__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__( /*! ./Formatting/NumberFormatter */ './stories/Formatting/NumberFormatter/index.js' ); - /* harmony import */ var _Conditionals_ConditionalProps__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__( + /* harmony import */ var _Conditionals_ConditionalProps__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__( /*! ./Conditionals/ConditionalProps */ './stories/Conditionals/ConditionalProps/index.js' ); - /* harmony import */ var _Conditionals_ConditionalPropsSchema__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__( + /* harmony import */ var _Conditionals_ConditionalPropsSchema__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__( /*! ./Conditionals/ConditionalPropsSchema */ './stories/Conditionals/ConditionalPropsSchema/index.js' ); - /* harmony import */ var _Schema_ChangingSchema__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__( + /* harmony import */ var _Schema_ChangingSchema__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__( /*! ./Schema/ChangingSchema */ './stories/Schema/ChangingSchema/index.js' ); + /* harmony import */ var _KeepState_KeepStateIfRelevant__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__( + /*! ./KeepState/KeepStateIfRelevant */ './stories/KeepState/KeepStateIfRelevant/index.js' + ); + /* harmony import */ var _KeepState_Keep__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__( + /*! ./KeepState/Keep */ './stories/KeepState/Keep/index.js' + ); // import ArrayFieldValidation from './Validation/ArrayFieldValidation'; // import ComplexArrayFieldValidation from './Validation/ComplexArrayFieldValidation'; @@ -43374,7 +43940,7 @@ ) .add( 'Dependent Fields', - _Form_FormatDependent__WEBPACK_IMPORTED_MODULE_72__[ + _Form_FormatDependent__WEBPACK_IMPORTED_MODULE_73__[ /* default */ 'a' ] ) @@ -43456,13 +44022,13 @@ ) .add( 'Creating Object Inputs', - _CustomInputs_ObjectInput__WEBPACK_IMPORTED_MODULE_74__[ + _CustomInputs_ObjectInput__WEBPACK_IMPORTED_MODULE_75__[ /* default */ 'a' ] ) .add( 'Creating Formatted Object Inputs', - _CustomInputs_FormattedObjectInput__WEBPACK_IMPORTED_MODULE_73__[ + _CustomInputs_FormattedObjectInput__WEBPACK_IMPORTED_MODULE_74__[ /* default */ 'a' ] ); @@ -43598,12 +44164,32 @@ /* default */ 'a' ] ); + Object(_storybook_react__WEBPACK_IMPORTED_MODULE_1__['storiesOf'])( + 'KeepState', + module + ) + .add( + 'KeepState', + _KeepState_KeepState__WEBPACK_IMPORTED_MODULE_66__[ + /* default */ 'a' + ] + ) + .add( + 'Keep State If Relevant', + _KeepState_KeepStateIfRelevant__WEBPACK_IMPORTED_MODULE_80__[ + /* default */ 'a' + ] + ) + .add( + 'Keep', + _KeepState_Keep__WEBPACK_IMPORTED_MODULE_81__[/* default */ 'a'] + ); Object(_storybook_react__WEBPACK_IMPORTED_MODULE_1__['storiesOf'])( 'Scope', module ).add( 'Scope Comonent', - _Scope_ScopeComponent__WEBPACK_IMPORTED_MODULE_66__[ + _Scope_ScopeComponent__WEBPACK_IMPORTED_MODULE_67__[ /* default */ 'a' ] ); @@ -43639,19 +44225,19 @@ ) .add( 'Conditional Schema', - _Schema_ConditionalSchema__WEBPACK_IMPORTED_MODULE_68__[ + _Schema_ConditionalSchema__WEBPACK_IMPORTED_MODULE_69__[ /* default */ 'a' ] ) .add( 'Conditional Schema Control', - _Schema_ConditionalSchemaControl__WEBPACK_IMPORTED_MODULE_69__[ + _Schema_ConditionalSchemaControl__WEBPACK_IMPORTED_MODULE_70__[ /* default */ 'a' ] ) .add( 'Conditional Options', - _Schema_ConditionalOptions__WEBPACK_IMPORTED_MODULE_70__[ + _Schema_ConditionalOptions__WEBPACK_IMPORTED_MODULE_71__[ /* default */ 'a' ] ) @@ -43663,7 +44249,7 @@ ) .add( 'Schema Components', - _Schema_SchemaComponents__WEBPACK_IMPORTED_MODULE_71__[ + _Schema_SchemaComponents__WEBPACK_IMPORTED_MODULE_72__[ /* default */ 'a' ] ) @@ -43681,7 +44267,7 @@ ) .add( 'Changing Schema', - _Schema_ChangingSchema__WEBPACK_IMPORTED_MODULE_78__[ + _Schema_ChangingSchema__WEBPACK_IMPORTED_MODULE_79__[ /* default */ 'a' ] ); // .add('Huge Schema', HugeSchema); @@ -43705,7 +44291,7 @@ ) .add( 'Number Formatter', - _Formatting_NumberFormatter__WEBPACK_IMPORTED_MODULE_75__[ + _Formatting_NumberFormatter__WEBPACK_IMPORTED_MODULE_76__[ /* default */ 'a' ] ) @@ -43736,31 +44322,31 @@ ) .add( 'useFormApi', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseFormApi */ 'e'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseFormApi */ 'e'] ) .add( 'useFormState', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseFormState */ 'f'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseFormState */ 'f'] ) .add( 'useFieldApi', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseFieldApi */ 'b'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseFieldApi */ 'b'] ) .add( 'useFieldState', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseFieldState */ 'c'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseFieldState */ 'c'] ) .add( 'useForm', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseForm */ 'd'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseForm */ 'd'] ) .add( 'useField', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[/* UseField */ 'a'] + _Hooks__WEBPACK_IMPORTED_MODULE_68__[/* UseField */ 'a'] ) .add( 'useFormStateSelector', - _Hooks__WEBPACK_IMPORTED_MODULE_67__[ + _Hooks__WEBPACK_IMPORTED_MODULE_68__[ /* UseFormStateSelector */ 'g' ] ); @@ -43849,13 +44435,13 @@ ) .add( 'Conditional Props', - _Conditionals_ConditionalProps__WEBPACK_IMPORTED_MODULE_76__[ + _Conditionals_ConditionalProps__WEBPACK_IMPORTED_MODULE_77__[ /* default */ 'a' ] ) .add( 'Conditional Props Schema', - _Conditionals_ConditionalPropsSchema__WEBPACK_IMPORTED_MODULE_77__[ + _Conditionals_ConditionalPropsSchema__WEBPACK_IMPORTED_MODULE_78__[ /* default */ 'a' ] ); @@ -44619,4 +45205,4 @@ }, [[0, 'runtime~main', 'vendors~main']] ]); -//# sourceMappingURL=main.e87f8f2f.iframe.bundle.js.map +//# sourceMappingURL=main.d979381b.iframe.bundle.js.map diff --git a/docs/main.d979381b.iframe.bundle.js.map b/docs/main.d979381b.iframe.bundle.js.map new file mode 100644 index 00000000..6e8f0149 --- /dev/null +++ b/docs/main.d979381b.iframe.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d979381b.iframe.bundle.js","sources":["webpack:///./.storybook/assets/normalize.css?0f0a","webpack:///./.storybook/assets/prism.css?efb1","webpack:///./.storybook/assets/prism.js","webpack:///./.storybook/assets/styles.css?4647","webpack:///./.storybook/preview.js","webpack:///./.storybook/preview.js-generated-config-entry.js","webpack:///./CHANGELOG.md","webpack:///./generated-stories-entry.js","webpack:///./.storybook/assets/normalize.css","webpack:///./.storybook/assets/prism.css","webpack:///./.storybook/assets/styles.css","webpack:///./src/Context.js","webpack:///./src/FormController.js","webpack:///./src/ObjectMap.js","webpack:///./src/components/ArrayField.js","webpack:///./src/components/Debug.js","webpack:///./src/components/DebugField.js","webpack:///./src/components/Form.js","webpack:///./src/components/FormComponents.js","webpack:///./src/components/FormField.js","webpack:///./src/components/FormFields.js","webpack:///./src/components/FormProvider.js","webpack:///./src/components/FormStateAccessor.js","webpack:///./src/components/Informed.js","webpack:///./src/components/Multistep.js","webpack:///./src/components/Relevant.js","webpack:///./src/components/SchemaFields.js","webpack:///./src/components/Scope.js","webpack:///./src/components/UpdateFields.js","webpack:///./src/components/form-fields/AddButton.js","webpack:///./src/components/form-fields/ArrayField.js","webpack:///./src/components/form-fields/Checkbox.js","webpack:///./src/components/form-fields/Hidden.js","webpack:///./src/components/form-fields/Input.js","webpack:///./src/components/form-fields/Option.js","webpack:///./src/components/form-fields/Radio.js","webpack:///./src/components/form-fields/RadioGroup.js","webpack:///./src/components/form-fields/RemoveButton.js","webpack:///./src/components/form-fields/Select.js","webpack:///./src/components/form-fields/TextArea.js","webpack:///./src/debug.js","webpack:///./src/fieldMap.js","webpack:///./src/hooks/useArrayField.js","webpack:///./src/hooks/useArrayFieldApi.js","webpack:///./src/hooks/useArrayFieldItemApi.js","webpack:///./src/hooks/useArrayFieldItemState.js","webpack:///./src/hooks/useArrayFieldState.js","webpack:///./src/hooks/useConditional.js","webpack:///./src/hooks/useCursorPosition.js","webpack:///./src/hooks/useEffectOnce.js","webpack:///./src/hooks/useField.js","webpack:///./src/hooks/useFieldApi.js","webpack:///./src/hooks/useFieldState.js","webpack:///./src/hooks/useFieldSubscription.js","webpack:///./src/hooks/useForceUpdate.js","webpack:///./src/hooks/useForm.js","webpack:///./src/hooks/useFormApi.js","webpack:///./src/hooks/useFormController.js","webpack:///./src/hooks/useFormState.js","webpack:///./src/hooks/useFormStateSelector.js","webpack:///./src/hooks/useInformed.js","webpack:///./src/hooks/useInformedApi.js","webpack:///./src/hooks/useInformedField.js","webpack:///./src/hooks/useInformedState.js","webpack:///./src/hooks/useMultistep.js","webpack:///./src/hooks/useMultistepApi.js","webpack:///./src/hooks/useMultistepState.js","webpack:///./src/hooks/useMultistepStep.js","webpack:///./src/hooks/useRadioGroup.js","webpack:///./src/hooks/useRelevance.js","webpack:///./src/hooks/useScope.js","webpack:///./src/hooks/useScopedApi.js","webpack:///./src/hooks/useScoper.js","webpack:///./src/hooks/useStateWithGetter.js","webpack:///./src/hooks/useUpdateEffect.js","webpack:///./src/index.js","webpack:///./src/proxy.js","webpack:///./src/structuredClone.js","webpack:///./src/utils.js","webpack:///./stories sync nonrecursive ^\\.[\\\\/](","webpack:///./stories/Arrays/AlternateSyntax/README.md","webpack:///./stories/Arrays/AlternateSyntax/index.js","webpack:///./stories/Arrays/ArrayFieldItem/README.md","webpack:///./stories/Arrays/ArrayFieldItem/index.js","webpack:///./stories/Arrays/ArrayOfFields/README.md","webpack:///./stories/Arrays/ArrayOfFields/index.js","webpack:///./stories/Arrays/ArrayOfScopes/README.md","webpack:///./stories/Arrays/ArrayOfScopes/index.js","webpack:///./stories/Arrays/DependentFields/README.md","webpack:///./stories/Arrays/DependentFields/index.js","webpack:///./stories/Arrays/DynamicArrays/README.md","webpack:///./stories/Arrays/DynamicArrays/index.js","webpack:///./stories/Arrays/HugeArrayForm/README.md","webpack:///./stories/Arrays/HugeArrayForm/index.js","webpack:///./stories/Arrays/NestedFields/README.md","webpack:///./stories/Arrays/NestedFields/index.js","webpack:///./stories/Arrays/index.js","webpack:///./stories/CarColor/README.md","webpack:///./stories/CarColor/index.js","webpack:///./stories/Conditionals/ConditionalProps/README.md","webpack:///./stories/Conditionals/ConditionalProps/index.js","webpack:///./stories/Conditionals/ConditionalPropsSchema/README.md","webpack:///./stories/Conditionals/ConditionalPropsSchema/index.js","webpack:///./stories/CustomInputs/FormattedObjectInput/README.md","webpack:///./stories/CustomInputs/FormattedObjectInput/index.js","webpack:///./stories/CustomInputs/FromScratch/README.md","webpack:///./stories/CustomInputs/FromScratch/index.js","webpack:///./stories/CustomInputs/Intro/README.md","webpack:///./stories/CustomInputs/Intro/index.js","webpack:///./stories/CustomInputs/ObjectInput/README.md","webpack:///./stories/CustomInputs/ObjectInput/index.js","webpack:///./stories/CustomInputs/Slider/README.md","webpack:///./stories/CustomInputs/Slider/index.js","webpack:///./stories/CustomInputs/UseField/README.md","webpack:///./stories/CustomInputs/UseField/index.js","webpack:///./stories/CustomInputs/UseFieldHooked/README.md","webpack:///./stories/CustomInputs/UseFieldHooked/index.js","webpack:///./stories/CustomInputs/index.js","webpack:///./stories/Debugging/Debug/README.md","webpack:///./stories/Debugging/Debug/index.js","webpack:///./stories/Dynamic/AsyncDependentFields/README.md","webpack:///./stories/Dynamic/AsyncDependentFields/index.js","webpack:///./stories/Dynamic/Dependent/README.md","webpack:///./stories/Dynamic/Dependent/index.js","webpack:///./stories/Dynamic/DynamicFields/README.md","webpack:///./stories/Dynamic/DynamicFields/index.js","webpack:///./stories/Form/Api/Intro/README.md","webpack:///./stories/Form/Api/Intro/index.js","webpack:///./stories/Form/Api/UseFormApi/README.md","webpack:///./stories/Form/Api/UseFormApi/index.js","webpack:///./stories/Form/Api/index.js","webpack:///./stories/Form/Basic/README.md","webpack:///./stories/Form/Basic/index.js","webpack:///./stories/Form/Big/README.md","webpack:///./stories/Form/Big/index.js","webpack:///./stories/Form/Complex/README.md","webpack:///./stories/Form/Complex/index.js","webpack:///./stories/Form/Dynamic/README.md","webpack:///./stories/Form/Dynamic/index.js","webpack:///./stories/Form/FeatureTester/README.md","webpack:///./stories/Form/FeatureTester/index.js","webpack:///./stories/Form/FormProvider/README.md","webpack:///./stories/Form/FormProvider/index.js","webpack:///./stories/Form/FormatDependent/README.md","webpack:///./stories/Form/FormatDependent/index.js","webpack:///./stories/Form/Modified/README.md","webpack:///./stories/Form/Modified/index.js","webpack:///./stories/Form/Path/README.md","webpack:///./stories/Form/Path/index.js","webpack:///./stories/Form/Props/README.md","webpack:///./stories/Form/Props/index.js","webpack:///./stories/Form/State/README.md","webpack:///./stories/Form/State/index.js","webpack:///./stories/Formatting/Clean/README.md","webpack:///./stories/Formatting/Clean/index.js","webpack:///./stories/Formatting/Formatter/README.md","webpack:///./stories/Formatting/Formatter/index.js","webpack:///./stories/Formatting/FormatterFunctions/README.md","webpack:///./stories/Formatting/FormatterFunctions/index.js","webpack:///./stories/Formatting/Mask/README.md","webpack:///./stories/Formatting/Mask/index.js","webpack:///./stories/Formatting/NumberFormatter/README.md","webpack:///./stories/Formatting/NumberFormatter/index.js","webpack:///./stories/Formatting/Parse/README.md","webpack:///./stories/Formatting/Parse/index.js","webpack:///./stories/GlobalForms/Intro/README.md","webpack:///./stories/GlobalForms/Intro/index.js","webpack:///./stories/Gotchas/ChangingInitialValues/README.md","webpack:///./stories/Gotchas/ChangingInitialValues/index.js","webpack:///./stories/Gotchas/InitializeIfPristine/README.md","webpack:///./stories/Gotchas/InitializeIfPristine/index.js","webpack:///./stories/Gotchas/InitialvsDefault/README.md","webpack:///./stories/Gotchas/InitialvsDefault/index.js","webpack:///./stories/Gotchas/Scope/WithField.js","webpack:///./stories/Gotchas/Scope/WithField.md","webpack:///./stories/Gotchas/Scope/index.js","webpack:///./stories/Hooks/index.js","webpack:///./stories/Hooks/useField/index.js","webpack:///./stories/Hooks/useField/useFieldCustom/README.md","webpack:///./stories/Hooks/useField/useFieldCustom/index.js","webpack:///./stories/Hooks/useField/useFieldDirect/README.md","webpack:///./stories/Hooks/useField/useFieldDirect/index.js","webpack:///./stories/Hooks/useFieldApi/README.md","webpack:///./stories/Hooks/useFieldApi/index.js","webpack:///./stories/Hooks/useFieldState/README.md","webpack:///./stories/Hooks/useFieldState/index.js","webpack:///./stories/Hooks/useForm/README.md","webpack:///./stories/Hooks/useForm/index.js","webpack:///./stories/Hooks/useFormApi/README.md","webpack:///./stories/Hooks/useFormApi/index.js","webpack:///./stories/Hooks/useFormState/README.md","webpack:///./stories/Hooks/useFormState/index.js","webpack:///./stories/Hooks/useFormStateSelector/README.md","webpack:///./stories/Hooks/useFormStateSelector/index.js","webpack:///./stories/Inputs/CheckboxInput/README.md","webpack:///./stories/Inputs/CheckboxInput/index.js","webpack:///./stories/Inputs/GoogleApi/README.md","webpack:///./stories/Inputs/GoogleApi/index.js","webpack:///./stories/Inputs/Intro/README.md","webpack:///./stories/Inputs/Intro/index.js","webpack:///./stories/Inputs/MultiSelectInput/README.md","webpack:///./stories/Inputs/MultiSelectInput/index.js","webpack:///./stories/Inputs/NumberInput/README.md","webpack:///./stories/Inputs/NumberInput/index.js","webpack:///./stories/Inputs/RadioInput/README.md","webpack:///./stories/Inputs/RadioInput/index.js","webpack:///./stories/Inputs/SelectInput/README.md","webpack:///./stories/Inputs/SelectInput/index.js","webpack:///./stories/Inputs/TextAreaInput/README.md","webpack:///./stories/Inputs/TextAreaInput/index.js","webpack:///./stories/Inputs/TextInput/README.md","webpack:///./stories/Inputs/TextInput/index.js","webpack:///./stories/Inputs/index.js","webpack:///./stories/Intro/Changelog.js","webpack:///./stories/Intro/CustomIntro/README.md","webpack:///./stories/Intro/CustomIntro/index.js","webpack:///./stories/Intro/FormApi/ApiRef/README.md","webpack:///./stories/Intro/FormApi/ApiRef/index.js","webpack:///./stories/Intro/FormApi/RenderProp/README.md","webpack:///./stories/Intro/FormApi/RenderProp/index.js","webpack:///./stories/Intro/FormApi/UseFormApi/README.md","webpack:///./stories/Intro/FormApi/UseFormApi/index.js","webpack:///./stories/Intro/FormApi/index.js","webpack:///./stories/Intro/FormState/README.md","webpack:///./stories/Intro/FormState/index.js","webpack:///./stories/Intro/GettingStarted/README.md","webpack:///./stories/Intro/GettingStarted/index.js","webpack:///./stories/Intro/Intro/README.md","webpack:///./stories/Intro/Intro/index.js","webpack:///./stories/Intro/SchemaVsFormat/README.md","webpack:///./stories/Intro/SchemaVsFormat/index.js","webpack:///./stories/Intro/UseForm/README.md","webpack:///./stories/Intro/UseForm/index.js","webpack:///./stories/Intro/WhatElse/README.md","webpack:///./stories/Intro/WhatElse/index.js","webpack:///./stories/Intro/index.js","webpack:///./stories/KeepState/Keep/README.md","webpack:///./stories/KeepState/Keep/index.js","webpack:///./stories/KeepState/KeepState/README.md","webpack:///./stories/KeepState/KeepState/index.js","webpack:///./stories/KeepState/KeepStateIfRelevant/README.md","webpack:///./stories/KeepState/KeepStateIfRelevant/index.js","webpack:///./stories/Multistep/Actions/README.md","webpack:///./stories/Multistep/Actions/index.js","webpack:///./stories/Multistep/Basic/README.md","webpack:///./stories/Multistep/Basic/index.js","webpack:///./stories/Multistep/Complex/README.md","webpack:///./stories/Multistep/Complex/index.js","webpack:///./stories/Multistep/MultistepState/README.md","webpack:///./stories/Multistep/MultistepState/index.js","webpack:///./stories/Playground/Format/README.md","webpack:///./stories/Playground/Format/index.js","webpack:///./stories/Playground/Schema/README.md","webpack:///./stories/Playground/Schema/index.js","webpack:///./stories/Relevance/ComplexRelevance/README.md","webpack:///./stories/Relevance/ComplexRelevance/index.js","webpack:///./stories/Relevance/RelevanceProp/README.md","webpack:///./stories/Relevance/RelevanceProp/index.js","webpack:///./stories/Relevance/RelevantComponent/README.md","webpack:///./stories/Relevance/RelevantComponent/index.js","webpack:///./stories/Relevance/ScopedRelevance/README.md","webpack:///./stories/Relevance/ScopedRelevance/index.js","webpack:///./stories/Schema/ArrayFieldSchema/README.md","webpack:///./stories/Schema/ArrayFieldSchema/index.js","webpack:///./stories/Schema/ArrayFieldSchemaNested/README.md","webpack:///./stories/Schema/ArrayFieldSchemaNested/index.js","webpack:///./stories/Schema/ArrayFieldSchemaRelevant/README.md","webpack:///./stories/Schema/ArrayFieldSchemaRelevant/index.js","webpack:///./stories/Schema/ChangingSchema/README.md","webpack:///./stories/Schema/ChangingSchema/index.js","webpack:///./stories/Schema/ConditionalOptions/README.md","webpack:///./stories/Schema/ConditionalOptions/index.js","webpack:///./stories/Schema/ConditionalSchema/README.md","webpack:///./stories/Schema/ConditionalSchema/index.js","webpack:///./stories/Schema/ConditionalSchemaControl/README.md","webpack:///./stories/Schema/ConditionalSchemaControl/index.js","webpack:///./stories/Schema/CustomSchema/README.md","webpack:///./stories/Schema/CustomSchema/index.js","webpack:///./stories/Schema/FormattedSchema/README.md","webpack:///./stories/Schema/FormattedSchema/index.js","webpack:///./stories/Schema/Intro/README.md","webpack:///./stories/Schema/Intro/index.js","webpack:///./stories/Schema/NestedSchema/README.md","webpack:///./stories/Schema/NestedSchema/index.js","webpack:///./stories/Schema/SchemaComponents/README.md","webpack:///./stories/Schema/SchemaComponents/index.js","webpack:///./stories/Schema/SubSchema/README.md","webpack:///./stories/Schema/SubSchema/index.js","webpack:///./stories/Scope/ScopeComponent/README.md","webpack:///./stories/Scope/ScopeComponent/index.js","webpack:///./stories/TLDR/GettingStarted/README.md","webpack:///./stories/TLDR/GettingStarted/index.js","webpack:///./stories/TLDR/Intro/README.md","webpack:///./stories/TLDR/Intro/index.js","webpack:///./stories/TLDR/index.js","webpack:///./stories/Validation/AjvValidation/README.md","webpack:///./stories/Validation/AjvValidation/index.js","webpack:///./stories/Validation/AjvValidationNoRender/README.md","webpack:///./stories/Validation/AjvValidationNoRender/index.js","webpack:///./stories/Validation/AsyncValidation/README.md","webpack:///./stories/Validation/AsyncValidation/index.js","webpack:///./stories/Validation/ComplexValidation/README.md","webpack:///./stories/Validation/ComplexValidation/index.js","webpack:///./stories/Validation/Elon/README.md","webpack:///./stories/Validation/Elon/index.js","webpack:///./stories/Validation/FieldLevelYupValidation/README.md","webpack:///./stories/Validation/FieldLevelYupValidation/index.js","webpack:///./stories/Validation/Notifications/README.md","webpack:///./stories/Validation/Notifications/index.js","webpack:///./stories/Validation/Required/README.md","webpack:///./stories/Validation/Required/index.js","webpack:///./stories/Validation/SimpleValidation/README.md","webpack:///./stories/Validation/SimpleValidation/index.js","webpack:///./stories/Validation/ValidationControl/README.md","webpack:///./stories/Validation/ValidationControl/index.js","webpack:///./stories/Validation/ValidationMessages/Format/README.md","webpack:///./stories/Validation/ValidationMessages/Format/index.js","webpack:///./stories/Validation/ValidationMessages/Schema/README.md","webpack:///./stories/Validation/ValidationMessages/Schema/index.js","webpack:///./stories/Validation/ValidationMessages/index.js","webpack:///./stories/Validation/YupValidation/README.md","webpack:///./stories/Validation/YupValidation/index.js","webpack:///./stories/index.js","webpack:///./stories/utils/Code.js","webpack:///./stories/utils/CodeBlock.js","webpack:///./stories/utils/Modal.js","webpack:///./stories/utils/StoryWrapper.js","webpack:///./stories/utils/withDocs.js","webpack:///./storybook-init-framework-entry.js","webpack:///./util.inspect (ignored)"],"sourcesContent":["var api = require(\"!../../node_modules/@storybook/builder-webpack4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js??ref--7-1!../../node_modules/postcss-loader/dist/cjs.js??ref--7-2!./normalize.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","var api = require(\"!../../node_modules/@storybook/builder-webpack4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js??ref--7-1!../../node_modules/postcss-loader/dist/cjs.js??ref--7-2!./prism.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+json+jsx&plugins=previewer-base */\nvar _self=\"undefined\"!=typeof window?window:\"undefined\"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\\blang(?:uage)?-(\\w+)\\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):\"Array\"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,\"&\").replace(/e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,S=t.length;S>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,N=w.slice(0,A),C=w.slice(j),E=[b,P];N&&(++b,k+=N.length,E.push(N));var L=new s(u,f?n.tokenize(_,f):_,y,_,m);if(E.push(L),C&&E.push(C),Array.prototype.splice.apply(t,E),1!=P&&n.matchGrammar(e,t,a,b,k,!0,u),l)break}else if(l)break}}}}},tokenize:function(e,t){var a=[e],r=t.rest;if(r){for(var i in r)t[i]=r[i];delete t.rest}return n.matchGrammar(e,a,t,0,0,!1),a},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||\"\").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if(\"string\"==typeof e)return e;if(\"Array\"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join(\"\");var i={type:e.type,content:a.stringify(e.content,t,r),tag:\"span\",classes:[\"token\",e.type],attributes:{},language:t,parent:r};if(\"comment\"==i.type&&(i.attributes.spellcheck=\"true\"),e.alias){var l=\"Array\"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}n.hooks.run(\"wrap\",i);var o=Object.keys(i.attributes).map(function(e){return e+'=\"'+(i.attributes[e]||\"\").replace(/\"/g,\""\")+'\"'}).join(\" \");return\"<\"+i.tag+' class=\"'+i.classes.join(\" \")+'\"'+(o?\" \"+o:\"\")+\">\"+i.content+\"\"},!_self.document)return _self.addEventListener?(_self.addEventListener(\"message\",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,i=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),i&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName(\"script\")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute(\"data-manual\")||(\"loading\"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener(\"DOMContentLoaded\",n.highlightAll))),_self.Prism}();\"undefined\"!=typeof module&&module.exports&&(module.exports=Prism),\"undefined\"!=typeof global&&(global.Prism=Prism);\nPrism.languages.markup={comment://,prolog:/<\\?[\\s\\S]+?\\?>/,doctype://i,cdata://i,tag:{pattern:/<\\/?(?!\\d)[^\\s>\\/=$<]+(?:\\s+[^\\s>\\/=]+(?:=(?:(\"|')(?:\\\\\\1|\\\\?(?!\\1)[\\s\\S])*\\1|[^\\s'\">=]+))?)*\\s*\\/?>/i,inside:{tag:{pattern:/^<\\/?[^\\s>\\/]+/i,inside:{punctuation:/^<\\/?/,namespace:/^[^\\s>\\/:]+:/}},\"attr-value\":{pattern:/=(?:('|\")[\\s\\S]*?(\\1)|[^\\s>]+)/i,inside:{punctuation:/[=>\"']/}},punctuation:/\\/?>/,\"attr-name\":{pattern:/[^\\s>\\/]+/,inside:{namespace:/^[^\\s>\\/:]+:/}}}},entity:/&#?[\\da-z]{1,8};/i},Prism.languages.markup.tag.inside[\"attr-value\"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add(\"wrap\",function(a){\"entity\"===a.type&&(a.attributes.title=a.content.replace(/&/,\"&\"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;\nPrism.languages.css={comment:/\\/\\*[\\s\\S]*?\\*\\//,atrule:{pattern:/@[\\w-]+?.*?(;|(?=\\s*\\{))/i,inside:{rule:/@[\\w-]+/}},url:/url\\((?:([\"'])(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1|.*?)\\)/i,selector:/[^\\{\\}\\s][^\\{\\};]*?(?=\\s*\\{)/,string:{pattern:/(\"|')(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,greedy:!0},property:/(\\b|\\B)[\\w-]+(?=\\s*:)/i,important:/\\B!important\\b/i,\"function\":/[-a-z0-9]+(?=\\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore(\"markup\",\"tag\",{style:{pattern:/()[\\s\\S]*?(?=<\\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:\"language-css\"}}),Prism.languages.insertBefore(\"inside\",\"attr-value\",{\"style-attr\":{pattern:/\\s*style=(\"|').*?\\1/i,inside:{\"attr-name\":{pattern:/^\\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\\s*=\\s*['\"]|['\"]\\s*$/,\"attr-value\":{pattern:/.+/i,inside:Prism.languages.css}},alias:\"language-css\"}},Prism.languages.markup.tag));\nPrism.languages.clike={comment:[{pattern:/(^|[^\\\\])\\/\\*[\\s\\S]*?\\*\\//,lookbehind:!0},{pattern:/(^|[^\\\\:])\\/\\/.*/,lookbehind:!0}],string:{pattern:/([\"'])(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,greedy:!0},\"class-name\":{pattern:/((?:\\b(?:class|interface|extends|implements|trait|instanceof|new)\\s+)|(?:catch\\s+\\())[a-z0-9_\\.\\\\]+/i,lookbehind:!0,inside:{punctuation:/(\\.|\\\\)/}},keyword:/\\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\\b/,\"boolean\":/\\b(true|false)\\b/,\"function\":/[a-z0-9_]+(?=\\()/i,number:/\\b-?(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*|\\/|~|\\^|%/,punctuation:/[{}[\\];(),.:]/};\nPrism.languages.javascript=Prism.languages.extend(\"clike\",{keyword:/\\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b/,number:/\\b-?(0[xX][\\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|\\d*\\.?\\d+([Ee][+-]?\\d+)?|NaN|Infinity)\\b/,\"function\":/[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*(?=\\()/i,operator:/-[-=]?|\\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\\|[|=]?|\\*\\*?=?|\\/=?|~|\\^=?|%=?|\\?|\\.{3}/}),Prism.languages.insertBefore(\"javascript\",\"keyword\",{regex:{pattern:/(^|[^\\/])\\/(?!\\/)(\\[[^\\]\\r\\n]+]|\\\\.|[^\\/\\\\\\[\\r\\n])+\\/[gimyu]{0,5}(?=\\s*($|[\\r\\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore(\"javascript\",\"string\",{\"template-string\":{pattern:/`(?:\\\\\\\\|\\\\?[^\\\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\\$\\{[^}]+\\}/,inside:{\"interpolation-punctuation\":{pattern:/^\\$\\{|\\}$/,alias:\"punctuation\"},rest:Prism.languages.javascript}},string:/[\\s\\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore(\"markup\",\"tag\",{script:{pattern:/()[\\s\\S]*?(?=<\\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:\"language-javascript\"}}),Prism.languages.js=Prism.languages.javascript;\nPrism.languages.json={property:/\"(?:\\\\.|[^\\\\\"])*\"(?=\\s*:)/gi,string:/\"(?!:)(?:\\\\.|[^\\\\\"])*\"(?!:)/g,number:/\\b-?(0x[\\dA-Fa-f]+|\\d*\\.?\\d+([Ee][+-]?\\d+)?)\\b/g,punctuation:/[{}[\\]);,]/g,operator:/:/g,\"boolean\":/\\b(true|false)\\b/gi,\"null\":/\\bnull\\b/gi},Prism.languages.jsonp=Prism.languages.json;\n!function(a){var e=a.util.clone(a.languages.javascript);a.languages.jsx=a.languages.extend(\"markup\",e),a.languages.jsx.tag.pattern=/<\\/?[\\w\\.:-]+\\s*(?:\\s+(?:[\\w\\.:-]+(?:=(?:(\"|')(\\\\?[\\s\\S])*?\\1|[^\\s'\">=]+|(\\{[\\s\\S]*?\\})))?|\\{\\.{3}\\w+\\}))*\\s*\\/?>/i,a.languages.jsx.tag.inside[\"attr-value\"].pattern=/=(?!\\{)(?:('|\")[\\s\\S]*?(\\1)|[^\\s>]+)/i,a.languages.insertBefore(\"inside\",\"attr-name\",{spread:{pattern:/\\{\\.{3}\\w+\\}/,inside:{punctuation:/\\{|\\}|\\./,\"attr-value\":/\\w+/}}},a.languages.jsx.tag);var s=a.util.clone(a.languages.jsx);delete s.punctuation,s=a.languages.insertBefore(\"jsx\",\"operator\",{punctuation:/=(?={)|[{}[\\];(),.:]/},{jsx:s}),a.languages.insertBefore(\"inside\",\"attr-value\",{script:{pattern:/=(\\{(?:\\{[^}]*\\}|[^}])+\\})/i,inside:s,alias:\"language-javascript\"}},a.languages.jsx.tag)}(Prism);\n!function(){if(\"undefined\"!=typeof self&&self.Prism&&self.document&&Function.prototype.bind){var t=function(t){var e=0,s=0,i=t;if(i.parentNode){do e+=i.offsetLeft,s+=i.offsetTop;while((i=i.offsetParent)&&i.nodeType<9);i=t;do e-=i.scrollLeft,s-=i.scrollTop;while((i=i.parentNode)&&!/body/i.test(i.nodeName))}return{top:s,right:innerWidth-e-t.offsetWidth,bottom:innerHeight-s-t.offsetHeight,left:e}},e=/(?:^|\\s)token(?=$|\\s)/,s=/(?:^|\\s)active(?=$|\\s)/g,i=/(?:^|\\s)flipped(?=$|\\s)/g,o=function(t,e,s,i){this._elt=null,this._type=t,this._clsRegexp=RegExp(\"(?:^|\\\\s)\"+t+\"(?=$|\\\\s)\"),this._token=null,this.updater=e,this._mouseout=this.mouseout.bind(this),this.initializer=i;var n=this;s||(s=[\"*\"]),\"Array\"!==Prism.util.type(s)&&(s=[s]),s.forEach(function(t){\"string\"!=typeof t&&(t=t.lang),o.byLanguages[t]||(o.byLanguages[t]=[]),o.byLanguages[t].indexOf(n)<0&&o.byLanguages[t].push(n)}),o.byType[t]=this};o.prototype.init=function(){this._elt||(this._elt=document.createElement(\"div\"),this._elt.className=\"prism-previewer prism-previewer-\"+this._type,document.body.appendChild(this._elt),this.initializer&&this.initializer())},o.prototype.check=function(t){do if(e.test(t.className)&&this._clsRegexp.test(t.className))break;while(t=t.parentNode);t&&t!==this._token&&(this._token=t,this.show())},o.prototype.mouseout=function(){this._token.removeEventListener(\"mouseout\",this._mouseout,!1),this._token=null,this.hide()},o.prototype.show=function(){if(this._elt||this.init(),this._token)if(this.updater.call(this._elt,this._token.textContent)){this._token.addEventListener(\"mouseout\",this._mouseout,!1);var e=t(this._token);this._elt.className+=\" active\",e.top-this._elt.offsetHeight>0?(this._elt.className=this._elt.className.replace(i,\"\"),this._elt.style.top=e.top+\"px\",this._elt.style.bottom=\"\"):(this._elt.className+=\" flipped\",this._elt.style.bottom=e.bottom+\"px\",this._elt.style.top=\"\"),this._elt.style.left=e.left+Math.min(200,this._token.offsetWidth/2)+\"px\"}else this.hide()},o.prototype.hide=function(){this._elt.className=this._elt.className.replace(s,\"\")},o.byLanguages={},o.byType={},o.initEvents=function(t,e){var s=[];o.byLanguages[e]&&(s=s.concat(o.byLanguages[e])),o.byLanguages[\"*\"]&&(s=s.concat(o.byLanguages[\"*\"])),t.addEventListener(\"mouseover\",function(t){var e=t.target;s.forEach(function(t){t.check(e)})},!1)},Prism.plugins.Previewer=o,Prism.hooks.add(\"after-highlight\",function(t){(o.byLanguages[\"*\"]||o.byLanguages[t.language])&&o.initEvents(t.element,t.language)})}}();\n\n","var api = require(\"!../../node_modules/@storybook/builder-webpack4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js??ref--7-1!../../node_modules/postcss-loader/dist/cjs.js??ref--7-2!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import './assets/prism';\nimport './assets/normalize.css';\n// import './assets/skeleton.css';\nimport './assets/prism.css';\nimport './assets/styles.css';\n\nimport '@codesandbox/sandpack-react/dist/index.css';\n\nimport { addParameters, addDecorator } from '@storybook/react';\nimport { addReadme, configureReadme } from 'storybook-readme';\nimport { create } from '@storybook/theming/create';\nimport { themes } from '@storybook/theming';\nimport { version } from '../package.json';\n\n// const availableCodeThemes = [\n// 'a11y-dark',\n// 'atom-dark',\n// 'base16-ateliersulphurpool.light',\n// 'cb',\n// 'darcula',\n// 'duotone-dark',\n// 'duotone-earth',\n// 'duotone-forest',\n// 'duotone-light',\n// 'duotone-sea',\n// 'duotone-space',\n// 'ghcolors',\n// 'github',\n// 'hopscotch',\n// 'pojoaque',\n// 'vs',\n// 'xonokai',\n// ];\n\n// TMEME SHIT\n\nconst theme = create({\n base: 'light',\n brandTitle: 'Informed',\n brandTitle: `Informed v${version}`,\n brandUrl: 'https://teslamotors.github.io/informed',\n // brandImage: 'https://placehold.it/350x150',\n // brandImage: '/InformedLogo.png'\n // brandImage: '/informed-car.png'\n brandImage: 'car-on-informed.png'\n\n //colorPrimary: 'hotpink',\n //colorSecondary: 'deepskyblue',\n\n // UI\n // appBg: 'white',\n // appContentBg: 'silver',\n // appBorderColor: 'grey',\n // appBorderRadius: 4,\n\n // Typography\n // fontBase: '\"Open Sans\", sans-serif',\n // fontCode: 'monospace',\n\n // Text colors\n //textColor: 'white',\n //textInverseColor: 'rgba(255,255,255,0.9)',\n\n // Toolbar default and active colors\n // barTextColor: 'silver',\n // barSelectedColor: 'black',\n // barBg: 'hotpink',\n\n // Form colors\n // inputBg: 'white',\n // inputBorder: 'silver',\n // inputTextColor: 'black',\n // inputBorderRadius: 4,\n});\n\n// README SHIT\naddParameters({\n readme: {\n /**\n * Prism code theme\n * Full list of theme https://github.com/PrismJS/prism-themes\n * To be used with storybook-readme, naming of the code theme should be used in one of these styles. https://github.com/tuchk4/storybook-readme/tree/master/packages/storybook-readme/src/styles/prismCodeThemes\n */\n //codeTheme: 'a11y-dark',\n //highlightContent: true\n },\n darkMode: {\n // Set the initial theme\n // current: 'dark',\n darkClass: 'informed-black',\n lightClass: 'informed-white',\n stylePreview: true,\n // Override the default dark theme\n dark: { ...theme, ...themes.dark },\n // Override the default light theme\n light: { ...themes.light, ...theme }\n }\n});\n\n// configureReadme({\n// StoryPreview: ({ children }) => (\n//
{children}
\n// ),\n// DocPreview: ({ children }) => (\n//
{children}
\n// )\n// });\n\naddDecorator(addReadme);\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/* eslint-disable import/no-unresolved */\nimport { addDecorator, addParameters, addLoader, addArgs, addArgTypes, addArgsEnhancer, addArgTypesEnhancer, setGlobalRender } from '/Users/jpuzzo/Documents/Dev/JS/informed/node_modules/@storybook/client-api';\nimport * as config from '/Users/jpuzzo/Documents/Dev/JS/informed/.storybook/preview.js';\nObject.keys(config).forEach(function (key) {\n var value = config[key];\n\n switch (key) {\n case 'args':\n {\n return addArgs(value);\n }\n\n case 'argTypes':\n {\n return addArgTypes(value);\n }\n\n case 'decorators':\n {\n return value.forEach(function (decorator) {\n return addDecorator(decorator, false);\n });\n }\n\n case 'loaders':\n {\n return value.forEach(function (loader) {\n return addLoader(loader, false);\n });\n }\n\n case 'parameters':\n {\n return addParameters(_objectSpread({}, value), false);\n }\n\n case 'argTypesEnhancers':\n {\n return value.forEach(function (enhancer) {\n return addArgTypesEnhancer(enhancer);\n });\n }\n\n case 'argsEnhancers':\n {\n return value.forEach(function (enhancer) {\n return addArgsEnhancer(enhancer);\n });\n }\n\n case 'render':\n {\n return setGlobalRender(value);\n }\n\n case 'globals':\n case 'globalTypes':\n {\n var v = {};\n v[key] = value;\n return addParameters(v, false);\n }\n\n case '__namedExportsOrder':\n case 'decorateStory':\n case 'renderToDOM':\n {\n return null; // This key is not handled directly in v6 mode.\n }\n\n default:\n {\n // eslint-disable-next-line prefer-template\n return console.log(key + ' was not supported :( !');\n }\n }\n});","export default \"## 4.37.0 (Nov 29th, 2022)\\n\\n- added ability to pass `keep` to form fields such that users can specify specific state to keep\\n\\n```js\\n// Example where we only keep value\\n\\n\\n```\\n\\n## 4.36.2 (Nov 9th, 2022)\\n\\n- removed console log from FormController\\n\\n## 4.36.1 (Nov 3rd, 2022)\\n\\n- added missing type for useArrayFieldItemState\\n\\n## 4.36.0 (Nov 1st, 2022)\\n\\n- array fields add and remove now trigger onValueSet\\n\\n## 4.35.2 (Oct 26th, 2022)\\n\\n- multistep type improvements\\n\\n## 4.35.1 (Oct 25th, 2022)\\n\\n- fixed issue where gatherOnMount would not gather after a reset\\n\\n## 4.35.0 (Oct 19th, 2022)\\n\\n- added ability to setValueQuietly\\n\\n## 4.34.0 (Oct 13th, 2022)\\n\\n- added useInformedApi that will allow user to manipulate multiple forms\\n\\n## 4.33.0 (Oct 11th, 2022)\\n\\n- added ability to remove specific index from array field api\\n\\n## 4.32.0 (Sep 30th, 2022)\\n\\n- added ability to disable and enable the form via formApi\\n\\n## 4.31.4 (Sep 22nd, 2022)\\n\\n- array fields dirt now gets set when a user adds or removes\\n\\n## 4.31.3 (Sep 22nd, 2022)\\n\\n- Fixed issue where react strict mode and 18 would not cleanup fields values when they were unmounted\\n\\n## 4.31.2 (Sep 20th, 2022)\\n\\n- Fixed issue where reseting array fields with new initial values would still use old ones\\n\\n## 4.31.1 (Sep 19th, 2022)\\n\\n- When formatting using createIntlNumberFormatter and currencySign being accounting () would not trigger negative\\n\\n```js\\n// When user types -2 or ($2) it would not format correctly\\nconst { formatter, parser } = utils.createIntlNumberFormatter('en-US', {\\n style: 'currency',\\n currency: 'USD',\\n currencySign: 'accounting'\\n});\\n```\\n\\n## 4.31.0 (Sep 14th, 2022)\\n\\n- Form now gets set to dirty when a user performs an add operation on an array field\\n\\n## 4.30.1 (Sep 12th, 2022)\\n\\n- Fixed issue with mask prop not masking last character\\n\\n## 4.30.0 (Sep 11th, 2022)\\n\\n- Added mask prop back to inputs!!!!!\\n\\n## 4.29.1 (Sep 8th, 2022)\\n\\n- Fixed useFormStateSelector when using SSR\\n\\n## 4.29.0 (August 30th, 2022)\\n\\n- added onValueSet to form that only gets called when the value is explicitly set\\n\\n## 4.28.9 (August 30th, 2022)\\n\\n- Fixed issue where validateOnMount would not trigger when the fields were reset to their initial state\\n\\n## 4.28.8 (August 25th, 2022)\\n\\n- Fixed issue where async validate would not trigger when you pass relevance prop to input and input becomes relevant\\n\\n## 4.28.7 (August 24th, 2022)\\n\\n- Fixed issue where locales that use comma instead of dot for fractions would not properly format for thousands\\n\\n## 4.28.6 (August 23nd, 2022)\\n\\n- Fixed issue where if form was reset array field with defualt values would not reset to the default values\\n\\n## 4.28.5 (August 22nd, 2022)\\n\\n- Fixed issue where showErrorIfDirty would not show error if touched\\n\\n## 4.28.4 (August 19th, 2022)\\n\\n- Fixed issue where useFieldSubscription would not spread fields to the useEffect causing potential infinate loops\\n\\n## 4.28.3 (August 15th, 2022)\\n\\n- Fixed issue where user would type the decimalChar in intl number formatter\\n\\n## 4.28.2 (August 10th, 2022)\\n\\n- Added mising types https://github.com/teslamotors/informed/pull/415\\n\\n## 4.28.1 (August 10th, 2022)\\n\\n- Fixed issue with number formatter when inititial value is number\\n\\n## 4.28.0 (August 5th, 2022)\\n\\n- Added ability to pass default values to array fields\\n\\n## 4.27.0 (August 4th, 2022)\\n\\n- Added `useFormStateSelector` hook\\n\\n## 4.26.0 (August 3rd, 2022)\\n\\n- Added ability to get field name from onValueModified and onValueChange props to form\\n\\n## 4.25.0 (August 2nd, 2022)\\n\\n- Added disabled prop back onto form props\\n\\n## 4.24.0 (August 1st, 2022)\\n\\n- Added useInformed to get access to any controller\\n\\n## 4.23.0 (July 31st, 2022)\\n\\n- Added useArrayFieldState\\n\\n## 4.22.0 (July 29th, 2022)\\n\\n- Added ability to pass focusOnInvalid to the form and also added focusFirstError to formApi\\n\\n## 4.21.0 (July 19th, 2022)\\n\\n- Added ability to pass clean function to inputs\\n\\n## 4.20.1 (July 14th, 2022)\\n\\n- Fixed issue where evaluate in useConditional would not trigger when form was reset\\n\\n## 4.20.0 (July 11th, 2022)\\n\\n### Added\\n\\n- ability to pass oneOf as an if condition to schemas\\n- ability to match fields whos values are arrays with enum in schema conditions\\n\\n```js\\nallOf: [\\n {\\n if: {\\n properties: {\\n cars: { oneOf: ['tesla', 'jeep'] }\\n },\\n required: ['cars']\\n },\\n then: {\\n properties: {\\n carName: {\\n type: 'string',\\n title: 'Cars name',\\n 'ui:control': 'input'\\n }\\n }\\n }\\n }\\n];\\n```\\n\\n## 4.19.3 (July 5th, 2022)\\n\\n### Fixed\\n\\n- fixes #411 bad type definition for onSubmit\\n\\n## 4.19.2 (July 5th, 2022)\\n\\n### Updated\\n\\n- package.json to allow react 18 as peer dep\\n\\n## 4.19.1 (June 24th, 2022)\\n\\n### Fixed\\n\\n- issue whith useArray field where if initial value was not array it would crash\\n\\n## 4.19.0 (June 22nd, 2022)\\n\\n### Added\\n\\n- onValueChange prop to fields\\n\\n## 4.18.2 (June 22nd, 2022)\\n\\n### Fixed\\n\\n- issue with key in FormField, this issue can be seen when you have changing schema\\n\\n## 4.18.1 (June 21st, 2022)\\n\\n### Updated\\n\\n- README to have correct urls\\n\\n## 4.18.0 (June15th, 2022)\\n\\n### Added\\n\\n- ability to `if: { properties: { status: {const: [\\\"active\\\"]} } },` in schema ( support array conditions )\\n\\n## 4.17.0 (June 12th, 2022)\\n\\n### Added\\n\\n- resetPath to form api to allow user to pass in path to reset all fields that live under that path\\n\\n## 4.16.2 (June 9th, 2022)\\n\\n### Fixed\\n\\n- issue where react 18 with strict mode would kill useStateWithGetter function ( relevance was broken )\\n\\n## 4.16.1 (June 3rd, 2022)\\n\\n### Fixed\\n\\n- issue where changing schema options would not reset value\\n\\n## 4.16.0 (June 2nd, 2022)\\n\\n### Added\\n\\n- ability get formApi formState and scope in validate function\\n\\n## 4.15.0 (June 2nd, 2022)\\n\\n### Added\\n\\n- ability to pass a function as validateWhen\\n\\n```js\\nvalidateWhen={ scope => `${scope.fieldName}`}\\n```\\n\\n## 4.14.0 (May 26th, 2022)\\n\\n### Added\\n\\n- `validateModified` prop to form so lib will only perform validation on modified fields\\n\\n## 4.13.1 (May 25th, 2022)\\n\\n### Fixed\\n\\n- issue where decimal was getting added when formatter explicitly was told not to add\\n\\n```js\\nutils.createIntlNumberFormatter('en-US', {\\n style: 'decimal',\\n signDisplay: 'never',\\n minimumFractionDigits: 0,\\n maximumFractionDigits: 0\\n});\\n```\\n\\n## 4.12.1 (May 12th, 2022)\\n\\n### Fixed\\n\\n- issue with missing types Debug and Schema Fields\\n\\n## 4.12.0 (May 12th, 2022)\\n\\n### Fixed\\n\\n- issue with isChild\\n\\n### Added\\n\\n- hidden field back to default exported components\\n\\n## 4.11.4 (May 4th, 2022)\\n\\n### Fixed\\n\\n- issue where Relevance inside of Relevance might prevent cleanup on form state\\n\\n## 4.11.3 (May 2nd, 2022)\\n\\n### Fixed\\n\\n- issue where nested array fields removal would break\\n\\n## 4.11.2 (April 29th, 2022)\\n\\n### Fixed\\n\\n- issue where custom error messages did not work in allOf\\n- issue where required:[] on allOf was not working\\n\\n## 4.11.1 (April 28th, 2022)\\n\\n### Fixed\\n\\n-issue where zero ( 0 ) would not work for minimum and maximum due to bad falsey check lol classic\\n\\n## 4.11.0 (April 28th, 2022)\\n\\n### Added\\n\\n- onNativeChange handler to useField\\n\\n## 4.10.0 (April 27th, 2022)\\n\\n### Added\\n\\n- onValid and onInvalid to useForm\\n\\n## 4.9.4 (April 19th, 2022)\\n\\n### Fixed\\n\\n- issue where we would not pass all options to intl formatter\\n\\n## 4.9.3 (April 13th, 2022)\\n\\n### Fixed\\n\\n- issue where after a gather data the field-value event would not get triggered so evaluate would never get called\\n\\n## 4.9.2 (April 13th, 2022)\\n\\n### Fixed\\n\\n- issue where FormComponents was not rendering from components option\\n\\n## 4.9.1 (April 12th, 2022)\\n\\n### Fixed\\n\\n- issue where modified would NOT be correct when allowEmptyString was passed\\n\\n## 4.9.0 (April 12th, 2022)\\n\\n### Added\\n\\n- `formState.modified`\\n- `fieldState.modified`\\n\\n## 4.8.1 (April 4th, 2022)\\n\\n### Fixed\\n\\n- Issue where errors would get kept when going to previous multistep step\\n\\n## 4.8.0 (March 31st, 2022)\\n\\n### Added\\n\\n- useConditional hook and ability to pass `evaluate` and `evaluateWhen`\\n\\n## 4.7.0 (March 29th, 2022)\\n\\n### Added\\n\\n- ability to pass gatherOnMount to a field\\n\\n## 4.6.1 (March 22nd, 2022)\\n\\n### Fixed\\n\\n- misnamed `gatherData` prop\\n\\n## 4.6.0 (March 22nd, 2022)\\n\\n### Added\\n\\n- `gatherData` prop to allow user to get asnyc information for a field\\n\\n## 4.5.12 (March 22nd, 2022)\\n\\n### Fixed\\n\\n- Missing types for default exported fields\\n- Missing type for `required`\\n\\n## 4.5.11 (March 20th, 2022)\\n\\n### Fixed\\n\\n- issue where allowEmptyString and allowEmptyStrings where broken\\n\\n## 4.5.10 (March 18th, 2022)\\n\\n### Fixed\\n\\n- issue where `step` was missing from multistep type\\n\\n## 4.5.9 (March 18th, 2022)\\n\\n### Fixed\\n\\n- issue with propertyOrder in nested schemas\\n\\n## 4.5.8 (March 18th, 2022)\\n\\n### Fixed\\n\\n- issue with more than double nested schemas\\n- issue with Multistep.Step types\\n\\n## 4.5.7 (March 9th, 2022)\\n\\n### Fixed\\n\\n- issue with changing options on schema fields ( undefined would clobber defined values in option merge )\\n\\n## 4.5.6 (March 8th, 2022)\\n\\n### Fixed\\n\\n- issue where changing validation params would not rebuild validation function\\n\\n## 4.5.5 (March 8th, 2022)\\n\\n### Fixed\\n\\n- issue where multistep steps would not deregister\\n\\n## 4.5.4 (Feb 28th, 2022)\\n\\n### Fixed\\n\\n- issue where multistep steps would not clean up after themselves\\n\\n## 4.5.3 (Feb 22th, 2022)\\n\\n### Fixed\\n\\n- issue with touchAllFields not touching fields within an array\\n\\n## 4.5.2 (Feb 18th, 2022)\\n\\n### Fixed\\n\\n- Another Issue with debugger in react native that caused crash\\n\\n## 4.5.1 (Feb 16th, 2022)\\n\\n### Fixed\\n\\n- Issue with debugger in react native\\n\\n## 4.5.0 (Feb 16th, 2022)\\n\\n### Added\\n\\n- onValueModified prop to useForm\\n\\n## 4.4.0 (Feb 15th, 2022)\\n\\n### Added\\n\\n- ability to pass reset options to reset field\\n\\n## 4.3.0 (Feb 15th, 2022)\\n\\n### Added\\n\\n- onValueChange prop to useForm\\n\\n## 4.2.0 (Feb 10th, 2022)\\n\\n### Added\\n\\n- Ability to add n items to array field by passing add(3) a number to add\\n\\n## 4.1.2 (Feb 10th, 2022)\\n\\n### Fixed\\n\\n- Missing form level option for keepState and keepStateIfRelevant\\n\\n## 4.1.1 (Feb 9th, 2022)\\n\\n### Fixed\\n\\n- Stupid issue with safari throwing a type error when trying to check for selectionStart on event.target\\n\\n## 4.1.0 (Feb 8th, 2022)\\n\\n### Added\\n\\n- Ability to use state across multiple forms\\n\\n## 4.0.35 (Feb 8th, 2022)\\n\\n### Fixed\\n\\n- missing types for multistep and formApi\\n\\n## 4.0.34 (Feb 4th, 2022)\\n\\n### Fixed\\n\\n- issue with INTL formatter when used with `EUR` and `en-DE`\\n\\n## 4.0.33 (Feb 3rd, 2022)\\n\\n### Fixed\\n\\n- issue with formatter function not allowing full value\\n\\n## 4.0.32 (January 26th, 2022)\\n\\n### Fixed\\n\\n- issue with FormField not allowing conditional fields\\n\\n## 4.0.31 (January 25th, 2022)\\n\\n### Fixes https://github.com/teslamotors/informed/issues/381\\n\\n- autoFocus on Input throws error\\n\\n## 4.0.30 (January 24th, 2022)\\n\\n### Added\\n\\n- propertyOrder back to schema\\n\\n## 4.0.29 (January 20th, 2022)\\n\\n### Added\\n\\n- asyncValidate to formApi\\n\\n## 4.0.28 (January 18th, 2022)\\n\\n### Fixed\\n\\n- issue with cursor offsets when suffix is added\\n\\n## 4.0.27 (January 14th, 2022)\\n\\n### Fixed\\n\\n- issue with negative cursor offsets\\n\\n### Fixed\\n\\n- issue with off by one cursor locations on formatter\\n\\n## 4.0.25 (January 14th, 2022)\\n\\n### Fixed\\n\\n- createIntlNumberFormatter not working with negative numbers\\n\\n## 4.0.24 (January 7th, 2022)\\n\\n### Added\\n\\n- clearValue() function to form and field apis\\n\\n### Fixed\\n\\n- Issue where validateOnMount would NOT trigger validation when a field was re-rendered\\n\\n## 4.0.23 (January 5th, 2022)\\n\\n### Fixed\\n\\n- issue with array field items being memoized\\n\\n## 4.0.22 (January 5th, 2022)\\n\\n### Fixed\\n\\n- issue with createIntlNumber mask adding random \\\"[]\\\" sometimes\\n\\n## 4.0.21 (January 5th, 2022)\\n\\n### Fixed\\n\\n- issue where returning \\\"\\\" from validation function would not show error state\\n\\n## 4.0.20 (January 4th, 2022)\\n\\n### Fixed\\n\\n- issue where removing item from array field would not make the form dirty\\n\\n## 4.0.19 (December 31st, 2021)\\n\\n### Exposed\\n\\n- useRelevance hook and added type for it in types\\n\\n## 4.0.18 (December 23rd, 2021)\\n\\n### Fixed\\n\\n- issue where values would get cleared on un-mount\\n\\n## 4.0.17 (December 17th, 2021)\\n\\n### Fixed\\n\\n- issue where I forgot to deregister fields when they became irrelevant\\n\\n## 4.0.16 (December 17th, 2021)\\n\\n### Fixed\\n\\n- issue where I forgot to allow relevanceDeps to be passed to multistep step\\n\\n## 4.0.15 (December 15th, 2021)\\n\\n### Moved\\n\\n- The repo to tesla or go needed to re publish to get updated README to npm\\n\\n## 4.0.14 (December 15th, 2021)\\n\\n### Fixed\\n\\n- forgot to add getCurrentStep to multistepApi\\n- forgot to add nextStep and previousStep to multistepState\\n\\n## 4.0.13 (December 15th, 2021)\\n\\n### Fixed\\n\\n- issue where set touched did not default meta when field is not there\\n\\n## 4.0.12 (December 15th, 2021)\\n\\n### Fixed\\n\\n- issue where `FormField` could not take field props\\n\\n## 4.0.11 (December 15th, 2021)\\n\\n### Fixed\\n\\n- missing type for Relevant\\n\\n## 4.0.10 (December 15th, 2021)\\n\\n### Fixed\\n\\n- issue where FormProvider was not exported\\n\\n## 4.0.9 (December 13th, 2021)\\n\\n### Fixed\\n\\n- issue where passing showErrorIfTouched={false} would not work\\n\\n## 4.0.8 (December 10th, 2021)\\n\\n### Removed\\n\\n- Empty dependencies object from package.json\\n\\n## 4.0.7 (December 10th, 2021)\\n\\n### Fixed\\n\\n- Issue with relevance subscription when no relevance function\\n\\n## 4.0.6 (December 9th, 2021)\\n\\n### Fixed\\n\\n- Missing functions setValues and setTheseValues\\n\\n## 4.0.5 (December 9th, 2021)\\n\\n### Fixed\\n\\n- Missing types for validate and validateField on FormApi\\n\\n## 4.0.4 (December 9th, 2021)\\n\\n### Fixed\\n\\n- Issue where we forgot to expose form validate\\n- Missing utils types\\n\\n## Added\\n\\n- useScope and useScoper to exports\\n\\n## 4.0.3 (December 7th, 2021)\\n\\n### Fixed\\n\\n- Issue with forms valid and invalid when relevance changes\\n\\n## 4.0.2 (December 7th, 2021)\\n\\n### Fixed\\n\\n- Issue with schema path util `inverter[12].air_filter_ok` would not work\\n\\n## 4.0.1 (December 7th, 2021)\\n\\n### Fixed\\n\\n- Issue with initializing when becoming relevant\\n\\n## 4.0 !!!!\\n\\n### Breaking changes\\n\\n#### onSubmit signature\\n\\nOld\\n\\n```\\nconst onSubmit = values => console.log( values );\\n```\\n\\nNew\\n\\n```\\nconst onSubmit = formState => console.log( formState.values );\\n```\\n\\n#### Text --> Input\\n\\nOld\\n\\n```jsx\\n\\n```\\n\\nNew\\n\\n```jsx\\n\\n```\\n\\n#### apiRef --> formApiRef\\n\\nOld\\n\\n```jsx\\n
\\n// OR\\n\\n```\\n\\nNew\\n\\n```jsx\\n\\n```\\n\\n#### informed:props ( schema )\\n\\n```\\ninformed:props is now ui:props when using schema based forms\\n```\\n\\n#### `asField` has been removed\\n\\nInstead of doing this\\n\\n```js\\nconst CustomField = asField({ fieldState, fieldApi }) => {}\\n```\\n\\nDo this\\n\\n```js\\nconst CustomField = props => {\\n const { fieldState, fieldApi } = useField(props);\\n};\\n```\\n\\n#### Relevance\\n\\nThe when function for relevance now has this signature\\n\\n```\\nwhen={({formState, formApi, scope}) => {...} }\\n```\\n\\n#### yupSchema\\n\\n```\\nvalidationSchema ---> is now yupSchema\\n```\\n\\n#### Array Fields\\n\\n##### Renamed `field` to `name`\\n\\n```jsx\\n\\n {({ remove, field }) => (\\n <>\\n \\n \\n \\n )}\\n\\n```\\n\\nIs Now\\n\\n```jsx\\n\\n {({ remove, name }) => (\\n <>\\n \\n \\n \\n )}\\n\\n```\\n\\n##### No more array field path prefixing\\n\\nOld:\\n\\n```jsx\\n\\n {({ remove, field }) => (\\n <>\\n \\n \\n \\n \\n )}\\n\\n```\\n\\nNew:\\n\\n```jsx\\n\\n {({ remove }) => (\\n <>\\n \\n \\n \\n \\n )}\\n\\n```\\n\\n##### No more values in array field render prop\\n\\nOld:\\n\\n```jsx\\n// Some component you need to use state of array field item\\nconst FieldState = ({ values }) => {\\n return (\\n
\\n      {JSON.stringify(values, null, 2)}\\n    
\\n );\\n};\\n\\n\\n {({ remove, values }) => (\\n <>\\n \\n \\n \\n \\n \\n )}\\n;\\n```\\n\\nNew:\\n\\n```jsx\\n// Some component you need to use state of array field item\\nconst FieldState = () => {\\n const { values } = useArrayFieldItemState();\\n return (\\n
\\n      {JSON.stringify(values, null, 2)}\\n    
\\n );\\n};\\n\\n\\n {({ remove }) => (\\n <>\\n \\n \\n \\n \\n \\n )}\\n;\\n```\\n\\n#### Debugging with ``\\n\\nOld:\\n\\n```jsx\\n\\n```\\n\\nNew:\\n\\n```jsx\\n\\n```\\n\\n#### Custom Inputs\\n\\nMinor changes to custom inputs\\n\\nNew:\\n\\n```jsx\\nconst CustomInput = props => {\\n const { fieldState, fieldApi, render, ref, userProps } = useField(props);\\n\\n // The field state\\n const { value, error, showError } = fieldState;\\n\\n // The field control\\n const { setValue, setTouched } = fieldApi;\\n\\n // Everything else\\n const { label, id, ...rest } = userProps;\\n\\n return render(\\n <>\\n {label ? : null}\\n {\\n setValue(e.target.value, e);\\n }}\\n onBlur={e => {\\n setTouched(true, e);\\n }}\\n style={showError ? { border: 'solid 1px red' } : null}\\n />\\n {showError ? {error} : null}\\n \\n );\\n};\\n```\\n\\n#### Validation\\n\\nValidation is now controlled via validateOn=\\\"validationString\\\"\\n\\nBy default fields will only validate on blur. To get\\nmore granular validation, simply pass in `validateOn` props.\\n\\nSee table below for mapping:\\n\\n
\\n\\n| validateOn | derived | change | blur | submit | default |\\n| ------------- | ------------- | ------------ | ------------ | ------------ | ------- |\\n| change | change-change | sync + async | sync + async | sync + async | |\\n| blur | blur-blur | x | sync + async | sync + async | x |\\n| change-blur | change-blur | sync | sync + async | sync + async | |\\n| change-submit | change-submit | sync | sync | sync + async | |\\n| blur-submit | submit-submit | x | sync | sync + async | |\\n| submit | submit-submit | x | x | sync + async | |\\n\\n
\\n\\nValidation is controlled via the `validateOn` prop, but in order to control when it shows,\\nuse the `showErrorIfError` and `showErrorIfDirty` props. **This is because sometimes you may want the form to be invalid but not show the error to the user yet ( default is `showErrorIfTouched` )**\\n\\n| prop | description | default |\\n| ------------------ | ------------------------------------------------------------------------------------------------------------ | ------- |\\n| showErrorIfError | will set `showError` for that field to true whenever there is an error (typically used with validateOnMount) | |\\n| showErrorIfTouched | will set `showError` for that field to true whenever there is an error and the field is touched | x |\\n| showErrorIfDirty | will set `showError` for that field to true whenever there is an error and the field is dirty | |\\n\\n
\\n\\nFinally we have a use case for validating right away ( on mount )\\n\\n| prop | description | default |\\n| --------------- | ------------------------------- | ------- |\\n| validateOnMount | will trigger validation onMount | false |\\n\\n
\\n
\\n\\n---\\n\\n
\\n\\n## 3.34.0 (June 22, 2021)\\n\\n### Added\\n\\n- ability to control when async validation occurs with props\\n\\n## 3.33.0 (May 21, 2021)\\n\\n### Added\\n\\n- createIntlNumberFormatter\\n\\n## 3.32.3 (May 21, 2021)\\n\\n### Fixed\\n\\n- Issue with useFieldState, now returns empty object by default\\n\\n## 3.32.2 (May 21, 2021)\\n\\n### Fixed\\n\\n- Issue with mounting useFieldStates\\n\\n## 3.32.1 (May 21, 2021)\\n\\n### Fixed\\n\\n- Issue with layoutEffect in SSR\\n\\n## 3.32.0 (May 19, 2021)\\n\\n### Added\\n\\n- Ability to walk down a multistep with step selection.\\n\\n## 3.31.0 (April 26, 2021)\\n\\n### Added\\n\\n- formatter functions `formatter = [()=>{}, ()=>{}]`\\n\\n## 3.30.3 (April 2, 2021)\\n\\n### Added\\n\\n- memoized render back because I never should have removed it\\n\\n## 3.30.2 (March 15, 2021)\\n\\n### Refactored\\n\\n- To no longer use event emitter.\\n\\n## 3.30.1 (March 5, 2021)\\n\\n### Fixed\\n\\n- Issue where keep state in scope was not working.\\n\\n## 3.30.0 (March 2, 2021)\\n\\n### Added\\n\\n- Pristine and Dirty to formFieldState\\n\\n## 3.29.4 (February 24, 2021)\\n\\n### Updated\\n\\n- Peer deps to support react v 17\\n\\n## 3.29.3 (February 5, 2021)\\n\\n### Fixed\\n\\n- Issue where ObjectMap `has` would reference wrong get funciton fixes #327\\n\\n## 3.29.2 (February 4, 2021)\\n\\n### Fixed\\n\\n- Issue where carrot pos would be in the wrong place when formatting\\n\\n### Updated\\n\\n- `useField` hook to use the `useCarrotPosition` hook ( removed duplicate code )\\n\\n## 3.29.1 (February 4, 2021)\\n\\n### Added\\n\\n- Ability to call `setValue` function for custom formattedObject Inputs\\n\\n## 3.29.0 (February 2, 2021)\\n\\n### Added\\n\\n- Ability to pass `initialize` function for custom initialization of the initial value\\n\\n## 3.28.0 (February 2, 2021)\\n\\n### Exposed\\n\\n- Utils functions that can be used by end users\\n\\n## 3.27.0 (December 18, 2020)\\n\\n### Fixed\\n\\n- bug with update function in form controller where it would pull instead of delete on swap\\n\\n## 3.26.0 (December 17, 2020)\\n\\n### Added\\n\\n- `swap` to array fields\\n\\n### Rafactored\\n\\n- Internal state management\\n\\n## 3.25.0 (December 8, 2020)\\n\\n### Added\\n\\n- `onReset` to form props\\n\\n## 3.24.4 (December 5, 2020)\\n\\n### Updated\\n\\n- README and needed to get it to npm ... again again\\n\\n## 3.24.3 (December 5, 2020)\\n\\n### Updated\\n\\n- README and needed to get it to npm ... again\\n\\n## 3.24.2 (November 24, 2020)\\n\\n### Updated\\n\\n- README and needed to get it to npm\\n\\n## 3.24.1 (November 23, 2020)\\n\\n### Fixed\\n\\n- Type issue ( missing allow empty string from props def )\\n\\n## 3.24.0 (November 19, 2020)\\n\\n### Fixed\\n\\n- Issue where Id was not getting passed to default select field\\n\\n## 3.23.0 (November 18, 2020)\\n\\n### Removed\\n\\n- LODASH!!!!! SEE YA LATER NEVER\\n\\n## 3.22.0 (November 17, 2020)\\n\\n### Added\\n\\n- Ability to pass relevant to array fields!!!\\n\\n## 3.21.2 (November 14, 2020)\\n\\n### Fixed\\n\\n- Bug with field level relevant\\n\\n### Updated\\n\\n- Form to always evaluate relevance, and not force the user to pass notify.\\n\\n## 3.21.1 (November 12, 2020)\\n\\n### Fixed\\n\\n- Isssue where state would not update after submit\\n\\n## 3.21.0 (November 12, 2020)\\n\\n### Added\\n\\n- Ability to add async validation functions to inputs\\n\\n## 3.20.0 (November 11, 2020)\\n\\n### Added\\n\\n- Ability to not pass keep state to multistep fields, and also added docs for conditional relevant nested array fields\\n\\n## 3.19.0 (November 10, 2020)\\n\\n### Added\\n\\n- Ability to hide or show fields based on relevant, and notify relevant fields\\n\\n## 3.18.3 (November 10, 2020)\\n\\n### Fixed\\n\\n- bug with resetting array field items\\n\\n## 3.18.2 (November 9, 2020)\\n\\n### Fixed\\n\\n- bug with duplicate fields\\n\\n## 3.18.1 (November 9, 2020)\\n\\n### Fixed\\n\\n- bug with keep state registering phantom fields\\n\\n## 3.18.0 (November 5, 2020)\\n\\n### Added\\n\\n- ability to create custom schema fields\\n\\n## 3.17.1 (November 3, 2020)\\n\\n### Fixed\\n\\n- useField was not adding id to label by default\\n\\n## 3.17.0 (November 3, 2020)\\n\\n### Added\\n\\n- Required attribute to input and automatic type generation for useField hook\\n\\n## 3.16.1 (November 2, 2020)\\n\\n### Fixed\\n\\n- Issue where informed props were not passed down to array fields in schema\\n\\n## 3.16.0 (November 1, 2020)\\n\\n### Added\\n\\n- Ability to have conditional schemas!!!!\\n\\n## 3.15.0 (October 28, 2020)\\n\\n### Added\\n\\n- Ability to add array fields in schema!!!!\\n\\n## 3.14.0 (October 27, 2020)\\n\\n### Added\\n\\n- Formatter and Parser !!!!!\\n\\n## 3.13.2 (October 27, 2020)\\n\\n### Fixed\\n\\n- Issue with strict mode double registering\\n\\n## 3.13.1 (October 23, 2020)\\n\\n### Fixed\\n\\n- Bug where inforemd would crash if schema was missing field that was in JSX ( returns null )\\n\\n## 3.13.0 (October 23, 2020)\\n\\n### Added\\n\\n- Ability to render schema fields in specific paces within JSX!!\\n\\n## 3.12.0 (October 22, 2020)\\n\\n### Added\\n\\n- Added AJV Schema shit!!!\\n\\n## 3.11.0 (October 21, 2020)\\n\\n### Added\\n\\n- Schema shit\\n\\n## 3.10.1 (October 18, 2020)\\n\\n### Fixed\\n\\n- Array fields because I stupidly broke them\\n\\n#### Added\\n\\n- Tests for multistep fields\\n- Better multistep form syntax\\n- Better multistep docs\\n\\n## 3.10.0 (September 29, 2020)\\n\\n### Updated\\n\\n- internals to modify state direct to improve performance!\\n\\n## 3.9.0 (June 15, 2020)\\n\\n### Updated\\n\\n- useArray field to expose a reset that resets to initial values\\n\\n## 3.8.1 (May 11, 2020)\\n\\n### Fixed\\n\\n- Issue with back and next types for multistep fields\\n\\n## 3.8.0 (May 4, 2020)\\n\\n### Added\\n\\n- Array field Api control for ArrayFieldItems\\n\\n## 3.7.0 (May 4, 2020)\\n\\n### Refactored\\n\\n- To use field ids instead of names\\n\\n### Added\\n\\n- `` component\\n\\n## 3.6.1 (March 2, 2020)\\n\\n### Updated\\n\\n- Type file to include preventEnter on form props\\n\\n## 3.6.0 (March 1, 2020)\\n\\n### Added\\n\\n- Ability to pass formController to useField hook\\n\\n## 3.5.2 (February 28, 2020)\\n\\n### Fixed\\n\\n- [Issue](https://github.com/joepuzzo/informed/issues/275) where new version of react would throw warnings due to bad code\\n\\n## 3.5.1 (February 27, 2020)\\n\\n### Fixed\\n\\n- [Issue](https://github.com/joepuzzo/informed/issues/272) where dynamic nested array fields with keep state kept too much state :)\\n\\n## 3.5.0 (February 25, 2020)\\n\\n### Added\\n\\n- New multistep abilities via setCurrent in `formApi` and `Current` in `formState`. See compex multistep form in docs\\n\\n## 3.4.0 (February 22, 2020)\\n\\n### Added\\n\\n- Ability to spread `informed` object on inputs via the `useField` hook\\n\\n## 3.3.5 (February 22, 2020)\\n\\n### Updated\\n\\n- Readme to show useForm example\\n\\n## 3.3.4 (February 20, 2020)\\n\\n### Added\\n\\n- FormState component to assist when debugging!\\n\\n## 3.3.3 (February 18, 2020)\\n\\n### Added\\n\\n- Types for multisetp forms\\n\\n## 3.3.2 (February 16, 2020)\\n\\n### Added\\n\\n- Ability to use cursor position in mask function\\n\\n## 3.3.1 (February 16, 2020)\\n\\n### Updated\\n\\n- Intro examples to inculde on submit example\\n\\n## 3.3.0 (February 10, 2020)\\n\\n### Added\\n\\n- Field level Yup support\\n\\n## 3.2.1 (February 9, 2020)\\n\\n### Fixed\\n\\n- Typo in yup docs and readme\\n\\n## 3.2.0 (February 9, 2020)\\n\\n### Added\\n\\n- Yup support\\n\\n## 3.1.2 (February 9, 2020)\\n\\n### Updated\\n\\n- docs and readme to link to dicord channel\\n\\n## 3.1.1 (February 8, 2020)\\n\\n### Added\\n\\n- apiRef so you can just pass a ref to the form\\n\\n## 3.1.0 (February 5, 2020)\\n\\n### Added\\n\\n- Step functionality to support multistep forms\\n\\n## 3.0.2 (January 24, 2020)\\n\\n### Fixed\\n\\n- Issue https://github.com/joepuzzo/informed/issues/267\\n\\n## 3.0.1 (January 24, 2020)\\n\\n### Fixed\\n\\n- README ( I wish there was a way on npm to update readme without publishing version )\\n\\n## 3.0.0 (January 24, 2020)\\n\\n### Fixed\\n\\n- Issue with array field validation https://github.com/joepuzzo/informed/issues/259\\n- Issue where informed would throw errors when fields were hidden but referenced\\n\\n### Added\\n\\n- Ability to ( in the near future ) add validations to scopes ( Enabled because of code refacotor... will add soon :)\\n\\n### Changed\\n\\n- The internals to no longer keep track of giant state object but instead generate it on demand\\n\\n### Removed\\n\\n- A bunch of useless code :)\\n\\n#### Cleaned up\\n\\n- Large portion of the code .. Mostly the formController!\\n\\n## 2.11.17 (January 21, 2020)\\n\\n## Update\\n\\n- useField to trigger validation when validation related props change\\n\\n## 2.11.16 (November 18, 2019)\\n\\n## Fixed\\n\\n- issue with array field where validation would fail\\n\\n## 2.11.15 (November 6, 2019)\\n\\n## Fixed\\n\\n- issue with array field where removing multiple fields did not remove the data from state\\n\\n## 2.11.14 (November 5, 2019)\\n\\n## Removed\\n\\n- removable prop to inputs because it was a bad idea... now it supports removal nativley\\n\\n## 2.11.13 (November 4, 2019)\\n\\n## Added\\n\\n- removable prop to inputs ( adds support for pairing keep state and array fields such that remove button actually removes field )\\n\\n## 2.11.12 (November 1, 2019)\\n\\n## Fixed\\n\\n- issue with keep state on array fields\\n\\n## 2.11.11 (November 1, 2019)\\n\\n## Added\\n\\n- comp name to useField hook\\n\\n## 2.11.10 (October 21, 2019)\\n\\n## Added\\n\\n- missing setFormError prop to FormApi interface\\n\\n## 2.11.9 (September 10, 2019)\\n\\n## Added\\n\\n- keepState to types\\n\\n## 2.11.8 (July 16, 2019)\\n\\n## Adds\\n\\n- allowEmptyStrings form level prop to types\\n\\n## 2.11.7 (July 8, 2019)\\n\\n## Fixes\\n\\n- issue 227 where allowEmptyStrings form level prop did not work\\n\\n## 2.11.6 (July 2, 2019)\\n\\n## Fixes\\n\\n- issue 219 where array fields would not work with scope\\n\\n## 2.11.5 (July 2, 2019)\\n\\n## Fixes\\n\\n- issue 225 where validation will occur on mount when there are initial values\\n\\n## 2.11.4 (July 1, 2019)\\n\\n## Fixes\\n\\n- issue 215 where selects dont work in Edge becase .. you know.. Microsoft\\n\\n## 2.11.3 (July 1, 2019)\\n\\n## Fixes\\n\\n- warning with useLayoutEffect when using SSR\\n\\n## 2.11.2 (June 27, 2019)\\n\\n## Updated\\n\\n- README file to include minzipped badge\\n\\n## 2.11.1 (June 18, 2019)\\n\\n## Fixed\\n\\n- Issue where initial values changing on multiselects caused looping .. oops\\n\\n## 2.11.0 (June 14, 2019)\\n\\n## Updated\\n\\n- useForm to return user props and a render method\\n- Form provider to no longer render a `` IT NEVER SHOULD HAVE.\\n\\n## 2.10.2 (June 13, 2019)\\n\\n## Fixed\\n\\n- Issue where initial values did not change when form was reset\\n\\n## 2.10.1 (June 11, 2019)\\n\\n## Fixed\\n\\n- Issue where array level validation would not trigger for complex nested fields within array field\\n\\n## Added\\n\\n- length as a second parameter to arrayFields validate function\\n\\n## 2.10.0 (June 7, 2019)\\n\\n## Added\\n\\n- ability to pass validation function to an array field\\n- arrayFields are now treaded as \\\"shadow\\\" fields\\n\\n## 2.9.0 (June 6, 2019)\\n\\n## Added\\n\\n- useArrayField hook\\n\\n## 2.8.2 (June 5, 2019)\\n\\n## Added\\n\\n- ability to change out form options such as validateFields\\n\\n## 2.8.1 (June 5, 2019)\\n\\n## Fixed\\n\\n- issue with addWithInitialValue when using add and then addWithInitialValue\\n\\n## 2.8.0 (June 5, 2019)\\n\\n## Added\\n\\n- addWithInitialValue to the `ArrayField`\\n\\n## 2.7.8 (May 31, 2019)\\n\\n## Fixed\\n\\n- issue where initial values were not being formatted\\n\\n## 2.7.7 (May 30, 2019)\\n\\n## Fixed\\n\\n- issue where initial values were not being masked\\n\\n## 2.7.6 (May 29, 2019)\\n\\n## Updated\\n\\n- Types file to support validate on formApi\\n\\n## 2.7.5 (May 29, 2019)\\n\\n## Updated\\n\\n- Types file to support any type on form errors\\n\\n## 2.7.4 (May 23, 2019)\\n\\n### Fixed\\n\\n- documentation for creating custom inputs\\n\\n### Added\\n\\n- the ability to pass your own ref to inputs\\n\\n## 2.7.3 (May 22, 2019)\\n\\n### Fixed\\n\\n- issue with validation triggering when keep state and validate on blur\\n\\n## 2.7.2 (May 21, 2019)\\n\\n### Added\\n\\n- made `maskWithCursorOffset` optional in types\\n\\n## 2.7.1 (May 21, 2019)\\n\\n### Added\\n\\n- `maskWithCursorOffset` to the type defs\\n\\n## 2.7.0 (May 21, 2019)\\n\\n### Added\\n\\n- `maskWithCursorOffset` prop to inputs\\n\\n## 2.6.15 (May 20, 2019)\\n\\n### Added\\n\\n- maintainCursor to types\\n\\n## 2.6.14 (May 16, 2019)\\n\\n### Added\\n\\n- render and userProps to field context types\\n\\n## 2.6.13 (May 16, 2019)\\n\\n### Added\\n\\n- maskedValue to types\\n\\n## 2.6.12 (May 14, 2019)\\n\\n### Added\\n\\n- getters to useFields field api\\n\\n## 2.6.11 (May 11, 2019)\\n\\n### Added\\n\\n- useField hook to the docs\\n\\n### Updated\\n\\n- the interface for useField hook\\n\\n## 2.6.10 (May 10, 2019)\\n\\n### Fixed\\n\\n- issue where initialization code in useform was in the effect and not in constructor\\n\\n## 2.6.9 (May 10, 2019)\\n\\n### Fixed\\n\\n- attempting to fix issue that I think is caused by useEffect in useForm hook\\n\\n## 2.6.8 (May 10, 2019)\\n\\n### Fixed\\n\\n- issues cause by using `useMemo` instead of `useState` for initial render stuff\\n\\n## 2.6.7 (May 9, 2019)\\n\\n### Added\\n\\n- exists function to the field api types\\n\\n## 2.6.6 (May 9, 2019)\\n\\n### Added\\n\\n- exists function to the field api so you can check to see if that field exists\\n\\n## 2.6.5 (May 9, 2019)\\n\\n### Fixed\\n\\n- issue where inital render of useFieldApi would fail when field was not registered yet\\n\\n## 2.6.4 (May 9, 2019)\\n\\n### Updated\\n\\n- useForm hook so that the event handlers can change\\n\\n## 2.6.3 (May 7, 2019)\\n\\n### Removed\\n\\n- debug as a dependency and added my own :)\\n\\n## 2.6.2 (May 3, 2019)\\n\\n### Fixed\\n\\n- issue with default register context missin getField function\\n\\n## 2.6.1 (May 3, 2019)\\n\\n### Fixed\\n\\n- issue with `useFieldApi` hook and `withFieldApi` HOC where reset and validate were not there\\n\\n### Added\\n\\n- a few more tests to increase test coverage!!!! wooo\\n\\n## 2.6.0 (May 2, 2019)\\n\\n### Added\\n\\n- `useForm` hook!!! and `FormProvider` component!!!\\n\\n## 2.5.0 (April 30, 2019)\\n\\n### Updated\\n\\n- useField hook to useEffect instead of useLayoutEffect\\n\\n## 2.4.0 (April 30, 2019)\\n\\n### Added\\n\\n- preventEnter prop to the form so users can prevent enter key form submission\\n\\n## 2.3.2 (April 22, 2019)\\n\\n### Updated\\n\\n- Issue with dynamic arrays and initial values\\n\\n## 2.3.1 (April 12, 2019)\\n\\n### Updated\\n\\n- Babel build\\n\\n## 2.3.0 (April 3, 2019)\\n\\n### Added\\n\\n- `allowEmtyStrings` prop to the form\\n- `allowEmtyString` prop to inputs\\n\\n### Fixed\\n\\n- issue where setValues would not allow empty strings\\n\\n## 2.2.0 (March 29, 2019)\\n\\n### Added\\n\\n- `setFormError` function to the form api\\n- `validate` function to the form api\\n\\n## 2.1.15 (March 28, 2019)\\n\\n### Fixed\\n\\n- Issue with setValues missing from the default context\\n\\n## 2.1.14 (March 27, 2019)\\n\\n### Fixed\\n\\n- Issue where reset would call validation\\n\\n## 2.1.13 (March 18, 2019)\\n\\n### Updated\\n\\n- Allowing for optional generic on FormValue\\n\\n## 2.1.12 (March 13, 2019)\\n\\n### Updated\\n\\n- ref to be any type in typings\\n\\n## 2.1.11 (March 12, 2019)\\n\\n### Fixed\\n\\n- issue in typings for ref field on FieldContext\\n\\n## 2.1.10 (March 12, 2019)\\n\\n### Fixed\\n\\n- issue when using a field NOT in the context of a form\\n\\n## 2.1.9 (March 8, 2019)\\n\\n### Fixed\\n\\n- another issue where initial values did not work when keep state was passed\\n\\n## 2.1.8 (March 8, 2019)\\n\\n### Fixed\\n\\n- issue where initial values did not work when keep state was passed\\n\\n## 2.1.7 (March 3, 2019)\\n\\n### Fixed\\n\\n- issue where initial values did not work for `ArrayFields`\\n\\n## 2.1.6 (Feb 21, 2019)\\n\\n### Updated\\n\\n- typing files for type script users\\n\\n## 2.1.5 (Feb 19, 2019)\\n\\n### Fixed\\n\\n- Issue with text area input not setting typed value\\n\\n## 2.1.4 (Feb 19, 2019)\\n\\n### Added\\n\\n- `maskOnBlur` prop to inputs\\n\\n## 2.1.3 (Feb 14, 2019)\\n\\n### Added\\n\\n- `fieldExists` api function to check if field exists\\n\\n## 2.1.2 (Feb 14, 2019)\\n\\n### Fixed\\n\\n- Issue where form that is submitted through enter key would try to prevent default\\n\\n## 2.1.1 (Feb 14, 2019)\\n\\n### Fixed\\n\\n- Issue where form values would not get passed to validation function when touched\\n\\n## 2.1.0 (Feb 14, 2019)\\n\\n### Updated\\n\\n- Format and parse to set maskedValue instead of value\\n\\n## 2.0.5 (Feb 14, 2019)\\n\\n### Fixed\\n\\n- Issue where you could NOT set 0 null or false as initial values because they are falsey\\n\\n## 2.0.4 (Feb 13, 2019)\\n\\n### Added\\n\\n- validateFields function to the form!!!\\n\\n## 2.0.3 (Feb 13, 2019)\\n\\n### Fixed\\n\\n- Issue where reset would not work for scoped fields\\n\\n### Added\\n\\n- Set Values to the form api!!!\\n\\n## 2.0.2 (Feb 13, 2019)\\n\\n### Fixed\\n\\n- Issue where ArrayField was prefixing all fields with 'field'\\n- Issue where when input fields changed input did not rerender.\\n\\n## 2.0.1 (Feb 10, 2019)\\n\\n### Fixed\\n\\n- Issue where render and component props were getting passed to the dom form\\n\\n## 2.0.0 (Feb 7, 2019)\\n\\n### Added\\n\\n- useFieldApi\\n- useFieldState\\n- useFormApi\\n- useFormState\\n- useField\\n- format\\n- parse\\n- maintianCursor ( fixes issue where cursor jumps to end on mask )\\n- ArrayField ( Check out the docs! this is sick! )\\n- Form Level validation ( function that can invalidate the form as a whole )\\n- debug prop that allows you to visually view the rendering!\\n\\n### Changed\\n\\n- the field `\\\"siblings.1\\\"` now resolves to `values.siblings[1]`, it used to resolve to `values.siblings.1`\\n- the field `\\\"siblings['2']\\\"` now resolves to `values.siblings[2]`, it used to resolve to `values.siblings.2`\\n- withFormApi will no longer trigger a rerender if the fomrs state changes. This is a great optimization for those who want to modify but dont care about the form state!\\n- the `validate` prop now expects the validation function to return `undefined` if there is no error. Any other returned value (including falsey `null`, `0`, etc will be treated as an error for the field.\\n\\n### Removed\\n\\n- The Field Component\\n- `fieldExists` not needed\\n- `setState` will maybe add later but its complex and out of scope ATM\\n- `setValues` will maybe add later but its complex and out of scope ATM ( as of V 2.0.3 its back! )\\n- `preSubmit` was never needed.. developers can do this themselves\\n- Async Validation. Async validation led to many issues that overcomplicated `informed`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\\n\\n## 1.10.12 ( December 4, 2018 )\\n\\n### Updated\\n\\n- typescript definition file\\n\\n## 1.10.11 & 1.10.10 I ran version patch twice lol ( December 4, 2018 )\\n\\n### Updated\\n\\n- Select forward ref\\n\\n## 1.10.9 ( November 16, 2018 )\\n\\n### Updated\\n\\n- files in package json to include typeigs\\n\\n## 1.10.8 ( November 8, 2018 )\\n\\n### Added\\n\\n- type file for typescript\\n\\n## 1.10.7 ( October 11, 2018 )\\n\\n### Updated\\n\\n- Name of withFormSate\\n\\n## 1.10.6 ( October 2, 2018 )\\n\\n### Fixed\\n\\n- Skipped test for select!!!\\n\\n### Updated\\n\\n- Select to use new ref interface\\n\\n## 1.10.5 ( September 14, 2018 )\\n\\n### Added\\n\\n- License\\n\\n## 1.10.4 ( August 13, 2018 )\\n\\n### Fixed\\n\\n- Issue with @babel/runtime was the dep when it should have ben @babel/runtime-corejs2\\n\\n## 1.10.3 ( August 13, 2018 )\\n\\n### Fixed\\n\\n- Issue with @babel/runtime for real this time\\n\\n## 1.10.2 ( August 13, 2018 )\\n\\n### Fixed\\n\\n- Issue with @babel/runtime\\n\\n## 1.10.1 ( August 13, 2018 )\\n\\n### Removed\\n\\n- mistakenly added dev deps that were deps... oops\\n\\n## 1.10.0 ( August 13, 2018 )\\n\\n### Added\\n\\n- submits to the form state\\n\\n## 1.9.0 ( August 8, 2018 )\\n\\n### Rebuilt\\n\\n- Added prettier so all the files have been changed... so i rebuilt to have source maps match code\\n\\n## 1.8.1 ( August 1, 2018 )\\n\\n### Rebuilt\\n\\n- Attempting to simply rebuild lib due to possible build issue\\n\\n## 1.8.0 ( August 1, 2018 )\\n\\n### Updated\\n\\n- initialValue to get exposed as prop to custom fields\\n\\n## 1.7.5 ( July 31, 2018 )\\n\\n### Added\\n\\n- Source maps\\n\\n## 1.7.4 ( July 26, 2018 )\\n\\n### Fixed\\n\\n- Issue where Basic radio group was not getting exported\\n\\n## 1.7.3 ( July 23, 2018 )\\n\\n### Fixed\\n\\n- issue where bind to field did not pass down the field prop.\\n\\n## 1.7.2 ( July 20, 2018 )\\n\\n### Fixed\\n\\n- Issue where element wont get removed from array when deregistering field... this is used when dynamically removing value\\n\\n## 1.7.1 ( July 20, 2018 )\\n\\n### Added\\n\\n- Field prop is now exposed to field elements and default inputs pass field as name to html inputs\\n\\n## 1.7.0 ( July 18, 2018 )\\n\\n### Added\\n\\n- fieldExists method to the formApi\\n\\n## 1.6.0 ( July 16, 2018 )\\n\\n### Added\\n\\n- onValueChange prop to inputs so you can tie into when values change!!\\n\\n## 1.5.2 ( July 13, 2018 )\\n\\n### Fixed\\n\\n- Issue where prop changes to fields would not get recognized\\n\\n## 1.5.1 ( July 13, 2018 )\\n\\n### Fixed\\n\\n- issue where i forgott to add @babel/runtime as dependency\\n\\n## 1.5.0 ( July 12, 2018 )\\n\\n### Added\\n\\n- asyncValidation prop to inputs\\n- asyncValidateOnBlur prop to inputs\\n\\n## 1.4.0 ( July 5, 2018 )\\n\\n### Added\\n\\n- Basic input fields so users can more easily create custom inputs\\n- Docs for creating custom inputs\\n\\n## 1.3.11 ( July 9, 2018 )\\n\\n### Fixed\\n\\n- issue where you could not nest scope\\n\\n## 1.3.10 ( July 5, 2018 )\\n\\n### Fixed\\n\\n- issue where you could not pass initialValue=false to checkbox\\n\\n## 1.3.9 ( July 5, 2018 )\\n\\n### Fixed\\n\\n- issue where mutable values were getting passed to onSubmit and getState\\n\\n## 1.3.8 ( July 2, 2018 )\\n\\n### Fixed\\n\\n- issue where path array was being build every get and set\\n\\n## 1.3.7 ( July 2, 2018 )\\n\\n### Fixed\\n\\n- issue where onChange was getting passed to internal form element\\n\\n## 1.3.6 ( June 28, 2018 )\\n\\n### Added\\n\\n- globalObject: 'this' to the webpack dist config to support SSR\\n\\n## 1.3.5 ( June 28, 2018 )\\n\\n### Fixed\\n\\n- Issue with event emitter limit ( need to look into alternative solution )\\n- Removed depricated sandbox sinon usage that was causing errors during tests\\n\\n## 1.3.3 ( June 28, 2018 )\\n\\n### Updated\\n\\n- Webpack dist configuration to keep class names\\n\\n## 1.3.2 ( June 28, 2018 )\\n\\n### Fixed\\n\\n- Issue were initialValue was getting passed all the way down to html input\\n- Issue where form would not rerender when field was registered\\n\\n## 1.3.1 ( June 28, 2018 )\\n\\n### Fixed\\n\\n- Issue were validateOnMount was getting passed all the way down to html input\\n\\n## 1.3.0 ( June 28, 2018 )\\n\\n### Added\\n\\n- mask so you can mask values at field level. example `value => value + '!!!'`\\n\\n## 1.2.1 ( June 27, 2018 )\\n\\n### Added\\n\\n- hook so you can add a button with type=reset and it will reset the form\\n\\n## 1.2.0 ( June 27, 2018 )\\n\\n### Added\\n\\n- validateOnMount to input props\\n\\n## 1.1.2 ( June 25, 2018 )\\n\\n### Moved\\n\\n- React and React-Dom to dev dependencies\\n\\n## 1.1.1 ( June 18, 2018 )\\n\\n### Fixed\\n\\n- Bug where i did not do null check on event within on submit\\n\\n## 1.0.1 ( June 15, 2018 )\\n\\n### Added\\n\\n- Notify prop to inputs that allows you to notify other fields when your error state changes ( see docs )\\n\\n## 1.0.0 (June 12, 2018)\\n\\n### Added\\n\\n- Text\\n- TextArea\\n- Radio Group\\n- Radio\\n- Select\\n- Select as Multiselect !!!\\n- Checkbox\\n- withRadioGroup\\n- withFieldApi\\n- withFieldState\\n- withFormApi\\n- withFormState\\n- asField\\n- Form\\n- Field\\n\\n### Changed\\n\\n**\\nNote: this was the first release but i wanted to include changes from\\n`react-form` so here they are:\\n**\\n\\n- `formApi` was split into two parts `formApi` ( contains just functions ) `formState` ( contains just form state )\\n- Form level validation is gone. You do all validation via field validation.\\n- `defaultValues` Form prop is now called `initialValues`\\n- `onChange` Form prop only recieves the `formState`. It used to retrieve the form Api as well.\\n- `preventDefault` Form prop is now `dontPreventDefault`\\n- `getApi` Form prop just returns the formApi, not the state and the api.\\n- `Form` component now renders the `form` element internally. So you dont have to \\\"hook it up\\\" anymore!!\\n\\n### Removed\\n\\n**\\nNote: this was the first release but i wanted to include things that were removed from\\n`react-form` so here they are:\\n**\\n\\n- `NestedField` you can use `Scope` instead but all it does is scope internal fields to `scope=\\\"your-scope\\\"`\\n- validateOnSubmit was removed. Now the form always validates on submit by default and you can opt into sooner validation at field level.\\n- `defaultValues` form prop is now called `initialValues`\\n- `pure` Form prop. Its not needed anymore due to the use of `React.PureComponent` internally.\\n- add, remove, and swap values. The developer can achive this on there own without the use of internal functionality.\\n- Array Syntax. In order to keep things simple we now only support the string syntax for field names.\\n- Async Validation. Async validation led to many issues that overcomplicated `react-form`. We determined this is something that the developer could achive on there own for now but we may look into adding this in the future.\\n- Warning and Success have been removed for now to keep lib lean but we may add additional functions in the future.\\n\";","\"use strict\";\n\nvar _frameworkImportPath = require(\"@storybook/react\");\n\n/* eslint-disable import/no-unresolved */\n(0, _frameworkImportPath.configure)([require.context('./stories', false, /^\\.[\\\\/](?:index\\.js)$/)], module, false);","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/*! normalize.css v3.0.2 | MIT License | git.io/normalize */\\n\\n/**\\n * 1. Set default font family to sans-serif.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\n\\nhtml {\\n font-family: sans-serif; /* 1 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Remove default margin.\\n */\\n\\nbody {\\n margin: 0;\\n}\\n\\n/* HTML5 display definitions\\n ========================================================================== */\\n\\n/**\\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\\n * and Firefox.\\n * Correct `block` display not defined for `main` in IE 11.\\n */\\n\\narticle,\\naside,\\ndetails,\\nfigcaption,\\nfigure,\\nfooter,\\nheader,\\nhgroup,\\nmain,\\nmenu,\\nnav,\\nsection,\\nsummary {\\n display: block;\\n}\\n\\n/**\\n * 1. Correct `inline-block` display not defined in IE 8/9.\\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\\n */\\n\\naudio,\\ncanvas,\\nprogress,\\nvideo {\\n display: inline-block; /* 1 */\\n vertical-align: baseline; /* 2 */\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\n\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address `[hidden]` styling not present in IE 8/9/10.\\n * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.\\n */\\n\\n[hidden],\\ntemplate {\\n display: none;\\n}\\n\\n/* Links\\n ========================================================================== */\\n\\n/**\\n * Remove the gray background color from active links in IE 10.\\n */\\n\\na {\\n background-color: transparent;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\n\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/* Text-level semantics\\n ========================================================================== */\\n\\n/**\\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\\n */\\n\\nabbr[title] {\\n border-bottom: 1px dotted;\\n}\\n\\n/**\\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\\n */\\n\\nb,\\nstrong {\\n font-weight: bold;\\n}\\n\\n/**\\n * Address styling not present in Safari and Chrome.\\n */\\n\\ndfn {\\n font-style: italic;\\n}\\n\\n/**\\n * Address variable `h1` font-size and margin within `section` and `article`\\n * contexts in Firefox 4+, Safari, and Chrome.\\n */\\n\\nh1 {\\n font-size: 2em;\\n margin: 0.67em 0;\\n}\\n\\n/**\\n * Address styling not present in IE 8/9.\\n */\\n\\nmark {\\n background: #ff0;\\n color: #000;\\n}\\n\\n/**\\n * Address inconsistent and variable font size in all browsers.\\n */\\n\\nsmall {\\n font-size: 80%;\\n}\\n\\n/**\\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\\n */\\n\\nsub,\\nsup {\\n font-size: 75%;\\n line-height: 0;\\n position: relative;\\n vertical-align: baseline;\\n}\\n\\nsup {\\n top: -0.5em;\\n}\\n\\nsub {\\n bottom: -0.25em;\\n}\\n\\n/* Embedded content\\n ========================================================================== */\\n\\n/**\\n * Remove border when inside `a` element in IE 8/9/10.\\n */\\n\\nimg {\\n border: 0;\\n}\\n\\n/**\\n * Correct overflow not hidden in IE 9/10/11.\\n */\\n\\nsvg:not(:root) {\\n overflow: hidden;\\n}\\n\\n/* Grouping content\\n ========================================================================== */\\n\\n/**\\n * Address margin not present in IE 8/9 and Safari.\\n */\\n\\nfigure {\\n margin: 1em 40px;\\n}\\n\\n/**\\n * Address differences between Firefox and other browsers.\\n */\\n\\nhr {\\n box-sizing: content-box;\\n height: 0;\\n}\\n\\n/**\\n * Contain overflow in all browsers.\\n */\\n\\npre {\\n overflow: auto;\\n}\\n\\n/**\\n * Address odd `em`-unit font size rendering in all browsers.\\n */\\n\\ncode,\\nkbd,\\npre,\\nsamp {\\n font-family: monospace, monospace;\\n font-size: 1em;\\n}\\n\\n/* Forms\\n ========================================================================== */\\n\\n/**\\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\\n * styling of `select`, unless a `border` property is set.\\n */\\n\\n/**\\n * 1. Correct color not being inherited.\\n * Known issue: affects color of disabled elements.\\n * 2. Correct font properties not being inherited.\\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\\n */\\n\\nbutton,\\ninput,\\noptgroup,\\nselect,\\ntextarea {\\n color: inherit; /* 1 */\\n font: inherit; /* 2 */\\n margin: 0; /* 3 */\\n}\\n\\n/**\\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\\n */\\n\\nbutton {\\n overflow: visible;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\\n * Correct `select` style inheritance in Firefox.\\n */\\n\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n */\\n\\nbutton,\\nhtml input[type=\\\"button\\\"], /* 1 */\\ninput[type=\\\"reset\\\"],\\ninput[type=\\\"submit\\\"] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\n\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 4+.\\n */\\n\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\n\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * It's recommended that you don't attempt to style these elements.\\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\\n *\\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\\n * 2. Remove excess padding in IE 8/9/10.\\n */\\n\\ninput[type=\\\"checkbox\\\"],\\ninput[type=\\\"radio\\\"] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n}\\n\\n/**\\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\\n * `font-size` values of the `input`, it causes the cursor style of the\\n * decrement button to change from `default` to `text`.\\n */\\n\\ninput[type=\\\"number\\\"]::-webkit-inner-spin-button,\\ninput[type=\\\"number\\\"]::-webkit-outer-spin-button {\\n height: auto;\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome\\n * (include `-moz` to future-proof).\\n */\\n\\ninput[type=\\\"search\\\"] {\\n -webkit-appearance: textfield; /* 1 */ /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\\n * Safari (but not Chrome) clips the cancel button when the search input has\\n * padding (and `textfield` appearance).\\n */\\n\\ninput[type=\\\"search\\\"]::-webkit-search-cancel-button,\\ninput[type=\\\"search\\\"]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\n\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\\n */\\n\\nlegend {\\n border: 0; /* 1 */\\n padding: 0; /* 2 */\\n}\\n\\n/**\\n * Remove default vertical scrollbar in IE 8/9/10/11.\\n */\\n\\ntextarea {\\n overflow: auto;\\n}\\n\\n/**\\n * Don't inherit the `font-weight` (applied by a rule above).\\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\\n */\\n\\noptgroup {\\n font-weight: bold;\\n}\\n\\n/* Tables\\n ========================================================================== */\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ntd,\\nth {\\n padding: 0;\\n}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+json+jsx&plugins=previewer-base */\\n/**\\n * okaidia theme for JavaScript, CSS and HTML\\n * Loosely based on Monokai textmate theme by http://www.monokai.nl/\\n * @author ocodia\\n */\\n\\ncode[class*=\\\"language-\\\"],\\npre[class*=\\\"language-\\\"] {\\n\\tcolor: #f8f8f2 !important;\\n\\tbackground: none !important;\\n\\ttext-shadow: 0 1px rgba(0, 0, 0, 0.3) !important;\\n\\tfont-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;\\n\\ttext-align: left !important;\\n\\twhite-space: pre !important;\\n\\tword-spacing: normal !important;\\n\\tword-break: normal !important;\\n\\tword-wrap: normal !important;\\n\\tline-height: 1.5 !important;\\n border: none;\\n\\n\\t-moz-tab-size: 4 !important;\\n\\t-o-tab-size: 4 !important;\\n\\ttab-size: 4 !important;\\n\\n\\t-webkit-hyphens: none !important;\\n\\t-ms-hyphens: none !important;\\n\\thyphens: none !important;\\n}\\n\\n/* Code blocks */\\npre[class*=\\\"language-\\\"] {\\n\\tpadding: 1rem !important;\\n\\tmargin: 0 0 !important;\\n\\toverflow: visible !important;\\n overflow-x: scroll !important;\\n\\tborder-radius: 0.3em !important;\\n}\\n\\ncode[class*=\\\"language-\\\"] {\\n margin: 0 !important;\\n padding: 0 !important;\\n overflow: visible !important;\\n}\\n\\n:not(pre) > code[class*=\\\"language-\\\"],\\npre[class*=\\\"language-\\\"] {\\n\\tbackground: #272822 !important;\\n}\\n\\n/* Inline code */\\n:not(pre) > code[class*=\\\"language-\\\"] {\\n\\tpadding: .1em !important;\\n\\tborder-radius: .3em !important;\\n\\twhite-space: normal !important;\\n}\\n\\n.token.comment,\\n.token.prolog,\\n.token.doctype,\\n.token.cdata {\\n\\tcolor: slategray !important;\\n}\\n\\n.token.punctuation {\\n\\tcolor: #f8f8f2 !important;\\n}\\n\\n.namespace {\\n\\topacity: .7 !important;\\n}\\n\\n.token.property,\\n.token.tag,\\n.token.constant,\\n.token.symbol,\\n.token.deleted {\\n\\tcolor: #f92672 !important;\\n}\\n\\n.token.boolean,\\n.token.number {\\n\\tcolor: #ae81ff !important;\\n}\\n\\n.token.selector,\\n.token.attr-name,\\n.token.string,\\n.token.char,\\n.token.builtin,\\n.token.inserted {\\n\\tcolor: #a6e22e !important;\\n}\\n\\n.token.operator,\\n.token.entity,\\n.token.url,\\n.language-css .token.string,\\n.style .token.string,\\n.token.variable {\\n\\tcolor: #f8f8f2 !important;\\n}\\n\\n.token.atrule,\\n.token.attr-value,\\n.token.function {\\n\\tcolor: #e6db74 !important;\\n}\\n\\n.token.keyword {\\n\\tcolor: #66d9ef !important;\\n}\\n\\n.token.regex,\\n.token.important {\\n\\tcolor: #fd971f !important;\\n}\\n\\n.token.important,\\n.token.bold {\\n\\tfont-weight: bold !important;\\n}\\n.token.italic {\\n\\tfont-style: italic !important;\\n}\\n\\n.token.entity {\\n\\tcursor: help !important;\\n}\\n\\n.prism-previewer,\\n.prism-previewer:before,\\n.prism-previewer:after {\\n\\tposition: absolute !important;\\n\\tpointer-events: none !important;\\n}\\n.prism-previewer,\\n.prism-previewer:after {\\n\\tleft: 50% !important;\\n}\\n.prism-previewer {\\n\\tmargin-top: -48px !important;\\n\\twidth: 32px !important;\\n\\theight: 32px !important;\\n\\tmargin-left: -16px !important;\\n\\n\\topacity: 0 !important;\\n\\ttransition: opacity .25s !important;\\n}\\n.prism-previewer.flipped {\\n\\tmargin-top: 0 !important;\\n\\tmargin-bottom: -48px !important;\\n}\\n.prism-previewer:before,\\n.prism-previewer:after {\\n\\tcontent: '' !important;\\n\\tposition: absolute !important;\\n\\tpointer-events: none !important;\\n}\\n.prism-previewer:before {\\n\\ttop: -5px !important;\\n\\tright: -5px !important;\\n\\tleft: -5px !important;\\n\\tbottom: -5px !important;\\n\\tborder-radius: 10px !important;\\n\\tborder: 5px solid #fff !important;\\n\\tbox-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75) !important;\\n}\\n\\n.prism-previewer:after {\\n\\ttop: 100% !important;\\n\\twidth: 0 !important;\\n\\theight: 0 !important;\\n\\tmargin: 5px 0 0 -7px !important;\\n\\tborder: 7px solid transparent !important;\\n\\tborder-color: rgba(255, 0, 0, 0) !important;\\n\\tborder-top-color: #fff !important;\\n}\\n.prism-previewer.flipped:after {\\n\\ttop: auto !important;\\n\\tbottom: 100% !important;\\n\\tmargin-top: 0 !important;\\n\\tmargin-bottom: 5px !important;\\n\\tborder-top-color: rgba(255, 0, 0, 0) !important;\\n\\tborder-bottom-color: #fff !important;\\n}\\n.prism-previewer.active {\\n\\topacity: 1 !important;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root {\\n --informed-font-size--10: 10px;\\n --informed-font-size--20: 12px;\\n --informed-font-size--30: 14px;\\n --informed-font-size--40: 17px;\\n --informed-font-size--50: 20px;\\n --informed-font-size--55: 23px;\\n --informed-font-size--60: 24px;\\n --informed-font-size--70: 28px;\\n --informed-font-size--75: 34px;\\n --informed-font-size--80: 40px;\\n --informed-height--pill: 40px;\\n --informed-line-height--10: 18px;\\n --informed-line-height--20: 20px;\\n --informed-line-height--30: 21px;\\n --informed-line-height--40: 23px;\\n --informed-line-height--50: 24px;\\n --informed-line-height--60: 28px;\\n --informed-line-height--70: 36px;\\n --informed-line-height--75: 45px;\\n --informed-line-height--80: 48px;\\n}\\n\\n.body {\\n font-family: Helvetica, sans-serif;\\n}\\n\\na > img {\\n border-radius: 10px;\\n}\\n\\nh1 {\\n letter-spacing: -0.6px;\\n font-size: var(--informed-font-size--80, 40px);\\n line-height: var(--informed-line-height--80, 48px);\\n}\\n\\nh2 {\\n letter-spacing: -0.5px;\\n font-size: var(--informed-font-size--70, 28px);\\n line-height: var(--informed-line-height--70, 36px);\\n}\\n\\nh3 {\\n letter-spacing: -0.6px;\\n font-size: var(--informed-font-size--60, 24px);\\n line-height: var(--informed-line-height--60, 28px);\\n}\\n\\nh4 {\\n letter-spacing: -0.4px;\\n font-size: var(--informed-font-size--50, 20px);\\n line-height: var(--informed-line-height--60, 28px);\\n}\\n\\nh5 {\\n font-size: var(--informed-font-size--40, 17px);\\n line-height: var(--informed-line-height--20, 20px);\\n}\\n\\nh6 {\\n font-size: var(--informed-font-size--30, 14px);\\n line-height: var(--informed-line-height--30, 21px);\\n}\\n\\ninput {\\n margin-bottom: 1rem;\\n}\\n\\n.address-option {\\n width: 100%;\\n background-color: #f4f4f4;\\n padding: 10px 20px;\\n}\\n\\n.address-option:hover {\\n background-color: #9d9c9c;\\n cursor: pointer;\\n}\\n\\ninput:not([type='checkbox']):not([type='radio']),\\ntextarea,\\nselect {\\n margin-bottom: 1rem;\\n margin-top: 1rem;\\n display: block;\\n border-radius: 20px;\\n width: 85%;\\n padding: 10px 20px;\\n font-weight: 500;\\n border: 1px solid transparent;\\n margin-right: 2rem;\\n /* max-width: 400px; */\\n background-color: #f4f4f4;\\n}\\n\\ninput + small,\\ntextarea + small,\\nselect + small {\\n color: rgb(237, 78, 59);\\n padding-bottom: 1rem;\\n display: block;\\n font-weight: bold;\\n}\\n\\nfieldset small[role='alert'] {\\n color: rgb(237, 78, 59);\\n padding-bottom: 1rem;\\n display: block;\\n font-weight: bold;\\n}\\n\\ninput[aria-invalid='true']:not([type='checkbox']):not([type='radio']),\\ntextarea[aria-invalid='true'],\\nselect[aria-invalid='true'] {\\n border: 1px solid rgb(237, 78, 59) !important;\\n}\\n\\ninput[aria-invalid='true'][type='radio'],\\ninput[aria-invalid='true'][type='checkbox'] {\\n outline: 1px solid rgb(237, 78, 59) !important;\\n}\\n\\n.radio-label {\\n display: block;\\n}\\n\\ntextarea {\\n max-width: 100%;\\n}\\n\\nfieldset {\\n border: none;\\n}\\n\\nselect {\\n /* needed */\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none;\\n /* SVG background image */\\n background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E');\\n background-size: 0.6em;\\n background-position: calc(100% - 1.3em) center;\\n background-repeat: no-repeat;\\n}\\n\\n.select:before {\\n content: '';\\n position: absolute;\\n right: 10px;\\n top: 8px;\\n width: 0;\\n height: 0;\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n border-top: 10px solid #f00;\\n}\\n\\n.select:after {\\n content: '';\\n position: absolute;\\n right: 10px;\\n top: 3px;\\n width: 0;\\n height: 0;\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n border-top: 10px solid #333;\\n}\\n\\nlabel {\\n margin-bottom: 1rem;\\n display: block;\\n}\\n\\nlegend {\\n margin-bottom: 1rem;\\n display: block;\\n}\\n\\nbutton {\\n text-align: left;\\n display: inline-block;\\n height: var(--informed-height--pill);\\n border: 1px solid transparent;\\n border-radius: 20px;\\n padding: 5px 40px;\\n color: white;\\n /* background-color: #3e6ae1; */\\n background-color: rebeccapurple;\\n margin-bottom: 1rem;\\n margin-top: 1rem;\\n margin-right: 1rem;\\n}\\n\\nbutton[type='submit'] {\\n display: block;\\n}\\n\\n.button-group {\\n display: flex;\\n}\\n\\nhr {\\n border: none !important;\\n height: 2px !important;\\n /* Set the hr color */\\n color: #333; /* old IE */\\n background-color: #333; /* Modern Browsers */\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n}\\n\\npre {\\n font-size: 1em !important;\\n}\\n\\n.markdown-body[class] {\\n font-size: inherit;\\n color: inherit;\\n border: inherit;\\n}\\n\\n.markdown-body pre {\\n font-size: inherit;\\n color: inherit;\\n border: inherit;\\n border-radius: 10px;\\n margin-bottom: 1rem;\\n margin-top: 1rem;\\n}\\n\\n.markdown-body[class] h1,\\n.markdown-body[class] h2,\\n.markdown-body[class] h3,\\n.markdown-body[class] h4,\\n.markdown-body[class] h5,\\n.markdown-body[class] h6 {\\n border: inherit;\\n margin: inherit;\\n padding: inherit;\\n margin-top: 2rem !important;\\n margin-bottom: 2rem !important;\\n}\\n\\n.markdown-body[class] h1[id] {\\n letter-spacing: -0.6px;\\n font-size: var(--informed-font-size--80, 40px);\\n line-height: var(--informed-line-height--80, 48px);\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n}\\n\\n.markdown-body[class] h2[id] {\\n letter-spacing: -0.5px;\\n font-size: var(--informed-font-size--70, 28px);\\n line-height: var(--informed-line-height--70, 36px);\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n}\\n\\n.markdown-body[class] h3[id] {\\n letter-spacing: -0.6px;\\n font-size: var(--informed-font-size--60, 24px);\\n line-height: var(--informed-line-height--60, 28px);\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n}\\n\\n.markdown-body[class] h4[id] {\\n letter-spacing: -0.4px;\\n font-size: var(--informed-font-size--50, 20px);\\n line-height: var(--informed-line-height--60, 28px);\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n}\\n\\n.markdown-body[class] h5[id] {\\n font-size: var(--informed-font-size--40, 17px);\\n line-height: var(--informed-line-height--20, 20px);\\n margin-top: 1rem;\\n margin-bottom: 1rem;\\n}\\n\\n.markdown-body[class] h6[id] {\\n font-size: var(--informed-font-size--30, 14px);\\n line-height: var(--informed-line-height--30, 21px);\\n margin-top: 1rem;\\n margin-bottom: 1rem;\\n}\\n\\n.markdown-body p {\\n margin: inherit;\\n}\\n\\n.markdown-body[class] p {\\n}\\n\\n.markdown-body[class] ul {\\n}\\n\\n.markdown-body[class] ol {\\n}\\n\\n.markdown-body a:active,\\n.markdown-body a:hover {\\n text-decoration: none !important;\\n}\\n\\n.markdown-body[class] table {\\n display: table;\\n}\\n\\n.markdown-body[class] table strong {\\n color: rgb(237, 78, 59);\\n}\\n\\nstrong {\\n color: rgb(237, 78, 59);\\n}\\n\\n/* .markdown-body[class] table {\\n display: table;\\n}\\n\\n.markdown-body thead {\\n}\\n\\n.markdown-body tbody {\\n}\\n\\n.markdown-body table thead tr:nth-child(1n),\\n.markdown-body table tbody tr:nth-child(1n) {\\n background: inherit;\\n border: inherit;\\n}\\n\\n.markdown-body table thead tr:nth-child(1n):first-child th {\\n}\\n\\n.markdown-body thead tr th:nth-child(1n),\\n.markdown-body tbody tr th:nth-child(1n) {\\n padding: inherit;\\n border: inherit;\\n}\\n\\n.markdown-body[class] thead tr th:nth-child(1n),\\n.markdown-body[class] tbody tr th:nth-child(1n) {\\n}\\n\\n.markdown-body thead tr td:nth-child(1n),\\n.markdown-body tbody tr td:nth-child(1n) {\\n padding: inherit;\\n border: inherit;\\n}\\n\\n.markdown-body[class] thead tr td:nth-child(1n),\\n.markdown-body[class] tbody tr td:nth-child(1n) {\\n}\\n\\n.markdown-body[class] thead tr th:nth-child(1n):first-child,\\n.markdown-body[class] tbody tr th:nth-child(1n):first-child,\\n.markdown-body[class] thead tr td:nth-child(1n):first-child,\\n.markdown-body[class] tbody tr td:nth-child(1n):first-child {\\n padding-left: 0;\\n}\\n\\n.markdown-body[class] thead tr th:nth-child(1n):last-child,\\n.markdown-body[class] tbody tr th:nth-child(1n):last-child,\\n.markdown-body[class] thead tr td:nth-child(1n):last-child,\\n.markdown-body[class] tbody tr td:nth-child(1n):last-child {\\n padding-right: 0;\\n} */\\n\\n.informed-container {\\n padding-left: 4rem;\\n padding-right: 4rem;\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n max-width: 1060px;\\n}\\n\\n.informed-black {\\n background-color: black;\\n color: white !important;\\n}\\n\\n.informed-black .address-option {\\n background-color: rgb(58, 60, 65);\\n color: white;\\n}\\n\\n.informed-black .address-option:hover {\\n background-color: rgb(82, 84, 89);\\n cursor: pointer;\\n}\\n\\n.informed-black input:not([type='checkbox']):not([type='radio']),\\n.informed-black select,\\n.informed-black textarea {\\n background-color: rgb(58, 60, 65);\\n color: white;\\n}\\n\\n.informed-black select {\\n background-image: url(\\\"data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ctitle%3Edown-arrow%3C/title%3E%3Cg fill='%23000000'%3E%3Cpath d='M10.293,3.293,6,7.586,1.707,3.293A1,1,0,0,0,.293,4.707l5,5a1,1,0,0,0,1.414,0l5-5a1,1,0,1,0-1.414-1.414Z' fill='%23FFFFFF'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\\\");\\n /* filter: invert(1); */\\n}\\n\\n.informed-black .markdown-body[class] table {\\n background-color: #000;\\n}\\n\\n.informed-black td {\\n background-color: #000;\\n}\\n\\n.informed-black th {\\n background-color: #000;\\n}\\n\\n.markdown-body > :first-child {\\n margin-top: 2rem !important;\\n}\\n\\n.loader,\\n.loader:after {\\n border-radius: 50%;\\n width: 10em;\\n height: 10em;\\n}\\n\\n.loader {\\n top: 0px;\\n margin: 60px auto;\\n font-size: 10px;\\n position: fixed;\\n top: 50%;\\n right: 50%;\\n text-indent: -9999em;\\n border-top: 1.1em solid rgba(67, 64, 64, 0.2);\\n border-right: 1.1em solid rgba(67, 64, 64, 0.2);\\n border-bottom: 1.1em solid rgba(67, 64, 64, 0.2);\\n border-left: 1.1em solid red;\\n transform: translateZ(0);\\n -webkit-animation: load8 1.1s infinite linear;\\n animation: load8 1.1s infinite linear;\\n}\\n\\n.informed-black .loader {\\n border-top: 1.1em solid rgba(255, 255, 255, 0.2);\\n border-right: 1.1em solid rgba(255, 255, 255, 0.2);\\n border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);\\n border-left: 1.1em solid red;\\n}\\n\\n@-webkit-keyframes load8 {\\n 0% {\\n transform: rotate(0deg);\\n }\\n 100% {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes load8 {\\n 0% {\\n transform: rotate(0deg);\\n }\\n 100% {\\n transform: rotate(360deg);\\n }\\n}\\n\\n/* This is for Car!!! */\\n\\n.cls-1 {\\n fill: #fefefe;\\n}\\n\\n.cls-1,\\n.cls-10,\\n.cls-11,\\n.cls-12,\\n.cls-13,\\n.cls-14,\\n.cls-15,\\n.cls-2,\\n.cls-3,\\n.cls-4,\\n.cls-5,\\n.cls-6,\\n.cls-7,\\n.cls-8,\\n.cls-9 {\\n fill-rule: evenodd;\\n}\\n\\n.cls-2 {\\n fill: #cfd5cf;\\n}\\n\\n.cls-11,\\n.cls-12,\\n.cls-3,\\n.cls-5 {\\n fill: none;\\n stroke-linecap: round;\\n stroke-linejoin: round;\\n}\\n\\n.cls-3,\\n.cls-5 {\\n stroke: #212121;\\n}\\n\\n.cls-11,\\n.cls-3 {\\n stroke-width: 3px;\\n}\\n\\n.cls-4 {\\n fill: #212121;\\n}\\n\\n.cls-12,\\n.cls-5 {\\n stroke-width: 2px;\\n}\\n\\n.cls-6 {\\n fill: #194767;\\n}\\n\\n.cls-7 {\\n fill: #1a3850;\\n}\\n\\n.cls-8 {\\n fill: #e53046;\\n}\\n\\n.cls-9 {\\n fill: #ae3b46;\\n}\\n\\n.cls-10 {\\n fill: #e96650;\\n}\\n\\n.car-color-red .cls-8 {\\n fill: #e53046;\\n}\\n\\n.car-color-red .cls-9 {\\n fill: #ae3b46;\\n}\\n\\n.car-color-red .cls-10 {\\n fill: #e96650;\\n}\\n\\n.car-color-blue .cls-8 {\\n fill: #4a2eee;\\n}\\n\\n.car-color-blue .cls-9 {\\n fill: #2540af;\\n}\\n\\n.car-color-blue .cls-10 {\\n fill: #6a72d5;\\n}\\n\\n.car-color-green .cls-8 {\\n fill: #0f4d1d;\\n}\\n\\n.car-color-green .cls-9 {\\n fill: #126014;\\n}\\n\\n.car-color-green .cls-10 {\\n fill: #0d5c18;\\n}\\n\\n.car-color-pink .cls-8 {\\n fill: rgb(233, 36, 111);\\n}\\n\\n.car-color-pink .cls-9 {\\n fill: rgb(145, 39, 80);\\n}\\n\\n.car-color-pink .cls-10 {\\n fill: rgb(155, 18, 70);\\n}\\n\\n.cls-11,\\n.cls-12 {\\n stroke: #231f20;\\n}\\n\\n.cls-13,\\n.cls-16 {\\n fill: #848c93;\\n}\\n\\n.cls-14 {\\n fill: #020303;\\n}\\n\\n.cls-15 {\\n fill: #74848c;\\n}\\n\\n.cls-16 {\\n font-size: 40px;\\n font-family: HelveticaNeue-Bold, Helvetica Neue;\\n font-weight: 700;\\n}\\n\\n#Circleelement {\\n -webkit-animation-name: rotate;\\n -webkit-animation-duration: 2s;\\n -webkit-animation-iteration-count: infinite;\\n -webkit-animation-timing-function: linear;\\n -moz-animation-name: rotate;\\n -moz-animation-duration: 2s;\\n -moz-animation-iteration-count: infinite;\\n -moz-animation-timing-function: linear;\\n animation-name: rotate;\\n animation-duration: 2s;\\n animation-iteration-count: infinite;\\n animation-timing-function: linear;\\n}\\n@-webkit-keyframes rotate {\\n from {\\n -webkit-transform: rotate(0deg);\\n }\\n to {\\n -webkit-transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes rotate {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\n\n/* ----------------------- Contexts ----------------------- */\nexport const FormControllerContext = React.createContext({});\nexport const FormApiContext = React.createContext({});\nexport const FormStateContext = React.createContext({});\nexport const MultistepStepContext = React.createContext();\nexport const MultistepApiContext = React.createContext();\nexport const MultistepStateContext = React.createContext();\nexport const ArrayFieldStateContext = React.createContext();\nexport const ArrayFieldApiContext = React.createContext();\nexport const ArrayFieldItemApiContext = React.createContext();\nexport const ArrayFieldItemStateContext = React.createContext();\nexport const RelevanceContext = React.createContext();\nexport const RadioGroupContext = React.createContext();\nexport const ScopeContext = React.createContext();\nexport const InformedContext = React.createContext();\n","import { ObjectMap } from './ObjectMap';\nimport { Debug } from './debug';\nimport { FieldMap as defaultFieldMap } from './fieldMap';\nimport {\n debounceByName,\n informedFormat,\n informedParse,\n uuidv4,\n validateAjvSchema,\n validateYupField,\n validateYupSchema,\n getSchemaPathFromJsonPath,\n isChild\n} from './utils';\nconst debug = Debug('informed:FormController' + '\\t');\n\nconst initializeValue = (value, { formatter, parser, initialize, mask }) => {\n if (value != null) {\n // Call users initialize if it was passed\n if (initialize && !parser) {\n return initialize(value);\n }\n if (formatter && !parser) {\n const res = informedFormat(value, formatter);\n return res.value;\n }\n if (mask && !parser) {\n return mask(value);\n }\n return value;\n }\n // Not needed but called out specifically\n return undefined;\n};\n\nconst initializeMask = (value, { formatter, initialize, mask }) => {\n if (initialize) {\n return initialize(value);\n }\n // Call formatter\n if (formatter) {\n const res = informedFormat(value, formatter);\n return res.value;\n }\n if (mask) {\n return mask(value);\n }\n\n return value;\n};\n\n/* ----------------------- FormController ----------------------- */\n\nexport class FormController {\n constructor(options) {\n // Set the options\n this.options = options;\n\n // Initialize listeners\n this.subscriptions = new Map();\n\n // Get schema stuff off of options\n const { ajv, schema, fieldMap, adapter } = options.current;\n\n // Create new ajv instance if passed\n this.ajv = ajv ? new ajv({ allErrors: true }) : null;\n // TODO this fucks with json pointer stuff\n // if (ajvErrors) {\n // ajvErrors(this.ajv);\n // }\n this.ajvValidate = ajv ? this.ajv.compile(schema) : null;\n\n // Add field map ( defaults to our field map )\n this.fieldMap = adapter || fieldMap || defaultFieldMap;\n\n // This is the emitter lol\n this.emitter = this;\n\n // Map will store all fields by name\n // Key => name\n // Val => fieldMetaRef\n // Why? so the form knows about field meta\n this.fieldsMap = new Map();\n\n // Map will store current validation request\n // Key => name\n // Val => {uuid, value}\n // Why? So we know if validation request is stale or not\n // We ALSO need to store value because of edge case:\n //\n // Assume sync validation \"Must be at least 5 characters\" and some async validation that takes 2 seconds\n // 1. User types ddddd ( 5 inputs so we pass sync validation )\n // 2. Because there is no sync validation async will trigger to validate username\n // 3. While that occurs, user starts to Backspace the ddddd\n // 4. The second user backspaces, sync has error so async never \"re-occurs\"\n // 5. the sync request made on step 2 completes\n // 6. It wipes out sync error\n this.validationRequests = new Map();\n\n this.dataRequests = new Map();\n\n // For array fields lol\n this.removalLocked = undefined;\n\n // Initialize the controller state\n this.state = {\n pristine: true,\n dirty: false,\n submitted: false,\n invalid: false,\n valid: true,\n submitting: false,\n validating: 0,\n gathering: 0,\n values: {},\n errors: {},\n touched: {},\n maskedValues: {},\n dirt: {},\n focused: {},\n modified: {},\n data: {},\n initialValues: this.options.current.initialValues || {}\n };\n\n // Bind functions that will be called externally\n this.getValue = this.getValue.bind(this);\n this.setValue = this.setValue.bind(this);\n this.setValueQuietly = this.setValueQuietly.bind(this);\n this.setValues = this.setValues.bind(this);\n this.setTheseValues = this.setTheseValues.bind(this);\n this.resetPath = this.resetPath.bind(this);\n this.getMaskedValue = this.getMaskedValue.bind(this);\n this.setMaskedValue = this.setMaskedValue.bind(this);\n this.setModifiedValue = this.setModifiedValue.bind(this);\n this.getTouched = this.getTouched.bind(this);\n this.setTouched = this.setTouched.bind(this);\n this.getFocused = this.getFocused.bind(this);\n this.setFocused = this.setFocused.bind(this);\n this.getError = this.getError.bind(this);\n this.setError = this.setError.bind(this);\n this.reset = this.reset.bind(this);\n this.validate = this.validate.bind(this);\n this.asyncValidate = this.asyncValidate.bind(this);\n this.getDirty = this.getDirty.bind(this);\n this.setDirt = this.setDirt.bind(this);\n this.getPristine = this.getPristine.bind(this);\n this.getFormState = this.getFormState.bind(this);\n this.getFormApi = this.getFormApi.bind(this);\n this.getFieldState = this.getFieldState.bind(this);\n this.getValid = this.getValid.bind(this);\n this.on = this.on.bind(this);\n this.emit = this.emit.bind(this);\n this.removeListener = this.removeListener.bind(this);\n this.remove = this.remove.bind(this);\n this.swap = this.swap.bind(this);\n this.pullOut = this.pullOut.bind(this);\n this.register = this.register.bind(this);\n this.deregister = this.deregister.bind(this);\n this.getInitialValue = this.getInitialValue.bind(this);\n this.initialize = this.initialize.bind(this);\n this.reformat = this.reformat.bind(this);\n this.lockRemoval = this.lockRemoval.bind(this);\n this.unlockRemoval = this.unlockRemoval.bind(this);\n this.resetField = this.resetField.bind(this);\n this.getRemovalLocked = this.getRemovalLocked.bind(this);\n this.isRemovalLocked = this.isRemovalLocked.bind(this);\n this.submitForm = this.submitForm.bind(this);\n this.touchAllFields = this.touchAllFields.bind(this);\n this.keyDown = this.keyDown.bind(this);\n this.validateAsync = this.validateAsync.bind(this);\n this.gatherData = this.gatherData.bind(this);\n this.validated = this.validated.bind(this);\n this.debouncedValidateAsync = debounceByName(this.validateAsync);\n this.debouncedGatherInfo = debounceByName(this.gatherData);\n this.getOptions = this.getOptions.bind(this);\n this.validateField = this.validateField.bind(this);\n this.getErrorMessage = this.getErrorMessage.bind(this);\n this.clearValue = this.clearValue.bind(this);\n this.clearError = this.clearError.bind(this);\n this.getData = this.getData.bind(this);\n this.setData = this.setData.bind(this);\n this.getModified = this.getModified.bind(this);\n this.updateValid = this.updateValid.bind(this);\n this.focusFirstError = this.focusFirstError.bind(this);\n this.setPristine = this.setPristine.bind(this);\n this.disableForm = this.disableForm.bind(this);\n this.enableForm = this.enableForm.bind(this);\n }\n\n getOptions() {\n return this.options.current;\n }\n\n getValue(name) {\n return ObjectMap.get(this.state.values, name);\n }\n\n getMaskedValue(name) {\n return ObjectMap.get(this.state.maskedValues, name);\n }\n\n setMaskedValue(name, value) {\n return ObjectMap.set(this.state.maskedValues, name, value);\n }\n\n setModifiedValue(name, value) {\n return ObjectMap.set(this.state.modified, name, value);\n }\n\n updateValid() {\n // Store previous state\n const prevValid = this.state.valid;\n\n // Now update\n this.state.valid = ObjectMap.empty(this.state.errors);\n this.state.invalid = !this.state.valid;\n\n // Call change handlers if needed\n if (prevValid && !this.state.valid) {\n this.emit('invalid');\n }\n if (!prevValid && this.state.valid) {\n this.emit('valid');\n }\n }\n\n setValues(values) {\n this.fieldsMap.forEach(fieldMeta => {\n // Get value out of values object basd on path\n const val = ObjectMap.get(values, fieldMeta.current.name);\n fieldMeta.current.fieldApi.setValue(val);\n });\n }\n\n disableForm() {\n this.disabled = true;\n // This will make all fields re render with updated value\n this.emit('field', '_ALL_');\n }\n\n enableForm() {\n this.disabled = undefined;\n // This will make all fields re render with updated value\n this.emit('field', '_ALL_');\n }\n\n setTheseValues(values) {\n this.fieldsMap.forEach(fieldMeta => {\n // Get value out of values object basd on path\n const val = ObjectMap.get(values, fieldMeta.current.name);\n // Only set if it is there\n if (val != null) {\n fieldMeta.current.fieldApi.setValue(val);\n }\n });\n }\n\n resetPath(path) {\n this.fieldsMap.forEach(fieldMeta => {\n // Only reset if parent path\n if (isChild(path, fieldMeta.current.name)) {\n fieldMeta.current.fieldApi.reset();\n }\n });\n }\n\n setValueQuietly(name, value) {\n this.setValue(name, value, undefined, undefined, true);\n }\n\n setValue(name, value, e, key, quiet) {\n debug(`setValue ${name}`, value);\n\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current || {};\n\n // Remember Cursor position!\n // Need try catch because of Safari Bullshit issue\n try {\n if (e && e.target && e.target.selectionStart) {\n meta.setCursor(e.target.selectionStart, key);\n }\n } catch (e) {\n // Need try catch because of Safari Bullshit issue\n if (!(e instanceof TypeError)) {\n throw e;\n }\n }\n\n if (value === '') {\n if (meta.allowEmptyString) {\n debug(`Setting ${name}'s value to '' because allowEmptyString is set`);\n ObjectMap.set(this.state.values, name, value);\n // Special if check for modified\n if (meta.getInitialValue && meta.getInitialValue() != value) {\n ObjectMap.set(this.state.modified, name, value);\n } else {\n debug(`Removing ${name}'s modified`);\n ObjectMap.delete(this.state.modified, name);\n }\n ObjectMap.set(this.state.maskedValues, name, value);\n } else {\n debug(`Setting ${name}'s value to undefiend`);\n ObjectMap.set(this.state.values, name, undefined);\n ObjectMap.set(this.state.modified, name, undefined);\n ObjectMap.set(this.state.maskedValues, name, undefined);\n }\n } else if (meta?.type === 'number' && value !== undefined) {\n let val = value;\n let maskedVal = value;\n\n // call mask if passed\n if (meta.mask) {\n maskedVal = meta.mask(val);\n }\n\n // // Only parse if parser was passed\n if (meta.parser) {\n val = val != null ? informedParse(val, meta.parser) : val;\n }\n\n debug(`Setting ${name}'s value to ${+val}`);\n ObjectMap.set(this.state.values, name, +val);\n\n // Special if check for modified\n if (meta.getInitialValue && meta.getInitialValue() != val) {\n ObjectMap.set(this.state.modified, name, +val);\n } else {\n debug(`Removing ${name}'s modified`);\n ObjectMap.delete(this.state.modified, name);\n }\n\n debug(`Setting ${name}'s maskedValue to`, +maskedVal);\n ObjectMap.set(this.state.maskedValues, name, +maskedVal);\n } else {\n let val = value;\n let maskedVal = value;\n\n // Only clean if clean was passed\n if (meta.clean) {\n val = meta.clean(val);\n maskedVal = val;\n }\n\n // Call formatter parser if passed\n if (meta.formatter) {\n const res = informedFormat(\n val,\n meta.formatter,\n this.getMaskedValue(name)\n );\n meta.setCursorOffset(res.offset, key);\n maskedVal = res.value;\n val = maskedVal;\n }\n\n // call mask if passed\n if (meta.mask) {\n val = meta.mask(val);\n maskedVal = val;\n }\n\n // // Only parse if parser was passed\n if (meta.parser) {\n val = val != null ? informedParse(val, meta.parser) : val;\n }\n\n debug(`Setting ${name}'s value to`, val);\n ObjectMap.set(this.state.values, name, val);\n\n // Special if check for modified\n // We want to set even if field is not on screen ( does not have getter for initial )\n if (!meta.getInitialValue || meta.getInitialValue() != val) {\n debug(`Setting ${name}'s modified to`, val);\n ObjectMap.set(this.state.modified, name, val);\n } else {\n debug(`Removing ${name}'s modified`);\n ObjectMap.delete(this.state.modified, name);\n }\n\n debug(`Setting ${name}'s maskedValue to`, maskedVal);\n ObjectMap.set(this.state.maskedValues, name, maskedVal);\n }\n\n // We only need to call validate if the user gave us one\n // and they want us to validate on change\n // Example validateOn = \"change\" (\"change-change\")==> true\n // Example validateOn = \"blur\" (\"blur-blur\") ==> false\n // Example validateOn = \"submit\" (\"submit-submit\")==> false\n // Example validateOn = \"change-blur\" ==> true\n // Example validateOn = \"change-submit\" ==> true\n // Example validateOn = \"blur-submit\" ==> false\n if (meta.validate && meta.validateOn.includes('change')) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating after change ${name} ${val}`);\n ObjectMap.set(\n this.state.errors,\n name,\n meta.validate(val, this.state.values)\n );\n }\n // Same thing but for YUP schema\n // I dont think we need this anymore as its done by the generate function ..... TODO maybe remove\n if (meta.yupSchema && meta.validateOn.includes('change')) {\n // Only call if we dont already have error\n if (this.getError(name) === undefined) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating YUP after change ${name} ${val}`);\n ObjectMap.set(\n this.state.errors,\n name,\n validateYupField(meta.yupSchema, val)\n );\n }\n }\n\n // We only need to call asyncValidate if\n // 1. the user gave us one\n // 2. they want us to validate on change\n // 3. We don't have a sync error\n // Example validateOn = \"change\" (\"change-change\")==> true\n // Example validateOn = \"blur\" (\"blur-blur\") ==> false\n // Example validateOn = \"submit\" (\"submit-submit\")==> false\n // Example validateOn = \"change-blur\" ==> false\n // Example validateOn = \"change-submit\" ==> false\n // Example validateOn = \"blur-submit\" ==> false\n if (meta.asyncValidate && meta.validateOn === 'change') {\n // Get error to determine if we even want to validateAsync\n if (this.getError(name) === undefined) this.debouncedValidateAsync(name);\n }\n\n // Always remember to update pristine and valid here\n if (!quiet) {\n this.state.pristine = false;\n this.state.dirty = !this.state.pristine;\n ObjectMap.set(this.state.dirt, name, true);\n }\n\n // Remember to update valid\n this.updateValid();\n\n // Call users onChange if it exists\n if (meta.onChange) {\n const fieldState = this.getFieldState(name);\n meta.onChange(fieldState, e);\n }\n\n // Call users onNativeChange if we had native event and func\n if (e && meta.onNativeChange) {\n const fieldState = this.getFieldState(name);\n meta.onNativeChange(fieldState, e);\n }\n\n if (meta.gatherData) {\n // Get error to determine if we even want to validateAsync\n this.debouncedGatherInfo(name);\n }\n\n // Normal field event\n this.emit('field', name);\n\n // Special event when fields value changes\n this.emit('field-value', name);\n this.emit('field-modified', name);\n this.emit('field-value-set', name);\n }\n\n validateField(name) {\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current;\n\n if (meta.validate) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating field ${name} via validateField with value ${val}`);\n ObjectMap.set(\n this.state.errors,\n name,\n meta.validate(val, this.state.values)\n );\n }\n // Same thing but for YUP schema\n if (meta.yupSchema) {\n // Only call if we dont already have error\n if (this.getError(name) === undefined) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating YUP field via validateField ${name} ${val}`);\n ObjectMap.set(\n this.state.errors,\n name,\n validateYupField(meta.yupSchema, val)\n );\n }\n }\n\n // TODO maybe do async validation here !?!?!?!\n\n // Remember to update valid\n this.updateValid();\n\n this.emit('field', name);\n }\n\n getModified(name) {\n return ObjectMap.get(this.state.modified, name);\n }\n\n getFocused(name) {\n return ObjectMap.get(this.state.focused, name);\n }\n\n setFocused(name, value, e) {\n debug(`Setting ${name}'s focused to ${value}`);\n\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current || {};\n\n // Update the state\n ObjectMap.set(this.state.focused, name, value);\n\n // Call users onFoucs if it exists\n if (meta.onFocus) {\n const fieldState = this.getFieldState(name);\n meta.onFocus(fieldState, e);\n }\n\n // emit field update\n this.emit('field', name);\n }\n\n getTouched(name) {\n return ObjectMap.get(this.state.touched, name);\n }\n\n setTouched(name, value, e) {\n debug(`Setting ${name}'s touched to ${value}`);\n\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current || {};\n\n // Update the state\n ObjectMap.set(this.state.touched, name, value);\n\n // We only need to call validate if the user gave us one\n // and they want us to validate on blur\n // Example validateOn = \"change\" (\"change-change\")==> true\n // Example validateOn = \"blur\" (\"blur-blur\") ==> true\n // Example validateOn = \"submit\" (\"submit-submit\")==> false\n // Example validateOn = \"change-blur\" ==> true\n // Example validateOn = \"change-submit\" ==> true\n // Example validateOn = \"blur-submit\" ==> true\n if (\n meta.validate &&\n (meta.validateOn.includes('blur') || meta.validateOn.includes('change'))\n ) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating after blur ${name} ${val}`);\n ObjectMap.set(\n this.state.errors,\n name,\n meta.validate(val, this.state.values)\n );\n }\n\n // We only need to call asyncValidate if\n // 1. the user gave us one\n // 2. they want us to validate on blur\n // 3. We don't have a sync error\n // Example validateOn = \"change\" (\"change-change\")==> true\n // Example validateOn = \"blur\" (\"blur-blur\") ==> true\n // Example validateOn = \"submit\" (\"submit-submit\")==> false\n // Example validateOn = \"change-blur\" ==> true\n // Example validateOn = \"change-submit\" ==> false\n // Example validateOn = \"blur-submit\" ==> false\n if (\n meta.asyncValidate &&\n (meta.validateOn === 'blur' ||\n meta.validateOn === 'change-blur' ||\n meta.validateOn === 'change')\n ) {\n // Get error to determine if we even want to validateAsync\n if (this.getError(name) === undefined) {\n this.validateAsync(name);\n }\n }\n\n // Remember to update valid\n this.updateValid();\n\n // Call users onBlur if it exists\n if (meta.onBlur) {\n const fieldState = this.getFieldState(name);\n meta.onBlur(fieldState, e);\n }\n\n this.emit('field', name);\n }\n\n getData(name) {\n return ObjectMap.get(this.state.data, name);\n }\n\n setData(name, value) {\n debug(`Setting ${name}'s data to ${value}`);\n ObjectMap.set(this.state.data, name, value);\n this.emit('field', name);\n }\n\n getError(name) {\n return ObjectMap.get(this.state.errors, name);\n }\n\n setError(name, value) {\n debug(`Setting ${name}'s error to ${value}`);\n ObjectMap.set(this.state.errors, name, value);\n this.state.valid = ObjectMap.empty(this.state.errors);\n this.state.invalid = !this.state.valid;\n this.emit('field', name);\n }\n\n getInitialValue(name) {\n return ObjectMap.get(this.state.initialValues, name);\n }\n\n getDirty(name) {\n return !!ObjectMap.get(this.state.dirt, name);\n }\n\n setDirt(name, value) {\n return ObjectMap.set(this.state.dirt, name, value);\n }\n\n getPristine(name) {\n return !this.getDirty(name);\n }\n\n getValid(name) {\n // Valid when we have no error\n return ObjectMap.get(this.state.errors, name) === undefined;\n }\n\n getFormState() {\n return this.state;\n }\n\n clearValue(name) {\n this.setValue(name, undefined);\n }\n\n clearError(name) {\n this.setError(name, undefined);\n }\n\n setPristine(pristine) {\n this.state.pristine = pristine;\n this.state.dirty = !this.state.pristine;\n\n // Just need to trigger a form state update\n this.emit('field');\n }\n\n getFormApi() {\n return {\n getValue: this.getValue,\n setValue: this.setValue,\n setValueQuietly: this.setValueQuietly,\n getMaskedValue: this.getMaskedValue,\n setMaskedValue: this.setMaskedValue,\n setModifiedValue: this.setModifiedValue,\n getTouched: this.getTouched,\n setTouched: this.setTouched,\n getError: this.getError,\n setError: this.setError,\n getFocused: this.getFocused,\n setFocused: this.setFocused,\n getData: this.getData,\n setData: this.setData,\n getModified: this.getModified,\n resetField: this.resetField,\n reset: this.reset,\n getFormState: this.getFormState,\n getPristine: this.getPristine,\n getDirty: this.getDirty,\n setDirt: this.setDirt,\n validateField: this.validateField,\n getFieldState: this.getFieldState,\n getInitialValue: this.getInitialValue,\n touchAllFields: this.touchAllFields,\n validate: this.validate,\n asyncValidate: this.asyncValidate,\n setValues: this.setValues,\n setTheseValues: this.setTheseValues,\n resetPath: this.resetPath,\n submitForm: this.submitForm,\n clearValue: this.clearValue,\n clearError: this.clearError,\n focusFirstError: this.focusFirstError,\n setPristine: this.setPristine,\n disable: this.disableForm,\n enable: this.enableForm\n };\n }\n\n getFieldState(name) {\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current || {};\n const error = this.getError(name);\n const focused = !!this.getFocused(name);\n const modified = !!this.getModified(name);\n const dirty = this.getDirty(name);\n const valid = this.getValid(name);\n const touched = !!this.getTouched(name);\n const pristine = !dirty;\n const validating = !!this.validationRequests.get(name);\n const gathering = !!this.dataRequests.get(name);\n\n let showError = false;\n if (meta && meta.showErrorIfError) {\n showError = error !== undefined;\n } else if (meta && meta.showErrorIfDirty) {\n showError = error !== undefined && (dirty || touched);\n } else if (meta && meta.showErrorIfTouched) {\n showError = error !== undefined && touched;\n }\n\n // $relevant\n // $focused\n\n return {\n value: this.getValue(name),\n maskedValue: this.getMaskedValue(name),\n modified,\n touched,\n error: this.getError(name),\n data: this.getData(name),\n pristine,\n dirty,\n valid,\n invalid: !valid,\n showError,\n validating,\n gathering,\n focused\n };\n }\n\n remove(name, options = {}) {\n debug('Remove', name);\n\n if (!this.removalLocked) {\n const {\n value: keepValue = false,\n error: keepError = false,\n touched: keepTouched = false\n } = options;\n\n if (!keepValue) {\n debug('Delete Value', name);\n ObjectMap.delete(this.state.values, name);\n debug('Delete Modified', name);\n ObjectMap.delete(this.state.modified, name);\n debug('Delete Masked', name);\n ObjectMap.delete(this.state.maskedValues, name);\n }\n if (!keepTouched) {\n debug('Delete Touched', name);\n ObjectMap.delete(this.state.touched, name);\n }\n if (!keepError) {\n debug('Delete Errors', name);\n ObjectMap.delete(this.state.errors, name);\n }\n debug('Delete Dirt', name);\n ObjectMap.delete(this.state.dirt, name);\n debug('Delete Focused', name);\n ObjectMap.delete(this.state.focused, name);\n debug('Delete Info', name);\n ObjectMap.delete(this.state.data, name);\n\n // Remember to update valid\n this.updateValid();\n\n // Final field change\n this.emit('field', name);\n // Special event when fields value changes\n this.emit('field-value', name);\n this.emit('field-modified', name);\n } else {\n debug('Removal locked so NOT removing', name);\n }\n }\n\n swap(name, a, b) {\n debug('Swap', name, a, b);\n ObjectMap.swap(this.state.values, name, a, b);\n ObjectMap.swap(this.state.modified, name, a, b);\n ObjectMap.swap(this.state.maskedValues, name, a, b);\n ObjectMap.swap(this.state.touched, name, a, b);\n ObjectMap.swap(this.state.errors, name, a, b);\n ObjectMap.swap(this.state.dirt, name, a, b);\n ObjectMap.swap(this.state.focused, name, a, b);\n ObjectMap.swap(this.state.data, name, a, b);\n // DO NOT emit event here we want to delay it on purpose because otherwise relevance will trigger with bad state\n // this.emit(\"field\", name);\n this.state.pristine = false;\n this.state.dirty = !this.state.pristine;\n }\n\n pullOut(name) {\n debug('Pull', name);\n ObjectMap.delete(this.state.values, name);\n ObjectMap.delete(this.state.modified, name);\n ObjectMap.delete(this.state.maskedValues, name);\n ObjectMap.delete(this.state.touched, name);\n ObjectMap.delete(this.state.errors, name);\n ObjectMap.delete(this.state.dirt, name);\n ObjectMap.delete(this.state.focused, name);\n ObjectMap.delete(this.state.data, name);\n // DO NOT emit event here we want to delay it on purpose because otherwise relevance will trigger with bad state\n // this.emit(\"field\", name);\n this.state.pristine = false;\n this.state.dirty = !this.state.pristine;\n }\n\n register(name, meta) {\n debug('Register', name, meta);\n // Register the meta\n if (!this.fieldsMap.get(name)) {\n this.fieldsMap.set(name, meta);\n this.emit('field', name);\n }\n }\n\n deregister(name) {\n debug('De-Register', name);\n if (this.fieldsMap.get(name)) {\n this.fieldsMap.delete(name);\n this.emit('field', name);\n }\n }\n\n initialize(name, meta) {\n debug('Initialize', name, this.state);\n // Initialize value if needed\n // If we already have value i.e \"saved\"\n // use that ( it was not removed on purpose! )\n // Otherwise use the fields initial value\n if (\n !this.getValue(name) &&\n meta.current.initialValue != null &&\n (meta.current.initializeValueIfPristine ? this.state.pristine : true)\n ) {\n const { formatter, parser, initialize, clean, mask } = meta.current;\n\n // Clean value if we have clean function\n const cleanedValue = clean\n ? clean(meta.current.initialValue)\n : meta.current.initialValue;\n\n const initialValue = initializeValue(cleanedValue, {\n formatter,\n parser,\n initialize,\n mask\n });\n const initialMask = initializeMask(cleanedValue, {\n formatter,\n initialize,\n mask\n });\n\n debug(`Initializing ${name}'s value to ${initialValue}`);\n ObjectMap.set(this.state.values, name, initialValue);\n\n debug(`Initializing ${name}'s maskedValue to ${initialMask}`);\n ObjectMap.set(this.state.maskedValues, name, initialMask);\n }\n\n // Might need to set initial error\n if (meta.current.validate && meta.current.validateOnMount) {\n const val = ObjectMap.get(this.state.values, name);\n debug(`Validating on mount ${name} ${val}`, this.state);\n ObjectMap.set(\n this.state.errors,\n name,\n meta.current.validate(val, this.state.values)\n );\n }\n\n // validateOnMount=\"sync\" DONT validateOnMount={true} DO\n if (meta.current.asyncValidate && meta.current.validateOnMount === true) {\n // Get error to determine if we even want to validateAsync\n if (this.getError(name) === undefined) this.validateAsync(name);\n }\n\n // Check if the form is valid\n this.state.valid = ObjectMap.empty(this.state.errors);\n this.state.invalid = !this.state.valid;\n\n if (meta.current.gatherData && meta.current.gatherOnMount === true) {\n // Get error to determine if we even want to validateAsync\n this.debouncedGatherInfo(name);\n }\n\n this.emit('field', name);\n\n // Special event when fields value changes ( this if first time so its technically a change to initial value)\n this.emit('field-value', name);\n // Specifically did NOT call field-modified here\n }\n\n validated(name, res) {\n debug(\n `Setting ${name}'s error to ${res} with ${\n this.state.validating\n } validations left`\n );\n ObjectMap.set(this.state.errors, name, res);\n\n // Remember to update valid\n this.updateValid();\n\n // Clear out validating\n this.validationRequests.delete(name);\n\n // If we are not still validating, and we were submitting, then submit form\n // If we are async validating then dont submit yet\n if (this.state.validating > 0) {\n debug(\n `Still validating ${this.state.validating} others so just update state.`\n );\n this.emit('field', name);\n return;\n }\n\n // If we were submitting\n if (this.state.submitting) {\n // Check validity and perform submission if valid\n if (this.valid()) {\n debug('Submit', this.state);\n this.emit('field', name);\n this.emit('submit');\n } else {\n debug('Fail', this.state);\n if (this.options.current.focusOnInvalid) {\n this.focusFirstError();\n }\n this.emit('field', name);\n this.emit('failure');\n }\n this.state.submitting = false;\n }\n\n // If we had done function\n if (this.done) {\n // Call done only if valid\n if (this.valid()) this.done();\n // Then always clear\n this.done = undefined;\n }\n\n // Always update\n this.emit('field', name);\n }\n\n gathered(name, res) {\n debug(\n `Setting ${name}'s data to ${res} with ${\n this.state.gathering\n } gatherers left`\n );\n ObjectMap.set(this.state.data, name, res);\n\n // Clear out validating\n this.dataRequests.delete(name);\n\n // Always update\n this.emit('field', name);\n this.emit('field-value', name);\n }\n\n validateAsync(name) {\n debug('VALIDATING ASYNC', name);\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current;\n\n // Get the value\n const value = this.getValue(name);\n\n if (meta && meta.asyncValidate) {\n this.state.validating = this.state.validating + 1;\n const uuid = uuidv4();\n debug('REQUEST', uuid);\n this.validationRequests.set(name, { uuid, value });\n\n // Because we may have been debounced need to update field here\n this.emit('field', name);\n\n meta\n .asyncValidate(value, this.state.values)\n .then(res => {\n this.state.validating = this.state.validating - 1;\n const stale = this.validationRequests.get(name).uuid !== uuid;\n\n // What in the hell is invalid and why do I need it??\n // 1. User types ddddd ( 5 inputs so we pass sync validation )\n // 2. Because there is no sync validation async will trigger to validate username\n // 3. While that occurs, user starts to Backspace the ddddd\n // 4. The second user backspaces, sync has error so async never \"re-occurs\"\n // 5. the sync request made on step 2 completes\n // 6. It wipes out sync error\n const invalid =\n this.validationRequests.get(name).value !== this.getValue(name);\n if (!stale && !invalid) {\n debug('FINISH', uuid);\n this.validated(name, res);\n } else {\n debug(\n `${stale ? 'STALE' : 'INVALID'} THEN`,\n uuid,\n value,\n this.getValue(name)\n );\n }\n })\n .catch(err => {\n this.state.validating = this.state.validating - 1;\n const stale = this.validationRequests.get(name).uuid !== uuid;\n const invalid =\n this.validationRequests.get(name).value !== this.getValue(name);\n if (!stale && !invalid) {\n debug('FINISH', uuid);\n this.validated(name, err.message);\n } else {\n debug(\n `${stale ? 'STALE' : 'INVALID'} THEN`,\n uuid,\n value,\n this.getValue(name)\n );\n }\n });\n }\n }\n\n gatherData(name) {\n debug('EXECUTING INFO ASYNC', name);\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current;\n\n // Get the value\n const value = this.getValue(name);\n\n if (meta && meta.gatherData) {\n this.state.gathering = this.state.gathering + 1;\n const uuid = uuidv4();\n debug('DATA REQUEST', uuid);\n this.dataRequests.set(name, { uuid, value });\n\n // Because we may have been debounced need to update field here\n this.emit('field', name);\n\n meta\n .gatherData(value, this.state)\n .then(res => {\n this.state.gathering = this.state.gathering - 1;\n const stale = this.dataRequests.get(name).uuid !== uuid;\n\n // What in the hell is invalid and why do I need it??\n // because the value can be outdated\n const invalid =\n this.dataRequests.get(name).value !== this.getValue(name);\n if (!stale && !invalid) {\n debug('DATA FINISH', uuid);\n this.gathered(name, res);\n } else {\n debug(\n `${stale ? 'STALE' : 'INVALID'} THEN`,\n uuid,\n value,\n this.getValue(name)\n );\n }\n })\n .catch(err => {\n this.state.gathering = this.state.gathering - 1;\n const stale = this.dataRequests.get(name).uuid !== uuid;\n const invalid =\n this.dataRequests.get(name).value !== this.getValue(name);\n if (!stale && !invalid) {\n debug('DATA FINISH', uuid);\n this.gathered(name, err.message);\n } else {\n debug(\n `${stale ? 'STALE' : 'INVALID'} THEN`,\n uuid,\n value,\n this.getValue(name)\n );\n }\n });\n }\n }\n\n reset() {\n this.state = {\n pristine: true,\n dirty: false,\n submitted: false,\n invalid: false,\n valid: true,\n submitting: false,\n validating: 0,\n gathering: 0,\n values: {},\n errors: {},\n touched: {},\n maskedValues: {},\n dirt: {},\n focused: {},\n modified: {},\n data: {},\n initialValues: this.options.current.initialValues || {}\n };\n\n this.fieldsMap.forEach(fieldMeta => {\n fieldMeta.current.fieldApi.reset();\n });\n\n this.emit('reset');\n }\n\n focusFirstError() {\n if (this.options.current.focusOnInvalid) {\n // Itterate through and call validate on every field\n\n Array.from(this.fieldsMap.values()).some(fieldMeta => {\n // Get meta off field\n const meta = fieldMeta.current;\n\n // Get ref to input\n const formFieldRef = meta.fieldRef;\n\n // Get error for that field\n const err = this.getError(meta.name);\n\n // Only focus if we can\n if (err && formFieldRef) {\n if (typeof formFieldRef.current.focus === 'function') {\n debug('Focusing onto', meta.name);\n formFieldRef.current.focus();\n }\n return true;\n }\n return false;\n });\n }\n }\n\n resetField(name, options = {}) {\n debug('Resetting', name);\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current || {};\n\n const { formatter, parser, initialize, mask } = meta;\n const {\n value,\n resetError = true,\n resetTouched = true,\n resetDirt = true,\n resetModified = true\n } = options;\n\n if (value) {\n const initializedValue = initializeValue(value, {\n formatter,\n parser,\n initialize,\n mask\n });\n\n debug(`Resetting ${name}'s value to ${initializedValue}`);\n ObjectMap.set(this.state.values, name, initializedValue);\n\n const maskedValue = initializeMask(value, { formatter, parser, mask });\n debug(`Resetting ${name}'s maskedValue to ${maskedValue}`);\n ObjectMap.set(this.state.maskedValues, name, maskedValue);\n } else {\n const initialValue = initializeValue(\n meta.getInitialValue && meta.getInitialValue(),\n {\n formatter,\n parser,\n initialize,\n mask\n }\n );\n\n const initialMask = initializeMask(\n meta.getInitialValue && meta.getInitialValue(),\n {\n formatter,\n initialize,\n mask\n }\n );\n\n debug(`Resetting ${name}'s value to ${initialValue}`);\n ObjectMap.set(this.state.values, name, initialValue);\n\n debug(`Resetting ${name}'s maskedValue to ${initialMask}`);\n ObjectMap.set(this.state.maskedValues, name, initialMask);\n }\n\n if (resetError) {\n debug(`Resetting ${name}'s error`);\n ObjectMap.delete(this.state.errors, name);\n }\n\n if (resetTouched) {\n debug(`Resetting ${name}'s touched`);\n ObjectMap.delete(this.state.touched, name);\n }\n\n if (resetDirt) {\n debug(`Resetting ${name}'s dirt`);\n ObjectMap.delete(this.state.dirt, name);\n }\n\n if (resetModified) {\n debug(`Resetting ${name}'s modified`);\n ObjectMap.delete(this.state.modified, name);\n }\n\n // Might need to set initial error\n if (meta.validate && meta.validateOnMount) {\n const val = ObjectMap.get(this.state.values, name);\n debug(\n `Validating on reset because of validateOnMount ${name} ${val}`,\n this.state\n );\n ObjectMap.set(\n this.state.errors,\n name,\n meta.validate(val, this.state.values)\n );\n }\n\n // Check if the form is valid\n this.state.valid = ObjectMap.empty(this.state.errors);\n this.state.invalid = !this.state.valid;\n\n if (meta.gatherData && meta.gatherOnMount === true) {\n // Get error to determine if we even want to validateAsync\n this.debouncedGatherInfo(name);\n }\n\n this.emit('field', name);\n\n // Special event when fields value changes ( its a reset so it changes )\n this.emit('field-value', name);\n this.emit('field-modified', name);\n }\n\n reformat(name) {\n debug('Reformatting', name);\n // Get meta for field\n const meta = this.fieldsMap.get(name)?.current;\n\n // Get current value\n const currentValue = ObjectMap.get(this.state.values, name);\n\n const { formatter, parser, initialize } = meta;\n\n const newValue = initializeValue(currentValue, {\n formatter,\n parser,\n initialize\n });\n const newMaskedValue = initializeMask(currentValue, {\n formatter\n });\n\n debug(`Reformatting ${name}'s value to ${newValue}`);\n ObjectMap.set(this.state.values, name, newValue);\n\n debug(`Reformatting ${name}'s maskedValue to ${newMaskedValue}`);\n ObjectMap.set(this.state.maskedValues, name, newMaskedValue);\n\n this.emit('field', name);\n\n // Special event when fields value changes\n this.emit('field-value', name);\n this.emit('field-modified', name);\n }\n\n lockRemoval(i) {\n debug('LOCKREMOVAL', i);\n this.removalLocked = i;\n }\n\n unlockRemoval() {\n debug('UNLOCK REMOVAL');\n this.removalLocked = undefined;\n }\n\n getRemovalLocked() {\n return this.removalLocked;\n }\n\n isRemovalLocked() {\n return this.removalLocked != null;\n }\n\n valid() {\n const errors = this.state.errors;\n return !!ObjectMap.empty(errors);\n }\n\n keyDown(e) {\n // If preventEnter then return\n if (e.keyCode == 13 && this.options.current.preventEnter) {\n e.preventDefault(e);\n return false;\n }\n }\n\n validate() {\n debug('Validating all fields');\n let values = this.state.values;\n\n const validateModified = this.options.current.validateModified;\n\n if (validateModified) {\n values = this.state.modified;\n }\n let errors = {};\n\n // Validate schema if needed\n if (this.options.current.yupSchema) {\n const yupErrors = validateYupSchema(\n this.options.current.yupSchema,\n values\n );\n errors = { ...errors, ...yupErrors };\n }\n\n // Validate AJV schema if needed\n if (this.options.current.schema && this.options.current.ajv) {\n const ajvErrors = validateAjvSchema(this.ajvValidate, values);\n errors = { ...errors, ...ajvErrors };\n }\n\n // Call the forms field level validation\n if (this.options.current.validateFields) {\n const fieldErrors = this.options.current.validateFields(values);\n errors = { ...errors, ...fieldErrors };\n errors = ObjectMap.purge(errors);\n }\n\n // Itterate through and call validate on every field\n this.fieldsMap.forEach(fieldMeta => {\n const meta = fieldMeta.current;\n const value = this.getValue(meta.name);\n const error = meta.validate ? meta.validate(value, values) : undefined;\n if (error != null) {\n ObjectMap.set(errors, meta.name, error);\n }\n });\n\n // Update the errors\n this.state.errors = errors;\n\n // Remember to update valid\n this.updateValid();\n\n // Let everyone know!\n this.emit('field', '_ALL_');\n }\n\n asyncValidate(done) {\n debug('Async Validating all fields');\n this.done = done;\n\n // Itterate through and call validate on every field\n this.fieldsMap.forEach(meta => {\n const { name } = meta.current;\n // Get error to determine if we even want to validateAsync\n if (this.getError(name) === undefined) this.validateAsync(name);\n });\n }\n\n getErrorMessage(key, n) {\n debug(`Getting ${key} error message for ${n} Validating all fields`);\n\n let name = n;\n\n if (this.options.current.schema) {\n debug('We have schema so looking in there for error message');\n\n // Try to grab message from schema first\n // Example schema\n // const schema = {\n // errorMessage: {\n // minLength: 'name must be longer',\n // maxLength: 'must be shorter'\n // },\n // properties: {\n // name: {\n // minLength: 6, // This will get 'name must be longer' message\n // },\n // brother: {\n // errorMessage: {\n // minLength: 'brothers name must be longer',\n // },\n // properties: {\n // name: {\n // minLength: 6, // This will get 'brothers name must be longer'\n // },\n // age: {\n // minLength: 6,\n // errorMessage: {\n // minLength: 'brothers age must be longer', // This will get 'brothers age must be longer'\n // }\n // },\n // test: {\n // maxLength: 6, // This will get 'must be shorter'\n // },\n // }\n // }\n // }\n // };\n // How are we going to get this? start at the property and drill up\n // First we go down to the fields location in the schema\n // Example\n // Start\n // name = brother.siblings[1].friend.name\n // path = properties.brother.properties.siblings.items.properties.friend.properties.name\n // Iteration 1\n // next = brother.siblings[1].friend\n // nextPath = properties.brother.properties.siblings.items.properties.friend\n // Iteration 2\n // next = brother.siblings[1]\n // nextPath = properties.brother.properties.siblings.items\n // Iteration 3\n // next = brother\n // nextPath = properties.brother\n // Iteration 4\n // next = ''\n // nextPath = ''\n // Done ---------------\n while (name !== '') {\n debug(`Looking for message at ${name}`);\n const path = getSchemaPathFromJsonPath(name);\n debug(`Looking for message at schema path ${path}`);\n const property = ObjectMap.get(this.options.current.schema, path);\n // If the property has an error message use that\n if (property && property.errorMessage) {\n const message =\n typeof property.errorMessage === 'string'\n ? property.errorMessage\n : property.errorMessage[key];\n // Only return a message if we had one... maybe we don't have that defined at field level!\n if (message) {\n return message;\n }\n }\n debug(`Did not find message in schema for ${path}`, property);\n // If we get here we did not find the error message so keep going up\n name = name.substring(0, name.lastIndexOf('.'));\n }\n\n // Last but not least check schema\n const property = this.options.current.schema;\n if (property.errorMessage) {\n const message =\n typeof property.errorMessage === 'string'\n ? property.errorMessage\n : property.errorMessage[key];\n // Only return a message if we had one... maybe we don't have that defined at field level!\n if (message) {\n return message;\n }\n }\n }\n\n // Next we check the errorMessage option if it was passed explicitly to an input\n const meta = this.fieldsMap.get(n)?.current;\n\n if (meta && meta.errorMessage) {\n const message =\n typeof meta.errorMessage === 'string'\n ? meta.errorMessage\n : meta.errorMessage[key];\n // Only return a message if we had one... maybe we don't have that defined at field level!\n if (message) {\n return message;\n }\n }\n\n // Finally we check the forms errorMessage prop\n if (this.options.current.errorMessage) {\n const message =\n typeof this.options.current.errorMessage === 'string'\n ? this.options.current.errorMessage\n : this.options.current.errorMessage[key];\n // Only return a message if we had one... maybe we don't have that defined at field level!\n if (message) {\n return message;\n }\n }\n }\n\n touchAllFields() {\n // Touch all the fields\n // TODO maybe do this all at once !?\n this.fieldsMap.forEach(meta => {\n if (!meta.current.arrayField) {\n debug(\n `TouchAllFields - setting ${meta.current.name}'s touched to true`\n );\n ObjectMap.set(this.state.touched, meta.current.name, true);\n }\n });\n }\n\n submitForm(e) {\n this.state.submitting = true;\n\n if (!this.options.current.dontPreventDefault && e) {\n // Prevent default browser form submission\n e.preventDefault(e);\n }\n\n // Validate the form\n this.validate();\n\n // Touch all the fields\n this.touchAllFields();\n\n // Let everyone know!\n this.emit('field', '_ALL_');\n\n // Trigger all async validations\n this.asyncValidate();\n\n // Check validity and perform submission if valid\n // Only submit if we are valid and we are NOT currently async validating\n if (this.valid() && this.state.validating === 0) {\n debug('Submit', this.state);\n this.state.submitted = true;\n this.emit('submit');\n } else {\n debug('Fail', this.state);\n if (this.options.current.focusOnInvalid) {\n this.focusFirstError();\n }\n this.emit('failure');\n }\n\n // Only set to false if we are not async validating\n if (this.state.validating === 0) {\n this.state.submitting = false;\n }\n\n this.emit('field');\n }\n\n /* -------------------------------- Event Emitter ------------------------------ */\n\n emit(event, ...args) {\n // Grab the set based on the event\n const listeners = this.subscriptions.get(event);\n // Only call if we have listeners on that event ( null check )\n if (listeners) {\n listeners.forEach(listener => listener(...args));\n }\n }\n\n on(event, listener) {\n // Singleton check\n if (!this.subscriptions.get(event)) {\n this.subscriptions.set(event, new Set());\n }\n // Add listener\n const listeners = this.subscriptions.get(event);\n listeners.add(listener);\n }\n\n removeListener(event, listener) {\n // Remove listener\n const listeners = this.subscriptions.get(event);\n listeners.delete(listener);\n }\n}\n","import { Debug } from './debug';\nconst debug = Debug('informed:ObjMap' + '\\t');\n\n/**\n *\n * A data structure to read and write to a JS object via\n * JSPAN ( Java Script Property Access Notation )\n */\n\n/* -------------------- toPath -------------------- */\n\nconst ldtoPath = (path = '') => {\n return String.prototype.replace\n .call(path, /\\['(.+?)'\\]/g, '.$1')\n .split(/[,[\\].]+?/)\n .filter(Boolean);\n};\n\n/* --------------------- get --------------------- */\n\nconst ldget = (obj, path = '', defaultValue) => {\n const result = String.prototype.replace\n .call(path, /\\['(.+?)'\\]/g, '.$1')\n .split(/[,[\\].]+?/)\n .filter(Boolean)\n .reduce(\n (res, key) => (res !== null && res !== undefined ? res[key] : res),\n obj\n );\n return result === undefined || result === obj ? defaultValue : result;\n};\n\n/* --------------------- swap --------------------- */\nconst ldSwap = (arr, a, b) => {\n if (arr[a] && arr[b]) {\n const oldA = arr[a];\n const oldB = arr[b];\n arr[a] = oldB;\n arr[b] = oldA;\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n `Attempted to swap ${a} with ${b} but one of them does not exist :(`\n );\n }\n};\n\n/* --------------------- has --------------------- */\n\n// foo -->\n// foo.bar --> foo\n// foo.bar[3] --> foo.bar\n// foo.bar.baz[2].raz.taz[5].laz --> foo.bar.baz[2].raz.taz[5]\nconst parentPath = path => {\n return `.${path}`.replace(/(.*)[.[].*/, '$1').replace(/\\./, '');\n};\n\n// foo --> foo\n// foo.bar --> bar\n// foo.bar[3] --> [3]\n// foo.bar.baz[2].raz.taz[5].laz --> laz\nconst pathKey = path => {\n return path.replace(parentPath(path), '').replace(/\\./, '');\n};\n\nconst ldhas = (obj, path) => {\n const pPath = parentPath(path);\n const key = pathKey(path);\n // If we have parent path then get the object at that location\n // .. otherwise its the root object\n const parentObj = pPath ? ldget(obj, pPath) : obj;\n // If its [3] turn key into 3\n return !!(\n parentObj &&\n Object.hasOwnProperty.call(parentObj, key.replace(/\\[(.*)\\]/, '$1'))\n );\n};\n\n/* --------------------- set --------------------- */\n\nconst ldset = (obj, path = '', val) => {\n String.prototype.replace\n .call(path, /\\['(.+?)'\\]/g, '.$1')\n .split(/[,[\\].]+?/)\n .filter(Boolean)\n .reduce((res, key, i, arr) => {\n //console.log('RES', res, 'Key', key, 'I', i, 'Arr', arr, 'OBJ', obj);\n // At the leaf set the value\n if (i === arr.length - 1) {\n res[key] = val;\n return res[key];\n }\n // Initialize to new array or object if needed\n // OLD CODE: if (res[key] === undefined) {\n // Note I left comment above because it used to be undefined check\n // I had to change it to object in case someone tried to set\n // a value on an existing non object type\n // Example ldSet({ foo: 'HelloWorld' }, 'foo.bar', 'Hello World')\n // ==> { foo: { bar: 'HelloWorld' } }\n if (typeof res[key] !== 'object') {\n if (Number.isInteger(+arr[i + 1])) {\n res[key] = [];\n } else {\n res[key] = {};\n }\n return res[key];\n }\n // Exception for if the value is changeing to an array\n if (Number.isInteger(+arr[i + 1]) && !Array.isArray(res[key])) {\n res[key] = [];\n }\n //TODO exception for if object ??\n\n // Otherwise keep whats there\n return res[key];\n }, obj);\n};\n\n/* --------------------- unset --------------------- */\n\nconst ldunset = (obj, path = '') => {\n let found = false;\n String.prototype.replace\n .call(path, /\\['(.+?)'\\]/g, '.$1')\n .split(/[,[\\].]+?/)\n .filter(Boolean)\n .reduce((res, key, i, arr) => {\n // Base case res is undefined\n if (res === undefined) {\n return res;\n }\n // At the leaf delete the value\n if (i === arr.length - 1) {\n delete res[key];\n found = true;\n return res[key];\n }\n // Otherwise keep going\n return res[key];\n }, obj);\n return found;\n};\n\n/* --------------------- pullAt --------------------- */\n\nconst ldpullAt = (obj, path = '') => {\n let pulled;\n String.prototype.replace\n .call(path, /\\['(.+?)'\\]/g, '.$1')\n .split(/[,[\\].]+?/)\n .filter(Boolean)\n .reduce((res, key, i, arr) => {\n // Base case res is undefined\n if (res === undefined) {\n return res;\n }\n // At the leaf delete the value\n if (i === arr.length - 1 && Array.isArray(res)) {\n // Pull out one value at index ( key )\n pulled = res.splice(key, 1);\n return res[key];\n }\n // Otherwise keep going\n return res[key];\n }, obj);\n return pulled;\n};\n\n/* --------------------- values --------------------- */\n\n// eslint-disable-next-line no-unused-vars\nconst ldvalues = (obj = {}) => {\n const props = Object.keys(obj);\n return props.map(key => obj[key]);\n};\n\nconst pathToArrayElem = path => {\n const pathArray = ldtoPath(path);\n return Number.isInteger(+pathArray[pathArray.length - 1]);\n};\n\nexport class ObjectMap {\n static empty(object) {\n // return ldvalues(object).length === 0;\n for (let i in object) return false;\n return true;\n }\n\n static get(object, path) {\n const val = ldget(object, path);\n //debug('GOT', path, val);\n return val;\n }\n\n static has(object, path) {\n return ldhas(object, path);\n }\n\n static set(object, path, value) {\n if (value !== undefined) {\n debug('Setting', path, value);\n ldset(object, path, value);\n } else {\n // Setting things to undefined in informed is special!\n // so in this else statement we deal with that\n\n // If the path is to an array leaf then we want to set to undefined\n // Example:\n // path = 'foo.bar[2]'\n // foo.bar = [ 'baz', 'raz', 'taz' ]\n // setting taz to undefined ^^^\n if (pathToArrayElem(path) && ObjectMap.get(object, path) !== undefined) {\n debug('Special case SETTING', path, 'to undefined');\n ldset(object, path, undefined);\n let pathArray = ldtoPath(path);\n pathArray = pathArray.slice(0, pathArray.length - 1);\n cleanup(object, pathArray, false);\n }\n // Only delete the field if it needs to be deleted and its not a path to an array ( array leaf )\n // Example:\n // path = 'foo.bar'\n // foo.bar = 'baz'\n // removing foo.bar from the object completley\n else if (\n !pathToArrayElem(path) &&\n ObjectMap.get(object, path) !== undefined\n ) {\n debug('Special case REMOVING', path, 'from object completley');\n ObjectMap.delete(object, path);\n }\n }\n }\n\n static delete(object, path) {\n debug('DELETE', path);\n\n // Special case for arrays\n if (pathToArrayElem(path)) {\n debug('ARRAY PATH', path);\n //ldunset(object, path);\n this.pullOut(object, path);\n } else {\n ldunset(object, path);\n }\n\n let pathArray = ldtoPath(path);\n pathArray = pathArray.slice(0, pathArray.length - 1);\n cleanup(object, pathArray);\n debug('DELETED', path);\n }\n\n // Very important ;)\n static pullOut(object, path) {\n // Get the path to the array\n let pathArray = ldtoPath(path);\n // debug('PathArray1', pathArray);\n const index = pathArray[pathArray.length - 1];\n pathArray = pathArray.slice(0, pathArray.length - 1);\n debug('Pulling out:', pathArray, 'index', index);\n // Get the array\n const arr = ldget(object, pathArray);\n debug('Array Before', arr);\n // Pull out of array\n if (Array.isArray(arr)) {\n ldpullAt(arr, index);\n }\n debug('Array After', arr);\n cleanup(object, pathArray);\n }\n\n static purge(obj) {\n let newObj = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(key => {\n // Its an object recur\n if (typeof obj[key] === 'object') {\n newObj[key] = ObjectMap.purge(obj[key]);\n // If its empty after purge delete\n if (Object.keys(newObj[key]).length === 0) {\n delete newObj[key];\n }\n } else if (obj[key] !== undefined) {\n newObj[key] = obj[key];\n }\n });\n return newObj;\n }\n\n // Very important ;)\n static swap(object, path, i, j) {\n // Get the path to the array\n console.log('Swaping out out:', path, i, j);\n // Get the array\n const arr = ldget(object, path);\n console.log('Array', arr);\n // Pull out of array\n if (Array.isArray(arr)) {\n ldSwap(arr, i, j);\n }\n }\n}\n\nfunction cleanup(obj, path) {\n // uncomment this to add third param back\n //,pull = true) {\n\n // Base case no path left\n if (path.length === 0) {\n return;\n }\n\n const object = ldget(obj, path);\n\n // Clean up undefined from array\n // if (Array.isArray(object) && pull) {\n // ldpull(object, undefined);\n // }\n\n // Delete object if its empty\n if (\n Array.isArray(object)\n ? object.every(e => e == null)\n : JSON.stringify(object) === '{}'\n ) {\n ldunset(obj, path);\n }\n // Recur\n cleanup(obj, path.slice(0, path.length - 1));\n}\n","import React, { useContext, useMemo, useState, useCallback } from 'react';\nimport { Relevant } from './Relevant';\nimport { useArrayField } from '../hooks/useArrayField';\n// import { useFieldSubscription } from '../hooks/useFieldSubscription';\nimport {\n ArrayFieldStateContext,\n ArrayFieldItemApiContext,\n ArrayFieldItemStateContext,\n FormControllerContext,\n ScopeContext\n} from '../Context';\nimport { useFormController } from '../hooks/useFormController';\nimport { useFieldState } from '../hooks/useFieldState';\nimport { Debug } from '../debug';\nimport { useScopedApi } from '../hooks/useScopedApi';\n\nconst debug = Debug('informed:ArrayField' + '\\t');\n\nconst ArrayField = ({\n relevant,\n relevanceWhen,\n relevanceDeps,\n name,\n ...props\n}) => {\n if (relevant) {\n return (\n \n \n \n );\n } else {\n return ;\n }\n};\n\nconst ArrayFieldWrapper = ({ children, ...props }) => {\n const { render, arrayFieldState, arrayFieldApi } = useArrayField(props);\n\n if (typeof children === 'function') {\n return render(\n children({\n arrayFieldApi,\n arrayFieldState,\n // Make it easier for user\n ...arrayFieldApi,\n ...arrayFieldState\n })\n );\n }\n\n return render(children);\n};\n\nconst ArrayFieldItem = ({\n arrayFieldItemState,\n arrayFieldItemApi,\n children\n // hidden\n}) => {\n const formController = useFormController();\n\n // Map will store all fields by name\n // Key => name\n // Val => fieldMetaRef\n // Why? so the array knows about all its field meta\n const [fieldsMap] = useState(() => new Map());\n\n // Register for child field updates\n const subState = useFieldState(arrayFieldItemState.name);\n\n // Get scoped api for item api\n const itemApi = useScopedApi(arrayFieldItemState.name);\n\n // Example evaluateWhen = [\"name\", \"age\"]\n // TODO maybe add this\n // useFieldSubscription(\n // 'field-modified',\n // [arrayFieldItemState.name],\n // target => {\n // debug(`updating hidden field ${hidden} for ${name} because of ${target}`);\n // formController.setModifiedValue(\n // `${arrayFieldItemState.name}.${hidden}`,\n // formController.getValue(`${arrayFieldItemState.name}.${hidden}`)\n // );\n // console.log(\n // `updating hidden field ${hidden} for ${name} because of ${target}`\n // );\n // },\n // false\n // );\n\n // Need to memoize to prevent re renders\n const wrappedController = useMemo(\n () => {\n return {\n ...formController,\n register: (n, m) => {\n fieldsMap.set(n, m);\n formController.register(n, m);\n },\n deregister: (n, m) => {\n fieldsMap.delete(n);\n formController.deregister(n, m);\n // When the very last field from the array is removed unlock\n const lockedUntil = formController.getRemovalLocked();\n debug(\n // fieldsMap,\n 'DEREGISTER',\n n,\n 'SIZE',\n fieldsMap.size,\n 'INDEX',\n arrayFieldItemState.index,\n 'LOCKEDUNTIL',\n lockedUntil\n );\n if (\n lockedUntil != null &&\n lockedUntil.index === arrayFieldItemState.index &&\n lockedUntil.name === arrayFieldItemState.parent &&\n // We are the last field in this item\n // 1. Example fieldsMap.keys() ==> [ 'friends[0].name' ]\n // 2. We are de registering friends[1].age\n // 3. We look to see if friends[1] is in the field map\n // 4. If its not, we are done and can unlock!!\n !Array.from(fieldsMap.keys()).some(k => {\n // debug(\n // 'CHECKING',\n // k,\n // `${arrayFieldItemState.parent}[${lockedUntil.index}]`\n // );\n return k.includes(\n `${arrayFieldItemState.parent}[${lockedUntil.index}]`\n );\n })\n ) {\n debug('UNLOCKING');\n formController.unlockRemoval();\n }\n }\n };\n },\n // WHATEVER YOU DO... DONT REMOVE THIS... need updated controller when index changes\n [arrayFieldItemState.index]\n );\n\n const reset = useCallback(\n () => {\n fieldsMap.forEach(fieldMeta => {\n fieldMeta.current.fieldApi.reset();\n });\n },\n [arrayFieldItemState.name, arrayFieldItemState.index]\n );\n\n const arrayFieldStateValue = {\n ...arrayFieldItemState,\n values: subState.value,\n errors: subState.error,\n touched: subState.touched\n };\n\n const arrayFieldItemApiValue = useMemo(\n () => {\n return {\n ...arrayFieldItemApi,\n ...itemApi,\n reset\n };\n },\n [arrayFieldItemState.name, arrayFieldItemState.index]\n );\n\n // const memoizedChildren = useMemo(\n // () => {\n // debug('Rendering');\n // return children({\n // ...arrayFieldItemApiValue,\n // name: arrayFieldItemState.name,\n // index: arrayFieldItemState.index\n // });\n // },\n // [arrayFieldItemState.name, arrayFieldItemState.index]\n // );\n\n if (typeof children === 'function') {\n return (\n \n \n \n \n {/*

{arrayFieldItemState.key}

*/}\n {/* {memoizedChildren} */}\n {children({\n ...arrayFieldItemApiValue,\n name: arrayFieldItemState.name,\n index: arrayFieldItemState.index\n })}\n
\n
\n
\n
\n );\n }\n\n return (\n \n \n \n \n {children}\n \n \n \n \n );\n};\n\nArrayField.Items = ({ children }) => {\n // TODO maybe add this { hidden, fields } =\n const { fields } = useContext(ArrayFieldStateContext);\n // console.log(\"FIELDS\", fields);\n return fields.map(({ arrayFieldItemState, arrayFieldItemApi }) => {\n const { key } = arrayFieldItemState;\n return (\n