@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.
- package/dist/App.js +98 -205
- package/dist/AxiosAPI.js +3 -3
- package/dist/AxiosWidget.js +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +104 -207
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +5 -17
- package/dist/FormComponents/Form/Form.js +29 -56
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +7 -30
- package/dist/FormComponents/Section/Section.js +2 -13
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +9 -32
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +47 -64
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +41 -102
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +37 -92
- package/dist/FormComponents/Step/AYFStepMapper.js +23 -75
- package/dist/FormComponents/Step/CBRStepMapper.js +56 -144
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +3 -26
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +6 -21
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +3 -26
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +32 -65
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +2 -13
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +6 -21
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +2 -13
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +27 -88
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +81 -171
- package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +15 -41
- package/dist/FormComponents/Step/RatingStep/RatingStep.js +2 -13
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +25 -52
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +3 -26
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +1 -2
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +3 -26
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +83 -145
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +2 -13
- package/dist/FormComponents/Step/Step.js +19 -39
- package/dist/FormComponents/Step/StepFunctions.js +14 -16
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +43 -62
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +2 -13
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +6 -21
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +2 -13
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -15
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +3 -26
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +19 -35
- package/dist/FormComponents/Term/Term.js +2 -13
- package/dist/Widget.js +13 -25
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.js +1 -1
- package/dist/controllers/FileService.js +29 -86
- package/dist/index.js +4 -15
- package/dist/shared/Loader/Loader.js +5 -17
- package/dist/shared/Navbar/Navbar.js +2 -14
- package/dist/shared/Rating/Rating.js +4 -27
- package/dist/shared/Rating/Ratings/LikeRating.js +9 -21
- package/dist/shared/Rating/Ratings/SatisfactionRating.js +15 -27
- package/dist/shared/Rating/Ratings/ScaleRating.js +22 -49
- package/dist/shared/RoundedButton/RoundedButton.js +12 -24
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +39 -84
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +235 -286
- package/dist/shared/RoundedSelect/RoundedSelect.js +103 -152
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +125 -160
- package/dist/shared/RoundedTextField/RoundedTextField.js +92 -137
- package/dist/utils/CbrFunctions.js +30 -30
- 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(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
79
|
+
(form ? form?.name : '404'),
|
|
162
80
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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(
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
useEffect(() => {
|
|
173
89
|
loadLogRocket();
|
|
174
90
|
}, [organizationInfo, form]);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
215
|
-
case 6: return [2 /*return*/];
|
|
111
|
+
}
|
|
216
112
|
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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",
|
|
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",
|
|
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",
|
|
143
|
+
return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "Error" }) }));
|
|
253
144
|
}
|
|
254
|
-
return _jsx("div",
|
|
145
|
+
return _jsx("div", { className: styles.curtain, children: "Error" });
|
|
255
146
|
}
|
|
256
147
|
else {
|
|
257
148
|
if (isWidget) {
|
|
258
|
-
return (_jsx("div",
|
|
149
|
+
return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "404" }) }));
|
|
259
150
|
}
|
|
260
|
-
return _jsx("div",
|
|
151
|
+
return _jsx("div", { className: styles.curtain, children: "404" });
|
|
261
152
|
}
|
|
262
153
|
}
|
|
263
154
|
else {
|
|
264
|
-
return (_jsx("div",
|
|
265
|
-
|
|
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(
|
|
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
|
|
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
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
for (
|
|
292
|
-
|
|
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
|
-
|
|
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
package/dist/AxiosWidget.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
baseURL:
|
|
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
|
|
6
|
+
headers,
|
|
7
7
|
});
|
|
8
8
|
export default widgetInstance;
|