eddev 0.3.26 → 0.3.27

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.
@@ -152,6 +152,7 @@ function useGravityForm(opts) {
152
152
  dispatch({ type: "field", id: field.id, value: value });
153
153
  } }), optionsForField(field)), { showLabel: field.labelPlacement !== "hidden_label" })); });
154
154
  var _b = (0, react_2.useState)(null), submitter = _b[0], setSubmitter = _b[1];
155
+ console.log("form.fields", opts.form.fields);
155
156
  (0, react_1.useEffect)(function () {
156
157
  var cancelled = false;
157
158
  setSubmitter({
@@ -184,7 +185,7 @@ function useGravityForm(opts) {
184
185
  }
185
186
  exports.useGravityForm = useGravityForm;
186
187
  function prepareValuesPayload(form, state, data) {
187
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
188
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
188
189
  var _loop_1 = function (field) {
189
190
  var value = state.values[field.id];
190
191
  var key = "input_" + field.id;
@@ -195,23 +196,24 @@ function prepareValuesPayload(form, state, data) {
195
196
  }
196
197
  else if (field.type === "consent") {
197
198
  data.append("".concat(key, "_1"), value ? "1" : "");
198
- data.append("".concat(key, ".2"), (_a = field === null || field === void 0 ? void 0 : field.consentText) !== null && _a !== void 0 ? _a : "");
199
+ data.append("".concat(key, ".1"), value ? "1" : "");
200
+ data.append("".concat(key, ".2"), (_b = (_a = field === null || field === void 0 ? void 0 : field.consentText) !== null && _a !== void 0 ? _a : field === null || field === void 0 ? void 0 : field.checkboxLabel) !== null && _b !== void 0 ? _b : "");
199
201
  data.append("".concat(key, ".3"), "2");
200
202
  }
201
203
  else if (field.type === "name") {
202
- data.append("".concat(key, "_2"), (_b = value === null || value === void 0 ? void 0 : value.prefix) !== null && _b !== void 0 ? _b : "");
203
- data.append("".concat(key, "_3"), (_c = value === null || value === void 0 ? void 0 : value.first) !== null && _c !== void 0 ? _c : "");
204
- data.append("".concat(key, "_4"), (_d = value === null || value === void 0 ? void 0 : value.middle) !== null && _d !== void 0 ? _d : "");
205
- data.append("".concat(key, "_6"), (_e = value === null || value === void 0 ? void 0 : value.last) !== null && _e !== void 0 ? _e : "");
206
- data.append("".concat(key, "_8"), (_f = value === null || value === void 0 ? void 0 : value.suffix) !== null && _f !== void 0 ? _f : "");
204
+ data.append("".concat(key, "_2"), (_c = value === null || value === void 0 ? void 0 : value.prefix) !== null && _c !== void 0 ? _c : "");
205
+ data.append("".concat(key, "_3"), (_d = value === null || value === void 0 ? void 0 : value.first) !== null && _d !== void 0 ? _d : "");
206
+ data.append("".concat(key, "_4"), (_e = value === null || value === void 0 ? void 0 : value.middle) !== null && _e !== void 0 ? _e : "");
207
+ data.append("".concat(key, "_6"), (_f = value === null || value === void 0 ? void 0 : value.last) !== null && _f !== void 0 ? _f : "");
208
+ data.append("".concat(key, "_8"), (_g = value === null || value === void 0 ? void 0 : value.suffix) !== null && _g !== void 0 ? _g : "");
207
209
  }
208
210
  else if (field.type === "address") {
209
- data.append("".concat(key, "_1"), (_g = value === null || value === void 0 ? void 0 : value.address1) !== null && _g !== void 0 ? _g : "");
210
- data.append("".concat(key, "_2"), (_h = value === null || value === void 0 ? void 0 : value.address2) !== null && _h !== void 0 ? _h : "");
211
- data.append("".concat(key, "_3"), (_j = value === null || value === void 0 ? void 0 : value.city) !== null && _j !== void 0 ? _j : "");
212
- data.append("".concat(key, "_4"), (_k = value === null || value === void 0 ? void 0 : value.state) !== null && _k !== void 0 ? _k : "");
213
- data.append("".concat(key, "_5"), (_l = value === null || value === void 0 ? void 0 : value.zip) !== null && _l !== void 0 ? _l : "");
214
- data.append("".concat(key, "_6"), (_m = value === null || value === void 0 ? void 0 : value.country) !== null && _m !== void 0 ? _m : "");
211
+ data.append("".concat(key, "_1"), (_h = value === null || value === void 0 ? void 0 : value.address1) !== null && _h !== void 0 ? _h : "");
212
+ data.append("".concat(key, "_2"), (_j = value === null || value === void 0 ? void 0 : value.address2) !== null && _j !== void 0 ? _j : "");
213
+ data.append("".concat(key, "_3"), (_k = value === null || value === void 0 ? void 0 : value.city) !== null && _k !== void 0 ? _k : "");
214
+ data.append("".concat(key, "_4"), (_l = value === null || value === void 0 ? void 0 : value.state) !== null && _l !== void 0 ? _l : "");
215
+ data.append("".concat(key, "_5"), (_m = value === null || value === void 0 ? void 0 : value.zip) !== null && _m !== void 0 ? _m : "");
216
+ data.append("".concat(key, "_6"), (_o = value === null || value === void 0 ? void 0 : value.country) !== null && _o !== void 0 ? _o : "");
215
217
  }
216
218
  else if (field.type === "captcha") {
217
219
  data.append("g-recaptcha-response", value);
@@ -236,8 +238,8 @@ function prepareValuesPayload(form, state, data) {
236
238
  }
237
239
  }
238
240
  };
239
- for (var _i = 0, _o = form.fields; _i < _o.length; _i++) {
240
- var field = _o[_i];
241
+ for (var _i = 0, _p = form.fields; _i < _p.length; _i++) {
242
+ var field = _p[_i];
241
243
  _loop_1(field);
242
244
  }
243
245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {