@bigbinary/neeto-form-frontend 2.0.1 → 2.0.3
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/app/javascript/src/translations/de.json +26 -6
- package/app/javascript/src/translations/en.json +7 -7
- package/app/javascript/src/translations/es.json +34 -0
- package/app/javascript/src/translations/fr.json +34 -0
- package/app/javascript/src/translations/nl.json +34 -0
- package/app/javascript/src/translations/pl.json +34 -0
- package/app/javascript/src/translations/pt.json +34 -0
- package/dist/index.cjs.js +1765 -1482
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1819 -1536
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs.js
CHANGED
|
@@ -11,6 +11,7 @@ var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
|
11
11
|
var ramda = require('ramda');
|
|
12
12
|
var reactQuery = require('react-query');
|
|
13
13
|
var i18next = require('i18next');
|
|
14
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
15
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
15
16
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
16
17
|
var axios = require('axios');
|
|
@@ -18,6 +19,7 @@ var ReactDOM = require('react-dom');
|
|
|
18
19
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
19
20
|
var reactI18next = require('react-i18next');
|
|
20
21
|
var zustand = require('zustand');
|
|
22
|
+
var neetoEditor = require('@bigbinary/neeto-editor');
|
|
21
23
|
var shallow = require('zustand/shallow');
|
|
22
24
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
23
25
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
@@ -28,7 +30,6 @@ var Pane = require('@bigbinary/neetoui/Pane');
|
|
|
28
30
|
var Form$2 = require('@bigbinary/neetoui/formik/Form');
|
|
29
31
|
var Select = require('@bigbinary/neetoui/formik/Select');
|
|
30
32
|
var Textarea = require('@bigbinary/neetoui/formik/Textarea');
|
|
31
|
-
var neetoEditor = require('@bigbinary/neeto-editor');
|
|
32
33
|
var Switch = require('@bigbinary/neetoui/formik/Switch');
|
|
33
34
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
34
35
|
var Button$1 = require('@bigbinary/neetoui/Button');
|
|
@@ -115,21 +116,6 @@ var Select__default$1 = /*#__PURE__*/_interopDefaultLegacy(Select$1);
|
|
|
115
116
|
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
116
117
|
var Textarea__default$1 = /*#__PURE__*/_interopDefaultLegacy(Textarea$1);
|
|
117
118
|
|
|
118
|
-
function _extends$8() {
|
|
119
|
-
_extends$8 = Object.assign ? Object.assign.bind() : function (target) {
|
|
120
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
121
|
-
var source = arguments[i];
|
|
122
|
-
for (var key in source) {
|
|
123
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
124
|
-
target[key] = source[key];
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return target;
|
|
129
|
-
};
|
|
130
|
-
return _extends$8.apply(this, arguments);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
119
|
function _typeof$4(o) {
|
|
134
120
|
"@babel/helpers - typeof";
|
|
135
121
|
|
|
@@ -228,11 +214,13 @@ var _excluded$g = ["size"],
|
|
|
228
214
|
_excluded3$2 = ["size"],
|
|
229
215
|
_excluded4$1 = ["size"],
|
|
230
216
|
_excluded5$1 = ["size"];
|
|
217
|
+
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
218
|
+
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
231
219
|
var Star = function Star(props) {
|
|
232
220
|
var _props$size = props.size,
|
|
233
221
|
size = _props$size === void 0 ? 20 : _props$size,
|
|
234
222
|
other = _objectWithoutProperties$1(props, _excluded$g);
|
|
235
|
-
return /*#__PURE__*/
|
|
223
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
236
224
|
fill: "none",
|
|
237
225
|
height: size,
|
|
238
226
|
stroke: "currentColor",
|
|
@@ -242,15 +230,17 @@ var Star = function Star(props) {
|
|
|
242
230
|
viewBox: "0 0 24 24",
|
|
243
231
|
width: size,
|
|
244
232
|
xmlns: "http://www.w3.org/2000/svg"
|
|
245
|
-
}, other),
|
|
246
|
-
|
|
233
|
+
}, other), {}, {
|
|
234
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
235
|
+
d: "M12 2L15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2z"
|
|
236
|
+
})
|
|
247
237
|
}));
|
|
248
238
|
};
|
|
249
239
|
var Heart = function Heart(props) {
|
|
250
240
|
var _props$size2 = props.size,
|
|
251
241
|
size = _props$size2 === void 0 ? 20 : _props$size2,
|
|
252
242
|
other = _objectWithoutProperties$1(props, _excluded2$2);
|
|
253
|
-
return /*#__PURE__*/
|
|
243
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
254
244
|
fill: "none",
|
|
255
245
|
height: size,
|
|
256
246
|
stroke: "currentColor",
|
|
@@ -260,15 +250,17 @@ var Heart = function Heart(props) {
|
|
|
260
250
|
viewBox: "0 0 24 24",
|
|
261
251
|
width: size,
|
|
262
252
|
xmlns: "http://www.w3.org/2000/svg"
|
|
263
|
-
}, other),
|
|
264
|
-
|
|
253
|
+
}, other), {}, {
|
|
254
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
255
|
+
d: "M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"
|
|
256
|
+
})
|
|
265
257
|
}));
|
|
266
258
|
};
|
|
267
259
|
var Zap = function Zap(props) {
|
|
268
260
|
var _props$size3 = props.size,
|
|
269
261
|
size = _props$size3 === void 0 ? 20 : _props$size3,
|
|
270
262
|
other = _objectWithoutProperties$1(props, _excluded3$2);
|
|
271
|
-
return /*#__PURE__*/
|
|
263
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
272
264
|
fill: "none",
|
|
273
265
|
height: size,
|
|
274
266
|
stroke: "currentColor",
|
|
@@ -278,15 +270,17 @@ var Zap = function Zap(props) {
|
|
|
278
270
|
viewBox: "0 0 24 24",
|
|
279
271
|
width: size,
|
|
280
272
|
xmlns: "http://www.w3.org/2000/svg"
|
|
281
|
-
}, other),
|
|
282
|
-
|
|
273
|
+
}, other), {}, {
|
|
274
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
275
|
+
d: "M13 2L3 14 12 14 11 22 21 10 12 10 13 2z"
|
|
276
|
+
})
|
|
283
277
|
}));
|
|
284
278
|
};
|
|
285
279
|
var Crown = function Crown(_ref) {
|
|
286
280
|
var _ref$size = _ref.size,
|
|
287
281
|
size = _ref$size === void 0 ? 20 : _ref$size,
|
|
288
282
|
otherProps = _objectWithoutProperties$1(_ref, _excluded4$1);
|
|
289
|
-
return /*#__PURE__*/
|
|
283
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
290
284
|
fill: "none",
|
|
291
285
|
height: size,
|
|
292
286
|
stroke: "currentColor",
|
|
@@ -296,19 +290,21 @@ var Crown = function Crown(_ref) {
|
|
|
296
290
|
viewBox: "0 0 24 24",
|
|
297
291
|
width: size,
|
|
298
292
|
xmlns: "http://www.w3.org/2000/svg"
|
|
299
|
-
}, otherProps),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
293
|
+
}, otherProps), {}, {
|
|
294
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
295
|
+
d: "M22.3186 17.8652C22.3186 18.8915 21.4789 19.7311 20.4527 19.7311L20.4714 19.733H5.54466C4.49979 19.733 3.67882 18.912 3.67882 17.8858V8.61254H3.66016C3.66016 8.0901 4.07064 7.67962 4.59308 7.67962C4.761 7.67962 4.94759 7.71693 5.09686 7.82888L9.23902 10.5903L12.1871 6.14963V6.13097C12.4669 5.70182 13.0453 5.57122 13.4745 5.86975C13.5678 5.92573 13.6611 6.01902 13.717 6.11231L16.6651 10.5344L20.8072 7.75425C21.2177 7.45572 21.8129 7.56767 22.0928 7.99681C22.1861 8.14608 22.2421 8.314 22.2421 8.50059V17.7552",
|
|
296
|
+
stroke: "currentColor",
|
|
297
|
+
strokeLinecap: "round",
|
|
298
|
+
strokeLinejoin: "round",
|
|
299
|
+
strokeWidth: "1.5"
|
|
300
|
+
})
|
|
305
301
|
}));
|
|
306
302
|
};
|
|
307
303
|
var Trophy = function Trophy(_ref2) {
|
|
308
304
|
var _ref2$size = _ref2.size,
|
|
309
305
|
size = _ref2$size === void 0 ? 20 : _ref2$size,
|
|
310
306
|
otherProps = _objectWithoutProperties$1(_ref2, _excluded5$1);
|
|
311
|
-
return /*#__PURE__*/
|
|
307
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$D(_objectSpread$D({
|
|
312
308
|
fill: "none",
|
|
313
309
|
height: size,
|
|
314
310
|
stroke: "currentColor",
|
|
@@ -318,36 +314,38 @@ var Trophy = function Trophy(_ref2) {
|
|
|
318
314
|
viewBox: "0 0 24 24",
|
|
319
315
|
width: size,
|
|
320
316
|
xmlns: "http://www.w3.org/2000/svg"
|
|
321
|
-
}, otherProps),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
317
|
+
}, otherProps), {}, {
|
|
318
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
319
|
+
d: "M17.6873 8.05176H20.0311V8.05176C20.894 8.05176 21.5936 8.75131 21.5936 9.61426V11.1768C21.5936 12.9026 20.1944 14.3018 18.4686 14.3018H17.5889",
|
|
320
|
+
stroke: "currentColor",
|
|
321
|
+
strokeLinecap: "round",
|
|
322
|
+
strokeLinejoin: "round",
|
|
323
|
+
strokeWidth: "1.5"
|
|
324
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
325
|
+
d: "M13 16.6455V21.333",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
strokeLinecap: "round",
|
|
328
|
+
strokeLinejoin: "round",
|
|
329
|
+
strokeWidth: "1.5"
|
|
330
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
331
|
+
d: "M16.125 21.333H9.875",
|
|
332
|
+
stroke: "currentColor",
|
|
333
|
+
strokeLinecap: "round",
|
|
334
|
+
strokeLinejoin: "round",
|
|
335
|
+
strokeWidth: "1.5"
|
|
336
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
337
|
+
d: "M9.875 5.70801H16.125V5.70801C16.9879 5.70801 17.6875 6.40756 17.6875 7.27051V13.5205C17.6875 15.2464 16.2884 16.6455 14.5625 16.6455H11.4375V16.6455C9.71161 16.6455 8.3125 15.2464 8.3125 13.5205V7.27051V7.27051C8.3125 6.40756 9.01205 5.70801 9.875 5.70801V5.70801Z",
|
|
338
|
+
stroke: "currentColor",
|
|
339
|
+
strokeLinecap: "round",
|
|
340
|
+
strokeLinejoin: "round",
|
|
341
|
+
strokeWidth: "1.5"
|
|
342
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
343
|
+
d: "M8.3125 8.05176H5.96875V8.05176C5.1058 8.05176 4.40625 8.75131 4.40625 9.61426V11.1768V11.1768C4.40625 12.9026 5.80536 14.3018 7.53125 14.3018H8.41094",
|
|
344
|
+
stroke: "currentColor",
|
|
345
|
+
strokeLinecap: "round",
|
|
346
|
+
strokeLinejoin: "round",
|
|
347
|
+
strokeWidth: "1.5"
|
|
348
|
+
})]
|
|
351
349
|
}));
|
|
352
350
|
};
|
|
353
351
|
var MemoizedStar = /*#__PURE__*/React__default["default"].memo(Star);
|
|
@@ -760,8 +758,8 @@ var _excluded$f = ["formId", "preview", "language"],
|
|
|
760
758
|
_excluded2$1 = ["formId", "language"],
|
|
761
759
|
_excluded3$1 = ["page", "pageSize"],
|
|
762
760
|
_excluded5 = ["formId", "submissionId"];
|
|
763
|
-
function ownKeys$
|
|
764
|
-
function _objectSpread$
|
|
761
|
+
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
762
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
765
763
|
var useForm = function useForm(_ref) {
|
|
766
764
|
var formId = _ref.formId,
|
|
767
765
|
_ref$preview = _ref.preview,
|
|
@@ -771,7 +769,7 @@ var useForm = function useForm(_ref) {
|
|
|
771
769
|
options = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
772
770
|
return reactQuery.useQuery([QUERY_KEYS.QUESTIONS, preview ? "preview/".concat(formId) : formId, language], function () {
|
|
773
771
|
return neetoFormApi.getPublicQuestions(formId, language);
|
|
774
|
-
}, _objectSpread$
|
|
772
|
+
}, _objectSpread$C({
|
|
775
773
|
keepPreviousData: true
|
|
776
774
|
}, options));
|
|
777
775
|
};
|
|
@@ -782,14 +780,14 @@ var useFetchQuestions = function useFetchQuestions(_ref2) {
|
|
|
782
780
|
options = _objectWithoutProperties$1(_ref2, _excluded2$1);
|
|
783
781
|
return reactQuery.useQuery([QUERY_KEYS.QUESTIONS, formId, language], function () {
|
|
784
782
|
return neetoFormApi.getQuestions(formId, language);
|
|
785
|
-
}, _objectSpread$
|
|
783
|
+
}, _objectSpread$C({
|
|
786
784
|
keepPreviousData: true
|
|
787
785
|
}, options));
|
|
788
786
|
};
|
|
789
787
|
var useCreateForm = function useCreateForm(options) {
|
|
790
788
|
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : i18next__default["default"].resolvedLanguage;
|
|
791
789
|
var queryClient = reactQuery.useQueryClient();
|
|
792
|
-
return reactQuery.useMutation(neetoFormApi.createForm, _objectSpread$
|
|
790
|
+
return reactQuery.useMutation(neetoFormApi.createForm, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
793
791
|
onSuccess: function onSuccess(form) {
|
|
794
792
|
var _options$onSuccess;
|
|
795
793
|
queryClient.setQueryData(QUERY_KEYS.QUESTIONS, function (forms) {
|
|
@@ -809,7 +807,7 @@ var useUpdateForm = function useUpdateForm(options) {
|
|
|
809
807
|
var id = _ref3.id,
|
|
810
808
|
values = _ref3.values;
|
|
811
809
|
return neetoFormApi.updateForm(id, values);
|
|
812
|
-
}, _objectSpread$
|
|
810
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
813
811
|
onSuccess: function onSuccess(data, _ref4) {
|
|
814
812
|
var id = _ref4.id;
|
|
815
813
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], ramda.assoc("title", data.title));
|
|
@@ -829,7 +827,7 @@ var useCreateQuestion = function useCreateQuestion(formId, language) {
|
|
|
829
827
|
var queryClient = reactQuery.useQueryClient();
|
|
830
828
|
return reactQuery.useMutation(function (payload) {
|
|
831
829
|
return neetoFormApi.createQuestion(formId, neetoCist.filterNonNull(payload));
|
|
832
|
-
}, _objectSpread$
|
|
830
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
833
831
|
onSuccess: function onSuccess() {
|
|
834
832
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
835
833
|
args[_key] = arguments[_key];
|
|
@@ -855,7 +853,7 @@ var useUpdateQuestion = function useUpdateQuestion(formId, language) {
|
|
|
855
853
|
questionId: questionId,
|
|
856
854
|
payload: neetoCist.filterNonNull(payload)
|
|
857
855
|
});
|
|
858
|
-
}, _objectSpread$
|
|
856
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
859
857
|
onSuccess: function onSuccess() {
|
|
860
858
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
861
859
|
args[_key2] = arguments[_key2];
|
|
@@ -875,7 +873,7 @@ var useDeleteQuestion = function useDeleteQuestion(formId, language) {
|
|
|
875
873
|
var queryClient = reactQuery.useQueryClient();
|
|
876
874
|
return reactQuery.useMutation(function (questionId) {
|
|
877
875
|
return neetoFormApi.deleteQuestion(formId, questionId);
|
|
878
|
-
}, _objectSpread$
|
|
876
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
879
877
|
onSuccess: function onSuccess() {
|
|
880
878
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
881
879
|
args[_key3] = arguments[_key3];
|
|
@@ -895,7 +893,7 @@ var useReorderQuestions = function useReorderQuestions(formId, language) {
|
|
|
895
893
|
var queryClient = reactQuery.useQueryClient();
|
|
896
894
|
return reactQuery.useMutation(function (payload) {
|
|
897
895
|
return neetoFormApi.reorderQuestions(formId, neetoCist.filterNonNull(payload));
|
|
898
|
-
}, _objectSpread$
|
|
896
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
899
897
|
onSuccess: function onSuccess() {
|
|
900
898
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
901
899
|
args[_key4] = arguments[_key4];
|
|
@@ -922,7 +920,7 @@ var useForms = function useForms() {
|
|
|
922
920
|
page: page,
|
|
923
921
|
pageSize: pageSize
|
|
924
922
|
});
|
|
925
|
-
}, _objectSpread$
|
|
923
|
+
}, _objectSpread$C({
|
|
926
924
|
keepPreviousData: true
|
|
927
925
|
}, options));
|
|
928
926
|
};
|
|
@@ -930,7 +928,7 @@ var useDeleteForm = function useDeleteForm(options) {
|
|
|
930
928
|
return reactUtils.useMutationWithInvalidation(function (_ref7) {
|
|
931
929
|
var id = _ref7.id;
|
|
932
930
|
return neetoFormApi.destroyForm(id);
|
|
933
|
-
}, _objectSpread$
|
|
931
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
934
932
|
keysToInvalidate: [[QUERY_KEYS.FORMS], function (_, _ref8) {
|
|
935
933
|
var id = _ref8.id;
|
|
936
934
|
return [QUERY_KEYS.QUESTIONS, id];
|
|
@@ -949,7 +947,7 @@ var useSubmission = function useSubmission(_ref11) {
|
|
|
949
947
|
options = _objectWithoutProperties$1(_ref11, _excluded5);
|
|
950
948
|
return reactQuery.useQuery([QUERY_KEYS.SUBMISSION, formId, submissionId], function () {
|
|
951
949
|
return neetoFormApi.getPublicSubmission(formId, submissionId);
|
|
952
|
-
}, _objectSpread$
|
|
950
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
953
951
|
keepPreviousData: true
|
|
954
952
|
}));
|
|
955
953
|
};
|
|
@@ -959,7 +957,7 @@ var useCreateSubmission = function useCreateSubmission(options) {
|
|
|
959
957
|
var formId = _ref12.formId,
|
|
960
958
|
values = _ref12.values;
|
|
961
959
|
return neetoFormApi.submitPublicForm(formId, values);
|
|
962
|
-
}, _objectSpread$
|
|
960
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
963
961
|
onSuccess: function onSuccess() {
|
|
964
962
|
var _data$submission, _data$submission2;
|
|
965
963
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
@@ -980,7 +978,7 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
980
978
|
var formId = _ref13.formId,
|
|
981
979
|
values = _ref13.values;
|
|
982
980
|
return neetoFormApi.updatePublicSubmission(formId, values);
|
|
983
|
-
}, _objectSpread$
|
|
981
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
984
982
|
onSuccess: function onSuccess() {
|
|
985
983
|
var _data$submission3;
|
|
986
984
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
@@ -1085,7 +1083,7 @@ function _defineProperty$5(obj, key, value) {
|
|
|
1085
1083
|
return obj;
|
|
1086
1084
|
}
|
|
1087
1085
|
|
|
1088
|
-
function ownKeys$
|
|
1086
|
+
function ownKeys$C(e, r) {
|
|
1089
1087
|
var t = Object.keys(e);
|
|
1090
1088
|
if (Object.getOwnPropertySymbols) {
|
|
1091
1089
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -1098,9 +1096,9 @@ function ownKeys$n(e, r) {
|
|
|
1098
1096
|
function _objectSpread2(e) {
|
|
1099
1097
|
for (var r = 1; r < arguments.length; r++) {
|
|
1100
1098
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
1101
|
-
r % 2 ? ownKeys$
|
|
1099
|
+
r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) {
|
|
1102
1100
|
_defineProperty$5(e, r, t[r]);
|
|
1103
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$
|
|
1101
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) {
|
|
1104
1102
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
1105
1103
|
});
|
|
1106
1104
|
}
|
|
@@ -1577,7 +1575,7 @@ var useSyncExternalStoreShim_production_min = {};
|
|
|
1577
1575
|
* LICENSE file in the root directory of this source tree.
|
|
1578
1576
|
*/
|
|
1579
1577
|
var e$2=React__default["default"];function h$3(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k$2="function"===typeof Object.is?Object.is:h$3,l$2=e$2.useState,m$2=e$2.useEffect,n$3=e$2.useLayoutEffect,p$3=e$2.useDebugValue;function q$3(a,b){var d=b(),f=l$2({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n$3(function(){c.value=d;c.getSnapshot=b;r$2(c)&&g({inst:c});},[a,d,b]);m$2(function(){r$2(c)&&g({inst:c});return a(function(){r$2(c)&&g({inst:c});})},[a]);p$3(d);return d}
|
|
1580
|
-
function r$2(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k$2(a,d)}catch(f){return !0}}function t$
|
|
1578
|
+
function r$2(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k$2(a,d)}catch(f){return !0}}function t$6(a,b){return b()}var u$2="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t$6:q$3;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e$2.useSyncExternalStore?e$2.useSyncExternalStore:u$2;
|
|
1581
1579
|
|
|
1582
1580
|
{
|
|
1583
1581
|
shim.exports = useSyncExternalStoreShim_production_min;
|
|
@@ -1596,8 +1594,8 @@ var withSelector_production_min = {};
|
|
|
1596
1594
|
* This source code is licensed under the MIT license found in the
|
|
1597
1595
|
* LICENSE file in the root directory of this source tree.
|
|
1598
1596
|
*/
|
|
1599
|
-
var h$2=React__default["default"],n$2=shimExports;function p$2(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q$2="function"===typeof Object.is?Object.is:p$2,r$1=n$2.useSyncExternalStore,t$
|
|
1600
|
-
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$
|
|
1597
|
+
var h$2=React__default["default"],n$2=shimExports;function p$2(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q$2="function"===typeof Object.is?Object.is:p$2,r$1=n$2.useSyncExternalStore,t$5=h$2.useRef,u$1=h$2.useEffect,v$2=h$2.useMemo,w$1=h$2.useDebugValue;
|
|
1598
|
+
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$5(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v$2(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q$2(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r$1(a,c[0],c[1]);
|
|
1601
1599
|
u$1(function(){f.hasValue=!0;f.value=d;},[d]);w$1(d);return d};
|
|
1602
1600
|
|
|
1603
1601
|
// Default to a dummy "batch" implementation that just runs the callback
|
|
@@ -1679,11 +1677,11 @@ var reactIs_production_min$1 = {};
|
|
|
1679
1677
|
* LICENSE file in the root directory of this source tree.
|
|
1680
1678
|
*/
|
|
1681
1679
|
var b$2="function"===typeof Symbol&&Symbol.for,c$2=b$2?Symbol.for("react.element"):60103,d$1=b$2?Symbol.for("react.portal"):60106,e$1=b$2?Symbol.for("react.fragment"):60107,f$1=b$2?Symbol.for("react.strict_mode"):60108,g$1=b$2?Symbol.for("react.profiler"):60114,h$1=b$2?Symbol.for("react.provider"):60109,k$1=b$2?Symbol.for("react.context"):60110,l$1=b$2?Symbol.for("react.async_mode"):60111,m$1=b$2?Symbol.for("react.concurrent_mode"):60111,n$1=b$2?Symbol.for("react.forward_ref"):60112,p$1=b$2?Symbol.for("react.suspense"):60113,q$1=b$2?
|
|
1682
|
-
Symbol.for("react.suspense_list"):60120,r=b$2?Symbol.for("react.memo"):60115,t$
|
|
1683
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$2:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$
|
|
1684
|
-
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l$1};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z(a)===t$
|
|
1680
|
+
Symbol.for("react.suspense_list"):60120,r=b$2?Symbol.for("react.memo"):60115,t$4=b$2?Symbol.for("react.lazy"):60116,v$1=b$2?Symbol.for("react.block"):60121,w=b$2?Symbol.for("react.fundamental"):60117,x=b$2?Symbol.for("react.responder"):60118,y=b$2?Symbol.for("react.scope"):60119;
|
|
1681
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$2:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$4:case r:case h$1:return a;default:return u}}case d$1:return u}}}function A(a){return z(a)===m$1}reactIs_production_min$1.AsyncMode=l$1;reactIs_production_min$1.ConcurrentMode=m$1;reactIs_production_min$1.ContextConsumer=k$1;reactIs_production_min$1.ContextProvider=h$1;reactIs_production_min$1.Element=c$2;reactIs_production_min$1.ForwardRef=n$1;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$4;reactIs_production_min$1.Memo=r;reactIs_production_min$1.Portal=d$1;
|
|
1682
|
+
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l$1};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z(a)===t$4};
|
|
1685
1683
|
reactIs_production_min$1.isMemo=function(a){return z(a)===r};reactIs_production_min$1.isPortal=function(a){return z(a)===d$1};reactIs_production_min$1.isProfiler=function(a){return z(a)===g$1};reactIs_production_min$1.isStrictMode=function(a){return z(a)===f$1};reactIs_production_min$1.isSuspense=function(a){return z(a)===p$1};
|
|
1686
|
-
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$
|
|
1684
|
+
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$4||a.$$typeof===r||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===n$1||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v$1)};reactIs_production_min$1.typeOf=z;
|
|
1687
1685
|
|
|
1688
1686
|
{
|
|
1689
1687
|
reactIs$2.exports = reactIs_production_min$1;
|
|
@@ -1808,11 +1806,11 @@ var reactIs_production_min = {};
|
|
|
1808
1806
|
* This source code is licensed under the MIT license found in the
|
|
1809
1807
|
* LICENSE file in the root directory of this source tree.
|
|
1810
1808
|
*/
|
|
1811
|
-
var b$1=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
1809
|
+
var b$1=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t$3=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
1812
1810
|
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b$1:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c$1:return r}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b$1;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c$1;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;
|
|
1813
1811
|
reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return v(a)===h};reactIs_production_min.isContextProvider=function(a){return v(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b$1};reactIs_production_min.isForwardRef=function(a){return v(a)===l};reactIs_production_min.isFragment=function(a){return v(a)===d};reactIs_production_min.isLazy=function(a){return v(a)===q};reactIs_production_min.isMemo=function(a){return v(a)===p};
|
|
1814
1812
|
reactIs_production_min.isPortal=function(a){return v(a)===c$1};reactIs_production_min.isProfiler=function(a){return v(a)===f};reactIs_production_min.isStrictMode=function(a){return v(a)===e};reactIs_production_min.isSuspense=function(a){return v(a)===m};reactIs_production_min.isSuspenseList=function(a){return v(a)===n};
|
|
1815
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v;
|
|
1813
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t$3||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v;
|
|
1816
1814
|
|
|
1817
1815
|
{
|
|
1818
1816
|
reactIs.exports = reactIs_production_min;
|
|
@@ -9992,6 +9990,13 @@ ramda.useWith(ramda.path, [ramda.split(".")]);
|
|
|
9992
9990
|
var isFunction$1 = function isFunction(obj) {
|
|
9993
9991
|
return typeof obj === "function";
|
|
9994
9992
|
};
|
|
9993
|
+
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
9994
|
+
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
9995
|
+
var fallback = question["".concat(fieldName, "Fallback")];
|
|
9996
|
+
var field = question[fieldName];
|
|
9997
|
+
var isFieldEmpty = hasRichContent ? neetoEditor.isEditorEmpty(field) : ramda.isEmpty(field);
|
|
9998
|
+
return isFieldEmpty && ramda.isNotNil(fallback) ? fallback : field;
|
|
9999
|
+
};
|
|
9995
10000
|
|
|
9996
10001
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
9997
10002
|
var useBuildFormStore = zustand.create(reactUtils.withImmutableActions(function (set) {
|
|
@@ -11872,9 +11877,8 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11872
11877
|
var questionKind = selectedQuestion.kind;
|
|
11873
11878
|
var independentLabel = INDEPENDENT_LABELS_MAP[questionKind];
|
|
11874
11879
|
if (neetoCist.isPresent(independentLabel)) return independentLabel;
|
|
11875
|
-
var questionLabel = selectedQuestion
|
|
11876
|
-
|
|
11877
|
-
return neetoCist.isPresent(questionLabel) ? neetoCist.truncate(questionLabel, 40) : neetoCist.humanize(questionKind);
|
|
11880
|
+
var questionLabel = fieldWithFallback(selectedQuestion, "label");
|
|
11881
|
+
return neetoCist.truncate(questionLabel, 40);
|
|
11878
11882
|
};
|
|
11879
11883
|
var _useDeleteQuestion = useDeleteQuestion(selectedQuestion === null || selectedQuestion === void 0 ? void 0 : selectedQuestion.formId, selectedLanguage, {
|
|
11880
11884
|
onSuccess: function onSuccess() {
|
|
@@ -11901,13 +11905,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11901
11905
|
}
|
|
11902
11906
|
});
|
|
11903
11907
|
};
|
|
11904
|
-
return /*#__PURE__*/
|
|
11908
|
+
return /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
11905
11909
|
isOpen: isOpen,
|
|
11906
11910
|
onClose: onClose,
|
|
11907
11911
|
isSubmitting: isDeleting,
|
|
11908
11912
|
submitButtonLabel: t("neetoForm.common.delete"),
|
|
11909
11913
|
title: t("neetoForm.questions.deleteAlert.title"),
|
|
11910
|
-
message: neetoCist.isPresent(selectedQuestion) && /*#__PURE__*/
|
|
11914
|
+
message: neetoCist.isPresent(selectedQuestion) && /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
11911
11915
|
i18nKey: "neetoForm.questions.deleteAlert.message",
|
|
11912
11916
|
values: {
|
|
11913
11917
|
count: languagesCount,
|
|
@@ -11946,34 +11950,42 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
11946
11950
|
var selectedLanguageName = (_findBy = neetoCist.findBy({
|
|
11947
11951
|
code: currentLanguage
|
|
11948
11952
|
}, languages)) === null || _findBy === void 0 ? void 0 : _findBy.name;
|
|
11949
|
-
return /*#__PURE__*/
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11953
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11954
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Tooltip__default["default"], {
|
|
11955
|
+
content: t("neetoForm.questions.changeLanguage"),
|
|
11956
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
11957
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Dropdown__default["default"], {
|
|
11958
|
+
buttonStyle: "secondary",
|
|
11959
|
+
label: selectedLanguageName,
|
|
11960
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Dropdown__default["default"].Menu, {
|
|
11961
|
+
children: languages.map(function (_ref2) {
|
|
11962
|
+
var code = _ref2.code,
|
|
11963
|
+
name = _ref2.name;
|
|
11964
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown__default["default"].MenuItem.Button, {
|
|
11965
|
+
isActive: currentLanguage === code,
|
|
11966
|
+
onClick: function onClick() {
|
|
11967
|
+
return languageChangeHandler(code);
|
|
11968
|
+
},
|
|
11969
|
+
children: name
|
|
11970
|
+
}, code);
|
|
11971
|
+
})
|
|
11972
|
+
})
|
|
11973
|
+
})
|
|
11974
|
+
})
|
|
11975
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
11976
|
+
isOpen: isUnsavedChangesAlertOpen,
|
|
11977
|
+
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11978
|
+
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11979
|
+
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11980
|
+
onClose: function onClose() {
|
|
11981
|
+
return setIsUnsavedChangesAlertOpen(false);
|
|
11982
|
+
},
|
|
11983
|
+
onSubmit: function onSubmit() {
|
|
11984
|
+
onChange(selectedLanguage);
|
|
11985
|
+
setIsUnsavedChangesAlertOpen(false);
|
|
11962
11986
|
}
|
|
11963
|
-
}
|
|
11964
|
-
})
|
|
11965
|
-
isOpen: isUnsavedChangesAlertOpen,
|
|
11966
|
-
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11967
|
-
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11968
|
-
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11969
|
-
onClose: function onClose() {
|
|
11970
|
-
return setIsUnsavedChangesAlertOpen(false);
|
|
11971
|
-
},
|
|
11972
|
-
onSubmit: function onSubmit() {
|
|
11973
|
-
onChange(selectedLanguage);
|
|
11974
|
-
setIsUnsavedChangesAlertOpen(false);
|
|
11975
|
-
}
|
|
11976
|
-
}));
|
|
11987
|
+
})]
|
|
11988
|
+
});
|
|
11977
11989
|
};
|
|
11978
11990
|
|
|
11979
11991
|
var Overview = function Overview(_ref) {
|
|
@@ -11983,56 +11995,65 @@ var Overview = function Overview(_ref) {
|
|
|
11983
11995
|
selectedLanguage = _ref.selectedLanguage,
|
|
11984
11996
|
onLanguageChange = _ref.onLanguageChange,
|
|
11985
11997
|
additionalActionOptions = _ref.additionalActionOptions;
|
|
11986
|
-
return /*#__PURE__*/
|
|
11987
|
-
className: "neeto-form-nano-form-wrapper__overview mb-4 w-full flex-shrink-0 space-y-4 px-6 pt-6"
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
11998
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
11999
|
+
className: "neeto-form-nano-form-wrapper__overview mb-4 w-full flex-shrink-0 space-y-4 px-6 pt-6",
|
|
12000
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12001
|
+
className: "flex items-center justify-between",
|
|
12002
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
12003
|
+
"data-cy": "neeto-form-engine-overview-title",
|
|
12004
|
+
lineHeight: "neeto-ui-leading-normal",
|
|
12005
|
+
style: "h2",
|
|
12006
|
+
weight: "neeto-ui-font-semibold",
|
|
12007
|
+
children: title
|
|
12008
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12009
|
+
className: "flex flex-shrink-0 items-center justify-between space-x-1",
|
|
12010
|
+
children: [availableLanguages.length > 1 && /*#__PURE__*/jsxRuntime.jsx(ChangeLanguageDropdown, {
|
|
12011
|
+
currentLanguage: selectedLanguage,
|
|
12012
|
+
languages: availableLanguages,
|
|
12013
|
+
onChange: onLanguageChange
|
|
12014
|
+
}), neetoCist.isPresent(additionalActionOptions) && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
12015
|
+
dropdownButtonProps: {
|
|
12016
|
+
isRounded: true,
|
|
12017
|
+
style: "tertiary"
|
|
12018
|
+
},
|
|
12019
|
+
dropdownProps: {
|
|
12020
|
+
strategy: "fixed",
|
|
12021
|
+
position: "bottom-start"
|
|
12022
|
+
},
|
|
12023
|
+
menuItems: additionalActionOptions
|
|
12024
|
+
})]
|
|
12025
|
+
})]
|
|
12026
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
12027
|
+
"data-cy": "neeto-form-engine-overview-description",
|
|
12028
|
+
style: "body2",
|
|
12029
|
+
children: description
|
|
12030
|
+
})]
|
|
12031
|
+
});
|
|
12015
12032
|
};
|
|
12016
12033
|
|
|
12017
12034
|
var _excluded$c = ["size", "color"],
|
|
12018
12035
|
_excluded2 = ["size", "color"],
|
|
12019
12036
|
_excluded3 = ["size", "color"],
|
|
12020
12037
|
_excluded4 = ["size", "color"];
|
|
12038
|
+
function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12039
|
+
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12021
12040
|
var BadSmiley = function BadSmiley(props) {
|
|
12022
12041
|
var size = props.size,
|
|
12023
12042
|
color = props.color,
|
|
12024
12043
|
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
12025
|
-
return /*#__PURE__*/
|
|
12044
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12026
12045
|
fill: "none",
|
|
12027
12046
|
height: size,
|
|
12028
12047
|
viewBox: "0 0 48 48",
|
|
12029
12048
|
width: size
|
|
12030
|
-
}, other),
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12049
|
+
}, other), {}, {
|
|
12050
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12051
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24c13.234 0 24-10.767 24-24S37.234 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.082 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
12052
|
+
fill: color
|
|
12053
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12054
|
+
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0c0-.575.468-1.044 1.043-1.044s1.044.469 1.044 1.044c0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 010-2.087 1.045 1.045 0 010 2.087zM24 29.218a13.677 13.677 0 00-10.168 4.52 1.043 1.043 0 101.553 1.394A11.587 11.587 0 0124 31.305c3.3 0 6.44 1.394 8.614 3.826a1.045 1.045 0 001.473.082 1.044 1.044 0 00.082-1.473c-2.57-2.874-6.277-4.523-10.169-4.523z",
|
|
12055
|
+
fill: color
|
|
12056
|
+
})]
|
|
12036
12057
|
}));
|
|
12037
12058
|
};
|
|
12038
12059
|
BadSmiley.defaultProps = {
|
|
@@ -12044,17 +12065,19 @@ var OkaySmiley = function OkaySmiley(props) {
|
|
|
12044
12065
|
var size = props.size,
|
|
12045
12066
|
color = props.color,
|
|
12046
12067
|
other = _objectWithoutProperties$1(props, _excluded2);
|
|
12047
|
-
return /*#__PURE__*/
|
|
12068
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12048
12069
|
fill: "none",
|
|
12049
12070
|
height: size,
|
|
12050
12071
|
viewBox: "0 0 48 48",
|
|
12051
12072
|
width: size
|
|
12052
|
-
}, other),
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12073
|
+
}, other), {}, {
|
|
12074
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12075
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
12076
|
+
fill: color
|
|
12077
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12078
|
+
d: "M15.652 22.956a3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13zm0-4.174c.575 0 1.044.469 1.044 1.044 0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043c0-.575.468-1.044 1.043-1.044zm16.696-2.086a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 01-1.044-1.043c0-.575.469-1.044 1.044-1.044a1.044 1.044 0 010 2.087zm2.087 8.349h-20.87a1.044 1.044 0 000 2.086h20.87a1.044 1.044 0 000-2.086z",
|
|
12079
|
+
fill: color
|
|
12080
|
+
})]
|
|
12058
12081
|
}));
|
|
12059
12082
|
};
|
|
12060
12083
|
OkaySmiley.defaultProps = {
|
|
@@ -12066,17 +12089,19 @@ var GoodSmiley = function GoodSmiley(props) {
|
|
|
12066
12089
|
var size = props.size,
|
|
12067
12090
|
color = props.color,
|
|
12068
12091
|
other = _objectWithoutProperties$1(props, _excluded3);
|
|
12069
|
-
return /*#__PURE__*/
|
|
12092
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12070
12093
|
fill: "none",
|
|
12071
12094
|
height: size,
|
|
12072
12095
|
viewBox: "0 0 48 48",
|
|
12073
12096
|
width: size
|
|
12074
|
-
}, other),
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12097
|
+
}, other), {}, {
|
|
12098
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12099
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
12100
|
+
fill: color
|
|
12101
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12102
|
+
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0a1.044 1.044 0 012.087 0c0 .575-.469 1.044-1.044 1.044a1.045 1.045 0 01-1.043-1.044zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.174a1.045 1.045 0 01-1.044-1.044 1.044 1.044 0 111.044 1.044zm.265 8.695c-2.175 2.432-5.314 3.826-8.613 3.826a11.59 11.59 0 01-8.615-3.827 1.043 1.043 0 10-1.553 1.394A13.677 13.677 0 0024 35.478c3.892 0 7.599-1.648 10.17-4.521a1.043 1.043 0 10-1.557-1.392z",
|
|
12103
|
+
fill: color
|
|
12104
|
+
})]
|
|
12080
12105
|
}));
|
|
12081
12106
|
};
|
|
12082
12107
|
GoodSmiley.defaultProps = {
|
|
@@ -12088,26 +12113,32 @@ var Drag = function Drag(props) {
|
|
|
12088
12113
|
var size = props.size,
|
|
12089
12114
|
color = props.color,
|
|
12090
12115
|
other = _objectWithoutProperties$1(props, _excluded4);
|
|
12091
|
-
return /*#__PURE__*/
|
|
12116
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12092
12117
|
fill: "none",
|
|
12093
12118
|
height: size,
|
|
12094
12119
|
viewBox: "0 0 24 24",
|
|
12095
12120
|
width: size
|
|
12096
|
-
}, other),
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12121
|
+
}, other), {}, {
|
|
12122
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("g", {
|
|
12123
|
+
clipPath: "url(#clip0_6290_43)",
|
|
12124
|
+
fill: color,
|
|
12125
|
+
stroke: color,
|
|
12126
|
+
strokeLinecap: "round",
|
|
12127
|
+
strokeLinejoin: "round",
|
|
12128
|
+
strokeWidth: "1.5",
|
|
12129
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12130
|
+
d: "M8 12a1 1 0 102 0 1 1 0 00-2 0zM8 18a1 1 0 102 0 1 1 0 00-2 0zM8 6a1 1 0 102 0 1 1 0 00-2 0zM14 12a1 1 0 102 0 1 1 0 00-2 0zM14 18a1 1 0 102 0 1 1 0 00-2 0zM14 6a1 1 0 102 0 1 1 0 00-2 0z"
|
|
12131
|
+
})
|
|
12132
|
+
}), /*#__PURE__*/jsxRuntime.jsx("defs", {
|
|
12133
|
+
children: /*#__PURE__*/jsxRuntime.jsx("clipPath", {
|
|
12134
|
+
id: "clip0_6290_43",
|
|
12135
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
12136
|
+
d: "M0 0H24V24H0z",
|
|
12137
|
+
fill: color
|
|
12138
|
+
})
|
|
12139
|
+
})
|
|
12140
|
+
})]
|
|
12141
|
+
}));
|
|
12111
12142
|
};
|
|
12112
12143
|
Drag.defaultProps = {
|
|
12113
12144
|
color: "currentColor",
|
|
@@ -12147,54 +12178,59 @@ var Card = function Card(_ref) {
|
|
|
12147
12178
|
item: question
|
|
12148
12179
|
}),
|
|
12149
12180
|
kind = _getActiveKindDetails.kind,
|
|
12150
|
-
label = _getActiveKindDetails.label,
|
|
12151
12181
|
isSingular = _getActiveKindDetails.isSingular;
|
|
12182
|
+
var label = fieldWithFallback(question, "label");
|
|
12152
12183
|
var questionLabel = isRichTextQuestion(kind) ? htmlToPlainText(label) : label;
|
|
12153
|
-
return /*#__PURE__*/
|
|
12184
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12154
12185
|
"data-cy": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
|
|
12155
12186
|
className: classnames__default["default"]("neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-white neeto-form-nano-form__card flex h-10 w-full items-center justify-between border p-2", {
|
|
12156
12187
|
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
12157
12188
|
}),
|
|
12158
12189
|
onClick: function onClick() {
|
|
12159
12190
|
return onSelect(question);
|
|
12160
|
-
}
|
|
12161
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12162
|
-
className: "flex min-w-0 flex-grow items-center gap-1"
|
|
12163
|
-
}, /*#__PURE__*/React__default["default"].createElement(Drag, {
|
|
12164
|
-
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
12165
|
-
}), /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
|
|
12166
|
-
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
12167
|
-
lineHeight: "snug",
|
|
12168
|
-
style: "body2",
|
|
12169
|
-
weight: "medium"
|
|
12170
|
-
}, questionLabel)), /*#__PURE__*/React__default["default"].createElement(MoreDropdown__default["default"], {
|
|
12171
|
-
dropdownButtonProps: {
|
|
12172
|
-
className: "shrink-0"
|
|
12173
|
-
},
|
|
12174
|
-
dropdownProps: {
|
|
12175
|
-
strategy: "fixed"
|
|
12176
12191
|
},
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
}, {
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12195
|
-
|
|
12192
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12193
|
+
className: "flex min-w-0 flex-grow items-center gap-1",
|
|
12194
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Drag, {
|
|
12195
|
+
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
12196
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
12197
|
+
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
12198
|
+
lineHeight: "snug",
|
|
12199
|
+
style: "body2",
|
|
12200
|
+
weight: "medium",
|
|
12201
|
+
children: questionLabel
|
|
12202
|
+
})]
|
|
12203
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
12204
|
+
dropdownButtonProps: {
|
|
12205
|
+
className: "shrink-0"
|
|
12206
|
+
},
|
|
12207
|
+
dropdownProps: {
|
|
12208
|
+
strategy: "fixed"
|
|
12209
|
+
},
|
|
12210
|
+
menuItems: [{
|
|
12211
|
+
"data-cy": "edit-question",
|
|
12212
|
+
key: "edit",
|
|
12213
|
+
label: t("neetoForm.common.edit"),
|
|
12214
|
+
onClick: onEdit
|
|
12215
|
+
}, {
|
|
12216
|
+
"data-cy": "clone-question",
|
|
12217
|
+
key: "clone",
|
|
12218
|
+
label: t("neetoForm.common.clone"),
|
|
12219
|
+
isVisible: !isSingular && isFunction$1(onClone),
|
|
12220
|
+
onClick: onClone
|
|
12221
|
+
}, {
|
|
12222
|
+
"data-cy": "delete-question",
|
|
12223
|
+
key: "delete",
|
|
12224
|
+
label: t("neetoForm.common.delete"),
|
|
12225
|
+
isVisible: isFunction$1(onDelete),
|
|
12226
|
+
onClick: onDelete
|
|
12227
|
+
}]
|
|
12228
|
+
})]
|
|
12229
|
+
});
|
|
12196
12230
|
};
|
|
12197
12231
|
|
|
12232
|
+
function ownKeys$A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12233
|
+
function _objectSpread$A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$A(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12198
12234
|
var Questions = function Questions(_ref) {
|
|
12199
12235
|
var questions = _ref.questions,
|
|
12200
12236
|
isDeletable = _ref.isDeletable,
|
|
@@ -12205,39 +12241,42 @@ var Questions = function Questions(_ref) {
|
|
|
12205
12241
|
onClone = _ref.onClone,
|
|
12206
12242
|
onDelete = _ref.onDelete,
|
|
12207
12243
|
onSelect = _ref.onSelect;
|
|
12208
|
-
return /*#__PURE__*/
|
|
12209
|
-
droppableId: "droppable"
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12244
|
+
return /*#__PURE__*/jsxRuntime.jsx(ConnectedDroppable$1, {
|
|
12245
|
+
droppableId: "droppable",
|
|
12246
|
+
children: function children(_ref2) {
|
|
12247
|
+
var droppableProps = _ref2.droppableProps,
|
|
12248
|
+
placeholder = _ref2.placeholder,
|
|
12249
|
+
innerRef = _ref2.innerRef;
|
|
12250
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$A(_objectSpread$A({}, droppableProps), {}, {
|
|
12251
|
+
className: "space-y-2",
|
|
12252
|
+
ref: innerRef,
|
|
12253
|
+
children: [questions.map(function (question, index) {
|
|
12254
|
+
var _question$id, _question$id2;
|
|
12255
|
+
return /*#__PURE__*/React$2.createElement(PublicDraggable, {
|
|
12256
|
+
index: index,
|
|
12257
|
+
draggableId: "question-".concat((_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId),
|
|
12258
|
+
key: "question-".concat((_question$id2 = question.id) !== null && _question$id2 !== void 0 ? _question$id2 : question.nodeId)
|
|
12259
|
+
}, function (_ref3) {
|
|
12260
|
+
var draggableProps = _ref3.draggableProps,
|
|
12261
|
+
dragHandleProps = _ref3.dragHandleProps,
|
|
12262
|
+
innerRef = _ref3.innerRef;
|
|
12263
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread$A(_objectSpread$A(_objectSpread$A({}, draggableProps), dragHandleProps), {}, {
|
|
12264
|
+
ref: innerRef,
|
|
12265
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Card, {
|
|
12266
|
+
allQuestionKinds: allQuestionKinds,
|
|
12267
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
12268
|
+
onClone: onClone,
|
|
12269
|
+
onEdit: onEdit,
|
|
12270
|
+
onSelect: onSelect,
|
|
12271
|
+
question: question,
|
|
12272
|
+
isActive: ramda.equals(selectedQuestion, question),
|
|
12273
|
+
onDelete: isDeletable(question) && onDelete
|
|
12274
|
+
})
|
|
12275
|
+
}));
|
|
12276
|
+
});
|
|
12277
|
+
}), placeholder]
|
|
12278
|
+
}));
|
|
12279
|
+
}
|
|
12241
12280
|
});
|
|
12242
12281
|
};
|
|
12243
12282
|
|
|
@@ -12318,8 +12357,8 @@ var arrayHelpers = {
|
|
|
12318
12357
|
moveItem: moveItem
|
|
12319
12358
|
};
|
|
12320
12359
|
|
|
12321
|
-
function ownKeys$
|
|
12322
|
-
function _objectSpread$
|
|
12360
|
+
function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12361
|
+
function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12323
12362
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
12324
12363
|
var fieldCodes = ramda.pluck("fieldCode", neetoCist.filterBy({
|
|
12325
12364
|
kind: type
|
|
@@ -12355,7 +12394,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
|
|
|
12355
12394
|
var nextItems = _toConsumableArray$1(items);
|
|
12356
12395
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
12357
12396
|
var orderedItems = nextItems.map(function (item, index) {
|
|
12358
|
-
return _objectSpread$
|
|
12397
|
+
return _objectSpread$z(_objectSpread$z({}, item), {}, {
|
|
12359
12398
|
displayOrder: index
|
|
12360
12399
|
});
|
|
12361
12400
|
});
|
|
@@ -12369,7 +12408,7 @@ var createFieldData = function createFieldData(_ref3) {
|
|
|
12369
12408
|
_ref3$isRequired = _ref3.isRequired,
|
|
12370
12409
|
isRequired = _ref3$isRequired === void 0 ? undefined : _ref3$isRequired,
|
|
12371
12410
|
questions = _ref3.questions;
|
|
12372
|
-
return _objectSpread$
|
|
12411
|
+
return _objectSpread$z(_objectSpread$z({}, defaults), {}, {
|
|
12373
12412
|
metadata: metadata,
|
|
12374
12413
|
isRequired: isRequired,
|
|
12375
12414
|
kind: type,
|
|
@@ -12386,14 +12425,14 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
12386
12425
|
}, questionKinds);
|
|
12387
12426
|
var isRequired = item.isRequired,
|
|
12388
12427
|
kind = item.kind,
|
|
12389
|
-
label = item.label,
|
|
12390
12428
|
optionsAttributes = item.optionsAttributes;
|
|
12429
|
+
var label = fieldWithFallback(item, "label");
|
|
12391
12430
|
var defaultAttributeNames = ramda.keys(questionKind.defaults || {});
|
|
12392
12431
|
var defaultAttributes = ramda.pick(defaultAttributeNames, item);
|
|
12393
12432
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : i18next.t("neetoForm.common.clonedElementLabel", {
|
|
12394
12433
|
label: label
|
|
12395
12434
|
});
|
|
12396
|
-
return _objectSpread$
|
|
12435
|
+
return _objectSpread$z(_objectSpread$z({}, defaultAttributes), {}, {
|
|
12397
12436
|
isRequired: isRequired,
|
|
12398
12437
|
kind: kind,
|
|
12399
12438
|
label: newQuestionLabel,
|
|
@@ -12451,11 +12490,13 @@ const SvgNoQuestions = props => /*#__PURE__*/React__namespace.createElement("svg
|
|
|
12451
12490
|
|
|
12452
12491
|
var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
12453
12492
|
var children = _ref.children;
|
|
12454
|
-
return /*#__PURE__*/
|
|
12455
|
-
className: "flex h-full flex-col items-center justify-center py-8"
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12493
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12494
|
+
className: "flex h-full flex-col items-center justify-center py-8",
|
|
12495
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12496
|
+
className: "mb-6",
|
|
12497
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SvgNoQuestions, {})
|
|
12498
|
+
}), children]
|
|
12499
|
+
});
|
|
12459
12500
|
};
|
|
12460
12501
|
|
|
12461
12502
|
var NAME = QUESTION_TYPES.NAME,
|
|
@@ -12491,6 +12532,8 @@ var INITIAL_VALUES = {
|
|
|
12491
12532
|
};
|
|
12492
12533
|
|
|
12493
12534
|
var _excluded$b = ["label", "name"];
|
|
12535
|
+
function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12536
|
+
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12494
12537
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
12495
12538
|
var label = _ref.label,
|
|
12496
12539
|
name = _ref.name,
|
|
@@ -12506,7 +12549,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
12506
12549
|
var end = element.value.length;
|
|
12507
12550
|
element.setSelectionRange(end, end);
|
|
12508
12551
|
};
|
|
12509
|
-
return /*#__PURE__*/
|
|
12552
|
+
return /*#__PURE__*/jsxRuntime.jsx(Textarea__default["default"], _objectSpread$y({
|
|
12510
12553
|
label: label,
|
|
12511
12554
|
name: name,
|
|
12512
12555
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -12524,19 +12567,23 @@ var Block = function Block(_ref) {
|
|
|
12524
12567
|
var title = _ref.title,
|
|
12525
12568
|
children = _ref.children,
|
|
12526
12569
|
dataCy = _ref.dataCy;
|
|
12527
|
-
return /*#__PURE__*/
|
|
12570
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12528
12571
|
className: "mt-4 space-y-4",
|
|
12529
|
-
"data-cy": dataCy
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12539
|
-
|
|
12572
|
+
"data-cy": dataCy,
|
|
12573
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12574
|
+
className: "flex items-center justify-between",
|
|
12575
|
+
"data-cy": "properties-header",
|
|
12576
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
12577
|
+
lineHeight: "normal",
|
|
12578
|
+
style: "body1",
|
|
12579
|
+
weight: "semibold",
|
|
12580
|
+
children: title
|
|
12581
|
+
})
|
|
12582
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12583
|
+
className: "space-y-4",
|
|
12584
|
+
children: children
|
|
12585
|
+
})]
|
|
12586
|
+
});
|
|
12540
12587
|
};
|
|
12541
12588
|
|
|
12542
12589
|
var useUpdateEditorContent = function useUpdateEditorContent(_ref) {
|
|
@@ -12626,33 +12673,37 @@ var Editor = function Editor() {
|
|
|
12626
12673
|
initialValue: initialValue,
|
|
12627
12674
|
fieldCode: fieldCode
|
|
12628
12675
|
});
|
|
12629
|
-
return /*#__PURE__*/
|
|
12630
|
-
className: "w-full cursor-auto"
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12676
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12677
|
+
className: "w-full cursor-auto",
|
|
12678
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.Editor, {
|
|
12679
|
+
required: true,
|
|
12680
|
+
error: touched ? error : "",
|
|
12681
|
+
id: "editor",
|
|
12682
|
+
initialValue: value,
|
|
12683
|
+
name: fieldName,
|
|
12684
|
+
ref: editorRef,
|
|
12685
|
+
onBlur: function onBlur() {
|
|
12686
|
+
return setTouched(true);
|
|
12687
|
+
},
|
|
12688
|
+
onChange: setValue
|
|
12689
|
+
})
|
|
12690
|
+
});
|
|
12643
12691
|
};
|
|
12644
12692
|
|
|
12645
12693
|
var RequiredSwitch = reactUtils.withT(function (_ref) {
|
|
12646
12694
|
var t = _ref.t;
|
|
12647
|
-
return /*#__PURE__*/
|
|
12648
|
-
className: "w-full"
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12695
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12696
|
+
className: "w-full",
|
|
12697
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
12698
|
+
label: t("neetoForm.questions.common.questionFields.field.required"),
|
|
12699
|
+
name: "isRequired"
|
|
12700
|
+
})
|
|
12701
|
+
});
|
|
12653
12702
|
});
|
|
12654
12703
|
|
|
12655
12704
|
var _excluded$a = ["maxLength"];
|
|
12705
|
+
function ownKeys$x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12706
|
+
function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$x(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12656
12707
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
12657
12708
|
var maxLength = _ref.maxLength,
|
|
12658
12709
|
props = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
@@ -12666,38 +12717,40 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
12666
12717
|
}
|
|
12667
12718
|
}, [value, maxLength, setValue]);
|
|
12668
12719
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
12669
|
-
return /*#__PURE__*/
|
|
12720
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], _objectSpread$x(_objectSpread$x({}, props), shouldShowMaxLength && {
|
|
12670
12721
|
maxLength: maxLength
|
|
12671
12722
|
}));
|
|
12672
12723
|
};
|
|
12673
12724
|
|
|
12674
12725
|
var FieldCode = reactUtils.withT(function (_ref) {
|
|
12675
12726
|
var t = _ref.t;
|
|
12676
|
-
return /*#__PURE__*/
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
|
|
12681
|
-
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12727
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12728
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
|
|
12729
|
+
required: true,
|
|
12730
|
+
label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
|
|
12731
|
+
name: "fieldCode",
|
|
12732
|
+
helpText: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
12733
|
+
i18nKey: "neetoForm.questions.common.questionFields.field.fieldCodeHelpDescription",
|
|
12734
|
+
components: {
|
|
12735
|
+
Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
12736
|
+
className: "text-xs",
|
|
12737
|
+
href: FIELD_CODE_DOC,
|
|
12738
|
+
style: "link",
|
|
12739
|
+
target: "_blank"
|
|
12740
|
+
})
|
|
12741
|
+
}
|
|
12742
|
+
}),
|
|
12743
|
+
labelProps: {
|
|
12744
|
+
helpIconProps: {
|
|
12745
|
+
icon: neetoIcons.Info,
|
|
12746
|
+
className: "cursor-pointer",
|
|
12747
|
+
onClick: function onClick() {
|
|
12748
|
+
return window.open(FIELD_CODE_DOC, "_blank");
|
|
12749
|
+
}
|
|
12697
12750
|
}
|
|
12698
12751
|
}
|
|
12699
|
-
}
|
|
12700
|
-
})
|
|
12752
|
+
})
|
|
12753
|
+
});
|
|
12701
12754
|
});
|
|
12702
12755
|
|
|
12703
12756
|
var Form$1 = function Form(_ref) {
|
|
@@ -12755,43 +12808,50 @@ var Form$1 = function Form(_ref) {
|
|
|
12755
12808
|
setErrors({});
|
|
12756
12809
|
setTouched({});
|
|
12757
12810
|
};
|
|
12758
|
-
return /*#__PURE__*/
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12811
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Body, {
|
|
12812
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12813
|
+
className: "w-full space-y-4",
|
|
12814
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
12815
|
+
isClearable: true,
|
|
12816
|
+
isSearchable: true,
|
|
12817
|
+
defaultValue: buildDefaultValueForKind(questionKind),
|
|
12818
|
+
innerRef: initialFocusRef,
|
|
12819
|
+
isDisabled: isEdit,
|
|
12820
|
+
name: "kind",
|
|
12821
|
+
options: buildKindOptions(questionKinds),
|
|
12822
|
+
label: t("neetoForm.questions.common.questionFields.field.questionType"),
|
|
12823
|
+
onChange: handleKindChange
|
|
12824
|
+
}), isRichTextQuestion(kind) ? /*#__PURE__*/jsxRuntime.jsx(Editor, {
|
|
12825
|
+
isLabelDisabled: isLabelDisabled
|
|
12826
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12827
|
+
className: "space-y-6",
|
|
12828
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12829
|
+
className: "space-y-4",
|
|
12830
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, {
|
|
12831
|
+
required: true,
|
|
12832
|
+
disabled: isLabelDisabled,
|
|
12833
|
+
name: "label",
|
|
12834
|
+
placeholder: DEFAULT_PLACEHOLDERS[kind],
|
|
12835
|
+
label: t("neetoForm.questions.common.questionFields.field.question")
|
|
12836
|
+
}), shouldShowPlaceholder && /*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, {
|
|
12837
|
+
name: "placeholder",
|
|
12838
|
+
label: t("neetoForm.questions.common.questionFields.field.placeholder")
|
|
12839
|
+
}), hasAdditionalData && renderAdditionalData({
|
|
12840
|
+
kind: kind,
|
|
12841
|
+
questionProps: questionProps
|
|
12842
|
+
})]
|
|
12843
|
+
}), !isRequired && /*#__PURE__*/jsxRuntime.jsx(Block, {
|
|
12844
|
+
dataCy: "settings-card",
|
|
12845
|
+
title: t("neetoForm.common.settings"),
|
|
12846
|
+
children: /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {})
|
|
12847
|
+
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(Block, {
|
|
12848
|
+
dataCy: "advanced-properties-card",
|
|
12849
|
+
title: t("neetoForm.common.advancedProperties"),
|
|
12850
|
+
children: /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})
|
|
12851
|
+
})]
|
|
12852
|
+
})]
|
|
12853
|
+
})
|
|
12854
|
+
});
|
|
12795
12855
|
};
|
|
12796
12856
|
|
|
12797
12857
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
@@ -12834,8 +12894,8 @@ var formValidationSchema = yup__namespace.object().shape({
|
|
|
12834
12894
|
});
|
|
12835
12895
|
|
|
12836
12896
|
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs"];
|
|
12837
|
-
function ownKeys$
|
|
12838
|
-
function _objectSpread$
|
|
12897
|
+
function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12898
|
+
function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12839
12899
|
var Add = function Add(_ref) {
|
|
12840
12900
|
var question = _ref.question,
|
|
12841
12901
|
onClose = _ref.onClose,
|
|
@@ -12864,7 +12924,7 @@ var Add = function Add(_ref) {
|
|
|
12864
12924
|
isCreating = _useCreateQuestion.isLoading;
|
|
12865
12925
|
var handleSubmit = function handleSubmit(values) {
|
|
12866
12926
|
var displayOrder = question ? question.displayOrder + 1 : questions.length;
|
|
12867
|
-
createQuestion(_objectSpread$
|
|
12927
|
+
createQuestion(_objectSpread$w({
|
|
12868
12928
|
language: language,
|
|
12869
12929
|
neetoFormQuestion: ramda.mergeLeft({
|
|
12870
12930
|
displayOrder: displayOrder
|
|
@@ -12879,29 +12939,39 @@ var Add = function Add(_ref) {
|
|
|
12879
12939
|
}
|
|
12880
12940
|
});
|
|
12881
12941
|
};
|
|
12882
|
-
return /*#__PURE__*/
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12942
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12943
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
|
|
12944
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
12945
|
+
"data-cy": "add-question-pane-header",
|
|
12946
|
+
style: "h2",
|
|
12947
|
+
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
12948
|
+
})
|
|
12949
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form__default["default"], {
|
|
12950
|
+
formikProps: {
|
|
12951
|
+
initialValues: INITIAL_VALUES,
|
|
12952
|
+
validationSchema: formValidationSchema,
|
|
12953
|
+
onSubmit: handleSubmit
|
|
12954
|
+
},
|
|
12955
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12956
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$w({}, _objectSpread$w(_objectSpread$w({}, props), {}, {
|
|
12957
|
+
question: question,
|
|
12958
|
+
questions: questions
|
|
12959
|
+
}))), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
|
|
12960
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
12961
|
+
cancelButtonProps: {
|
|
12962
|
+
onClick: onClose
|
|
12963
|
+
},
|
|
12964
|
+
isSubmitting: isCreating
|
|
12965
|
+
})
|
|
12966
|
+
})]
|
|
12967
|
+
})
|
|
12968
|
+
})]
|
|
12969
|
+
});
|
|
12900
12970
|
};
|
|
12901
12971
|
|
|
12902
12972
|
var _excluded$8 = ["question", "onClose"];
|
|
12903
|
-
function ownKeys$
|
|
12904
|
-
function _objectSpread$
|
|
12973
|
+
function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12974
|
+
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12905
12975
|
var Edit = function Edit(_ref) {
|
|
12906
12976
|
var question = _ref.question,
|
|
12907
12977
|
onClose = _ref.onClose,
|
|
@@ -12937,25 +13007,35 @@ var Edit = function Edit(_ref) {
|
|
|
12937
13007
|
}
|
|
12938
13008
|
});
|
|
12939
13009
|
};
|
|
12940
|
-
return /*#__PURE__*/
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
13010
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13011
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
|
|
13012
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
13013
|
+
"data-cy": "edit-question-pane-header",
|
|
13014
|
+
style: "h2",
|
|
13015
|
+
children: t("neetoForm.questions.common.editQuestion")
|
|
13016
|
+
})
|
|
13017
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form__default["default"], {
|
|
13018
|
+
formikProps: {
|
|
13019
|
+
initialValues: question,
|
|
13020
|
+
validationSchema: formValidationSchema,
|
|
13021
|
+
onSubmit: handleSubmit
|
|
13022
|
+
},
|
|
13023
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13024
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$v(_objectSpread$v({}, _objectSpread$v({
|
|
13025
|
+
question: question
|
|
13026
|
+
}, props)), {}, {
|
|
13027
|
+
isEdit: true
|
|
13028
|
+
})), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
|
|
13029
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
13030
|
+
cancelButtonProps: {
|
|
13031
|
+
onClick: onClose
|
|
13032
|
+
},
|
|
13033
|
+
isSubmitting: isUpdating
|
|
13034
|
+
})
|
|
13035
|
+
})]
|
|
13036
|
+
})
|
|
13037
|
+
})]
|
|
13038
|
+
});
|
|
12959
13039
|
};
|
|
12960
13040
|
|
|
12961
13041
|
var FileGroup = function FileGroup(_ref) {
|
|
@@ -12963,7 +13043,7 @@ var FileGroup = function FileGroup(_ref) {
|
|
|
12963
13043
|
label = _ref.label,
|
|
12964
13044
|
checked = _ref.checked,
|
|
12965
13045
|
handleAllowedFileTypesChange = _ref.handleAllowedFileTypesChange;
|
|
12966
|
-
return /*#__PURE__*/
|
|
13046
|
+
return /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], {
|
|
12967
13047
|
checked: checked,
|
|
12968
13048
|
label: label,
|
|
12969
13049
|
name: name,
|
|
@@ -13009,34 +13089,40 @@ var FileUpload$1 = function FileUpload() {
|
|
|
13009
13089
|
allowedFileTypes: allowedFileTypes
|
|
13010
13090
|
}));
|
|
13011
13091
|
};
|
|
13012
|
-
return /*#__PURE__*/
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13092
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13093
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13094
|
+
className: "w-full",
|
|
13095
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Checkbox__default$1["default"], {
|
|
13096
|
+
id: "multipleFilesAllowed",
|
|
13097
|
+
label: t("neetoForm.fileUpload.enableMultipleFilesUpload"),
|
|
13098
|
+
name: "multipleFilesAllowed"
|
|
13099
|
+
})
|
|
13100
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13101
|
+
className: "flex flex-col space-y-3",
|
|
13102
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
13103
|
+
style: "body1",
|
|
13104
|
+
weight: "semibold",
|
|
13105
|
+
children: t("neetoForm.fileUpload.fileTypes")
|
|
13106
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13107
|
+
className: "flex space-x-4",
|
|
13108
|
+
children: FILE_GROUPS.map(function (_ref2) {
|
|
13109
|
+
var name = _ref2.name,
|
|
13110
|
+
label = _ref2.label;
|
|
13111
|
+
return /*#__PURE__*/React$2.createElement(FileGroup, {
|
|
13112
|
+
handleAllowedFileTypesChange: handleAllowedFileTypesChange,
|
|
13113
|
+
label: label,
|
|
13114
|
+
name: name,
|
|
13115
|
+
checked: isFileTypeEnabled(name, allowedFileTypes),
|
|
13116
|
+
key: name
|
|
13117
|
+
});
|
|
13118
|
+
})
|
|
13119
|
+
})]
|
|
13120
|
+
})]
|
|
13121
|
+
});
|
|
13036
13122
|
};
|
|
13037
13123
|
|
|
13038
|
-
function ownKeys$
|
|
13039
|
-
function _objectSpread$
|
|
13124
|
+
function ownKeys$u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13125
|
+
function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$u(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13040
13126
|
var defaultConfig = {
|
|
13041
13127
|
strict: true,
|
|
13042
13128
|
matchKey: "value"
|
|
@@ -13044,7 +13130,7 @@ var defaultConfig = {
|
|
|
13044
13130
|
var findOptionByValue = function findOptionByValue(value) {
|
|
13045
13131
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
13046
13132
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13047
|
-
var configObject = _objectSpread$
|
|
13133
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
13048
13134
|
var matchKey = configObject.matchKey,
|
|
13049
13135
|
strict = configObject.strict;
|
|
13050
13136
|
return options.find(function (option) {
|
|
@@ -13058,7 +13144,7 @@ var filterOptionsByValues = function filterOptionsByValues() {
|
|
|
13058
13144
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13059
13145
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
13060
13146
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13061
|
-
var configObject = _objectSpread$
|
|
13147
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
13062
13148
|
var matchKey = configObject.matchKey,
|
|
13063
13149
|
strict = configObject.strict;
|
|
13064
13150
|
return options.filter(function (option) {
|
|
@@ -13076,7 +13162,7 @@ var destroyFromList = function destroyFromList(items, index) {
|
|
|
13076
13162
|
var nextItems = _toConsumableArray$1(items);
|
|
13077
13163
|
nextItems.splice(index, 1);
|
|
13078
13164
|
if (itemToRemove.id) {
|
|
13079
|
-
nextItems.push(_objectSpread$
|
|
13165
|
+
nextItems.push(_objectSpread$u(_objectSpread$u({}, itemToRemove), {}, {
|
|
13080
13166
|
_destroy: true
|
|
13081
13167
|
}));
|
|
13082
13168
|
}
|
|
@@ -13102,6 +13188,8 @@ var formHelpers = {
|
|
|
13102
13188
|
pushToList: pushToList
|
|
13103
13189
|
};
|
|
13104
13190
|
|
|
13191
|
+
function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13192
|
+
function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13105
13193
|
var Options = function Options(_ref) {
|
|
13106
13194
|
var questionProps = _ref.questionProps;
|
|
13107
13195
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -13120,88 +13208,106 @@ var Options = function Options(_ref) {
|
|
|
13120
13208
|
var nextOptions = formHelpers.destroyFromList(optionsAttributes, index);
|
|
13121
13209
|
setOptionsAttributes(nextOptions);
|
|
13122
13210
|
};
|
|
13123
|
-
return /*#__PURE__*/
|
|
13124
|
-
className: "w-full"
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13211
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13212
|
+
className: "w-full",
|
|
13213
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik.FieldArray, {
|
|
13214
|
+
name: "optionsAttributes",
|
|
13215
|
+
children: function children(_ref3) {
|
|
13216
|
+
var handlePush = _ref3.handlePush;
|
|
13217
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13218
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label__default["default"], _objectSpread$t(_objectSpread$t({
|
|
13219
|
+
className: "mb-1 block"
|
|
13220
|
+
}, optionLabelProps), {}, {
|
|
13221
|
+
children: t("neetoForm.questions.common.questionFields.field.options")
|
|
13222
|
+
})), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13223
|
+
className: "flex w-2/3 flex-col space-y-2",
|
|
13224
|
+
children: optionsAttributes === null || optionsAttributes === void 0 ? void 0 : optionsAttributes.map(function (option, index) {
|
|
13225
|
+
var _option$id;
|
|
13226
|
+
return !option._destroy && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13227
|
+
className: "flex items-start gap-1",
|
|
13228
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
|
|
13229
|
+
required: true,
|
|
13230
|
+
disabled: freezeOptions,
|
|
13231
|
+
name: "optionsAttributes.".concat(index, ".label"),
|
|
13232
|
+
placeholder: t("neetoForm.questions.common.questionFields.field.numberedOption", {
|
|
13233
|
+
number: index + 1
|
|
13234
|
+
})
|
|
13235
|
+
}), !freezeOptions && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
13236
|
+
"data-cy": "neeto-form-engine-delete-option-button",
|
|
13237
|
+
icon: neetoIcons.Delete,
|
|
13238
|
+
size: "small",
|
|
13239
|
+
style: "text",
|
|
13240
|
+
className: classnames__default["default"]({
|
|
13241
|
+
invisible: index < MINIMUM_OPTIONS
|
|
13242
|
+
}),
|
|
13243
|
+
tooltipProps: {
|
|
13244
|
+
position: "top",
|
|
13245
|
+
content: t("neetoForm.common.delete")
|
|
13246
|
+
},
|
|
13247
|
+
onClick: function onClick() {
|
|
13248
|
+
return handleRemoveOption(index);
|
|
13249
|
+
}
|
|
13250
|
+
})]
|
|
13251
|
+
}, "question-option-".concat((_option$id = option.id) !== null && _option$id !== void 0 ? _option$id : index));
|
|
13252
|
+
})
|
|
13253
|
+
}), !freezeOptions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13254
|
+
className: "mt-3 w-full",
|
|
13255
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
13256
|
+
icon: neetoIcons.Plus,
|
|
13257
|
+
iconPosition: "left",
|
|
13258
|
+
size: "small",
|
|
13259
|
+
style: "text",
|
|
13260
|
+
label: t("neetoForm.questions.common.questionFields.field.addOption"),
|
|
13261
|
+
onClick: handlePush({
|
|
13262
|
+
label: ""
|
|
13263
|
+
})
|
|
13264
|
+
})
|
|
13265
|
+
})]
|
|
13266
|
+
});
|
|
13267
|
+
}
|
|
13268
|
+
})
|
|
13269
|
+
});
|
|
13174
13270
|
};
|
|
13175
13271
|
|
|
13176
13272
|
var RatingItem = function RatingItem(_ref) {
|
|
13177
13273
|
var children = _ref.children;
|
|
13178
|
-
return /*#__PURE__*/
|
|
13179
|
-
className: "flex w-16 flex-col items-center gap-3"
|
|
13180
|
-
|
|
13274
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13275
|
+
className: "flex w-16 flex-col items-center gap-3",
|
|
13276
|
+
children: children
|
|
13277
|
+
});
|
|
13181
13278
|
};
|
|
13182
13279
|
var Rating$2 = function Rating() {
|
|
13183
|
-
return /*#__PURE__*/
|
|
13184
|
-
className: "flex flex-col"
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13280
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13281
|
+
className: "flex flex-col",
|
|
13282
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13283
|
+
className: "w-full",
|
|
13284
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13285
|
+
className: "flex gap-6",
|
|
13286
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
|
|
13287
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(GoodSmiley, {
|
|
13288
|
+
color: "#00ba88",
|
|
13289
|
+
size: 48
|
|
13290
|
+
}), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
|
|
13291
|
+
name: "highestRatingLabel"
|
|
13292
|
+
})]
|
|
13293
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
|
|
13294
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(OkaySmiley, {
|
|
13295
|
+
color: "#f3cd82",
|
|
13296
|
+
size: 48
|
|
13297
|
+
}), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
|
|
13298
|
+
name: "averageRatingLabel"
|
|
13299
|
+
})]
|
|
13300
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
|
|
13301
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(BadSmiley, {
|
|
13302
|
+
color: "#f56a58",
|
|
13303
|
+
size: 48
|
|
13304
|
+
}), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
|
|
13305
|
+
name: "lowestRatingLabel"
|
|
13306
|
+
})]
|
|
13307
|
+
})]
|
|
13308
|
+
})
|
|
13309
|
+
})
|
|
13310
|
+
});
|
|
13205
13311
|
};
|
|
13206
13312
|
|
|
13207
13313
|
var StarRating$2 = function StarRating() {
|
|
@@ -13214,42 +13320,48 @@ var StarRating$2 = function StarRating() {
|
|
|
13214
13320
|
iconType = _useField2[0].value;
|
|
13215
13321
|
_useField2[1];
|
|
13216
13322
|
var setIconType = _useField2[2].setValue;
|
|
13217
|
-
return /*#__PURE__*/
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13323
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13324
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13325
|
+
className: "flex space-x-4",
|
|
13326
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
13327
|
+
className: "w-1/2",
|
|
13328
|
+
label: t("neetoForm.common.start"),
|
|
13329
|
+
name: "minValue",
|
|
13330
|
+
options: STAR_RATING_MIN_VALUE_OPTIONS,
|
|
13331
|
+
onChange: function onChange(option) {
|
|
13332
|
+
return setFieldValue("minValue", option === null || option === void 0 ? void 0 : option.value);
|
|
13333
|
+
}
|
|
13334
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
13335
|
+
className: "w-1/2",
|
|
13336
|
+
label: t("neetoForm.common.end"),
|
|
13337
|
+
name: "maxValue",
|
|
13338
|
+
options: STAR_RATING_MAX_VALUE_OPTIONS,
|
|
13339
|
+
onChange: function onChange(option) {
|
|
13340
|
+
return setFieldValue("maxValue", option === null || option === void 0 ? void 0 : option.value);
|
|
13341
|
+
}
|
|
13342
|
+
})]
|
|
13343
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
|
|
13344
|
+
children: t("neetoForm.common.shape")
|
|
13345
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13346
|
+
className: "flex gap-2",
|
|
13347
|
+
children: Object.entries(STAR_RATING_ICONS_MAP).map(function (_ref) {
|
|
13348
|
+
var _ref2 = _slicedToArray$3(_ref, 2),
|
|
13349
|
+
name = _ref2[0],
|
|
13350
|
+
IconType = _ref2[1];
|
|
13351
|
+
var isActive = name === iconType;
|
|
13352
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13353
|
+
className: classnames__default["default"]("flex h-10 w-10 items-center justify-center gap-2", "neeto-ui-border-gray-800 neeto-ui-rounded-full cursor-pointer border", "transition-all duration-300 ease-in-out", {
|
|
13354
|
+
"neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
|
|
13355
|
+
"neeto-ui-text-white neeto-ui-bg-gray-800": isActive
|
|
13356
|
+
}),
|
|
13357
|
+
onClick: function onClick() {
|
|
13358
|
+
return setIconType(name);
|
|
13359
|
+
},
|
|
13360
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconType, {})
|
|
13361
|
+
}, name);
|
|
13362
|
+
})
|
|
13363
|
+
})]
|
|
13364
|
+
});
|
|
13253
13365
|
};
|
|
13254
13366
|
|
|
13255
13367
|
var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
@@ -13270,15 +13382,15 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
13270
13382
|
case CHECKBOX:
|
|
13271
13383
|
case RADIO:
|
|
13272
13384
|
case DROPDOWN:
|
|
13273
|
-
return /*#__PURE__*/
|
|
13385
|
+
return /*#__PURE__*/jsxRuntime.jsx(Options, {
|
|
13274
13386
|
questionProps: questionProps
|
|
13275
13387
|
});
|
|
13276
13388
|
case RATING:
|
|
13277
|
-
return /*#__PURE__*/
|
|
13389
|
+
return /*#__PURE__*/jsxRuntime.jsx(Rating$2, {});
|
|
13278
13390
|
case STAR_RATING:
|
|
13279
|
-
return /*#__PURE__*/
|
|
13391
|
+
return /*#__PURE__*/jsxRuntime.jsx(StarRating$2, {});
|
|
13280
13392
|
case FILE_UPLOAD:
|
|
13281
|
-
return /*#__PURE__*/
|
|
13393
|
+
return /*#__PURE__*/jsxRuntime.jsx(FileUpload$1, {});
|
|
13282
13394
|
default:
|
|
13283
13395
|
return null;
|
|
13284
13396
|
}
|
|
@@ -13311,8 +13423,8 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
13311
13423
|
};
|
|
13312
13424
|
|
|
13313
13425
|
var _excluded$7 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
13314
|
-
function ownKeys$
|
|
13315
|
-
function _objectSpread$
|
|
13426
|
+
function ownKeys$s(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13427
|
+
function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13316
13428
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
13317
13429
|
var isOpen = _ref.isOpen,
|
|
13318
13430
|
onClose = _ref.onClose,
|
|
@@ -13322,16 +13434,17 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
13322
13434
|
props = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13323
13435
|
var initialFocusRef = React$2.useRef(null);
|
|
13324
13436
|
var Component = resolveActionComponent(action);
|
|
13325
|
-
return /*#__PURE__*/
|
|
13437
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"], {
|
|
13326
13438
|
initialFocusRef: initialFocusRef,
|
|
13327
13439
|
isOpen: isOpen,
|
|
13328
|
-
onClose: onClose
|
|
13329
|
-
}, /*#__PURE__*/React__default["default"].createElement(Component, _objectSpread$i({
|
|
13330
|
-
availableQuestionKinds: availableQuestionKinds,
|
|
13331
|
-
initialFocusRef: initialFocusRef,
|
|
13332
13440
|
onClose: onClose,
|
|
13333
|
-
|
|
13334
|
-
|
|
13441
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$s({}, _objectSpread$s({
|
|
13442
|
+
availableQuestionKinds: availableQuestionKinds,
|
|
13443
|
+
initialFocusRef: initialFocusRef,
|
|
13444
|
+
onClose: onClose,
|
|
13445
|
+
question: question
|
|
13446
|
+
}, props)))
|
|
13447
|
+
});
|
|
13335
13448
|
};
|
|
13336
13449
|
|
|
13337
13450
|
var AddQuestion = reactUtils.withT(function (_ref) {
|
|
@@ -13339,23 +13452,26 @@ var AddQuestion = reactUtils.withT(function (_ref) {
|
|
|
13339
13452
|
onAdd = _ref.onAdd,
|
|
13340
13453
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
13341
13454
|
isDisabled = _ref.isDisabled;
|
|
13342
|
-
return /*#__PURE__*/
|
|
13455
|
+
return /*#__PURE__*/jsxRuntime.jsx(Tooltip__default["default"], {
|
|
13343
13456
|
disabled: !isDisabled,
|
|
13344
13457
|
position: "top",
|
|
13345
|
-
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13458
|
+
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft"),
|
|
13459
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
13460
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
13461
|
+
disabled: isDisabled,
|
|
13462
|
+
icon: neetoIcons.Plus,
|
|
13463
|
+
iconPosition: "left",
|
|
13464
|
+
label: t("neetoForm.questions.common.primaryPanel.addQuestion"),
|
|
13465
|
+
style: "link",
|
|
13466
|
+
onClick: onAdd
|
|
13467
|
+
})
|
|
13468
|
+
})
|
|
13469
|
+
});
|
|
13354
13470
|
});
|
|
13355
13471
|
|
|
13356
13472
|
var _excluded$6 = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs"];
|
|
13357
|
-
function ownKeys$
|
|
13358
|
-
function _objectSpread$
|
|
13473
|
+
function ownKeys$r(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13474
|
+
function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13359
13475
|
var Form = function Form(_ref) {
|
|
13360
13476
|
var questionKinds = _ref.questionKinds,
|
|
13361
13477
|
onValueChange = _ref.onValueChange,
|
|
@@ -13449,7 +13565,7 @@ var Form = function Form(_ref) {
|
|
|
13449
13565
|
questions: questions
|
|
13450
13566
|
});
|
|
13451
13567
|
var displayOrder = selectedQuestion.displayOrder + 1;
|
|
13452
|
-
var payload = _objectSpread$
|
|
13568
|
+
var payload = _objectSpread$r({
|
|
13453
13569
|
language: selectedLanguage,
|
|
13454
13570
|
neetoFormQuestion: ramda.mergeLeft({
|
|
13455
13571
|
displayOrder: displayOrder
|
|
@@ -13497,92 +13613,102 @@ var Form = function Form(_ref) {
|
|
|
13497
13613
|
richTextFieldsToReset: ramda.pluck("fieldCode", richTextQuestions)
|
|
13498
13614
|
});
|
|
13499
13615
|
};
|
|
13500
|
-
return /*#__PURE__*/
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13616
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13617
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DeleteAlert, {
|
|
13618
|
+
handleSelect: handleSelect,
|
|
13619
|
+
selectedQuestion: selectedQuestion,
|
|
13620
|
+
isOpen: isDeleteAlertOpen,
|
|
13621
|
+
languagesCount: availableLanguages.length,
|
|
13622
|
+
onClose: function onClose() {
|
|
13623
|
+
return setIsDeleteAlertOpen(false);
|
|
13624
|
+
}
|
|
13625
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(formik.Form, _objectSpread$r(_objectSpread$r({
|
|
13626
|
+
className: "neeto-form-nano-form-wrapper flex h-full flex-col"
|
|
13627
|
+
}, formDomProps), {}, {
|
|
13628
|
+
noValidate: true,
|
|
13629
|
+
children: [formTitle && /*#__PURE__*/jsxRuntime.jsx(Overview, {
|
|
13630
|
+
additionalActionOptions: additionalActionOptions,
|
|
13631
|
+
availableLanguages: availableLanguages,
|
|
13632
|
+
selectedLanguage: selectedLanguage,
|
|
13633
|
+
description: formDescription,
|
|
13634
|
+
title: formTitle,
|
|
13635
|
+
onLanguageChange: handleLanguageChange
|
|
13636
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13637
|
+
className: "neeto-form-nano-form-wrapper__body min-h-0 w-full flex-grow space-y-6 overflow-y-auto px-6 pb-6",
|
|
13638
|
+
children: hasActiveQuestions ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13639
|
+
className: "space-y-6",
|
|
13640
|
+
ref: containerRef,
|
|
13641
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DragDropContext, {
|
|
13642
|
+
onDragEnd: function onDragEnd(_ref3) {
|
|
13643
|
+
var source = _ref3.source,
|
|
13644
|
+
destination = _ref3.destination;
|
|
13645
|
+
return handleFieldDragEnd({
|
|
13646
|
+
source: source,
|
|
13647
|
+
destination: destination,
|
|
13648
|
+
items: questions,
|
|
13649
|
+
setValue: setFieldValue
|
|
13650
|
+
});
|
|
13651
|
+
},
|
|
13652
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Questions, {
|
|
13653
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13654
|
+
isDeletable: isDeletable,
|
|
13655
|
+
questions: questions,
|
|
13656
|
+
selectedQuestion: selectedQuestion,
|
|
13657
|
+
allQuestionKinds: questionKinds,
|
|
13658
|
+
onClone: handleClone,
|
|
13659
|
+
onDelete: handleDelete,
|
|
13660
|
+
onEdit: handleEdit,
|
|
13661
|
+
onSelect: handleSelect
|
|
13662
|
+
})
|
|
13663
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13664
|
+
className: "mb-8 w-full",
|
|
13665
|
+
children: /*#__PURE__*/jsxRuntime.jsx(AddQuestion, {
|
|
13666
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13667
|
+
isDisabled: ramda.isEmpty(availableQuestionKinds),
|
|
13668
|
+
onAdd: handleAdd
|
|
13669
|
+
})
|
|
13670
|
+
})]
|
|
13671
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(AddFirstQuestion, {
|
|
13672
|
+
children: /*#__PURE__*/jsxRuntime.jsx(AddQuestion, {
|
|
13673
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13674
|
+
isDisabled: ramda.isEmpty(availableQuestionKinds),
|
|
13675
|
+
onAdd: handleAdd
|
|
13676
|
+
})
|
|
13677
|
+
})
|
|
13678
|
+
}), (showActionBlock || dirty) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13679
|
+
className: "neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer flex flex-shrink-0 justify-end border-t px-6 py-4",
|
|
13680
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
13681
|
+
submitButtonProps: submitButtonProps,
|
|
13682
|
+
isSubmitting: isReordering,
|
|
13683
|
+
cancelButtonProps: _objectSpread$r({
|
|
13684
|
+
label: t("neetoForm.common.reset"),
|
|
13685
|
+
onClick: resetFormData
|
|
13686
|
+
}, cancelButtonProps)
|
|
13687
|
+
})
|
|
13688
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ManageQuestionPane, {
|
|
13689
|
+
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
13690
|
+
availableQuestionKinds: availableQuestionKinds,
|
|
13691
|
+
buildRequestArgs: buildRequestArgs,
|
|
13692
|
+
enableFieldCode: enableFieldCode,
|
|
13693
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13694
|
+
handleSelect: handleSelect,
|
|
13695
|
+
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
13696
|
+
isRequiredField: isRequiredField,
|
|
13697
|
+
questions: questions,
|
|
13698
|
+
action: selectedAction,
|
|
13699
|
+
allQuestionKinds: questionKinds,
|
|
13700
|
+
isOpen: isManageQuestionPaneOpen,
|
|
13701
|
+
question: selectedQuestion,
|
|
13702
|
+
onClose: function onClose() {
|
|
13703
|
+
return setIsManageQuestionPaneOpen(false);
|
|
13704
|
+
}
|
|
13705
|
+
})]
|
|
13706
|
+
}))]
|
|
13707
|
+
});
|
|
13582
13708
|
};
|
|
13583
13709
|
|
|
13584
|
-
function ownKeys$
|
|
13585
|
-
function _objectSpread$
|
|
13710
|
+
function ownKeys$q(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13711
|
+
function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13586
13712
|
var BuildForm = function BuildForm(_ref) {
|
|
13587
13713
|
var id = _ref.id,
|
|
13588
13714
|
onUpdate = _ref.onUpdate,
|
|
@@ -13660,9 +13786,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13660
13786
|
questions = _useFetchQuestions$da2.questions,
|
|
13661
13787
|
isLoading = _useFetchQuestions.isLoading;
|
|
13662
13788
|
if (isLoading || showLoader && isQuestionsLoading) {
|
|
13663
|
-
return /*#__PURE__*/
|
|
13664
|
-
className: "flex h-full w-full items-center justify-center py-6"
|
|
13665
|
-
|
|
13789
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13790
|
+
className: "flex h-full w-full items-center justify-center py-6",
|
|
13791
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
13792
|
+
});
|
|
13666
13793
|
}
|
|
13667
13794
|
var handleSubmit = function handleSubmit(_ref2, _ref3) {
|
|
13668
13795
|
var questions = _ref2.questions;
|
|
@@ -13698,57 +13825,62 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13698
13825
|
var defaultQuestionKinds = allowAdditionalGuests ? QUESTION_KINDS : neetoCist.removeBy({
|
|
13699
13826
|
type: QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
13700
13827
|
}, QUESTION_KINDS);
|
|
13701
|
-
return /*#__PURE__*/
|
|
13702
|
-
className: classnames__default["default"]("neeto-form-nano-form-outer-wrapper relative", className)
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13828
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13829
|
+
className: classnames__default["default"]("neeto-form-nano-form-outer-wrapper relative", className),
|
|
13830
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(formik.Formik, {
|
|
13831
|
+
enableReinitialize: true,
|
|
13832
|
+
initialValues: {
|
|
13833
|
+
questions: questions
|
|
13834
|
+
},
|
|
13835
|
+
onSubmit: handleSubmit,
|
|
13836
|
+
children: function children(_ref5) {
|
|
13837
|
+
var errors = _ref5.errors,
|
|
13838
|
+
setFieldError = _ref5.setFieldError;
|
|
13839
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form, _objectSpread$q(_objectSpread$q({}, _objectSpread$q(_objectSpread$q({}, formDomProps), {}, {
|
|
13840
|
+
additionalActionOptions: additionalActionOptions,
|
|
13841
|
+
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
13842
|
+
availableLanguages: availableLanguages,
|
|
13843
|
+
buildRequestArgs: buildRequestArgs,
|
|
13844
|
+
cancelButtonProps: cancelButtonProps,
|
|
13845
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13846
|
+
enableFieldCode: enableFieldCode,
|
|
13847
|
+
formDescription: formDescription,
|
|
13848
|
+
formTitle: formTitle,
|
|
13849
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13850
|
+
isDeletable: isDeletable,
|
|
13851
|
+
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
13852
|
+
isFormEnabled: isFormEnabled,
|
|
13853
|
+
isKindAlreadyActive: isKindAlreadyActive,
|
|
13854
|
+
isReordering: isReordering,
|
|
13855
|
+
isRequiredField: isRequiredField,
|
|
13856
|
+
kindUniqueOn: kindUniqueOn,
|
|
13857
|
+
onLanguageChange: onLanguageChange,
|
|
13858
|
+
onValueChange: onValueChange,
|
|
13859
|
+
savedTitle: savedTitle,
|
|
13860
|
+
selectedLanguage: selectedLanguage,
|
|
13861
|
+
showActionBlock: showActionBlock,
|
|
13862
|
+
submitButtonProps: submitButtonProps
|
|
13863
|
+
})), {}, {
|
|
13864
|
+
formId: id,
|
|
13865
|
+
questionKinds: neetoCist.isPresent(questionKinds) ? questionKinds : defaultQuestionKinds,
|
|
13866
|
+
onChange: function onChange(event) {
|
|
13867
|
+
if (ramda.isEmpty(errors)) return;
|
|
13868
|
+
setFieldError(event.target.name);
|
|
13869
|
+
}
|
|
13870
|
+
}));
|
|
13742
13871
|
}
|
|
13743
|
-
})
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13872
|
+
}), isQuestionsLoading && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13873
|
+
className: "neeto-ui-bg-white absolute inset-0 flex items-center justify-center",
|
|
13874
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
13875
|
+
})]
|
|
13876
|
+
});
|
|
13747
13877
|
};
|
|
13748
13878
|
|
|
13749
13879
|
var NeetoFormProvider = function NeetoFormProvider(_ref) {
|
|
13750
13880
|
var children = _ref.children;
|
|
13751
|
-
return /*#__PURE__*/
|
|
13881
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
13882
|
+
children: children
|
|
13883
|
+
});
|
|
13752
13884
|
};
|
|
13753
13885
|
|
|
13754
13886
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -14134,25 +14266,29 @@ var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
|
14134
14266
|
var Spinner = function Spinner(_ref) {
|
|
14135
14267
|
var _ref$size = _ref.size,
|
|
14136
14268
|
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
14137
|
-
return /*#__PURE__*/
|
|
14138
|
-
className: "neeto-form-engine-spinner"
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14269
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14270
|
+
className: "neeto-form-engine-spinner",
|
|
14271
|
+
children: /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
14272
|
+
fill: "none",
|
|
14273
|
+
height: size,
|
|
14274
|
+
viewBox: "0 0 25 24",
|
|
14275
|
+
width: size,
|
|
14276
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14277
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
14278
|
+
d: "M12.5 5.00098V8.75M17.4401 7.04867L14.9888 9.5M19.5008 11.9994H15.5M17.4401 16.9372L14.9888 14.4859M12.5023 18.9979V15M7.5516 16.9372L10.4888 14M5.50391 11.9994H9.5M7.5516 7.04867L10.0029 9.5",
|
|
14279
|
+
stroke: "#87929D",
|
|
14280
|
+
strokeLinecap: "round",
|
|
14281
|
+
strokeLinejoin: "round",
|
|
14282
|
+
strokeWidth: "1.5"
|
|
14283
|
+
})
|
|
14284
|
+
})
|
|
14285
|
+
});
|
|
14152
14286
|
};
|
|
14153
14287
|
var Spinner$1 = /*#__PURE__*/React__default["default"].memo(Spinner);
|
|
14154
14288
|
|
|
14155
14289
|
var _excluded$5 = ["label", "loading", "success", "className"];
|
|
14290
|
+
function ownKeys$p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14291
|
+
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14156
14292
|
var Button = function Button(_ref) {
|
|
14157
14293
|
var label = _ref.label,
|
|
14158
14294
|
_ref$loading = _ref.loading,
|
|
@@ -14162,19 +14298,23 @@ var Button = function Button(_ref) {
|
|
|
14162
14298
|
_ref$className = _ref.className,
|
|
14163
14299
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
14164
14300
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14165
|
-
return /*#__PURE__*/
|
|
14301
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$p(_objectSpread$p({
|
|
14166
14302
|
className: classnames__default["default"]("neeto-form-engine-button", className)
|
|
14167
|
-
}, otherProps),
|
|
14303
|
+
}, otherProps), {}, {
|
|
14304
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoader, {}), success && /*#__PURE__*/jsxRuntime.jsx(Success$2, {}), label]
|
|
14305
|
+
}));
|
|
14168
14306
|
};
|
|
14169
14307
|
var ButtonLoader = function ButtonLoader() {
|
|
14170
|
-
return /*#__PURE__*/
|
|
14171
|
-
className: "neeto-form-engine-button__loader"
|
|
14172
|
-
|
|
14308
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14309
|
+
className: "neeto-form-engine-button__loader",
|
|
14310
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner$1, {})
|
|
14311
|
+
});
|
|
14173
14312
|
};
|
|
14174
14313
|
var Success$2 = function Success() {
|
|
14175
|
-
return /*#__PURE__*/
|
|
14176
|
-
className: "neeto-form-engine-button__success"
|
|
14177
|
-
|
|
14314
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14315
|
+
className: "neeto-form-engine-button__success",
|
|
14316
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Check, {})
|
|
14317
|
+
});
|
|
14178
14318
|
};
|
|
14179
14319
|
|
|
14180
14320
|
var CALLOUT_STYLES = {
|
|
@@ -14202,31 +14342,40 @@ var Callout = function Callout(_ref) {
|
|
|
14202
14342
|
primaryButton = callout.primaryButton,
|
|
14203
14343
|
secondaryButton = callout.secondaryButton;
|
|
14204
14344
|
if (!isVisible) return null;
|
|
14205
|
-
return /*#__PURE__*/
|
|
14345
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14206
14346
|
className: classnames__default["default"]("neeto-form-engine-callout", _defineProperty$6({
|
|
14207
14347
|
"neeto-form-engine-callout--error": style === CALLOUT_STYLES.ERROR,
|
|
14208
14348
|
"neeto-form-engine-callout--info": style === CALLOUT_STYLES.INFO,
|
|
14209
14349
|
"neeto-form-engine-callout--static": position === CALLOUT_POSITIONS.STATIC,
|
|
14210
14350
|
"neeto-form-engine-callout--absolute": position === CALLOUT_POSITIONS.ABSOLUTE
|
|
14211
|
-
}, className, className))
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14216
|
-
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14351
|
+
}, className, className)),
|
|
14352
|
+
children: [neetoCist.isPresent(onClose) && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
14353
|
+
className: "neeto-form-engine-callout__close",
|
|
14354
|
+
onClick: onClose,
|
|
14355
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Close, {
|
|
14356
|
+
size: 16
|
|
14357
|
+
})
|
|
14358
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14359
|
+
className: "neeto-form-engine-callout__content",
|
|
14360
|
+
children: [ramda.not(isBlank(title)) && /*#__PURE__*/jsxRuntime.jsx("h5", {
|
|
14361
|
+
children: title
|
|
14362
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
14363
|
+
children: message
|
|
14364
|
+
})]
|
|
14365
|
+
}), primaryButton && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
14366
|
+
label: primaryButton.label,
|
|
14367
|
+
size: "small",
|
|
14368
|
+
onClick: primaryButton.onClick
|
|
14369
|
+
}), secondaryButton && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
14370
|
+
label: secondaryButton.label,
|
|
14371
|
+
size: "small",
|
|
14372
|
+
onClick: secondaryButton.onClick
|
|
14373
|
+
}), children]
|
|
14374
|
+
});
|
|
14228
14375
|
};
|
|
14229
14376
|
|
|
14377
|
+
var clientI18nInstance = i18next__default["default"].cloneInstance();
|
|
14378
|
+
|
|
14230
14379
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
14231
14380
|
try {
|
|
14232
14381
|
localStorage.removeItem(key);
|
|
@@ -14274,13 +14423,25 @@ var FormikWrap = function FormikWrap(_ref) {
|
|
|
14274
14423
|
children = _ref.children,
|
|
14275
14424
|
formId = _ref.formId,
|
|
14276
14425
|
preserveValues = _ref.preserveValues,
|
|
14277
|
-
onValuesChange = _ref.onValuesChange
|
|
14426
|
+
onValuesChange = _ref.onValuesChange,
|
|
14427
|
+
dataUpdateCount = _ref.dataUpdateCount;
|
|
14278
14428
|
var _useFormikContext = formik.useFormikContext(),
|
|
14279
14429
|
errors = _useFormikContext.errors,
|
|
14280
14430
|
touched = _useFormikContext.touched,
|
|
14281
14431
|
isValid = _useFormikContext.isValid,
|
|
14282
14432
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
14283
|
-
values = _useFormikContext.values
|
|
14433
|
+
values = _useFormikContext.values,
|
|
14434
|
+
validateForm = _useFormikContext.validateForm;
|
|
14435
|
+
var revalidate = function revalidate() {
|
|
14436
|
+
return neetoCist.isPresent(errors) && validateForm();
|
|
14437
|
+
};
|
|
14438
|
+
React$2.useEffect(function () {
|
|
14439
|
+
revalidate();
|
|
14440
|
+
clientI18nInstance.on("languageChanged", revalidate);
|
|
14441
|
+
return function () {
|
|
14442
|
+
return clientI18nInstance.off("languageChanged", revalidate);
|
|
14443
|
+
};
|
|
14444
|
+
}, [dataUpdateCount]);
|
|
14284
14445
|
var syncValuesWithLocalStorage = function syncValuesWithLocalStorage() {
|
|
14285
14446
|
return preserveValues && !isEmptyValues(values) && setWithExpiry("".concat(formId, "/values"), values);
|
|
14286
14447
|
};
|
|
@@ -14289,16 +14450,16 @@ var FormikWrap = function FormikWrap(_ref) {
|
|
|
14289
14450
|
onValuesChange && onValuesChange(values);
|
|
14290
14451
|
}, [values, formId, preserveValues]);
|
|
14291
14452
|
React$2.useEffect(function () {
|
|
14292
|
-
if (
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14453
|
+
if (isSubmitting || isValid) return;
|
|
14454
|
+
|
|
14455
|
+
// include only touched fields
|
|
14456
|
+
var touchedErrors = Object.keys(errors).filter(function (key) {
|
|
14457
|
+
return touched[key];
|
|
14458
|
+
}).reduce(function (obj, key) {
|
|
14459
|
+
obj[key] = errors[key];
|
|
14460
|
+
return obj;
|
|
14461
|
+
}, {});
|
|
14462
|
+
if (isFunction$1(onError)) onError(touchedErrors);
|
|
14302
14463
|
}, [isValid, isSubmitting]);
|
|
14303
14464
|
return children;
|
|
14304
14465
|
};
|
|
@@ -15922,9 +16083,9 @@ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o
|
|
|
15922
16083
|
|
|
15923
16084
|
function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15924
16085
|
|
|
15925
|
-
function ownKeys$
|
|
16086
|
+
function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15926
16087
|
|
|
15927
|
-
function _objectSpread$
|
|
16088
|
+
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty$4(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15928
16089
|
|
|
15929
16090
|
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15930
16091
|
var DEFAULT_OPTIONS = {
|
|
@@ -15951,7 +16112,7 @@ var DEFAULT_OPTIONS = {
|
|
|
15951
16112
|
function formatNumber(input, format, options, metadata) {
|
|
15952
16113
|
// Apply default options.
|
|
15953
16114
|
if (options) {
|
|
15954
|
-
options = _objectSpread$
|
|
16115
|
+
options = _objectSpread$o(_objectSpread$o({}, DEFAULT_OPTIONS), options);
|
|
15955
16116
|
} else {
|
|
15956
16117
|
options = DEFAULT_OPTIONS;
|
|
15957
16118
|
}
|
|
@@ -16096,9 +16257,9 @@ function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry,
|
|
|
16096
16257
|
}
|
|
16097
16258
|
}
|
|
16098
16259
|
|
|
16099
|
-
function ownKeys$
|
|
16260
|
+
function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16100
16261
|
|
|
16101
|
-
function _objectSpread$
|
|
16262
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16102
16263
|
|
|
16103
16264
|
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16104
16265
|
|
|
@@ -16210,7 +16371,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
16210
16371
|
}, {
|
|
16211
16372
|
key: "format",
|
|
16212
16373
|
value: function format(_format, options) {
|
|
16213
|
-
return formatNumber(this, _format, options ? _objectSpread$
|
|
16374
|
+
return formatNumber(this, _format, options ? _objectSpread$n(_objectSpread$n({}, options), {}, {
|
|
16214
16375
|
v2: true
|
|
16215
16376
|
}) : {
|
|
16216
16377
|
v2: true
|
|
@@ -17253,20 +17414,20 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
17253
17414
|
};
|
|
17254
17415
|
}
|
|
17255
17416
|
|
|
17256
|
-
function ownKeys$
|
|
17417
|
+
function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17257
17418
|
|
|
17258
|
-
function _objectSpread$
|
|
17419
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17259
17420
|
|
|
17260
17421
|
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17261
17422
|
function parsePhoneNumberWithError$2(text, options, metadata) {
|
|
17262
|
-
return parse$1(text, _objectSpread$
|
|
17423
|
+
return parse$1(text, _objectSpread$m(_objectSpread$m({}, options), {}, {
|
|
17263
17424
|
v2: true
|
|
17264
17425
|
}), metadata);
|
|
17265
17426
|
}
|
|
17266
17427
|
|
|
17267
|
-
function ownKeys$
|
|
17428
|
+
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17268
17429
|
|
|
17269
|
-
function _objectSpread$
|
|
17430
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17270
17431
|
|
|
17271
17432
|
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17272
17433
|
|
|
@@ -17314,7 +17475,7 @@ function normalizeArguments(args) {
|
|
|
17314
17475
|
}
|
|
17315
17476
|
|
|
17316
17477
|
if (arg_2) {
|
|
17317
|
-
options = _objectSpread$
|
|
17478
|
+
options = _objectSpread$l({
|
|
17318
17479
|
defaultCountry: arg_2
|
|
17319
17480
|
}, options);
|
|
17320
17481
|
}
|
|
@@ -17349,25 +17510,26 @@ function parsePhoneNumberWithError() {
|
|
|
17349
17510
|
return withMetadataArgument(parsePhoneNumberWithError$1, arguments)
|
|
17350
17511
|
}
|
|
17351
17512
|
|
|
17513
|
+
var t$2 = clientI18nInstance.t;
|
|
17352
17514
|
var getInvalidFieldError = function getInvalidFieldError(label) {
|
|
17353
|
-
return
|
|
17515
|
+
return t$2("neetoForm.error.invalidField", {
|
|
17354
17516
|
label: label
|
|
17355
17517
|
});
|
|
17356
17518
|
};
|
|
17357
17519
|
var getRequiredFieldError = function getRequiredFieldError(label) {
|
|
17358
|
-
return
|
|
17520
|
+
return t$2("neetoForm.error.requiredField", {
|
|
17359
17521
|
label: label
|
|
17360
17522
|
});
|
|
17361
17523
|
};
|
|
17362
17524
|
var getSelectMinError = function getSelectMinError(min) {
|
|
17363
|
-
var entity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "option";
|
|
17364
|
-
return
|
|
17525
|
+
var entity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : t$2("neetoForm.common.option");
|
|
17526
|
+
return t$2("neetoForm.error.selectMin", {
|
|
17365
17527
|
min: min,
|
|
17366
17528
|
entity: entity
|
|
17367
17529
|
});
|
|
17368
17530
|
};
|
|
17369
17531
|
var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
17370
|
-
return
|
|
17532
|
+
return t$2("neetoForm.error.invalidType", {
|
|
17371
17533
|
label: label,
|
|
17372
17534
|
type: type
|
|
17373
17535
|
});
|
|
@@ -17375,8 +17537,9 @@ var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
|
17375
17537
|
|
|
17376
17538
|
var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
17377
17539
|
var _fieldKindValidatorMa;
|
|
17378
|
-
function ownKeys$
|
|
17379
|
-
function _objectSpread$
|
|
17540
|
+
function ownKeys$k(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17541
|
+
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17542
|
+
var t$1 = clientI18nInstance.t;
|
|
17380
17543
|
yup__namespace.addMethod(yup__namespace.array, "unique", function () {
|
|
17381
17544
|
var field, message;
|
|
17382
17545
|
if (arguments.length > 1) {
|
|
@@ -17412,7 +17575,7 @@ var validateTextField = function validateTextField(_ref) {
|
|
|
17412
17575
|
isRequired = _ref.isRequired;
|
|
17413
17576
|
var schema = yup__namespace.string().typeError(getInvalidTypeError(label, "string"));
|
|
17414
17577
|
if (kind === QUESTION_KIND.PHONE.value) {
|
|
17415
|
-
schema = PhoneNumber$1.validation(getInvalidFieldError(
|
|
17578
|
+
schema = PhoneNumber$1.validation(getInvalidFieldError(t$1("neetoForm.common.phoneNumberValidation")));
|
|
17416
17579
|
}
|
|
17417
17580
|
if (isRequired) schema = schema.trim().required(getRequiredFieldError(label));
|
|
17418
17581
|
return schema.trim();
|
|
@@ -17455,18 +17618,20 @@ var validateStarRatingField = function validateStarRatingField(_ref7) {
|
|
|
17455
17618
|
var label = _ref7.label,
|
|
17456
17619
|
isRequired = _ref7.isRequired;
|
|
17457
17620
|
var schema = yup__namespace.string().typeError(getInvalidTypeError(label, "string"));
|
|
17458
|
-
if (isRequired)
|
|
17621
|
+
if (isRequired) {
|
|
17622
|
+
schema = schema.required(getSelectMinError("a", t$1("neetoForm.common.rating")));
|
|
17623
|
+
}
|
|
17459
17624
|
return schema.trim();
|
|
17460
17625
|
};
|
|
17461
17626
|
var validateTermsField = function validateTermsField(_ref8) {
|
|
17462
17627
|
var _ref8$isRequired = _ref8.isRequired,
|
|
17463
17628
|
isRequired = _ref8$isRequired === void 0 ? true : _ref8$isRequired;
|
|
17464
|
-
return isRequired ? yup__namespace["boolean"]().oneOf([true],
|
|
17629
|
+
return isRequired ? yup__namespace["boolean"]().oneOf([true], t$1("neetoForm.common.mustAcceptTermsAndConditions")) : yup__namespace["boolean"]().notRequired();
|
|
17465
17630
|
};
|
|
17466
17631
|
var validateConditionField = function validateConditionField(_ref9) {
|
|
17467
17632
|
var _ref9$isRequired = _ref9.isRequired,
|
|
17468
17633
|
isRequired = _ref9$isRequired === void 0 ? true : _ref9$isRequired;
|
|
17469
|
-
return isRequired ? yup__namespace["boolean"]().oneOf([true],
|
|
17634
|
+
return isRequired ? yup__namespace["boolean"]().oneOf([true], t$1("neetoForm.common.mustAcceptCondition")) : yup__namespace["boolean"]().notRequired();
|
|
17470
17635
|
};
|
|
17471
17636
|
var validateDateField = function validateDateField(_ref10) {
|
|
17472
17637
|
var label = _ref10.label,
|
|
@@ -17485,7 +17650,7 @@ var validateMultiEmailField = function validateMultiEmailField(_ref11) {
|
|
|
17485
17650
|
value: yup__namespace.string().email(getInvalidFieldError("Email")).trim()
|
|
17486
17651
|
})).nullable();
|
|
17487
17652
|
if (isRequired) {
|
|
17488
|
-
schema = schema.compact().min(1, getSelectMinError("an", "email"));
|
|
17653
|
+
schema = schema.compact().min(1, getSelectMinError("an", t$1("neetoForm.common.email")));
|
|
17489
17654
|
}
|
|
17490
17655
|
return schema;
|
|
17491
17656
|
};
|
|
@@ -17507,9 +17672,9 @@ var validateFileUploadField = function validateFileUploadField(_ref13) {
|
|
|
17507
17672
|
if (isRequired) {
|
|
17508
17673
|
files_schema = files_schema.of(yup__namespace.object().shape({
|
|
17509
17674
|
name: yup__namespace.string(),
|
|
17510
|
-
signedId: yup__namespace.string().required(
|
|
17511
|
-
url: yup__namespace.string().required(
|
|
17512
|
-
})).unique("name",
|
|
17675
|
+
signedId: yup__namespace.string().required(t$1("neetoForm.fileUpload.validations.waitForUpload")),
|
|
17676
|
+
url: yup__namespace.string().required(t$1("neetoForm.fileUpload.validations.waitForUpload"))
|
|
17677
|
+
})).unique("name", t$1("neetoForm.fileUpload.validations.removeDuplicates")).min(1, multipleFilesAllowed ? t$1("neetoForm.fileUpload.validations.atLeastOneFileRequired") : t$1("neetoForm.fileUpload.validations.fileIsRequired"));
|
|
17513
17678
|
}
|
|
17514
17679
|
return yup__namespace.object().shape({
|
|
17515
17680
|
files: files_schema
|
|
@@ -17525,7 +17690,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17525
17690
|
return function (value) {
|
|
17526
17691
|
if (!(kind in fieldKindValidatorMap)) return;
|
|
17527
17692
|
var validator = fieldKindValidatorMap[kind];
|
|
17528
|
-
var schema = customValidator || validator(_objectSpread$
|
|
17693
|
+
var schema = customValidator || validator(_objectSpread$k({
|
|
17529
17694
|
kind: kind,
|
|
17530
17695
|
label: label,
|
|
17531
17696
|
isRequired: isRequired
|
|
@@ -17562,7 +17727,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17562
17727
|
};
|
|
17563
17728
|
|
|
17564
17729
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
17565
|
-
var
|
|
17730
|
+
var _jsx2;
|
|
17566
17731
|
var question = _ref.question,
|
|
17567
17732
|
customValidator = _ref.customValidator;
|
|
17568
17733
|
var name = question.id,
|
|
@@ -17591,31 +17756,33 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
17591
17756
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
17592
17757
|
isInputVisible = _useState2[0],
|
|
17593
17758
|
setIsInputVisible = _useState2[1];
|
|
17594
|
-
return /*#__PURE__*/
|
|
17595
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
|
|
17603
|
-
|
|
17604
|
-
|
|
17605
|
-
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17759
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
17760
|
+
className: "neeto-form-engine-input__wrapper",
|
|
17761
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
17762
|
+
className: "neeto-ui-w-full",
|
|
17763
|
+
children: isInputVisible ? /*#__PURE__*/jsxRuntime.jsx(NeetoUIMultiEmailInput__default["default"], {
|
|
17764
|
+
isRequired: isRequired,
|
|
17765
|
+
label: label,
|
|
17766
|
+
error: meta.touched ? meta.error : "",
|
|
17767
|
+
helpText: t("neetoForm.common.addGuestsHelper"),
|
|
17768
|
+
name: field.name,
|
|
17769
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
17770
|
+
value: field.value,
|
|
17771
|
+
onBlur: function onBlur() {
|
|
17772
|
+
return setTouched(true);
|
|
17773
|
+
},
|
|
17774
|
+
onChange: setValue
|
|
17775
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], (_jsx2 = {
|
|
17776
|
+
label: label
|
|
17777
|
+
}, _defineProperty$6(_jsx2, "label", t("neetoForm.common.addGuests")), _defineProperty$6(_jsx2, "style", "secondary"), _defineProperty$6(_jsx2, "onClick", function onClick() {
|
|
17778
|
+
return setIsInputVisible(true);
|
|
17779
|
+
}), _jsx2))
|
|
17780
|
+
})
|
|
17781
|
+
});
|
|
17615
17782
|
};
|
|
17616
17783
|
|
|
17617
|
-
function ownKeys$
|
|
17618
|
-
function _objectSpread$
|
|
17784
|
+
function ownKeys$j(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17785
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17619
17786
|
var ConditionField = function ConditionField(_ref) {
|
|
17620
17787
|
var question = _ref.question,
|
|
17621
17788
|
customValidator = _ref.customValidator;
|
|
@@ -17624,30 +17791,32 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17624
17791
|
isRequired = question.isRequired,
|
|
17625
17792
|
nodeId = question.nodeId;
|
|
17626
17793
|
var label = fieldWithFallback(question, "label");
|
|
17627
|
-
return /*#__PURE__*/
|
|
17794
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
17628
17795
|
name: name || nodeId,
|
|
17629
17796
|
validate: validateFieldValue({
|
|
17630
17797
|
kind: kind,
|
|
17631
17798
|
label: label,
|
|
17632
17799
|
isRequired: isRequired,
|
|
17633
17800
|
customValidator: customValidator
|
|
17634
|
-
})
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17801
|
+
}),
|
|
17802
|
+
children: function children(_ref2) {
|
|
17803
|
+
var meta = _ref2.meta,
|
|
17804
|
+
field = _ref2.field;
|
|
17805
|
+
return /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], _objectSpread$j(_objectSpread$j({}, _objectSpread$j(_objectSpread$j({}, field), {}, {
|
|
17806
|
+
label: label,
|
|
17807
|
+
name: name
|
|
17808
|
+
})), {}, {
|
|
17809
|
+
checked: field.value,
|
|
17810
|
+
error: meta.touched ? meta.error : "",
|
|
17811
|
+
required: isRequired
|
|
17812
|
+
}));
|
|
17813
|
+
}
|
|
17646
17814
|
});
|
|
17647
17815
|
};
|
|
17648
17816
|
|
|
17649
|
-
function ownKeys$
|
|
17650
|
-
function _objectSpread$
|
|
17817
|
+
function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17818
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17819
|
+
var t = clientI18nInstance.t;
|
|
17651
17820
|
var toEmailValues = function toEmailValues() {
|
|
17652
17821
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17653
17822
|
return values.map(function (value) {
|
|
@@ -17740,7 +17909,7 @@ var generateInitValues = function generateInitValues(_ref7) {
|
|
|
17740
17909
|
var valuesMap = {};
|
|
17741
17910
|
if (initialValues) {
|
|
17742
17911
|
valuesMap = initialValues.reduce(function (acc, answer) {
|
|
17743
|
-
return _objectSpread$
|
|
17912
|
+
return _objectSpread$i(_objectSpread$i({}, acc), {}, _defineProperty$6({}, answer.questionId, {
|
|
17744
17913
|
value: answer.value,
|
|
17745
17914
|
optionIds: answer.optionIds
|
|
17746
17915
|
}));
|
|
@@ -17942,23 +18111,21 @@ var renderErrorMessage = function renderErrorMessage(errorObject, maxFileSize, i
|
|
|
17942
18111
|
var code = error.code;
|
|
17943
18112
|
switch (code) {
|
|
17944
18113
|
case ERROR_CODES.FILE_TOO_LARGE:
|
|
17945
|
-
return
|
|
18114
|
+
return t("neetoForm.fileUpload.dropzone.errors.fileTooLarge", {
|
|
17946
18115
|
fileName: file.name,
|
|
17947
18116
|
maxSize: Math.round(maxFileSize / 1048576)
|
|
17948
18117
|
});
|
|
17949
18118
|
case ERROR_CODES.FILE_INVALID_TYPE:
|
|
17950
|
-
return
|
|
18119
|
+
return t("neetoForm.fileUpload.dropzone.errors.fileInvalidType", {
|
|
17951
18120
|
fileType: path__default["default"].extname(file.name)
|
|
17952
18121
|
});
|
|
17953
18122
|
case ERROR_CODES.TOO_MANY_FILES:
|
|
17954
18123
|
if (!isMultiple) {
|
|
17955
|
-
return
|
|
17956
|
-
maxFiles: 1
|
|
17957
|
-
});
|
|
18124
|
+
return t("neetoForm.fileUpload.dropzone.errors.tooManyFiles");
|
|
17958
18125
|
}
|
|
17959
18126
|
}
|
|
17960
18127
|
}
|
|
17961
|
-
return
|
|
18128
|
+
return t("neetoForm.fileUpload.dropzone.errors.defaultError", {
|
|
17962
18129
|
fileName: file.name
|
|
17963
18130
|
});
|
|
17964
18131
|
};
|
|
@@ -17972,8 +18139,8 @@ var getSelectedRating = function getSelectedRating(value) {
|
|
|
17972
18139
|
};
|
|
17973
18140
|
|
|
17974
18141
|
var _excluded$3 = ["value"];
|
|
17975
|
-
function ownKeys$
|
|
17976
|
-
function _objectSpread$
|
|
18142
|
+
function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18143
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17977
18144
|
dayjs__default["default"].extend(weekOfYear__default["default"]);
|
|
17978
18145
|
dayjs__default["default"].extend(weekday__default["default"]);
|
|
17979
18146
|
dayjs__default["default"].extend(localeData__default["default"]);
|
|
@@ -17988,47 +18155,52 @@ var DateField = function DateField(_ref) {
|
|
|
17988
18155
|
var label = fieldWithFallback(question, "label");
|
|
17989
18156
|
var _QUESTION_KIND$kind$t = QUESTION_KIND[kind.toUpperCase()].type,
|
|
17990
18157
|
type = _QUESTION_KIND$kind$t === void 0 ? "date" : _QUESTION_KIND$kind$t;
|
|
17991
|
-
return /*#__PURE__*/
|
|
17992
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17993
|
-
|
|
17994
|
-
|
|
17995
|
-
|
|
17996
|
-
|
|
17997
|
-
|
|
17998
|
-
|
|
17999
|
-
|
|
18000
|
-
|
|
18001
|
-
|
|
18002
|
-
|
|
18003
|
-
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18010
|
-
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
|
|
18016
|
-
|
|
18017
|
-
|
|
18018
|
-
|
|
18019
|
-
|
|
18020
|
-
|
|
18021
|
-
|
|
18022
|
-
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18158
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
18159
|
+
className: "neeto-form-engine-input__wrapper",
|
|
18160
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18161
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
18162
|
+
children: label && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
18163
|
+
className: "neeto-form-engine-label",
|
|
18164
|
+
children: getLabel(label, isRequired)
|
|
18165
|
+
})
|
|
18166
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18167
|
+
className: "neeto-form-engine-date-picker",
|
|
18168
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
18169
|
+
name: name || nodeId,
|
|
18170
|
+
validate: validateFieldValue({
|
|
18171
|
+
kind: kind,
|
|
18172
|
+
label: label,
|
|
18173
|
+
isRequired: isRequired,
|
|
18174
|
+
customValidator: customValidator
|
|
18175
|
+
}),
|
|
18176
|
+
children: function children(_ref2) {
|
|
18177
|
+
var meta = _ref2.meta,
|
|
18178
|
+
_ref2$field = _ref2.field,
|
|
18179
|
+
value = _ref2$field.value,
|
|
18180
|
+
field = _objectWithoutProperties$1(_ref2$field, _excluded$3),
|
|
18181
|
+
form = _ref2.form;
|
|
18182
|
+
return /*#__PURE__*/jsxRuntime.jsx(DatePicker__default["default"], _objectSpread$h(_objectSpread$h({}, _objectSpread$h(_objectSpread$h({}, field), {}, {
|
|
18183
|
+
type: type
|
|
18184
|
+
})), {}, {
|
|
18185
|
+
dateFormat: "MMM D, YYYY",
|
|
18186
|
+
error: meta.touched ? meta.error : "",
|
|
18187
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
18188
|
+
popupClassName: "neeto-form-engine-date-picker-popup",
|
|
18189
|
+
required: isRequired,
|
|
18190
|
+
size: "small",
|
|
18191
|
+
value: getValidDate(value),
|
|
18192
|
+
onChange: function onChange(date) {
|
|
18193
|
+
form.setFieldValue(name, date ? date.toISOString() : "");
|
|
18194
|
+
}
|
|
18195
|
+
}));
|
|
18196
|
+
}
|
|
18197
|
+
})
|
|
18198
|
+
})]
|
|
18199
|
+
});
|
|
18028
18200
|
};
|
|
18029
18201
|
|
|
18030
|
-
function ownKeys$
|
|
18031
|
-
function _objectSpread$
|
|
18202
|
+
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18203
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18032
18204
|
var EmailField = function EmailField(_ref) {
|
|
18033
18205
|
var question = _ref.question,
|
|
18034
18206
|
customValidator = _ref.customValidator,
|
|
@@ -18057,12 +18229,12 @@ var EmailField = function EmailField(_ref) {
|
|
|
18057
18229
|
setValue = _useField2$2.setValue,
|
|
18058
18230
|
setTouched = _useField2$2.setTouched;
|
|
18059
18231
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
18060
|
-
return /*#__PURE__*/
|
|
18232
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$g(_objectSpread$g({}, _objectSpread$g(_objectSpread$g({
|
|
18061
18233
|
type: type
|
|
18062
18234
|
}, field), {}, {
|
|
18063
18235
|
autoComplete: autoComplete,
|
|
18064
18236
|
label: label
|
|
18065
|
-
}), {
|
|
18237
|
+
})), {}, {
|
|
18066
18238
|
error: touched ? error : "",
|
|
18067
18239
|
name: kind,
|
|
18068
18240
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -19564,9 +19736,9 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
19564
19736
|
|
|
19565
19737
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19566
19738
|
|
|
19567
|
-
function ownKeys$
|
|
19739
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
19568
19740
|
|
|
19569
|
-
function _objectSpread$
|
|
19741
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$f(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19570
19742
|
|
|
19571
19743
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19572
19744
|
|
|
@@ -19602,7 +19774,7 @@ var Dropzone = /*#__PURE__*/React$2.forwardRef(function (_ref, ref) {
|
|
|
19602
19774
|
};
|
|
19603
19775
|
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
19604
19776
|
|
|
19605
|
-
return /*#__PURE__*/React__default["default"].createElement(React$2.Fragment, null, children(_objectSpread$
|
|
19777
|
+
return /*#__PURE__*/React__default["default"].createElement(React$2.Fragment, null, children(_objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
19606
19778
|
open: open
|
|
19607
19779
|
})));
|
|
19608
19780
|
});
|
|
@@ -19936,7 +20108,7 @@ var initialState = {
|
|
|
19936
20108
|
function useDropzone() {
|
|
19937
20109
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19938
20110
|
|
|
19939
|
-
var _defaultProps$options = _objectSpread$
|
|
20111
|
+
var _defaultProps$options = _objectSpread$f(_objectSpread$f({}, defaultProps), options),
|
|
19940
20112
|
accept = _defaultProps$options.accept,
|
|
19941
20113
|
disabled = _defaultProps$options.disabled,
|
|
19942
20114
|
getFilesFromEvent = _defaultProps$options.getFilesFromEvent,
|
|
@@ -20253,7 +20425,7 @@ function useDropzone() {
|
|
|
20253
20425
|
onDrop = _ref2.onDrop,
|
|
20254
20426
|
rest = _objectWithoutProperties(_ref2, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
|
|
20255
20427
|
|
|
20256
|
-
return _objectSpread$
|
|
20428
|
+
return _objectSpread$f(_objectSpread$f(_defineProperty({
|
|
20257
20429
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
20258
20430
|
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
20259
20431
|
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
@@ -20292,7 +20464,7 @@ function useDropzone() {
|
|
|
20292
20464
|
tabIndex: -1
|
|
20293
20465
|
}, refKey, inputRef);
|
|
20294
20466
|
|
|
20295
|
-
return _objectSpread$
|
|
20467
|
+
return _objectSpread$f(_objectSpread$f({}, inputProps), rest);
|
|
20296
20468
|
};
|
|
20297
20469
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
20298
20470
|
var fileCount = draggedFiles.length;
|
|
@@ -20305,7 +20477,7 @@ function useDropzone() {
|
|
|
20305
20477
|
maxFiles: maxFiles
|
|
20306
20478
|
});
|
|
20307
20479
|
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
20308
|
-
return _objectSpread$
|
|
20480
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20309
20481
|
isDragAccept: isDragAccept,
|
|
20310
20482
|
isDragReject: isDragReject,
|
|
20311
20483
|
isFocused: isFocused && !disabled,
|
|
@@ -20321,22 +20493,22 @@ function reducer(state, action) {
|
|
|
20321
20493
|
/* istanbul ignore next */
|
|
20322
20494
|
switch (action.type) {
|
|
20323
20495
|
case 'focus':
|
|
20324
|
-
return _objectSpread$
|
|
20496
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20325
20497
|
isFocused: true
|
|
20326
20498
|
});
|
|
20327
20499
|
|
|
20328
20500
|
case 'blur':
|
|
20329
|
-
return _objectSpread$
|
|
20501
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20330
20502
|
isFocused: false
|
|
20331
20503
|
});
|
|
20332
20504
|
|
|
20333
20505
|
case 'openDialog':
|
|
20334
|
-
return _objectSpread$
|
|
20506
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20335
20507
|
isFileDialogActive: true
|
|
20336
20508
|
});
|
|
20337
20509
|
|
|
20338
20510
|
case 'closeDialog':
|
|
20339
|
-
return _objectSpread$
|
|
20511
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20340
20512
|
isFileDialogActive: false
|
|
20341
20513
|
});
|
|
20342
20514
|
|
|
@@ -20344,19 +20516,19 @@ function reducer(state, action) {
|
|
|
20344
20516
|
/* eslint no-case-declarations: 0 */
|
|
20345
20517
|
var isDragActive = action.isDragActive,
|
|
20346
20518
|
draggedFiles = action.draggedFiles;
|
|
20347
|
-
return _objectSpread$
|
|
20519
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20348
20520
|
draggedFiles: draggedFiles,
|
|
20349
20521
|
isDragActive: isDragActive
|
|
20350
20522
|
});
|
|
20351
20523
|
|
|
20352
20524
|
case 'setFiles':
|
|
20353
|
-
return _objectSpread$
|
|
20525
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20354
20526
|
acceptedFiles: action.acceptedFiles,
|
|
20355
20527
|
fileRejections: action.fileRejections
|
|
20356
20528
|
});
|
|
20357
20529
|
|
|
20358
20530
|
case 'reset':
|
|
20359
|
-
return _objectSpread$
|
|
20531
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20360
20532
|
isFileDialogActive: false,
|
|
20361
20533
|
isDragActive: false,
|
|
20362
20534
|
draggedFiles: [],
|
|
@@ -20369,8 +20541,8 @@ function reducer(state, action) {
|
|
|
20369
20541
|
}
|
|
20370
20542
|
}
|
|
20371
20543
|
|
|
20372
|
-
function ownKeys$
|
|
20373
|
-
function _objectSpread$
|
|
20544
|
+
function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20545
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20374
20546
|
var useFileUpload = function useFileUpload(_ref) {
|
|
20375
20547
|
var disabled = _ref.disabled,
|
|
20376
20548
|
accept = _ref.accept,
|
|
@@ -20470,7 +20642,7 @@ var useFileUpload = function useFileUpload(_ref) {
|
|
|
20470
20642
|
var uploadedFile = neetoCist.findBy({
|
|
20471
20643
|
name: file.name
|
|
20472
20644
|
}, newFiles);
|
|
20473
|
-
return _objectSpread$
|
|
20645
|
+
return _objectSpread$e(_objectSpread$e({}, file), uploadedFile);
|
|
20474
20646
|
})
|
|
20475
20647
|
});
|
|
20476
20648
|
} else {
|
|
@@ -20529,6 +20701,8 @@ const SvgFileUpload = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
20529
20701
|
d: "M32 26h-6v10h-4V26h-6l8-8 8 8zm6.958-11.816C38.534 6.282 32.012 0 24 0S9.466 6.282 9.042 14.184C3.902 15.11 0 19.596 0 25c0 6.074 4.926 11 11 11h7v-4h-7c-3.86 0-7-3.14-7-7 0-5.594 4.958-7.666 8.866-7.44C12.532 9.124 17.282 4 24 4c6.906 0 11.782 5.594 11.134 13.56C38.624 17.468 44 19.062 44 25c0 3.86-3.14 7-7 7h-7v4h7c6.074 0 11-4.926 11-11 0-5.404-3.902-9.89-9.042-10.816z"
|
|
20530
20702
|
})));
|
|
20531
20703
|
|
|
20704
|
+
function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20705
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20532
20706
|
var DropZone = function DropZone(_ref) {
|
|
20533
20707
|
var isDragActive = _ref.isDragActive,
|
|
20534
20708
|
getRootProps = _ref.getRootProps,
|
|
@@ -20541,54 +20715,63 @@ var DropZone = function DropZone(_ref) {
|
|
|
20541
20715
|
var _useTranslation = reactI18next.useTranslation(),
|
|
20542
20716
|
t = _useTranslation.t;
|
|
20543
20717
|
var shouldShowFileSizeLimit = hasFileSizeLimit && maxFileSize;
|
|
20544
|
-
return /*#__PURE__*/
|
|
20718
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread$d(_objectSpread$d({}, getRootProps({
|
|
20545
20719
|
className: classnames__default["default"](["neeto-form-engine-file-upload__dropzone"], {
|
|
20546
20720
|
"neeto-form-engine-file-upload__dropzone--drag-active": isDragActive
|
|
20547
20721
|
})
|
|
20548
|
-
}),
|
|
20549
|
-
|
|
20550
|
-
|
|
20551
|
-
|
|
20552
|
-
|
|
20553
|
-
|
|
20554
|
-
|
|
20555
|
-
|
|
20556
|
-
|
|
20557
|
-
|
|
20558
|
-
|
|
20559
|
-
|
|
20560
|
-
|
|
20561
|
-
|
|
20562
|
-
|
|
20563
|
-
|
|
20564
|
-
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
20568
|
-
|
|
20569
|
-
|
|
20570
|
-
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20590
|
-
|
|
20591
|
-
|
|
20722
|
+
})), {}, {
|
|
20723
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20724
|
+
className: "neeto-form-engine-file-upload__dropzone-inner",
|
|
20725
|
+
"data-cy": "file-upload-body",
|
|
20726
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgFileUpload, {
|
|
20727
|
+
className: "neeto-form-engine-file-upload__upload-icon"
|
|
20728
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20729
|
+
className: "neeto-form-engine-file-upload__dropzone-content",
|
|
20730
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
20731
|
+
className: "neeto-form-engine-file-upload__upload-label",
|
|
20732
|
+
htmlFor: "file-upload",
|
|
20733
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
20734
|
+
i18nKey: "neetoForm.fileUpload.dropzone.chooseOrDragFile",
|
|
20735
|
+
components: {
|
|
20736
|
+
typography: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20737
|
+
component: "span",
|
|
20738
|
+
weight: "semibold"
|
|
20739
|
+
}),
|
|
20740
|
+
span: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20741
|
+
component: "span",
|
|
20742
|
+
weight: "normal"
|
|
20743
|
+
})
|
|
20744
|
+
}
|
|
20745
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$d(_objectSpread$d({}, getInputProps()), {}, {
|
|
20746
|
+
"data-cy": "file-browse-button"
|
|
20747
|
+
}))]
|
|
20748
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20749
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-block",
|
|
20750
|
+
children: [!multipleFilesAllowed && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20751
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20752
|
+
"data-cy": "upload-only-one-file-text",
|
|
20753
|
+
style: "body3",
|
|
20754
|
+
children: t("neetoForm.fileUpload.dropzone.oneFileAllowed")
|
|
20755
|
+
}), shouldShowFileSizeLimit && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20756
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20757
|
+
"data-cy": "maximum-allowed-size-text",
|
|
20758
|
+
style: "body3",
|
|
20759
|
+
children: t("neetoForm.fileUpload.dropzone.maxFileSize", {
|
|
20760
|
+
size: maxFileSize,
|
|
20761
|
+
unit: t("neetoForm.fileUpload.mb")
|
|
20762
|
+
})
|
|
20763
|
+
}), allowedFileTypes && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20764
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20765
|
+
"data-cy": "allowed-files-types-text",
|
|
20766
|
+
style: "body3",
|
|
20767
|
+
children: t("neetoForm.fileUpload.dropzone.allowedFileTypes", {
|
|
20768
|
+
types: allowedFileTypes
|
|
20769
|
+
})
|
|
20770
|
+
})]
|
|
20771
|
+
})]
|
|
20772
|
+
})]
|
|
20773
|
+
})
|
|
20774
|
+
}));
|
|
20592
20775
|
};
|
|
20593
20776
|
|
|
20594
20777
|
var createDefinition = function (propNames) { return ({
|
|
@@ -27898,51 +28081,55 @@ var Progress = function Progress(_ref) {
|
|
|
27898
28081
|
transition: transition
|
|
27899
28082
|
}
|
|
27900
28083
|
};
|
|
27901
|
-
return /*#__PURE__*/
|
|
27902
|
-
className: "neeto-form-engine-progress__circle"
|
|
27903
|
-
|
|
27904
|
-
|
|
27905
|
-
|
|
27906
|
-
|
|
27907
|
-
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
|
|
27916
|
-
|
|
27917
|
-
|
|
27918
|
-
|
|
27919
|
-
|
|
27920
|
-
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
|
|
27924
|
-
|
|
27925
|
-
|
|
27926
|
-
|
|
27927
|
-
|
|
27928
|
-
|
|
27929
|
-
|
|
27930
|
-
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
|
|
27934
|
-
|
|
27935
|
-
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27940
|
-
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
28084
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28085
|
+
className: "neeto-form-engine-progress__circle",
|
|
28086
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28087
|
+
className: "neeto-form-engine-progress__circle-wrapper",
|
|
28088
|
+
style: {
|
|
28089
|
+
height: size
|
|
28090
|
+
},
|
|
28091
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
28092
|
+
height: size,
|
|
28093
|
+
version: "1.1",
|
|
28094
|
+
viewBox: "0 0 100 100",
|
|
28095
|
+
width: size,
|
|
28096
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28097
|
+
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
28098
|
+
strokeWidth: strokeWidth,
|
|
28099
|
+
className: "circle",
|
|
28100
|
+
cx: "50",
|
|
28101
|
+
cy: "50",
|
|
28102
|
+
fill: "transparent",
|
|
28103
|
+
r: radius,
|
|
28104
|
+
stroke: emptyStroke,
|
|
28105
|
+
strokeOpacity: emptyStrokeOpacity
|
|
28106
|
+
})
|
|
28107
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
28108
|
+
height: size,
|
|
28109
|
+
viewBox: "0 0 100 100",
|
|
28110
|
+
width: size,
|
|
28111
|
+
style: {
|
|
28112
|
+
position: "absolute",
|
|
28113
|
+
transform: "rotate(-90deg)",
|
|
28114
|
+
overflow: "visible",
|
|
28115
|
+
top: 0
|
|
28116
|
+
},
|
|
28117
|
+
children: /*#__PURE__*/jsxRuntime.jsx(motion.circle, {
|
|
28118
|
+
stroke: stroke,
|
|
28119
|
+
strokeWidth: strokeWidth,
|
|
28120
|
+
variants: variants,
|
|
28121
|
+
animate: "show",
|
|
28122
|
+
cx: "50",
|
|
28123
|
+
cy: "50",
|
|
28124
|
+
fill: "transparent",
|
|
28125
|
+
initial: "hidden",
|
|
28126
|
+
r: radius,
|
|
28127
|
+
strokeDasharray: circumference,
|
|
28128
|
+
strokeDashoffset: fillPercents
|
|
28129
|
+
})
|
|
28130
|
+
})]
|
|
28131
|
+
})
|
|
28132
|
+
});
|
|
27946
28133
|
};
|
|
27947
28134
|
|
|
27948
28135
|
var FILE_MIME_TYPES = {
|
|
@@ -27994,48 +28181,56 @@ var FilePreview = reactUtils.withT(function (_ref) {
|
|
|
27994
28181
|
isUploading = _ref.isUploading,
|
|
27995
28182
|
cancel = _ref.cancel,
|
|
27996
28183
|
progress = _ref.progress;
|
|
27997
|
-
return /*#__PURE__*/
|
|
28184
|
+
return /*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
27998
28185
|
className: "neeto-form-engine-file-upload__uploaded-list-item",
|
|
27999
|
-
|
|
28000
|
-
|
|
28001
|
-
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
|
|
28007
|
-
|
|
28008
|
-
|
|
28009
|
-
|
|
28010
|
-
|
|
28011
|
-
|
|
28012
|
-
|
|
28013
|
-
|
|
28014
|
-
|
|
28015
|
-
|
|
28016
|
-
|
|
28017
|
-
|
|
28018
|
-
|
|
28019
|
-
|
|
28020
|
-
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28025
|
-
|
|
28026
|
-
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28038
|
-
|
|
28186
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28187
|
+
className: "neeto-form-engine-file-upload__file-preview",
|
|
28188
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
28189
|
+
className: classnames__default["default"]("p-0", {
|
|
28190
|
+
invisible: isUploading
|
|
28191
|
+
}),
|
|
28192
|
+
href: file.url,
|
|
28193
|
+
icon: neetoIcons.FileGeneric,
|
|
28194
|
+
iconSize: 24,
|
|
28195
|
+
rel: "noreferrer",
|
|
28196
|
+
size: "large",
|
|
28197
|
+
style: "text",
|
|
28198
|
+
target: "_blank"
|
|
28199
|
+
}), isUploading && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28200
|
+
className: "neeto-form-engine-progress",
|
|
28201
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Progress, {
|
|
28202
|
+
percents: progress || 0,
|
|
28203
|
+
size: 20
|
|
28204
|
+
})
|
|
28205
|
+
})]
|
|
28206
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28207
|
+
className: "flex min-w-0 grow flex-col break-words",
|
|
28208
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28209
|
+
className: "neeto-form-engine-file-upload__file-info-name",
|
|
28210
|
+
style: "body2",
|
|
28211
|
+
children: file.name
|
|
28212
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28213
|
+
className: "neeto-form-engine-file-upload__file-info-size",
|
|
28214
|
+
style: "body3",
|
|
28215
|
+
children: file.size ? t("neetoForm.fileUpload.fileSizeInMb", {
|
|
28216
|
+
fileSize: convertBytesToMb(file.size)
|
|
28217
|
+
}) : ""
|
|
28218
|
+
})]
|
|
28219
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28220
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__actions"),
|
|
28221
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28222
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__success-indicator", {
|
|
28223
|
+
"neeto-form-engine-file-upload__success-indicator--active": file.url
|
|
28224
|
+
}),
|
|
28225
|
+
children: file.url && /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Check, {})
|
|
28226
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
28227
|
+
type: "button",
|
|
28228
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__button--red neeto-form-engine-file-upload__remove-button"),
|
|
28229
|
+
onClick: cancel,
|
|
28230
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Close, {})
|
|
28231
|
+
})]
|
|
28232
|
+
})]
|
|
28233
|
+
}, file.url);
|
|
28039
28234
|
});
|
|
28040
28235
|
|
|
28041
28236
|
var FileUploadField = function FileUploadField(_ref) {
|
|
@@ -28085,42 +28280,47 @@ var FileUploadField = function FileUploadField(_ref) {
|
|
|
28085
28280
|
var isUploadingFile = function isUploadingFile(file) {
|
|
28086
28281
|
return ramda.isNotNil(progress[file.name]) && (progress[file.name] !== 100 || !file.url);
|
|
28087
28282
|
};
|
|
28088
|
-
return /*#__PURE__*/
|
|
28089
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
|
|
28096
|
-
|
|
28097
|
-
|
|
28098
|
-
|
|
28099
|
-
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28283
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28284
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28285
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28286
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28287
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
|
|
28288
|
+
className: "neeto-form-engine-label",
|
|
28289
|
+
required: isRequired,
|
|
28290
|
+
children: label
|
|
28291
|
+
})
|
|
28292
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DropZone, {
|
|
28293
|
+
allowedFileTypes: allowedFileTypes,
|
|
28294
|
+
getInputProps: getInputProps,
|
|
28295
|
+
getRootProps: getRootProps,
|
|
28296
|
+
isDragActive: isDragActive,
|
|
28297
|
+
maxFileSize: maxFileSize,
|
|
28298
|
+
multipleFilesAllowed: multipleFilesAllowed
|
|
28299
|
+
}), neetoCist.isNotEmpty(files) && /*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
28300
|
+
className: "neeto-form-engine-file-upload__uploaded-list",
|
|
28301
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (file, idx) {
|
|
28302
|
+
return /*#__PURE__*/React$2.createElement(FilePreview, {
|
|
28303
|
+
file: file,
|
|
28304
|
+
cancel: cancel(idx),
|
|
28305
|
+
isUploading: isUploadingFile(file),
|
|
28306
|
+
key: idx,
|
|
28307
|
+
progress: progress[file.name]
|
|
28308
|
+
});
|
|
28309
|
+
})
|
|
28310
|
+
}), neetoCist.isNotEmpty(fileRejections) && fileRejections.map(function (file, index) {
|
|
28311
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28312
|
+
className: "neeto-ui-text-error-800 neeto-ui-bg-pastel-red neeto-ui-rounded-sm mt-2 inline-block w-full p-1 text-sm",
|
|
28313
|
+
children: renderErrorMessage(file, maxFileSizeInBytes, false)
|
|
28314
|
+
}, index);
|
|
28315
|
+
}), shouldShowError && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28114
28316
|
className: "neeto-ui-text-error-800 neeto-ui-bg-pastel-red neeto-ui-rounded-sm mt-2 inline-block w-full p-1 text-sm",
|
|
28115
|
-
|
|
28116
|
-
}
|
|
28117
|
-
})
|
|
28118
|
-
className: "neeto-ui-text-error-800 neeto-ui-bg-pastel-red neeto-ui-rounded-sm mt-2 inline-block w-full p-1 text-sm"
|
|
28119
|
-
}, error));
|
|
28317
|
+
children: error
|
|
28318
|
+
})]
|
|
28319
|
+
});
|
|
28120
28320
|
};
|
|
28121
28321
|
|
|
28122
|
-
function ownKeys$
|
|
28123
|
-
function _objectSpread$
|
|
28322
|
+
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28323
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28124
28324
|
var NameField = function NameField(_ref) {
|
|
28125
28325
|
var question = _ref.question,
|
|
28126
28326
|
customValidator = _ref.customValidator,
|
|
@@ -28150,12 +28350,12 @@ var NameField = function NameField(_ref) {
|
|
|
28150
28350
|
setValue = _useField2$2.setValue,
|
|
28151
28351
|
setTouched = _useField2$2.setTouched;
|
|
28152
28352
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28153
|
-
return /*#__PURE__*/
|
|
28353
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
28154
28354
|
type: type
|
|
28155
28355
|
}, field), {}, {
|
|
28156
28356
|
autoComplete: autoComplete,
|
|
28157
28357
|
label: label
|
|
28158
|
-
}), {
|
|
28358
|
+
})), {}, {
|
|
28159
28359
|
error: touched ? error : "",
|
|
28160
28360
|
name: kind,
|
|
28161
28361
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28178,39 +28378,43 @@ var Choices = function Choices(_ref) {
|
|
|
28178
28378
|
var isCheckBox = type === "checkbox";
|
|
28179
28379
|
var ChoiceWrapper = isCheckBox ? "div" : Radio__default["default"];
|
|
28180
28380
|
var Component = isCheckBox ? Checkbox__default["default"] : Radio__default["default"].Item;
|
|
28181
|
-
return /*#__PURE__*/
|
|
28182
|
-
className: "neeto-form-engine-choices__wrapper"
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28190
|
-
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28381
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28382
|
+
className: "neeto-form-engine-choices__wrapper",
|
|
28383
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28384
|
+
className: "neeto-form-engine-label",
|
|
28385
|
+
children: label
|
|
28386
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ChoiceWrapper, {
|
|
28387
|
+
className: "neeto-form-engine-choices",
|
|
28388
|
+
stacked: !isCheckBox,
|
|
28389
|
+
children: options.map(function (option, index) {
|
|
28390
|
+
var _value$index;
|
|
28391
|
+
return /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28392
|
+
htmlFor: option.id,
|
|
28393
|
+
className: classnames__default["default"]("neeto-form-engine-choice", {
|
|
28394
|
+
active: false
|
|
28395
|
+
}),
|
|
28396
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
28397
|
+
onChange: onChange,
|
|
28398
|
+
type: type,
|
|
28399
|
+
id: option.id,
|
|
28400
|
+
label: option.label,
|
|
28401
|
+
name: isCheckBox ? "".concat(name, ".").concat(index) : name,
|
|
28402
|
+
value: option.id,
|
|
28403
|
+
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28404
|
+
})
|
|
28405
|
+
}, option.id);
|
|
28195
28406
|
})
|
|
28196
|
-
}, /*#__PURE__*/
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
value: option.id,
|
|
28203
|
-
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28204
|
-
}));
|
|
28205
|
-
})), !!error && typeof error === "string" && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
28206
|
-
className: "neeto-form-engine-input__error",
|
|
28207
|
-
"data-cy": "neeto-form-engine-".concat(type, "-error")
|
|
28208
|
-
}, error));
|
|
28407
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28408
|
+
className: "neeto-form-engine-input__error",
|
|
28409
|
+
"data-cy": "neeto-form-engine-".concat(type, "-error"),
|
|
28410
|
+
children: error
|
|
28411
|
+
})]
|
|
28412
|
+
});
|
|
28209
28413
|
};
|
|
28210
28414
|
var Choices$1 = /*#__PURE__*/React__default["default"].memo(Choices);
|
|
28211
28415
|
|
|
28212
|
-
function ownKeys$
|
|
28213
|
-
function _objectSpread$
|
|
28416
|
+
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28417
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28214
28418
|
var OptionsField = function OptionsField(_ref) {
|
|
28215
28419
|
var question = _ref.question,
|
|
28216
28420
|
customValidator = _ref.customValidator;
|
|
@@ -28233,7 +28437,7 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28233
28437
|
value: option.id
|
|
28234
28438
|
};
|
|
28235
28439
|
}) : options.map(function (option) {
|
|
28236
|
-
return _objectSpread$
|
|
28440
|
+
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
28237
28441
|
label: fieldWithFallback(option, "label")
|
|
28238
28442
|
});
|
|
28239
28443
|
});
|
|
@@ -28244,31 +28448,32 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28244
28448
|
return validateField(name);
|
|
28245
28449
|
});
|
|
28246
28450
|
};
|
|
28247
|
-
return /*#__PURE__*/
|
|
28451
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28248
28452
|
name: name,
|
|
28249
28453
|
validate: validateFieldValue({
|
|
28250
28454
|
kind: kind,
|
|
28251
28455
|
label: label,
|
|
28252
28456
|
isRequired: isRequired,
|
|
28253
28457
|
customValidator: customValidator
|
|
28254
|
-
})
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28271
|
-
|
|
28458
|
+
}),
|
|
28459
|
+
children: function children(_ref2) {
|
|
28460
|
+
var meta = _ref2.meta,
|
|
28461
|
+
field = _ref2.field;
|
|
28462
|
+
var onChange = field.onChange,
|
|
28463
|
+
value = field.value;
|
|
28464
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
28465
|
+
isRequired: isRequired,
|
|
28466
|
+
name: name,
|
|
28467
|
+
error: getError(meta),
|
|
28468
|
+
label: getLabel(label, isRequired),
|
|
28469
|
+
options: transformedOptions,
|
|
28470
|
+
type: kind,
|
|
28471
|
+
value: isDropdown ? neetoCist.findBy({
|
|
28472
|
+
value: value
|
|
28473
|
+
}, transformedOptions) || null : value,
|
|
28474
|
+
onChange: isDropdown ? handleSelect : onChange
|
|
28475
|
+
});
|
|
28476
|
+
}
|
|
28272
28477
|
});
|
|
28273
28478
|
};
|
|
28274
28479
|
|
|
@@ -28297,7 +28502,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28297
28502
|
_useField2$2 = _useField2[2],
|
|
28298
28503
|
setValue = _useField2$2.setValue,
|
|
28299
28504
|
setTouched = _useField2$2.setTouched;
|
|
28300
|
-
return /*#__PURE__*/
|
|
28505
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumberInput, {
|
|
28301
28506
|
autoComplete: autoComplete,
|
|
28302
28507
|
label: label,
|
|
28303
28508
|
value: value,
|
|
@@ -28314,6 +28519,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28314
28519
|
};
|
|
28315
28520
|
|
|
28316
28521
|
var _excluded$2 = ["name", "label", "error", "lowestRatingLabel", "averageRatingLabel", "highestRatingLabel", "value"];
|
|
28522
|
+
function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28523
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28317
28524
|
var Rating = function Rating(_ref) {
|
|
28318
28525
|
var name = _ref.name,
|
|
28319
28526
|
label = _ref.label,
|
|
@@ -28332,38 +28539,46 @@ var Rating = function Rating(_ref) {
|
|
|
28332
28539
|
var Icon = _ref2.icon,
|
|
28333
28540
|
modifier = _ref2.modifier,
|
|
28334
28541
|
rating = _ref2.value;
|
|
28335
|
-
return /*#__PURE__*/
|
|
28336
|
-
|
|
28337
|
-
|
|
28338
|
-
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28542
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React$2.Fragment, {
|
|
28543
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
28544
|
+
type: "button",
|
|
28545
|
+
className: classnames__default["default"]("neeto-form-engine-rating__item neeto-form-engine-rating__item--".concat(modifier), {
|
|
28546
|
+
active: rating === value
|
|
28547
|
+
}),
|
|
28548
|
+
onClick: handleClick,
|
|
28549
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {}), /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28550
|
+
className: "neeto-form-engine-label",
|
|
28551
|
+
children: labels[index]
|
|
28552
|
+
})]
|
|
28553
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$a({
|
|
28554
|
+
name: name,
|
|
28555
|
+
hidden: true,
|
|
28556
|
+
checked: rating === value,
|
|
28557
|
+
type: "radio",
|
|
28558
|
+
value: rating
|
|
28559
|
+
}, other))]
|
|
28560
|
+
}, rating);
|
|
28352
28561
|
});
|
|
28353
28562
|
};
|
|
28354
|
-
return /*#__PURE__*/
|
|
28355
|
-
className: "neeto-form-engine-rating"
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
"
|
|
28363
|
-
|
|
28563
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28564
|
+
className: "neeto-form-engine-rating",
|
|
28565
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28566
|
+
className: "neeto-form-engine-label",
|
|
28567
|
+
children: label
|
|
28568
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28569
|
+
className: "neeto-form-engine-rating__row",
|
|
28570
|
+
children: render()
|
|
28571
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28572
|
+
className: "neeto-form-engine-input__error",
|
|
28573
|
+
"data-cy": "neeto-form-engine-rating-error",
|
|
28574
|
+
children: error
|
|
28575
|
+
})]
|
|
28576
|
+
});
|
|
28364
28577
|
};
|
|
28365
28578
|
var Rating$1 = /*#__PURE__*/React__default["default"].memo(Rating);
|
|
28366
28579
|
|
|
28580
|
+
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28581
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28367
28582
|
var RatingField = function RatingField(_ref) {
|
|
28368
28583
|
var question = _ref.question,
|
|
28369
28584
|
customValidator = _ref.customValidator;
|
|
@@ -28371,27 +28586,30 @@ var RatingField = function RatingField(_ref) {
|
|
|
28371
28586
|
kind = question.kind,
|
|
28372
28587
|
isRequired = question.isRequired;
|
|
28373
28588
|
var label = fieldWithFallback(question, "label");
|
|
28374
|
-
return /*#__PURE__*/
|
|
28589
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28375
28590
|
name: name,
|
|
28376
28591
|
validate: validateFieldValue({
|
|
28377
28592
|
kind: kind,
|
|
28378
28593
|
label: label,
|
|
28379
28594
|
isRequired: isRequired,
|
|
28380
28595
|
customValidator: customValidator
|
|
28381
|
-
})
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28596
|
+
}),
|
|
28597
|
+
children: function children(_ref2) {
|
|
28598
|
+
var meta = _ref2.meta,
|
|
28599
|
+
field = _ref2.field;
|
|
28600
|
+
return /*#__PURE__*/jsxRuntime.jsx(Rating$1, _objectSpread$9(_objectSpread$9({}, field), {}, {
|
|
28601
|
+
error: meta.touched ? meta.error : "",
|
|
28602
|
+
label: getLabel(label, isRequired),
|
|
28603
|
+
averageRatingLabel: fieldWithFallback(question, "averageRatingLabel") || RATING_VALUES.AVERAGE.label,
|
|
28604
|
+
highestRatingLabel: fieldWithFallback(question, "highestRatingLabel") || RATING_VALUES.GOOD.label,
|
|
28605
|
+
lowestRatingLabel: fieldWithFallback(question, "lowestRatingLabel") || RATING_VALUES.BAD.label
|
|
28606
|
+
}));
|
|
28607
|
+
}
|
|
28392
28608
|
});
|
|
28393
28609
|
};
|
|
28394
28610
|
|
|
28611
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28612
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28395
28613
|
var RichTextEditor = function RichTextEditor(_ref) {
|
|
28396
28614
|
var editorRef = _ref.editorRef,
|
|
28397
28615
|
question = _ref.question,
|
|
@@ -28407,45 +28625,50 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
28407
28625
|
var label = fieldWithFallback(question, "label");
|
|
28408
28626
|
var debouncedPlaceholder = reactUtils.useDebounce(fieldWithFallback(question, "placeholder"), 300);
|
|
28409
28627
|
var propsToCompare = preview ? ["debouncedPlaceholder", "error"] : ["debouncedPlaceholder"];
|
|
28410
|
-
return /*#__PURE__*/
|
|
28411
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28412
|
-
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28435
|
-
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28628
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28629
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28630
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28631
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28632
|
+
children: label && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28633
|
+
className: "neeto-form-engine-label",
|
|
28634
|
+
children: getLabel(label, isRequired)
|
|
28635
|
+
})
|
|
28636
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.FastField, {
|
|
28637
|
+
debouncedPlaceholder: debouncedPlaceholder,
|
|
28638
|
+
error: errors[name],
|
|
28639
|
+
name: name || nodeId,
|
|
28640
|
+
shouldUpdate: isPropsUnequal(propsToCompare),
|
|
28641
|
+
validate: validateFieldValue({
|
|
28642
|
+
kind: kind,
|
|
28643
|
+
label: label,
|
|
28644
|
+
isRequired: isRequired
|
|
28645
|
+
}),
|
|
28646
|
+
children: function children(_ref2) {
|
|
28647
|
+
var field = _ref2.field,
|
|
28648
|
+
form = _ref2.form,
|
|
28649
|
+
meta = _ref2.meta;
|
|
28650
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.Editor, _objectSpread$8({
|
|
28651
|
+
className: "neeto-form-engine-rich-text-input",
|
|
28652
|
+
error: meta.touched ? meta.error : "",
|
|
28653
|
+
initialValue: field.value,
|
|
28654
|
+
placeholder: debouncedPlaceholder,
|
|
28655
|
+
ref: editorRef,
|
|
28656
|
+
addons: ["attachments", "block-quote", "code-block", "image-upload"],
|
|
28657
|
+
onBlur: function onBlur() {
|
|
28658
|
+
return form.setFieldTouched(name, true);
|
|
28659
|
+
},
|
|
28660
|
+
onChange: function onChange(value) {
|
|
28661
|
+
return form.setFieldValue(name, value);
|
|
28662
|
+
}
|
|
28663
|
+
}, editorProps), debouncedPlaceholder);
|
|
28443
28664
|
}
|
|
28444
|
-
}
|
|
28445
|
-
})
|
|
28665
|
+
})]
|
|
28666
|
+
});
|
|
28446
28667
|
};
|
|
28447
28668
|
|
|
28448
28669
|
var _excluded$1 = ["value", "iconType", "label", "rating"];
|
|
28670
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28671
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28449
28672
|
var RatingButton = function RatingButton(_ref) {
|
|
28450
28673
|
var _ref$value = _ref.value,
|
|
28451
28674
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
@@ -28458,56 +28681,68 @@ var RatingButton = function RatingButton(_ref) {
|
|
|
28458
28681
|
};
|
|
28459
28682
|
var Icon = ICONS_MAP[iconType];
|
|
28460
28683
|
var selectedRating = getSelectedRating(value);
|
|
28461
|
-
return /*#__PURE__*/
|
|
28462
|
-
|
|
28463
|
-
|
|
28464
|
-
|
|
28465
|
-
|
|
28466
|
-
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
|
|
28471
|
-
|
|
28472
|
-
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28684
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
28685
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
28686
|
+
className: classnames__default["default"]({
|
|
28687
|
+
active: rating === value
|
|
28688
|
+
}),
|
|
28689
|
+
type: "button",
|
|
28690
|
+
onClick: handleClick,
|
|
28691
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
28692
|
+
size: 24,
|
|
28693
|
+
className: classnames__default["default"]("neeto-form-engine-star-rating__icon", {
|
|
28694
|
+
"neeto-form-engine-star-rating__icon--active": rating <= selectedRating
|
|
28695
|
+
})
|
|
28696
|
+
}), /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28697
|
+
className: "neeto-form-engine-label",
|
|
28698
|
+
children: label
|
|
28699
|
+
})]
|
|
28700
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$7({
|
|
28701
|
+
hidden: true,
|
|
28702
|
+
checked: ramda.equals(rating, value),
|
|
28703
|
+
type: "radio",
|
|
28704
|
+
value: rating
|
|
28705
|
+
}, otherProps))]
|
|
28706
|
+
});
|
|
28480
28707
|
};
|
|
28481
28708
|
var RatingButton$1 = /*#__PURE__*/React__default["default"].memo(RatingButton);
|
|
28482
28709
|
|
|
28483
28710
|
var _excluded = ["label", "minValue", "maxValue", "error"];
|
|
28711
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28712
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28484
28713
|
var StarRating = function StarRating(_ref) {
|
|
28485
28714
|
var label = _ref.label,
|
|
28486
28715
|
minValue = _ref.minValue,
|
|
28487
28716
|
maxValue = _ref.maxValue,
|
|
28488
28717
|
error = _ref.error,
|
|
28489
28718
|
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
28490
|
-
return /*#__PURE__*/
|
|
28491
|
-
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating"
|
|
28492
|
-
|
|
28493
|
-
|
|
28494
|
-
|
|
28495
|
-
|
|
28496
|
-
|
|
28497
|
-
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
|
|
28504
|
-
|
|
28505
|
-
|
|
28506
|
-
"
|
|
28507
|
-
|
|
28719
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28720
|
+
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating",
|
|
28721
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28722
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28723
|
+
children: /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28724
|
+
className: "neeto-form-engine-label",
|
|
28725
|
+
children: label
|
|
28726
|
+
})
|
|
28727
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28728
|
+
className: "neeto-form-engine-star-rating__row",
|
|
28729
|
+
children: generateArray(minValue, maxValue).map(function (index) {
|
|
28730
|
+
return /*#__PURE__*/jsxRuntime.jsx(RatingButton$1, _objectSpread$6({
|
|
28731
|
+
label: index,
|
|
28732
|
+
rating: index
|
|
28733
|
+
}, props), index);
|
|
28734
|
+
})
|
|
28735
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28736
|
+
className: "neeto-form-engine-input__error",
|
|
28737
|
+
"data-cy": "neeto-form-engine-star-rating-error",
|
|
28738
|
+
children: error
|
|
28739
|
+
})]
|
|
28740
|
+
});
|
|
28508
28741
|
};
|
|
28509
28742
|
var StarRating$1 = /*#__PURE__*/React__default["default"].memo(StarRating);
|
|
28510
28743
|
|
|
28744
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28745
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28511
28746
|
var StarRatingField = function StarRatingField(_ref) {
|
|
28512
28747
|
var question = _ref.question,
|
|
28513
28748
|
customValidator = _ref.customValidator;
|
|
@@ -28518,30 +28753,31 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
28518
28753
|
maxValue = question.maxValue,
|
|
28519
28754
|
iconType = question.iconType;
|
|
28520
28755
|
var label = fieldWithFallback(question, "label");
|
|
28521
|
-
return /*#__PURE__*/
|
|
28756
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28522
28757
|
name: name,
|
|
28523
28758
|
validate: validateFieldValue({
|
|
28524
28759
|
kind: kind,
|
|
28525
28760
|
label: label,
|
|
28526
28761
|
isRequired: isRequired,
|
|
28527
28762
|
customValidator: customValidator
|
|
28528
|
-
})
|
|
28529
|
-
|
|
28530
|
-
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
|
|
28534
|
-
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28538
|
-
|
|
28539
|
-
|
|
28763
|
+
}),
|
|
28764
|
+
children: function children(_ref2) {
|
|
28765
|
+
var meta = _ref2.meta,
|
|
28766
|
+
field = _ref2.field;
|
|
28767
|
+
return /*#__PURE__*/jsxRuntime.jsx(StarRating$1, _objectSpread$5({
|
|
28768
|
+
iconType: iconType,
|
|
28769
|
+
maxValue: maxValue,
|
|
28770
|
+
minValue: minValue,
|
|
28771
|
+
name: name,
|
|
28772
|
+
error: meta.touched ? meta.error : "",
|
|
28773
|
+
label: getLabel(label, isRequired)
|
|
28774
|
+
}, field));
|
|
28775
|
+
}
|
|
28540
28776
|
});
|
|
28541
28777
|
};
|
|
28542
28778
|
|
|
28543
|
-
function ownKeys$
|
|
28544
|
-
function _objectSpread$
|
|
28779
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28780
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28545
28781
|
var TermsField = function TermsField(_ref) {
|
|
28546
28782
|
var question = _ref.question,
|
|
28547
28783
|
customValidator = _ref.customValidator;
|
|
@@ -28550,32 +28786,35 @@ var TermsField = function TermsField(_ref) {
|
|
|
28550
28786
|
isRequired = question.isRequired,
|
|
28551
28787
|
nodeId = question.nodeId;
|
|
28552
28788
|
var label = fieldWithFallback(question, "label", true);
|
|
28553
|
-
return /*#__PURE__*/
|
|
28789
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28554
28790
|
name: name || nodeId,
|
|
28555
28791
|
validate: validateFieldValue({
|
|
28556
28792
|
kind: kind,
|
|
28557
28793
|
label: label,
|
|
28558
28794
|
isRequired: isRequired,
|
|
28559
28795
|
customValidator: customValidator
|
|
28560
|
-
})
|
|
28561
|
-
|
|
28562
|
-
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
|
|
28566
|
-
|
|
28567
|
-
|
|
28568
|
-
|
|
28569
|
-
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28796
|
+
}),
|
|
28797
|
+
children: function children(_ref2) {
|
|
28798
|
+
var meta = _ref2.meta,
|
|
28799
|
+
field = _ref2.field;
|
|
28800
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28801
|
+
className: "neeto-form-engine-terms",
|
|
28802
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], _objectSpread$4(_objectSpread$4({}, _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
28803
|
+
name: name
|
|
28804
|
+
})), {}, {
|
|
28805
|
+
checked: field.value,
|
|
28806
|
+
error: meta.touched ? meta.error : "",
|
|
28807
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
28808
|
+
content: label
|
|
28809
|
+
})
|
|
28810
|
+
}))
|
|
28811
|
+
});
|
|
28812
|
+
}
|
|
28574
28813
|
});
|
|
28575
28814
|
};
|
|
28576
28815
|
|
|
28577
|
-
function ownKeys$
|
|
28578
|
-
function _objectSpread$
|
|
28816
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28817
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28579
28818
|
var TextField = function TextField(_ref) {
|
|
28580
28819
|
var _otherProps$onChange;
|
|
28581
28820
|
var question = _ref.question,
|
|
@@ -28610,13 +28849,13 @@ var TextField = function TextField(_ref) {
|
|
|
28610
28849
|
setValue = _useField2$2.setValue,
|
|
28611
28850
|
setTouched = _useField2$2.setTouched;
|
|
28612
28851
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28613
|
-
return /*#__PURE__*/
|
|
28852
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({
|
|
28614
28853
|
type: type
|
|
28615
28854
|
}, field), {}, {
|
|
28616
28855
|
autoComplete: autoComplete,
|
|
28617
28856
|
label: label,
|
|
28618
28857
|
onKeyDown: onKeyDown
|
|
28619
|
-
}), {
|
|
28858
|
+
})), {}, {
|
|
28620
28859
|
error: touched ? error : "",
|
|
28621
28860
|
name: neetoCist.slugify(label),
|
|
28622
28861
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28631,18 +28870,11 @@ var TextField = function TextField(_ref) {
|
|
|
28631
28870
|
var _QUESTION_TO_COMPONEN;
|
|
28632
28871
|
var QUESTION_TO_COMPONENT_MAP = (_QUESTION_TO_COMPONEN = {}, _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.TEXT.value, TextField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.NAME.value, NameField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.EMAIL.value, EmailField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.INTEGER.value, TextField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.DECIMAL.value, TextField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.PHONE.value, PhoneNumberField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.QUESTION.value, TextField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.TEXTAREA.value, TextField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.CHECKBOX.value, OptionsField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.RADIO.value, OptionsField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.DROPDOWN.value, OptionsField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.RATING.value, RatingField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.PARAGRAPH.value, function (_ref) {
|
|
28633
28872
|
var question = _ref.question;
|
|
28634
|
-
return /*#__PURE__*/
|
|
28873
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
28635
28874
|
content: fieldWithFallback(question, "label", true)
|
|
28636
28875
|
});
|
|
28637
28876
|
}), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.TERMS.value, TermsField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.DATE.value, DateField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.STAR_RATING.value, StarRatingField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.ADDITIONAL_GUESTS.value, MultipleEmailInput), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.RICH_TEXT.value, RichTextEditor), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.CONDITION.value, ConditionField), _defineProperty$6(_QUESTION_TO_COMPONEN, QUESTION_KIND.FILE_UPLOAD.value, FileUploadField), _QUESTION_TO_COMPONEN);
|
|
28638
28877
|
|
|
28639
|
-
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
28640
|
-
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
28641
|
-
var fallback = question["".concat(fieldName, "Fallback")];
|
|
28642
|
-
var field = question[fieldName];
|
|
28643
|
-
var isFieldEmpty = hasRichContent ? neetoEditor.isEditorEmpty(field) : ramda.isEmpty(field);
|
|
28644
|
-
return isFieldEmpty && ramda.isNotNil(fallback) ? fallback : field;
|
|
28645
|
-
};
|
|
28646
28878
|
var getFieldComponent = function getFieldComponent(_ref) {
|
|
28647
28879
|
var kind = _ref.kind;
|
|
28648
28880
|
if (kind in QUESTION_TO_COMPONENT_MAP) return QUESTION_TO_COMPONENT_MAP[kind];
|
|
@@ -28696,21 +28928,24 @@ const SvgSuccess = props => /*#__PURE__*/React__namespace.createElement("svg", _
|
|
|
28696
28928
|
var Success = function Success() {
|
|
28697
28929
|
var _useTranslation = reactI18next.useTranslation(),
|
|
28698
28930
|
t = _useTranslation.t;
|
|
28699
|
-
return /*#__PURE__*/
|
|
28700
|
-
className: "flex h-full w-full flex-col items-center justify-center space-y-4"
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28931
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28932
|
+
className: "flex h-full w-full flex-col items-center justify-center space-y-4",
|
|
28933
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgSuccess, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28934
|
+
style: "h1",
|
|
28935
|
+
children: t("neetoForm.successPage.title1")
|
|
28936
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28937
|
+
style: "h1",
|
|
28938
|
+
children: t("neetoForm.successPage.title2")
|
|
28939
|
+
})]
|
|
28940
|
+
});
|
|
28706
28941
|
};
|
|
28707
28942
|
var Success$1 = /*#__PURE__*/React__default["default"].memo(Success);
|
|
28708
28943
|
|
|
28709
28944
|
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
28710
28945
|
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
28711
28946
|
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28712
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28713
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28947
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28948
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28714
28949
|
var ExternalForm = function ExternalForm(_ref) {
|
|
28715
28950
|
var _formikInnerRef$curre;
|
|
28716
28951
|
var _ref$preview = _ref.preview,
|
|
@@ -28776,6 +29011,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28776
29011
|
var formikInnerRef = React$2.useRef();
|
|
28777
29012
|
var editorRef = React$2.useRef();
|
|
28778
29013
|
var queryClient = reactQuery.useQueryClient();
|
|
29014
|
+
React$2.useEffect(function () {
|
|
29015
|
+
if (ramda.equals(language, clientI18nInstance.resolvedLanguage)) return;
|
|
29016
|
+
clientI18nInstance.changeLanguage(language);
|
|
29017
|
+
}, [language]);
|
|
28779
29018
|
var _useTranslation = reactI18next.useTranslation(),
|
|
28780
29019
|
t = _useTranslation.t;
|
|
28781
29020
|
React$2.useEffect(function () {
|
|
@@ -28879,7 +29118,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28879
29118
|
_context.next = 29;
|
|
28880
29119
|
return createSubmission({
|
|
28881
29120
|
formId: formId,
|
|
28882
|
-
values: _objectSpread({
|
|
29121
|
+
values: _objectSpread$2({
|
|
28883
29122
|
neetoFormResponse: {
|
|
28884
29123
|
responses: responses
|
|
28885
29124
|
}
|
|
@@ -28978,13 +29217,16 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28978
29217
|
questions: []
|
|
28979
29218
|
} : _useForm$data,
|
|
28980
29219
|
isLoading = _useForm.isLoading;
|
|
29220
|
+
var _queryClient$getQuery = queryClient.getQueryState([QUERY_KEYS.QUESTIONS, formId, language]),
|
|
29221
|
+
dataUpdateCount = _queryClient$getQuery.dataUpdateCount;
|
|
28981
29222
|
var keyPressRef = useHotkeys__default["default"]("command+enter", ((_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit) || neetoCist.noop, {
|
|
28982
29223
|
mode: "scoped"
|
|
28983
29224
|
});
|
|
28984
29225
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|
|
28985
|
-
return /*#__PURE__*/
|
|
28986
|
-
className: "loader flex h-full w-full items-center justify-center"
|
|
28987
|
-
|
|
29226
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29227
|
+
className: "loader flex h-full w-full items-center justify-center",
|
|
29228
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
29229
|
+
});
|
|
28988
29230
|
}
|
|
28989
29231
|
var title = form.title,
|
|
28990
29232
|
_form$questions = form.questions,
|
|
@@ -28994,96 +29236,109 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28994
29236
|
return !_destroy;
|
|
28995
29237
|
}) : questions;
|
|
28996
29238
|
if (displayThankYou && showSuccess) {
|
|
28997
|
-
return /*#__PURE__*/
|
|
28998
|
-
}
|
|
28999
|
-
return /*#__PURE__*/
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
|
|
29005
|
-
|
|
29006
|
-
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29014
|
-
|
|
29015
|
-
|
|
29016
|
-
|
|
29017
|
-
|
|
29018
|
-
|
|
29019
|
-
|
|
29020
|
-
|
|
29021
|
-
|
|
29022
|
-
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
|
|
29029
|
-
|
|
29030
|
-
|
|
29031
|
-
|
|
29032
|
-
|
|
29033
|
-
|
|
29034
|
-
|
|
29035
|
-
|
|
29036
|
-
|
|
29037
|
-
|
|
29038
|
-
|
|
29039
|
-
|
|
29040
|
-
|
|
29041
|
-
|
|
29042
|
-
|
|
29043
|
-
|
|
29044
|
-
|
|
29045
|
-
|
|
29046
|
-
|
|
29047
|
-
|
|
29048
|
-
|
|
29049
|
-
|
|
29050
|
-
|
|
29051
|
-
|
|
29052
|
-
|
|
29053
|
-
|
|
29054
|
-
|
|
29055
|
-
|
|
29056
|
-
|
|
29057
|
-
|
|
29058
|
-
|
|
29059
|
-
|
|
29060
|
-
|
|
29061
|
-
|
|
29062
|
-
|
|
29063
|
-
|
|
29064
|
-
|
|
29065
|
-
|
|
29066
|
-
|
|
29067
|
-
|
|
29068
|
-
|
|
29069
|
-
|
|
29070
|
-
|
|
29071
|
-
|
|
29072
|
-
|
|
29073
|
-
|
|
29074
|
-
|
|
29075
|
-
|
|
29076
|
-
|
|
29077
|
-
|
|
29078
|
-
|
|
29079
|
-
|
|
29080
|
-
|
|
29081
|
-
|
|
29082
|
-
|
|
29083
|
-
|
|
29239
|
+
return /*#__PURE__*/jsxRuntime.jsx(Success$1, {});
|
|
29240
|
+
}
|
|
29241
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactI18next.I18nextProvider, {
|
|
29242
|
+
i18n: clientI18nInstance,
|
|
29243
|
+
children: [showTitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29244
|
+
className: "py-6 text-center",
|
|
29245
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$2(_objectSpread$2({
|
|
29246
|
+
className: "neeto-ui-text-gray-800",
|
|
29247
|
+
style: "h4",
|
|
29248
|
+
weight: "semibold"
|
|
29249
|
+
}, titleProps), {}, {
|
|
29250
|
+
children: formTitle || title
|
|
29251
|
+
}))
|
|
29252
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.Formik, {
|
|
29253
|
+
onSubmit: onSubmit,
|
|
29254
|
+
enableReinitialize: true,
|
|
29255
|
+
innerRef: formikInnerRef,
|
|
29256
|
+
initialValues: generateInitValues({
|
|
29257
|
+
questions: questions,
|
|
29258
|
+
initialValues: submission === null || submission === void 0 ? void 0 : submission.responses,
|
|
29259
|
+
localValues: preserveValues ? localValues : initialValues,
|
|
29260
|
+
fieldCodes: enablePreFilling ? utils.getQueryParams({
|
|
29261
|
+
toCamelCase: false
|
|
29262
|
+
}) : {}
|
|
29263
|
+
}),
|
|
29264
|
+
children: function children(_ref5) {
|
|
29265
|
+
var isSubmitting = _ref5.isSubmitting,
|
|
29266
|
+
errors = _ref5.errors,
|
|
29267
|
+
setFieldError = _ref5.setFieldError,
|
|
29268
|
+
handleReset = _ref5.handleReset;
|
|
29269
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FormikWrap, {
|
|
29270
|
+
dataUpdateCount: dataUpdateCount,
|
|
29271
|
+
formId: formId,
|
|
29272
|
+
preserveValues: preserveValues,
|
|
29273
|
+
onError: handleScrollToError,
|
|
29274
|
+
onValuesChange: onChange,
|
|
29275
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(formik.Form, _objectSpread$2(_objectSpread$2({
|
|
29276
|
+
noValidate: true,
|
|
29277
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
29278
|
+
className: classnames__default["default"]("neeto-form-engine-form relative space-y-4", _defineProperty$6({}, className, className)),
|
|
29279
|
+
onChange: function onChange(event) {
|
|
29280
|
+
if (ramda.isEmpty(errors)) return;
|
|
29281
|
+
setFieldError(event.target.name, "");
|
|
29282
|
+
}
|
|
29283
|
+
}, formDomProps), {}, {
|
|
29284
|
+
onReset: function onReset(e) {
|
|
29285
|
+
return _onReset(e, handleReset);
|
|
29286
|
+
},
|
|
29287
|
+
children: [(submission === null || submission === void 0 ? void 0 : submission.isLoading) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29288
|
+
className: "neeto-ui-bg-gray-100 absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center opacity-75",
|
|
29289
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner__default["default"], {})
|
|
29290
|
+
}), renderedQuestions.map(function (question) {
|
|
29291
|
+
var _question$id;
|
|
29292
|
+
var FieldComponent = getFieldComponent(question);
|
|
29293
|
+
return /*#__PURE__*/React$2.createElement(FieldComponent, {
|
|
29294
|
+
editorProps: editorProps,
|
|
29295
|
+
editorRef: editorRef,
|
|
29296
|
+
preview: preview,
|
|
29297
|
+
question: question,
|
|
29298
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
29299
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
29300
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
29301
|
+
});
|
|
29302
|
+
}), showEmptyState && ramda.isEmpty(renderedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
29303
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
29304
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgNoQuestions, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
29305
|
+
style: "h3",
|
|
29306
|
+
weight: "semibold",
|
|
29307
|
+
children: t("neetoForm.questions.common.notFound")
|
|
29308
|
+
})]
|
|
29309
|
+
}), footer, !ramda.isEmpty(renderedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
29310
|
+
className: "mt-8 flex items-center justify-between",
|
|
29311
|
+
children: [cancelButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29312
|
+
label: t("neetoForm.common.cancel"),
|
|
29313
|
+
style: "secondary"
|
|
29314
|
+
}, cancelButtonProps)), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29315
|
+
className: "flex gap-x-2",
|
|
29316
|
+
children: renderButtonsInOrder([/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29317
|
+
disabled: isSubmitting || isSubmitted,
|
|
29318
|
+
label: t("neetoForm.common.submit"),
|
|
29319
|
+
loading: isSubmitting,
|
|
29320
|
+
type: "submit"
|
|
29321
|
+
}, submitButtonProps), "submit"), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29322
|
+
label: t("neetoForm.common.reset"),
|
|
29323
|
+
style: "secondary",
|
|
29324
|
+
type: "reset"
|
|
29325
|
+
}, resetButtonProps), "reset")], neetoCist.isPresent(cancelButtonProps))
|
|
29326
|
+
})]
|
|
29327
|
+
})]
|
|
29328
|
+
})), !customSubmitHandler && /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
29329
|
+
callout: {
|
|
29330
|
+
isVisible: neetoCist.isPresent(error),
|
|
29331
|
+
title: t("neetoForm.callouts.submitError"),
|
|
29332
|
+
message: error
|
|
29333
|
+
},
|
|
29334
|
+
onClose: function onClose() {
|
|
29335
|
+
return setError(null);
|
|
29336
|
+
}
|
|
29337
|
+
})]
|
|
29338
|
+
});
|
|
29084
29339
|
}
|
|
29085
|
-
})
|
|
29086
|
-
})
|
|
29340
|
+
})]
|
|
29341
|
+
});
|
|
29087
29342
|
};
|
|
29088
29343
|
|
|
29089
29344
|
var dist = {};
|
|
@@ -31611,13 +31866,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31611
31866
|
var _default = dist.default = _Linkify2.default;
|
|
31612
31867
|
|
|
31613
31868
|
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
31614
|
-
return /*#__PURE__*/
|
|
31869
|
+
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
31615
31870
|
className: "neeto-ui-text-primary-500 hover:underline",
|
|
31616
31871
|
href: decoratedHref,
|
|
31617
|
-
key: key,
|
|
31618
31872
|
rel: "noreferrer",
|
|
31619
|
-
target: "_blank"
|
|
31620
|
-
|
|
31873
|
+
target: "_blank",
|
|
31874
|
+
children: decoratedText
|
|
31875
|
+
}, key);
|
|
31621
31876
|
};
|
|
31622
31877
|
var filterResponses = neetoCist.removeBy({
|
|
31623
31878
|
kind: QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
@@ -31626,27 +31881,33 @@ var filterResponses = neetoCist.removeBy({
|
|
|
31626
31881
|
|
|
31627
31882
|
var FileUpload = function FileUpload(_ref) {
|
|
31628
31883
|
var files = _ref.files;
|
|
31629
|
-
return /*#__PURE__*/
|
|
31630
|
-
className: "space-y-2"
|
|
31631
|
-
|
|
31632
|
-
|
|
31633
|
-
|
|
31634
|
-
|
|
31635
|
-
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
|
|
31639
|
-
|
|
31640
|
-
|
|
31641
|
-
|
|
31642
|
-
|
|
31643
|
-
|
|
31884
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31885
|
+
className: "space-y-2",
|
|
31886
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (_ref2, index) {
|
|
31887
|
+
var url = _ref2.url,
|
|
31888
|
+
name = _ref2.name;
|
|
31889
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
31890
|
+
className: "break-all",
|
|
31891
|
+
style: "body2",
|
|
31892
|
+
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
31893
|
+
componentDecorator: function componentDecorator() {
|
|
31894
|
+
return linkifyDecorator(url, name, index);
|
|
31895
|
+
},
|
|
31896
|
+
children: url
|
|
31897
|
+
})
|
|
31898
|
+
}, index);
|
|
31899
|
+
})
|
|
31900
|
+
});
|
|
31644
31901
|
};
|
|
31645
31902
|
|
|
31903
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31904
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31646
31905
|
var getValue = function getValue(_ref) {
|
|
31647
31906
|
var value = _ref.value,
|
|
31648
31907
|
kind = _ref.kind;
|
|
31649
|
-
if (ramda.isEmpty(value)) return /*#__PURE__*/
|
|
31908
|
+
if (ramda.isEmpty(value)) return /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
31909
|
+
children: i18next.t("neetoForm.common.unanswered")
|
|
31910
|
+
});
|
|
31650
31911
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31651
31912
|
return value && utils.dateFormat.date(value);
|
|
31652
31913
|
}
|
|
@@ -31690,51 +31951,58 @@ var Submission = function Submission(_ref2) {
|
|
|
31690
31951
|
var renderSubmittedValue = function renderSubmittedValue(kind, value) {
|
|
31691
31952
|
switch (kind) {
|
|
31692
31953
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
31693
|
-
return /*#__PURE__*/
|
|
31954
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
31694
31955
|
content: getEditorContent(getValue({
|
|
31695
31956
|
value: value,
|
|
31696
31957
|
kind: kind
|
|
31697
31958
|
}))
|
|
31698
31959
|
});
|
|
31699
31960
|
case QUESTION_KIND.PHONE.value:
|
|
31700
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31961
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumber, {
|
|
31701
31962
|
value: value,
|
|
31702
31963
|
showEmoji: true
|
|
31703
31964
|
}) : "-";
|
|
31704
31965
|
case QUESTION_KIND.FILE_UPLOAD.value:
|
|
31705
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31966
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(FileUpload, {
|
|
31706
31967
|
files: value
|
|
31707
31968
|
}) : "-";
|
|
31708
31969
|
default:
|
|
31709
|
-
return /*#__PURE__*/
|
|
31970
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$1(_objectSpread$1({
|
|
31710
31971
|
weight: "semibold"
|
|
31711
|
-
}, answerProps),
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31972
|
+
}, answerProps), {}, {
|
|
31973
|
+
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
31974
|
+
componentDecorator: linkifyDecorator,
|
|
31975
|
+
children: getValue({
|
|
31976
|
+
value: value,
|
|
31977
|
+
kind: kind
|
|
31978
|
+
})
|
|
31979
|
+
})
|
|
31980
|
+
}));
|
|
31717
31981
|
}
|
|
31718
31982
|
};
|
|
31719
31983
|
if (isLoading) {
|
|
31720
|
-
return /*#__PURE__*/
|
|
31721
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
|
|
31725
|
-
|
|
31726
|
-
|
|
31727
|
-
|
|
31728
|
-
|
|
31729
|
-
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31984
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31985
|
+
className: "flex h-full w-full items-center justify-center",
|
|
31986
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
31987
|
+
});
|
|
31988
|
+
}
|
|
31989
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31990
|
+
className: classnames__default["default"]("mx-auto flex h-full w-full flex-col items-start", _defineProperty$6({}, className, className)),
|
|
31991
|
+
children: filteredResponses.map(function (_ref3) {
|
|
31992
|
+
var kind = _ref3.kind,
|
|
31993
|
+
label = _ref3.label,
|
|
31994
|
+
value = _ref3.value;
|
|
31995
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31996
|
+
className: "mb-4",
|
|
31997
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$1(_objectSpread$1({
|
|
31998
|
+
style: "h5",
|
|
31999
|
+
weight: "light"
|
|
32000
|
+
}, questionLabelProps), {}, {
|
|
32001
|
+
children: label
|
|
32002
|
+
})), renderSubmittedValue(kind, value)]
|
|
32003
|
+
}, label);
|
|
32004
|
+
})
|
|
32005
|
+
});
|
|
31738
32006
|
};
|
|
31739
32007
|
|
|
31740
32008
|
var getPreFillableQuestions = function getPreFillableQuestions(questions) {
|
|
@@ -31798,6 +32066,8 @@ var buildQueryParameters = function buildQueryParameters(responses, questions) {
|
|
|
31798
32066
|
return queryParameters;
|
|
31799
32067
|
};
|
|
31800
32068
|
|
|
32069
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32070
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31801
32071
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
31802
32072
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31803
32073
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -31882,81 +32152,94 @@ var UrlBuilder = function UrlBuilder(_ref) {
|
|
|
31882
32152
|
mode: "scoped"
|
|
31883
32153
|
});
|
|
31884
32154
|
if (isLoading || form.isQuestionsLoading) {
|
|
31885
|
-
return /*#__PURE__*/
|
|
31886
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31887
|
-
|
|
32155
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32156
|
+
className: "flex h-full w-full items-center justify-center",
|
|
32157
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
32158
|
+
});
|
|
31888
32159
|
}
|
|
31889
32160
|
var title = form.title,
|
|
31890
32161
|
questions = form.questions;
|
|
31891
32162
|
var modifiedQuestions = getPreFillableQuestions(questions);
|
|
31892
|
-
return /*#__PURE__*/
|
|
31893
|
-
|
|
31894
|
-
|
|
31895
|
-
|
|
31896
|
-
|
|
31897
|
-
|
|
31898
|
-
|
|
31899
|
-
|
|
31900
|
-
|
|
31901
|
-
|
|
31902
|
-
|
|
31903
|
-
|
|
31904
|
-
|
|
31905
|
-
|
|
31906
|
-
|
|
31907
|
-
|
|
31908
|
-
|
|
31909
|
-
|
|
31910
|
-
|
|
31911
|
-
|
|
31912
|
-
|
|
31913
|
-
|
|
31914
|
-
|
|
31915
|
-
|
|
31916
|
-
|
|
31917
|
-
|
|
31918
|
-
|
|
31919
|
-
|
|
31920
|
-
|
|
31921
|
-
|
|
31922
|
-
|
|
31923
|
-
|
|
31924
|
-
|
|
31925
|
-
|
|
32163
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
32164
|
+
children: [showTitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32165
|
+
className: "py-6 text-center",
|
|
32166
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread(_objectSpread({
|
|
32167
|
+
className: "neeto-ui-text-gray-800",
|
|
32168
|
+
style: "h4",
|
|
32169
|
+
weight: "semibold"
|
|
32170
|
+
}, titleProps), {}, {
|
|
32171
|
+
children: formTitle || title
|
|
32172
|
+
}))
|
|
32173
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.Formik, {
|
|
32174
|
+
onSubmit: onSubmit,
|
|
32175
|
+
enableReinitialize: true,
|
|
32176
|
+
initialValues: generateInitValues({
|
|
32177
|
+
questions: modifiedQuestions
|
|
32178
|
+
}),
|
|
32179
|
+
innerRef: formikInnerRef,
|
|
32180
|
+
children: function children(_ref3) {
|
|
32181
|
+
var isSubmitting = _ref3.isSubmitting,
|
|
32182
|
+
errors = _ref3.errors,
|
|
32183
|
+
setFieldError = _ref3.setFieldError,
|
|
32184
|
+
handleReset = _ref3.handleReset;
|
|
32185
|
+
return /*#__PURE__*/jsxRuntime.jsx(FormikWrap, {
|
|
32186
|
+
formId: formId,
|
|
32187
|
+
preserveValues: false,
|
|
32188
|
+
onError: handleScrollToError,
|
|
32189
|
+
onValuesChange: onChange,
|
|
32190
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(formik.Form, _objectSpread(_objectSpread({
|
|
32191
|
+
noValidate: true,
|
|
32192
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
32193
|
+
className: classnames__default["default"]("neeto-form-engine-form relative space-y-4", className),
|
|
32194
|
+
onChange: function onChange(event) {
|
|
32195
|
+
if (ramda.isEmpty(errors)) return;
|
|
32196
|
+
setFieldError(event.target.name, "");
|
|
32197
|
+
}
|
|
32198
|
+
}, formDomProps), {}, {
|
|
32199
|
+
onReset: function onReset(e) {
|
|
32200
|
+
return _onReset(e, handleReset);
|
|
32201
|
+
},
|
|
32202
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32203
|
+
className: "neeto-form-engine-questions-wrapper space-y-4 overflow-auto pr-4",
|
|
32204
|
+
children: [modifiedQuestions.map(function (question) {
|
|
32205
|
+
var _question$id;
|
|
32206
|
+
var FieldComponent = getFieldComponent(question);
|
|
32207
|
+
return /*#__PURE__*/React$2.createElement(FieldComponent, {
|
|
32208
|
+
editorProps: editorProps,
|
|
32209
|
+
editorRef: editorRef,
|
|
32210
|
+
question: question,
|
|
32211
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
32212
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
32213
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
32214
|
+
});
|
|
32215
|
+
}), showEmptyState && ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32216
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
32217
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgNoQuestions, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
32218
|
+
style: "h3",
|
|
32219
|
+
weight: "semibold",
|
|
32220
|
+
children: t("neetoForm.questions.common.notFound")
|
|
32221
|
+
})]
|
|
32222
|
+
})]
|
|
32223
|
+
}), !ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32224
|
+
className: "mt-8 flex items-center justify-start gap-x-2",
|
|
32225
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32226
|
+
disabled: isSubmitting,
|
|
32227
|
+
label: t("neetoForm.common.generateLink"),
|
|
32228
|
+
loading: isSubmitting,
|
|
32229
|
+
type: "submit"
|
|
32230
|
+
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32231
|
+
label: t("neetoForm.common.reset"),
|
|
32232
|
+
style: "secondary",
|
|
32233
|
+
type: "reset"
|
|
32234
|
+
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32235
|
+
label: t("neetoForm.common.cancel")
|
|
32236
|
+
}, cancelButtonProps))]
|
|
32237
|
+
})]
|
|
32238
|
+
}))
|
|
32239
|
+
});
|
|
31926
32240
|
}
|
|
31927
|
-
})
|
|
31928
|
-
|
|
31929
|
-
}, modifiedQuestions.map(function (question) {
|
|
31930
|
-
var _question$id;
|
|
31931
|
-
var FieldComponent = getFieldComponent(question);
|
|
31932
|
-
return /*#__PURE__*/React__default["default"].createElement(FieldComponent, {
|
|
31933
|
-
editorProps: editorProps,
|
|
31934
|
-
editorRef: editorRef,
|
|
31935
|
-
question: question,
|
|
31936
|
-
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
31937
|
-
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
31938
|
-
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
31939
|
-
});
|
|
31940
|
-
}), showEmptyState && ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31941
|
-
className: "flex flex-col items-center justify-center gap-y-4 py-8"
|
|
31942
|
-
}, /*#__PURE__*/React__default["default"].createElement(SvgNoQuestions, null), /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
|
|
31943
|
-
style: "h3",
|
|
31944
|
-
weight: "semibold"
|
|
31945
|
-
}, t("neetoForm.questions.common.notFound")))), !ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31946
|
-
className: "mt-8 flex items-center justify-start gap-x-2"
|
|
31947
|
-
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31948
|
-
disabled: isSubmitting,
|
|
31949
|
-
label: t("neetoForm.common.generateLink"),
|
|
31950
|
-
loading: isSubmitting,
|
|
31951
|
-
type: "submit"
|
|
31952
|
-
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31953
|
-
label: t("neetoForm.common.reset"),
|
|
31954
|
-
style: "secondary",
|
|
31955
|
-
type: "reset"
|
|
31956
|
-
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31957
|
-
label: t("neetoForm.common.cancel")
|
|
31958
|
-
}, cancelButtonProps)))));
|
|
31959
|
-
}));
|
|
32241
|
+
})]
|
|
32242
|
+
});
|
|
31960
32243
|
};
|
|
31961
32244
|
|
|
31962
32245
|
var useFormSubmission = function useFormSubmission(_ref) {
|