@arquimedes.co/eureka-forms 1.9.15 → 1.9.17-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.
Files changed (64) hide show
  1. package/dist/App.js +98 -205
  2. package/dist/AxiosAPI.js +3 -3
  3. package/dist/AxiosWidget.js +4 -4
  4. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +104 -207
  5. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +5 -17
  6. package/dist/FormComponents/Form/Form.js +29 -56
  7. package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
  8. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +7 -30
  9. package/dist/FormComponents/Section/Section.js +2 -13
  10. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  11. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +9 -32
  12. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +47 -64
  13. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +41 -102
  14. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +37 -92
  15. package/dist/FormComponents/Step/AYFStepMapper.js +23 -75
  16. package/dist/FormComponents/Step/CBRStepMapper.js +56 -144
  17. package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +3 -26
  18. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +6 -21
  19. package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +3 -26
  20. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +32 -65
  21. package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +2 -13
  22. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +6 -21
  23. package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +2 -13
  24. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +27 -88
  25. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +81 -171
  26. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +15 -41
  27. package/dist/FormComponents/Step/RatingStep/RatingStep.js +2 -13
  28. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +25 -52
  29. package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +3 -26
  30. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +1 -2
  31. package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +3 -26
  32. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +83 -145
  33. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +2 -13
  34. package/dist/FormComponents/Step/Step.js +19 -39
  35. package/dist/FormComponents/Step/StepFunctions.js +14 -16
  36. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +43 -62
  37. package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +2 -13
  38. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +6 -21
  39. package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +2 -13
  40. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -15
  41. package/dist/FormComponents/Step/TitleStep/TitleStep.js +3 -26
  42. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +19 -35
  43. package/dist/FormComponents/Term/Term.js +2 -13
  44. package/dist/Widget.js +13 -25
  45. package/dist/constants/Files/FileExtensions.js +3 -3
  46. package/dist/constants/Files/FileMaxSize.js +1 -1
  47. package/dist/constants/InternalFormStyle.js +1 -1
  48. package/dist/constants/MaterialClassNameSeed.js +1 -1
  49. package/dist/controllers/FileService.js +29 -86
  50. package/dist/index.js +4 -15
  51. package/dist/shared/Loader/Loader.js +5 -17
  52. package/dist/shared/Navbar/Navbar.js +2 -14
  53. package/dist/shared/Rating/Rating.js +4 -27
  54. package/dist/shared/Rating/Ratings/LikeRating.js +9 -21
  55. package/dist/shared/Rating/Ratings/SatisfactionRating.js +15 -27
  56. package/dist/shared/Rating/Ratings/ScaleRating.js +22 -49
  57. package/dist/shared/RoundedButton/RoundedButton.js +12 -24
  58. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +39 -84
  59. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +235 -286
  60. package/dist/shared/RoundedSelect/RoundedSelect.js +103 -152
  61. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +125 -160
  62. package/dist/shared/RoundedTextField/RoundedTextField.js +92 -137
  63. package/dist/utils/CbrFunctions.js +30 -30
  64. package/package.json +4 -4
package/dist/App.js CHANGED
@@ -1,62 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __rest = (this && this.__rest) || function (s, e) {
49
- var t = {};
50
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- };
59
- var _a;
60
1
  import { jsx as _jsx } from "react/jsx-runtime";
61
2
  import { useEffect, useRef, useState } from 'react';
62
3
  import Loader from './shared/Loader/Loader';
@@ -68,21 +9,16 @@ import widgetInstance from './AxiosWidget';
68
9
  import InternalFormStyle from './constants/InternalFormStyle';
69
10
  import { calcCbrForm } from './utils/CbrFunctions';
70
11
  import CBRStepTypes from './constants/CBRFormStepTypes';
71
- function App(_a) {
72
- var _this = this;
73
- var _b, _c, _d, _e;
74
- var apiKey = _a.apiKey, domain = _a.domain, preview = _a.preview, partial = _a.partial, formData = _a.formData, postview = _a.postview, _f = _a.editable, editable = _f === void 0 ? true : _f, isWidget = _a.isWidget, internal = _a.internal, valuesData = _a.valuesData, customSend = _a.customSend, customSteps = _a.customSteps, handleConfirmed = _a.handleConfirmed, others = __rest(_a, ["apiKey", "domain", "preview", "partial", "formData", "postview", "editable", "isWidget", "internal", "valuesData", "customSend", "customSteps", "handleConfirmed"]);
75
- var _g = useState(undefined), form = _g[0], setForm = _g[1];
76
- var _h = useState({}), originalValues = _h[0], setOriginalValues = _h[1];
77
- var _j = useState(undefined), organizationInfo = _j[0], setOrganizationInfo = _j[1];
78
- var migrateFormData = function (formData, valuesData) {
79
- var form = migrateForm(formData);
80
- var steps = Object.values(form.steps);
81
- var hasCBR = steps.find(function (step) {
82
- return step.type.startsWith('CBR');
83
- });
12
+ function App({ apiKey, domain, preview, partial, formData, postview, editable = true, isWidget, internal, valuesData, customSend, customSteps, handleConfirmed, ...others }) {
13
+ const [form, setForm] = useState(undefined);
14
+ const [originalValues, setOriginalValues] = useState({});
15
+ const [organizationInfo, setOrganizationInfo] = useState(undefined);
16
+ const migrateFormData = (formData, valuesData) => {
17
+ const form = migrateForm(formData);
18
+ const steps = Object.values(form.steps);
19
+ const hasCBR = steps.find((step) => step.type.startsWith('CBR'));
84
20
  if (hasCBR !== undefined) {
85
- var CBRForm = calcCbrForm(form, valuesData !== null && valuesData !== void 0 ? valuesData : {});
21
+ const CBRForm = calcCbrForm(form, valuesData ?? {});
86
22
  setForm(CBRForm);
87
23
  }
88
24
  else {
@@ -92,30 +28,20 @@ function App(_a) {
92
28
  setOriginalValues(valuesData);
93
29
  }
94
30
  };
95
- function fetchPreview(formData, valuesData) {
96
- return __awaiter(this, void 0, void 0, function () {
97
- var response;
98
- return __generator(this, function (_a) {
99
- switch (_a.label) {
100
- case 0: return [4 /*yield*/, widgetInstance.get('/organization')];
101
- case 1:
102
- response = _a.sent();
103
- if (response.data) {
104
- setOrganizationInfo(response.data);
105
- migrateFormData(formData, valuesData);
106
- }
107
- return [2 /*return*/];
108
- }
109
- });
110
- });
31
+ async function fetchPreview(formData, valuesData) {
32
+ const response = await widgetInstance.get('/organization');
33
+ if (response.data) {
34
+ setOrganizationInfo(response.data);
35
+ migrateFormData(formData, valuesData);
36
+ }
111
37
  }
112
- useEffect(function () {
38
+ useEffect(() => {
113
39
  if (formData !== undefined) {
114
40
  if (preview && formData.isStandAlone) {
115
41
  fetchPreview(formData, valuesData);
116
42
  }
117
43
  else {
118
- migrateFormData(__assign({}, formData), valuesData);
44
+ migrateFormData({ ...formData }, valuesData);
119
45
  setOrganizationInfo(null);
120
46
  }
121
47
  }
@@ -136,141 +62,106 @@ function App(_a) {
136
62
  setOrganizationInfo(null);
137
63
  }
138
64
  }, []);
139
- var loadLogRocket = function () { return __awaiter(_this, void 0, void 0, function () {
140
- var LogRocket, error_1;
141
- return __generator(this, function (_a) {
142
- switch (_a.label) {
143
- case 0:
144
- if (!(organizationInfo && form !== undefined)) return [3 /*break*/, 4];
145
- if (!(process.env.NODE_ENV === 'production' &&
146
- apiKey !== 'rCgWiEfOSN1TlUmHO28Y0' &&
147
- apiKey !== 'FORMSTEST' &&
148
- !internal &&
149
- !postview &&
150
- !preview)) return [3 /*break*/, 4];
151
- _a.label = 1;
152
- case 1:
153
- _a.trys.push([1, 3, , 4]);
154
- return [4 /*yield*/, import('logrocket')];
155
- case 2:
156
- LogRocket = _a.sent();
65
+ const loadLogRocket = async () => {
66
+ if (organizationInfo && form !== undefined) {
67
+ if (process.env.NODE_ENV === 'production' &&
68
+ apiKey !== 'rCgWiEfOSN1TlUmHO28Y0' &&
69
+ apiKey !== 'FORMSTEST' &&
70
+ !internal &&
71
+ !postview &&
72
+ !preview) {
73
+ try {
74
+ const LogRocket = await import('logrocket');
157
75
  LogRocket.default.init('63mg8a/forms-uv0gd');
158
76
  LogRocket.default.identify(organizationInfo.idOrganization + '/' + apiKey, {
159
77
  name: organizationInfo.name +
160
78
  '/' +
161
- (form ? form === null || form === void 0 ? void 0 : form.name : '404'),
79
+ (form ? form?.name : '404'),
162
80
  });
163
- return [3 /*break*/, 4];
164
- case 3:
165
- error_1 = _a.sent();
166
- console.error('LogRocker Error', error_1);
167
- return [3 /*break*/, 4];
168
- case 4: return [2 /*return*/];
81
+ }
82
+ catch (error) {
83
+ console.error('LogRocker Error', error);
84
+ }
169
85
  }
170
- });
171
- }); };
172
- useEffect(function () {
86
+ }
87
+ };
88
+ useEffect(() => {
173
89
  loadLogRocket();
174
90
  }, [organizationInfo, form]);
175
- var containerRef = useRef();
176
- var loadOrgInfo = function (domain) { return __awaiter(_this, void 0, void 0, function () {
177
- var response, _a, error_2;
178
- return __generator(this, function (_b) {
179
- switch (_b.label) {
180
- case 0:
181
- _b.trys.push([0, 5, , 6]);
182
- if (!domain) return [3 /*break*/, 2];
183
- return [4 /*yield*/, widgetInstance.get("/organization?idOrganization=".concat(domain))];
184
- case 1:
185
- _a = _b.sent();
186
- return [3 /*break*/, 4];
187
- case 2: return [4 /*yield*/, axiosInstance.get('/organization')];
188
- case 3:
189
- _a = _b.sent();
190
- _b.label = 4;
191
- case 4:
192
- response = _a;
193
- if (response === null || response === void 0 ? void 0 : response.data) {
194
- if (response === null || response === void 0 ? void 0 : response.data) {
195
- // document.title = currentOrg.name;
196
- // const favicon: any = document.getElementById('favicon');
197
- // if (favicon !== undefined) {
198
- // favicon.href = currentOrg.partialLogoUrl;
199
- // }
200
- //TODO cambiar el color del navbar en movil
201
- // eslint-disable-next-line no-console
202
- console.log(response === null || response === void 0 ? void 0 : response.data);
203
- setOrganizationInfo(response === null || response === void 0 ? void 0 : response.data);
204
- }
205
- else {
206
- setOrganizationInfo(null);
207
- }
208
- }
209
- return [3 /*break*/, 6];
210
- case 5:
211
- error_2 = _b.sent();
212
- console.error(error_2);
91
+ const containerRef = useRef();
92
+ const loadOrgInfo = async (domain) => {
93
+ try {
94
+ const response = domain
95
+ ? await widgetInstance.get(`/organization?idOrganization=${domain}`)
96
+ : await axiosInstance.get('/organization');
97
+ if (response?.data) {
98
+ if (response?.data) {
99
+ // document.title = currentOrg.name;
100
+ // const favicon: any = document.getElementById('favicon');
101
+ // if (favicon !== undefined) {
102
+ // favicon.href = currentOrg.partialLogoUrl;
103
+ // }
104
+ //TODO cambiar el color del navbar en movil
105
+ // eslint-disable-next-line no-console
106
+ console.log(response?.data);
107
+ setOrganizationInfo(response?.data);
108
+ }
109
+ else {
213
110
  setOrganizationInfo(null);
214
- return [3 /*break*/, 6];
215
- case 6: return [2 /*return*/];
111
+ }
216
112
  }
217
- });
218
- }); };
219
- var loadInfo = function (apiKey, domain) { return __awaiter(_this, void 0, void 0, function () {
220
- var response, error_3;
221
- return __generator(this, function (_a) {
222
- switch (_a.label) {
223
- case 0:
224
- _a.trys.push([0, 2, , 3]);
225
- return [4 /*yield*/, (domain
226
- ? widgetInstance.get("/form/".concat(apiKey, "?idOrganization=").concat(domain))
227
- : axiosInstance.get("/form/".concat(apiKey)))];
228
- case 1:
229
- response = _a.sent();
230
- if (response) {
231
- migrateFormData(response.data, valuesData);
232
- }
233
- return [3 /*break*/, 3];
234
- case 2:
235
- error_3 = _a.sent();
236
- console.error(error_3);
237
- setForm(null);
238
- return [3 /*break*/, 3];
239
- case 3: return [2 /*return*/];
113
+ }
114
+ catch (error) {
115
+ console.error(error);
116
+ setOrganizationInfo(null);
117
+ }
118
+ };
119
+ const loadInfo = async (apiKey, domain) => {
120
+ try {
121
+ const response = await (domain
122
+ ? widgetInstance.get(`/form/${apiKey}?idOrganization=${domain}`)
123
+ : axiosInstance.get(`/form/${apiKey}`));
124
+ if (response) {
125
+ migrateFormData(response.data, valuesData);
240
126
  }
241
- });
242
- }); };
127
+ }
128
+ catch (error) {
129
+ console.error(error);
130
+ setForm(null);
131
+ }
132
+ };
243
133
  if (form === undefined || organizationInfo === undefined) {
244
134
  if (isWidget) {
245
- return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: _jsx(Loader, { size: 50, color: (_c = (_b = organizationInfo === null || organizationInfo === void 0 ? void 0 : organizationInfo.styles) === null || _b === void 0 ? void 0 : _b.primaryColor) !== null && _c !== void 0 ? _c : '#b8b8b8' }) })) })));
135
+ return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: _jsx(Loader, { size: 50, color: organizationInfo?.styles?.primaryColor ??
136
+ '#b8b8b8' }) }) }));
246
137
  }
247
- return (_jsx("div", __assign({ className: styles.curtain }, { children: _jsx(Loader, { size: 50, color: (_e = (_d = organizationInfo === null || organizationInfo === void 0 ? void 0 : organizationInfo.styles) === null || _d === void 0 ? void 0 : _d.primaryColor) !== null && _e !== void 0 ? _e : '#b8b8b8' }) })));
138
+ return (_jsx("div", { className: styles.curtain, children: _jsx(Loader, { size: 50, color: organizationInfo?.styles?.primaryColor ?? '#b8b8b8' }) }));
248
139
  }
249
140
  else if (form === null) {
250
141
  if (organizationInfo === null) {
251
142
  if (isWidget) {
252
- return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "Error" })) })));
143
+ return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "Error" }) }));
253
144
  }
254
- return _jsx("div", __assign({ className: styles.curtain }, { children: "Error" }));
145
+ return _jsx("div", { className: styles.curtain, children: "Error" });
255
146
  }
256
147
  else {
257
148
  if (isWidget) {
258
- return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "404" })) })));
149
+ return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "404" }) }));
259
150
  }
260
- return _jsx("div", __assign({ className: styles.curtain }, { children: "404" }));
151
+ return _jsx("div", { className: styles.curtain, children: "404" });
261
152
  }
262
153
  }
263
154
  else {
264
- return (_jsx("div", __assign({ ref: containerRef, className: styles.container }, { children: _jsx(FormComponent, __assign({}, others, { form: form, reload: function () {
265
- var tempForm = __assign({}, form);
155
+ return (_jsx("div", { ref: containerRef, className: styles.container, children: _jsx(FormComponent, { ...others, form: form, reload: () => {
156
+ const tempForm = { ...form };
266
157
  setForm(undefined);
267
- setTimeout(function () {
158
+ setTimeout(() => {
268
159
  setForm(tempForm);
269
160
  }, 100);
270
161
  if (handleConfirmed) {
271
162
  handleConfirmed();
272
163
  }
273
- }, editable: editable, postview: postview === true, partial: partial === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo !== null && organizationInfo !== void 0 ? organizationInfo : { idOrganization: domain }, customSteps: customSteps !== null && customSteps !== void 0 ? customSteps : {}, isWidget: isWidget === true })) })));
164
+ }, editable: editable, postview: postview === true, partial: partial === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo ?? { idOrganization: domain }, customSteps: customSteps ?? {}, isWidget: isWidget === true }) }));
274
165
  }
275
166
  }
276
167
  export default App;
@@ -281,16 +172,15 @@ export var SIZES;
281
172
  SIZES["MEDIUM"] = "MEDIUM";
282
173
  SIZES["LARGE"] = "LARGE";
283
174
  })(SIZES || (SIZES = {}));
284
- export var SizesToNum = (_a = {},
285
- _a[SIZES.LARGE] = 4,
286
- _a[SIZES.MEDIUM] = 2,
287
- _a[SIZES.SMALL] = 1,
288
- _a);
289
- var migrateForm = function (form) {
290
- var steps = __assign({}, form.steps);
291
- for (var _i = 0, _a = Object.keys(form.steps); _i < _a.length; _i++) {
292
- var idStep = _a[_i];
293
- var step = __assign({}, form.steps[idStep]);
175
+ export const SizesToNum = {
176
+ [SIZES.LARGE]: 4,
177
+ [SIZES.MEDIUM]: 2,
178
+ [SIZES.SMALL]: 1,
179
+ };
180
+ const migrateForm = (form) => {
181
+ const steps = { ...form.steps };
182
+ for (const idStep of Object.keys(form.steps)) {
183
+ const step = { ...form.steps[idStep] };
294
184
  if (step.size && isNaN(step.size)) {
295
185
  step.size = getStaticWidth(step);
296
186
  }
@@ -310,7 +200,10 @@ var migrateForm = function (form) {
310
200
  }
311
201
  steps[idStep] = step;
312
202
  }
313
- var newForm = __assign(__assign({}, form), { steps: steps });
203
+ const newForm = {
204
+ ...form,
205
+ steps,
206
+ };
314
207
  if (form.size === undefined) {
315
208
  if (form.spacingSize) {
316
209
  newForm.size = {
package/dist/AxiosAPI.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import axios from 'axios';
2
- var headers = {};
3
- var axiosInstance = axios.create({
2
+ let headers = {};
3
+ const axiosInstance = axios.create({
4
4
  baseURL: '/api',
5
5
  timeout: 30000,
6
- headers: headers,
6
+ headers,
7
7
  });
8
8
  export default axiosInstance;
@@ -1,8 +1,8 @@
1
1
  import axios from 'axios';
2
- var headers = {};
3
- var widgetInstance = axios.create({
4
- baseURL: "https://api.forms.".concat(process.env.REACT_APP_DOMAIN, "/api"),
2
+ let headers = {};
3
+ const widgetInstance = axios.create({
4
+ baseURL: `https://api.forms.${process.env.REACT_APP_DOMAIN}/api`,
5
5
  timeout: 30000,
6
- headers: headers,
6
+ headers,
7
7
  });
8
8
  export default widgetInstance;