@bolttech/form-engine 3.0.0-beta.14 → 3.0.0-beta.15

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.
Files changed (2) hide show
  1. package/index.esm.js +20 -2
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -2093,7 +2093,6 @@ const AsFormFieldBuilder = props => {
2093
2093
  } = useFormGroupContext();
2094
2094
  const [field, setField] = useState(jsx(Fragment, {}));
2095
2095
  useEffect(() => {
2096
- var _a;
2097
2096
  if (!(formGroupInstance === null || formGroupInstance === void 0 ? void 0 : formGroupInstance.forms.has(props.formIndex))) {
2098
2097
  addFormWithIndex(props.formIndex);
2099
2098
  }
@@ -2101,7 +2100,26 @@ const AsFormFieldBuilder = props => {
2101
2100
  component: props.mapper.componentName,
2102
2101
  children: undefined
2103
2102
  });
2104
- (_a = formGroupInstance.forms.get(props.formIndex)) === null || _a === void 0 ? void 0 : _a.addField(fieldInstanceProps, props.mapper);
2103
+ const formInstance = formGroupInstance.forms.get(props.formIndex);
2104
+ formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField(fieldInstanceProps, props.mapper);
2105
+ /*
2106
+ some magic happens using this setTimeout and i don't know why...
2107
+ this is executed right before the FieldWrapper mounts as expected
2108
+ but has the blinking problem allowing people to see the template
2109
+ format instead of the prop value
2110
+ */
2111
+ setTimeout(() => {
2112
+ var _a;
2113
+ (_a = formInstance === null || formInstance === void 0 ? void 0 : formInstance.getField({
2114
+ key: props.name
2115
+ })) === null || _a === void 0 ? void 0 : _a.emitEvents({
2116
+ event: 'ON_FIELD_MOUNT'
2117
+ });
2118
+ formInstance === null || formInstance === void 0 ? void 0 : formInstance.refreshTemplates({
2119
+ key: props.name,
2120
+ event: 'ON_FIELDS'
2121
+ });
2122
+ }, 0);
2105
2123
  const field = jsx(FieldWrapper, {
2106
2124
  mapper: props.mapper,
2107
2125
  formIndex: props.formIndex,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine",
3
- "version": "3.0.0-beta.14",
3
+ "version": "3.0.0-beta.15",
4
4
  "description": "A react adapter for bolttech form engine",
5
5
  "module": "./index.esm.js",
6
6
  "type": "module",
7
7
  "main": "./index.esm.js",
8
8
  "dependencies": {
9
- "@bolttech/form-engine-core": "0.0.1-beta.5",
9
+ "@bolttech/form-engine-core": "0.0.1-beta.6",
10
10
  "lodash": "4.17.21",
11
11
  "react": "18.2.0",
12
12
  "rxjs": "7.8.1"