@bolttech/form-engine 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.2](http://bitbucket.org/gofrank/bolttech-frontend/compare/form-engine-0.11.1...form-engine-0.11.2) (2024-02-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **handler:** add defaultClearFields prop on clearFields handler ([b5865f6](http://bitbucket.org/gofrank/bolttech-frontend/commit/b5865f66e2cb61f5a811bfab0d67fb9101bb3046))
11
+ * **handler:** updating readme ([99b2ac8](http://bitbucket.org/gofrank/bolttech-frontend/commit/99b2ac8902f0b8834dd96d84a2fb44641a2c86d0))
12
+
5
13
  ## [0.11.1](http://bitbucket.org/gofrank/bolttech-frontend/compare/form-engine-0.11.0...form-engine-0.11.1) (2024-02-19)
6
14
 
7
15
 
package/README.md CHANGED
@@ -995,6 +995,30 @@ Each prop will be changed using the respective field. For example, if I have `fi
995
995
  I can send it as `clearedProps: [{ label: 'value' }]` or `clearedProps: { label: 'value' }`. And only input props will be changed.
996
996
  It's useful when we have some API calls whose response will be used as a prop value in the component.
997
997
 
998
+ ```json
999
+ {
1000
+ "clearFields": {
1001
+ "ON_FIELD_CHANGE": [
1002
+ {
1003
+ "validations": {
1004
+ "value": "Yes"
1005
+ },
1006
+ "field": "targetValue",
1007
+ "clearedValue": false,
1008
+ "defaultClearedValue": true,
1009
+ "defaultClearedProps": {
1010
+ "disabled": false,
1011
+ }
1012
+ }
1013
+ ]
1014
+ }
1015
+ }
1016
+ ```
1017
+
1018
+ If you want to set a value when the validation passes you can set `defaultClearedValue` prop on the event to set a value on the cleared field.
1019
+ Useful after an API call to set a default response value or a value stored earlier.
1020
+ You can also set a `defaultClearedProps` attribute to change the props of the component if the validation passes.
1021
+
998
1022
  For definition clearValues runs validations on the target field and not on the field it is declaring.
999
1023
  Therefore, you can set `useCurrentFieldValidation` prop with true if you want validations to be performed on the current field.
1000
1024