@bolttech/form-engine-core 0.0.3-beta.6 → 0.0.3-beta.7

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/index.esm.js CHANGED
@@ -3882,10 +3882,12 @@ class FormCore {
3882
3882
  */
3883
3883
  getFormValues() {
3884
3884
  const values = {};
3885
+ const metadata = {};
3885
3886
  const erroredFields = [];
3886
3887
  this.fields.forEach((val, key) => {
3887
3888
  if (val.value) {
3888
3889
  set(values, val.nameToSubmit || key, val.value);
3890
+ metadata[key] = val.metadata;
3889
3891
  }
3890
3892
  if (!val.valid) {
3891
3893
  erroredFields.push(key);
@@ -3893,6 +3895,7 @@ class FormCore {
3893
3895
  });
3894
3896
  return {
3895
3897
  values,
3898
+ metadata,
3896
3899
  erroredFields,
3897
3900
  isValid: this.isValid
3898
3901
  };
@@ -4136,6 +4139,7 @@ class FormGroup {
4136
4139
  submitMultipleFormsByIndex(indexes, callback) {
4137
4140
  let isValid = true;
4138
4141
  let values = {};
4142
+ let metadata = {};
4139
4143
  let erroredFields = [];
4140
4144
  indexes.forEach(index => {
4141
4145
  var _a, _b;
@@ -4143,12 +4147,14 @@ class FormGroup {
4143
4147
  const res = (_b = this.forms.get(index)) === null || _b === void 0 ? void 0 : _b.getFormValues();
4144
4148
  isValid = isValid && ((res === null || res === void 0 ? void 0 : res.isValid) || false);
4145
4149
  values = Object.assign(Object.assign({}, values), (res === null || res === void 0 ? void 0 : res.values) || {});
4150
+ metadata = Object.assign(Object.assign({}, metadata), (res === null || res === void 0 ? void 0 : res.metadata) || {});
4146
4151
  erroredFields = [...erroredFields, ...((res === null || res === void 0 ? void 0 : res.erroredFields) || [])];
4147
4152
  });
4148
4153
  isValid && callback && callback({
4149
4154
  erroredFields,
4150
4155
  isValid,
4151
- values
4156
+ values,
4157
+ metadata
4152
4158
  });
4153
4159
  }
4154
4160
  onDataSubscription({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "0.0.3-beta.6",
3
+ "version": "0.0.3-beta.7",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
@@ -19,6 +19,7 @@ import { TMapper } from './mapper';
19
19
  */
20
20
  type TFormValues<T> = {
21
21
  values: T;
22
+ metadata: unknown;
22
23
  erroredFields: string[];
23
24
  isValid: boolean;
24
25
  };