@bigbinary/neeto-form-frontend 2.0.0 → 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 +1705 -1458
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1707 -1460
- package/dist/index.js.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React$2 = require('react');
|
|
6
|
+
var classnames = require('classnames');
|
|
6
7
|
var formik = require('formik');
|
|
7
8
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
8
9
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
@@ -10,6 +11,7 @@ var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
|
10
11
|
var ramda = require('ramda');
|
|
11
12
|
var reactQuery = require('react-query');
|
|
12
13
|
var i18next = require('i18next');
|
|
14
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
15
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
14
16
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
15
17
|
var axios = require('axios');
|
|
@@ -17,18 +19,17 @@ var ReactDOM = require('react-dom');
|
|
|
17
19
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
18
20
|
var reactI18next = require('react-i18next');
|
|
19
21
|
var zustand = require('zustand');
|
|
22
|
+
var neetoEditor = require('@bigbinary/neeto-editor');
|
|
20
23
|
var shallow = require('zustand/shallow');
|
|
21
24
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
22
25
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
23
26
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
24
27
|
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
25
28
|
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
26
|
-
var classnames = require('classnames');
|
|
27
29
|
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');
|
|
@@ -77,6 +78,7 @@ function _interopNamespace(e) {
|
|
|
77
78
|
|
|
78
79
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React$2);
|
|
79
80
|
var React__namespace = /*#__PURE__*/_interopNamespace(React$2);
|
|
81
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
80
82
|
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
81
83
|
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
82
84
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
@@ -87,7 +89,6 @@ var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
|
87
89
|
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
88
90
|
var Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(Dropdown);
|
|
89
91
|
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
90
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
91
92
|
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
92
93
|
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form$2);
|
|
93
94
|
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
@@ -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) {
|
|
@@ -11630,13 +11635,6 @@ var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
|
|
|
11630
11635
|
var generateArray = function generateArray(start, end) {
|
|
11631
11636
|
return ramda.range(start, end + 1);
|
|
11632
11637
|
};
|
|
11633
|
-
var isElementOverflowing = function isElementOverflowing(_ref2) {
|
|
11634
|
-
var clientWidth = _ref2.clientWidth,
|
|
11635
|
-
clientHeight = _ref2.clientHeight,
|
|
11636
|
-
scrollWidth = _ref2.scrollWidth,
|
|
11637
|
-
scrollHeight = _ref2.scrollHeight;
|
|
11638
|
-
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
11639
|
-
};
|
|
11640
11638
|
var htmlToPlainText = function htmlToPlainText(htmlContent) {
|
|
11641
11639
|
var formattedContent = htmlContent.replaceAll(EMPTY_PARAGRAPH_REGEX, "\n");
|
|
11642
11640
|
var node = document.createElement("div");
|
|
@@ -11879,9 +11877,8 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11879
11877
|
var questionKind = selectedQuestion.kind;
|
|
11880
11878
|
var independentLabel = INDEPENDENT_LABELS_MAP[questionKind];
|
|
11881
11879
|
if (neetoCist.isPresent(independentLabel)) return independentLabel;
|
|
11882
|
-
var questionLabel = selectedQuestion
|
|
11883
|
-
|
|
11884
|
-
return neetoCist.isPresent(questionLabel) ? neetoCist.truncate(questionLabel, 40) : neetoCist.humanize(questionKind);
|
|
11880
|
+
var questionLabel = fieldWithFallback(selectedQuestion, "label");
|
|
11881
|
+
return neetoCist.truncate(questionLabel, 40);
|
|
11885
11882
|
};
|
|
11886
11883
|
var _useDeleteQuestion = useDeleteQuestion(selectedQuestion === null || selectedQuestion === void 0 ? void 0 : selectedQuestion.formId, selectedLanguage, {
|
|
11887
11884
|
onSuccess: function onSuccess() {
|
|
@@ -11908,13 +11905,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11908
11905
|
}
|
|
11909
11906
|
});
|
|
11910
11907
|
};
|
|
11911
|
-
return /*#__PURE__*/
|
|
11908
|
+
return /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
11912
11909
|
isOpen: isOpen,
|
|
11913
11910
|
onClose: onClose,
|
|
11914
11911
|
isSubmitting: isDeleting,
|
|
11915
11912
|
submitButtonLabel: t("neetoForm.common.delete"),
|
|
11916
11913
|
title: t("neetoForm.questions.deleteAlert.title"),
|
|
11917
|
-
message: neetoCist.isPresent(selectedQuestion) && /*#__PURE__*/
|
|
11914
|
+
message: neetoCist.isPresent(selectedQuestion) && /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
11918
11915
|
i18nKey: "neetoForm.questions.deleteAlert.message",
|
|
11919
11916
|
values: {
|
|
11920
11917
|
count: languagesCount,
|
|
@@ -11953,34 +11950,42 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
11953
11950
|
var selectedLanguageName = (_findBy = neetoCist.findBy({
|
|
11954
11951
|
code: currentLanguage
|
|
11955
11952
|
}, languages)) === null || _findBy === void 0 ? void 0 : _findBy.name;
|
|
11956
|
-
return /*#__PURE__*/
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
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);
|
|
11969
11986
|
}
|
|
11970
|
-
}
|
|
11971
|
-
})
|
|
11972
|
-
isOpen: isUnsavedChangesAlertOpen,
|
|
11973
|
-
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11974
|
-
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11975
|
-
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11976
|
-
onClose: function onClose() {
|
|
11977
|
-
return setIsUnsavedChangesAlertOpen(false);
|
|
11978
|
-
},
|
|
11979
|
-
onSubmit: function onSubmit() {
|
|
11980
|
-
onChange(selectedLanguage);
|
|
11981
|
-
setIsUnsavedChangesAlertOpen(false);
|
|
11982
|
-
}
|
|
11983
|
-
}));
|
|
11987
|
+
})]
|
|
11988
|
+
});
|
|
11984
11989
|
};
|
|
11985
11990
|
|
|
11986
11991
|
var Overview = function Overview(_ref) {
|
|
@@ -11990,56 +11995,65 @@ var Overview = function Overview(_ref) {
|
|
|
11990
11995
|
selectedLanguage = _ref.selectedLanguage,
|
|
11991
11996
|
onLanguageChange = _ref.onLanguageChange,
|
|
11992
11997
|
additionalActionOptions = _ref.additionalActionOptions;
|
|
11993
|
-
return /*#__PURE__*/
|
|
11994
|
-
className: "mb-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
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
|
+
});
|
|
12022
12032
|
};
|
|
12023
12033
|
|
|
12024
12034
|
var _excluded$c = ["size", "color"],
|
|
12025
12035
|
_excluded2 = ["size", "color"],
|
|
12026
12036
|
_excluded3 = ["size", "color"],
|
|
12027
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; }
|
|
12028
12040
|
var BadSmiley = function BadSmiley(props) {
|
|
12029
12041
|
var size = props.size,
|
|
12030
12042
|
color = props.color,
|
|
12031
12043
|
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
12032
|
-
return /*#__PURE__*/
|
|
12044
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12033
12045
|
fill: "none",
|
|
12034
12046
|
height: size,
|
|
12035
12047
|
viewBox: "0 0 48 48",
|
|
12036
12048
|
width: size
|
|
12037
|
-
}, other),
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
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
|
+
})]
|
|
12043
12057
|
}));
|
|
12044
12058
|
};
|
|
12045
12059
|
BadSmiley.defaultProps = {
|
|
@@ -12051,17 +12065,19 @@ var OkaySmiley = function OkaySmiley(props) {
|
|
|
12051
12065
|
var size = props.size,
|
|
12052
12066
|
color = props.color,
|
|
12053
12067
|
other = _objectWithoutProperties$1(props, _excluded2);
|
|
12054
|
-
return /*#__PURE__*/
|
|
12068
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12055
12069
|
fill: "none",
|
|
12056
12070
|
height: size,
|
|
12057
12071
|
viewBox: "0 0 48 48",
|
|
12058
12072
|
width: size
|
|
12059
|
-
}, other),
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
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
|
+
})]
|
|
12065
12081
|
}));
|
|
12066
12082
|
};
|
|
12067
12083
|
OkaySmiley.defaultProps = {
|
|
@@ -12073,17 +12089,19 @@ var GoodSmiley = function GoodSmiley(props) {
|
|
|
12073
12089
|
var size = props.size,
|
|
12074
12090
|
color = props.color,
|
|
12075
12091
|
other = _objectWithoutProperties$1(props, _excluded3);
|
|
12076
|
-
return /*#__PURE__*/
|
|
12092
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12077
12093
|
fill: "none",
|
|
12078
12094
|
height: size,
|
|
12079
12095
|
viewBox: "0 0 48 48",
|
|
12080
12096
|
width: size
|
|
12081
|
-
}, other),
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
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
|
+
})]
|
|
12087
12105
|
}));
|
|
12088
12106
|
};
|
|
12089
12107
|
GoodSmiley.defaultProps = {
|
|
@@ -12095,18 +12113,31 @@ var Drag = function Drag(props) {
|
|
|
12095
12113
|
var size = props.size,
|
|
12096
12114
|
color = props.color,
|
|
12097
12115
|
other = _objectWithoutProperties$1(props, _excluded4);
|
|
12098
|
-
return /*#__PURE__*/
|
|
12116
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12099
12117
|
fill: "none",
|
|
12100
12118
|
height: size,
|
|
12101
12119
|
viewBox: "0 0 24 24",
|
|
12102
12120
|
width: size
|
|
12103
|
-
}, other),
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
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
|
+
})]
|
|
12110
12141
|
}));
|
|
12111
12142
|
};
|
|
12112
12143
|
Drag.defaultProps = {
|
|
@@ -12140,11 +12171,6 @@ var Card = function Card(_ref) {
|
|
|
12140
12171
|
onEdit = _ref.onEdit,
|
|
12141
12172
|
onClone = _ref.onClone,
|
|
12142
12173
|
onDelete = _ref.onDelete;
|
|
12143
|
-
var _useState = React$2.useState(false),
|
|
12144
|
-
_useState2 = _slicedToArray$3(_useState, 2),
|
|
12145
|
-
isTooltipEnabled = _useState2[0],
|
|
12146
|
-
setIsTooltipEnabled = _useState2[1];
|
|
12147
|
-
var questionLabelRef = React$2.useRef(null);
|
|
12148
12174
|
var _useTranslation = reactI18next.useTranslation(),
|
|
12149
12175
|
t = _useTranslation.t;
|
|
12150
12176
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
@@ -12152,61 +12178,59 @@ var Card = function Card(_ref) {
|
|
|
12152
12178
|
item: question
|
|
12153
12179
|
}),
|
|
12154
12180
|
kind = _getActiveKindDetails.kind,
|
|
12155
|
-
label = _getActiveKindDetails.label,
|
|
12156
12181
|
isSingular = _getActiveKindDetails.isSingular;
|
|
12182
|
+
var label = fieldWithFallback(question, "label");
|
|
12157
12183
|
var questionLabel = isRichTextQuestion(kind) ? htmlToPlainText(label) : label;
|
|
12158
|
-
|
|
12159
|
-
var element = questionLabelRef.current;
|
|
12160
|
-
if (neetoCist.isNotPresent(element)) return;
|
|
12161
|
-
setIsTooltipEnabled(isElementOverflowing(element));
|
|
12162
|
-
}, [questionLabel]);
|
|
12163
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12184
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12164
12185
|
"data-cy": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
|
|
12165
|
-
className: classnames__default["default"]("neeto-ui-rounded neeto-ui-border-gray-300 flex h-10 w-full items-center justify-between border p-2", {
|
|
12166
|
-
"neeto-ui-border-primary-500
|
|
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", {
|
|
12187
|
+
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
12167
12188
|
}),
|
|
12168
12189
|
onClick: function onClick() {
|
|
12169
12190
|
return onSelect(question);
|
|
12170
|
-
}
|
|
12171
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12172
|
-
className: "flex items-center justify-between space-x-2"
|
|
12173
|
-
}, /*#__PURE__*/React__default["default"].createElement(Drag, {
|
|
12174
|
-
className: "flex-shrink-0 cursor-move"
|
|
12175
|
-
}), /*#__PURE__*/React__default["default"].createElement(Tooltip__default["default"], {
|
|
12176
|
-
content: questionLabel,
|
|
12177
|
-
disabled: !isTooltipEnabled,
|
|
12178
|
-
position: "top"
|
|
12179
|
-
}, /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
|
|
12180
|
-
className: "max-w-md truncate",
|
|
12181
|
-
lineHeight: "neeto-ui-leading-tight",
|
|
12182
|
-
ref: questionLabelRef,
|
|
12183
|
-
style: "h5",
|
|
12184
|
-
weight: "neeto-ui-font-medium"
|
|
12185
|
-
}, questionLabel))), /*#__PURE__*/React__default["default"].createElement(MoreDropdown__default["default"], {
|
|
12186
|
-
dropdownProps: {
|
|
12187
|
-
strategy: "fixed"
|
|
12188
12191
|
},
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12199
|
-
|
|
12200
|
-
}, {
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
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
|
+
});
|
|
12208
12230
|
};
|
|
12209
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; }
|
|
12210
12234
|
var Questions = function Questions(_ref) {
|
|
12211
12235
|
var questions = _ref.questions,
|
|
12212
12236
|
isDeletable = _ref.isDeletable,
|
|
@@ -12217,39 +12241,42 @@ var Questions = function Questions(_ref) {
|
|
|
12217
12241
|
onClone = _ref.onClone,
|
|
12218
12242
|
onDelete = _ref.onDelete,
|
|
12219
12243
|
onSelect = _ref.onSelect;
|
|
12220
|
-
return /*#__PURE__*/
|
|
12221
|
-
droppableId: "droppable"
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
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
|
+
}
|
|
12253
12280
|
});
|
|
12254
12281
|
};
|
|
12255
12282
|
|
|
@@ -12330,8 +12357,8 @@ var arrayHelpers = {
|
|
|
12330
12357
|
moveItem: moveItem
|
|
12331
12358
|
};
|
|
12332
12359
|
|
|
12333
|
-
function ownKeys$
|
|
12334
|
-
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; }
|
|
12335
12362
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
12336
12363
|
var fieldCodes = ramda.pluck("fieldCode", neetoCist.filterBy({
|
|
12337
12364
|
kind: type
|
|
@@ -12367,7 +12394,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
|
|
|
12367
12394
|
var nextItems = _toConsumableArray$1(items);
|
|
12368
12395
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
12369
12396
|
var orderedItems = nextItems.map(function (item, index) {
|
|
12370
|
-
return _objectSpread$
|
|
12397
|
+
return _objectSpread$z(_objectSpread$z({}, item), {}, {
|
|
12371
12398
|
displayOrder: index
|
|
12372
12399
|
});
|
|
12373
12400
|
});
|
|
@@ -12381,7 +12408,7 @@ var createFieldData = function createFieldData(_ref3) {
|
|
|
12381
12408
|
_ref3$isRequired = _ref3.isRequired,
|
|
12382
12409
|
isRequired = _ref3$isRequired === void 0 ? undefined : _ref3$isRequired,
|
|
12383
12410
|
questions = _ref3.questions;
|
|
12384
|
-
return _objectSpread$
|
|
12411
|
+
return _objectSpread$z(_objectSpread$z({}, defaults), {}, {
|
|
12385
12412
|
metadata: metadata,
|
|
12386
12413
|
isRequired: isRequired,
|
|
12387
12414
|
kind: type,
|
|
@@ -12398,14 +12425,14 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
12398
12425
|
}, questionKinds);
|
|
12399
12426
|
var isRequired = item.isRequired,
|
|
12400
12427
|
kind = item.kind,
|
|
12401
|
-
label = item.label,
|
|
12402
12428
|
optionsAttributes = item.optionsAttributes;
|
|
12429
|
+
var label = fieldWithFallback(item, "label");
|
|
12403
12430
|
var defaultAttributeNames = ramda.keys(questionKind.defaults || {});
|
|
12404
12431
|
var defaultAttributes = ramda.pick(defaultAttributeNames, item);
|
|
12405
12432
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : i18next.t("neetoForm.common.clonedElementLabel", {
|
|
12406
12433
|
label: label
|
|
12407
12434
|
});
|
|
12408
|
-
return _objectSpread$
|
|
12435
|
+
return _objectSpread$z(_objectSpread$z({}, defaultAttributes), {}, {
|
|
12409
12436
|
isRequired: isRequired,
|
|
12410
12437
|
kind: kind,
|
|
12411
12438
|
label: newQuestionLabel,
|
|
@@ -12463,11 +12490,13 @@ const SvgNoQuestions = props => /*#__PURE__*/React__namespace.createElement("svg
|
|
|
12463
12490
|
|
|
12464
12491
|
var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
12465
12492
|
var children = _ref.children;
|
|
12466
|
-
return /*#__PURE__*/
|
|
12467
|
-
className: "flex h-full flex-col items-center justify-center py-8"
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
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
|
+
});
|
|
12471
12500
|
};
|
|
12472
12501
|
|
|
12473
12502
|
var NAME = QUESTION_TYPES.NAME,
|
|
@@ -12503,6 +12532,8 @@ var INITIAL_VALUES = {
|
|
|
12503
12532
|
};
|
|
12504
12533
|
|
|
12505
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; }
|
|
12506
12537
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
12507
12538
|
var label = _ref.label,
|
|
12508
12539
|
name = _ref.name,
|
|
@@ -12518,7 +12549,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
12518
12549
|
var end = element.value.length;
|
|
12519
12550
|
element.setSelectionRange(end, end);
|
|
12520
12551
|
};
|
|
12521
|
-
return /*#__PURE__*/
|
|
12552
|
+
return /*#__PURE__*/jsxRuntime.jsx(Textarea__default["default"], _objectSpread$y({
|
|
12522
12553
|
label: label,
|
|
12523
12554
|
name: name,
|
|
12524
12555
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -12536,19 +12567,23 @@ var Block = function Block(_ref) {
|
|
|
12536
12567
|
var title = _ref.title,
|
|
12537
12568
|
children = _ref.children,
|
|
12538
12569
|
dataCy = _ref.dataCy;
|
|
12539
|
-
return /*#__PURE__*/
|
|
12570
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12540
12571
|
className: "mt-4 space-y-4",
|
|
12541
|
-
"data-cy": dataCy
|
|
12542
|
-
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
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
|
+
});
|
|
12552
12587
|
};
|
|
12553
12588
|
|
|
12554
12589
|
var useUpdateEditorContent = function useUpdateEditorContent(_ref) {
|
|
@@ -12638,33 +12673,37 @@ var Editor = function Editor() {
|
|
|
12638
12673
|
initialValue: initialValue,
|
|
12639
12674
|
fieldCode: fieldCode
|
|
12640
12675
|
});
|
|
12641
|
-
return /*#__PURE__*/
|
|
12642
|
-
className: "w-full cursor-auto"
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
|
|
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
|
+
});
|
|
12655
12691
|
};
|
|
12656
12692
|
|
|
12657
12693
|
var RequiredSwitch = reactUtils.withT(function (_ref) {
|
|
12658
12694
|
var t = _ref.t;
|
|
12659
|
-
return /*#__PURE__*/
|
|
12660
|
-
className: "w-full"
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12664
|
-
|
|
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
|
+
});
|
|
12665
12702
|
});
|
|
12666
12703
|
|
|
12667
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; }
|
|
12668
12707
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
12669
12708
|
var maxLength = _ref.maxLength,
|
|
12670
12709
|
props = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
@@ -12678,38 +12717,40 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
12678
12717
|
}
|
|
12679
12718
|
}, [value, maxLength, setValue]);
|
|
12680
12719
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
12681
|
-
return /*#__PURE__*/
|
|
12720
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], _objectSpread$x(_objectSpread$x({}, props), shouldShowMaxLength && {
|
|
12682
12721
|
maxLength: maxLength
|
|
12683
12722
|
}));
|
|
12684
12723
|
};
|
|
12685
12724
|
|
|
12686
12725
|
var FieldCode = reactUtils.withT(function (_ref) {
|
|
12687
12726
|
var t = _ref.t;
|
|
12688
|
-
return /*#__PURE__*/
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12707
|
-
|
|
12708
|
-
|
|
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
|
+
}
|
|
12709
12750
|
}
|
|
12710
12751
|
}
|
|
12711
|
-
}
|
|
12712
|
-
})
|
|
12752
|
+
})
|
|
12753
|
+
});
|
|
12713
12754
|
});
|
|
12714
12755
|
|
|
12715
12756
|
var Form$1 = function Form(_ref) {
|
|
@@ -12767,43 +12808,50 @@ var Form$1 = function Form(_ref) {
|
|
|
12767
12808
|
setErrors({});
|
|
12768
12809
|
setTouched({});
|
|
12769
12810
|
};
|
|
12770
|
-
return /*#__PURE__*/
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
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
|
+
});
|
|
12807
12855
|
};
|
|
12808
12856
|
|
|
12809
12857
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
@@ -12846,8 +12894,8 @@ var formValidationSchema = yup__namespace.object().shape({
|
|
|
12846
12894
|
});
|
|
12847
12895
|
|
|
12848
12896
|
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs"];
|
|
12849
|
-
function ownKeys$
|
|
12850
|
-
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; }
|
|
12851
12899
|
var Add = function Add(_ref) {
|
|
12852
12900
|
var question = _ref.question,
|
|
12853
12901
|
onClose = _ref.onClose,
|
|
@@ -12876,7 +12924,7 @@ var Add = function Add(_ref) {
|
|
|
12876
12924
|
isCreating = _useCreateQuestion.isLoading;
|
|
12877
12925
|
var handleSubmit = function handleSubmit(values) {
|
|
12878
12926
|
var displayOrder = question ? question.displayOrder + 1 : questions.length;
|
|
12879
|
-
createQuestion(_objectSpread$
|
|
12927
|
+
createQuestion(_objectSpread$w({
|
|
12880
12928
|
language: language,
|
|
12881
12929
|
neetoFormQuestion: ramda.mergeLeft({
|
|
12882
12930
|
displayOrder: displayOrder
|
|
@@ -12891,29 +12939,39 @@ var Add = function Add(_ref) {
|
|
|
12891
12939
|
}
|
|
12892
12940
|
});
|
|
12893
12941
|
};
|
|
12894
|
-
return /*#__PURE__*/
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
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
|
+
});
|
|
12912
12970
|
};
|
|
12913
12971
|
|
|
12914
12972
|
var _excluded$8 = ["question", "onClose"];
|
|
12915
|
-
function ownKeys$
|
|
12916
|
-
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; }
|
|
12917
12975
|
var Edit = function Edit(_ref) {
|
|
12918
12976
|
var question = _ref.question,
|
|
12919
12977
|
onClose = _ref.onClose,
|
|
@@ -12949,25 +13007,35 @@ var Edit = function Edit(_ref) {
|
|
|
12949
13007
|
}
|
|
12950
13008
|
});
|
|
12951
13009
|
};
|
|
12952
|
-
return /*#__PURE__*/
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
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
|
+
});
|
|
12971
13039
|
};
|
|
12972
13040
|
|
|
12973
13041
|
var FileGroup = function FileGroup(_ref) {
|
|
@@ -12975,7 +13043,7 @@ var FileGroup = function FileGroup(_ref) {
|
|
|
12975
13043
|
label = _ref.label,
|
|
12976
13044
|
checked = _ref.checked,
|
|
12977
13045
|
handleAllowedFileTypesChange = _ref.handleAllowedFileTypesChange;
|
|
12978
|
-
return /*#__PURE__*/
|
|
13046
|
+
return /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], {
|
|
12979
13047
|
checked: checked,
|
|
12980
13048
|
label: label,
|
|
12981
13049
|
name: name,
|
|
@@ -13021,34 +13089,40 @@ var FileUpload$1 = function FileUpload() {
|
|
|
13021
13089
|
allowedFileTypes: allowedFileTypes
|
|
13022
13090
|
}));
|
|
13023
13091
|
};
|
|
13024
|
-
return /*#__PURE__*/
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
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
|
+
});
|
|
13048
13122
|
};
|
|
13049
13123
|
|
|
13050
|
-
function ownKeys$
|
|
13051
|
-
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; }
|
|
13052
13126
|
var defaultConfig = {
|
|
13053
13127
|
strict: true,
|
|
13054
13128
|
matchKey: "value"
|
|
@@ -13056,7 +13130,7 @@ var defaultConfig = {
|
|
|
13056
13130
|
var findOptionByValue = function findOptionByValue(value) {
|
|
13057
13131
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
13058
13132
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13059
|
-
var configObject = _objectSpread$
|
|
13133
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
13060
13134
|
var matchKey = configObject.matchKey,
|
|
13061
13135
|
strict = configObject.strict;
|
|
13062
13136
|
return options.find(function (option) {
|
|
@@ -13070,7 +13144,7 @@ var filterOptionsByValues = function filterOptionsByValues() {
|
|
|
13070
13144
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13071
13145
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
13072
13146
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13073
|
-
var configObject = _objectSpread$
|
|
13147
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
13074
13148
|
var matchKey = configObject.matchKey,
|
|
13075
13149
|
strict = configObject.strict;
|
|
13076
13150
|
return options.filter(function (option) {
|
|
@@ -13088,7 +13162,7 @@ var destroyFromList = function destroyFromList(items, index) {
|
|
|
13088
13162
|
var nextItems = _toConsumableArray$1(items);
|
|
13089
13163
|
nextItems.splice(index, 1);
|
|
13090
13164
|
if (itemToRemove.id) {
|
|
13091
|
-
nextItems.push(_objectSpread$
|
|
13165
|
+
nextItems.push(_objectSpread$u(_objectSpread$u({}, itemToRemove), {}, {
|
|
13092
13166
|
_destroy: true
|
|
13093
13167
|
}));
|
|
13094
13168
|
}
|
|
@@ -13114,6 +13188,8 @@ var formHelpers = {
|
|
|
13114
13188
|
pushToList: pushToList
|
|
13115
13189
|
};
|
|
13116
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; }
|
|
13117
13193
|
var Options = function Options(_ref) {
|
|
13118
13194
|
var questionProps = _ref.questionProps;
|
|
13119
13195
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -13132,88 +13208,106 @@ var Options = function Options(_ref) {
|
|
|
13132
13208
|
var nextOptions = formHelpers.destroyFromList(optionsAttributes, index);
|
|
13133
13209
|
setOptionsAttributes(nextOptions);
|
|
13134
13210
|
};
|
|
13135
|
-
return /*#__PURE__*/
|
|
13136
|
-
className: "w-full"
|
|
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
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
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
|
+
});
|
|
13186
13270
|
};
|
|
13187
13271
|
|
|
13188
13272
|
var RatingItem = function RatingItem(_ref) {
|
|
13189
13273
|
var children = _ref.children;
|
|
13190
|
-
return /*#__PURE__*/
|
|
13191
|
-
className: "flex w-16 flex-col items-center gap-3"
|
|
13192
|
-
|
|
13274
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13275
|
+
className: "flex w-16 flex-col items-center gap-3",
|
|
13276
|
+
children: children
|
|
13277
|
+
});
|
|
13193
13278
|
};
|
|
13194
13279
|
var Rating$2 = function Rating() {
|
|
13195
|
-
return /*#__PURE__*/
|
|
13196
|
-
className: "flex flex-col"
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
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
|
+
});
|
|
13217
13311
|
};
|
|
13218
13312
|
|
|
13219
13313
|
var StarRating$2 = function StarRating() {
|
|
@@ -13226,42 +13320,48 @@ var StarRating$2 = function StarRating() {
|
|
|
13226
13320
|
iconType = _useField2[0].value;
|
|
13227
13321
|
_useField2[1];
|
|
13228
13322
|
var setIconType = _useField2[2].setValue;
|
|
13229
|
-
return /*#__PURE__*/
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
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
|
+
});
|
|
13265
13365
|
};
|
|
13266
13366
|
|
|
13267
13367
|
var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
@@ -13282,15 +13382,15 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
13282
13382
|
case CHECKBOX:
|
|
13283
13383
|
case RADIO:
|
|
13284
13384
|
case DROPDOWN:
|
|
13285
|
-
return /*#__PURE__*/
|
|
13385
|
+
return /*#__PURE__*/jsxRuntime.jsx(Options, {
|
|
13286
13386
|
questionProps: questionProps
|
|
13287
13387
|
});
|
|
13288
13388
|
case RATING:
|
|
13289
|
-
return /*#__PURE__*/
|
|
13389
|
+
return /*#__PURE__*/jsxRuntime.jsx(Rating$2, {});
|
|
13290
13390
|
case STAR_RATING:
|
|
13291
|
-
return /*#__PURE__*/
|
|
13391
|
+
return /*#__PURE__*/jsxRuntime.jsx(StarRating$2, {});
|
|
13292
13392
|
case FILE_UPLOAD:
|
|
13293
|
-
return /*#__PURE__*/
|
|
13393
|
+
return /*#__PURE__*/jsxRuntime.jsx(FileUpload$1, {});
|
|
13294
13394
|
default:
|
|
13295
13395
|
return null;
|
|
13296
13396
|
}
|
|
@@ -13323,8 +13423,8 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
13323
13423
|
};
|
|
13324
13424
|
|
|
13325
13425
|
var _excluded$7 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
13326
|
-
function ownKeys$
|
|
13327
|
-
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; }
|
|
13328
13428
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
13329
13429
|
var isOpen = _ref.isOpen,
|
|
13330
13430
|
onClose = _ref.onClose,
|
|
@@ -13334,16 +13434,17 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
13334
13434
|
props = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13335
13435
|
var initialFocusRef = React$2.useRef(null);
|
|
13336
13436
|
var Component = resolveActionComponent(action);
|
|
13337
|
-
return /*#__PURE__*/
|
|
13437
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"], {
|
|
13338
13438
|
initialFocusRef: initialFocusRef,
|
|
13339
13439
|
isOpen: isOpen,
|
|
13340
|
-
onClose: onClose
|
|
13341
|
-
}, /*#__PURE__*/React__default["default"].createElement(Component, _objectSpread$i({
|
|
13342
|
-
availableQuestionKinds: availableQuestionKinds,
|
|
13343
|
-
initialFocusRef: initialFocusRef,
|
|
13344
13440
|
onClose: onClose,
|
|
13345
|
-
|
|
13346
|
-
|
|
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
|
+
});
|
|
13347
13448
|
};
|
|
13348
13449
|
|
|
13349
13450
|
var AddQuestion = reactUtils.withT(function (_ref) {
|
|
@@ -13351,23 +13452,26 @@ var AddQuestion = reactUtils.withT(function (_ref) {
|
|
|
13351
13452
|
onAdd = _ref.onAdd,
|
|
13352
13453
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
13353
13454
|
isDisabled = _ref.isDisabled;
|
|
13354
|
-
return /*#__PURE__*/
|
|
13455
|
+
return /*#__PURE__*/jsxRuntime.jsx(Tooltip__default["default"], {
|
|
13355
13456
|
disabled: !isDisabled,
|
|
13356
13457
|
position: "top",
|
|
13357
|
-
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
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
|
+
});
|
|
13366
13470
|
});
|
|
13367
13471
|
|
|
13368
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"];
|
|
13369
|
-
function ownKeys$
|
|
13370
|
-
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; }
|
|
13371
13475
|
var Form = function Form(_ref) {
|
|
13372
13476
|
var questionKinds = _ref.questionKinds,
|
|
13373
13477
|
onValueChange = _ref.onValueChange,
|
|
@@ -13461,7 +13565,7 @@ var Form = function Form(_ref) {
|
|
|
13461
13565
|
questions: questions
|
|
13462
13566
|
});
|
|
13463
13567
|
var displayOrder = selectedQuestion.displayOrder + 1;
|
|
13464
|
-
var payload = _objectSpread$
|
|
13568
|
+
var payload = _objectSpread$r({
|
|
13465
13569
|
language: selectedLanguage,
|
|
13466
13570
|
neetoFormQuestion: ramda.mergeLeft({
|
|
13467
13571
|
displayOrder: displayOrder
|
|
@@ -13509,92 +13613,102 @@ var Form = function Form(_ref) {
|
|
|
13509
13613
|
richTextFieldsToReset: ramda.pluck("fieldCode", richTextQuestions)
|
|
13510
13614
|
});
|
|
13511
13615
|
};
|
|
13512
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
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
|
+
});
|
|
13594
13708
|
};
|
|
13595
13709
|
|
|
13596
|
-
function ownKeys$
|
|
13597
|
-
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; }
|
|
13598
13712
|
var BuildForm = function BuildForm(_ref) {
|
|
13599
13713
|
var id = _ref.id,
|
|
13600
13714
|
onUpdate = _ref.onUpdate,
|
|
@@ -13637,7 +13751,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13637
13751
|
onLanguageChange = _ref$onLanguageChange === void 0 ? neetoCist.noop : _ref$onLanguageChange,
|
|
13638
13752
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
13639
13753
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
13640
|
-
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern
|
|
13754
|
+
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
13755
|
+
className = _ref.className;
|
|
13641
13756
|
var queryClient = reactQuery.useQueryClient();
|
|
13642
13757
|
var _useReorderQuestions = useReorderQuestions(id, {
|
|
13643
13758
|
onSuccess: utils.showThumbsUpToastr
|
|
@@ -13671,9 +13786,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13671
13786
|
questions = _useFetchQuestions$da2.questions,
|
|
13672
13787
|
isLoading = _useFetchQuestions.isLoading;
|
|
13673
13788
|
if (isLoading || showLoader && isQuestionsLoading) {
|
|
13674
|
-
return /*#__PURE__*/
|
|
13675
|
-
className: "flex h-full w-full items-center justify-center py-6"
|
|
13676
|
-
|
|
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
|
+
});
|
|
13677
13793
|
}
|
|
13678
13794
|
var handleSubmit = function handleSubmit(_ref2, _ref3) {
|
|
13679
13795
|
var questions = _ref2.questions;
|
|
@@ -13709,57 +13825,62 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13709
13825
|
var defaultQuestionKinds = allowAdditionalGuests ? QUESTION_KINDS : neetoCist.removeBy({
|
|
13710
13826
|
type: QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
13711
13827
|
}, QUESTION_KINDS);
|
|
13712
|
-
return /*#__PURE__*/
|
|
13713
|
-
className: "relative
|
|
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
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
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
|
+
}));
|
|
13753
13871
|
}
|
|
13754
|
-
})
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
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
|
+
});
|
|
13758
13877
|
};
|
|
13759
13878
|
|
|
13760
13879
|
var NeetoFormProvider = function NeetoFormProvider(_ref) {
|
|
13761
13880
|
var children = _ref.children;
|
|
13762
|
-
return /*#__PURE__*/
|
|
13881
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
13882
|
+
children: children
|
|
13883
|
+
});
|
|
13763
13884
|
};
|
|
13764
13885
|
|
|
13765
13886
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -14145,25 +14266,29 @@ var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
|
14145
14266
|
var Spinner = function Spinner(_ref) {
|
|
14146
14267
|
var _ref$size = _ref.size,
|
|
14147
14268
|
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
14148
|
-
return /*#__PURE__*/
|
|
14149
|
-
className: "neeto-form-engine-spinner"
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
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
|
+
});
|
|
14163
14286
|
};
|
|
14164
14287
|
var Spinner$1 = /*#__PURE__*/React__default["default"].memo(Spinner);
|
|
14165
14288
|
|
|
14166
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; }
|
|
14167
14292
|
var Button = function Button(_ref) {
|
|
14168
14293
|
var label = _ref.label,
|
|
14169
14294
|
_ref$loading = _ref.loading,
|
|
@@ -14173,19 +14298,23 @@ var Button = function Button(_ref) {
|
|
|
14173
14298
|
_ref$className = _ref.className,
|
|
14174
14299
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
14175
14300
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14176
|
-
return /*#__PURE__*/
|
|
14301
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$p(_objectSpread$p({
|
|
14177
14302
|
className: classnames__default["default"]("neeto-form-engine-button", className)
|
|
14178
|
-
}, otherProps),
|
|
14303
|
+
}, otherProps), {}, {
|
|
14304
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoader, {}), success && /*#__PURE__*/jsxRuntime.jsx(Success$2, {}), label]
|
|
14305
|
+
}));
|
|
14179
14306
|
};
|
|
14180
14307
|
var ButtonLoader = function ButtonLoader() {
|
|
14181
|
-
return /*#__PURE__*/
|
|
14182
|
-
className: "neeto-form-engine-button__loader"
|
|
14183
|
-
|
|
14308
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14309
|
+
className: "neeto-form-engine-button__loader",
|
|
14310
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner$1, {})
|
|
14311
|
+
});
|
|
14184
14312
|
};
|
|
14185
14313
|
var Success$2 = function Success() {
|
|
14186
|
-
return /*#__PURE__*/
|
|
14187
|
-
className: "neeto-form-engine-button__success"
|
|
14188
|
-
|
|
14314
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14315
|
+
className: "neeto-form-engine-button__success",
|
|
14316
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Check, {})
|
|
14317
|
+
});
|
|
14189
14318
|
};
|
|
14190
14319
|
|
|
14191
14320
|
var CALLOUT_STYLES = {
|
|
@@ -14213,29 +14342,36 @@ var Callout = function Callout(_ref) {
|
|
|
14213
14342
|
primaryButton = callout.primaryButton,
|
|
14214
14343
|
secondaryButton = callout.secondaryButton;
|
|
14215
14344
|
if (!isVisible) return null;
|
|
14216
|
-
return /*#__PURE__*/
|
|
14345
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14217
14346
|
className: classnames__default["default"]("neeto-form-engine-callout", _defineProperty$6({
|
|
14218
14347
|
"neeto-form-engine-callout--error": style === CALLOUT_STYLES.ERROR,
|
|
14219
14348
|
"neeto-form-engine-callout--info": style === CALLOUT_STYLES.INFO,
|
|
14220
14349
|
"neeto-form-engine-callout--static": position === CALLOUT_POSITIONS.STATIC,
|
|
14221
14350
|
"neeto-form-engine-callout--absolute": position === CALLOUT_POSITIONS.ABSOLUTE
|
|
14222
|
-
}, className, className))
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
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
|
+
});
|
|
14239
14375
|
};
|
|
14240
14376
|
|
|
14241
14377
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
@@ -15933,9 +16069,9 @@ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o
|
|
|
15933
16069
|
|
|
15934
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; }
|
|
15935
16071
|
|
|
15936
|
-
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; }
|
|
15937
16073
|
|
|
15938
|
-
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; }
|
|
15939
16075
|
|
|
15940
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; }
|
|
15941
16077
|
var DEFAULT_OPTIONS = {
|
|
@@ -15962,7 +16098,7 @@ var DEFAULT_OPTIONS = {
|
|
|
15962
16098
|
function formatNumber(input, format, options, metadata) {
|
|
15963
16099
|
// Apply default options.
|
|
15964
16100
|
if (options) {
|
|
15965
|
-
options = _objectSpread$
|
|
16101
|
+
options = _objectSpread$o(_objectSpread$o({}, DEFAULT_OPTIONS), options);
|
|
15966
16102
|
} else {
|
|
15967
16103
|
options = DEFAULT_OPTIONS;
|
|
15968
16104
|
}
|
|
@@ -16107,9 +16243,9 @@ function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry,
|
|
|
16107
16243
|
}
|
|
16108
16244
|
}
|
|
16109
16245
|
|
|
16110
|
-
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; }
|
|
16111
16247
|
|
|
16112
|
-
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; }
|
|
16113
16249
|
|
|
16114
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; }
|
|
16115
16251
|
|
|
@@ -16221,7 +16357,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
16221
16357
|
}, {
|
|
16222
16358
|
key: "format",
|
|
16223
16359
|
value: function format(_format, options) {
|
|
16224
|
-
return formatNumber(this, _format, options ? _objectSpread$
|
|
16360
|
+
return formatNumber(this, _format, options ? _objectSpread$n(_objectSpread$n({}, options), {}, {
|
|
16225
16361
|
v2: true
|
|
16226
16362
|
}) : {
|
|
16227
16363
|
v2: true
|
|
@@ -17264,20 +17400,20 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
17264
17400
|
};
|
|
17265
17401
|
}
|
|
17266
17402
|
|
|
17267
|
-
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; }
|
|
17268
17404
|
|
|
17269
|
-
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; }
|
|
17270
17406
|
|
|
17271
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; }
|
|
17272
17408
|
function parsePhoneNumberWithError$2(text, options, metadata) {
|
|
17273
|
-
return parse$1(text, _objectSpread$
|
|
17409
|
+
return parse$1(text, _objectSpread$m(_objectSpread$m({}, options), {}, {
|
|
17274
17410
|
v2: true
|
|
17275
17411
|
}), metadata);
|
|
17276
17412
|
}
|
|
17277
17413
|
|
|
17278
|
-
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; }
|
|
17279
17415
|
|
|
17280
|
-
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; }
|
|
17281
17417
|
|
|
17282
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; }
|
|
17283
17419
|
|
|
@@ -17325,7 +17461,7 @@ function normalizeArguments(args) {
|
|
|
17325
17461
|
}
|
|
17326
17462
|
|
|
17327
17463
|
if (arg_2) {
|
|
17328
|
-
options = _objectSpread$
|
|
17464
|
+
options = _objectSpread$l({
|
|
17329
17465
|
defaultCountry: arg_2
|
|
17330
17466
|
}, options);
|
|
17331
17467
|
}
|
|
@@ -17386,8 +17522,8 @@ var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
|
17386
17522
|
|
|
17387
17523
|
var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
17388
17524
|
var _fieldKindValidatorMa;
|
|
17389
|
-
function ownKeys$
|
|
17390
|
-
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; }
|
|
17391
17527
|
yup__namespace.addMethod(yup__namespace.array, "unique", function () {
|
|
17392
17528
|
var field, message;
|
|
17393
17529
|
if (arguments.length > 1) {
|
|
@@ -17536,7 +17672,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17536
17672
|
return function (value) {
|
|
17537
17673
|
if (!(kind in fieldKindValidatorMap)) return;
|
|
17538
17674
|
var validator = fieldKindValidatorMap[kind];
|
|
17539
|
-
var schema = customValidator || validator(_objectSpread$
|
|
17675
|
+
var schema = customValidator || validator(_objectSpread$k({
|
|
17540
17676
|
kind: kind,
|
|
17541
17677
|
label: label,
|
|
17542
17678
|
isRequired: isRequired
|
|
@@ -17573,7 +17709,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17573
17709
|
};
|
|
17574
17710
|
|
|
17575
17711
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
17576
|
-
var
|
|
17712
|
+
var _jsx2;
|
|
17577
17713
|
var question = _ref.question,
|
|
17578
17714
|
customValidator = _ref.customValidator;
|
|
17579
17715
|
var name = question.id,
|
|
@@ -17602,31 +17738,33 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
17602
17738
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
17603
17739
|
isInputVisible = _useState2[0],
|
|
17604
17740
|
setIsInputVisible = _useState2[1];
|
|
17605
|
-
return /*#__PURE__*/
|
|
17606
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
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
|
+
});
|
|
17626
17764
|
};
|
|
17627
17765
|
|
|
17628
|
-
function ownKeys$
|
|
17629
|
-
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; }
|
|
17630
17768
|
var ConditionField = function ConditionField(_ref) {
|
|
17631
17769
|
var question = _ref.question,
|
|
17632
17770
|
customValidator = _ref.customValidator;
|
|
@@ -17635,30 +17773,31 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17635
17773
|
isRequired = question.isRequired,
|
|
17636
17774
|
nodeId = question.nodeId;
|
|
17637
17775
|
var label = fieldWithFallback(question, "label");
|
|
17638
|
-
return /*#__PURE__*/
|
|
17776
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
17639
17777
|
name: name || nodeId,
|
|
17640
17778
|
validate: validateFieldValue({
|
|
17641
17779
|
kind: kind,
|
|
17642
17780
|
label: label,
|
|
17643
17781
|
isRequired: isRequired,
|
|
17644
17782
|
customValidator: customValidator
|
|
17645
|
-
})
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
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
|
+
}
|
|
17657
17796
|
});
|
|
17658
17797
|
};
|
|
17659
17798
|
|
|
17660
|
-
function ownKeys$
|
|
17661
|
-
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; }
|
|
17662
17801
|
var toEmailValues = function toEmailValues() {
|
|
17663
17802
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17664
17803
|
return values.map(function (value) {
|
|
@@ -17751,7 +17890,7 @@ var generateInitValues = function generateInitValues(_ref7) {
|
|
|
17751
17890
|
var valuesMap = {};
|
|
17752
17891
|
if (initialValues) {
|
|
17753
17892
|
valuesMap = initialValues.reduce(function (acc, answer) {
|
|
17754
|
-
return _objectSpread$
|
|
17893
|
+
return _objectSpread$i(_objectSpread$i({}, acc), {}, _defineProperty$6({}, answer.questionId, {
|
|
17755
17894
|
value: answer.value,
|
|
17756
17895
|
optionIds: answer.optionIds
|
|
17757
17896
|
}));
|
|
@@ -17983,8 +18122,8 @@ var getSelectedRating = function getSelectedRating(value) {
|
|
|
17983
18122
|
};
|
|
17984
18123
|
|
|
17985
18124
|
var _excluded$3 = ["value"];
|
|
17986
|
-
function ownKeys$
|
|
17987
|
-
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; }
|
|
17988
18127
|
dayjs__default["default"].extend(weekOfYear__default["default"]);
|
|
17989
18128
|
dayjs__default["default"].extend(weekday__default["default"]);
|
|
17990
18129
|
dayjs__default["default"].extend(localeData__default["default"]);
|
|
@@ -17999,47 +18138,52 @@ var DateField = function DateField(_ref) {
|
|
|
17999
18138
|
var label = fieldWithFallback(question, "label");
|
|
18000
18139
|
var _QUESTION_KIND$kind$t = QUESTION_KIND[kind.toUpperCase()].type,
|
|
18001
18140
|
type = _QUESTION_KIND$kind$t === void 0 ? "date" : _QUESTION_KIND$kind$t;
|
|
18002
|
-
return /*#__PURE__*/
|
|
18003
|
-
className: "neeto-form-engine-input__wrapper"
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18010
|
-
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
|
|
18016
|
-
|
|
18017
|
-
|
|
18018
|
-
|
|
18019
|
-
|
|
18020
|
-
|
|
18021
|
-
|
|
18022
|
-
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18038
|
-
|
|
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
|
+
});
|
|
18039
18183
|
};
|
|
18040
18184
|
|
|
18041
|
-
function ownKeys$
|
|
18042
|
-
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; }
|
|
18043
18187
|
var EmailField = function EmailField(_ref) {
|
|
18044
18188
|
var question = _ref.question,
|
|
18045
18189
|
customValidator = _ref.customValidator,
|
|
@@ -18068,12 +18212,12 @@ var EmailField = function EmailField(_ref) {
|
|
|
18068
18212
|
setValue = _useField2$2.setValue,
|
|
18069
18213
|
setTouched = _useField2$2.setTouched;
|
|
18070
18214
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
18071
|
-
return /*#__PURE__*/
|
|
18215
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$g(_objectSpread$g({}, _objectSpread$g(_objectSpread$g({
|
|
18072
18216
|
type: type
|
|
18073
18217
|
}, field), {}, {
|
|
18074
18218
|
autoComplete: autoComplete,
|
|
18075
18219
|
label: label
|
|
18076
|
-
}), {
|
|
18220
|
+
})), {}, {
|
|
18077
18221
|
error: touched ? error : "",
|
|
18078
18222
|
name: kind,
|
|
18079
18223
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -19575,9 +19719,9 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
19575
19719
|
|
|
19576
19720
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19577
19721
|
|
|
19578
|
-
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; }
|
|
19579
19723
|
|
|
19580
|
-
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; }
|
|
19581
19725
|
|
|
19582
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; }
|
|
19583
19727
|
|
|
@@ -19613,7 +19757,7 @@ var Dropzone = /*#__PURE__*/React$2.forwardRef(function (_ref, ref) {
|
|
|
19613
19757
|
};
|
|
19614
19758
|
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
19615
19759
|
|
|
19616
|
-
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), {}, {
|
|
19617
19761
|
open: open
|
|
19618
19762
|
})));
|
|
19619
19763
|
});
|
|
@@ -19947,7 +20091,7 @@ var initialState = {
|
|
|
19947
20091
|
function useDropzone() {
|
|
19948
20092
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19949
20093
|
|
|
19950
|
-
var _defaultProps$options = _objectSpread$
|
|
20094
|
+
var _defaultProps$options = _objectSpread$f(_objectSpread$f({}, defaultProps), options),
|
|
19951
20095
|
accept = _defaultProps$options.accept,
|
|
19952
20096
|
disabled = _defaultProps$options.disabled,
|
|
19953
20097
|
getFilesFromEvent = _defaultProps$options.getFilesFromEvent,
|
|
@@ -20264,7 +20408,7 @@ function useDropzone() {
|
|
|
20264
20408
|
onDrop = _ref2.onDrop,
|
|
20265
20409
|
rest = _objectWithoutProperties(_ref2, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
|
|
20266
20410
|
|
|
20267
|
-
return _objectSpread$
|
|
20411
|
+
return _objectSpread$f(_objectSpread$f(_defineProperty({
|
|
20268
20412
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
20269
20413
|
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
20270
20414
|
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
@@ -20303,7 +20447,7 @@ function useDropzone() {
|
|
|
20303
20447
|
tabIndex: -1
|
|
20304
20448
|
}, refKey, inputRef);
|
|
20305
20449
|
|
|
20306
|
-
return _objectSpread$
|
|
20450
|
+
return _objectSpread$f(_objectSpread$f({}, inputProps), rest);
|
|
20307
20451
|
};
|
|
20308
20452
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
20309
20453
|
var fileCount = draggedFiles.length;
|
|
@@ -20316,7 +20460,7 @@ function useDropzone() {
|
|
|
20316
20460
|
maxFiles: maxFiles
|
|
20317
20461
|
});
|
|
20318
20462
|
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
20319
|
-
return _objectSpread$
|
|
20463
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20320
20464
|
isDragAccept: isDragAccept,
|
|
20321
20465
|
isDragReject: isDragReject,
|
|
20322
20466
|
isFocused: isFocused && !disabled,
|
|
@@ -20332,22 +20476,22 @@ function reducer(state, action) {
|
|
|
20332
20476
|
/* istanbul ignore next */
|
|
20333
20477
|
switch (action.type) {
|
|
20334
20478
|
case 'focus':
|
|
20335
|
-
return _objectSpread$
|
|
20479
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20336
20480
|
isFocused: true
|
|
20337
20481
|
});
|
|
20338
20482
|
|
|
20339
20483
|
case 'blur':
|
|
20340
|
-
return _objectSpread$
|
|
20484
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20341
20485
|
isFocused: false
|
|
20342
20486
|
});
|
|
20343
20487
|
|
|
20344
20488
|
case 'openDialog':
|
|
20345
|
-
return _objectSpread$
|
|
20489
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20346
20490
|
isFileDialogActive: true
|
|
20347
20491
|
});
|
|
20348
20492
|
|
|
20349
20493
|
case 'closeDialog':
|
|
20350
|
-
return _objectSpread$
|
|
20494
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20351
20495
|
isFileDialogActive: false
|
|
20352
20496
|
});
|
|
20353
20497
|
|
|
@@ -20355,19 +20499,19 @@ function reducer(state, action) {
|
|
|
20355
20499
|
/* eslint no-case-declarations: 0 */
|
|
20356
20500
|
var isDragActive = action.isDragActive,
|
|
20357
20501
|
draggedFiles = action.draggedFiles;
|
|
20358
|
-
return _objectSpread$
|
|
20502
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20359
20503
|
draggedFiles: draggedFiles,
|
|
20360
20504
|
isDragActive: isDragActive
|
|
20361
20505
|
});
|
|
20362
20506
|
|
|
20363
20507
|
case 'setFiles':
|
|
20364
|
-
return _objectSpread$
|
|
20508
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20365
20509
|
acceptedFiles: action.acceptedFiles,
|
|
20366
20510
|
fileRejections: action.fileRejections
|
|
20367
20511
|
});
|
|
20368
20512
|
|
|
20369
20513
|
case 'reset':
|
|
20370
|
-
return _objectSpread$
|
|
20514
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20371
20515
|
isFileDialogActive: false,
|
|
20372
20516
|
isDragActive: false,
|
|
20373
20517
|
draggedFiles: [],
|
|
@@ -20380,8 +20524,8 @@ function reducer(state, action) {
|
|
|
20380
20524
|
}
|
|
20381
20525
|
}
|
|
20382
20526
|
|
|
20383
|
-
function ownKeys$
|
|
20384
|
-
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; }
|
|
20385
20529
|
var useFileUpload = function useFileUpload(_ref) {
|
|
20386
20530
|
var disabled = _ref.disabled,
|
|
20387
20531
|
accept = _ref.accept,
|
|
@@ -20481,7 +20625,7 @@ var useFileUpload = function useFileUpload(_ref) {
|
|
|
20481
20625
|
var uploadedFile = neetoCist.findBy({
|
|
20482
20626
|
name: file.name
|
|
20483
20627
|
}, newFiles);
|
|
20484
|
-
return _objectSpread$
|
|
20628
|
+
return _objectSpread$e(_objectSpread$e({}, file), uploadedFile);
|
|
20485
20629
|
})
|
|
20486
20630
|
});
|
|
20487
20631
|
} else {
|
|
@@ -20540,6 +20684,8 @@ const SvgFileUpload = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
20540
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"
|
|
20541
20685
|
})));
|
|
20542
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; }
|
|
20543
20689
|
var DropZone = function DropZone(_ref) {
|
|
20544
20690
|
var isDragActive = _ref.isDragActive,
|
|
20545
20691
|
getRootProps = _ref.getRootProps,
|
|
@@ -20552,54 +20698,63 @@ var DropZone = function DropZone(_ref) {
|
|
|
20552
20698
|
var _useTranslation = reactI18next.useTranslation(),
|
|
20553
20699
|
t = _useTranslation.t;
|
|
20554
20700
|
var shouldShowFileSizeLimit = hasFileSizeLimit && maxFileSize;
|
|
20555
|
-
return /*#__PURE__*/
|
|
20701
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread$d(_objectSpread$d({}, getRootProps({
|
|
20556
20702
|
className: classnames__default["default"](["neeto-form-engine-file-upload__dropzone"], {
|
|
20557
20703
|
"neeto-form-engine-file-upload__dropzone--drag-active": isDragActive
|
|
20558
20704
|
})
|
|
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
|
-
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
|
|
20597
|
-
|
|
20598
|
-
|
|
20599
|
-
|
|
20600
|
-
|
|
20601
|
-
|
|
20602
|
-
|
|
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
|
+
}));
|
|
20603
20758
|
};
|
|
20604
20759
|
|
|
20605
20760
|
var createDefinition = function (propNames) { return ({
|
|
@@ -27909,51 +28064,55 @@ var Progress = function Progress(_ref) {
|
|
|
27909
28064
|
transition: transition
|
|
27910
28065
|
}
|
|
27911
28066
|
};
|
|
27912
|
-
return /*#__PURE__*/
|
|
27913
|
-
className: "neeto-form-engine-progress__circle"
|
|
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
|
-
|
|
27946
|
-
|
|
27947
|
-
|
|
27948
|
-
|
|
27949
|
-
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
|
|
27954
|
-
|
|
27955
|
-
|
|
27956
|
-
|
|
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
|
+
});
|
|
27957
28116
|
};
|
|
27958
28117
|
|
|
27959
28118
|
var FILE_MIME_TYPES = {
|
|
@@ -28005,48 +28164,56 @@ var FilePreview = reactUtils.withT(function (_ref) {
|
|
|
28005
28164
|
isUploading = _ref.isUploading,
|
|
28006
28165
|
cancel = _ref.cancel,
|
|
28007
28166
|
progress = _ref.progress;
|
|
28008
|
-
return /*#__PURE__*/
|
|
28167
|
+
return /*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
28009
28168
|
className: "neeto-form-engine-file-upload__uploaded-list-item",
|
|
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
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
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);
|
|
28050
28217
|
});
|
|
28051
28218
|
|
|
28052
28219
|
var FileUploadField = function FileUploadField(_ref) {
|
|
@@ -28096,42 +28263,47 @@ var FileUploadField = function FileUploadField(_ref) {
|
|
|
28096
28263
|
var isUploadingFile = function isUploadingFile(file) {
|
|
28097
28264
|
return ramda.isNotNil(progress[file.name]) && (progress[file.name] !== 100 || !file.url);
|
|
28098
28265
|
};
|
|
28099
|
-
return /*#__PURE__*/
|
|
28100
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
|
|
28115
|
-
|
|
28116
|
-
|
|
28117
|
-
|
|
28118
|
-
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
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"], {
|
|
28125
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",
|
|
28126
|
-
|
|
28127
|
-
}
|
|
28128
|
-
})
|
|
28129
|
-
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"
|
|
28130
|
-
}, error));
|
|
28300
|
+
children: error
|
|
28301
|
+
})]
|
|
28302
|
+
});
|
|
28131
28303
|
};
|
|
28132
28304
|
|
|
28133
|
-
function ownKeys$
|
|
28134
|
-
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; }
|
|
28135
28307
|
var NameField = function NameField(_ref) {
|
|
28136
28308
|
var question = _ref.question,
|
|
28137
28309
|
customValidator = _ref.customValidator,
|
|
@@ -28161,12 +28333,12 @@ var NameField = function NameField(_ref) {
|
|
|
28161
28333
|
setValue = _useField2$2.setValue,
|
|
28162
28334
|
setTouched = _useField2$2.setTouched;
|
|
28163
28335
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28164
|
-
return /*#__PURE__*/
|
|
28336
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input__default$1["default"], _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
28165
28337
|
type: type
|
|
28166
28338
|
}, field), {}, {
|
|
28167
28339
|
autoComplete: autoComplete,
|
|
28168
28340
|
label: label
|
|
28169
|
-
}), {
|
|
28341
|
+
})), {}, {
|
|
28170
28342
|
error: touched ? error : "",
|
|
28171
28343
|
name: kind,
|
|
28172
28344
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28189,39 +28361,43 @@ var Choices = function Choices(_ref) {
|
|
|
28189
28361
|
var isCheckBox = type === "checkbox";
|
|
28190
28362
|
var ChoiceWrapper = isCheckBox ? "div" : Radio__default["default"];
|
|
28191
28363
|
var Component = isCheckBox ? Checkbox__default["default"] : Radio__default["default"].Item;
|
|
28192
|
-
return /*#__PURE__*/
|
|
28193
|
-
className: "neeto-form-engine-choices__wrapper"
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
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);
|
|
28206
28389
|
})
|
|
28207
|
-
}, /*#__PURE__*/
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
value: option.id,
|
|
28214
|
-
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28215
|
-
}));
|
|
28216
|
-
})), !!error && typeof error === "string" && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
28217
|
-
className: "neeto-form-engine-input__error",
|
|
28218
|
-
"data-cy": "neeto-form-engine-".concat(type, "-error")
|
|
28219
|
-
}, 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
|
+
});
|
|
28220
28396
|
};
|
|
28221
28397
|
var Choices$1 = /*#__PURE__*/React__default["default"].memo(Choices);
|
|
28222
28398
|
|
|
28223
|
-
function ownKeys$
|
|
28224
|
-
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; }
|
|
28225
28401
|
var OptionsField = function OptionsField(_ref) {
|
|
28226
28402
|
var question = _ref.question,
|
|
28227
28403
|
customValidator = _ref.customValidator;
|
|
@@ -28244,7 +28420,7 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28244
28420
|
value: option.id
|
|
28245
28421
|
};
|
|
28246
28422
|
}) : options.map(function (option) {
|
|
28247
|
-
return _objectSpread$
|
|
28423
|
+
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
28248
28424
|
label: fieldWithFallback(option, "label")
|
|
28249
28425
|
});
|
|
28250
28426
|
});
|
|
@@ -28255,31 +28431,32 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28255
28431
|
return validateField(name);
|
|
28256
28432
|
});
|
|
28257
28433
|
};
|
|
28258
|
-
return /*#__PURE__*/
|
|
28434
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28259
28435
|
name: name,
|
|
28260
28436
|
validate: validateFieldValue({
|
|
28261
28437
|
kind: kind,
|
|
28262
28438
|
label: label,
|
|
28263
28439
|
isRequired: isRequired,
|
|
28264
28440
|
customValidator: customValidator
|
|
28265
|
-
})
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28271
|
-
|
|
28272
|
-
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
|
|
28276
|
-
|
|
28277
|
-
|
|
28278
|
-
|
|
28279
|
-
|
|
28280
|
-
|
|
28281
|
-
|
|
28282
|
-
|
|
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
|
+
}
|
|
28283
28460
|
});
|
|
28284
28461
|
};
|
|
28285
28462
|
|
|
@@ -28308,7 +28485,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28308
28485
|
_useField2$2 = _useField2[2],
|
|
28309
28486
|
setValue = _useField2$2.setValue,
|
|
28310
28487
|
setTouched = _useField2$2.setTouched;
|
|
28311
|
-
return /*#__PURE__*/
|
|
28488
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumberInput, {
|
|
28312
28489
|
autoComplete: autoComplete,
|
|
28313
28490
|
label: label,
|
|
28314
28491
|
value: value,
|
|
@@ -28325,6 +28502,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28325
28502
|
};
|
|
28326
28503
|
|
|
28327
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; }
|
|
28328
28507
|
var Rating = function Rating(_ref) {
|
|
28329
28508
|
var name = _ref.name,
|
|
28330
28509
|
label = _ref.label,
|
|
@@ -28343,38 +28522,46 @@ var Rating = function Rating(_ref) {
|
|
|
28343
28522
|
var Icon = _ref2.icon,
|
|
28344
28523
|
modifier = _ref2.modifier,
|
|
28345
28524
|
rating = _ref2.value;
|
|
28346
|
-
return /*#__PURE__*/
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
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);
|
|
28363
28544
|
});
|
|
28364
28545
|
};
|
|
28365
|
-
return /*#__PURE__*/
|
|
28366
|
-
className: "neeto-form-engine-rating"
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
"
|
|
28374
|
-
|
|
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
|
+
});
|
|
28375
28560
|
};
|
|
28376
28561
|
var Rating$1 = /*#__PURE__*/React__default["default"].memo(Rating);
|
|
28377
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; }
|
|
28378
28565
|
var RatingField = function RatingField(_ref) {
|
|
28379
28566
|
var question = _ref.question,
|
|
28380
28567
|
customValidator = _ref.customValidator;
|
|
@@ -28382,27 +28569,30 @@ var RatingField = function RatingField(_ref) {
|
|
|
28382
28569
|
kind = question.kind,
|
|
28383
28570
|
isRequired = question.isRequired;
|
|
28384
28571
|
var label = fieldWithFallback(question, "label");
|
|
28385
|
-
return /*#__PURE__*/
|
|
28572
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28386
28573
|
name: name,
|
|
28387
28574
|
validate: validateFieldValue({
|
|
28388
28575
|
kind: kind,
|
|
28389
28576
|
label: label,
|
|
28390
28577
|
isRequired: isRequired,
|
|
28391
28578
|
customValidator: customValidator
|
|
28392
|
-
})
|
|
28393
|
-
|
|
28394
|
-
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
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
|
+
}
|
|
28403
28591
|
});
|
|
28404
28592
|
};
|
|
28405
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; }
|
|
28406
28596
|
var RichTextEditor = function RichTextEditor(_ref) {
|
|
28407
28597
|
var editorRef = _ref.editorRef,
|
|
28408
28598
|
question = _ref.question,
|
|
@@ -28418,45 +28608,50 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
28418
28608
|
var label = fieldWithFallback(question, "label");
|
|
28419
28609
|
var debouncedPlaceholder = reactUtils.useDebounce(fieldWithFallback(question, "placeholder"), 300);
|
|
28420
28610
|
var propsToCompare = preview ? ["debouncedPlaceholder", "error"] : ["debouncedPlaceholder"];
|
|
28421
|
-
return /*#__PURE__*/
|
|
28422
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28435
|
-
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
28448
|
-
|
|
28449
|
-
|
|
28450
|
-
|
|
28451
|
-
|
|
28452
|
-
|
|
28453
|
-
|
|
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);
|
|
28454
28647
|
}
|
|
28455
|
-
}
|
|
28456
|
-
})
|
|
28648
|
+
})]
|
|
28649
|
+
});
|
|
28457
28650
|
};
|
|
28458
28651
|
|
|
28459
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; }
|
|
28460
28655
|
var RatingButton = function RatingButton(_ref) {
|
|
28461
28656
|
var _ref$value = _ref.value,
|
|
28462
28657
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
@@ -28469,56 +28664,68 @@ var RatingButton = function RatingButton(_ref) {
|
|
|
28469
28664
|
};
|
|
28470
28665
|
var Icon = ICONS_MAP[iconType];
|
|
28471
28666
|
var selectedRating = getSelectedRating(value);
|
|
28472
|
-
return /*#__PURE__*/
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28482
|
-
|
|
28483
|
-
|
|
28484
|
-
|
|
28485
|
-
|
|
28486
|
-
|
|
28487
|
-
|
|
28488
|
-
|
|
28489
|
-
|
|
28490
|
-
|
|
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
|
+
});
|
|
28491
28690
|
};
|
|
28492
28691
|
var RatingButton$1 = /*#__PURE__*/React__default["default"].memo(RatingButton);
|
|
28493
28692
|
|
|
28494
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; }
|
|
28495
28696
|
var StarRating = function StarRating(_ref) {
|
|
28496
28697
|
var label = _ref.label,
|
|
28497
28698
|
minValue = _ref.minValue,
|
|
28498
28699
|
maxValue = _ref.maxValue,
|
|
28499
28700
|
error = _ref.error,
|
|
28500
28701
|
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
28501
|
-
return /*#__PURE__*/
|
|
28502
|
-
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating"
|
|
28503
|
-
|
|
28504
|
-
|
|
28505
|
-
|
|
28506
|
-
|
|
28507
|
-
|
|
28508
|
-
|
|
28509
|
-
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
"
|
|
28518
|
-
|
|
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
|
+
});
|
|
28519
28724
|
};
|
|
28520
28725
|
var StarRating$1 = /*#__PURE__*/React__default["default"].memo(StarRating);
|
|
28521
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; }
|
|
28522
28729
|
var StarRatingField = function StarRatingField(_ref) {
|
|
28523
28730
|
var question = _ref.question,
|
|
28524
28731
|
customValidator = _ref.customValidator;
|
|
@@ -28529,30 +28736,31 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
28529
28736
|
maxValue = question.maxValue,
|
|
28530
28737
|
iconType = question.iconType;
|
|
28531
28738
|
var label = fieldWithFallback(question, "label");
|
|
28532
|
-
return /*#__PURE__*/
|
|
28739
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28533
28740
|
name: name,
|
|
28534
28741
|
validate: validateFieldValue({
|
|
28535
28742
|
kind: kind,
|
|
28536
28743
|
label: label,
|
|
28537
28744
|
isRequired: isRequired,
|
|
28538
28745
|
customValidator: customValidator
|
|
28539
|
-
})
|
|
28540
|
-
|
|
28541
|
-
|
|
28542
|
-
|
|
28543
|
-
|
|
28544
|
-
|
|
28545
|
-
|
|
28546
|
-
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28550
|
-
|
|
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
|
+
}
|
|
28551
28759
|
});
|
|
28552
28760
|
};
|
|
28553
28761
|
|
|
28554
|
-
function ownKeys$
|
|
28555
|
-
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; }
|
|
28556
28764
|
var TermsField = function TermsField(_ref) {
|
|
28557
28765
|
var question = _ref.question,
|
|
28558
28766
|
customValidator = _ref.customValidator;
|
|
@@ -28561,32 +28769,35 @@ var TermsField = function TermsField(_ref) {
|
|
|
28561
28769
|
isRequired = question.isRequired,
|
|
28562
28770
|
nodeId = question.nodeId;
|
|
28563
28771
|
var label = fieldWithFallback(question, "label", true);
|
|
28564
|
-
return /*#__PURE__*/
|
|
28772
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
|
|
28565
28773
|
name: name || nodeId,
|
|
28566
28774
|
validate: validateFieldValue({
|
|
28567
28775
|
kind: kind,
|
|
28568
28776
|
label: label,
|
|
28569
28777
|
isRequired: isRequired,
|
|
28570
28778
|
customValidator: customValidator
|
|
28571
|
-
})
|
|
28572
|
-
|
|
28573
|
-
|
|
28574
|
-
|
|
28575
|
-
|
|
28576
|
-
|
|
28577
|
-
|
|
28578
|
-
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
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
|
+
}
|
|
28585
28796
|
});
|
|
28586
28797
|
};
|
|
28587
28798
|
|
|
28588
|
-
function ownKeys$
|
|
28589
|
-
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; }
|
|
28590
28801
|
var TextField = function TextField(_ref) {
|
|
28591
28802
|
var _otherProps$onChange;
|
|
28592
28803
|
var question = _ref.question,
|
|
@@ -28621,13 +28832,13 @@ var TextField = function TextField(_ref) {
|
|
|
28621
28832
|
setValue = _useField2$2.setValue,
|
|
28622
28833
|
setTouched = _useField2$2.setTouched;
|
|
28623
28834
|
var handleFieldChange = utils.withEventTargetValue(setValue);
|
|
28624
|
-
return /*#__PURE__*/
|
|
28835
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({
|
|
28625
28836
|
type: type
|
|
28626
28837
|
}, field), {}, {
|
|
28627
28838
|
autoComplete: autoComplete,
|
|
28628
28839
|
label: label,
|
|
28629
28840
|
onKeyDown: onKeyDown
|
|
28630
|
-
}), {
|
|
28841
|
+
})), {}, {
|
|
28631
28842
|
error: touched ? error : "",
|
|
28632
28843
|
name: neetoCist.slugify(label),
|
|
28633
28844
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28642,18 +28853,11 @@ var TextField = function TextField(_ref) {
|
|
|
28642
28853
|
var _QUESTION_TO_COMPONEN;
|
|
28643
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) {
|
|
28644
28855
|
var question = _ref.question;
|
|
28645
|
-
return /*#__PURE__*/
|
|
28856
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
28646
28857
|
content: fieldWithFallback(question, "label", true)
|
|
28647
28858
|
});
|
|
28648
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);
|
|
28649
28860
|
|
|
28650
|
-
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
28651
|
-
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
28652
|
-
var fallback = question["".concat(fieldName, "Fallback")];
|
|
28653
|
-
var field = question[fieldName];
|
|
28654
|
-
var isFieldEmpty = hasRichContent ? neetoEditor.isEditorEmpty(field) : ramda.isEmpty(field);
|
|
28655
|
-
return isFieldEmpty && ramda.isNotNil(fallback) ? fallback : field;
|
|
28656
|
-
};
|
|
28657
28861
|
var getFieldComponent = function getFieldComponent(_ref) {
|
|
28658
28862
|
var kind = _ref.kind;
|
|
28659
28863
|
if (kind in QUESTION_TO_COMPONENT_MAP) return QUESTION_TO_COMPONENT_MAP[kind];
|
|
@@ -28707,21 +28911,24 @@ const SvgSuccess = props => /*#__PURE__*/React__namespace.createElement("svg", _
|
|
|
28707
28911
|
var Success = function Success() {
|
|
28708
28912
|
var _useTranslation = reactI18next.useTranslation(),
|
|
28709
28913
|
t = _useTranslation.t;
|
|
28710
|
-
return /*#__PURE__*/
|
|
28711
|
-
className: "flex h-full w-full flex-col items-center justify-center space-y-4"
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28715
|
-
|
|
28716
|
-
|
|
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
|
+
});
|
|
28717
28924
|
};
|
|
28718
28925
|
var Success$1 = /*#__PURE__*/React__default["default"].memo(Success);
|
|
28719
28926
|
|
|
28720
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; } } }; }
|
|
28721
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); }
|
|
28722
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; }
|
|
28723
|
-
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; }
|
|
28724
|
-
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; }
|
|
28725
28932
|
var ExternalForm = function ExternalForm(_ref) {
|
|
28726
28933
|
var _formikInnerRef$curre;
|
|
28727
28934
|
var _ref$preview = _ref.preview,
|
|
@@ -28890,7 +29097,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28890
29097
|
_context.next = 29;
|
|
28891
29098
|
return createSubmission({
|
|
28892
29099
|
formId: formId,
|
|
28893
|
-
values: _objectSpread({
|
|
29100
|
+
values: _objectSpread$2({
|
|
28894
29101
|
neetoFormResponse: {
|
|
28895
29102
|
responses: responses
|
|
28896
29103
|
}
|
|
@@ -28993,9 +29200,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28993
29200
|
mode: "scoped"
|
|
28994
29201
|
});
|
|
28995
29202
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|
|
28996
|
-
return /*#__PURE__*/
|
|
28997
|
-
className: "loader flex h-full w-full items-center justify-center"
|
|
28998
|
-
|
|
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
|
+
});
|
|
28999
29207
|
}
|
|
29000
29208
|
var title = form.title,
|
|
29001
29209
|
_form$questions = form.questions,
|
|
@@ -29005,96 +29213,107 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
29005
29213
|
return !_destroy;
|
|
29006
29214
|
}) : questions;
|
|
29007
29215
|
if (displayThankYou && showSuccess) {
|
|
29008
|
-
return /*#__PURE__*/
|
|
29009
|
-
}
|
|
29010
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
29084
|
-
|
|
29085
|
-
|
|
29086
|
-
|
|
29087
|
-
|
|
29088
|
-
|
|
29089
|
-
|
|
29090
|
-
|
|
29091
|
-
|
|
29092
|
-
|
|
29093
|
-
|
|
29094
|
-
|
|
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
|
+
});
|
|
29095
29314
|
}
|
|
29096
|
-
})
|
|
29097
|
-
})
|
|
29315
|
+
})]
|
|
29316
|
+
});
|
|
29098
29317
|
};
|
|
29099
29318
|
|
|
29100
29319
|
var dist = {};
|
|
@@ -31622,13 +31841,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31622
31841
|
var _default = dist.default = _Linkify2.default;
|
|
31623
31842
|
|
|
31624
31843
|
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
31625
|
-
return /*#__PURE__*/
|
|
31844
|
+
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
31626
31845
|
className: "neeto-ui-text-primary-500 hover:underline",
|
|
31627
31846
|
href: decoratedHref,
|
|
31628
|
-
key: key,
|
|
31629
31847
|
rel: "noreferrer",
|
|
31630
|
-
target: "_blank"
|
|
31631
|
-
|
|
31848
|
+
target: "_blank",
|
|
31849
|
+
children: decoratedText
|
|
31850
|
+
}, key);
|
|
31632
31851
|
};
|
|
31633
31852
|
var filterResponses = neetoCist.removeBy({
|
|
31634
31853
|
kind: QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
@@ -31637,27 +31856,33 @@ var filterResponses = neetoCist.removeBy({
|
|
|
31637
31856
|
|
|
31638
31857
|
var FileUpload = function FileUpload(_ref) {
|
|
31639
31858
|
var files = _ref.files;
|
|
31640
|
-
return /*#__PURE__*/
|
|
31641
|
-
className: "space-y-2"
|
|
31642
|
-
|
|
31643
|
-
|
|
31644
|
-
|
|
31645
|
-
|
|
31646
|
-
|
|
31647
|
-
|
|
31648
|
-
|
|
31649
|
-
|
|
31650
|
-
|
|
31651
|
-
|
|
31652
|
-
|
|
31653
|
-
|
|
31654
|
-
|
|
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
|
+
});
|
|
31655
31876
|
};
|
|
31656
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; }
|
|
31657
31880
|
var getValue = function getValue(_ref) {
|
|
31658
31881
|
var value = _ref.value,
|
|
31659
31882
|
kind = _ref.kind;
|
|
31660
|
-
if (ramda.isEmpty(value)) return /*#__PURE__*/
|
|
31883
|
+
if (ramda.isEmpty(value)) return /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
31884
|
+
children: i18next.t("neetoForm.common.unanswered")
|
|
31885
|
+
});
|
|
31661
31886
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31662
31887
|
return value && utils.dateFormat.date(value);
|
|
31663
31888
|
}
|
|
@@ -31701,51 +31926,58 @@ var Submission = function Submission(_ref2) {
|
|
|
31701
31926
|
var renderSubmittedValue = function renderSubmittedValue(kind, value) {
|
|
31702
31927
|
switch (kind) {
|
|
31703
31928
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
31704
|
-
return /*#__PURE__*/
|
|
31929
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoEditor.EditorContent, {
|
|
31705
31930
|
content: getEditorContent(getValue({
|
|
31706
31931
|
value: value,
|
|
31707
31932
|
kind: kind
|
|
31708
31933
|
}))
|
|
31709
31934
|
});
|
|
31710
31935
|
case QUESTION_KIND.PHONE.value:
|
|
31711
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31936
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(PhoneNumber$1.PhoneNumber, {
|
|
31712
31937
|
value: value,
|
|
31713
31938
|
showEmoji: true
|
|
31714
31939
|
}) : "-";
|
|
31715
31940
|
case QUESTION_KIND.FILE_UPLOAD.value:
|
|
31716
|
-
return neetoCist.isPresent(value) ? /*#__PURE__*/
|
|
31941
|
+
return neetoCist.isPresent(value) ? /*#__PURE__*/jsxRuntime.jsx(FileUpload, {
|
|
31717
31942
|
files: value
|
|
31718
31943
|
}) : "-";
|
|
31719
31944
|
default:
|
|
31720
|
-
return /*#__PURE__*/
|
|
31945
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], _objectSpread$1(_objectSpread$1({
|
|
31721
31946
|
weight: "semibold"
|
|
31722
|
-
}, answerProps),
|
|
31723
|
-
|
|
31724
|
-
|
|
31725
|
-
|
|
31726
|
-
|
|
31727
|
-
|
|
31947
|
+
}, answerProps), {}, {
|
|
31948
|
+
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
31949
|
+
componentDecorator: linkifyDecorator,
|
|
31950
|
+
children: getValue({
|
|
31951
|
+
value: value,
|
|
31952
|
+
kind: kind
|
|
31953
|
+
})
|
|
31954
|
+
})
|
|
31955
|
+
}));
|
|
31728
31956
|
}
|
|
31729
31957
|
};
|
|
31730
31958
|
if (isLoading) {
|
|
31731
|
-
return /*#__PURE__*/
|
|
31732
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
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
|
+
});
|
|
31749
31981
|
};
|
|
31750
31982
|
|
|
31751
31983
|
var getPreFillableQuestions = function getPreFillableQuestions(questions) {
|
|
@@ -31809,6 +32041,8 @@ var buildQueryParameters = function buildQueryParameters(responses, questions) {
|
|
|
31809
32041
|
return queryParameters;
|
|
31810
32042
|
};
|
|
31811
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; }
|
|
31812
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; } } }; }
|
|
31813
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); }
|
|
31814
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; }
|
|
@@ -31893,81 +32127,94 @@ var UrlBuilder = function UrlBuilder(_ref) {
|
|
|
31893
32127
|
mode: "scoped"
|
|
31894
32128
|
});
|
|
31895
32129
|
if (isLoading || form.isQuestionsLoading) {
|
|
31896
|
-
return /*#__PURE__*/
|
|
31897
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31898
|
-
|
|
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
|
+
});
|
|
31899
32134
|
}
|
|
31900
32135
|
var title = form.title,
|
|
31901
32136
|
questions = form.questions;
|
|
31902
32137
|
var modifiedQuestions = getPreFillableQuestions(questions);
|
|
31903
|
-
return /*#__PURE__*/
|
|
31904
|
-
|
|
31905
|
-
|
|
31906
|
-
|
|
31907
|
-
|
|
31908
|
-
|
|
31909
|
-
|
|
31910
|
-
|
|
31911
|
-
|
|
31912
|
-
|
|
31913
|
-
|
|
31914
|
-
|
|
31915
|
-
|
|
31916
|
-
|
|
31917
|
-
|
|
31918
|
-
|
|
31919
|
-
|
|
31920
|
-
|
|
31921
|
-
|
|
31922
|
-
|
|
31923
|
-
|
|
31924
|
-
|
|
31925
|
-
|
|
31926
|
-
|
|
31927
|
-
|
|
31928
|
-
|
|
31929
|
-
|
|
31930
|
-
|
|
31931
|
-
|
|
31932
|
-
|
|
31933
|
-
|
|
31934
|
-
|
|
31935
|
-
|
|
31936
|
-
|
|
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
|
+
});
|
|
31937
32215
|
}
|
|
31938
|
-
})
|
|
31939
|
-
|
|
31940
|
-
}, modifiedQuestions.map(function (question) {
|
|
31941
|
-
var _question$id;
|
|
31942
|
-
var FieldComponent = getFieldComponent(question);
|
|
31943
|
-
return /*#__PURE__*/React__default["default"].createElement(FieldComponent, {
|
|
31944
|
-
editorProps: editorProps,
|
|
31945
|
-
editorRef: editorRef,
|
|
31946
|
-
question: question,
|
|
31947
|
-
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
31948
|
-
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
31949
|
-
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
31950
|
-
});
|
|
31951
|
-
}), showEmptyState && ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31952
|
-
className: "flex flex-col items-center justify-center gap-y-4 py-8"
|
|
31953
|
-
}, /*#__PURE__*/React__default["default"].createElement(SvgNoQuestions, null), /*#__PURE__*/React__default["default"].createElement(Typography__default["default"], {
|
|
31954
|
-
style: "h3",
|
|
31955
|
-
weight: "semibold"
|
|
31956
|
-
}, t("neetoForm.questions.common.notFound")))), !ramda.isEmpty(modifiedQuestions) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31957
|
-
className: "mt-8 flex items-center justify-start gap-x-2"
|
|
31958
|
-
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31959
|
-
disabled: isSubmitting,
|
|
31960
|
-
label: t("neetoForm.common.generateLink"),
|
|
31961
|
-
loading: isSubmitting,
|
|
31962
|
-
type: "submit"
|
|
31963
|
-
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31964
|
-
label: t("neetoForm.common.reset"),
|
|
31965
|
-
style: "secondary",
|
|
31966
|
-
type: "reset"
|
|
31967
|
-
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/React__default["default"].createElement(Button__default["default"], _extends$8({
|
|
31968
|
-
label: t("neetoForm.common.cancel")
|
|
31969
|
-
}, cancelButtonProps)))));
|
|
31970
|
-
}));
|
|
32216
|
+
})]
|
|
32217
|
+
});
|
|
31971
32218
|
};
|
|
31972
32219
|
|
|
31973
32220
|
var useFormSubmission = function useFormSubmission(_ref) {
|