@bolttech/form-engine 3.1.2-beta.0 → 3.1.2-beta.1

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 +8 -7
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -2357,14 +2357,14 @@ function Form({
2357
2357
  },
2358
2358
  children: "try submit"
2359
2359
  }), jsx("br", {}), jsx("hr", {})]
2360
- }), jsx("form", {
2360
+ }), jsxs("form", {
2361
2361
  onSubmit: handleSubmit,
2362
- children: jsx(BuildSchemaAsFields, {
2362
+ children: [jsx(BuildSchemaAsFields, {
2363
2363
  formIndex: schemaIndex,
2364
2364
  mappers: mappers,
2365
2365
  components: schema === null || schema === void 0 ? void 0 : schema.components,
2366
2366
  mountedForm: mounted
2367
- })
2367
+ }), children]
2368
2368
  })]
2369
2369
  });
2370
2370
  }
@@ -2429,6 +2429,7 @@ const FieldWrapper = ({
2429
2429
  }) => {
2430
2430
  var _a, _b, _c, _d;
2431
2431
  const localContext = useFormGroupContext({});
2432
+ const fieldMapper = mapper || ((_a = localContext.mappers) === null || _a === void 0 ? void 0 : _a.find(mapper => mapper.componentName === component));
2432
2433
  /**
2433
2434
  * picks the right context prioritizing the context passed as prop
2434
2435
  */
@@ -2456,7 +2457,7 @@ const FieldWrapper = ({
2456
2457
  return returnProps;
2457
2458
  }, [props]);
2458
2459
  const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {
2459
- [((_a = mapper === null || mapper === void 0 ? void 0 : mapper.events) === null || _a === void 0 ? void 0 : _a.setValue) || 'value']: ''
2460
+ [((_b = fieldMapper === null || fieldMapper === void 0 ? void 0 : fieldMapper.events) === null || _b === void 0 ? void 0 : _b.setValue) || 'value']: ''
2460
2461
  });
2461
2462
  const [state, setState] = useState({
2462
2463
  visibility: typeof visibility === 'boolean' ? visibility : true,
@@ -2516,7 +2517,7 @@ const FieldWrapper = ({
2516
2517
  * to the corresponding prop defined on the mappers
2517
2518
  */
2518
2519
  const mapProps = useMemo(() => {
2519
- const events = mapper === null || mapper === void 0 ? void 0 : mapper.events;
2520
+ const events = fieldMapper === null || fieldMapper === void 0 ? void 0 : fieldMapper.events;
2520
2521
  const props = {};
2521
2522
  if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
2522
2523
  if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
@@ -2545,7 +2546,7 @@ const FieldWrapper = ({
2545
2546
  padding: '0px',
2546
2547
  margin: '0px'
2547
2548
  },
2548
- children: ["order:", (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _b === void 0 ? void 0 : _b.order]
2549
+ children: ["order:", (_c = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _c === void 0 ? void 0 : _c.order]
2549
2550
  }), jsxs("b", {
2550
2551
  style: {
2551
2552
  padding: '0px',
@@ -2556,7 +2557,7 @@ const FieldWrapper = ({
2556
2557
  }), jsx(FieldWrapperComponentRender, {
2557
2558
  props: Object.assign(Object.assign(Object.assign(Object.assign({}, mapProps), state.props), state.errors), valueState),
2558
2559
  fieldInstance: fieldInstance,
2559
- mapper: mapper || ((_c = localContext.mappers) === null || _c === void 0 ? void 0 : _c.find(mapper => mapper.componentName === component)),
2560
+ mapper: fieldMapper,
2560
2561
  children: children ? children : ((_d = state === null || state === void 0 ? void 0 : state.props) === null || _d === void 0 ? void 0 : _d.children) ? state === null || state === void 0 ? void 0 : state.props.children : null
2561
2562
  })]
2562
2563
  }) : jsx(Fragment, {});
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine",
3
- "version": "3.1.2-beta.0",
3
+ "version": "3.1.2-beta.1",
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": "1.0.2-beta.0",
9
+ "@bolttech/form-engine-core": "1.0.2-beta.1",
10
10
  "react": "18.2.0"
11
11
  },
12
12
  "peerDependencies": {}