@arquimedes.co/eureka-forms 1.9.59 → 1.9.61-test

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/dist/App.js CHANGED
@@ -382,12 +382,6 @@ var mapOriginalValues = function (originalValues, form) {
382
382
  }
383
383
  }
384
384
  }
385
- for (var _f = 0, _g = Object.keys(element); _f < _g.length; _f++) {
386
- var idValue_1 = _g[_f];
387
- if (!step.steps[idValue_1] && idValue_1 !== 'id') {
388
- newValues[idValue_1] = element[idValue_1];
389
- }
390
- }
391
385
  mappedElements.push(mappedElement);
392
386
  }
393
387
  newValues[step.id] = mappedElements;
@@ -94,14 +94,14 @@ function ColumnForm(_a) {
94
94
  return _jsx("div", {});
95
95
  }
96
96
  var onSubmit = function (token) { return __awaiter(_this, void 0, void 0, function () {
97
- var valid, values, newValues, _i, _a, idStep, customResp, payload, url, resp, _b, error_1;
98
- return __generator(this, function (_c) {
99
- switch (_c.label) {
97
+ var valid, values, newValues, deleteIds, _i, _a, idStep, _b, deleteIds_1, id, customResp, payload, url, resp, _c, error_1;
98
+ return __generator(this, function (_d) {
99
+ switch (_d.label) {
100
100
  case 0:
101
101
  if (!(apiKey || internal || customSend)) return [3 /*break*/, 11];
102
102
  return [4 /*yield*/, trigger(undefined, { shouldFocus: true })];
103
103
  case 1:
104
- valid = _c.sent();
104
+ valid = _d.sent();
105
105
  values = getValues();
106
106
  if (!!valid) return [3 /*break*/, 2];
107
107
  console.error('ERRORS:', errors);
@@ -111,17 +111,22 @@ function ColumnForm(_a) {
111
111
  }, 500);
112
112
  return [3 /*break*/, 11];
113
113
  case 2:
114
- _c.trys.push([2, 10, , 11]);
114
+ _d.trys.push([2, 10, , 11]);
115
115
  setLoading(true);
116
116
  newValues = {};
117
+ deleteIds = [];
117
118
  for (_i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
118
119
  idStep = _a[_i];
119
- newValues[idStep] = calcValue(newValues, idStep, form.steps, values, customSteps);
120
+ newValues[idStep] = calcValue(idStep, form.steps, values, customSteps, deleteIds);
121
+ }
122
+ for (_b = 0, deleteIds_1 = deleteIds; _b < deleteIds_1.length; _b++) {
123
+ id = deleteIds_1[_b];
124
+ delete newValues[id];
120
125
  }
121
126
  if (!customSend) return [3 /*break*/, 4];
122
127
  return [4 /*yield*/, customSend(newValues, reload)];
123
128
  case 3:
124
- customResp = _c.sent();
129
+ customResp = _d.sent();
125
130
  setLoading(false);
126
131
  return [2 /*return*/, customResp];
127
132
  case 4:
@@ -135,21 +140,21 @@ function ColumnForm(_a) {
135
140
  if (!(domain || internal)) return [3 /*break*/, 6];
136
141
  return [4 /*yield*/, widgetInstance.post("".concat(url, "?idOrganization=").concat(domain), payload)];
137
142
  case 5:
138
- _b = _c.sent();
143
+ _c = _d.sent();
139
144
  return [3 /*break*/, 8];
140
145
  case 6: return [4 /*yield*/, axiosInstance.post(url, payload)];
141
146
  case 7:
142
- _b = _c.sent();
143
- _c.label = 8;
147
+ _c = _d.sent();
148
+ _d.label = 8;
144
149
  case 8:
145
- resp = _b;
150
+ resp = _c;
146
151
  setShowConfirmation(resp === null || resp === void 0 ? void 0 : resp.data);
147
- _c.label = 9;
152
+ _d.label = 9;
148
153
  case 9:
149
154
  setLoading(false);
150
155
  return [3 /*break*/, 11];
151
156
  case 10:
152
- error_1 = _c.sent();
157
+ error_1 = _d.sent();
153
158
  console.error(error_1);
154
159
  setLoading(false);
155
160
  return [3 /*break*/, 11];
@@ -220,7 +225,7 @@ function calcNextSection(form, idSection, sections) {
220
225
  }
221
226
  }
222
227
  }
223
- var calcValue = function (newValues, idStep, steps, values, customSteps, value) {
228
+ var calcValue = function (idStep, steps, values, customSteps, deleteIds, value) {
224
229
  var _a, _b;
225
230
  if (value === void 0) { value = values[idStep]; }
226
231
  var step = steps[idStep];
@@ -272,8 +277,8 @@ var calcValue = function (newValues, idStep, steps, values, customSteps, value)
272
277
  var idStep_1 = _d[_c];
273
278
  var mappedId = element.ids[idStep_1];
274
279
  if (values[mappedId] !== undefined) {
275
- newValue[idStep_1] = calcValue(newValues, idStep_1, step.steps, values, customSteps, values[mappedId]);
276
- delete newValues[mappedId];
280
+ newValue[idStep_1] = calcValue(idStep_1, step.steps, values, customSteps, deleteIds, values[mappedId]);
281
+ deleteIds.push(mappedId);
277
282
  }
278
283
  }
279
284
  mappedValues.push(newValue);
@@ -25,6 +25,7 @@ import { createElement as _createElement } from "react";
25
25
  import StepComponent from '../../Step/Step';
26
26
  import styles from './MaterialSection.module.css';
27
27
  function MaterialSection(_a) {
28
+ var _b;
28
29
  var form = _a.form, section = _a.section, widthStats = _a.widthStats, sendLabel = _a.sendLabel, others = __rest(_a, ["form", "section", "widthStats", "sendLabel"]);
29
30
  return (_jsx("div", __assign({ className: styles.container, style: {
30
31
  width: (form.size.blockSize + form.size.spacingSize) *
@@ -33,7 +34,7 @@ function MaterialSection(_a) {
33
34
  widthStats.currentBreakPoint < form.size.blockNum
34
35
  ? 'center'
35
36
  : 'normal',
36
- } }, { children: section.steps.map(function (idStep) {
37
+ } }, { children: (_b = section.steps) === null || _b === void 0 ? void 0 : _b.map(function (idStep) {
37
38
  var step = form.steps[idStep];
38
39
  //If partial is active only display steps with originalValues
39
40
  if (step) {
@@ -4,11 +4,10 @@
4
4
  width: 900px;
5
5
  max-width: 100%;
6
6
  margin-top: 5px;
7
+ margin-bottom: 10px;
7
8
  }
8
9
 
9
10
  .collapsibleLabel {
10
- margin-top: 10px;
11
- margin-bottom: 10px;
12
11
  margin-left: 10px;
13
12
  font-size: 20px;
14
13
  font-weight: 600;
@@ -58,6 +57,6 @@
58
57
  height: 1px;
59
58
  width: calc(100% - 20px);
60
59
  margin-left: 10px;
61
- margin-bottom: 5px;
60
+ margin-bottom: 10px;
62
61
  border-radius: 20px;
63
62
  }
@@ -203,9 +203,7 @@ function FileUploadStep(_a) {
203
203
  };
204
204
  return (_jsxs("div", __assign({ className: styles.container +
205
205
  (error || !!errors[step.id] ? ' EF-error' : ''), style: editable == false || postview
206
- ? {
207
- paddingBottom: 5,
208
- }
206
+ ? {}
209
207
  : {
210
208
  minHeight: '100px',
211
209
  }, "data-testid": step.id }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label })), step.description && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: { color: formStyle.descriptionTextColor } }, { children: step.description }))), _jsx("input", { type: "file", ref: inputRef, className: styles.filesInput, onChange: function (e) {
@@ -94,10 +94,10 @@ function StepComponent(_a) {
94
94
  break;
95
95
  }
96
96
  if (step.type.startsWith('CBR')) {
97
- return _jsx(CBRStepMapper, __assign({}, props, { step: step }));
97
+ return (_jsx(CBRStepMapper, __assign({}, props, { step: step, editable: editable })));
98
98
  }
99
99
  else if (step.type.startsWith('AYF')) {
100
- return _jsx(AYFStepMapper, __assign({}, props, { step: step }));
100
+ return (_jsx(AYFStepMapper, __assign({}, props, { step: step, editable: editable })));
101
101
  }
102
102
  return _jsx("div", {});
103
103
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "1.9.59",
4
+ "version":"1.9.61-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",