@bigbinary/neeto-form-frontend 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1700 -1442
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1703 -1445
- 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
|
}
|
|
@@ -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
12191
|
},
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
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,29 +14342,36 @@ 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
|
|
|
14230
14377
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
@@ -15922,9 +16069,9 @@ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o
|
|
|
15922
16069
|
|
|
15923
16070
|
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
16071
|
|
|
15925
|
-
function ownKeys$
|
|
16072
|
+
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
16073
|
|
|
15927
|
-
function _objectSpread$
|
|
16074
|
+
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
16075
|
|
|
15929
16076
|
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
16077
|
var DEFAULT_OPTIONS = {
|
|
@@ -15951,7 +16098,7 @@ var DEFAULT_OPTIONS = {
|
|
|
15951
16098
|
function formatNumber(input, format, options, metadata) {
|
|
15952
16099
|
// Apply default options.
|
|
15953
16100
|
if (options) {
|
|
15954
|
-
options = _objectSpread$
|
|
16101
|
+
options = _objectSpread$o(_objectSpread$o({}, DEFAULT_OPTIONS), options);
|
|
15955
16102
|
} else {
|
|
15956
16103
|
options = DEFAULT_OPTIONS;
|
|
15957
16104
|
}
|
|
@@ -16096,9 +16243,9 @@ function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry,
|
|
|
16096
16243
|
}
|
|
16097
16244
|
}
|
|
16098
16245
|
|
|
16099
|
-
function ownKeys$
|
|
16246
|
+
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
16247
|
|
|
16101
|
-
function _objectSpread$
|
|
16248
|
+
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
16249
|
|
|
16103
16250
|
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
16251
|
|
|
@@ -16210,7 +16357,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
16210
16357
|
}, {
|
|
16211
16358
|
key: "format",
|
|
16212
16359
|
value: function format(_format, options) {
|
|
16213
|
-
return formatNumber(this, _format, options ? _objectSpread$
|
|
16360
|
+
return formatNumber(this, _format, options ? _objectSpread$n(_objectSpread$n({}, options), {}, {
|
|
16214
16361
|
v2: true
|
|
16215
16362
|
}) : {
|
|
16216
16363
|
v2: true
|
|
@@ -17253,20 +17400,20 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
17253
17400
|
};
|
|
17254
17401
|
}
|
|
17255
17402
|
|
|
17256
|
-
function ownKeys$
|
|
17403
|
+
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
17404
|
|
|
17258
|
-
function _objectSpread$
|
|
17405
|
+
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
17406
|
|
|
17260
17407
|
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
17408
|
function parsePhoneNumberWithError$2(text, options, metadata) {
|
|
17262
|
-
return parse$1(text, _objectSpread$
|
|
17409
|
+
return parse$1(text, _objectSpread$m(_objectSpread$m({}, options), {}, {
|
|
17263
17410
|
v2: true
|
|
17264
17411
|
}), metadata);
|
|
17265
17412
|
}
|
|
17266
17413
|
|
|
17267
|
-
function ownKeys$
|
|
17414
|
+
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
17415
|
|
|
17269
|
-
function _objectSpread$
|
|
17416
|
+
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
17417
|
|
|
17271
17418
|
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
17419
|
|
|
@@ -17314,7 +17461,7 @@ function normalizeArguments(args) {
|
|
|
17314
17461
|
}
|
|
17315
17462
|
|
|
17316
17463
|
if (arg_2) {
|
|
17317
|
-
options = _objectSpread$
|
|
17464
|
+
options = _objectSpread$l({
|
|
17318
17465
|
defaultCountry: arg_2
|
|
17319
17466
|
}, options);
|
|
17320
17467
|
}
|
|
@@ -17375,8 +17522,8 @@ var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
|
17375
17522
|
|
|
17376
17523
|
var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
17377
17524
|
var _fieldKindValidatorMa;
|
|
17378
|
-
function ownKeys$
|
|
17379
|
-
function _objectSpread$
|
|
17525
|
+
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; }
|
|
17526
|
+
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; }
|
|
17380
17527
|
yup__namespace.addMethod(yup__namespace.array, "unique", function () {
|
|
17381
17528
|
var field, message;
|
|
17382
17529
|
if (arguments.length > 1) {
|
|
@@ -17525,7 +17672,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17525
17672
|
return function (value) {
|
|
17526
17673
|
if (!(kind in fieldKindValidatorMap)) return;
|
|
17527
17674
|
var validator = fieldKindValidatorMap[kind];
|
|
17528
|
-
var schema = customValidator || validator(_objectSpread$
|
|
17675
|
+
var schema = customValidator || validator(_objectSpread$k({
|
|
17529
17676
|
kind: kind,
|
|
17530
17677
|
label: label,
|
|
17531
17678
|
isRequired: isRequired
|
|
@@ -17562,7 +17709,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17562
17709
|
};
|
|
17563
17710
|
|
|
17564
17711
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
17565
|
-
var
|
|
17712
|
+
var _jsx2;
|
|
17566
17713
|
var question = _ref.question,
|
|
17567
17714
|
customValidator = _ref.customValidator;
|
|
17568
17715
|
var name = question.id,
|
|
@@ -17591,31 +17738,33 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
17591
17738
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
17592
17739
|
isInputVisible = _useState2[0],
|
|
17593
17740
|
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
|
-
|
|
17741
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
17742
|
+
className: "neeto-form-engine-input__wrapper",
|
|
17743
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
17744
|
+
className: "neeto-ui-w-full",
|
|
17745
|
+
children: isInputVisible ? /*#__PURE__*/jsxRuntime.jsx(NeetoUIMultiEmailInput__default["default"], {
|
|
17746
|
+
isRequired: isRequired,
|
|
17747
|
+
label: label,
|
|
17748
|
+
error: meta.touched ? meta.error : "",
|
|
17749
|
+
helpText: t("neetoForm.common.addGuestsHelper"),
|
|
17750
|
+
name: field.name,
|
|
17751
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
17752
|
+
value: field.value,
|
|
17753
|
+
onBlur: function onBlur() {
|
|
17754
|
+
return setTouched(true);
|
|
17755
|
+
},
|
|
17756
|
+
onChange: setValue
|
|
17757
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], (_jsx2 = {
|
|
17758
|
+
label: label
|
|
17759
|
+
}, _defineProperty$6(_jsx2, "label", t("neetoForm.common.addGuests")), _defineProperty$6(_jsx2, "style", "secondary"), _defineProperty$6(_jsx2, "onClick", function onClick() {
|
|
17760
|
+
return setIsInputVisible(true);
|
|
17761
|
+
}), _jsx2))
|
|
17762
|
+
})
|
|
17763
|
+
});
|
|
17615
17764
|
};
|
|
17616
17765
|
|
|
17617
|
-
function ownKeys$
|
|
17618
|
-
function _objectSpread$
|
|
17766
|
+
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; }
|
|
17767
|
+
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
17768
|
var ConditionField = function ConditionField(_ref) {
|
|
17620
17769
|
var question = _ref.question,
|
|
17621
17770
|
customValidator = _ref.customValidator;
|
|
@@ -17624,30 +17773,31 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17624
17773
|
isRequired = question.isRequired,
|
|
17625
17774
|
nodeId = question.nodeId;
|
|
17626
17775
|
var label = fieldWithFallback(question, "label");
|
|
17627
|
-
return /*#__PURE__*/
|
|
17776
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
17628
17777
|
name: name || nodeId,
|
|
17629
17778
|
validate: validateFieldValue({
|
|
17630
17779
|
kind: kind,
|
|
17631
17780
|
label: label,
|
|
17632
17781
|
isRequired: isRequired,
|
|
17633
17782
|
customValidator: customValidator
|
|
17634
|
-
})
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17783
|
+
}),
|
|
17784
|
+
children: function children(_ref2) {
|
|
17785
|
+
var meta = _ref2.meta,
|
|
17786
|
+
field = _ref2.field;
|
|
17787
|
+
return /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], _objectSpread$j(_objectSpread$j({}, _objectSpread$j(_objectSpread$j({}, field), {}, {
|
|
17788
|
+
label: label,
|
|
17789
|
+
name: name
|
|
17790
|
+
})), {}, {
|
|
17791
|
+
checked: field.value,
|
|
17792
|
+
error: meta.touched ? meta.error : "",
|
|
17793
|
+
required: isRequired
|
|
17794
|
+
}));
|
|
17795
|
+
}
|
|
17646
17796
|
});
|
|
17647
17797
|
};
|
|
17648
17798
|
|
|
17649
|
-
function ownKeys$
|
|
17650
|
-
function _objectSpread$
|
|
17799
|
+
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; }
|
|
17800
|
+
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; }
|
|
17651
17801
|
var toEmailValues = function toEmailValues() {
|
|
17652
17802
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17653
17803
|
return values.map(function (value) {
|
|
@@ -17740,7 +17890,7 @@ var generateInitValues = function generateInitValues(_ref7) {
|
|
|
17740
17890
|
var valuesMap = {};
|
|
17741
17891
|
if (initialValues) {
|
|
17742
17892
|
valuesMap = initialValues.reduce(function (acc, answer) {
|
|
17743
|
-
return _objectSpread$
|
|
17893
|
+
return _objectSpread$i(_objectSpread$i({}, acc), {}, _defineProperty$6({}, answer.questionId, {
|
|
17744
17894
|
value: answer.value,
|
|
17745
17895
|
optionIds: answer.optionIds
|
|
17746
17896
|
}));
|
|
@@ -17972,8 +18122,8 @@ var getSelectedRating = function getSelectedRating(value) {
|
|
|
17972
18122
|
};
|
|
17973
18123
|
|
|
17974
18124
|
var _excluded$3 = ["value"];
|
|
17975
|
-
function ownKeys$
|
|
17976
|
-
function _objectSpread$
|
|
18125
|
+
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; }
|
|
18126
|
+
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
18127
|
dayjs__default["default"].extend(weekOfYear__default["default"]);
|
|
17978
18128
|
dayjs__default["default"].extend(weekday__default["default"]);
|
|
17979
18129
|
dayjs__default["default"].extend(localeData__default["default"]);
|
|
@@ -17988,47 +18138,52 @@ var DateField = function DateField(_ref) {
|
|
|
17988
18138
|
var label = fieldWithFallback(question, "label");
|
|
17989
18139
|
var _QUESTION_KIND$kind$t = QUESTION_KIND[kind.toUpperCase()].type,
|
|
17990
18140
|
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
|
-
|
|
18141
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
18142
|
+
className: "neeto-form-engine-input__wrapper",
|
|
18143
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18144
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
18145
|
+
children: label && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
18146
|
+
className: "neeto-form-engine-label",
|
|
18147
|
+
children: getLabel(label, isRequired)
|
|
18148
|
+
})
|
|
18149
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18150
|
+
className: "neeto-form-engine-date-picker",
|
|
18151
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
18152
|
+
name: name || nodeId,
|
|
18153
|
+
validate: validateFieldValue({
|
|
18154
|
+
kind: kind,
|
|
18155
|
+
label: label,
|
|
18156
|
+
isRequired: isRequired,
|
|
18157
|
+
customValidator: customValidator
|
|
18158
|
+
}),
|
|
18159
|
+
children: function children(_ref2) {
|
|
18160
|
+
var meta = _ref2.meta,
|
|
18161
|
+
_ref2$field = _ref2.field,
|
|
18162
|
+
value = _ref2$field.value,
|
|
18163
|
+
field = _objectWithoutProperties$1(_ref2$field, _excluded$3),
|
|
18164
|
+
form = _ref2.form;
|
|
18165
|
+
return /*#__PURE__*/jsxRuntime.jsx(DatePicker__default["default"], _objectSpread$h(_objectSpread$h({}, _objectSpread$h(_objectSpread$h({}, field), {}, {
|
|
18166
|
+
type: type
|
|
18167
|
+
})), {}, {
|
|
18168
|
+
dateFormat: "MMM D, YYYY",
|
|
18169
|
+
error: meta.touched ? meta.error : "",
|
|
18170
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
18171
|
+
popupClassName: "neeto-form-engine-date-picker-popup",
|
|
18172
|
+
required: isRequired,
|
|
18173
|
+
size: "small",
|
|
18174
|
+
value: getValidDate(value),
|
|
18175
|
+
onChange: function onChange(date) {
|
|
18176
|
+
form.setFieldValue(name, date ? date.toISOString() : "");
|
|
18177
|
+
}
|
|
18178
|
+
}));
|
|
18179
|
+
}
|
|
18180
|
+
})
|
|
18181
|
+
})]
|
|
18182
|
+
});
|
|
18028
18183
|
};
|
|
18029
18184
|
|
|
18030
|
-
function ownKeys$
|
|
18031
|
-
function _objectSpread$
|
|
18185
|
+
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; }
|
|
18186
|
+
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
18187
|
var EmailField = function EmailField(_ref) {
|
|
18033
18188
|
var question = _ref.question,
|
|
18034
18189
|
customValidator = _ref.customValidator,
|
|
@@ -18057,12 +18212,12 @@ var EmailField = function EmailField(_ref) {
|
|
|
18057
18212
|
setValue = _useField2$2.setValue,
|
|
18058
18213
|
setTouched = _useField2$2.setTouched;
|
|
18059
18214
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
18060
|
-
return /*#__PURE__*/
|
|
18215
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$g(_objectSpread$g({}, _objectSpread$g(_objectSpread$g({
|
|
18061
18216
|
type: type
|
|
18062
18217
|
}, field), {}, {
|
|
18063
18218
|
autoComplete: autoComplete,
|
|
18064
18219
|
label: label
|
|
18065
|
-
}), {
|
|
18220
|
+
})), {}, {
|
|
18066
18221
|
error: touched ? error : "",
|
|
18067
18222
|
name: kind,
|
|
18068
18223
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -19564,9 +19719,9 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
19564
19719
|
|
|
19565
19720
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19566
19721
|
|
|
19567
|
-
function ownKeys$
|
|
19722
|
+
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
19723
|
|
|
19569
|
-
function _objectSpread$
|
|
19724
|
+
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
19725
|
|
|
19571
19726
|
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
19727
|
|
|
@@ -19602,7 +19757,7 @@ var Dropzone = /*#__PURE__*/React$2.forwardRef(function (_ref, ref) {
|
|
|
19602
19757
|
};
|
|
19603
19758
|
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
19604
19759
|
|
|
19605
|
-
return /*#__PURE__*/React__default["default"].createElement(React$2.Fragment, null, children(_objectSpread$
|
|
19760
|
+
return /*#__PURE__*/React__default["default"].createElement(React$2.Fragment, null, children(_objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
19606
19761
|
open: open
|
|
19607
19762
|
})));
|
|
19608
19763
|
});
|
|
@@ -19936,7 +20091,7 @@ var initialState = {
|
|
|
19936
20091
|
function useDropzone() {
|
|
19937
20092
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19938
20093
|
|
|
19939
|
-
var _defaultProps$options = _objectSpread$
|
|
20094
|
+
var _defaultProps$options = _objectSpread$f(_objectSpread$f({}, defaultProps), options),
|
|
19940
20095
|
accept = _defaultProps$options.accept,
|
|
19941
20096
|
disabled = _defaultProps$options.disabled,
|
|
19942
20097
|
getFilesFromEvent = _defaultProps$options.getFilesFromEvent,
|
|
@@ -20253,7 +20408,7 @@ function useDropzone() {
|
|
|
20253
20408
|
onDrop = _ref2.onDrop,
|
|
20254
20409
|
rest = _objectWithoutProperties(_ref2, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
|
|
20255
20410
|
|
|
20256
|
-
return _objectSpread$
|
|
20411
|
+
return _objectSpread$f(_objectSpread$f(_defineProperty({
|
|
20257
20412
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
20258
20413
|
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
20259
20414
|
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
@@ -20292,7 +20447,7 @@ function useDropzone() {
|
|
|
20292
20447
|
tabIndex: -1
|
|
20293
20448
|
}, refKey, inputRef);
|
|
20294
20449
|
|
|
20295
|
-
return _objectSpread$
|
|
20450
|
+
return _objectSpread$f(_objectSpread$f({}, inputProps), rest);
|
|
20296
20451
|
};
|
|
20297
20452
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
20298
20453
|
var fileCount = draggedFiles.length;
|
|
@@ -20305,7 +20460,7 @@ function useDropzone() {
|
|
|
20305
20460
|
maxFiles: maxFiles
|
|
20306
20461
|
});
|
|
20307
20462
|
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
20308
|
-
return _objectSpread$
|
|
20463
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20309
20464
|
isDragAccept: isDragAccept,
|
|
20310
20465
|
isDragReject: isDragReject,
|
|
20311
20466
|
isFocused: isFocused && !disabled,
|
|
@@ -20321,22 +20476,22 @@ function reducer(state, action) {
|
|
|
20321
20476
|
/* istanbul ignore next */
|
|
20322
20477
|
switch (action.type) {
|
|
20323
20478
|
case 'focus':
|
|
20324
|
-
return _objectSpread$
|
|
20479
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20325
20480
|
isFocused: true
|
|
20326
20481
|
});
|
|
20327
20482
|
|
|
20328
20483
|
case 'blur':
|
|
20329
|
-
return _objectSpread$
|
|
20484
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20330
20485
|
isFocused: false
|
|
20331
20486
|
});
|
|
20332
20487
|
|
|
20333
20488
|
case 'openDialog':
|
|
20334
|
-
return _objectSpread$
|
|
20489
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20335
20490
|
isFileDialogActive: true
|
|
20336
20491
|
});
|
|
20337
20492
|
|
|
20338
20493
|
case 'closeDialog':
|
|
20339
|
-
return _objectSpread$
|
|
20494
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20340
20495
|
isFileDialogActive: false
|
|
20341
20496
|
});
|
|
20342
20497
|
|
|
@@ -20344,19 +20499,19 @@ function reducer(state, action) {
|
|
|
20344
20499
|
/* eslint no-case-declarations: 0 */
|
|
20345
20500
|
var isDragActive = action.isDragActive,
|
|
20346
20501
|
draggedFiles = action.draggedFiles;
|
|
20347
|
-
return _objectSpread$
|
|
20502
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20348
20503
|
draggedFiles: draggedFiles,
|
|
20349
20504
|
isDragActive: isDragActive
|
|
20350
20505
|
});
|
|
20351
20506
|
|
|
20352
20507
|
case 'setFiles':
|
|
20353
|
-
return _objectSpread$
|
|
20508
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20354
20509
|
acceptedFiles: action.acceptedFiles,
|
|
20355
20510
|
fileRejections: action.fileRejections
|
|
20356
20511
|
});
|
|
20357
20512
|
|
|
20358
20513
|
case 'reset':
|
|
20359
|
-
return _objectSpread$
|
|
20514
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20360
20515
|
isFileDialogActive: false,
|
|
20361
20516
|
isDragActive: false,
|
|
20362
20517
|
draggedFiles: [],
|
|
@@ -20369,8 +20524,8 @@ function reducer(state, action) {
|
|
|
20369
20524
|
}
|
|
20370
20525
|
}
|
|
20371
20526
|
|
|
20372
|
-
function ownKeys$
|
|
20373
|
-
function _objectSpread$
|
|
20527
|
+
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; }
|
|
20528
|
+
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
20529
|
var useFileUpload = function useFileUpload(_ref) {
|
|
20375
20530
|
var disabled = _ref.disabled,
|
|
20376
20531
|
accept = _ref.accept,
|
|
@@ -20470,7 +20625,7 @@ var useFileUpload = function useFileUpload(_ref) {
|
|
|
20470
20625
|
var uploadedFile = neetoCist.findBy({
|
|
20471
20626
|
name: file.name
|
|
20472
20627
|
}, newFiles);
|
|
20473
|
-
return _objectSpread$
|
|
20628
|
+
return _objectSpread$e(_objectSpread$e({}, file), uploadedFile);
|
|
20474
20629
|
})
|
|
20475
20630
|
});
|
|
20476
20631
|
} else {
|
|
@@ -20529,6 +20684,8 @@ const SvgFileUpload = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
20529
20684
|
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
20685
|
})));
|
|
20531
20686
|
|
|
20687
|
+
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; }
|
|
20688
|
+
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
20689
|
var DropZone = function DropZone(_ref) {
|
|
20533
20690
|
var isDragActive = _ref.isDragActive,
|
|
20534
20691
|
getRootProps = _ref.getRootProps,
|
|
@@ -20541,54 +20698,63 @@ var DropZone = function DropZone(_ref) {
|
|
|
20541
20698
|
var _useTranslation = reactI18next.useTranslation(),
|
|
20542
20699
|
t = _useTranslation.t;
|
|
20543
20700
|
var shouldShowFileSizeLimit = hasFileSizeLimit && maxFileSize;
|
|
20544
|
-
return /*#__PURE__*/
|
|
20701
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread$d(_objectSpread$d({}, getRootProps({
|
|
20545
20702
|
className: classnames__default["default"](["neeto-form-engine-file-upload__dropzone"], {
|
|
20546
20703
|
"neeto-form-engine-file-upload__dropzone--drag-active": isDragActive
|
|
20547
20704
|
})
|
|
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
|
-
|
|
20705
|
+
})), {}, {
|
|
20706
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20707
|
+
className: "neeto-form-engine-file-upload__dropzone-inner",
|
|
20708
|
+
"data-cy": "file-upload-body",
|
|
20709
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgFileUpload, {
|
|
20710
|
+
className: "neeto-form-engine-file-upload__upload-icon"
|
|
20711
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20712
|
+
className: "neeto-form-engine-file-upload__dropzone-content",
|
|
20713
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
20714
|
+
className: "neeto-form-engine-file-upload__upload-label",
|
|
20715
|
+
htmlFor: "file-upload",
|
|
20716
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
20717
|
+
i18nKey: "neetoForm.fileUpload.dropzone.chooseOrDragFile",
|
|
20718
|
+
components: {
|
|
20719
|
+
typography: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20720
|
+
component: "span",
|
|
20721
|
+
weight: "semibold"
|
|
20722
|
+
}),
|
|
20723
|
+
span: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20724
|
+
component: "span",
|
|
20725
|
+
weight: "normal"
|
|
20726
|
+
})
|
|
20727
|
+
}
|
|
20728
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$d(_objectSpread$d({}, getInputProps()), {}, {
|
|
20729
|
+
"data-cy": "file-browse-button"
|
|
20730
|
+
}))]
|
|
20731
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20732
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-block",
|
|
20733
|
+
children: [!multipleFilesAllowed && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20734
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20735
|
+
"data-cy": "upload-only-one-file-text",
|
|
20736
|
+
style: "body3",
|
|
20737
|
+
children: t("neetoForm.fileUpload.dropzone.oneFileAllowed")
|
|
20738
|
+
}), shouldShowFileSizeLimit && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20739
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20740
|
+
"data-cy": "maximum-allowed-size-text",
|
|
20741
|
+
style: "body3",
|
|
20742
|
+
children: t("neetoForm.fileUpload.dropzone.maxFileSize", {
|
|
20743
|
+
size: maxFileSize,
|
|
20744
|
+
unit: t("neetoForm.fileUpload.mb")
|
|
20745
|
+
})
|
|
20746
|
+
}), allowedFileTypes && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
20747
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20748
|
+
"data-cy": "allowed-files-types-text",
|
|
20749
|
+
style: "body3",
|
|
20750
|
+
children: t("neetoForm.fileUpload.dropzone.allowedFileTypes", {
|
|
20751
|
+
types: allowedFileTypes
|
|
20752
|
+
})
|
|
20753
|
+
})]
|
|
20754
|
+
})]
|
|
20755
|
+
})]
|
|
20756
|
+
})
|
|
20757
|
+
}));
|
|
20592
20758
|
};
|
|
20593
20759
|
|
|
20594
20760
|
var createDefinition = function (propNames) { return ({
|
|
@@ -27898,51 +28064,55 @@ var Progress = function Progress(_ref) {
|
|
|
27898
28064
|
transition: transition
|
|
27899
28065
|
}
|
|
27900
28066
|
};
|
|
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
|
-
|
|
28067
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28068
|
+
className: "neeto-form-engine-progress__circle",
|
|
28069
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28070
|
+
className: "neeto-form-engine-progress__circle-wrapper",
|
|
28071
|
+
style: {
|
|
28072
|
+
height: size
|
|
28073
|
+
},
|
|
28074
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
28075
|
+
height: size,
|
|
28076
|
+
version: "1.1",
|
|
28077
|
+
viewBox: "0 0 100 100",
|
|
28078
|
+
width: size,
|
|
28079
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28080
|
+
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
28081
|
+
strokeWidth: strokeWidth,
|
|
28082
|
+
className: "circle",
|
|
28083
|
+
cx: "50",
|
|
28084
|
+
cy: "50",
|
|
28085
|
+
fill: "transparent",
|
|
28086
|
+
r: radius,
|
|
28087
|
+
stroke: emptyStroke,
|
|
28088
|
+
strokeOpacity: emptyStrokeOpacity
|
|
28089
|
+
})
|
|
28090
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
28091
|
+
height: size,
|
|
28092
|
+
viewBox: "0 0 100 100",
|
|
28093
|
+
width: size,
|
|
28094
|
+
style: {
|
|
28095
|
+
position: "absolute",
|
|
28096
|
+
transform: "rotate(-90deg)",
|
|
28097
|
+
overflow: "visible",
|
|
28098
|
+
top: 0
|
|
28099
|
+
},
|
|
28100
|
+
children: /*#__PURE__*/jsxRuntime.jsx(motion.circle, {
|
|
28101
|
+
stroke: stroke,
|
|
28102
|
+
strokeWidth: strokeWidth,
|
|
28103
|
+
variants: variants,
|
|
28104
|
+
animate: "show",
|
|
28105
|
+
cx: "50",
|
|
28106
|
+
cy: "50",
|
|
28107
|
+
fill: "transparent",
|
|
28108
|
+
initial: "hidden",
|
|
28109
|
+
r: radius,
|
|
28110
|
+
strokeDasharray: circumference,
|
|
28111
|
+
strokeDashoffset: fillPercents
|
|
28112
|
+
})
|
|
28113
|
+
})]
|
|
28114
|
+
})
|
|
28115
|
+
});
|
|
27946
28116
|
};
|
|
27947
28117
|
|
|
27948
28118
|
var FILE_MIME_TYPES = {
|
|
@@ -27994,48 +28164,56 @@ var FilePreview = reactUtils.withT(function (_ref) {
|
|
|
27994
28164
|
isUploading = _ref.isUploading,
|
|
27995
28165
|
cancel = _ref.cancel,
|
|
27996
28166
|
progress = _ref.progress;
|
|
27997
|
-
return /*#__PURE__*/
|
|
28167
|
+
return /*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
27998
28168
|
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
|
-
|
|
28169
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28170
|
+
className: "neeto-form-engine-file-upload__file-preview",
|
|
28171
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
28172
|
+
className: classnames__default["default"]("p-0", {
|
|
28173
|
+
invisible: isUploading
|
|
28174
|
+
}),
|
|
28175
|
+
href: file.url,
|
|
28176
|
+
icon: neetoIcons.FileGeneric,
|
|
28177
|
+
iconSize: 24,
|
|
28178
|
+
rel: "noreferrer",
|
|
28179
|
+
size: "large",
|
|
28180
|
+
style: "text",
|
|
28181
|
+
target: "_blank"
|
|
28182
|
+
}), isUploading && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28183
|
+
className: "neeto-form-engine-progress",
|
|
28184
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Progress, {
|
|
28185
|
+
percents: progress || 0,
|
|
28186
|
+
size: 20
|
|
28187
|
+
})
|
|
28188
|
+
})]
|
|
28189
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28190
|
+
className: "flex min-w-0 grow flex-col break-words",
|
|
28191
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28192
|
+
className: "neeto-form-engine-file-upload__file-info-name",
|
|
28193
|
+
style: "body2",
|
|
28194
|
+
children: file.name
|
|
28195
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28196
|
+
className: "neeto-form-engine-file-upload__file-info-size",
|
|
28197
|
+
style: "body3",
|
|
28198
|
+
children: file.size ? t("neetoForm.fileUpload.fileSizeInMb", {
|
|
28199
|
+
fileSize: convertBytesToMb(file.size)
|
|
28200
|
+
}) : ""
|
|
28201
|
+
})]
|
|
28202
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28203
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__actions"),
|
|
28204
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28205
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__success-indicator", {
|
|
28206
|
+
"neeto-form-engine-file-upload__success-indicator--active": file.url
|
|
28207
|
+
}),
|
|
28208
|
+
children: file.url && /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Check, {})
|
|
28209
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
28210
|
+
type: "button",
|
|
28211
|
+
className: classnames__default["default"]("neeto-form-engine-file-upload__button--red neeto-form-engine-file-upload__remove-button"),
|
|
28212
|
+
onClick: cancel,
|
|
28213
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Close, {})
|
|
28214
|
+
})]
|
|
28215
|
+
})]
|
|
28216
|
+
}, file.url);
|
|
28039
28217
|
});
|
|
28040
28218
|
|
|
28041
28219
|
var FileUploadField = function FileUploadField(_ref) {
|
|
@@ -28085,42 +28263,47 @@ var FileUploadField = function FileUploadField(_ref) {
|
|
|
28085
28263
|
var isUploadingFile = function isUploadingFile(file) {
|
|
28086
28264
|
return ramda.isNotNil(progress[file.name]) && (progress[file.name] !== 100 || !file.url);
|
|
28087
28265
|
};
|
|
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
|
-
|
|
28266
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28267
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28268
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28269
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28270
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
|
|
28271
|
+
className: "neeto-form-engine-label",
|
|
28272
|
+
required: isRequired,
|
|
28273
|
+
children: label
|
|
28274
|
+
})
|
|
28275
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DropZone, {
|
|
28276
|
+
allowedFileTypes: allowedFileTypes,
|
|
28277
|
+
getInputProps: getInputProps,
|
|
28278
|
+
getRootProps: getRootProps,
|
|
28279
|
+
isDragActive: isDragActive,
|
|
28280
|
+
maxFileSize: maxFileSize,
|
|
28281
|
+
multipleFilesAllowed: multipleFilesAllowed
|
|
28282
|
+
}), neetoCist.isNotEmpty(files) && /*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
28283
|
+
className: "neeto-form-engine-file-upload__uploaded-list",
|
|
28284
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (file, idx) {
|
|
28285
|
+
return /*#__PURE__*/React$2.createElement(FilePreview, {
|
|
28286
|
+
file: file,
|
|
28287
|
+
cancel: cancel(idx),
|
|
28288
|
+
isUploading: isUploadingFile(file),
|
|
28289
|
+
key: idx,
|
|
28290
|
+
progress: progress[file.name]
|
|
28291
|
+
});
|
|
28292
|
+
})
|
|
28293
|
+
}), neetoCist.isNotEmpty(fileRejections) && fileRejections.map(function (file, index) {
|
|
28294
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28295
|
+
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",
|
|
28296
|
+
children: renderErrorMessage(file, maxFileSizeInBytes, false)
|
|
28297
|
+
}, index);
|
|
28298
|
+
}), shouldShowError && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28114
28299
|
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));
|
|
28300
|
+
children: error
|
|
28301
|
+
})]
|
|
28302
|
+
});
|
|
28120
28303
|
};
|
|
28121
28304
|
|
|
28122
|
-
function ownKeys$
|
|
28123
|
-
function _objectSpread$
|
|
28305
|
+
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; }
|
|
28306
|
+
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
28307
|
var NameField = function NameField(_ref) {
|
|
28125
28308
|
var question = _ref.question,
|
|
28126
28309
|
customValidator = _ref.customValidator,
|
|
@@ -28150,12 +28333,12 @@ var NameField = function NameField(_ref) {
|
|
|
28150
28333
|
setValue = _useField2$2.setValue,
|
|
28151
28334
|
setTouched = _useField2$2.setTouched;
|
|
28152
28335
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28153
|
-
return /*#__PURE__*/
|
|
28336
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
28154
28337
|
type: type
|
|
28155
28338
|
}, field), {}, {
|
|
28156
28339
|
autoComplete: autoComplete,
|
|
28157
28340
|
label: label
|
|
28158
|
-
}), {
|
|
28341
|
+
})), {}, {
|
|
28159
28342
|
error: touched ? error : "",
|
|
28160
28343
|
name: kind,
|
|
28161
28344
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28178,39 +28361,43 @@ var Choices = function Choices(_ref) {
|
|
|
28178
28361
|
var isCheckBox = type === "checkbox";
|
|
28179
28362
|
var ChoiceWrapper = isCheckBox ? "div" : Radio__default["default"];
|
|
28180
28363
|
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
|
-
|
|
28364
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28365
|
+
className: "neeto-form-engine-choices__wrapper",
|
|
28366
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28367
|
+
className: "neeto-form-engine-label",
|
|
28368
|
+
children: label
|
|
28369
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ChoiceWrapper, {
|
|
28370
|
+
className: "neeto-form-engine-choices",
|
|
28371
|
+
stacked: !isCheckBox,
|
|
28372
|
+
children: options.map(function (option, index) {
|
|
28373
|
+
var _value$index;
|
|
28374
|
+
return /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28375
|
+
htmlFor: option.id,
|
|
28376
|
+
className: classnames__default["default"]("neeto-form-engine-choice", {
|
|
28377
|
+
active: false
|
|
28378
|
+
}),
|
|
28379
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
28380
|
+
onChange: onChange,
|
|
28381
|
+
type: type,
|
|
28382
|
+
id: option.id,
|
|
28383
|
+
label: option.label,
|
|
28384
|
+
name: isCheckBox ? "".concat(name, ".").concat(index) : name,
|
|
28385
|
+
value: option.id,
|
|
28386
|
+
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28387
|
+
})
|
|
28388
|
+
}, option.id);
|
|
28195
28389
|
})
|
|
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));
|
|
28390
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28391
|
+
className: "neeto-form-engine-input__error",
|
|
28392
|
+
"data-cy": "neeto-form-engine-".concat(type, "-error"),
|
|
28393
|
+
children: error
|
|
28394
|
+
})]
|
|
28395
|
+
});
|
|
28209
28396
|
};
|
|
28210
28397
|
var Choices$1 = /*#__PURE__*/React__default["default"].memo(Choices);
|
|
28211
28398
|
|
|
28212
|
-
function ownKeys$
|
|
28213
|
-
function _objectSpread$
|
|
28399
|
+
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; }
|
|
28400
|
+
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
28401
|
var OptionsField = function OptionsField(_ref) {
|
|
28215
28402
|
var question = _ref.question,
|
|
28216
28403
|
customValidator = _ref.customValidator;
|
|
@@ -28233,7 +28420,7 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28233
28420
|
value: option.id
|
|
28234
28421
|
};
|
|
28235
28422
|
}) : options.map(function (option) {
|
|
28236
|
-
return _objectSpread$
|
|
28423
|
+
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
28237
28424
|
label: fieldWithFallback(option, "label")
|
|
28238
28425
|
});
|
|
28239
28426
|
});
|
|
@@ -28244,31 +28431,32 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28244
28431
|
return validateField(name);
|
|
28245
28432
|
});
|
|
28246
28433
|
};
|
|
28247
|
-
return /*#__PURE__*/
|
|
28434
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28248
28435
|
name: name,
|
|
28249
28436
|
validate: validateFieldValue({
|
|
28250
28437
|
kind: kind,
|
|
28251
28438
|
label: label,
|
|
28252
28439
|
isRequired: isRequired,
|
|
28253
28440
|
customValidator: customValidator
|
|
28254
|
-
})
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28271
|
-
|
|
28441
|
+
}),
|
|
28442
|
+
children: function children(_ref2) {
|
|
28443
|
+
var meta = _ref2.meta,
|
|
28444
|
+
field = _ref2.field;
|
|
28445
|
+
var onChange = field.onChange,
|
|
28446
|
+
value = field.value;
|
|
28447
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
28448
|
+
isRequired: isRequired,
|
|
28449
|
+
name: name,
|
|
28450
|
+
error: getError(meta),
|
|
28451
|
+
label: getLabel(label, isRequired),
|
|
28452
|
+
options: transformedOptions,
|
|
28453
|
+
type: kind,
|
|
28454
|
+
value: isDropdown ? neetoCist.findBy({
|
|
28455
|
+
value: value
|
|
28456
|
+
}, transformedOptions) || null : value,
|
|
28457
|
+
onChange: isDropdown ? handleSelect : onChange
|
|
28458
|
+
});
|
|
28459
|
+
}
|
|
28272
28460
|
});
|
|
28273
28461
|
};
|
|
28274
28462
|
|
|
@@ -28297,7 +28485,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28297
28485
|
_useField2$2 = _useField2[2],
|
|
28298
28486
|
setValue = _useField2$2.setValue,
|
|
28299
28487
|
setTouched = _useField2$2.setTouched;
|
|
28300
|
-
return /*#__PURE__*/
|
|
28488
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumberInput, {
|
|
28301
28489
|
autoComplete: autoComplete,
|
|
28302
28490
|
label: label,
|
|
28303
28491
|
value: value,
|
|
@@ -28314,6 +28502,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28314
28502
|
};
|
|
28315
28503
|
|
|
28316
28504
|
var _excluded$2 = ["name", "label", "error", "lowestRatingLabel", "averageRatingLabel", "highestRatingLabel", "value"];
|
|
28505
|
+
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; }
|
|
28506
|
+
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
28507
|
var Rating = function Rating(_ref) {
|
|
28318
28508
|
var name = _ref.name,
|
|
28319
28509
|
label = _ref.label,
|
|
@@ -28332,38 +28522,46 @@ var Rating = function Rating(_ref) {
|
|
|
28332
28522
|
var Icon = _ref2.icon,
|
|
28333
28523
|
modifier = _ref2.modifier,
|
|
28334
28524
|
rating = _ref2.value;
|
|
28335
|
-
return /*#__PURE__*/
|
|
28336
|
-
|
|
28337
|
-
|
|
28338
|
-
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28525
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React$2.Fragment, {
|
|
28526
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
28527
|
+
type: "button",
|
|
28528
|
+
className: classnames__default["default"]("neeto-form-engine-rating__item neeto-form-engine-rating__item--".concat(modifier), {
|
|
28529
|
+
active: rating === value
|
|
28530
|
+
}),
|
|
28531
|
+
onClick: handleClick,
|
|
28532
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {}), /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28533
|
+
className: "neeto-form-engine-label",
|
|
28534
|
+
children: labels[index]
|
|
28535
|
+
})]
|
|
28536
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$a({
|
|
28537
|
+
name: name,
|
|
28538
|
+
hidden: true,
|
|
28539
|
+
checked: rating === value,
|
|
28540
|
+
type: "radio",
|
|
28541
|
+
value: rating
|
|
28542
|
+
}, other))]
|
|
28543
|
+
}, rating);
|
|
28352
28544
|
});
|
|
28353
28545
|
};
|
|
28354
|
-
return /*#__PURE__*/
|
|
28355
|
-
className: "neeto-form-engine-rating"
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
"
|
|
28363
|
-
|
|
28546
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28547
|
+
className: "neeto-form-engine-rating",
|
|
28548
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28549
|
+
className: "neeto-form-engine-label",
|
|
28550
|
+
children: label
|
|
28551
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28552
|
+
className: "neeto-form-engine-rating__row",
|
|
28553
|
+
children: render()
|
|
28554
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28555
|
+
className: "neeto-form-engine-input__error",
|
|
28556
|
+
"data-cy": "neeto-form-engine-rating-error",
|
|
28557
|
+
children: error
|
|
28558
|
+
})]
|
|
28559
|
+
});
|
|
28364
28560
|
};
|
|
28365
28561
|
var Rating$1 = /*#__PURE__*/React__default["default"].memo(Rating);
|
|
28366
28562
|
|
|
28563
|
+
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; }
|
|
28564
|
+
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
28565
|
var RatingField = function RatingField(_ref) {
|
|
28368
28566
|
var question = _ref.question,
|
|
28369
28567
|
customValidator = _ref.customValidator;
|
|
@@ -28371,27 +28569,30 @@ var RatingField = function RatingField(_ref) {
|
|
|
28371
28569
|
kind = question.kind,
|
|
28372
28570
|
isRequired = question.isRequired;
|
|
28373
28571
|
var label = fieldWithFallback(question, "label");
|
|
28374
|
-
return /*#__PURE__*/
|
|
28572
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28375
28573
|
name: name,
|
|
28376
28574
|
validate: validateFieldValue({
|
|
28377
28575
|
kind: kind,
|
|
28378
28576
|
label: label,
|
|
28379
28577
|
isRequired: isRequired,
|
|
28380
28578
|
customValidator: customValidator
|
|
28381
|
-
})
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28579
|
+
}),
|
|
28580
|
+
children: function children(_ref2) {
|
|
28581
|
+
var meta = _ref2.meta,
|
|
28582
|
+
field = _ref2.field;
|
|
28583
|
+
return /*#__PURE__*/jsxRuntime.jsx(Rating$1, _objectSpread$9(_objectSpread$9({}, field), {}, {
|
|
28584
|
+
error: meta.touched ? meta.error : "",
|
|
28585
|
+
label: getLabel(label, isRequired),
|
|
28586
|
+
averageRatingLabel: fieldWithFallback(question, "averageRatingLabel") || RATING_VALUES.AVERAGE.label,
|
|
28587
|
+
highestRatingLabel: fieldWithFallback(question, "highestRatingLabel") || RATING_VALUES.GOOD.label,
|
|
28588
|
+
lowestRatingLabel: fieldWithFallback(question, "lowestRatingLabel") || RATING_VALUES.BAD.label
|
|
28589
|
+
}));
|
|
28590
|
+
}
|
|
28392
28591
|
});
|
|
28393
28592
|
};
|
|
28394
28593
|
|
|
28594
|
+
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; }
|
|
28595
|
+
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
28596
|
var RichTextEditor = function RichTextEditor(_ref) {
|
|
28396
28597
|
var editorRef = _ref.editorRef,
|
|
28397
28598
|
question = _ref.question,
|
|
@@ -28407,45 +28608,50 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
28407
28608
|
var label = fieldWithFallback(question, "label");
|
|
28408
28609
|
var debouncedPlaceholder = reactUtils.useDebounce(fieldWithFallback(question, "placeholder"), 300);
|
|
28409
28610
|
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
|
-
|
|
28611
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28612
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28613
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28614
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28615
|
+
children: label && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28616
|
+
className: "neeto-form-engine-label",
|
|
28617
|
+
children: getLabel(label, isRequired)
|
|
28618
|
+
})
|
|
28619
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.FastField, {
|
|
28620
|
+
debouncedPlaceholder: debouncedPlaceholder,
|
|
28621
|
+
error: errors[name],
|
|
28622
|
+
name: name || nodeId,
|
|
28623
|
+
shouldUpdate: isPropsUnequal(propsToCompare),
|
|
28624
|
+
validate: validateFieldValue({
|
|
28625
|
+
kind: kind,
|
|
28626
|
+
label: label,
|
|
28627
|
+
isRequired: isRequired
|
|
28628
|
+
}),
|
|
28629
|
+
children: function children(_ref2) {
|
|
28630
|
+
var field = _ref2.field,
|
|
28631
|
+
form = _ref2.form,
|
|
28632
|
+
meta = _ref2.meta;
|
|
28633
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.Editor, _objectSpread$8({
|
|
28634
|
+
className: "neeto-form-engine-rich-text-input",
|
|
28635
|
+
error: meta.touched ? meta.error : "",
|
|
28636
|
+
initialValue: field.value,
|
|
28637
|
+
placeholder: debouncedPlaceholder,
|
|
28638
|
+
ref: editorRef,
|
|
28639
|
+
addons: ["attachments", "block-quote", "code-block", "image-upload"],
|
|
28640
|
+
onBlur: function onBlur() {
|
|
28641
|
+
return form.setFieldTouched(name, true);
|
|
28642
|
+
},
|
|
28643
|
+
onChange: function onChange(value) {
|
|
28644
|
+
return form.setFieldValue(name, value);
|
|
28645
|
+
}
|
|
28646
|
+
}, editorProps), debouncedPlaceholder);
|
|
28443
28647
|
}
|
|
28444
|
-
}
|
|
28445
|
-
})
|
|
28648
|
+
})]
|
|
28649
|
+
});
|
|
28446
28650
|
};
|
|
28447
28651
|
|
|
28448
28652
|
var _excluded$1 = ["value", "iconType", "label", "rating"];
|
|
28653
|
+
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; }
|
|
28654
|
+
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
28655
|
var RatingButton = function RatingButton(_ref) {
|
|
28450
28656
|
var _ref$value = _ref.value,
|
|
28451
28657
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
@@ -28458,56 +28664,68 @@ var RatingButton = function RatingButton(_ref) {
|
|
|
28458
28664
|
};
|
|
28459
28665
|
var Icon = ICONS_MAP[iconType];
|
|
28460
28666
|
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
|
-
|
|
28667
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
28668
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
28669
|
+
className: classnames__default["default"]({
|
|
28670
|
+
active: rating === value
|
|
28671
|
+
}),
|
|
28672
|
+
type: "button",
|
|
28673
|
+
onClick: handleClick,
|
|
28674
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
28675
|
+
size: 24,
|
|
28676
|
+
className: classnames__default["default"]("neeto-form-engine-star-rating__icon", {
|
|
28677
|
+
"neeto-form-engine-star-rating__icon--active": rating <= selectedRating
|
|
28678
|
+
})
|
|
28679
|
+
}), /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28680
|
+
className: "neeto-form-engine-label",
|
|
28681
|
+
children: label
|
|
28682
|
+
})]
|
|
28683
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread$7({
|
|
28684
|
+
hidden: true,
|
|
28685
|
+
checked: ramda.equals(rating, value),
|
|
28686
|
+
type: "radio",
|
|
28687
|
+
value: rating
|
|
28688
|
+
}, otherProps))]
|
|
28689
|
+
});
|
|
28480
28690
|
};
|
|
28481
28691
|
var RatingButton$1 = /*#__PURE__*/React__default["default"].memo(RatingButton);
|
|
28482
28692
|
|
|
28483
28693
|
var _excluded = ["label", "minValue", "maxValue", "error"];
|
|
28694
|
+
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; }
|
|
28695
|
+
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
28696
|
var StarRating = function StarRating(_ref) {
|
|
28485
28697
|
var label = _ref.label,
|
|
28486
28698
|
minValue = _ref.minValue,
|
|
28487
28699
|
maxValue = _ref.maxValue,
|
|
28488
28700
|
error = _ref.error,
|
|
28489
28701
|
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
|
-
|
|
28702
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28703
|
+
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating",
|
|
28704
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28705
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28706
|
+
children: /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
28707
|
+
className: "neeto-form-engine-label",
|
|
28708
|
+
children: label
|
|
28709
|
+
})
|
|
28710
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28711
|
+
className: "neeto-form-engine-star-rating__row",
|
|
28712
|
+
children: generateArray(minValue, maxValue).map(function (index) {
|
|
28713
|
+
return /*#__PURE__*/jsxRuntime.jsx(RatingButton$1, _objectSpread$6({
|
|
28714
|
+
label: index,
|
|
28715
|
+
rating: index
|
|
28716
|
+
}, props), index);
|
|
28717
|
+
})
|
|
28718
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28719
|
+
className: "neeto-form-engine-input__error",
|
|
28720
|
+
"data-cy": "neeto-form-engine-star-rating-error",
|
|
28721
|
+
children: error
|
|
28722
|
+
})]
|
|
28723
|
+
});
|
|
28508
28724
|
};
|
|
28509
28725
|
var StarRating$1 = /*#__PURE__*/React__default["default"].memo(StarRating);
|
|
28510
28726
|
|
|
28727
|
+
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; }
|
|
28728
|
+
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
28729
|
var StarRatingField = function StarRatingField(_ref) {
|
|
28512
28730
|
var question = _ref.question,
|
|
28513
28731
|
customValidator = _ref.customValidator;
|
|
@@ -28518,30 +28736,31 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
28518
28736
|
maxValue = question.maxValue,
|
|
28519
28737
|
iconType = question.iconType;
|
|
28520
28738
|
var label = fieldWithFallback(question, "label");
|
|
28521
|
-
return /*#__PURE__*/
|
|
28739
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28522
28740
|
name: name,
|
|
28523
28741
|
validate: validateFieldValue({
|
|
28524
28742
|
kind: kind,
|
|
28525
28743
|
label: label,
|
|
28526
28744
|
isRequired: isRequired,
|
|
28527
28745
|
customValidator: customValidator
|
|
28528
|
-
})
|
|
28529
|
-
|
|
28530
|
-
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
|
|
28534
|
-
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28538
|
-
|
|
28539
|
-
|
|
28746
|
+
}),
|
|
28747
|
+
children: function children(_ref2) {
|
|
28748
|
+
var meta = _ref2.meta,
|
|
28749
|
+
field = _ref2.field;
|
|
28750
|
+
return /*#__PURE__*/jsxRuntime.jsx(StarRating$1, _objectSpread$5({
|
|
28751
|
+
iconType: iconType,
|
|
28752
|
+
maxValue: maxValue,
|
|
28753
|
+
minValue: minValue,
|
|
28754
|
+
name: name,
|
|
28755
|
+
error: meta.touched ? meta.error : "",
|
|
28756
|
+
label: getLabel(label, isRequired)
|
|
28757
|
+
}, field));
|
|
28758
|
+
}
|
|
28540
28759
|
});
|
|
28541
28760
|
};
|
|
28542
28761
|
|
|
28543
|
-
function ownKeys$
|
|
28544
|
-
function _objectSpread$
|
|
28762
|
+
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; }
|
|
28763
|
+
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
28764
|
var TermsField = function TermsField(_ref) {
|
|
28546
28765
|
var question = _ref.question,
|
|
28547
28766
|
customValidator = _ref.customValidator;
|
|
@@ -28550,32 +28769,35 @@ var TermsField = function TermsField(_ref) {
|
|
|
28550
28769
|
isRequired = question.isRequired,
|
|
28551
28770
|
nodeId = question.nodeId;
|
|
28552
28771
|
var label = fieldWithFallback(question, "label", true);
|
|
28553
|
-
return /*#__PURE__*/
|
|
28772
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28554
28773
|
name: name || nodeId,
|
|
28555
28774
|
validate: validateFieldValue({
|
|
28556
28775
|
kind: kind,
|
|
28557
28776
|
label: label,
|
|
28558
28777
|
isRequired: isRequired,
|
|
28559
28778
|
customValidator: customValidator
|
|
28560
|
-
})
|
|
28561
|
-
|
|
28562
|
-
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
|
|
28566
|
-
|
|
28567
|
-
|
|
28568
|
-
|
|
28569
|
-
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28779
|
+
}),
|
|
28780
|
+
children: function children(_ref2) {
|
|
28781
|
+
var meta = _ref2.meta,
|
|
28782
|
+
field = _ref2.field;
|
|
28783
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28784
|
+
className: "neeto-form-engine-terms",
|
|
28785
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], _objectSpread$4(_objectSpread$4({}, _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
28786
|
+
name: name
|
|
28787
|
+
})), {}, {
|
|
28788
|
+
checked: field.value,
|
|
28789
|
+
error: meta.touched ? meta.error : "",
|
|
28790
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
28791
|
+
content: label
|
|
28792
|
+
})
|
|
28793
|
+
}))
|
|
28794
|
+
});
|
|
28795
|
+
}
|
|
28574
28796
|
});
|
|
28575
28797
|
};
|
|
28576
28798
|
|
|
28577
|
-
function ownKeys$
|
|
28578
|
-
function _objectSpread$
|
|
28799
|
+
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; }
|
|
28800
|
+
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
28801
|
var TextField = function TextField(_ref) {
|
|
28580
28802
|
var _otherProps$onChange;
|
|
28581
28803
|
var question = _ref.question,
|
|
@@ -28610,13 +28832,13 @@ var TextField = function TextField(_ref) {
|
|
|
28610
28832
|
setValue = _useField2$2.setValue,
|
|
28611
28833
|
setTouched = _useField2$2.setTouched;
|
|
28612
28834
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28613
|
-
return /*#__PURE__*/
|
|
28835
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({
|
|
28614
28836
|
type: type
|
|
28615
28837
|
}, field), {}, {
|
|
28616
28838
|
autoComplete: autoComplete,
|
|
28617
28839
|
label: label,
|
|
28618
28840
|
onKeyDown: onKeyDown
|
|
28619
|
-
}), {
|
|
28841
|
+
})), {}, {
|
|
28620
28842
|
error: touched ? error : "",
|
|
28621
28843
|
name: neetoCist.slugify(label),
|
|
28622
28844
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28631,18 +28853,11 @@ var TextField = function TextField(_ref) {
|
|
|
28631
28853
|
var _QUESTION_TO_COMPONEN;
|
|
28632
28854
|
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
28855
|
var question = _ref.question;
|
|
28634
|
-
return /*#__PURE__*/
|
|
28856
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
28635
28857
|
content: fieldWithFallback(question, "label", true)
|
|
28636
28858
|
});
|
|
28637
28859
|
}), _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
28860
|
|
|
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
28861
|
var getFieldComponent = function getFieldComponent(_ref) {
|
|
28647
28862
|
var kind = _ref.kind;
|
|
28648
28863
|
if (kind in QUESTION_TO_COMPONENT_MAP) return QUESTION_TO_COMPONENT_MAP[kind];
|
|
@@ -28696,21 +28911,24 @@ const SvgSuccess = props => /*#__PURE__*/React__namespace.createElement("svg", _
|
|
|
28696
28911
|
var Success = function Success() {
|
|
28697
28912
|
var _useTranslation = reactI18next.useTranslation(),
|
|
28698
28913
|
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
|
-
|
|
28914
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28915
|
+
className: "flex h-full w-full flex-col items-center justify-center space-y-4",
|
|
28916
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgSuccess, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28917
|
+
style: "h1",
|
|
28918
|
+
children: t("neetoForm.successPage.title1")
|
|
28919
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
28920
|
+
style: "h1",
|
|
28921
|
+
children: t("neetoForm.successPage.title2")
|
|
28922
|
+
})]
|
|
28923
|
+
});
|
|
28706
28924
|
};
|
|
28707
28925
|
var Success$1 = /*#__PURE__*/React__default["default"].memo(Success);
|
|
28708
28926
|
|
|
28709
28927
|
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
28928
|
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
28929
|
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; }
|
|
28930
|
+
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; }
|
|
28931
|
+
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
28932
|
var ExternalForm = function ExternalForm(_ref) {
|
|
28715
28933
|
var _formikInnerRef$curre;
|
|
28716
28934
|
var _ref$preview = _ref.preview,
|
|
@@ -28879,7 +29097,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28879
29097
|
_context.next = 29;
|
|
28880
29098
|
return createSubmission({
|
|
28881
29099
|
formId: formId,
|
|
28882
|
-
values: _objectSpread({
|
|
29100
|
+
values: _objectSpread$2({
|
|
28883
29101
|
neetoFormResponse: {
|
|
28884
29102
|
responses: responses
|
|
28885
29103
|
}
|
|
@@ -28982,9 +29200,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28982
29200
|
mode: "scoped"
|
|
28983
29201
|
});
|
|
28984
29202
|
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
|
-
|
|
29203
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29204
|
+
className: "loader flex h-full w-full items-center justify-center",
|
|
29205
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
29206
|
+
});
|
|
28988
29207
|
}
|
|
28989
29208
|
var title = form.title,
|
|
28990
29209
|
_form$questions = form.questions,
|
|
@@ -28994,96 +29213,107 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28994
29213
|
return !_destroy;
|
|
28995
29214
|
}) : questions;
|
|
28996
29215
|
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
|
-
|
|
29216
|
+
return /*#__PURE__*/jsxRuntime.jsx(Success$1, {});
|
|
29217
|
+
}
|
|
29218
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
29219
|
+
children: [showTitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29220
|
+
className: "py-6 text-center",
|
|
29221
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$2(_objectSpread$2({
|
|
29222
|
+
className: "neeto-ui-text-gray-800",
|
|
29223
|
+
style: "h4",
|
|
29224
|
+
weight: "semibold"
|
|
29225
|
+
}, titleProps), {}, {
|
|
29226
|
+
children: formTitle || title
|
|
29227
|
+
}))
|
|
29228
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.Formik, {
|
|
29229
|
+
onSubmit: onSubmit,
|
|
29230
|
+
enableReinitialize: true,
|
|
29231
|
+
innerRef: formikInnerRef,
|
|
29232
|
+
initialValues: generateInitValues({
|
|
29233
|
+
questions: questions,
|
|
29234
|
+
initialValues: submission === null || submission === void 0 ? void 0 : submission.responses,
|
|
29235
|
+
localValues: preserveValues ? localValues : initialValues,
|
|
29236
|
+
fieldCodes: enablePreFilling ? utils.getQueryParams({
|
|
29237
|
+
toCamelCase: false
|
|
29238
|
+
}) : {}
|
|
29239
|
+
}),
|
|
29240
|
+
children: function children(_ref5) {
|
|
29241
|
+
var isSubmitting = _ref5.isSubmitting,
|
|
29242
|
+
errors = _ref5.errors,
|
|
29243
|
+
setFieldError = _ref5.setFieldError,
|
|
29244
|
+
handleReset = _ref5.handleReset;
|
|
29245
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FormikWrap, {
|
|
29246
|
+
formId: formId,
|
|
29247
|
+
preserveValues: preserveValues,
|
|
29248
|
+
onError: handleScrollToError,
|
|
29249
|
+
onValuesChange: onChange,
|
|
29250
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(formik.Form, _objectSpread$2(_objectSpread$2({
|
|
29251
|
+
noValidate: true,
|
|
29252
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
29253
|
+
className: classnames__default["default"]("neeto-form-engine-form relative space-y-4", _defineProperty$6({}, className, className)),
|
|
29254
|
+
onChange: function onChange(event) {
|
|
29255
|
+
if (ramda.isEmpty(errors)) return;
|
|
29256
|
+
setFieldError(event.target.name, "");
|
|
29257
|
+
}
|
|
29258
|
+
}, formDomProps), {}, {
|
|
29259
|
+
onReset: function onReset(e) {
|
|
29260
|
+
return _onReset(e, handleReset);
|
|
29261
|
+
},
|
|
29262
|
+
children: [(submission === null || submission === void 0 ? void 0 : submission.isLoading) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29263
|
+
className: "neeto-ui-bg-gray-100 absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center opacity-75",
|
|
29264
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner__default["default"], {})
|
|
29265
|
+
}), renderedQuestions.map(function (question) {
|
|
29266
|
+
var _question$id;
|
|
29267
|
+
var FieldComponent = getFieldComponent(question);
|
|
29268
|
+
return /*#__PURE__*/React$2.createElement(FieldComponent, {
|
|
29269
|
+
editorProps: editorProps,
|
|
29270
|
+
editorRef: editorRef,
|
|
29271
|
+
preview: preview,
|
|
29272
|
+
question: question,
|
|
29273
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
29274
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
29275
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
29276
|
+
});
|
|
29277
|
+
}), showEmptyState && ramda.isEmpty(renderedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
29278
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
29279
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgNoQuestions, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
29280
|
+
style: "h3",
|
|
29281
|
+
weight: "semibold",
|
|
29282
|
+
children: t("neetoForm.questions.common.notFound")
|
|
29283
|
+
})]
|
|
29284
|
+
}), footer, !ramda.isEmpty(renderedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
29285
|
+
className: "mt-8 flex items-center justify-between",
|
|
29286
|
+
children: [cancelButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29287
|
+
label: t("neetoForm.common.cancel"),
|
|
29288
|
+
style: "secondary"
|
|
29289
|
+
}, cancelButtonProps)), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
29290
|
+
className: "flex gap-x-2",
|
|
29291
|
+
children: renderButtonsInOrder([/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29292
|
+
disabled: isSubmitting || isSubmitted,
|
|
29293
|
+
label: t("neetoForm.common.submit"),
|
|
29294
|
+
loading: isSubmitting,
|
|
29295
|
+
type: "submit"
|
|
29296
|
+
}, submitButtonProps), "submit"), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$2({
|
|
29297
|
+
label: t("neetoForm.common.reset"),
|
|
29298
|
+
style: "secondary",
|
|
29299
|
+
type: "reset"
|
|
29300
|
+
}, resetButtonProps), "reset")], neetoCist.isPresent(cancelButtonProps))
|
|
29301
|
+
})]
|
|
29302
|
+
})]
|
|
29303
|
+
})), !customSubmitHandler && /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
29304
|
+
callout: {
|
|
29305
|
+
isVisible: neetoCist.isPresent(error),
|
|
29306
|
+
title: t("neetoForm.callouts.submitError"),
|
|
29307
|
+
message: error
|
|
29308
|
+
},
|
|
29309
|
+
onClose: function onClose() {
|
|
29310
|
+
return setError(null);
|
|
29311
|
+
}
|
|
29312
|
+
})]
|
|
29313
|
+
});
|
|
29084
29314
|
}
|
|
29085
|
-
})
|
|
29086
|
-
})
|
|
29315
|
+
})]
|
|
29316
|
+
});
|
|
29087
29317
|
};
|
|
29088
29318
|
|
|
29089
29319
|
var dist = {};
|
|
@@ -31611,13 +31841,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31611
31841
|
var _default = dist.default = _Linkify2.default;
|
|
31612
31842
|
|
|
31613
31843
|
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
31614
|
-
return /*#__PURE__*/
|
|
31844
|
+
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
31615
31845
|
className: "neeto-ui-text-primary-500 hover:underline",
|
|
31616
31846
|
href: decoratedHref,
|
|
31617
|
-
key: key,
|
|
31618
31847
|
rel: "noreferrer",
|
|
31619
|
-
target: "_blank"
|
|
31620
|
-
|
|
31848
|
+
target: "_blank",
|
|
31849
|
+
children: decoratedText
|
|
31850
|
+
}, key);
|
|
31621
31851
|
};
|
|
31622
31852
|
var filterResponses = neetoCist.removeBy({
|
|
31623
31853
|
kind: QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
@@ -31626,27 +31856,33 @@ var filterResponses = neetoCist.removeBy({
|
|
|
31626
31856
|
|
|
31627
31857
|
var FileUpload = function FileUpload(_ref) {
|
|
31628
31858
|
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
|
-
|
|
31859
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31860
|
+
className: "space-y-2",
|
|
31861
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (_ref2, index) {
|
|
31862
|
+
var url = _ref2.url,
|
|
31863
|
+
name = _ref2.name;
|
|
31864
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
31865
|
+
className: "break-all",
|
|
31866
|
+
style: "body2",
|
|
31867
|
+
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
31868
|
+
componentDecorator: function componentDecorator() {
|
|
31869
|
+
return linkifyDecorator(url, name, index);
|
|
31870
|
+
},
|
|
31871
|
+
children: url
|
|
31872
|
+
})
|
|
31873
|
+
}, index);
|
|
31874
|
+
})
|
|
31875
|
+
});
|
|
31644
31876
|
};
|
|
31645
31877
|
|
|
31878
|
+
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; }
|
|
31879
|
+
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
31880
|
var getValue = function getValue(_ref) {
|
|
31647
31881
|
var value = _ref.value,
|
|
31648
31882
|
kind = _ref.kind;
|
|
31649
|
-
if (ramda.isEmpty(value)) return /*#__PURE__*/
|
|
31883
|
+
if (ramda.isEmpty(value)) return /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
31884
|
+
children: i18next.t("neetoForm.common.unanswered")
|
|
31885
|
+
});
|
|
31650
31886
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31651
31887
|
return value && utils.dateFormat.date(value);
|
|
31652
31888
|
}
|
|
@@ -31690,51 +31926,58 @@ var Submission = function Submission(_ref2) {
|
|
|
31690
31926
|
var renderSubmittedValue = function renderSubmittedValue(kind, value) {
|
|
31691
31927
|
switch (kind) {
|
|
31692
31928
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
31693
|
-
return /*#__PURE__*/
|
|
31929
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
31694
31930
|
content: getEditorContent(getValue({
|
|
31695
31931
|
value: value,
|
|
31696
31932
|
kind: kind
|
|
31697
31933
|
}))
|
|
31698
31934
|
});
|
|
31699
31935
|
case QUESTION_KIND.PHONE.value:
|
|
31700
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31936
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumber, {
|
|
31701
31937
|
value: value,
|
|
31702
31938
|
showEmoji: true
|
|
31703
31939
|
}) : "-";
|
|
31704
31940
|
case QUESTION_KIND.FILE_UPLOAD.value:
|
|
31705
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31941
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(FileUpload, {
|
|
31706
31942
|
files: value
|
|
31707
31943
|
}) : "-";
|
|
31708
31944
|
default:
|
|
31709
|
-
return /*#__PURE__*/
|
|
31945
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$1(_objectSpread$1({
|
|
31710
31946
|
weight: "semibold"
|
|
31711
|
-
}, answerProps),
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31947
|
+
}, answerProps), {}, {
|
|
31948
|
+
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
31949
|
+
componentDecorator: linkifyDecorator,
|
|
31950
|
+
children: getValue({
|
|
31951
|
+
value: value,
|
|
31952
|
+
kind: kind
|
|
31953
|
+
})
|
|
31954
|
+
})
|
|
31955
|
+
}));
|
|
31717
31956
|
}
|
|
31718
31957
|
};
|
|
31719
31958
|
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
|
-
|
|
31959
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31960
|
+
className: "flex h-full w-full items-center justify-center",
|
|
31961
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
31962
|
+
});
|
|
31963
|
+
}
|
|
31964
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31965
|
+
className: classnames__default["default"]("mx-auto flex h-full w-full flex-col items-start", _defineProperty$6({}, className, className)),
|
|
31966
|
+
children: filteredResponses.map(function (_ref3) {
|
|
31967
|
+
var kind = _ref3.kind,
|
|
31968
|
+
label = _ref3.label,
|
|
31969
|
+
value = _ref3.value;
|
|
31970
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31971
|
+
className: "mb-4",
|
|
31972
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$1(_objectSpread$1({
|
|
31973
|
+
style: "h5",
|
|
31974
|
+
weight: "light"
|
|
31975
|
+
}, questionLabelProps), {}, {
|
|
31976
|
+
children: label
|
|
31977
|
+
})), renderSubmittedValue(kind, value)]
|
|
31978
|
+
}, label);
|
|
31979
|
+
})
|
|
31980
|
+
});
|
|
31738
31981
|
};
|
|
31739
31982
|
|
|
31740
31983
|
var getPreFillableQuestions = function getPreFillableQuestions(questions) {
|
|
@@ -31798,6 +32041,8 @@ var buildQueryParameters = function buildQueryParameters(responses, questions) {
|
|
|
31798
32041
|
return queryParameters;
|
|
31799
32042
|
};
|
|
31800
32043
|
|
|
32044
|
+
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; }
|
|
32045
|
+
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
32046
|
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
32047
|
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
32048
|
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 +32127,94 @@ var UrlBuilder = function UrlBuilder(_ref) {
|
|
|
31882
32127
|
mode: "scoped"
|
|
31883
32128
|
});
|
|
31884
32129
|
if (isLoading || form.isQuestionsLoading) {
|
|
31885
|
-
return /*#__PURE__*/
|
|
31886
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31887
|
-
|
|
32130
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32131
|
+
className: "flex h-full w-full items-center justify-center",
|
|
32132
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
|
|
32133
|
+
});
|
|
31888
32134
|
}
|
|
31889
32135
|
var title = form.title,
|
|
31890
32136
|
questions = form.questions;
|
|
31891
32137
|
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
|
-
|
|
32138
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
32139
|
+
children: [showTitle && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32140
|
+
className: "py-6 text-center",
|
|
32141
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread(_objectSpread({
|
|
32142
|
+
className: "neeto-ui-text-gray-800",
|
|
32143
|
+
style: "h4",
|
|
32144
|
+
weight: "semibold"
|
|
32145
|
+
}, titleProps), {}, {
|
|
32146
|
+
children: formTitle || title
|
|
32147
|
+
}))
|
|
32148
|
+
}), /*#__PURE__*/jsxRuntime.jsx(formik.Formik, {
|
|
32149
|
+
onSubmit: onSubmit,
|
|
32150
|
+
enableReinitialize: true,
|
|
32151
|
+
initialValues: generateInitValues({
|
|
32152
|
+
questions: modifiedQuestions
|
|
32153
|
+
}),
|
|
32154
|
+
innerRef: formikInnerRef,
|
|
32155
|
+
children: function children(_ref3) {
|
|
32156
|
+
var isSubmitting = _ref3.isSubmitting,
|
|
32157
|
+
errors = _ref3.errors,
|
|
32158
|
+
setFieldError = _ref3.setFieldError,
|
|
32159
|
+
handleReset = _ref3.handleReset;
|
|
32160
|
+
return /*#__PURE__*/jsxRuntime.jsx(FormikWrap, {
|
|
32161
|
+
formId: formId,
|
|
32162
|
+
preserveValues: false,
|
|
32163
|
+
onError: handleScrollToError,
|
|
32164
|
+
onValuesChange: onChange,
|
|
32165
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(formik.Form, _objectSpread(_objectSpread({
|
|
32166
|
+
noValidate: true,
|
|
32167
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
32168
|
+
className: classnames__default["default"]("neeto-form-engine-form relative space-y-4", className),
|
|
32169
|
+
onChange: function onChange(event) {
|
|
32170
|
+
if (ramda.isEmpty(errors)) return;
|
|
32171
|
+
setFieldError(event.target.name, "");
|
|
32172
|
+
}
|
|
32173
|
+
}, formDomProps), {}, {
|
|
32174
|
+
onReset: function onReset(e) {
|
|
32175
|
+
return _onReset(e, handleReset);
|
|
32176
|
+
},
|
|
32177
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32178
|
+
className: "neeto-form-engine-questions-wrapper space-y-4 overflow-auto pr-4",
|
|
32179
|
+
children: [modifiedQuestions.map(function (question) {
|
|
32180
|
+
var _question$id;
|
|
32181
|
+
var FieldComponent = getFieldComponent(question);
|
|
32182
|
+
return /*#__PURE__*/React$2.createElement(FieldComponent, {
|
|
32183
|
+
editorProps: editorProps,
|
|
32184
|
+
editorRef: editorRef,
|
|
32185
|
+
question: question,
|
|
32186
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
32187
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
32188
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
32189
|
+
});
|
|
32190
|
+
}), showEmptyState && ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32191
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
32192
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgNoQuestions, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
32193
|
+
style: "h3",
|
|
32194
|
+
weight: "semibold",
|
|
32195
|
+
children: t("neetoForm.questions.common.notFound")
|
|
32196
|
+
})]
|
|
32197
|
+
})]
|
|
32198
|
+
}), !ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32199
|
+
className: "mt-8 flex items-center justify-start gap-x-2",
|
|
32200
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32201
|
+
disabled: isSubmitting,
|
|
32202
|
+
label: t("neetoForm.common.generateLink"),
|
|
32203
|
+
loading: isSubmitting,
|
|
32204
|
+
type: "submit"
|
|
32205
|
+
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32206
|
+
label: t("neetoForm.common.reset"),
|
|
32207
|
+
style: "secondary",
|
|
32208
|
+
type: "reset"
|
|
32209
|
+
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
32210
|
+
label: t("neetoForm.common.cancel")
|
|
32211
|
+
}, cancelButtonProps))]
|
|
32212
|
+
})]
|
|
32213
|
+
}))
|
|
32214
|
+
});
|
|
31926
32215
|
}
|
|
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
|
-
}));
|
|
32216
|
+
})]
|
|
32217
|
+
});
|
|
31960
32218
|
};
|
|
31961
32219
|
|
|
31962
32220
|
var useFormSubmission = function useFormSubmission(_ref) {
|