@arquimedes.co/eureka-forms 1.9.19-test → 1.9.20-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 +205 -98
- package/dist/AxiosAPI.js +3 -3
- package/dist/AxiosWidget.js +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +207 -104
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +17 -5
- package/dist/FormComponents/Form/Form.js +56 -29
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +30 -7
- package/dist/FormComponents/Section/Section.js +13 -2
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +32 -9
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +64 -47
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +102 -41
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +92 -37
- package/dist/FormComponents/Step/AYFStepMapper.js +75 -23
- package/dist/FormComponents/Step/CBRStepMapper.js +144 -56
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +26 -3
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +21 -6
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +26 -3
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +65 -32
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +21 -6
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +88 -27
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +171 -81
- package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +41 -15
- package/dist/FormComponents/Step/RatingStep/RatingStep.js +13 -2
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +52 -25
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +26 -3
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -1
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +26 -3
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -83
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormComponents/Step/Step.js +39 -19
- package/dist/FormComponents/Step/StepFunctions.js +16 -14
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +62 -43
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +13 -2
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +21 -6
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +15 -3
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +26 -3
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +35 -19
- package/dist/FormComponents/Term/Term.js +13 -2
- package/dist/Widget.js +25 -13
- 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 +86 -29
- package/dist/index.js +15 -4
- package/dist/shared/Loader/Loader.js +17 -5
- package/dist/shared/Navbar/Navbar.js +14 -2
- package/dist/shared/Rating/Rating.js +27 -4
- package/dist/shared/Rating/Ratings/LikeRating.js +21 -9
- package/dist/shared/Rating/Ratings/SatisfactionRating.js +27 -15
- package/dist/shared/Rating/Ratings/ScaleRating.js +49 -22
- package/dist/shared/RoundedButton/RoundedButton.js +24 -12
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +84 -39
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +286 -235
- package/dist/shared/RoundedSelect/RoundedSelect.js +152 -103
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +160 -125
- package/dist/shared/RoundedTextField/RoundedTextField.js +137 -92
- package/dist/utils/CbrFunctions.js +30 -30
- package/package.json +1 -3
package/dist/App.js
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
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;
|
|
1
60
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
61
|
import { useEffect, useRef, useState } from 'react';
|
|
3
62
|
import Loader from './shared/Loader/Loader';
|
|
@@ -9,16 +68,21 @@ import widgetInstance from './AxiosWidget';
|
|
|
9
68
|
import InternalFormStyle from './constants/InternalFormStyle';
|
|
10
69
|
import { calcCbrForm } from './utils/CbrFunctions';
|
|
11
70
|
import CBRStepTypes from './constants/CBRFormStepTypes';
|
|
12
|
-
function App(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
+
});
|
|
20
84
|
if (hasCBR !== undefined) {
|
|
21
|
-
|
|
85
|
+
var CBRForm = calcCbrForm(form, valuesData !== null && valuesData !== void 0 ? valuesData : {});
|
|
22
86
|
setForm(CBRForm);
|
|
23
87
|
}
|
|
24
88
|
else {
|
|
@@ -28,20 +92,30 @@ function App({ apiKey, domain, preview, partial, formData, postview, editable =
|
|
|
28
92
|
setOriginalValues(valuesData);
|
|
29
93
|
}
|
|
30
94
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
});
|
|
37
111
|
}
|
|
38
|
-
useEffect(()
|
|
112
|
+
useEffect(function () {
|
|
39
113
|
if (formData !== undefined) {
|
|
40
114
|
if (preview && formData.isStandAlone) {
|
|
41
115
|
fetchPreview(formData, valuesData);
|
|
42
116
|
}
|
|
43
117
|
else {
|
|
44
|
-
migrateFormData({
|
|
118
|
+
migrateFormData(__assign({}, formData), valuesData);
|
|
45
119
|
setOrganizationInfo(null);
|
|
46
120
|
}
|
|
47
121
|
}
|
|
@@ -62,106 +136,141 @@ function App({ apiKey, domain, preview, partial, formData, postview, editable =
|
|
|
62
136
|
setOrganizationInfo(null);
|
|
63
137
|
}
|
|
64
138
|
}, []);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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();
|
|
75
157
|
LogRocket.default.init('63mg8a/forms-uv0gd');
|
|
76
158
|
LogRocket.default.identify(organizationInfo.idOrganization + '/' + apiKey, {
|
|
77
159
|
name: organizationInfo.name +
|
|
78
160
|
'/' +
|
|
79
|
-
(form ? form
|
|
161
|
+
(form ? form === null || form === void 0 ? void 0 : form.name : '404'),
|
|
80
162
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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*/];
|
|
85
169
|
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
useEffect(()
|
|
170
|
+
});
|
|
171
|
+
}); };
|
|
172
|
+
useEffect(function () {
|
|
89
173
|
loadLogRocket();
|
|
90
174
|
}, [organizationInfo, form]);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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);
|
|
110
213
|
setOrganizationInfo(null);
|
|
111
|
-
|
|
214
|
+
return [3 /*break*/, 6];
|
|
215
|
+
case 6: return [2 /*return*/];
|
|
112
216
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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*/];
|
|
126
240
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
console.error(error);
|
|
130
|
-
setForm(null);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
241
|
+
});
|
|
242
|
+
}); };
|
|
133
243
|
if (form === undefined || organizationInfo === undefined) {
|
|
134
244
|
if (isWidget) {
|
|
135
|
-
return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: _jsx(Loader, { size: 50, color: organizationInfo
|
|
136
|
-
'#b8b8b8' }) }) }));
|
|
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' }) })) })));
|
|
137
246
|
}
|
|
138
|
-
return (_jsx("div", { className: styles.curtain, children: _jsx(Loader, { size: 50, color: organizationInfo
|
|
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' }) })));
|
|
139
248
|
}
|
|
140
249
|
else if (form === null) {
|
|
141
250
|
if (organizationInfo === null) {
|
|
142
251
|
if (isWidget) {
|
|
143
|
-
return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "Error" }) }));
|
|
252
|
+
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "Error" })) })));
|
|
144
253
|
}
|
|
145
|
-
return _jsx("div", { className: styles.curtain, children: "Error" });
|
|
254
|
+
return _jsx("div", __assign({ className: styles.curtain }, { children: "Error" }));
|
|
146
255
|
}
|
|
147
256
|
else {
|
|
148
257
|
if (isWidget) {
|
|
149
|
-
return (_jsx("div", { className: styles.widgetContainer, children: _jsx("div", { className: styles.curtain, children: "404" }) }));
|
|
258
|
+
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "404" })) })));
|
|
150
259
|
}
|
|
151
|
-
return _jsx("div", { className: styles.curtain, children: "404" });
|
|
260
|
+
return _jsx("div", __assign({ className: styles.curtain }, { children: "404" }));
|
|
152
261
|
}
|
|
153
262
|
}
|
|
154
263
|
else {
|
|
155
|
-
return (_jsx("div", { ref: containerRef, className: styles.container, children: _jsx(FormComponent, {
|
|
156
|
-
|
|
264
|
+
return (_jsx("div", __assign({ ref: containerRef, className: styles.container }, { children: _jsx(FormComponent, __assign({}, others, { form: form, reload: function () {
|
|
265
|
+
var tempForm = __assign({}, form);
|
|
157
266
|
setForm(undefined);
|
|
158
|
-
setTimeout(()
|
|
267
|
+
setTimeout(function () {
|
|
159
268
|
setForm(tempForm);
|
|
160
269
|
}, 100);
|
|
161
270
|
if (handleConfirmed) {
|
|
162
271
|
handleConfirmed();
|
|
163
272
|
}
|
|
164
|
-
}, editable: editable, postview: postview === true, partial: partial === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo
|
|
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 })) })));
|
|
165
274
|
}
|
|
166
275
|
}
|
|
167
276
|
export default App;
|
|
@@ -172,15 +281,16 @@ export var SIZES;
|
|
|
172
281
|
SIZES["MEDIUM"] = "MEDIUM";
|
|
173
282
|
SIZES["LARGE"] = "LARGE";
|
|
174
283
|
})(SIZES || (SIZES = {}));
|
|
175
|
-
export
|
|
176
|
-
[SIZES.LARGE]
|
|
177
|
-
[SIZES.MEDIUM]
|
|
178
|
-
[SIZES.SMALL]
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
for (
|
|
183
|
-
|
|
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]);
|
|
184
294
|
if (step.size && isNaN(step.size)) {
|
|
185
295
|
step.size = getStaticWidth(step);
|
|
186
296
|
}
|
|
@@ -200,10 +310,7 @@ const migrateForm = (form) => {
|
|
|
200
310
|
}
|
|
201
311
|
steps[idStep] = step;
|
|
202
312
|
}
|
|
203
|
-
|
|
204
|
-
...form,
|
|
205
|
-
steps,
|
|
206
|
-
};
|
|
313
|
+
var newForm = __assign(__assign({}, form), { steps: steps });
|
|
207
314
|
if (form.size === undefined) {
|
|
208
315
|
if (form.spacingSize) {
|
|
209
316
|
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
|
+
var headers = {};
|
|
3
|
+
var widgetInstance = axios.create({
|
|
4
|
+
baseURL: "https://api.forms.".concat(process.env.REACT_APP_DOMAIN, "/api"),
|
|
5
5
|
timeout: 30000,
|
|
6
|
-
headers,
|
|
6
|
+
headers: headers,
|
|
7
7
|
});
|
|
8
8
|
export default widgetInstance;
|