@maif/react-forms 1.0.45 → 1.0.48

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/lib/esm/index.js CHANGED
@@ -28504,6 +28504,13 @@ function CodeInput(_ref) {
28504
28504
  e.stopImmediatePropagation();
28505
28505
  });
28506
28506
  if (setRef) setRef(e);
28507
+ e.dispatch({
28508
+ changes: {
28509
+ from: 0,
28510
+ to: e.state.doc.length,
28511
+ insert: value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value
28512
+ }
28513
+ });
28507
28514
  setEditor(e);
28508
28515
  }, []);
28509
28516
  useEffect(function () {
@@ -29137,14 +29144,16 @@ var cleanInputArray = function cleanInputArray(obj, defaultValues, flow, subSche
29137
29144
 
29138
29145
  if (step.array && !step.render) {
29139
29146
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, (v || []).map(function (value) {
29147
+ var _subSchema$key, _subSchema$key2;
29148
+
29140
29149
  return {
29141
- value: value
29150
+ value: _typeof$1(value) === 'object' && !(value instanceof Date) && !Array.isArray(value) ? cleanInputArray(value, defaultValues, (_subSchema$key = subSchema[key]) === null || _subSchema$key === void 0 ? void 0 : _subSchema$key.flow, ((_subSchema$key2 = subSchema[key]) === null || _subSchema$key2 === void 0 ? void 0 : _subSchema$key2.schema) || {}) : value
29142
29151
  };
29143
29152
  })));
29144
29153
  } else if (_typeof$1(v) === 'object' && !(v instanceof Date) && !Array.isArray(v)) {
29145
- var _subSchema$key, _subSchema$key2;
29154
+ var _subSchema$key3, _subSchema$key4;
29146
29155
 
29147
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanInputArray(v, defaultValues, (_subSchema$key = subSchema[key]) === null || _subSchema$key === void 0 ? void 0 : _subSchema$key.flow, ((_subSchema$key2 = subSchema[key]) === null || _subSchema$key2 === void 0 ? void 0 : _subSchema$key2.schema) || {})));
29156
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanInputArray(v, defaultValues, (_subSchema$key3 = subSchema[key]) === null || _subSchema$key3 === void 0 ? void 0 : _subSchema$key3.flow, ((_subSchema$key4 = subSchema[key]) === null || _subSchema$key4 === void 0 ? void 0 : _subSchema$key4.schema) || {})));
29148
29157
  } else {
29149
29158
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v === undefined ? Array.isArray(v) ? [] : step.type === type.object ? {} : null : v));
29150
29159
  }
@@ -29166,21 +29175,23 @@ var cleanOutputArray = function cleanOutputArray(obj, subSchema) {
29166
29175
  }).getOrElse(false);
29167
29176
 
29168
29177
  if (isArray) {
29169
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v.map(function (_ref6) {
29170
- var value = _ref6.value;
29171
- return value;
29178
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v.map(function (step) {
29179
+ var _subSchema$key5;
29180
+
29181
+ if (!!step.value && _typeof$1(step.value) === 'object' && !(step.value instanceof Date && !Array.isArray(step.value))) return cleanOutputArray(step.value, ((_subSchema$key5 = subSchema[key]) === null || _subSchema$key5 === void 0 ? void 0 : _subSchema$key5.schema) || {});
29182
+ return step.value;
29172
29183
  })));
29173
29184
  }
29174
29185
 
29175
29186
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v));
29176
29187
  } else if (!!v && _typeof$1(v) === 'object' && !(v instanceof Date && !Array.isArray(v))) {
29177
- var _subSchema$key3;
29188
+ var _subSchema$key6;
29178
29189
 
29179
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanOutputArray(v, ((_subSchema$key3 = subSchema[key]) === null || _subSchema$key3 === void 0 ? void 0 : _subSchema$key3.schema) || {})));
29190
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanOutputArray(v, ((_subSchema$key6 = subSchema[key]) === null || _subSchema$key6 === void 0 ? void 0 : _subSchema$key6.schema) || {})));
29180
29191
  } else {
29181
- var _subSchema$key4;
29192
+ var _subSchema$key7;
29182
29193
 
29183
- if (((_subSchema$key4 = subSchema[key]) === null || _subSchema$key4 === void 0 ? void 0 : _subSchema$key4.type) === 'json') {
29194
+ if (((_subSchema$key7 = subSchema[key]) === null || _subSchema$key7 === void 0 ? void 0 : _subSchema$key7.type) === 'json') {
29184
29195
  try {
29185
29196
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, JSON.parse(v)));
29186
29197
  } catch (err) {
@@ -29205,14 +29216,14 @@ var validate = function validate(flow, schema, value) {
29205
29216
  });
29206
29217
  };
29207
29218
 
29208
- var Watcher = function Watcher(_ref7) {
29209
- var options = _ref7.options,
29210
- control = _ref7.control,
29211
- schema = _ref7.schema,
29212
- onSubmit = _ref7.onSubmit,
29213
- handleSubmit = _ref7.handleSubmit;
29214
- _ref7.getValues;
29215
- _ref7.watch;
29219
+ var Watcher = function Watcher(_ref6) {
29220
+ var options = _ref6.options,
29221
+ control = _ref6.control,
29222
+ schema = _ref6.schema,
29223
+ onSubmit = _ref6.onSubmit,
29224
+ handleSubmit = _ref6.handleSubmit;
29225
+ _ref6.getValues;
29226
+ _ref6.watch;
29216
29227
  var data = useWatch({
29217
29228
  control: control
29218
29229
  });
@@ -29238,20 +29249,20 @@ var Watcher = function Watcher(_ref7) {
29238
29249
  return null;
29239
29250
  };
29240
29251
 
29241
- var Form = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
29242
- var schema = _ref8.schema,
29243
- flow = _ref8.flow,
29244
- value = _ref8.value,
29245
- inputWrapper = _ref8.inputWrapper,
29246
- onSubmit = _ref8.onSubmit,
29247
- _ref8$onError = _ref8.onError,
29248
- onError = _ref8$onError === void 0 ? function () {} : _ref8$onError,
29249
- footer = _ref8.footer,
29250
- _ref8$style = _ref8.style,
29251
- style = _ref8$style === void 0 ? {} : _ref8$style,
29252
- className = _ref8.className,
29253
- _ref8$options = _ref8.options,
29254
- options = _ref8$options === void 0 ? {} : _ref8$options;
29252
+ var Form = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
29253
+ var schema = _ref7.schema,
29254
+ flow = _ref7.flow,
29255
+ value = _ref7.value,
29256
+ inputWrapper = _ref7.inputWrapper,
29257
+ onSubmit = _ref7.onSubmit,
29258
+ _ref7$onError = _ref7.onError,
29259
+ onError = _ref7$onError === void 0 ? function () {} : _ref7$onError,
29260
+ footer = _ref7.footer,
29261
+ _ref7$style = _ref7.style,
29262
+ style = _ref7$style === void 0 ? {} : _ref7$style,
29263
+ className = _ref7.className,
29264
+ _ref7$options = _ref7.options,
29265
+ options = _ref7$options === void 0 ? {} : _ref7$options;
29255
29266
  var classes = useCustomStyle(style);
29256
29267
  var formFlow = flow || Object.keys(schema);
29257
29268
 
@@ -29338,7 +29349,11 @@ var Form = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
29338
29349
  }, onError)();
29339
29350
  },
29340
29351
  trigger: trigger,
29341
- methods: methods
29352
+ methods: _objectSpread2$1(_objectSpread2$1({}, methods), {}, {
29353
+ data: function data() {
29354
+ return cleanOutputArray(getValues(), schema);
29355
+ }
29356
+ })
29342
29357
  };
29343
29358
  });
29344
29359
  return /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement(Watcher, {
@@ -29449,18 +29464,18 @@ var Footer = function Footer(props) {
29449
29464
  }, ((_props$actions8 = props.actions) === null || _props$actions8 === void 0 ? void 0 : (_props$actions8$submi = _props$actions8.submit) === null || _props$actions8$submi === void 0 ? void 0 : _props$actions8$submi.label) || 'Save'));
29450
29465
  };
29451
29466
 
29452
- var Step = function Step(_ref9) {
29453
- var entry = _ref9.entry,
29454
- realEntry = _ref9.realEntry,
29455
- step = _ref9.step,
29456
- schema = _ref9.schema,
29457
- inputWrapper = _ref9.inputWrapper,
29458
- httpClient = _ref9.httpClient,
29459
- defaultValue = _ref9.defaultValue,
29460
- index = _ref9.index,
29461
- functionalProperty = _ref9.functionalProperty,
29462
- parent = _ref9.parent,
29463
- onAfterChange = _ref9.onAfterChange;
29467
+ var Step = function Step(_ref8) {
29468
+ var entry = _ref8.entry,
29469
+ realEntry = _ref8.realEntry,
29470
+ step = _ref8.step,
29471
+ schema = _ref8.schema,
29472
+ inputWrapper = _ref8.inputWrapper,
29473
+ httpClient = _ref8.httpClient,
29474
+ defaultValue = _ref8.defaultValue,
29475
+ index = _ref8.index,
29476
+ functionalProperty = _ref8.functionalProperty,
29477
+ parent = _ref8.parent,
29478
+ onAfterChange = _ref8.onAfterChange;
29464
29479
  var classes = useCustomStyle();
29465
29480
 
29466
29481
  var _useFormContext2 = useFormContext(),
@@ -29554,12 +29569,12 @@ var Step = function Step(_ref9) {
29554
29569
  var newData = cleanOutputArray(d, schema);
29555
29570
  if (!deepEqual(newData, currentData) || newData !== undefined && currentData === undefined) onAfterChangeFunc({
29556
29571
  entry: entry,
29557
- previousValue: currentData,
29558
29572
  value: getValues(entry),
29573
+ rawValues: newData,
29574
+ previousValue: currentData,
29559
29575
  getValue: function getValue(e) {
29560
29576
  return getValues(e);
29561
29577
  },
29562
- rawValues: newData,
29563
29578
  setValue: _setValue,
29564
29579
  onChange: function onChange(v) {
29565
29580
  return _setValue(entry, v);
@@ -29831,11 +29846,11 @@ var Step = function Step(_ref9) {
29831
29846
  return /*#__PURE__*/React.createElement(Controller, {
29832
29847
  name: entry,
29833
29848
  control: control,
29834
- render: function render(_ref10) {
29835
- var field = _ref10.field;
29849
+ render: function render(_ref9) {
29850
+ var field = _ref9.field;
29836
29851
 
29837
- var FileInput = function FileInput(_ref11) {
29838
- var onChange = _ref11.onChange;
29852
+ var FileInput = function FileInput(_ref10) {
29853
+ var onChange = _ref10.onChange;
29839
29854
 
29840
29855
  var _useState3 = useState(false),
29841
29856
  _useState4 = _slicedToArray(_useState3, 2),
@@ -29920,11 +29935,11 @@ var Step = function Step(_ref9) {
29920
29935
  }
29921
29936
  };
29922
29937
 
29923
- var ArrayStep = function ArrayStep(_ref12) {
29924
- var entry = _ref12.entry,
29925
- step = _ref12.step,
29926
- component = _ref12.component,
29927
- disabled = _ref12.disabled;
29938
+ var ArrayStep = function ArrayStep(_ref11) {
29939
+ var entry = _ref11.entry,
29940
+ step = _ref11.step,
29941
+ component = _ref11.component,
29942
+ disabled = _ref11.disabled;
29928
29943
  var classes = useCustomStyle();
29929
29944
 
29930
29945
  var _useFormContext3 = useFormContext(),
@@ -30011,19 +30026,19 @@ var ArrayStep = function ArrayStep(_ref12) {
30011
30026
  }, error.message)));
30012
30027
  };
30013
30028
 
30014
- var NestedForm = function NestedForm(_ref13) {
30029
+ var NestedForm = function NestedForm(_ref12) {
30015
30030
  var _classNames17;
30016
30031
 
30017
- var schema = _ref13.schema,
30018
- flow = _ref13.flow,
30019
- parent = _ref13.parent,
30020
- inputWrapper = _ref13.inputWrapper,
30021
- maybeCustomHttpClient = _ref13.maybeCustomHttpClient,
30022
- errorDisplayed = _ref13.errorDisplayed,
30023
- value = _ref13.value,
30024
- step = _ref13.step,
30025
- functionalProperty = _ref13.functionalProperty,
30026
- index = _ref13.index;
30032
+ var schema = _ref12.schema,
30033
+ flow = _ref12.flow,
30034
+ parent = _ref12.parent,
30035
+ inputWrapper = _ref12.inputWrapper,
30036
+ maybeCustomHttpClient = _ref12.maybeCustomHttpClient,
30037
+ errorDisplayed = _ref12.errorDisplayed,
30038
+ value = _ref12.value,
30039
+ step = _ref12.step,
30040
+ functionalProperty = _ref12.functionalProperty,
30041
+ index = _ref12.index;
30027
30042
 
30028
30043
  var _useFormContext4 = useFormContext(),
30029
30044
  getValues = _useFormContext4.getValues,
@@ -30134,10 +30149,10 @@ var NestedForm = function NestedForm(_ref13) {
30134
30149
  onClick: function onClick() {
30135
30150
  return setCollapsed(!collapsed);
30136
30151
  }
30137
- }), computedSandF.map(function (_ref14, idx) {
30138
- var step = _ref14.step,
30139
- visibleStep = _ref14.visibleStep,
30140
- entry = _ref14.entry;
30152
+ }), computedSandF.map(function (_ref13, idx) {
30153
+ var step = _ref13.step,
30154
+ visibleStep = _ref13.visibleStep,
30155
+ entry = _ref13.entry;
30141
30156
 
30142
30157
  if (!step && typeof entry === 'string') {
30143
30158
  console.error("no step found for the entry \"".concat(entry, "\" in the given schema. Your form might not work properly. Please fix it"));
package/lib/index.js CHANGED
@@ -28538,6 +28538,13 @@ function CodeInput(_ref) {
28538
28538
  e.stopImmediatePropagation();
28539
28539
  });
28540
28540
  if (setRef) setRef(e);
28541
+ e.dispatch({
28542
+ changes: {
28543
+ from: 0,
28544
+ to: e.state.doc.length,
28545
+ insert: value === null || value === undefined ? '' : _typeof$1(value) === 'object' ? JSON.stringify(value, null, 2) : value
28546
+ }
28547
+ });
28541
28548
  setEditor(e);
28542
28549
  }, []);
28543
28550
  React.useEffect(function () {
@@ -29171,14 +29178,16 @@ var cleanInputArray = function cleanInputArray(obj, defaultValues, flow, subSche
29171
29178
 
29172
29179
  if (step.array && !step.render) {
29173
29180
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, (v || []).map(function (value) {
29181
+ var _subSchema$key, _subSchema$key2;
29182
+
29174
29183
  return {
29175
- value: value
29184
+ value: _typeof$1(value) === 'object' && !(value instanceof Date) && !Array.isArray(value) ? cleanInputArray(value, defaultValues, (_subSchema$key = subSchema[key]) === null || _subSchema$key === void 0 ? void 0 : _subSchema$key.flow, ((_subSchema$key2 = subSchema[key]) === null || _subSchema$key2 === void 0 ? void 0 : _subSchema$key2.schema) || {}) : value
29176
29185
  };
29177
29186
  })));
29178
29187
  } else if (_typeof$1(v) === 'object' && !(v instanceof Date) && !Array.isArray(v)) {
29179
- var _subSchema$key, _subSchema$key2;
29188
+ var _subSchema$key3, _subSchema$key4;
29180
29189
 
29181
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanInputArray(v, defaultValues, (_subSchema$key = subSchema[key]) === null || _subSchema$key === void 0 ? void 0 : _subSchema$key.flow, ((_subSchema$key2 = subSchema[key]) === null || _subSchema$key2 === void 0 ? void 0 : _subSchema$key2.schema) || {})));
29190
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanInputArray(v, defaultValues, (_subSchema$key3 = subSchema[key]) === null || _subSchema$key3 === void 0 ? void 0 : _subSchema$key3.flow, ((_subSchema$key4 = subSchema[key]) === null || _subSchema$key4 === void 0 ? void 0 : _subSchema$key4.schema) || {})));
29182
29191
  } else {
29183
29192
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v === undefined ? Array.isArray(v) ? [] : step.type === type.object ? {} : null : v));
29184
29193
  }
@@ -29200,21 +29209,23 @@ var cleanOutputArray = function cleanOutputArray(obj, subSchema) {
29200
29209
  }).getOrElse(false);
29201
29210
 
29202
29211
  if (isArray) {
29203
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v.map(function (_ref6) {
29204
- var value = _ref6.value;
29205
- return value;
29212
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v.map(function (step) {
29213
+ var _subSchema$key5;
29214
+
29215
+ if (!!step.value && _typeof$1(step.value) === 'object' && !(step.value instanceof Date && !Array.isArray(step.value))) return cleanOutputArray(step.value, ((_subSchema$key5 = subSchema[key]) === null || _subSchema$key5 === void 0 ? void 0 : _subSchema$key5.schema) || {});
29216
+ return step.value;
29206
29217
  })));
29207
29218
  }
29208
29219
 
29209
29220
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, v));
29210
29221
  } else if (!!v && _typeof$1(v) === 'object' && !(v instanceof Date && !Array.isArray(v))) {
29211
- var _subSchema$key3;
29222
+ var _subSchema$key6;
29212
29223
 
29213
- return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanOutputArray(v, ((_subSchema$key3 = subSchema[key]) === null || _subSchema$key3 === void 0 ? void 0 : _subSchema$key3.schema) || {})));
29224
+ return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, cleanOutputArray(v, ((_subSchema$key6 = subSchema[key]) === null || _subSchema$key6 === void 0 ? void 0 : _subSchema$key6.schema) || {})));
29214
29225
  } else {
29215
- var _subSchema$key4;
29226
+ var _subSchema$key7;
29216
29227
 
29217
- if (((_subSchema$key4 = subSchema[key]) === null || _subSchema$key4 === void 0 ? void 0 : _subSchema$key4.type) === 'json') {
29228
+ if (((_subSchema$key7 = subSchema[key]) === null || _subSchema$key7 === void 0 ? void 0 : _subSchema$key7.type) === 'json') {
29218
29229
  try {
29219
29230
  return _objectSpread2$1(_objectSpread2$1({}, acc), {}, _defineProperty$1({}, key, JSON.parse(v)));
29220
29231
  } catch (err) {
@@ -29239,14 +29250,14 @@ var validate = function validate(flow, schema, value) {
29239
29250
  });
29240
29251
  };
29241
29252
 
29242
- var Watcher = function Watcher(_ref7) {
29243
- var options = _ref7.options,
29244
- control = _ref7.control,
29245
- schema = _ref7.schema,
29246
- onSubmit = _ref7.onSubmit,
29247
- handleSubmit = _ref7.handleSubmit;
29248
- _ref7.getValues;
29249
- _ref7.watch;
29253
+ var Watcher = function Watcher(_ref6) {
29254
+ var options = _ref6.options,
29255
+ control = _ref6.control,
29256
+ schema = _ref6.schema,
29257
+ onSubmit = _ref6.onSubmit,
29258
+ handleSubmit = _ref6.handleSubmit;
29259
+ _ref6.getValues;
29260
+ _ref6.watch;
29250
29261
  var data = reactHookForm.useWatch({
29251
29262
  control: control
29252
29263
  });
@@ -29272,20 +29283,20 @@ var Watcher = function Watcher(_ref7) {
29272
29283
  return null;
29273
29284
  };
29274
29285
 
29275
- var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref8, ref) {
29276
- var schema = _ref8.schema,
29277
- flow = _ref8.flow,
29278
- value = _ref8.value,
29279
- inputWrapper = _ref8.inputWrapper,
29280
- onSubmit = _ref8.onSubmit,
29281
- _ref8$onError = _ref8.onError,
29282
- onError = _ref8$onError === void 0 ? function () {} : _ref8$onError,
29283
- footer = _ref8.footer,
29284
- _ref8$style = _ref8.style,
29285
- style = _ref8$style === void 0 ? {} : _ref8$style,
29286
- className = _ref8.className,
29287
- _ref8$options = _ref8.options,
29288
- options = _ref8$options === void 0 ? {} : _ref8$options;
29286
+ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref7, ref) {
29287
+ var schema = _ref7.schema,
29288
+ flow = _ref7.flow,
29289
+ value = _ref7.value,
29290
+ inputWrapper = _ref7.inputWrapper,
29291
+ onSubmit = _ref7.onSubmit,
29292
+ _ref7$onError = _ref7.onError,
29293
+ onError = _ref7$onError === void 0 ? function () {} : _ref7$onError,
29294
+ footer = _ref7.footer,
29295
+ _ref7$style = _ref7.style,
29296
+ style = _ref7$style === void 0 ? {} : _ref7$style,
29297
+ className = _ref7.className,
29298
+ _ref7$options = _ref7.options,
29299
+ options = _ref7$options === void 0 ? {} : _ref7$options;
29289
29300
  var classes = useCustomStyle(style);
29290
29301
  var formFlow = flow || Object.keys(schema);
29291
29302
 
@@ -29372,7 +29383,11 @@ var Form = /*#__PURE__*/React__default["default"].forwardRef(function (_ref8, re
29372
29383
  }, onError)();
29373
29384
  },
29374
29385
  trigger: trigger,
29375
- methods: methods
29386
+ methods: _objectSpread2$1(_objectSpread2$1({}, methods), {}, {
29387
+ data: function data() {
29388
+ return cleanOutputArray(getValues(), schema);
29389
+ }
29390
+ })
29376
29391
  };
29377
29392
  });
29378
29393
  return /*#__PURE__*/React__default["default"].createElement(reactHookForm.FormProvider, methods, /*#__PURE__*/React__default["default"].createElement(Watcher, {
@@ -29483,18 +29498,18 @@ var Footer = function Footer(props) {
29483
29498
  }, ((_props$actions8 = props.actions) === null || _props$actions8 === void 0 ? void 0 : (_props$actions8$submi = _props$actions8.submit) === null || _props$actions8$submi === void 0 ? void 0 : _props$actions8$submi.label) || 'Save'));
29484
29499
  };
29485
29500
 
29486
- var Step = function Step(_ref9) {
29487
- var entry = _ref9.entry,
29488
- realEntry = _ref9.realEntry,
29489
- step = _ref9.step,
29490
- schema = _ref9.schema,
29491
- inputWrapper = _ref9.inputWrapper,
29492
- httpClient = _ref9.httpClient,
29493
- defaultValue = _ref9.defaultValue,
29494
- index = _ref9.index,
29495
- functionalProperty = _ref9.functionalProperty,
29496
- parent = _ref9.parent,
29497
- onAfterChange = _ref9.onAfterChange;
29501
+ var Step = function Step(_ref8) {
29502
+ var entry = _ref8.entry,
29503
+ realEntry = _ref8.realEntry,
29504
+ step = _ref8.step,
29505
+ schema = _ref8.schema,
29506
+ inputWrapper = _ref8.inputWrapper,
29507
+ httpClient = _ref8.httpClient,
29508
+ defaultValue = _ref8.defaultValue,
29509
+ index = _ref8.index,
29510
+ functionalProperty = _ref8.functionalProperty,
29511
+ parent = _ref8.parent,
29512
+ onAfterChange = _ref8.onAfterChange;
29498
29513
  var classes = useCustomStyle();
29499
29514
 
29500
29515
  var _useFormContext2 = reactHookForm.useFormContext(),
@@ -29588,12 +29603,12 @@ var Step = function Step(_ref9) {
29588
29603
  var newData = cleanOutputArray(d, schema);
29589
29604
  if (!deepEqual__default["default"](newData, currentData) || newData !== undefined && currentData === undefined) onAfterChangeFunc({
29590
29605
  entry: entry,
29591
- previousValue: currentData,
29592
29606
  value: getValues(entry),
29607
+ rawValues: newData,
29608
+ previousValue: currentData,
29593
29609
  getValue: function getValue(e) {
29594
29610
  return getValues(e);
29595
29611
  },
29596
- rawValues: newData,
29597
29612
  setValue: _setValue,
29598
29613
  onChange: function onChange(v) {
29599
29614
  return _setValue(entry, v);
@@ -29865,11 +29880,11 @@ var Step = function Step(_ref9) {
29865
29880
  return /*#__PURE__*/React__default["default"].createElement(reactHookForm.Controller, {
29866
29881
  name: entry,
29867
29882
  control: control,
29868
- render: function render(_ref10) {
29869
- var field = _ref10.field;
29883
+ render: function render(_ref9) {
29884
+ var field = _ref9.field;
29870
29885
 
29871
- var FileInput = function FileInput(_ref11) {
29872
- var onChange = _ref11.onChange;
29886
+ var FileInput = function FileInput(_ref10) {
29887
+ var onChange = _ref10.onChange;
29873
29888
 
29874
29889
  var _useState3 = React.useState(false),
29875
29890
  _useState4 = _slicedToArray(_useState3, 2),
@@ -29954,11 +29969,11 @@ var Step = function Step(_ref9) {
29954
29969
  }
29955
29970
  };
29956
29971
 
29957
- var ArrayStep = function ArrayStep(_ref12) {
29958
- var entry = _ref12.entry,
29959
- step = _ref12.step,
29960
- component = _ref12.component,
29961
- disabled = _ref12.disabled;
29972
+ var ArrayStep = function ArrayStep(_ref11) {
29973
+ var entry = _ref11.entry,
29974
+ step = _ref11.step,
29975
+ component = _ref11.component,
29976
+ disabled = _ref11.disabled;
29962
29977
  var classes = useCustomStyle();
29963
29978
 
29964
29979
  var _useFormContext3 = reactHookForm.useFormContext(),
@@ -30045,19 +30060,19 @@ var ArrayStep = function ArrayStep(_ref12) {
30045
30060
  }, error.message)));
30046
30061
  };
30047
30062
 
30048
- var NestedForm = function NestedForm(_ref13) {
30063
+ var NestedForm = function NestedForm(_ref12) {
30049
30064
  var _classNames17;
30050
30065
 
30051
- var schema = _ref13.schema,
30052
- flow = _ref13.flow,
30053
- parent = _ref13.parent,
30054
- inputWrapper = _ref13.inputWrapper,
30055
- maybeCustomHttpClient = _ref13.maybeCustomHttpClient,
30056
- errorDisplayed = _ref13.errorDisplayed,
30057
- value = _ref13.value,
30058
- step = _ref13.step,
30059
- functionalProperty = _ref13.functionalProperty,
30060
- index = _ref13.index;
30066
+ var schema = _ref12.schema,
30067
+ flow = _ref12.flow,
30068
+ parent = _ref12.parent,
30069
+ inputWrapper = _ref12.inputWrapper,
30070
+ maybeCustomHttpClient = _ref12.maybeCustomHttpClient,
30071
+ errorDisplayed = _ref12.errorDisplayed,
30072
+ value = _ref12.value,
30073
+ step = _ref12.step,
30074
+ functionalProperty = _ref12.functionalProperty,
30075
+ index = _ref12.index;
30061
30076
 
30062
30077
  var _useFormContext4 = reactHookForm.useFormContext(),
30063
30078
  getValues = _useFormContext4.getValues,
@@ -30168,10 +30183,10 @@ var NestedForm = function NestedForm(_ref13) {
30168
30183
  onClick: function onClick() {
30169
30184
  return setCollapsed(!collapsed);
30170
30185
  }
30171
- }), computedSandF.map(function (_ref14, idx) {
30172
- var step = _ref14.step,
30173
- visibleStep = _ref14.visibleStep,
30174
- entry = _ref14.entry;
30186
+ }), computedSandF.map(function (_ref13, idx) {
30187
+ var step = _ref13.step,
30188
+ visibleStep = _ref13.visibleStep,
30189
+ entry = _ref13.entry;
30175
30190
 
30176
30191
  if (!step && typeof entry === 'string') {
30177
30192
  console.error("no step found for the entry \"".concat(entry, "\" in the given schema. Your form might not work properly. Please fix it"));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maif/react-forms",
3
3
  "description": "Build react safe forms as fast as possible",
4
- "version": "1.0.45",
4
+ "version": "1.0.48",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
7
7
  "types": "lib/index.js",