@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.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React$2 from 'react';
|
|
2
|
-
import React__default, { useState, useRef, useEffect, useContext, useLayoutEffect as useLayoutEffect$1, forwardRef, useImperativeHandle, Fragment, useReducer, useCallback as useCallback$1, useMemo as useMemo$1, createContext
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useContext, useLayoutEffect as useLayoutEffect$1, createElement, forwardRef, useImperativeHandle, Fragment as Fragment$1, useReducer, useCallback as useCallback$1, useMemo as useMemo$1, createContext } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
3
4
|
import { useFormikContext, useField, FieldArray, Form as Form$3, Formik, Field, FastField } from 'formik';
|
|
4
|
-
import { filterNonNull, noop as noop$4, findBy, toLabelAndValue, isPresent as isPresent$1, truncate,
|
|
5
|
+
import { filterNonNull, noop as noop$4, findBy, toLabelAndValue, isPresent as isPresent$1, truncate, slugify, filterBy, removeBy, isNotPresent, isNotEmpty, findById, notEqualsDeep } from '@bigbinary/neeto-cist';
|
|
5
6
|
import { buildUrl, showThumbsUpToastr, withEventTargetValue, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
6
7
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
7
|
-
import { assoc, mergeLeft, compose as compose$1, isEmpty, trim, useWith, path, split, either, isNil, values, equals, modify, prop, range, includes, __, reduce, reject, keys, pick, omit, pluck, without, difference, pipe as pipe$1, last, not, toLower, map, identity, clamp as clamp$2,
|
|
8
|
+
import { assoc, mergeLeft, compose as compose$1, isEmpty, trim, useWith, path, split, isNotNil, either, isNil, values, equals, modify, prop, range, includes, __, reduce, reject, keys, pick, omit, pluck, without, difference, pipe as pipe$1, last, not, toLower, map, identity, clamp as clamp$2, filter as filter$1 } from 'ramda';
|
|
8
9
|
import { useQuery, useQueryClient, useMutation } from 'react-query';
|
|
9
10
|
import i18next, { t as t$4 } from 'i18next';
|
|
11
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
12
|
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
11
13
|
import { useMutationWithInvalidation, withImmutableActions, withT, useStateWithDependency, useOnClickOutside, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
12
14
|
import axios from 'axios';
|
|
@@ -14,18 +16,17 @@ import ReactDOM, { unstable_batchedUpdates, flushSync as flushSync$1 } from 'rea
|
|
|
14
16
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
15
17
|
import { useTranslation, Trans } from 'react-i18next';
|
|
16
18
|
import { create as create$2 } from 'zustand';
|
|
19
|
+
import { isEditorEmpty, Editor as Editor$1, EditorContent } from '@bigbinary/neeto-editor';
|
|
17
20
|
import { shallow } from 'zustand/shallow';
|
|
18
21
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
19
22
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
20
23
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
21
24
|
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
22
25
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
23
|
-
import classnames from 'classnames';
|
|
24
26
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
25
27
|
import Form$2 from '@bigbinary/neetoui/formik/Form';
|
|
26
28
|
import Select from '@bigbinary/neetoui/formik/Select';
|
|
27
29
|
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
28
|
-
import { Editor as Editor$1, isEditorEmpty, EditorContent } from '@bigbinary/neeto-editor';
|
|
29
30
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
30
31
|
import { Info, Delete, Plus, Check, Close, FileGeneric } from '@bigbinary/neeto-icons';
|
|
31
32
|
import Button$1 from '@bigbinary/neetoui/Button';
|
|
@@ -52,21 +53,6 @@ import Radio from '@bigbinary/neetoui/Radio';
|
|
|
52
53
|
import Textarea$1 from '@bigbinary/neetoui/Textarea';
|
|
53
54
|
import { renderToString } from 'react-dom/server';
|
|
54
55
|
|
|
55
|
-
function _extends$8() {
|
|
56
|
-
_extends$8 = Object.assign ? Object.assign.bind() : function (target) {
|
|
57
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
58
|
-
var source = arguments[i];
|
|
59
|
-
for (var key in source) {
|
|
60
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
61
|
-
target[key] = source[key];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return target;
|
|
66
|
-
};
|
|
67
|
-
return _extends$8.apply(this, arguments);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
56
|
function _typeof$4(o) {
|
|
71
57
|
"@babel/helpers - typeof";
|
|
72
58
|
|
|
@@ -165,11 +151,13 @@ var _excluded$g = ["size"],
|
|
|
165
151
|
_excluded3$2 = ["size"],
|
|
166
152
|
_excluded4$1 = ["size"],
|
|
167
153
|
_excluded5$1 = ["size"];
|
|
154
|
+
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; }
|
|
155
|
+
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; }
|
|
168
156
|
var Star = function Star(props) {
|
|
169
157
|
var _props$size = props.size,
|
|
170
158
|
size = _props$size === void 0 ? 20 : _props$size,
|
|
171
159
|
other = _objectWithoutProperties$1(props, _excluded$g);
|
|
172
|
-
return /*#__PURE__*/
|
|
160
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
173
161
|
fill: "none",
|
|
174
162
|
height: size,
|
|
175
163
|
stroke: "currentColor",
|
|
@@ -179,15 +167,17 @@ var Star = function Star(props) {
|
|
|
179
167
|
viewBox: "0 0 24 24",
|
|
180
168
|
width: size,
|
|
181
169
|
xmlns: "http://www.w3.org/2000/svg"
|
|
182
|
-
}, other),
|
|
183
|
-
|
|
170
|
+
}, other), {}, {
|
|
171
|
+
children: /*#__PURE__*/jsx("path", {
|
|
172
|
+
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"
|
|
173
|
+
})
|
|
184
174
|
}));
|
|
185
175
|
};
|
|
186
176
|
var Heart = function Heart(props) {
|
|
187
177
|
var _props$size2 = props.size,
|
|
188
178
|
size = _props$size2 === void 0 ? 20 : _props$size2,
|
|
189
179
|
other = _objectWithoutProperties$1(props, _excluded2$2);
|
|
190
|
-
return /*#__PURE__*/
|
|
180
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
191
181
|
fill: "none",
|
|
192
182
|
height: size,
|
|
193
183
|
stroke: "currentColor",
|
|
@@ -197,15 +187,17 @@ var Heart = function Heart(props) {
|
|
|
197
187
|
viewBox: "0 0 24 24",
|
|
198
188
|
width: size,
|
|
199
189
|
xmlns: "http://www.w3.org/2000/svg"
|
|
200
|
-
}, other),
|
|
201
|
-
|
|
190
|
+
}, other), {}, {
|
|
191
|
+
children: /*#__PURE__*/jsx("path", {
|
|
192
|
+
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"
|
|
193
|
+
})
|
|
202
194
|
}));
|
|
203
195
|
};
|
|
204
196
|
var Zap = function Zap(props) {
|
|
205
197
|
var _props$size3 = props.size,
|
|
206
198
|
size = _props$size3 === void 0 ? 20 : _props$size3,
|
|
207
199
|
other = _objectWithoutProperties$1(props, _excluded3$2);
|
|
208
|
-
return /*#__PURE__*/
|
|
200
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
209
201
|
fill: "none",
|
|
210
202
|
height: size,
|
|
211
203
|
stroke: "currentColor",
|
|
@@ -215,15 +207,17 @@ var Zap = function Zap(props) {
|
|
|
215
207
|
viewBox: "0 0 24 24",
|
|
216
208
|
width: size,
|
|
217
209
|
xmlns: "http://www.w3.org/2000/svg"
|
|
218
|
-
}, other),
|
|
219
|
-
|
|
210
|
+
}, other), {}, {
|
|
211
|
+
children: /*#__PURE__*/jsx("path", {
|
|
212
|
+
d: "M13 2L3 14 12 14 11 22 21 10 12 10 13 2z"
|
|
213
|
+
})
|
|
220
214
|
}));
|
|
221
215
|
};
|
|
222
216
|
var Crown = function Crown(_ref) {
|
|
223
217
|
var _ref$size = _ref.size,
|
|
224
218
|
size = _ref$size === void 0 ? 20 : _ref$size,
|
|
225
219
|
otherProps = _objectWithoutProperties$1(_ref, _excluded4$1);
|
|
226
|
-
return /*#__PURE__*/
|
|
220
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$D(_objectSpread$D({
|
|
227
221
|
fill: "none",
|
|
228
222
|
height: size,
|
|
229
223
|
stroke: "currentColor",
|
|
@@ -233,19 +227,21 @@ var Crown = function Crown(_ref) {
|
|
|
233
227
|
viewBox: "0 0 24 24",
|
|
234
228
|
width: size,
|
|
235
229
|
xmlns: "http://www.w3.org/2000/svg"
|
|
236
|
-
}, otherProps),
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
230
|
+
}, otherProps), {}, {
|
|
231
|
+
children: /*#__PURE__*/jsx("path", {
|
|
232
|
+
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",
|
|
233
|
+
stroke: "currentColor",
|
|
234
|
+
strokeLinecap: "round",
|
|
235
|
+
strokeLinejoin: "round",
|
|
236
|
+
strokeWidth: "1.5"
|
|
237
|
+
})
|
|
242
238
|
}));
|
|
243
239
|
};
|
|
244
240
|
var Trophy = function Trophy(_ref2) {
|
|
245
241
|
var _ref2$size = _ref2.size,
|
|
246
242
|
size = _ref2$size === void 0 ? 20 : _ref2$size,
|
|
247
243
|
otherProps = _objectWithoutProperties$1(_ref2, _excluded5$1);
|
|
248
|
-
return /*#__PURE__*/
|
|
244
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$D(_objectSpread$D({
|
|
249
245
|
fill: "none",
|
|
250
246
|
height: size,
|
|
251
247
|
stroke: "currentColor",
|
|
@@ -255,36 +251,38 @@ var Trophy = function Trophy(_ref2) {
|
|
|
255
251
|
viewBox: "0 0 24 24",
|
|
256
252
|
width: size,
|
|
257
253
|
xmlns: "http://www.w3.org/2000/svg"
|
|
258
|
-
}, otherProps),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
254
|
+
}, otherProps), {}, {
|
|
255
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
256
|
+
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",
|
|
257
|
+
stroke: "currentColor",
|
|
258
|
+
strokeLinecap: "round",
|
|
259
|
+
strokeLinejoin: "round",
|
|
260
|
+
strokeWidth: "1.5"
|
|
261
|
+
}), /*#__PURE__*/jsx("path", {
|
|
262
|
+
d: "M13 16.6455V21.333",
|
|
263
|
+
stroke: "currentColor",
|
|
264
|
+
strokeLinecap: "round",
|
|
265
|
+
strokeLinejoin: "round",
|
|
266
|
+
strokeWidth: "1.5"
|
|
267
|
+
}), /*#__PURE__*/jsx("path", {
|
|
268
|
+
d: "M16.125 21.333H9.875",
|
|
269
|
+
stroke: "currentColor",
|
|
270
|
+
strokeLinecap: "round",
|
|
271
|
+
strokeLinejoin: "round",
|
|
272
|
+
strokeWidth: "1.5"
|
|
273
|
+
}), /*#__PURE__*/jsx("path", {
|
|
274
|
+
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",
|
|
275
|
+
stroke: "currentColor",
|
|
276
|
+
strokeLinecap: "round",
|
|
277
|
+
strokeLinejoin: "round",
|
|
278
|
+
strokeWidth: "1.5"
|
|
279
|
+
}), /*#__PURE__*/jsx("path", {
|
|
280
|
+
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",
|
|
281
|
+
stroke: "currentColor",
|
|
282
|
+
strokeLinecap: "round",
|
|
283
|
+
strokeLinejoin: "round",
|
|
284
|
+
strokeWidth: "1.5"
|
|
285
|
+
})]
|
|
288
286
|
}));
|
|
289
287
|
};
|
|
290
288
|
var MemoizedStar = /*#__PURE__*/React__default.memo(Star);
|
|
@@ -697,8 +695,8 @@ var _excluded$f = ["formId", "preview", "language"],
|
|
|
697
695
|
_excluded2$1 = ["formId", "language"],
|
|
698
696
|
_excluded3$1 = ["page", "pageSize"],
|
|
699
697
|
_excluded5 = ["formId", "submissionId"];
|
|
700
|
-
function ownKeys$
|
|
701
|
-
function _objectSpread$
|
|
698
|
+
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; }
|
|
699
|
+
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; }
|
|
702
700
|
var useForm = function useForm(_ref) {
|
|
703
701
|
var formId = _ref.formId,
|
|
704
702
|
_ref$preview = _ref.preview,
|
|
@@ -708,7 +706,7 @@ var useForm = function useForm(_ref) {
|
|
|
708
706
|
options = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
709
707
|
return useQuery([QUERY_KEYS.QUESTIONS, preview ? "preview/".concat(formId) : formId, language], function () {
|
|
710
708
|
return neetoFormApi.getPublicQuestions(formId, language);
|
|
711
|
-
}, _objectSpread$
|
|
709
|
+
}, _objectSpread$C({
|
|
712
710
|
keepPreviousData: true
|
|
713
711
|
}, options));
|
|
714
712
|
};
|
|
@@ -719,14 +717,14 @@ var useFetchQuestions = function useFetchQuestions(_ref2) {
|
|
|
719
717
|
options = _objectWithoutProperties$1(_ref2, _excluded2$1);
|
|
720
718
|
return useQuery([QUERY_KEYS.QUESTIONS, formId, language], function () {
|
|
721
719
|
return neetoFormApi.getQuestions(formId, language);
|
|
722
|
-
}, _objectSpread$
|
|
720
|
+
}, _objectSpread$C({
|
|
723
721
|
keepPreviousData: true
|
|
724
722
|
}, options));
|
|
725
723
|
};
|
|
726
724
|
var useCreateForm = function useCreateForm(options) {
|
|
727
725
|
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : i18next.resolvedLanguage;
|
|
728
726
|
var queryClient = useQueryClient();
|
|
729
|
-
return useMutation(neetoFormApi.createForm, _objectSpread$
|
|
727
|
+
return useMutation(neetoFormApi.createForm, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
730
728
|
onSuccess: function onSuccess(form) {
|
|
731
729
|
var _options$onSuccess;
|
|
732
730
|
queryClient.setQueryData(QUERY_KEYS.QUESTIONS, function (forms) {
|
|
@@ -746,7 +744,7 @@ var useUpdateForm = function useUpdateForm(options) {
|
|
|
746
744
|
var id = _ref3.id,
|
|
747
745
|
values = _ref3.values;
|
|
748
746
|
return neetoFormApi.updateForm(id, values);
|
|
749
|
-
}, _objectSpread$
|
|
747
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
750
748
|
onSuccess: function onSuccess(data, _ref4) {
|
|
751
749
|
var id = _ref4.id;
|
|
752
750
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], assoc("title", data.title));
|
|
@@ -766,7 +764,7 @@ var useCreateQuestion = function useCreateQuestion(formId, language) {
|
|
|
766
764
|
var queryClient = useQueryClient();
|
|
767
765
|
return useMutation(function (payload) {
|
|
768
766
|
return neetoFormApi.createQuestion(formId, filterNonNull(payload));
|
|
769
|
-
}, _objectSpread$
|
|
767
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
770
768
|
onSuccess: function onSuccess() {
|
|
771
769
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
772
770
|
args[_key] = arguments[_key];
|
|
@@ -792,7 +790,7 @@ var useUpdateQuestion = function useUpdateQuestion(formId, language) {
|
|
|
792
790
|
questionId: questionId,
|
|
793
791
|
payload: filterNonNull(payload)
|
|
794
792
|
});
|
|
795
|
-
}, _objectSpread$
|
|
793
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
796
794
|
onSuccess: function onSuccess() {
|
|
797
795
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
798
796
|
args[_key2] = arguments[_key2];
|
|
@@ -812,7 +810,7 @@ var useDeleteQuestion = function useDeleteQuestion(formId, language) {
|
|
|
812
810
|
var queryClient = useQueryClient();
|
|
813
811
|
return useMutation(function (questionId) {
|
|
814
812
|
return neetoFormApi.deleteQuestion(formId, questionId);
|
|
815
|
-
}, _objectSpread$
|
|
813
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
816
814
|
onSuccess: function onSuccess() {
|
|
817
815
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
818
816
|
args[_key3] = arguments[_key3];
|
|
@@ -832,7 +830,7 @@ var useReorderQuestions = function useReorderQuestions(formId, language) {
|
|
|
832
830
|
var queryClient = useQueryClient();
|
|
833
831
|
return useMutation(function (payload) {
|
|
834
832
|
return neetoFormApi.reorderQuestions(formId, filterNonNull(payload));
|
|
835
|
-
}, _objectSpread$
|
|
833
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
836
834
|
onSuccess: function onSuccess() {
|
|
837
835
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
838
836
|
args[_key4] = arguments[_key4];
|
|
@@ -859,7 +857,7 @@ var useForms = function useForms() {
|
|
|
859
857
|
page: page,
|
|
860
858
|
pageSize: pageSize
|
|
861
859
|
});
|
|
862
|
-
}, _objectSpread$
|
|
860
|
+
}, _objectSpread$C({
|
|
863
861
|
keepPreviousData: true
|
|
864
862
|
}, options));
|
|
865
863
|
};
|
|
@@ -867,7 +865,7 @@ var useDeleteForm = function useDeleteForm(options) {
|
|
|
867
865
|
return useMutationWithInvalidation(function (_ref7) {
|
|
868
866
|
var id = _ref7.id;
|
|
869
867
|
return neetoFormApi.destroyForm(id);
|
|
870
|
-
}, _objectSpread$
|
|
868
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
871
869
|
keysToInvalidate: [[QUERY_KEYS.FORMS], function (_, _ref8) {
|
|
872
870
|
var id = _ref8.id;
|
|
873
871
|
return [QUERY_KEYS.QUESTIONS, id];
|
|
@@ -886,7 +884,7 @@ var useSubmission = function useSubmission(_ref11) {
|
|
|
886
884
|
options = _objectWithoutProperties$1(_ref11, _excluded5);
|
|
887
885
|
return useQuery([QUERY_KEYS.SUBMISSION, formId, submissionId], function () {
|
|
888
886
|
return neetoFormApi.getPublicSubmission(formId, submissionId);
|
|
889
|
-
}, _objectSpread$
|
|
887
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
890
888
|
keepPreviousData: true
|
|
891
889
|
}));
|
|
892
890
|
};
|
|
@@ -896,7 +894,7 @@ var useCreateSubmission = function useCreateSubmission(options) {
|
|
|
896
894
|
var formId = _ref12.formId,
|
|
897
895
|
values = _ref12.values;
|
|
898
896
|
return neetoFormApi.submitPublicForm(formId, values);
|
|
899
|
-
}, _objectSpread$
|
|
897
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
900
898
|
onSuccess: function onSuccess() {
|
|
901
899
|
var _data$submission, _data$submission2;
|
|
902
900
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
@@ -917,7 +915,7 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
917
915
|
var formId = _ref13.formId,
|
|
918
916
|
values = _ref13.values;
|
|
919
917
|
return neetoFormApi.updatePublicSubmission(formId, values);
|
|
920
|
-
}, _objectSpread$
|
|
918
|
+
}, _objectSpread$C(_objectSpread$C({}, options), {}, {
|
|
921
919
|
onSuccess: function onSuccess() {
|
|
922
920
|
var _data$submission3;
|
|
923
921
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
@@ -1022,7 +1020,7 @@ function _defineProperty$5(obj, key, value) {
|
|
|
1022
1020
|
return obj;
|
|
1023
1021
|
}
|
|
1024
1022
|
|
|
1025
|
-
function ownKeys$
|
|
1023
|
+
function ownKeys$C(e, r) {
|
|
1026
1024
|
var t = Object.keys(e);
|
|
1027
1025
|
if (Object.getOwnPropertySymbols) {
|
|
1028
1026
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -1035,9 +1033,9 @@ function ownKeys$n(e, r) {
|
|
|
1035
1033
|
function _objectSpread2(e) {
|
|
1036
1034
|
for (var r = 1; r < arguments.length; r++) {
|
|
1037
1035
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
1038
|
-
r % 2 ? ownKeys$
|
|
1036
|
+
r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) {
|
|
1039
1037
|
_defineProperty$5(e, r, t[r]);
|
|
1040
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$
|
|
1038
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) {
|
|
1041
1039
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
1042
1040
|
});
|
|
1043
1041
|
}
|
|
@@ -9929,6 +9927,13 @@ useWith(path, [split(".")]);
|
|
|
9929
9927
|
var isFunction$1 = function isFunction(obj) {
|
|
9930
9928
|
return typeof obj === "function";
|
|
9931
9929
|
};
|
|
9930
|
+
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
9931
|
+
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
9932
|
+
var fallback = question["".concat(fieldName, "Fallback")];
|
|
9933
|
+
var field = question[fieldName];
|
|
9934
|
+
var isFieldEmpty = hasRichContent ? isEditorEmpty(field) : isEmpty(field);
|
|
9935
|
+
return isFieldEmpty && isNotNil(fallback) ? fallback : field;
|
|
9936
|
+
};
|
|
9932
9937
|
|
|
9933
9938
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
9934
9939
|
var useBuildFormStore = create$2(withImmutableActions(function (set) {
|
|
@@ -11567,13 +11572,6 @@ var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
|
|
|
11567
11572
|
var generateArray = function generateArray(start, end) {
|
|
11568
11573
|
return range(start, end + 1);
|
|
11569
11574
|
};
|
|
11570
|
-
var isElementOverflowing = function isElementOverflowing(_ref2) {
|
|
11571
|
-
var clientWidth = _ref2.clientWidth,
|
|
11572
|
-
clientHeight = _ref2.clientHeight,
|
|
11573
|
-
scrollWidth = _ref2.scrollWidth,
|
|
11574
|
-
scrollHeight = _ref2.scrollHeight;
|
|
11575
|
-
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
11576
|
-
};
|
|
11577
11575
|
var htmlToPlainText = function htmlToPlainText(htmlContent) {
|
|
11578
11576
|
var formattedContent = htmlContent.replaceAll(EMPTY_PARAGRAPH_REGEX, "\n");
|
|
11579
11577
|
var node = document.createElement("div");
|
|
@@ -11816,9 +11814,8 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11816
11814
|
var questionKind = selectedQuestion.kind;
|
|
11817
11815
|
var independentLabel = INDEPENDENT_LABELS_MAP[questionKind];
|
|
11818
11816
|
if (isPresent$1(independentLabel)) return independentLabel;
|
|
11819
|
-
var questionLabel = selectedQuestion
|
|
11820
|
-
|
|
11821
|
-
return isPresent$1(questionLabel) ? truncate(questionLabel, 40) : humanize(questionKind);
|
|
11817
|
+
var questionLabel = fieldWithFallback(selectedQuestion, "label");
|
|
11818
|
+
return truncate(questionLabel, 40);
|
|
11822
11819
|
};
|
|
11823
11820
|
var _useDeleteQuestion = useDeleteQuestion(selectedQuestion === null || selectedQuestion === void 0 ? void 0 : selectedQuestion.formId, selectedLanguage, {
|
|
11824
11821
|
onSuccess: function onSuccess() {
|
|
@@ -11845,13 +11842,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11845
11842
|
}
|
|
11846
11843
|
});
|
|
11847
11844
|
};
|
|
11848
|
-
return /*#__PURE__*/
|
|
11845
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
11849
11846
|
isOpen: isOpen,
|
|
11850
11847
|
onClose: onClose,
|
|
11851
11848
|
isSubmitting: isDeleting,
|
|
11852
11849
|
submitButtonLabel: t("neetoForm.common.delete"),
|
|
11853
11850
|
title: t("neetoForm.questions.deleteAlert.title"),
|
|
11854
|
-
message: isPresent$1(selectedQuestion) && /*#__PURE__*/
|
|
11851
|
+
message: isPresent$1(selectedQuestion) && /*#__PURE__*/jsx(Trans, {
|
|
11855
11852
|
i18nKey: "neetoForm.questions.deleteAlert.message",
|
|
11856
11853
|
values: {
|
|
11857
11854
|
count: languagesCount,
|
|
@@ -11890,34 +11887,42 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
11890
11887
|
var selectedLanguageName = (_findBy = findBy({
|
|
11891
11888
|
code: currentLanguage
|
|
11892
11889
|
}, languages)) === null || _findBy === void 0 ? void 0 : _findBy.name;
|
|
11893
|
-
return /*#__PURE__*/
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11890
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11891
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
11892
|
+
content: t("neetoForm.questions.changeLanguage"),
|
|
11893
|
+
children: /*#__PURE__*/jsx("div", {
|
|
11894
|
+
children: /*#__PURE__*/jsx(Dropdown, {
|
|
11895
|
+
buttonStyle: "secondary",
|
|
11896
|
+
label: selectedLanguageName,
|
|
11897
|
+
children: /*#__PURE__*/jsx(Dropdown.Menu, {
|
|
11898
|
+
children: languages.map(function (_ref2) {
|
|
11899
|
+
var code = _ref2.code,
|
|
11900
|
+
name = _ref2.name;
|
|
11901
|
+
return /*#__PURE__*/jsx(Dropdown.MenuItem.Button, {
|
|
11902
|
+
isActive: currentLanguage === code,
|
|
11903
|
+
onClick: function onClick() {
|
|
11904
|
+
return languageChangeHandler(code);
|
|
11905
|
+
},
|
|
11906
|
+
children: name
|
|
11907
|
+
}, code);
|
|
11908
|
+
})
|
|
11909
|
+
})
|
|
11910
|
+
})
|
|
11911
|
+
})
|
|
11912
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
11913
|
+
isOpen: isUnsavedChangesAlertOpen,
|
|
11914
|
+
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11915
|
+
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11916
|
+
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11917
|
+
onClose: function onClose() {
|
|
11918
|
+
return setIsUnsavedChangesAlertOpen(false);
|
|
11919
|
+
},
|
|
11920
|
+
onSubmit: function onSubmit() {
|
|
11921
|
+
onChange(selectedLanguage);
|
|
11922
|
+
setIsUnsavedChangesAlertOpen(false);
|
|
11906
11923
|
}
|
|
11907
|
-
}
|
|
11908
|
-
})
|
|
11909
|
-
isOpen: isUnsavedChangesAlertOpen,
|
|
11910
|
-
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11911
|
-
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11912
|
-
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11913
|
-
onClose: function onClose() {
|
|
11914
|
-
return setIsUnsavedChangesAlertOpen(false);
|
|
11915
|
-
},
|
|
11916
|
-
onSubmit: function onSubmit() {
|
|
11917
|
-
onChange(selectedLanguage);
|
|
11918
|
-
setIsUnsavedChangesAlertOpen(false);
|
|
11919
|
-
}
|
|
11920
|
-
}));
|
|
11924
|
+
})]
|
|
11925
|
+
});
|
|
11921
11926
|
};
|
|
11922
11927
|
|
|
11923
11928
|
var Overview = function Overview(_ref) {
|
|
@@ -11927,56 +11932,65 @@ var Overview = function Overview(_ref) {
|
|
|
11927
11932
|
selectedLanguage = _ref.selectedLanguage,
|
|
11928
11933
|
onLanguageChange = _ref.onLanguageChange,
|
|
11929
11934
|
additionalActionOptions = _ref.additionalActionOptions;
|
|
11930
|
-
return /*#__PURE__*/
|
|
11931
|
-
className: "mb-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11935
|
+
return /*#__PURE__*/jsxs("div", {
|
|
11936
|
+
className: "neeto-form-nano-form-wrapper__overview mb-4 w-full flex-shrink-0 space-y-4 px-6 pt-6",
|
|
11937
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
11938
|
+
className: "flex items-center justify-between",
|
|
11939
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
11940
|
+
"data-cy": "neeto-form-engine-overview-title",
|
|
11941
|
+
lineHeight: "neeto-ui-leading-normal",
|
|
11942
|
+
style: "h2",
|
|
11943
|
+
weight: "neeto-ui-font-semibold",
|
|
11944
|
+
children: title
|
|
11945
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
11946
|
+
className: "flex flex-shrink-0 items-center justify-between space-x-1",
|
|
11947
|
+
children: [availableLanguages.length > 1 && /*#__PURE__*/jsx(ChangeLanguageDropdown, {
|
|
11948
|
+
currentLanguage: selectedLanguage,
|
|
11949
|
+
languages: availableLanguages,
|
|
11950
|
+
onChange: onLanguageChange
|
|
11951
|
+
}), isPresent$1(additionalActionOptions) && /*#__PURE__*/jsx(MoreDropdown, {
|
|
11952
|
+
dropdownButtonProps: {
|
|
11953
|
+
isRounded: true,
|
|
11954
|
+
style: "tertiary"
|
|
11955
|
+
},
|
|
11956
|
+
dropdownProps: {
|
|
11957
|
+
strategy: "fixed",
|
|
11958
|
+
position: "bottom-start"
|
|
11959
|
+
},
|
|
11960
|
+
menuItems: additionalActionOptions
|
|
11961
|
+
})]
|
|
11962
|
+
})]
|
|
11963
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
11964
|
+
"data-cy": "neeto-form-engine-overview-description",
|
|
11965
|
+
style: "body2",
|
|
11966
|
+
children: description
|
|
11967
|
+
})]
|
|
11968
|
+
});
|
|
11959
11969
|
};
|
|
11960
11970
|
|
|
11961
11971
|
var _excluded$c = ["size", "color"],
|
|
11962
11972
|
_excluded2 = ["size", "color"],
|
|
11963
11973
|
_excluded3 = ["size", "color"],
|
|
11964
11974
|
_excluded4 = ["size", "color"];
|
|
11975
|
+
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; }
|
|
11976
|
+
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; }
|
|
11965
11977
|
var BadSmiley = function BadSmiley(props) {
|
|
11966
11978
|
var size = props.size,
|
|
11967
11979
|
color = props.color,
|
|
11968
11980
|
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
11969
|
-
return /*#__PURE__*/
|
|
11981
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
11970
11982
|
fill: "none",
|
|
11971
11983
|
height: size,
|
|
11972
11984
|
viewBox: "0 0 48 48",
|
|
11973
11985
|
width: size
|
|
11974
|
-
}, other),
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11986
|
+
}, other), {}, {
|
|
11987
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
11988
|
+
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",
|
|
11989
|
+
fill: color
|
|
11990
|
+
}), /*#__PURE__*/jsx("path", {
|
|
11991
|
+
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",
|
|
11992
|
+
fill: color
|
|
11993
|
+
})]
|
|
11980
11994
|
}));
|
|
11981
11995
|
};
|
|
11982
11996
|
BadSmiley.defaultProps = {
|
|
@@ -11988,17 +12002,19 @@ var OkaySmiley = function OkaySmiley(props) {
|
|
|
11988
12002
|
var size = props.size,
|
|
11989
12003
|
color = props.color,
|
|
11990
12004
|
other = _objectWithoutProperties$1(props, _excluded2);
|
|
11991
|
-
return /*#__PURE__*/
|
|
12005
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
11992
12006
|
fill: "none",
|
|
11993
12007
|
height: size,
|
|
11994
12008
|
viewBox: "0 0 48 48",
|
|
11995
12009
|
width: size
|
|
11996
|
-
}, other),
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12010
|
+
}, other), {}, {
|
|
12011
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
12012
|
+
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",
|
|
12013
|
+
fill: color
|
|
12014
|
+
}), /*#__PURE__*/jsx("path", {
|
|
12015
|
+
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",
|
|
12016
|
+
fill: color
|
|
12017
|
+
})]
|
|
12002
12018
|
}));
|
|
12003
12019
|
};
|
|
12004
12020
|
OkaySmiley.defaultProps = {
|
|
@@ -12010,17 +12026,19 @@ var GoodSmiley = function GoodSmiley(props) {
|
|
|
12010
12026
|
var size = props.size,
|
|
12011
12027
|
color = props.color,
|
|
12012
12028
|
other = _objectWithoutProperties$1(props, _excluded3);
|
|
12013
|
-
return /*#__PURE__*/
|
|
12029
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12014
12030
|
fill: "none",
|
|
12015
12031
|
height: size,
|
|
12016
12032
|
viewBox: "0 0 48 48",
|
|
12017
12033
|
width: size
|
|
12018
|
-
}, other),
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12034
|
+
}, other), {}, {
|
|
12035
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
12036
|
+
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",
|
|
12037
|
+
fill: color
|
|
12038
|
+
}), /*#__PURE__*/jsx("path", {
|
|
12039
|
+
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",
|
|
12040
|
+
fill: color
|
|
12041
|
+
})]
|
|
12024
12042
|
}));
|
|
12025
12043
|
};
|
|
12026
12044
|
GoodSmiley.defaultProps = {
|
|
@@ -12032,18 +12050,31 @@ var Drag = function Drag(props) {
|
|
|
12032
12050
|
var size = props.size,
|
|
12033
12051
|
color = props.color,
|
|
12034
12052
|
other = _objectWithoutProperties$1(props, _excluded4);
|
|
12035
|
-
return /*#__PURE__*/
|
|
12053
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12036
12054
|
fill: "none",
|
|
12037
12055
|
height: size,
|
|
12038
12056
|
viewBox: "0 0 24 24",
|
|
12039
12057
|
width: size
|
|
12040
|
-
}, other),
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12058
|
+
}, other), {}, {
|
|
12059
|
+
children: [/*#__PURE__*/jsx("g", {
|
|
12060
|
+
clipPath: "url(#clip0_6290_43)",
|
|
12061
|
+
fill: color,
|
|
12062
|
+
stroke: color,
|
|
12063
|
+
strokeLinecap: "round",
|
|
12064
|
+
strokeLinejoin: "round",
|
|
12065
|
+
strokeWidth: "1.5",
|
|
12066
|
+
children: /*#__PURE__*/jsx("path", {
|
|
12067
|
+
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"
|
|
12068
|
+
})
|
|
12069
|
+
}), /*#__PURE__*/jsx("defs", {
|
|
12070
|
+
children: /*#__PURE__*/jsx("clipPath", {
|
|
12071
|
+
id: "clip0_6290_43",
|
|
12072
|
+
children: /*#__PURE__*/jsx("path", {
|
|
12073
|
+
d: "M0 0H24V24H0z",
|
|
12074
|
+
fill: color
|
|
12075
|
+
})
|
|
12076
|
+
})
|
|
12077
|
+
})]
|
|
12047
12078
|
}));
|
|
12048
12079
|
};
|
|
12049
12080
|
Drag.defaultProps = {
|
|
@@ -12077,11 +12108,6 @@ var Card = function Card(_ref) {
|
|
|
12077
12108
|
onEdit = _ref.onEdit,
|
|
12078
12109
|
onClone = _ref.onClone,
|
|
12079
12110
|
onDelete = _ref.onDelete;
|
|
12080
|
-
var _useState = useState(false),
|
|
12081
|
-
_useState2 = _slicedToArray$3(_useState, 2),
|
|
12082
|
-
isTooltipEnabled = _useState2[0],
|
|
12083
|
-
setIsTooltipEnabled = _useState2[1];
|
|
12084
|
-
var questionLabelRef = useRef(null);
|
|
12085
12111
|
var _useTranslation = useTranslation(),
|
|
12086
12112
|
t = _useTranslation.t;
|
|
12087
12113
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
@@ -12089,61 +12115,59 @@ var Card = function Card(_ref) {
|
|
|
12089
12115
|
item: question
|
|
12090
12116
|
}),
|
|
12091
12117
|
kind = _getActiveKindDetails.kind,
|
|
12092
|
-
label = _getActiveKindDetails.label,
|
|
12093
12118
|
isSingular = _getActiveKindDetails.isSingular;
|
|
12119
|
+
var label = fieldWithFallback(question, "label");
|
|
12094
12120
|
var questionLabel = isRichTextQuestion(kind) ? htmlToPlainText(label) : label;
|
|
12095
|
-
|
|
12096
|
-
var element = questionLabelRef.current;
|
|
12097
|
-
if (isNotPresent(element)) return;
|
|
12098
|
-
setIsTooltipEnabled(isElementOverflowing(element));
|
|
12099
|
-
}, [questionLabel]);
|
|
12100
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
12121
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12101
12122
|
"data-cy": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
12102
|
-
className: classnames("neeto-ui-rounded neeto-ui-border-gray-300 flex h-10 w-full items-center justify-between border p-2", {
|
|
12103
|
-
"neeto-ui-border-primary-500
|
|
12123
|
+
className: classnames("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", {
|
|
12124
|
+
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
12104
12125
|
}),
|
|
12105
12126
|
onClick: function onClick() {
|
|
12106
12127
|
return onSelect(question);
|
|
12107
|
-
}
|
|
12108
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
12109
|
-
className: "flex items-center justify-between space-x-2"
|
|
12110
|
-
}, /*#__PURE__*/React__default.createElement(Drag, {
|
|
12111
|
-
className: "flex-shrink-0 cursor-move"
|
|
12112
|
-
}), /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
12113
|
-
content: questionLabel,
|
|
12114
|
-
disabled: !isTooltipEnabled,
|
|
12115
|
-
position: "top"
|
|
12116
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
12117
|
-
className: "max-w-md truncate",
|
|
12118
|
-
lineHeight: "neeto-ui-leading-tight",
|
|
12119
|
-
ref: questionLabelRef,
|
|
12120
|
-
style: "h5",
|
|
12121
|
-
weight: "neeto-ui-font-medium"
|
|
12122
|
-
}, questionLabel))), /*#__PURE__*/React__default.createElement(MoreDropdown, {
|
|
12123
|
-
dropdownProps: {
|
|
12124
|
-
strategy: "fixed"
|
|
12125
12128
|
},
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
}, {
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12129
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
12130
|
+
className: "flex min-w-0 flex-grow items-center gap-1",
|
|
12131
|
+
children: [/*#__PURE__*/jsx(Drag, {
|
|
12132
|
+
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
12133
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
12134
|
+
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
12135
|
+
lineHeight: "snug",
|
|
12136
|
+
style: "body2",
|
|
12137
|
+
weight: "medium",
|
|
12138
|
+
children: questionLabel
|
|
12139
|
+
})]
|
|
12140
|
+
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
12141
|
+
dropdownButtonProps: {
|
|
12142
|
+
className: "shrink-0"
|
|
12143
|
+
},
|
|
12144
|
+
dropdownProps: {
|
|
12145
|
+
strategy: "fixed"
|
|
12146
|
+
},
|
|
12147
|
+
menuItems: [{
|
|
12148
|
+
"data-cy": "edit-question",
|
|
12149
|
+
key: "edit",
|
|
12150
|
+
label: t("neetoForm.common.edit"),
|
|
12151
|
+
onClick: onEdit
|
|
12152
|
+
}, {
|
|
12153
|
+
"data-cy": "clone-question",
|
|
12154
|
+
key: "clone",
|
|
12155
|
+
label: t("neetoForm.common.clone"),
|
|
12156
|
+
isVisible: !isSingular && isFunction$1(onClone),
|
|
12157
|
+
onClick: onClone
|
|
12158
|
+
}, {
|
|
12159
|
+
"data-cy": "delete-question",
|
|
12160
|
+
key: "delete",
|
|
12161
|
+
label: t("neetoForm.common.delete"),
|
|
12162
|
+
isVisible: isFunction$1(onDelete),
|
|
12163
|
+
onClick: onDelete
|
|
12164
|
+
}]
|
|
12165
|
+
})]
|
|
12166
|
+
});
|
|
12145
12167
|
};
|
|
12146
12168
|
|
|
12169
|
+
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; }
|
|
12170
|
+
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; }
|
|
12147
12171
|
var Questions = function Questions(_ref) {
|
|
12148
12172
|
var questions = _ref.questions,
|
|
12149
12173
|
isDeletable = _ref.isDeletable,
|
|
@@ -12154,39 +12178,42 @@ var Questions = function Questions(_ref) {
|
|
|
12154
12178
|
onClone = _ref.onClone,
|
|
12155
12179
|
onDelete = _ref.onDelete,
|
|
12156
12180
|
onSelect = _ref.onSelect;
|
|
12157
|
-
return /*#__PURE__*/
|
|
12158
|
-
droppableId: "droppable"
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12181
|
+
return /*#__PURE__*/jsx(ConnectedDroppable$1, {
|
|
12182
|
+
droppableId: "droppable",
|
|
12183
|
+
children: function children(_ref2) {
|
|
12184
|
+
var droppableProps = _ref2.droppableProps,
|
|
12185
|
+
placeholder = _ref2.placeholder,
|
|
12186
|
+
innerRef = _ref2.innerRef;
|
|
12187
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$A(_objectSpread$A({}, droppableProps), {}, {
|
|
12188
|
+
className: "space-y-2",
|
|
12189
|
+
ref: innerRef,
|
|
12190
|
+
children: [questions.map(function (question, index) {
|
|
12191
|
+
var _question$id, _question$id2;
|
|
12192
|
+
return /*#__PURE__*/createElement(PublicDraggable, {
|
|
12193
|
+
index: index,
|
|
12194
|
+
draggableId: "question-".concat((_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId),
|
|
12195
|
+
key: "question-".concat((_question$id2 = question.id) !== null && _question$id2 !== void 0 ? _question$id2 : question.nodeId)
|
|
12196
|
+
}, function (_ref3) {
|
|
12197
|
+
var draggableProps = _ref3.draggableProps,
|
|
12198
|
+
dragHandleProps = _ref3.dragHandleProps,
|
|
12199
|
+
innerRef = _ref3.innerRef;
|
|
12200
|
+
return /*#__PURE__*/jsx("div", _objectSpread$A(_objectSpread$A(_objectSpread$A({}, draggableProps), dragHandleProps), {}, {
|
|
12201
|
+
ref: innerRef,
|
|
12202
|
+
children: /*#__PURE__*/jsx(Card, {
|
|
12203
|
+
allQuestionKinds: allQuestionKinds,
|
|
12204
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
12205
|
+
onClone: onClone,
|
|
12206
|
+
onEdit: onEdit,
|
|
12207
|
+
onSelect: onSelect,
|
|
12208
|
+
question: question,
|
|
12209
|
+
isActive: equals(selectedQuestion, question),
|
|
12210
|
+
onDelete: isDeletable(question) && onDelete
|
|
12211
|
+
})
|
|
12212
|
+
}));
|
|
12213
|
+
});
|
|
12214
|
+
}), placeholder]
|
|
12215
|
+
}));
|
|
12216
|
+
}
|
|
12190
12217
|
});
|
|
12191
12218
|
};
|
|
12192
12219
|
|
|
@@ -12267,8 +12294,8 @@ var arrayHelpers = {
|
|
|
12267
12294
|
moveItem: moveItem
|
|
12268
12295
|
};
|
|
12269
12296
|
|
|
12270
|
-
function ownKeys$
|
|
12271
|
-
function _objectSpread$
|
|
12297
|
+
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; }
|
|
12298
|
+
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; }
|
|
12272
12299
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
12273
12300
|
var fieldCodes = pluck("fieldCode", filterBy({
|
|
12274
12301
|
kind: type
|
|
@@ -12304,7 +12331,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
|
|
|
12304
12331
|
var nextItems = _toConsumableArray$1(items);
|
|
12305
12332
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
12306
12333
|
var orderedItems = nextItems.map(function (item, index) {
|
|
12307
|
-
return _objectSpread$
|
|
12334
|
+
return _objectSpread$z(_objectSpread$z({}, item), {}, {
|
|
12308
12335
|
displayOrder: index
|
|
12309
12336
|
});
|
|
12310
12337
|
});
|
|
@@ -12318,7 +12345,7 @@ var createFieldData = function createFieldData(_ref3) {
|
|
|
12318
12345
|
_ref3$isRequired = _ref3.isRequired,
|
|
12319
12346
|
isRequired = _ref3$isRequired === void 0 ? undefined : _ref3$isRequired,
|
|
12320
12347
|
questions = _ref3.questions;
|
|
12321
|
-
return _objectSpread$
|
|
12348
|
+
return _objectSpread$z(_objectSpread$z({}, defaults), {}, {
|
|
12322
12349
|
metadata: metadata,
|
|
12323
12350
|
isRequired: isRequired,
|
|
12324
12351
|
kind: type,
|
|
@@ -12335,14 +12362,14 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
12335
12362
|
}, questionKinds);
|
|
12336
12363
|
var isRequired = item.isRequired,
|
|
12337
12364
|
kind = item.kind,
|
|
12338
|
-
label = item.label,
|
|
12339
12365
|
optionsAttributes = item.optionsAttributes;
|
|
12366
|
+
var label = fieldWithFallback(item, "label");
|
|
12340
12367
|
var defaultAttributeNames = keys(questionKind.defaults || {});
|
|
12341
12368
|
var defaultAttributes = pick(defaultAttributeNames, item);
|
|
12342
12369
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : t$4("neetoForm.common.clonedElementLabel", {
|
|
12343
12370
|
label: label
|
|
12344
12371
|
});
|
|
12345
|
-
return _objectSpread$
|
|
12372
|
+
return _objectSpread$z(_objectSpread$z({}, defaultAttributes), {}, {
|
|
12346
12373
|
isRequired: isRequired,
|
|
12347
12374
|
kind: kind,
|
|
12348
12375
|
label: newQuestionLabel,
|
|
@@ -12400,11 +12427,13 @@ const SvgNoQuestions = props => /*#__PURE__*/React$2.createElement("svg", _exten
|
|
|
12400
12427
|
|
|
12401
12428
|
var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
12402
12429
|
var children = _ref.children;
|
|
12403
|
-
return /*#__PURE__*/
|
|
12404
|
-
className: "flex h-full flex-col items-center justify-center py-8"
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12430
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12431
|
+
className: "flex h-full flex-col items-center justify-center py-8",
|
|
12432
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
12433
|
+
className: "mb-6",
|
|
12434
|
+
children: /*#__PURE__*/jsx(SvgNoQuestions, {})
|
|
12435
|
+
}), children]
|
|
12436
|
+
});
|
|
12408
12437
|
};
|
|
12409
12438
|
|
|
12410
12439
|
var NAME = QUESTION_TYPES.NAME,
|
|
@@ -12440,6 +12469,8 @@ var INITIAL_VALUES = {
|
|
|
12440
12469
|
};
|
|
12441
12470
|
|
|
12442
12471
|
var _excluded$b = ["label", "name"];
|
|
12472
|
+
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; }
|
|
12473
|
+
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; }
|
|
12443
12474
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
12444
12475
|
var label = _ref.label,
|
|
12445
12476
|
name = _ref.name,
|
|
@@ -12455,7 +12486,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
12455
12486
|
var end = element.value.length;
|
|
12456
12487
|
element.setSelectionRange(end, end);
|
|
12457
12488
|
};
|
|
12458
|
-
return /*#__PURE__*/
|
|
12489
|
+
return /*#__PURE__*/jsx(Textarea, _objectSpread$y({
|
|
12459
12490
|
label: label,
|
|
12460
12491
|
name: name,
|
|
12461
12492
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -12473,19 +12504,23 @@ var Block = function Block(_ref) {
|
|
|
12473
12504
|
var title = _ref.title,
|
|
12474
12505
|
children = _ref.children,
|
|
12475
12506
|
dataCy = _ref.dataCy;
|
|
12476
|
-
return /*#__PURE__*/
|
|
12507
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12477
12508
|
className: "mt-4 space-y-4",
|
|
12478
|
-
"data-cy": dataCy
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12509
|
+
"data-cy": dataCy,
|
|
12510
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
12511
|
+
className: "flex items-center justify-between",
|
|
12512
|
+
"data-cy": "properties-header",
|
|
12513
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
12514
|
+
lineHeight: "normal",
|
|
12515
|
+
style: "body1",
|
|
12516
|
+
weight: "semibold",
|
|
12517
|
+
children: title
|
|
12518
|
+
})
|
|
12519
|
+
}), /*#__PURE__*/jsx("div", {
|
|
12520
|
+
className: "space-y-4",
|
|
12521
|
+
children: children
|
|
12522
|
+
})]
|
|
12523
|
+
});
|
|
12489
12524
|
};
|
|
12490
12525
|
|
|
12491
12526
|
var useUpdateEditorContent = function useUpdateEditorContent(_ref) {
|
|
@@ -12575,33 +12610,37 @@ var Editor = function Editor() {
|
|
|
12575
12610
|
initialValue: initialValue,
|
|
12576
12611
|
fieldCode: fieldCode
|
|
12577
12612
|
});
|
|
12578
|
-
return /*#__PURE__*/
|
|
12579
|
-
className: "w-full cursor-auto"
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12613
|
+
return /*#__PURE__*/jsx("div", {
|
|
12614
|
+
className: "w-full cursor-auto",
|
|
12615
|
+
children: /*#__PURE__*/jsx(Editor$1, {
|
|
12616
|
+
required: true,
|
|
12617
|
+
error: touched ? error : "",
|
|
12618
|
+
id: "editor",
|
|
12619
|
+
initialValue: value,
|
|
12620
|
+
name: fieldName,
|
|
12621
|
+
ref: editorRef,
|
|
12622
|
+
onBlur: function onBlur() {
|
|
12623
|
+
return setTouched(true);
|
|
12624
|
+
},
|
|
12625
|
+
onChange: setValue
|
|
12626
|
+
})
|
|
12627
|
+
});
|
|
12592
12628
|
};
|
|
12593
12629
|
|
|
12594
12630
|
var RequiredSwitch = withT(function (_ref) {
|
|
12595
12631
|
var t = _ref.t;
|
|
12596
|
-
return /*#__PURE__*/
|
|
12597
|
-
className: "w-full"
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12632
|
+
return /*#__PURE__*/jsx("div", {
|
|
12633
|
+
className: "w-full",
|
|
12634
|
+
children: /*#__PURE__*/jsx(Switch, {
|
|
12635
|
+
label: t("neetoForm.questions.common.questionFields.field.required"),
|
|
12636
|
+
name: "isRequired"
|
|
12637
|
+
})
|
|
12638
|
+
});
|
|
12602
12639
|
});
|
|
12603
12640
|
|
|
12604
12641
|
var _excluded$a = ["maxLength"];
|
|
12642
|
+
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; }
|
|
12643
|
+
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; }
|
|
12605
12644
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
12606
12645
|
var maxLength = _ref.maxLength,
|
|
12607
12646
|
props = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
@@ -12615,38 +12654,40 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
12615
12654
|
}
|
|
12616
12655
|
}, [value, maxLength, setValue]);
|
|
12617
12656
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
12618
|
-
return /*#__PURE__*/
|
|
12657
|
+
return /*#__PURE__*/jsx(Input, _objectSpread$x(_objectSpread$x({}, props), shouldShowMaxLength && {
|
|
12619
12658
|
maxLength: maxLength
|
|
12620
12659
|
}));
|
|
12621
12660
|
};
|
|
12622
12661
|
|
|
12623
12662
|
var FieldCode = withT(function (_ref) {
|
|
12624
12663
|
var t = _ref.t;
|
|
12625
|
-
return /*#__PURE__*/
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12664
|
+
return /*#__PURE__*/jsx("div", {
|
|
12665
|
+
children: /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
12666
|
+
required: true,
|
|
12667
|
+
label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
|
|
12668
|
+
name: "fieldCode",
|
|
12669
|
+
helpText: /*#__PURE__*/jsx(Trans, {
|
|
12670
|
+
i18nKey: "neetoForm.questions.common.questionFields.field.fieldCodeHelpDescription",
|
|
12671
|
+
components: {
|
|
12672
|
+
Link: /*#__PURE__*/jsx(Button$1, {
|
|
12673
|
+
className: "text-xs",
|
|
12674
|
+
href: FIELD_CODE_DOC,
|
|
12675
|
+
style: "link",
|
|
12676
|
+
target: "_blank"
|
|
12677
|
+
})
|
|
12678
|
+
}
|
|
12679
|
+
}),
|
|
12680
|
+
labelProps: {
|
|
12681
|
+
helpIconProps: {
|
|
12682
|
+
icon: Info,
|
|
12683
|
+
className: "cursor-pointer",
|
|
12684
|
+
onClick: function onClick() {
|
|
12685
|
+
return window.open(FIELD_CODE_DOC, "_blank");
|
|
12686
|
+
}
|
|
12646
12687
|
}
|
|
12647
12688
|
}
|
|
12648
|
-
}
|
|
12649
|
-
})
|
|
12689
|
+
})
|
|
12690
|
+
});
|
|
12650
12691
|
});
|
|
12651
12692
|
|
|
12652
12693
|
var Form$1 = function Form(_ref) {
|
|
@@ -12704,43 +12745,50 @@ var Form$1 = function Form(_ref) {
|
|
|
12704
12745
|
setErrors({});
|
|
12705
12746
|
setTouched({});
|
|
12706
12747
|
};
|
|
12707
|
-
return /*#__PURE__*/
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12748
|
+
return /*#__PURE__*/jsx(Pane.Body, {
|
|
12749
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
12750
|
+
className: "w-full space-y-4",
|
|
12751
|
+
children: [/*#__PURE__*/jsx(Select, {
|
|
12752
|
+
isClearable: true,
|
|
12753
|
+
isSearchable: true,
|
|
12754
|
+
defaultValue: buildDefaultValueForKind(questionKind),
|
|
12755
|
+
innerRef: initialFocusRef,
|
|
12756
|
+
isDisabled: isEdit,
|
|
12757
|
+
name: "kind",
|
|
12758
|
+
options: buildKindOptions(questionKinds),
|
|
12759
|
+
label: t("neetoForm.questions.common.questionFields.field.questionType"),
|
|
12760
|
+
onChange: handleKindChange
|
|
12761
|
+
}), isRichTextQuestion(kind) ? /*#__PURE__*/jsx(Editor, {
|
|
12762
|
+
isLabelDisabled: isLabelDisabled
|
|
12763
|
+
}) : /*#__PURE__*/jsxs("div", {
|
|
12764
|
+
className: "space-y-6",
|
|
12765
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
12766
|
+
className: "space-y-4",
|
|
12767
|
+
children: [/*#__PURE__*/jsx(FormikAdaptiveInput, {
|
|
12768
|
+
required: true,
|
|
12769
|
+
disabled: isLabelDisabled,
|
|
12770
|
+
name: "label",
|
|
12771
|
+
placeholder: DEFAULT_PLACEHOLDERS[kind],
|
|
12772
|
+
label: t("neetoForm.questions.common.questionFields.field.question")
|
|
12773
|
+
}), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, {
|
|
12774
|
+
name: "placeholder",
|
|
12775
|
+
label: t("neetoForm.questions.common.questionFields.field.placeholder")
|
|
12776
|
+
}), hasAdditionalData && renderAdditionalData({
|
|
12777
|
+
kind: kind,
|
|
12778
|
+
questionProps: questionProps
|
|
12779
|
+
})]
|
|
12780
|
+
}), !isRequired && /*#__PURE__*/jsx(Block, {
|
|
12781
|
+
dataCy: "settings-card",
|
|
12782
|
+
title: t("neetoForm.common.settings"),
|
|
12783
|
+
children: /*#__PURE__*/jsx(RequiredSwitch, {})
|
|
12784
|
+
}), shouldShowFieldCode && /*#__PURE__*/jsx(Block, {
|
|
12785
|
+
dataCy: "advanced-properties-card",
|
|
12786
|
+
title: t("neetoForm.common.advancedProperties"),
|
|
12787
|
+
children: /*#__PURE__*/jsx(FieldCode, {})
|
|
12788
|
+
})]
|
|
12789
|
+
})]
|
|
12790
|
+
})
|
|
12791
|
+
});
|
|
12744
12792
|
};
|
|
12745
12793
|
|
|
12746
12794
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
@@ -12783,8 +12831,8 @@ var formValidationSchema = yup.object().shape({
|
|
|
12783
12831
|
});
|
|
12784
12832
|
|
|
12785
12833
|
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs"];
|
|
12786
|
-
function ownKeys$
|
|
12787
|
-
function _objectSpread$
|
|
12834
|
+
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; }
|
|
12835
|
+
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; }
|
|
12788
12836
|
var Add = function Add(_ref) {
|
|
12789
12837
|
var question = _ref.question,
|
|
12790
12838
|
onClose = _ref.onClose,
|
|
@@ -12813,7 +12861,7 @@ var Add = function Add(_ref) {
|
|
|
12813
12861
|
isCreating = _useCreateQuestion.isLoading;
|
|
12814
12862
|
var handleSubmit = function handleSubmit(values) {
|
|
12815
12863
|
var displayOrder = question ? question.displayOrder + 1 : questions.length;
|
|
12816
|
-
createQuestion(_objectSpread$
|
|
12864
|
+
createQuestion(_objectSpread$w({
|
|
12817
12865
|
language: language,
|
|
12818
12866
|
neetoFormQuestion: mergeLeft({
|
|
12819
12867
|
displayOrder: displayOrder
|
|
@@ -12828,29 +12876,39 @@ var Add = function Add(_ref) {
|
|
|
12828
12876
|
}
|
|
12829
12877
|
});
|
|
12830
12878
|
};
|
|
12831
|
-
return /*#__PURE__*/
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12879
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
12880
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
12881
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
12882
|
+
"data-cy": "add-question-pane-header",
|
|
12883
|
+
style: "h2",
|
|
12884
|
+
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
12885
|
+
})
|
|
12886
|
+
}), /*#__PURE__*/jsx(Form$2, {
|
|
12887
|
+
formikProps: {
|
|
12888
|
+
initialValues: INITIAL_VALUES,
|
|
12889
|
+
validationSchema: formValidationSchema,
|
|
12890
|
+
onSubmit: handleSubmit
|
|
12891
|
+
},
|
|
12892
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
12893
|
+
children: [/*#__PURE__*/jsx(Form$1, _objectSpread$w({}, _objectSpread$w(_objectSpread$w({}, props), {}, {
|
|
12894
|
+
question: question,
|
|
12895
|
+
questions: questions
|
|
12896
|
+
}))), /*#__PURE__*/jsx(Pane.Footer, {
|
|
12897
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
12898
|
+
cancelButtonProps: {
|
|
12899
|
+
onClick: onClose
|
|
12900
|
+
},
|
|
12901
|
+
isSubmitting: isCreating
|
|
12902
|
+
})
|
|
12903
|
+
})]
|
|
12904
|
+
})
|
|
12905
|
+
})]
|
|
12906
|
+
});
|
|
12849
12907
|
};
|
|
12850
12908
|
|
|
12851
12909
|
var _excluded$8 = ["question", "onClose"];
|
|
12852
|
-
function ownKeys$
|
|
12853
|
-
function _objectSpread$
|
|
12910
|
+
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; }
|
|
12911
|
+
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; }
|
|
12854
12912
|
var Edit = function Edit(_ref) {
|
|
12855
12913
|
var question = _ref.question,
|
|
12856
12914
|
onClose = _ref.onClose,
|
|
@@ -12886,25 +12944,35 @@ var Edit = function Edit(_ref) {
|
|
|
12886
12944
|
}
|
|
12887
12945
|
});
|
|
12888
12946
|
};
|
|
12889
|
-
return /*#__PURE__*/
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12947
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
12948
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
12949
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
12950
|
+
"data-cy": "edit-question-pane-header",
|
|
12951
|
+
style: "h2",
|
|
12952
|
+
children: t("neetoForm.questions.common.editQuestion")
|
|
12953
|
+
})
|
|
12954
|
+
}), /*#__PURE__*/jsx(Form$2, {
|
|
12955
|
+
formikProps: {
|
|
12956
|
+
initialValues: question,
|
|
12957
|
+
validationSchema: formValidationSchema,
|
|
12958
|
+
onSubmit: handleSubmit
|
|
12959
|
+
},
|
|
12960
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
12961
|
+
children: [/*#__PURE__*/jsx(Form$1, _objectSpread$v(_objectSpread$v({}, _objectSpread$v({
|
|
12962
|
+
question: question
|
|
12963
|
+
}, props)), {}, {
|
|
12964
|
+
isEdit: true
|
|
12965
|
+
})), /*#__PURE__*/jsx(Pane.Footer, {
|
|
12966
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
12967
|
+
cancelButtonProps: {
|
|
12968
|
+
onClick: onClose
|
|
12969
|
+
},
|
|
12970
|
+
isSubmitting: isUpdating
|
|
12971
|
+
})
|
|
12972
|
+
})]
|
|
12973
|
+
})
|
|
12974
|
+
})]
|
|
12975
|
+
});
|
|
12908
12976
|
};
|
|
12909
12977
|
|
|
12910
12978
|
var FileGroup = function FileGroup(_ref) {
|
|
@@ -12912,7 +12980,7 @@ var FileGroup = function FileGroup(_ref) {
|
|
|
12912
12980
|
label = _ref.label,
|
|
12913
12981
|
checked = _ref.checked,
|
|
12914
12982
|
handleAllowedFileTypesChange = _ref.handleAllowedFileTypesChange;
|
|
12915
|
-
return /*#__PURE__*/
|
|
12983
|
+
return /*#__PURE__*/jsx(Checkbox, {
|
|
12916
12984
|
checked: checked,
|
|
12917
12985
|
label: label,
|
|
12918
12986
|
name: name,
|
|
@@ -12958,34 +13026,40 @@ var FileUpload$1 = function FileUpload() {
|
|
|
12958
13026
|
allowedFileTypes: allowedFileTypes
|
|
12959
13027
|
}));
|
|
12960
13028
|
};
|
|
12961
|
-
return /*#__PURE__*/
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
13029
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
13030
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
13031
|
+
className: "w-full",
|
|
13032
|
+
children: /*#__PURE__*/jsx(Checkbox$1, {
|
|
13033
|
+
id: "multipleFilesAllowed",
|
|
13034
|
+
label: t("neetoForm.fileUpload.enableMultipleFilesUpload"),
|
|
13035
|
+
name: "multipleFilesAllowed"
|
|
13036
|
+
})
|
|
13037
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
13038
|
+
className: "flex flex-col space-y-3",
|
|
13039
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
13040
|
+
style: "body1",
|
|
13041
|
+
weight: "semibold",
|
|
13042
|
+
children: t("neetoForm.fileUpload.fileTypes")
|
|
13043
|
+
}), /*#__PURE__*/jsx("div", {
|
|
13044
|
+
className: "flex space-x-4",
|
|
13045
|
+
children: FILE_GROUPS.map(function (_ref2) {
|
|
13046
|
+
var name = _ref2.name,
|
|
13047
|
+
label = _ref2.label;
|
|
13048
|
+
return /*#__PURE__*/createElement(FileGroup, {
|
|
13049
|
+
handleAllowedFileTypesChange: handleAllowedFileTypesChange,
|
|
13050
|
+
label: label,
|
|
13051
|
+
name: name,
|
|
13052
|
+
checked: isFileTypeEnabled(name, allowedFileTypes),
|
|
13053
|
+
key: name
|
|
13054
|
+
});
|
|
13055
|
+
})
|
|
13056
|
+
})]
|
|
13057
|
+
})]
|
|
13058
|
+
});
|
|
12985
13059
|
};
|
|
12986
13060
|
|
|
12987
|
-
function ownKeys$
|
|
12988
|
-
function _objectSpread$
|
|
13061
|
+
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; }
|
|
13062
|
+
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; }
|
|
12989
13063
|
var defaultConfig = {
|
|
12990
13064
|
strict: true,
|
|
12991
13065
|
matchKey: "value"
|
|
@@ -12993,7 +13067,7 @@ var defaultConfig = {
|
|
|
12993
13067
|
var findOptionByValue = function findOptionByValue(value) {
|
|
12994
13068
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
12995
13069
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12996
|
-
var configObject = _objectSpread$
|
|
13070
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
12997
13071
|
var matchKey = configObject.matchKey,
|
|
12998
13072
|
strict = configObject.strict;
|
|
12999
13073
|
return options.find(function (option) {
|
|
@@ -13007,7 +13081,7 @@ var filterOptionsByValues = function filterOptionsByValues() {
|
|
|
13007
13081
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13008
13082
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
13009
13083
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13010
|
-
var configObject = _objectSpread$
|
|
13084
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
13011
13085
|
var matchKey = configObject.matchKey,
|
|
13012
13086
|
strict = configObject.strict;
|
|
13013
13087
|
return options.filter(function (option) {
|
|
@@ -13025,7 +13099,7 @@ var destroyFromList = function destroyFromList(items, index) {
|
|
|
13025
13099
|
var nextItems = _toConsumableArray$1(items);
|
|
13026
13100
|
nextItems.splice(index, 1);
|
|
13027
13101
|
if (itemToRemove.id) {
|
|
13028
|
-
nextItems.push(_objectSpread$
|
|
13102
|
+
nextItems.push(_objectSpread$u(_objectSpread$u({}, itemToRemove), {}, {
|
|
13029
13103
|
_destroy: true
|
|
13030
13104
|
}));
|
|
13031
13105
|
}
|
|
@@ -13051,6 +13125,8 @@ var formHelpers = {
|
|
|
13051
13125
|
pushToList: pushToList
|
|
13052
13126
|
};
|
|
13053
13127
|
|
|
13128
|
+
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; }
|
|
13129
|
+
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; }
|
|
13054
13130
|
var Options = function Options(_ref) {
|
|
13055
13131
|
var questionProps = _ref.questionProps;
|
|
13056
13132
|
var _useTranslation = useTranslation(),
|
|
@@ -13069,88 +13145,106 @@ var Options = function Options(_ref) {
|
|
|
13069
13145
|
var nextOptions = formHelpers.destroyFromList(optionsAttributes, index);
|
|
13070
13146
|
setOptionsAttributes(nextOptions);
|
|
13071
13147
|
};
|
|
13072
|
-
return /*#__PURE__*/
|
|
13073
|
-
className: "w-full"
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13148
|
+
return /*#__PURE__*/jsx("div", {
|
|
13149
|
+
className: "w-full",
|
|
13150
|
+
children: /*#__PURE__*/jsx(FieldArray, {
|
|
13151
|
+
name: "optionsAttributes",
|
|
13152
|
+
children: function children(_ref3) {
|
|
13153
|
+
var handlePush = _ref3.handlePush;
|
|
13154
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
13155
|
+
children: [/*#__PURE__*/jsx(Label, _objectSpread$t(_objectSpread$t({
|
|
13156
|
+
className: "mb-1 block"
|
|
13157
|
+
}, optionLabelProps), {}, {
|
|
13158
|
+
children: t("neetoForm.questions.common.questionFields.field.options")
|
|
13159
|
+
})), /*#__PURE__*/jsx("div", {
|
|
13160
|
+
className: "flex w-2/3 flex-col space-y-2",
|
|
13161
|
+
children: optionsAttributes === null || optionsAttributes === void 0 ? void 0 : optionsAttributes.map(function (option, index) {
|
|
13162
|
+
var _option$id;
|
|
13163
|
+
return !option._destroy && /*#__PURE__*/jsxs("div", {
|
|
13164
|
+
className: "flex items-start gap-1",
|
|
13165
|
+
children: [/*#__PURE__*/jsx(InputWithMaxLength, {
|
|
13166
|
+
required: true,
|
|
13167
|
+
disabled: freezeOptions,
|
|
13168
|
+
name: "optionsAttributes.".concat(index, ".label"),
|
|
13169
|
+
placeholder: t("neetoForm.questions.common.questionFields.field.numberedOption", {
|
|
13170
|
+
number: index + 1
|
|
13171
|
+
})
|
|
13172
|
+
}), !freezeOptions && /*#__PURE__*/jsx(Button$1, {
|
|
13173
|
+
"data-cy": "neeto-form-engine-delete-option-button",
|
|
13174
|
+
icon: Delete,
|
|
13175
|
+
size: "small",
|
|
13176
|
+
style: "text",
|
|
13177
|
+
className: classnames({
|
|
13178
|
+
invisible: index < MINIMUM_OPTIONS
|
|
13179
|
+
}),
|
|
13180
|
+
tooltipProps: {
|
|
13181
|
+
position: "top",
|
|
13182
|
+
content: t("neetoForm.common.delete")
|
|
13183
|
+
},
|
|
13184
|
+
onClick: function onClick() {
|
|
13185
|
+
return handleRemoveOption(index);
|
|
13186
|
+
}
|
|
13187
|
+
})]
|
|
13188
|
+
}, "question-option-".concat((_option$id = option.id) !== null && _option$id !== void 0 ? _option$id : index));
|
|
13189
|
+
})
|
|
13190
|
+
}), !freezeOptions && /*#__PURE__*/jsx("div", {
|
|
13191
|
+
className: "mt-3 w-full",
|
|
13192
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
13193
|
+
icon: Plus,
|
|
13194
|
+
iconPosition: "left",
|
|
13195
|
+
size: "small",
|
|
13196
|
+
style: "text",
|
|
13197
|
+
label: t("neetoForm.questions.common.questionFields.field.addOption"),
|
|
13198
|
+
onClick: handlePush({
|
|
13199
|
+
label: ""
|
|
13200
|
+
})
|
|
13201
|
+
})
|
|
13202
|
+
})]
|
|
13203
|
+
});
|
|
13204
|
+
}
|
|
13205
|
+
})
|
|
13206
|
+
});
|
|
13123
13207
|
};
|
|
13124
13208
|
|
|
13125
13209
|
var RatingItem = function RatingItem(_ref) {
|
|
13126
13210
|
var children = _ref.children;
|
|
13127
|
-
return /*#__PURE__*/
|
|
13128
|
-
className: "flex w-16 flex-col items-center gap-3"
|
|
13129
|
-
|
|
13211
|
+
return /*#__PURE__*/jsx("div", {
|
|
13212
|
+
className: "flex w-16 flex-col items-center gap-3",
|
|
13213
|
+
children: children
|
|
13214
|
+
});
|
|
13130
13215
|
};
|
|
13131
13216
|
var Rating$2 = function Rating() {
|
|
13132
|
-
return /*#__PURE__*/
|
|
13133
|
-
className: "flex flex-col"
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13217
|
+
return /*#__PURE__*/jsx("div", {
|
|
13218
|
+
className: "flex flex-col",
|
|
13219
|
+
children: /*#__PURE__*/jsx("div", {
|
|
13220
|
+
className: "w-full",
|
|
13221
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
13222
|
+
className: "flex gap-6",
|
|
13223
|
+
children: [/*#__PURE__*/jsxs(RatingItem, {
|
|
13224
|
+
children: [/*#__PURE__*/jsx(GoodSmiley, {
|
|
13225
|
+
color: "#00ba88",
|
|
13226
|
+
size: 48
|
|
13227
|
+
}), /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
13228
|
+
name: "highestRatingLabel"
|
|
13229
|
+
})]
|
|
13230
|
+
}), /*#__PURE__*/jsxs(RatingItem, {
|
|
13231
|
+
children: [/*#__PURE__*/jsx(OkaySmiley, {
|
|
13232
|
+
color: "#f3cd82",
|
|
13233
|
+
size: 48
|
|
13234
|
+
}), /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
13235
|
+
name: "averageRatingLabel"
|
|
13236
|
+
})]
|
|
13237
|
+
}), /*#__PURE__*/jsxs(RatingItem, {
|
|
13238
|
+
children: [/*#__PURE__*/jsx(BadSmiley, {
|
|
13239
|
+
color: "#f56a58",
|
|
13240
|
+
size: 48
|
|
13241
|
+
}), /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
13242
|
+
name: "lowestRatingLabel"
|
|
13243
|
+
})]
|
|
13244
|
+
})]
|
|
13245
|
+
})
|
|
13246
|
+
})
|
|
13247
|
+
});
|
|
13154
13248
|
};
|
|
13155
13249
|
|
|
13156
13250
|
var StarRating$2 = function StarRating() {
|
|
@@ -13163,42 +13257,48 @@ var StarRating$2 = function StarRating() {
|
|
|
13163
13257
|
iconType = _useField2[0].value;
|
|
13164
13258
|
_useField2[1];
|
|
13165
13259
|
var setIconType = _useField2[2].setValue;
|
|
13166
|
-
return /*#__PURE__*/
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13260
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
13261
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
13262
|
+
className: "flex space-x-4",
|
|
13263
|
+
children: [/*#__PURE__*/jsx(Select, {
|
|
13264
|
+
className: "w-1/2",
|
|
13265
|
+
label: t("neetoForm.common.start"),
|
|
13266
|
+
name: "minValue",
|
|
13267
|
+
options: STAR_RATING_MIN_VALUE_OPTIONS,
|
|
13268
|
+
onChange: function onChange(option) {
|
|
13269
|
+
return setFieldValue("minValue", option === null || option === void 0 ? void 0 : option.value);
|
|
13270
|
+
}
|
|
13271
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
13272
|
+
className: "w-1/2",
|
|
13273
|
+
label: t("neetoForm.common.end"),
|
|
13274
|
+
name: "maxValue",
|
|
13275
|
+
options: STAR_RATING_MAX_VALUE_OPTIONS,
|
|
13276
|
+
onChange: function onChange(option) {
|
|
13277
|
+
return setFieldValue("maxValue", option === null || option === void 0 ? void 0 : option.value);
|
|
13278
|
+
}
|
|
13279
|
+
})]
|
|
13280
|
+
}), /*#__PURE__*/jsx(Label, {
|
|
13281
|
+
children: t("neetoForm.common.shape")
|
|
13282
|
+
}), /*#__PURE__*/jsx("div", {
|
|
13283
|
+
className: "flex gap-2",
|
|
13284
|
+
children: Object.entries(STAR_RATING_ICONS_MAP).map(function (_ref) {
|
|
13285
|
+
var _ref2 = _slicedToArray$3(_ref, 2),
|
|
13286
|
+
name = _ref2[0],
|
|
13287
|
+
IconType = _ref2[1];
|
|
13288
|
+
var isActive = name === iconType;
|
|
13289
|
+
return /*#__PURE__*/jsx("div", {
|
|
13290
|
+
className: classnames("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", {
|
|
13291
|
+
"neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
|
|
13292
|
+
"neeto-ui-text-white neeto-ui-bg-gray-800": isActive
|
|
13293
|
+
}),
|
|
13294
|
+
onClick: function onClick() {
|
|
13295
|
+
return setIconType(name);
|
|
13296
|
+
},
|
|
13297
|
+
children: /*#__PURE__*/jsx(IconType, {})
|
|
13298
|
+
}, name);
|
|
13299
|
+
})
|
|
13300
|
+
})]
|
|
13301
|
+
});
|
|
13202
13302
|
};
|
|
13203
13303
|
|
|
13204
13304
|
var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
@@ -13219,15 +13319,15 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
13219
13319
|
case CHECKBOX:
|
|
13220
13320
|
case RADIO:
|
|
13221
13321
|
case DROPDOWN:
|
|
13222
|
-
return /*#__PURE__*/
|
|
13322
|
+
return /*#__PURE__*/jsx(Options, {
|
|
13223
13323
|
questionProps: questionProps
|
|
13224
13324
|
});
|
|
13225
13325
|
case RATING:
|
|
13226
|
-
return /*#__PURE__*/
|
|
13326
|
+
return /*#__PURE__*/jsx(Rating$2, {});
|
|
13227
13327
|
case STAR_RATING:
|
|
13228
|
-
return /*#__PURE__*/
|
|
13328
|
+
return /*#__PURE__*/jsx(StarRating$2, {});
|
|
13229
13329
|
case FILE_UPLOAD:
|
|
13230
|
-
return /*#__PURE__*/
|
|
13330
|
+
return /*#__PURE__*/jsx(FileUpload$1, {});
|
|
13231
13331
|
default:
|
|
13232
13332
|
return null;
|
|
13233
13333
|
}
|
|
@@ -13260,8 +13360,8 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
13260
13360
|
};
|
|
13261
13361
|
|
|
13262
13362
|
var _excluded$7 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
13263
|
-
function ownKeys$
|
|
13264
|
-
function _objectSpread$
|
|
13363
|
+
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; }
|
|
13364
|
+
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; }
|
|
13265
13365
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
13266
13366
|
var isOpen = _ref.isOpen,
|
|
13267
13367
|
onClose = _ref.onClose,
|
|
@@ -13271,16 +13371,17 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
13271
13371
|
props = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13272
13372
|
var initialFocusRef = useRef(null);
|
|
13273
13373
|
var Component = resolveActionComponent(action);
|
|
13274
|
-
return /*#__PURE__*/
|
|
13374
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
13275
13375
|
initialFocusRef: initialFocusRef,
|
|
13276
13376
|
isOpen: isOpen,
|
|
13277
|
-
onClose: onClose
|
|
13278
|
-
}, /*#__PURE__*/React__default.createElement(Component, _objectSpread$i({
|
|
13279
|
-
availableQuestionKinds: availableQuestionKinds,
|
|
13280
|
-
initialFocusRef: initialFocusRef,
|
|
13281
13377
|
onClose: onClose,
|
|
13282
|
-
|
|
13283
|
-
|
|
13378
|
+
children: /*#__PURE__*/jsx(Component, _objectSpread$s({}, _objectSpread$s({
|
|
13379
|
+
availableQuestionKinds: availableQuestionKinds,
|
|
13380
|
+
initialFocusRef: initialFocusRef,
|
|
13381
|
+
onClose: onClose,
|
|
13382
|
+
question: question
|
|
13383
|
+
}, props)))
|
|
13384
|
+
});
|
|
13284
13385
|
};
|
|
13285
13386
|
|
|
13286
13387
|
var AddQuestion = withT(function (_ref) {
|
|
@@ -13288,23 +13389,26 @@ var AddQuestion = withT(function (_ref) {
|
|
|
13288
13389
|
onAdd = _ref.onAdd,
|
|
13289
13390
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
13290
13391
|
isDisabled = _ref.isDisabled;
|
|
13291
|
-
return /*#__PURE__*/
|
|
13392
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
13292
13393
|
disabled: !isDisabled,
|
|
13293
13394
|
position: "top",
|
|
13294
|
-
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13395
|
+
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft"),
|
|
13396
|
+
children: /*#__PURE__*/jsx("span", {
|
|
13397
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
13398
|
+
disabled: isDisabled,
|
|
13399
|
+
icon: Plus,
|
|
13400
|
+
iconPosition: "left",
|
|
13401
|
+
label: t("neetoForm.questions.common.primaryPanel.addQuestion"),
|
|
13402
|
+
style: "link",
|
|
13403
|
+
onClick: onAdd
|
|
13404
|
+
})
|
|
13405
|
+
})
|
|
13406
|
+
});
|
|
13303
13407
|
});
|
|
13304
13408
|
|
|
13305
13409
|
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"];
|
|
13306
|
-
function ownKeys$
|
|
13307
|
-
function _objectSpread$
|
|
13410
|
+
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; }
|
|
13411
|
+
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; }
|
|
13308
13412
|
var Form = function Form(_ref) {
|
|
13309
13413
|
var questionKinds = _ref.questionKinds,
|
|
13310
13414
|
onValueChange = _ref.onValueChange,
|
|
@@ -13398,7 +13502,7 @@ var Form = function Form(_ref) {
|
|
|
13398
13502
|
questions: questions
|
|
13399
13503
|
});
|
|
13400
13504
|
var displayOrder = selectedQuestion.displayOrder + 1;
|
|
13401
|
-
var payload = _objectSpread$
|
|
13505
|
+
var payload = _objectSpread$r({
|
|
13402
13506
|
language: selectedLanguage,
|
|
13403
13507
|
neetoFormQuestion: mergeLeft({
|
|
13404
13508
|
displayOrder: displayOrder
|
|
@@ -13446,92 +13550,102 @@ var Form = function Form(_ref) {
|
|
|
13446
13550
|
richTextFieldsToReset: pluck("fieldCode", richTextQuestions)
|
|
13447
13551
|
});
|
|
13448
13552
|
};
|
|
13449
|
-
return /*#__PURE__*/
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13553
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
13554
|
+
children: [/*#__PURE__*/jsx(DeleteAlert, {
|
|
13555
|
+
handleSelect: handleSelect,
|
|
13556
|
+
selectedQuestion: selectedQuestion,
|
|
13557
|
+
isOpen: isDeleteAlertOpen,
|
|
13558
|
+
languagesCount: availableLanguages.length,
|
|
13559
|
+
onClose: function onClose() {
|
|
13560
|
+
return setIsDeleteAlertOpen(false);
|
|
13561
|
+
}
|
|
13562
|
+
}), /*#__PURE__*/jsxs(Form$3, _objectSpread$r(_objectSpread$r({
|
|
13563
|
+
className: "neeto-form-nano-form-wrapper flex h-full flex-col"
|
|
13564
|
+
}, formDomProps), {}, {
|
|
13565
|
+
noValidate: true,
|
|
13566
|
+
children: [formTitle && /*#__PURE__*/jsx(Overview, {
|
|
13567
|
+
additionalActionOptions: additionalActionOptions,
|
|
13568
|
+
availableLanguages: availableLanguages,
|
|
13569
|
+
selectedLanguage: selectedLanguage,
|
|
13570
|
+
description: formDescription,
|
|
13571
|
+
title: formTitle,
|
|
13572
|
+
onLanguageChange: handleLanguageChange
|
|
13573
|
+
}), /*#__PURE__*/jsx("div", {
|
|
13574
|
+
className: "neeto-form-nano-form-wrapper__body min-h-0 w-full flex-grow space-y-6 overflow-y-auto px-6 pb-6",
|
|
13575
|
+
children: hasActiveQuestions ? /*#__PURE__*/jsxs("div", {
|
|
13576
|
+
className: "space-y-6",
|
|
13577
|
+
ref: containerRef,
|
|
13578
|
+
children: [/*#__PURE__*/jsx(DragDropContext, {
|
|
13579
|
+
onDragEnd: function onDragEnd(_ref3) {
|
|
13580
|
+
var source = _ref3.source,
|
|
13581
|
+
destination = _ref3.destination;
|
|
13582
|
+
return handleFieldDragEnd({
|
|
13583
|
+
source: source,
|
|
13584
|
+
destination: destination,
|
|
13585
|
+
items: questions,
|
|
13586
|
+
setValue: setFieldValue
|
|
13587
|
+
});
|
|
13588
|
+
},
|
|
13589
|
+
children: /*#__PURE__*/jsx(Questions, {
|
|
13590
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13591
|
+
isDeletable: isDeletable,
|
|
13592
|
+
questions: questions,
|
|
13593
|
+
selectedQuestion: selectedQuestion,
|
|
13594
|
+
allQuestionKinds: questionKinds,
|
|
13595
|
+
onClone: handleClone,
|
|
13596
|
+
onDelete: handleDelete,
|
|
13597
|
+
onEdit: handleEdit,
|
|
13598
|
+
onSelect: handleSelect
|
|
13599
|
+
})
|
|
13600
|
+
}), /*#__PURE__*/jsx("div", {
|
|
13601
|
+
className: "mb-8 w-full",
|
|
13602
|
+
children: /*#__PURE__*/jsx(AddQuestion, {
|
|
13603
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13604
|
+
isDisabled: isEmpty(availableQuestionKinds),
|
|
13605
|
+
onAdd: handleAdd
|
|
13606
|
+
})
|
|
13607
|
+
})]
|
|
13608
|
+
}) : /*#__PURE__*/jsx(AddFirstQuestion, {
|
|
13609
|
+
children: /*#__PURE__*/jsx(AddQuestion, {
|
|
13610
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13611
|
+
isDisabled: isEmpty(availableQuestionKinds),
|
|
13612
|
+
onAdd: handleAdd
|
|
13613
|
+
})
|
|
13614
|
+
})
|
|
13615
|
+
}), (showActionBlock || dirty) && /*#__PURE__*/jsx("div", {
|
|
13616
|
+
className: "neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer flex flex-shrink-0 justify-end border-t px-6 py-4",
|
|
13617
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
13618
|
+
submitButtonProps: submitButtonProps,
|
|
13619
|
+
isSubmitting: isReordering,
|
|
13620
|
+
cancelButtonProps: _objectSpread$r({
|
|
13621
|
+
label: t("neetoForm.common.reset"),
|
|
13622
|
+
onClick: resetFormData
|
|
13623
|
+
}, cancelButtonProps)
|
|
13624
|
+
})
|
|
13625
|
+
}), /*#__PURE__*/jsx(ManageQuestionPane, {
|
|
13626
|
+
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
13627
|
+
availableQuestionKinds: availableQuestionKinds,
|
|
13628
|
+
buildRequestArgs: buildRequestArgs,
|
|
13629
|
+
enableFieldCode: enableFieldCode,
|
|
13630
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13631
|
+
handleSelect: handleSelect,
|
|
13632
|
+
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
13633
|
+
isRequiredField: isRequiredField,
|
|
13634
|
+
questions: questions,
|
|
13635
|
+
action: selectedAction,
|
|
13636
|
+
allQuestionKinds: questionKinds,
|
|
13637
|
+
isOpen: isManageQuestionPaneOpen,
|
|
13638
|
+
question: selectedQuestion,
|
|
13639
|
+
onClose: function onClose() {
|
|
13640
|
+
return setIsManageQuestionPaneOpen(false);
|
|
13641
|
+
}
|
|
13642
|
+
})]
|
|
13643
|
+
}))]
|
|
13644
|
+
});
|
|
13531
13645
|
};
|
|
13532
13646
|
|
|
13533
|
-
function ownKeys$
|
|
13534
|
-
function _objectSpread$
|
|
13647
|
+
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; }
|
|
13648
|
+
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; }
|
|
13535
13649
|
var BuildForm = function BuildForm(_ref) {
|
|
13536
13650
|
var id = _ref.id,
|
|
13537
13651
|
onUpdate = _ref.onUpdate,
|
|
@@ -13574,7 +13688,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13574
13688
|
onLanguageChange = _ref$onLanguageChange === void 0 ? noop$4 : _ref$onLanguageChange,
|
|
13575
13689
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
13576
13690
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
13577
|
-
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern
|
|
13691
|
+
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
13692
|
+
className = _ref.className;
|
|
13578
13693
|
var queryClient = useQueryClient();
|
|
13579
13694
|
var _useReorderQuestions = useReorderQuestions(id, {
|
|
13580
13695
|
onSuccess: showThumbsUpToastr
|
|
@@ -13608,9 +13723,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13608
13723
|
questions = _useFetchQuestions$da2.questions,
|
|
13609
13724
|
isLoading = _useFetchQuestions.isLoading;
|
|
13610
13725
|
if (isLoading || showLoader && isQuestionsLoading) {
|
|
13611
|
-
return /*#__PURE__*/
|
|
13612
|
-
className: "flex h-full w-full items-center justify-center py-6"
|
|
13613
|
-
|
|
13726
|
+
return /*#__PURE__*/jsx("div", {
|
|
13727
|
+
className: "flex h-full w-full items-center justify-center py-6",
|
|
13728
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
13729
|
+
});
|
|
13614
13730
|
}
|
|
13615
13731
|
var handleSubmit = function handleSubmit(_ref2, _ref3) {
|
|
13616
13732
|
var questions = _ref2.questions;
|
|
@@ -13646,57 +13762,62 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13646
13762
|
var defaultQuestionKinds = allowAdditionalGuests ? QUESTION_KINDS : removeBy({
|
|
13647
13763
|
type: QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
13648
13764
|
}, QUESTION_KINDS);
|
|
13649
|
-
return /*#__PURE__*/
|
|
13650
|
-
className: "relative
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13765
|
+
return /*#__PURE__*/jsxs("div", {
|
|
13766
|
+
className: classnames("neeto-form-nano-form-outer-wrapper relative", className),
|
|
13767
|
+
children: [/*#__PURE__*/jsx(Formik, {
|
|
13768
|
+
enableReinitialize: true,
|
|
13769
|
+
initialValues: {
|
|
13770
|
+
questions: questions
|
|
13771
|
+
},
|
|
13772
|
+
onSubmit: handleSubmit,
|
|
13773
|
+
children: function children(_ref5) {
|
|
13774
|
+
var errors = _ref5.errors,
|
|
13775
|
+
setFieldError = _ref5.setFieldError;
|
|
13776
|
+
return /*#__PURE__*/jsx(Form, _objectSpread$q(_objectSpread$q({}, _objectSpread$q(_objectSpread$q({}, formDomProps), {}, {
|
|
13777
|
+
additionalActionOptions: additionalActionOptions,
|
|
13778
|
+
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
13779
|
+
availableLanguages: availableLanguages,
|
|
13780
|
+
buildRequestArgs: buildRequestArgs,
|
|
13781
|
+
cancelButtonProps: cancelButtonProps,
|
|
13782
|
+
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
13783
|
+
enableFieldCode: enableFieldCode,
|
|
13784
|
+
formDescription: formDescription,
|
|
13785
|
+
formTitle: formTitle,
|
|
13786
|
+
getActiveKindDetails: getActiveKindDetails,
|
|
13787
|
+
isDeletable: isDeletable,
|
|
13788
|
+
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
13789
|
+
isFormEnabled: isFormEnabled,
|
|
13790
|
+
isKindAlreadyActive: isKindAlreadyActive,
|
|
13791
|
+
isReordering: isReordering,
|
|
13792
|
+
isRequiredField: isRequiredField,
|
|
13793
|
+
kindUniqueOn: kindUniqueOn,
|
|
13794
|
+
onLanguageChange: onLanguageChange,
|
|
13795
|
+
onValueChange: onValueChange,
|
|
13796
|
+
savedTitle: savedTitle,
|
|
13797
|
+
selectedLanguage: selectedLanguage,
|
|
13798
|
+
showActionBlock: showActionBlock,
|
|
13799
|
+
submitButtonProps: submitButtonProps
|
|
13800
|
+
})), {}, {
|
|
13801
|
+
formId: id,
|
|
13802
|
+
questionKinds: isPresent$1(questionKinds) ? questionKinds : defaultQuestionKinds,
|
|
13803
|
+
onChange: function onChange(event) {
|
|
13804
|
+
if (isEmpty(errors)) return;
|
|
13805
|
+
setFieldError(event.target.name);
|
|
13806
|
+
}
|
|
13807
|
+
}));
|
|
13690
13808
|
}
|
|
13691
|
-
})
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
|
|
13809
|
+
}), isQuestionsLoading && /*#__PURE__*/jsx("div", {
|
|
13810
|
+
className: "neeto-ui-bg-white absolute inset-0 flex items-center justify-center",
|
|
13811
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
13812
|
+
})]
|
|
13813
|
+
});
|
|
13695
13814
|
};
|
|
13696
13815
|
|
|
13697
13816
|
var NeetoFormProvider = function NeetoFormProvider(_ref) {
|
|
13698
13817
|
var children = _ref.children;
|
|
13699
|
-
return /*#__PURE__*/
|
|
13818
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
13819
|
+
children: children
|
|
13820
|
+
});
|
|
13700
13821
|
};
|
|
13701
13822
|
|
|
13702
13823
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -14082,25 +14203,29 @@ var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
|
14082
14203
|
var Spinner = function Spinner(_ref) {
|
|
14083
14204
|
var _ref$size = _ref.size,
|
|
14084
14205
|
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
14085
|
-
return /*#__PURE__*/
|
|
14086
|
-
className: "neeto-form-engine-spinner"
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14206
|
+
return /*#__PURE__*/jsx("div", {
|
|
14207
|
+
className: "neeto-form-engine-spinner",
|
|
14208
|
+
children: /*#__PURE__*/jsx("svg", {
|
|
14209
|
+
fill: "none",
|
|
14210
|
+
height: size,
|
|
14211
|
+
viewBox: "0 0 25 24",
|
|
14212
|
+
width: size,
|
|
14213
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14214
|
+
children: /*#__PURE__*/jsx("path", {
|
|
14215
|
+
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",
|
|
14216
|
+
stroke: "#87929D",
|
|
14217
|
+
strokeLinecap: "round",
|
|
14218
|
+
strokeLinejoin: "round",
|
|
14219
|
+
strokeWidth: "1.5"
|
|
14220
|
+
})
|
|
14221
|
+
})
|
|
14222
|
+
});
|
|
14100
14223
|
};
|
|
14101
14224
|
var Spinner$1 = /*#__PURE__*/React__default.memo(Spinner);
|
|
14102
14225
|
|
|
14103
14226
|
var _excluded$5 = ["label", "loading", "success", "className"];
|
|
14227
|
+
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; }
|
|
14228
|
+
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; }
|
|
14104
14229
|
var Button = function Button(_ref) {
|
|
14105
14230
|
var label = _ref.label,
|
|
14106
14231
|
_ref$loading = _ref.loading,
|
|
@@ -14110,19 +14235,23 @@ var Button = function Button(_ref) {
|
|
|
14110
14235
|
_ref$className = _ref.className,
|
|
14111
14236
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
14112
14237
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14113
|
-
return /*#__PURE__*/
|
|
14238
|
+
return /*#__PURE__*/jsxs("button", _objectSpread$p(_objectSpread$p({
|
|
14114
14239
|
className: classnames("neeto-form-engine-button", className)
|
|
14115
|
-
}, otherProps),
|
|
14240
|
+
}, otherProps), {}, {
|
|
14241
|
+
children: [loading && /*#__PURE__*/jsx(ButtonLoader, {}), success && /*#__PURE__*/jsx(Success$2, {}), label]
|
|
14242
|
+
}));
|
|
14116
14243
|
};
|
|
14117
14244
|
var ButtonLoader = function ButtonLoader() {
|
|
14118
|
-
return /*#__PURE__*/
|
|
14119
|
-
className: "neeto-form-engine-button__loader"
|
|
14120
|
-
|
|
14245
|
+
return /*#__PURE__*/jsx("div", {
|
|
14246
|
+
className: "neeto-form-engine-button__loader",
|
|
14247
|
+
children: /*#__PURE__*/jsx(Spinner$1, {})
|
|
14248
|
+
});
|
|
14121
14249
|
};
|
|
14122
14250
|
var Success$2 = function Success() {
|
|
14123
|
-
return /*#__PURE__*/
|
|
14124
|
-
className: "neeto-form-engine-button__success"
|
|
14125
|
-
|
|
14251
|
+
return /*#__PURE__*/jsx("div", {
|
|
14252
|
+
className: "neeto-form-engine-button__success",
|
|
14253
|
+
children: /*#__PURE__*/jsx(Check, {})
|
|
14254
|
+
});
|
|
14126
14255
|
};
|
|
14127
14256
|
|
|
14128
14257
|
var CALLOUT_STYLES = {
|
|
@@ -14150,29 +14279,36 @@ var Callout = function Callout(_ref) {
|
|
|
14150
14279
|
primaryButton = callout.primaryButton,
|
|
14151
14280
|
secondaryButton = callout.secondaryButton;
|
|
14152
14281
|
if (!isVisible) return null;
|
|
14153
|
-
return /*#__PURE__*/
|
|
14282
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14154
14283
|
className: classnames("neeto-form-engine-callout", _defineProperty$6({
|
|
14155
14284
|
"neeto-form-engine-callout--error": style === CALLOUT_STYLES.ERROR,
|
|
14156
14285
|
"neeto-form-engine-callout--info": style === CALLOUT_STYLES.INFO,
|
|
14157
14286
|
"neeto-form-engine-callout--static": position === CALLOUT_POSITIONS.STATIC,
|
|
14158
14287
|
"neeto-form-engine-callout--absolute": position === CALLOUT_POSITIONS.ABSOLUTE
|
|
14159
|
-
}, className, className))
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14288
|
+
}, className, className)),
|
|
14289
|
+
children: [isPresent$1(onClose) && /*#__PURE__*/jsx("button", {
|
|
14290
|
+
className: "neeto-form-engine-callout__close",
|
|
14291
|
+
onClick: onClose,
|
|
14292
|
+
children: /*#__PURE__*/jsx(Close, {
|
|
14293
|
+
size: 16
|
|
14294
|
+
})
|
|
14295
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14296
|
+
className: "neeto-form-engine-callout__content",
|
|
14297
|
+
children: [not(isBlank(title)) && /*#__PURE__*/jsx("h5", {
|
|
14298
|
+
children: title
|
|
14299
|
+
}), /*#__PURE__*/jsx("p", {
|
|
14300
|
+
children: message
|
|
14301
|
+
})]
|
|
14302
|
+
}), primaryButton && /*#__PURE__*/jsx(Button, {
|
|
14303
|
+
label: primaryButton.label,
|
|
14304
|
+
size: "small",
|
|
14305
|
+
onClick: primaryButton.onClick
|
|
14306
|
+
}), secondaryButton && /*#__PURE__*/jsx(Button, {
|
|
14307
|
+
label: secondaryButton.label,
|
|
14308
|
+
size: "small",
|
|
14309
|
+
onClick: secondaryButton.onClick
|
|
14310
|
+
}), children]
|
|
14311
|
+
});
|
|
14176
14312
|
};
|
|
14177
14313
|
|
|
14178
14314
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
@@ -15870,9 +16006,9 @@ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o
|
|
|
15870
16006
|
|
|
15871
16007
|
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; }
|
|
15872
16008
|
|
|
15873
|
-
function ownKeys$
|
|
16009
|
+
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; }
|
|
15874
16010
|
|
|
15875
|
-
function _objectSpread$
|
|
16011
|
+
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; }
|
|
15876
16012
|
|
|
15877
16013
|
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; }
|
|
15878
16014
|
var DEFAULT_OPTIONS = {
|
|
@@ -15899,7 +16035,7 @@ var DEFAULT_OPTIONS = {
|
|
|
15899
16035
|
function formatNumber(input, format, options, metadata) {
|
|
15900
16036
|
// Apply default options.
|
|
15901
16037
|
if (options) {
|
|
15902
|
-
options = _objectSpread$
|
|
16038
|
+
options = _objectSpread$o(_objectSpread$o({}, DEFAULT_OPTIONS), options);
|
|
15903
16039
|
} else {
|
|
15904
16040
|
options = DEFAULT_OPTIONS;
|
|
15905
16041
|
}
|
|
@@ -16044,9 +16180,9 @@ function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry,
|
|
|
16044
16180
|
}
|
|
16045
16181
|
}
|
|
16046
16182
|
|
|
16047
|
-
function ownKeys$
|
|
16183
|
+
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; }
|
|
16048
16184
|
|
|
16049
|
-
function _objectSpread$
|
|
16185
|
+
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; }
|
|
16050
16186
|
|
|
16051
16187
|
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; }
|
|
16052
16188
|
|
|
@@ -16158,7 +16294,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
16158
16294
|
}, {
|
|
16159
16295
|
key: "format",
|
|
16160
16296
|
value: function format(_format, options) {
|
|
16161
|
-
return formatNumber(this, _format, options ? _objectSpread$
|
|
16297
|
+
return formatNumber(this, _format, options ? _objectSpread$n(_objectSpread$n({}, options), {}, {
|
|
16162
16298
|
v2: true
|
|
16163
16299
|
}) : {
|
|
16164
16300
|
v2: true
|
|
@@ -17201,20 +17337,20 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
17201
17337
|
};
|
|
17202
17338
|
}
|
|
17203
17339
|
|
|
17204
|
-
function ownKeys$
|
|
17340
|
+
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; }
|
|
17205
17341
|
|
|
17206
|
-
function _objectSpread$
|
|
17342
|
+
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; }
|
|
17207
17343
|
|
|
17208
17344
|
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; }
|
|
17209
17345
|
function parsePhoneNumberWithError$2(text, options, metadata) {
|
|
17210
|
-
return parse$1(text, _objectSpread$
|
|
17346
|
+
return parse$1(text, _objectSpread$m(_objectSpread$m({}, options), {}, {
|
|
17211
17347
|
v2: true
|
|
17212
17348
|
}), metadata);
|
|
17213
17349
|
}
|
|
17214
17350
|
|
|
17215
|
-
function ownKeys$
|
|
17351
|
+
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; }
|
|
17216
17352
|
|
|
17217
|
-
function _objectSpread$
|
|
17353
|
+
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; }
|
|
17218
17354
|
|
|
17219
17355
|
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; }
|
|
17220
17356
|
|
|
@@ -17262,7 +17398,7 @@ function normalizeArguments(args) {
|
|
|
17262
17398
|
}
|
|
17263
17399
|
|
|
17264
17400
|
if (arg_2) {
|
|
17265
|
-
options = _objectSpread$
|
|
17401
|
+
options = _objectSpread$l({
|
|
17266
17402
|
defaultCountry: arg_2
|
|
17267
17403
|
}, options);
|
|
17268
17404
|
}
|
|
@@ -17323,8 +17459,8 @@ var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
|
17323
17459
|
|
|
17324
17460
|
var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
17325
17461
|
var _fieldKindValidatorMa;
|
|
17326
|
-
function ownKeys$
|
|
17327
|
-
function _objectSpread$
|
|
17462
|
+
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; }
|
|
17463
|
+
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; }
|
|
17328
17464
|
yup.addMethod(yup.array, "unique", function () {
|
|
17329
17465
|
var field, message;
|
|
17330
17466
|
if (arguments.length > 1) {
|
|
@@ -17473,7 +17609,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17473
17609
|
return function (value) {
|
|
17474
17610
|
if (!(kind in fieldKindValidatorMap)) return;
|
|
17475
17611
|
var validator = fieldKindValidatorMap[kind];
|
|
17476
|
-
var schema = customValidator || validator(_objectSpread$
|
|
17612
|
+
var schema = customValidator || validator(_objectSpread$k({
|
|
17477
17613
|
kind: kind,
|
|
17478
17614
|
label: label,
|
|
17479
17615
|
isRequired: isRequired
|
|
@@ -17510,7 +17646,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17510
17646
|
};
|
|
17511
17647
|
|
|
17512
17648
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
17513
|
-
var
|
|
17649
|
+
var _jsx2;
|
|
17514
17650
|
var question = _ref.question,
|
|
17515
17651
|
customValidator = _ref.customValidator;
|
|
17516
17652
|
var name = question.id,
|
|
@@ -17539,31 +17675,33 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
17539
17675
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
17540
17676
|
isInputVisible = _useState2[0],
|
|
17541
17677
|
setIsInputVisible = _useState2[1];
|
|
17542
|
-
return /*#__PURE__*/
|
|
17543
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
17554
|
-
|
|
17555
|
-
|
|
17556
|
-
|
|
17557
|
-
|
|
17558
|
-
|
|
17559
|
-
|
|
17560
|
-
|
|
17561
|
-
|
|
17562
|
-
|
|
17678
|
+
return /*#__PURE__*/jsx("div", {
|
|
17679
|
+
className: "neeto-form-engine-input__wrapper",
|
|
17680
|
+
children: /*#__PURE__*/jsx("div", {
|
|
17681
|
+
className: "neeto-ui-w-full",
|
|
17682
|
+
children: isInputVisible ? /*#__PURE__*/jsx(NeetoUIMultiEmailInput, {
|
|
17683
|
+
isRequired: isRequired,
|
|
17684
|
+
label: label,
|
|
17685
|
+
error: meta.touched ? meta.error : "",
|
|
17686
|
+
helpText: t("neetoForm.common.addGuestsHelper"),
|
|
17687
|
+
name: field.name,
|
|
17688
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
17689
|
+
value: field.value,
|
|
17690
|
+
onBlur: function onBlur() {
|
|
17691
|
+
return setTouched(true);
|
|
17692
|
+
},
|
|
17693
|
+
onChange: setValue
|
|
17694
|
+
}) : /*#__PURE__*/jsx(Button$1, (_jsx2 = {
|
|
17695
|
+
label: label
|
|
17696
|
+
}, _defineProperty$6(_jsx2, "label", t("neetoForm.common.addGuests")), _defineProperty$6(_jsx2, "style", "secondary"), _defineProperty$6(_jsx2, "onClick", function onClick() {
|
|
17697
|
+
return setIsInputVisible(true);
|
|
17698
|
+
}), _jsx2))
|
|
17699
|
+
})
|
|
17700
|
+
});
|
|
17563
17701
|
};
|
|
17564
17702
|
|
|
17565
|
-
function ownKeys$
|
|
17566
|
-
function _objectSpread$
|
|
17703
|
+
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; }
|
|
17704
|
+
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; }
|
|
17567
17705
|
var ConditionField = function ConditionField(_ref) {
|
|
17568
17706
|
var question = _ref.question,
|
|
17569
17707
|
customValidator = _ref.customValidator;
|
|
@@ -17572,30 +17710,31 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17572
17710
|
isRequired = question.isRequired,
|
|
17573
17711
|
nodeId = question.nodeId;
|
|
17574
17712
|
var label = fieldWithFallback(question, "label");
|
|
17575
|
-
return /*#__PURE__*/
|
|
17713
|
+
return /*#__PURE__*/jsx(Field, {
|
|
17576
17714
|
name: name || nodeId,
|
|
17577
17715
|
validate: validateFieldValue({
|
|
17578
17716
|
kind: kind,
|
|
17579
17717
|
label: label,
|
|
17580
17718
|
isRequired: isRequired,
|
|
17581
17719
|
customValidator: customValidator
|
|
17582
|
-
})
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17720
|
+
}),
|
|
17721
|
+
children: function children(_ref2) {
|
|
17722
|
+
var meta = _ref2.meta,
|
|
17723
|
+
field = _ref2.field;
|
|
17724
|
+
return /*#__PURE__*/jsx(Checkbox, _objectSpread$j(_objectSpread$j({}, _objectSpread$j(_objectSpread$j({}, field), {}, {
|
|
17725
|
+
label: label,
|
|
17726
|
+
name: name
|
|
17727
|
+
})), {}, {
|
|
17728
|
+
checked: field.value,
|
|
17729
|
+
error: meta.touched ? meta.error : "",
|
|
17730
|
+
required: isRequired
|
|
17731
|
+
}));
|
|
17732
|
+
}
|
|
17594
17733
|
});
|
|
17595
17734
|
};
|
|
17596
17735
|
|
|
17597
|
-
function ownKeys$
|
|
17598
|
-
function _objectSpread$
|
|
17736
|
+
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; }
|
|
17737
|
+
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; }
|
|
17599
17738
|
var toEmailValues = function toEmailValues() {
|
|
17600
17739
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17601
17740
|
return values.map(function (value) {
|
|
@@ -17688,7 +17827,7 @@ var generateInitValues = function generateInitValues(_ref7) {
|
|
|
17688
17827
|
var valuesMap = {};
|
|
17689
17828
|
if (initialValues) {
|
|
17690
17829
|
valuesMap = initialValues.reduce(function (acc, answer) {
|
|
17691
|
-
return _objectSpread$
|
|
17830
|
+
return _objectSpread$i(_objectSpread$i({}, acc), {}, _defineProperty$6({}, answer.questionId, {
|
|
17692
17831
|
value: answer.value,
|
|
17693
17832
|
optionIds: answer.optionIds
|
|
17694
17833
|
}));
|
|
@@ -17920,8 +18059,8 @@ var getSelectedRating = function getSelectedRating(value) {
|
|
|
17920
18059
|
};
|
|
17921
18060
|
|
|
17922
18061
|
var _excluded$3 = ["value"];
|
|
17923
|
-
function ownKeys$
|
|
17924
|
-
function _objectSpread$
|
|
18062
|
+
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; }
|
|
18063
|
+
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; }
|
|
17925
18064
|
dayjs.extend(weekOfYear);
|
|
17926
18065
|
dayjs.extend(weekday);
|
|
17927
18066
|
dayjs.extend(localeData);
|
|
@@ -17936,47 +18075,52 @@ var DateField = function DateField(_ref) {
|
|
|
17936
18075
|
var label = fieldWithFallback(question, "label");
|
|
17937
18076
|
var _QUESTION_KIND$kind$t = QUESTION_KIND[kind.toUpperCase()].type,
|
|
17938
18077
|
type = _QUESTION_KIND$kind$t === void 0 ? "date" : _QUESTION_KIND$kind$t;
|
|
17939
|
-
return /*#__PURE__*/
|
|
17940
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17975
|
-
|
|
18078
|
+
return /*#__PURE__*/jsxs("div", {
|
|
18079
|
+
className: "neeto-form-engine-input__wrapper",
|
|
18080
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
18081
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
18082
|
+
children: label && /*#__PURE__*/jsx("label", {
|
|
18083
|
+
className: "neeto-form-engine-label",
|
|
18084
|
+
children: getLabel(label, isRequired)
|
|
18085
|
+
})
|
|
18086
|
+
}), /*#__PURE__*/jsx("div", {
|
|
18087
|
+
className: "neeto-form-engine-date-picker",
|
|
18088
|
+
children: /*#__PURE__*/jsx(Field, {
|
|
18089
|
+
name: name || nodeId,
|
|
18090
|
+
validate: validateFieldValue({
|
|
18091
|
+
kind: kind,
|
|
18092
|
+
label: label,
|
|
18093
|
+
isRequired: isRequired,
|
|
18094
|
+
customValidator: customValidator
|
|
18095
|
+
}),
|
|
18096
|
+
children: function children(_ref2) {
|
|
18097
|
+
var meta = _ref2.meta,
|
|
18098
|
+
_ref2$field = _ref2.field,
|
|
18099
|
+
value = _ref2$field.value,
|
|
18100
|
+
field = _objectWithoutProperties$1(_ref2$field, _excluded$3),
|
|
18101
|
+
form = _ref2.form;
|
|
18102
|
+
return /*#__PURE__*/jsx(DatePicker, _objectSpread$h(_objectSpread$h({}, _objectSpread$h(_objectSpread$h({}, field), {}, {
|
|
18103
|
+
type: type
|
|
18104
|
+
})), {}, {
|
|
18105
|
+
dateFormat: "MMM D, YYYY",
|
|
18106
|
+
error: meta.touched ? meta.error : "",
|
|
18107
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
18108
|
+
popupClassName: "neeto-form-engine-date-picker-popup",
|
|
18109
|
+
required: isRequired,
|
|
18110
|
+
size: "small",
|
|
18111
|
+
value: getValidDate(value),
|
|
18112
|
+
onChange: function onChange(date) {
|
|
18113
|
+
form.setFieldValue(name, date ? date.toISOString() : "");
|
|
18114
|
+
}
|
|
18115
|
+
}));
|
|
18116
|
+
}
|
|
18117
|
+
})
|
|
18118
|
+
})]
|
|
18119
|
+
});
|
|
17976
18120
|
};
|
|
17977
18121
|
|
|
17978
|
-
function ownKeys$
|
|
17979
|
-
function _objectSpread$
|
|
18122
|
+
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; }
|
|
18123
|
+
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; }
|
|
17980
18124
|
var EmailField = function EmailField(_ref) {
|
|
17981
18125
|
var question = _ref.question,
|
|
17982
18126
|
customValidator = _ref.customValidator,
|
|
@@ -18005,12 +18149,12 @@ var EmailField = function EmailField(_ref) {
|
|
|
18005
18149
|
setValue = _useField2$2.setValue,
|
|
18006
18150
|
setTouched = _useField2$2.setTouched;
|
|
18007
18151
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
18008
|
-
return /*#__PURE__*/
|
|
18152
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$g(_objectSpread$g({}, _objectSpread$g(_objectSpread$g({
|
|
18009
18153
|
type: type
|
|
18010
18154
|
}, field), {}, {
|
|
18011
18155
|
autoComplete: autoComplete,
|
|
18012
18156
|
label: label
|
|
18013
|
-
}), {
|
|
18157
|
+
})), {}, {
|
|
18014
18158
|
error: touched ? error : "",
|
|
18015
18159
|
name: kind,
|
|
18016
18160
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -19512,9 +19656,9 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
19512
19656
|
|
|
19513
19657
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19514
19658
|
|
|
19515
|
-
function ownKeys$
|
|
19659
|
+
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; }
|
|
19516
19660
|
|
|
19517
|
-
function _objectSpread$
|
|
19661
|
+
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; }
|
|
19518
19662
|
|
|
19519
19663
|
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; }
|
|
19520
19664
|
|
|
@@ -19550,7 +19694,7 @@ var Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
19550
19694
|
};
|
|
19551
19695
|
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
19552
19696
|
|
|
19553
|
-
return /*#__PURE__*/React__default.createElement(Fragment, null, children(_objectSpread$
|
|
19697
|
+
return /*#__PURE__*/React__default.createElement(Fragment$1, null, children(_objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
19554
19698
|
open: open
|
|
19555
19699
|
})));
|
|
19556
19700
|
});
|
|
@@ -19884,7 +20028,7 @@ var initialState = {
|
|
|
19884
20028
|
function useDropzone() {
|
|
19885
20029
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19886
20030
|
|
|
19887
|
-
var _defaultProps$options = _objectSpread$
|
|
20031
|
+
var _defaultProps$options = _objectSpread$f(_objectSpread$f({}, defaultProps), options),
|
|
19888
20032
|
accept = _defaultProps$options.accept,
|
|
19889
20033
|
disabled = _defaultProps$options.disabled,
|
|
19890
20034
|
getFilesFromEvent = _defaultProps$options.getFilesFromEvent,
|
|
@@ -20201,7 +20345,7 @@ function useDropzone() {
|
|
|
20201
20345
|
onDrop = _ref2.onDrop,
|
|
20202
20346
|
rest = _objectWithoutProperties(_ref2, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
|
|
20203
20347
|
|
|
20204
|
-
return _objectSpread$
|
|
20348
|
+
return _objectSpread$f(_objectSpread$f(_defineProperty({
|
|
20205
20349
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
20206
20350
|
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
20207
20351
|
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
@@ -20240,7 +20384,7 @@ function useDropzone() {
|
|
|
20240
20384
|
tabIndex: -1
|
|
20241
20385
|
}, refKey, inputRef);
|
|
20242
20386
|
|
|
20243
|
-
return _objectSpread$
|
|
20387
|
+
return _objectSpread$f(_objectSpread$f({}, inputProps), rest);
|
|
20244
20388
|
};
|
|
20245
20389
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
20246
20390
|
var fileCount = draggedFiles.length;
|
|
@@ -20253,7 +20397,7 @@ function useDropzone() {
|
|
|
20253
20397
|
maxFiles: maxFiles
|
|
20254
20398
|
});
|
|
20255
20399
|
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
20256
|
-
return _objectSpread$
|
|
20400
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20257
20401
|
isDragAccept: isDragAccept,
|
|
20258
20402
|
isDragReject: isDragReject,
|
|
20259
20403
|
isFocused: isFocused && !disabled,
|
|
@@ -20269,22 +20413,22 @@ function reducer(state, action) {
|
|
|
20269
20413
|
/* istanbul ignore next */
|
|
20270
20414
|
switch (action.type) {
|
|
20271
20415
|
case 'focus':
|
|
20272
|
-
return _objectSpread$
|
|
20416
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20273
20417
|
isFocused: true
|
|
20274
20418
|
});
|
|
20275
20419
|
|
|
20276
20420
|
case 'blur':
|
|
20277
|
-
return _objectSpread$
|
|
20421
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20278
20422
|
isFocused: false
|
|
20279
20423
|
});
|
|
20280
20424
|
|
|
20281
20425
|
case 'openDialog':
|
|
20282
|
-
return _objectSpread$
|
|
20426
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20283
20427
|
isFileDialogActive: true
|
|
20284
20428
|
});
|
|
20285
20429
|
|
|
20286
20430
|
case 'closeDialog':
|
|
20287
|
-
return _objectSpread$
|
|
20431
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20288
20432
|
isFileDialogActive: false
|
|
20289
20433
|
});
|
|
20290
20434
|
|
|
@@ -20292,19 +20436,19 @@ function reducer(state, action) {
|
|
|
20292
20436
|
/* eslint no-case-declarations: 0 */
|
|
20293
20437
|
var isDragActive = action.isDragActive,
|
|
20294
20438
|
draggedFiles = action.draggedFiles;
|
|
20295
|
-
return _objectSpread$
|
|
20439
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20296
20440
|
draggedFiles: draggedFiles,
|
|
20297
20441
|
isDragActive: isDragActive
|
|
20298
20442
|
});
|
|
20299
20443
|
|
|
20300
20444
|
case 'setFiles':
|
|
20301
|
-
return _objectSpread$
|
|
20445
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20302
20446
|
acceptedFiles: action.acceptedFiles,
|
|
20303
20447
|
fileRejections: action.fileRejections
|
|
20304
20448
|
});
|
|
20305
20449
|
|
|
20306
20450
|
case 'reset':
|
|
20307
|
-
return _objectSpread$
|
|
20451
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20308
20452
|
isFileDialogActive: false,
|
|
20309
20453
|
isDragActive: false,
|
|
20310
20454
|
draggedFiles: [],
|
|
@@ -20317,8 +20461,8 @@ function reducer(state, action) {
|
|
|
20317
20461
|
}
|
|
20318
20462
|
}
|
|
20319
20463
|
|
|
20320
|
-
function ownKeys$
|
|
20321
|
-
function _objectSpread$
|
|
20464
|
+
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; }
|
|
20465
|
+
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; }
|
|
20322
20466
|
var useFileUpload = function useFileUpload(_ref) {
|
|
20323
20467
|
var disabled = _ref.disabled,
|
|
20324
20468
|
accept = _ref.accept,
|
|
@@ -20418,7 +20562,7 @@ var useFileUpload = function useFileUpload(_ref) {
|
|
|
20418
20562
|
var uploadedFile = findBy({
|
|
20419
20563
|
name: file.name
|
|
20420
20564
|
}, newFiles);
|
|
20421
|
-
return _objectSpread$
|
|
20565
|
+
return _objectSpread$e(_objectSpread$e({}, file), uploadedFile);
|
|
20422
20566
|
})
|
|
20423
20567
|
});
|
|
20424
20568
|
} else {
|
|
@@ -20477,6 +20621,8 @@ const SvgFileUpload = props => /*#__PURE__*/React$2.createElement("svg", _extend
|
|
|
20477
20621
|
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"
|
|
20478
20622
|
})));
|
|
20479
20623
|
|
|
20624
|
+
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; }
|
|
20625
|
+
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; }
|
|
20480
20626
|
var DropZone = function DropZone(_ref) {
|
|
20481
20627
|
var isDragActive = _ref.isDragActive,
|
|
20482
20628
|
getRootProps = _ref.getRootProps,
|
|
@@ -20489,54 +20635,63 @@ var DropZone = function DropZone(_ref) {
|
|
|
20489
20635
|
var _useTranslation = useTranslation(),
|
|
20490
20636
|
t = _useTranslation.t;
|
|
20491
20637
|
var shouldShowFileSizeLimit = hasFileSizeLimit && maxFileSize;
|
|
20492
|
-
return /*#__PURE__*/
|
|
20638
|
+
return /*#__PURE__*/jsx("div", _objectSpread$d(_objectSpread$d({}, getRootProps({
|
|
20493
20639
|
className: classnames(["neeto-form-engine-file-upload__dropzone"], {
|
|
20494
20640
|
"neeto-form-engine-file-upload__dropzone--drag-active": isDragActive
|
|
20495
20641
|
})
|
|
20496
|
-
}),
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20504
|
-
|
|
20505
|
-
|
|
20506
|
-
|
|
20507
|
-
|
|
20508
|
-
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20515
|
-
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
|
|
20519
|
-
|
|
20520
|
-
|
|
20521
|
-
|
|
20522
|
-
|
|
20523
|
-
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
|
|
20528
|
-
|
|
20529
|
-
|
|
20530
|
-
|
|
20531
|
-
|
|
20532
|
-
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
|
|
20539
|
-
|
|
20642
|
+
})), {}, {
|
|
20643
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
20644
|
+
className: "neeto-form-engine-file-upload__dropzone-inner",
|
|
20645
|
+
"data-cy": "file-upload-body",
|
|
20646
|
+
children: [/*#__PURE__*/jsx(SvgFileUpload, {
|
|
20647
|
+
className: "neeto-form-engine-file-upload__upload-icon"
|
|
20648
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
20649
|
+
className: "neeto-form-engine-file-upload__dropzone-content",
|
|
20650
|
+
children: [/*#__PURE__*/jsxs("label", {
|
|
20651
|
+
className: "neeto-form-engine-file-upload__upload-label",
|
|
20652
|
+
htmlFor: "file-upload",
|
|
20653
|
+
children: [/*#__PURE__*/jsx(Trans, {
|
|
20654
|
+
i18nKey: "neetoForm.fileUpload.dropzone.chooseOrDragFile",
|
|
20655
|
+
components: {
|
|
20656
|
+
typography: /*#__PURE__*/jsx(Typography, {
|
|
20657
|
+
component: "span",
|
|
20658
|
+
weight: "semibold"
|
|
20659
|
+
}),
|
|
20660
|
+
span: /*#__PURE__*/jsx(Typography, {
|
|
20661
|
+
component: "span",
|
|
20662
|
+
weight: "normal"
|
|
20663
|
+
})
|
|
20664
|
+
}
|
|
20665
|
+
}), /*#__PURE__*/jsx("input", _objectSpread$d(_objectSpread$d({}, getInputProps()), {}, {
|
|
20666
|
+
"data-cy": "file-browse-button"
|
|
20667
|
+
}))]
|
|
20668
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
20669
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-block",
|
|
20670
|
+
children: [!multipleFilesAllowed && /*#__PURE__*/jsx(Typography, {
|
|
20671
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20672
|
+
"data-cy": "upload-only-one-file-text",
|
|
20673
|
+
style: "body3",
|
|
20674
|
+
children: t("neetoForm.fileUpload.dropzone.oneFileAllowed")
|
|
20675
|
+
}), shouldShowFileSizeLimit && /*#__PURE__*/jsx(Typography, {
|
|
20676
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20677
|
+
"data-cy": "maximum-allowed-size-text",
|
|
20678
|
+
style: "body3",
|
|
20679
|
+
children: t("neetoForm.fileUpload.dropzone.maxFileSize", {
|
|
20680
|
+
size: maxFileSize,
|
|
20681
|
+
unit: t("neetoForm.fileUpload.mb")
|
|
20682
|
+
})
|
|
20683
|
+
}), allowedFileTypes && /*#__PURE__*/jsx(Typography, {
|
|
20684
|
+
className: "neeto-form-engine-file-upload__dropzone-helper-text",
|
|
20685
|
+
"data-cy": "allowed-files-types-text",
|
|
20686
|
+
style: "body3",
|
|
20687
|
+
children: t("neetoForm.fileUpload.dropzone.allowedFileTypes", {
|
|
20688
|
+
types: allowedFileTypes
|
|
20689
|
+
})
|
|
20690
|
+
})]
|
|
20691
|
+
})]
|
|
20692
|
+
})]
|
|
20693
|
+
})
|
|
20694
|
+
}));
|
|
20540
20695
|
};
|
|
20541
20696
|
|
|
20542
20697
|
var createDefinition = function (propNames) { return ({
|
|
@@ -27846,51 +28001,55 @@ var Progress = function Progress(_ref) {
|
|
|
27846
28001
|
transition: transition
|
|
27847
28002
|
}
|
|
27848
28003
|
};
|
|
27849
|
-
return /*#__PURE__*/
|
|
27850
|
-
className: "neeto-form-engine-progress__circle"
|
|
27851
|
-
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
|
|
27857
|
-
|
|
27858
|
-
|
|
27859
|
-
|
|
27860
|
-
|
|
27861
|
-
|
|
27862
|
-
|
|
27863
|
-
|
|
27864
|
-
|
|
27865
|
-
|
|
27866
|
-
|
|
27867
|
-
|
|
27868
|
-
|
|
27869
|
-
|
|
27870
|
-
|
|
27871
|
-
|
|
27872
|
-
|
|
27873
|
-
|
|
27874
|
-
|
|
27875
|
-
|
|
27876
|
-
|
|
27877
|
-
|
|
27878
|
-
|
|
27879
|
-
|
|
27880
|
-
|
|
27881
|
-
|
|
27882
|
-
|
|
27883
|
-
|
|
27884
|
-
|
|
27885
|
-
|
|
27886
|
-
|
|
27887
|
-
|
|
27888
|
-
|
|
27889
|
-
|
|
27890
|
-
|
|
27891
|
-
|
|
27892
|
-
|
|
27893
|
-
|
|
28004
|
+
return /*#__PURE__*/jsx("div", {
|
|
28005
|
+
className: "neeto-form-engine-progress__circle",
|
|
28006
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
28007
|
+
className: "neeto-form-engine-progress__circle-wrapper",
|
|
28008
|
+
style: {
|
|
28009
|
+
height: size
|
|
28010
|
+
},
|
|
28011
|
+
children: [/*#__PURE__*/jsx("svg", {
|
|
28012
|
+
height: size,
|
|
28013
|
+
version: "1.1",
|
|
28014
|
+
viewBox: "0 0 100 100",
|
|
28015
|
+
width: size,
|
|
28016
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28017
|
+
children: /*#__PURE__*/jsx("circle", {
|
|
28018
|
+
strokeWidth: strokeWidth,
|
|
28019
|
+
className: "circle",
|
|
28020
|
+
cx: "50",
|
|
28021
|
+
cy: "50",
|
|
28022
|
+
fill: "transparent",
|
|
28023
|
+
r: radius,
|
|
28024
|
+
stroke: emptyStroke,
|
|
28025
|
+
strokeOpacity: emptyStrokeOpacity
|
|
28026
|
+
})
|
|
28027
|
+
}), /*#__PURE__*/jsx("svg", {
|
|
28028
|
+
height: size,
|
|
28029
|
+
viewBox: "0 0 100 100",
|
|
28030
|
+
width: size,
|
|
28031
|
+
style: {
|
|
28032
|
+
position: "absolute",
|
|
28033
|
+
transform: "rotate(-90deg)",
|
|
28034
|
+
overflow: "visible",
|
|
28035
|
+
top: 0
|
|
28036
|
+
},
|
|
28037
|
+
children: /*#__PURE__*/jsx(motion.circle, {
|
|
28038
|
+
stroke: stroke,
|
|
28039
|
+
strokeWidth: strokeWidth,
|
|
28040
|
+
variants: variants,
|
|
28041
|
+
animate: "show",
|
|
28042
|
+
cx: "50",
|
|
28043
|
+
cy: "50",
|
|
28044
|
+
fill: "transparent",
|
|
28045
|
+
initial: "hidden",
|
|
28046
|
+
r: radius,
|
|
28047
|
+
strokeDasharray: circumference,
|
|
28048
|
+
strokeDashoffset: fillPercents
|
|
28049
|
+
})
|
|
28050
|
+
})]
|
|
28051
|
+
})
|
|
28052
|
+
});
|
|
27894
28053
|
};
|
|
27895
28054
|
|
|
27896
28055
|
var FILE_MIME_TYPES = {
|
|
@@ -27942,48 +28101,56 @@ var FilePreview = withT(function (_ref) {
|
|
|
27942
28101
|
isUploading = _ref.isUploading,
|
|
27943
28102
|
cancel = _ref.cancel,
|
|
27944
28103
|
progress = _ref.progress;
|
|
27945
|
-
return /*#__PURE__*/
|
|
28104
|
+
return /*#__PURE__*/jsxs("li", {
|
|
27946
28105
|
className: "neeto-form-engine-file-upload__uploaded-list-item",
|
|
27947
|
-
|
|
27948
|
-
|
|
27949
|
-
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
|
|
27954
|
-
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
27959
|
-
|
|
27960
|
-
|
|
27961
|
-
|
|
27962
|
-
|
|
27963
|
-
|
|
27964
|
-
|
|
27965
|
-
|
|
27966
|
-
|
|
27967
|
-
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
|
|
27972
|
-
|
|
27973
|
-
|
|
27974
|
-
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
28106
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
28107
|
+
className: "neeto-form-engine-file-upload__file-preview",
|
|
28108
|
+
children: [/*#__PURE__*/jsx(Button$1, {
|
|
28109
|
+
className: classnames("p-0", {
|
|
28110
|
+
invisible: isUploading
|
|
28111
|
+
}),
|
|
28112
|
+
href: file.url,
|
|
28113
|
+
icon: FileGeneric,
|
|
28114
|
+
iconSize: 24,
|
|
28115
|
+
rel: "noreferrer",
|
|
28116
|
+
size: "large",
|
|
28117
|
+
style: "text",
|
|
28118
|
+
target: "_blank"
|
|
28119
|
+
}), isUploading && /*#__PURE__*/jsx("div", {
|
|
28120
|
+
className: "neeto-form-engine-progress",
|
|
28121
|
+
children: /*#__PURE__*/jsx(Progress, {
|
|
28122
|
+
percents: progress || 0,
|
|
28123
|
+
size: 20
|
|
28124
|
+
})
|
|
28125
|
+
})]
|
|
28126
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
28127
|
+
className: "flex min-w-0 grow flex-col break-words",
|
|
28128
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
28129
|
+
className: "neeto-form-engine-file-upload__file-info-name",
|
|
28130
|
+
style: "body2",
|
|
28131
|
+
children: file.name
|
|
28132
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
28133
|
+
className: "neeto-form-engine-file-upload__file-info-size",
|
|
28134
|
+
style: "body3",
|
|
28135
|
+
children: file.size ? t("neetoForm.fileUpload.fileSizeInMb", {
|
|
28136
|
+
fileSize: convertBytesToMb(file.size)
|
|
28137
|
+
}) : ""
|
|
28138
|
+
})]
|
|
28139
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
28140
|
+
className: classnames("neeto-form-engine-file-upload__actions"),
|
|
28141
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
28142
|
+
className: classnames("neeto-form-engine-file-upload__success-indicator", {
|
|
28143
|
+
"neeto-form-engine-file-upload__success-indicator--active": file.url
|
|
28144
|
+
}),
|
|
28145
|
+
children: file.url && /*#__PURE__*/jsx(Check, {})
|
|
28146
|
+
}), /*#__PURE__*/jsx("button", {
|
|
28147
|
+
type: "button",
|
|
28148
|
+
className: classnames("neeto-form-engine-file-upload__button--red neeto-form-engine-file-upload__remove-button"),
|
|
28149
|
+
onClick: cancel,
|
|
28150
|
+
children: /*#__PURE__*/jsx(Close, {})
|
|
28151
|
+
})]
|
|
28152
|
+
})]
|
|
28153
|
+
}, file.url);
|
|
27987
28154
|
});
|
|
27988
28155
|
|
|
27989
28156
|
var FileUploadField = function FileUploadField(_ref) {
|
|
@@ -28033,42 +28200,47 @@ var FileUploadField = function FileUploadField(_ref) {
|
|
|
28033
28200
|
var isUploadingFile = function isUploadingFile(file) {
|
|
28034
28201
|
return isNotNil(progress[file.name]) && (progress[file.name] !== 100 || !file.url);
|
|
28035
28202
|
};
|
|
28036
|
-
return /*#__PURE__*/
|
|
28037
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
|
|
28057
|
-
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28061
|
-
|
|
28203
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28204
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28205
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
28206
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28207
|
+
children: /*#__PURE__*/jsx(Label, {
|
|
28208
|
+
className: "neeto-form-engine-label",
|
|
28209
|
+
required: isRequired,
|
|
28210
|
+
children: label
|
|
28211
|
+
})
|
|
28212
|
+
}), /*#__PURE__*/jsx(DropZone, {
|
|
28213
|
+
allowedFileTypes: allowedFileTypes,
|
|
28214
|
+
getInputProps: getInputProps,
|
|
28215
|
+
getRootProps: getRootProps,
|
|
28216
|
+
isDragActive: isDragActive,
|
|
28217
|
+
maxFileSize: maxFileSize,
|
|
28218
|
+
multipleFilesAllowed: multipleFilesAllowed
|
|
28219
|
+
}), isNotEmpty(files) && /*#__PURE__*/jsx("ul", {
|
|
28220
|
+
className: "neeto-form-engine-file-upload__uploaded-list",
|
|
28221
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (file, idx) {
|
|
28222
|
+
return /*#__PURE__*/createElement(FilePreview, {
|
|
28223
|
+
file: file,
|
|
28224
|
+
cancel: cancel(idx),
|
|
28225
|
+
isUploading: isUploadingFile(file),
|
|
28226
|
+
key: idx,
|
|
28227
|
+
progress: progress[file.name]
|
|
28228
|
+
});
|
|
28229
|
+
})
|
|
28230
|
+
}), isNotEmpty(fileRejections) && fileRejections.map(function (file, index) {
|
|
28231
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
28232
|
+
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",
|
|
28233
|
+
children: renderErrorMessage(file, maxFileSizeInBytes, false)
|
|
28234
|
+
}, index);
|
|
28235
|
+
}), shouldShowError && /*#__PURE__*/jsx(Typography, {
|
|
28062
28236
|
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",
|
|
28063
|
-
|
|
28064
|
-
}
|
|
28065
|
-
})
|
|
28066
|
-
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"
|
|
28067
|
-
}, error));
|
|
28237
|
+
children: error
|
|
28238
|
+
})]
|
|
28239
|
+
});
|
|
28068
28240
|
};
|
|
28069
28241
|
|
|
28070
|
-
function ownKeys$
|
|
28071
|
-
function _objectSpread$
|
|
28242
|
+
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; }
|
|
28243
|
+
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; }
|
|
28072
28244
|
var NameField = function NameField(_ref) {
|
|
28073
28245
|
var question = _ref.question,
|
|
28074
28246
|
customValidator = _ref.customValidator,
|
|
@@ -28098,12 +28270,12 @@ var NameField = function NameField(_ref) {
|
|
|
28098
28270
|
setValue = _useField2$2.setValue,
|
|
28099
28271
|
setTouched = _useField2$2.setTouched;
|
|
28100
28272
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
28101
|
-
return /*#__PURE__*/
|
|
28273
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
28102
28274
|
type: type
|
|
28103
28275
|
}, field), {}, {
|
|
28104
28276
|
autoComplete: autoComplete,
|
|
28105
28277
|
label: label
|
|
28106
|
-
}), {
|
|
28278
|
+
})), {}, {
|
|
28107
28279
|
error: touched ? error : "",
|
|
28108
28280
|
name: kind,
|
|
28109
28281
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28126,39 +28298,43 @@ var Choices = function Choices(_ref) {
|
|
|
28126
28298
|
var isCheckBox = type === "checkbox";
|
|
28127
28299
|
var ChoiceWrapper = isCheckBox ? "div" : Radio;
|
|
28128
28300
|
var Component = isCheckBox ? Checkbox : Radio.Item;
|
|
28129
|
-
return /*#__PURE__*/
|
|
28130
|
-
className: "neeto-form-engine-choices__wrapper"
|
|
28131
|
-
|
|
28132
|
-
|
|
28133
|
-
|
|
28134
|
-
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
|
|
28140
|
-
|
|
28141
|
-
|
|
28142
|
-
|
|
28301
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28302
|
+
className: "neeto-form-engine-choices__wrapper",
|
|
28303
|
+
children: [/*#__PURE__*/jsx("label", {
|
|
28304
|
+
className: "neeto-form-engine-label",
|
|
28305
|
+
children: label
|
|
28306
|
+
}), /*#__PURE__*/jsx(ChoiceWrapper, {
|
|
28307
|
+
className: "neeto-form-engine-choices",
|
|
28308
|
+
stacked: !isCheckBox,
|
|
28309
|
+
children: options.map(function (option, index) {
|
|
28310
|
+
var _value$index;
|
|
28311
|
+
return /*#__PURE__*/jsx("label", {
|
|
28312
|
+
htmlFor: option.id,
|
|
28313
|
+
className: classnames("neeto-form-engine-choice", {
|
|
28314
|
+
active: false
|
|
28315
|
+
}),
|
|
28316
|
+
children: /*#__PURE__*/jsx(Component, {
|
|
28317
|
+
onChange: onChange,
|
|
28318
|
+
type: type,
|
|
28319
|
+
id: option.id,
|
|
28320
|
+
label: option.label,
|
|
28321
|
+
name: isCheckBox ? "".concat(name, ".").concat(index) : name,
|
|
28322
|
+
value: option.id,
|
|
28323
|
+
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28324
|
+
})
|
|
28325
|
+
}, option.id);
|
|
28143
28326
|
})
|
|
28144
|
-
}, /*#__PURE__*/
|
|
28145
|
-
|
|
28146
|
-
|
|
28147
|
-
|
|
28148
|
-
|
|
28149
|
-
|
|
28150
|
-
value: option.id,
|
|
28151
|
-
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28152
|
-
}));
|
|
28153
|
-
})), !!error && typeof error === "string" && /*#__PURE__*/React__default.createElement("p", {
|
|
28154
|
-
className: "neeto-form-engine-input__error",
|
|
28155
|
-
"data-cy": "neeto-form-engine-".concat(type, "-error")
|
|
28156
|
-
}, error));
|
|
28327
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsx("p", {
|
|
28328
|
+
className: "neeto-form-engine-input__error",
|
|
28329
|
+
"data-cy": "neeto-form-engine-".concat(type, "-error"),
|
|
28330
|
+
children: error
|
|
28331
|
+
})]
|
|
28332
|
+
});
|
|
28157
28333
|
};
|
|
28158
28334
|
var Choices$1 = /*#__PURE__*/React__default.memo(Choices);
|
|
28159
28335
|
|
|
28160
|
-
function ownKeys$
|
|
28161
|
-
function _objectSpread$
|
|
28336
|
+
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; }
|
|
28337
|
+
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; }
|
|
28162
28338
|
var OptionsField = function OptionsField(_ref) {
|
|
28163
28339
|
var question = _ref.question,
|
|
28164
28340
|
customValidator = _ref.customValidator;
|
|
@@ -28181,7 +28357,7 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28181
28357
|
value: option.id
|
|
28182
28358
|
};
|
|
28183
28359
|
}) : options.map(function (option) {
|
|
28184
|
-
return _objectSpread$
|
|
28360
|
+
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
28185
28361
|
label: fieldWithFallback(option, "label")
|
|
28186
28362
|
});
|
|
28187
28363
|
});
|
|
@@ -28192,31 +28368,32 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28192
28368
|
return validateField(name);
|
|
28193
28369
|
});
|
|
28194
28370
|
};
|
|
28195
|
-
return /*#__PURE__*/
|
|
28371
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28196
28372
|
name: name,
|
|
28197
28373
|
validate: validateFieldValue({
|
|
28198
28374
|
kind: kind,
|
|
28199
28375
|
label: label,
|
|
28200
28376
|
isRequired: isRequired,
|
|
28201
28377
|
customValidator: customValidator
|
|
28202
|
-
})
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28378
|
+
}),
|
|
28379
|
+
children: function children(_ref2) {
|
|
28380
|
+
var meta = _ref2.meta,
|
|
28381
|
+
field = _ref2.field;
|
|
28382
|
+
var onChange = field.onChange,
|
|
28383
|
+
value = field.value;
|
|
28384
|
+
return /*#__PURE__*/jsx(Component, {
|
|
28385
|
+
isRequired: isRequired,
|
|
28386
|
+
name: name,
|
|
28387
|
+
error: getError(meta),
|
|
28388
|
+
label: getLabel(label, isRequired),
|
|
28389
|
+
options: transformedOptions,
|
|
28390
|
+
type: kind,
|
|
28391
|
+
value: isDropdown ? findBy({
|
|
28392
|
+
value: value
|
|
28393
|
+
}, transformedOptions) || null : value,
|
|
28394
|
+
onChange: isDropdown ? handleSelect : onChange
|
|
28395
|
+
});
|
|
28396
|
+
}
|
|
28220
28397
|
});
|
|
28221
28398
|
};
|
|
28222
28399
|
|
|
@@ -28245,7 +28422,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28245
28422
|
_useField2$2 = _useField2[2],
|
|
28246
28423
|
setValue = _useField2$2.setValue,
|
|
28247
28424
|
setTouched = _useField2$2.setTouched;
|
|
28248
|
-
return /*#__PURE__*/
|
|
28425
|
+
return /*#__PURE__*/jsx(PhoneNumberInput, {
|
|
28249
28426
|
autoComplete: autoComplete,
|
|
28250
28427
|
label: label,
|
|
28251
28428
|
value: value,
|
|
@@ -28262,6 +28439,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28262
28439
|
};
|
|
28263
28440
|
|
|
28264
28441
|
var _excluded$2 = ["name", "label", "error", "lowestRatingLabel", "averageRatingLabel", "highestRatingLabel", "value"];
|
|
28442
|
+
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; }
|
|
28443
|
+
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; }
|
|
28265
28444
|
var Rating = function Rating(_ref) {
|
|
28266
28445
|
var name = _ref.name,
|
|
28267
28446
|
label = _ref.label,
|
|
@@ -28280,38 +28459,46 @@ var Rating = function Rating(_ref) {
|
|
|
28280
28459
|
var Icon = _ref2.icon,
|
|
28281
28460
|
modifier = _ref2.modifier,
|
|
28282
28461
|
rating = _ref2.value;
|
|
28283
|
-
return /*#__PURE__*/
|
|
28284
|
-
|
|
28285
|
-
|
|
28286
|
-
|
|
28287
|
-
|
|
28288
|
-
|
|
28289
|
-
|
|
28290
|
-
|
|
28291
|
-
|
|
28292
|
-
|
|
28293
|
-
|
|
28294
|
-
|
|
28295
|
-
|
|
28296
|
-
|
|
28297
|
-
|
|
28298
|
-
|
|
28299
|
-
|
|
28462
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
28463
|
+
children: [/*#__PURE__*/jsxs("button", {
|
|
28464
|
+
type: "button",
|
|
28465
|
+
className: classnames("neeto-form-engine-rating__item neeto-form-engine-rating__item--".concat(modifier), {
|
|
28466
|
+
active: rating === value
|
|
28467
|
+
}),
|
|
28468
|
+
onClick: handleClick,
|
|
28469
|
+
children: [/*#__PURE__*/jsx(Icon, {}), /*#__PURE__*/jsx("label", {
|
|
28470
|
+
className: "neeto-form-engine-label",
|
|
28471
|
+
children: labels[index]
|
|
28472
|
+
})]
|
|
28473
|
+
}), /*#__PURE__*/jsx("input", _objectSpread$a({
|
|
28474
|
+
name: name,
|
|
28475
|
+
hidden: true,
|
|
28476
|
+
checked: rating === value,
|
|
28477
|
+
type: "radio",
|
|
28478
|
+
value: rating
|
|
28479
|
+
}, other))]
|
|
28480
|
+
}, rating);
|
|
28300
28481
|
});
|
|
28301
28482
|
};
|
|
28302
|
-
return /*#__PURE__*/
|
|
28303
|
-
className: "neeto-form-engine-rating"
|
|
28304
|
-
|
|
28305
|
-
|
|
28306
|
-
|
|
28307
|
-
|
|
28308
|
-
|
|
28309
|
-
|
|
28310
|
-
"
|
|
28311
|
-
|
|
28483
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28484
|
+
className: "neeto-form-engine-rating",
|
|
28485
|
+
children: [/*#__PURE__*/jsx("label", {
|
|
28486
|
+
className: "neeto-form-engine-label",
|
|
28487
|
+
children: label
|
|
28488
|
+
}), /*#__PURE__*/jsx("div", {
|
|
28489
|
+
className: "neeto-form-engine-rating__row",
|
|
28490
|
+
children: render()
|
|
28491
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsx("p", {
|
|
28492
|
+
className: "neeto-form-engine-input__error",
|
|
28493
|
+
"data-cy": "neeto-form-engine-rating-error",
|
|
28494
|
+
children: error
|
|
28495
|
+
})]
|
|
28496
|
+
});
|
|
28312
28497
|
};
|
|
28313
28498
|
var Rating$1 = /*#__PURE__*/React__default.memo(Rating);
|
|
28314
28499
|
|
|
28500
|
+
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; }
|
|
28501
|
+
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; }
|
|
28315
28502
|
var RatingField = function RatingField(_ref) {
|
|
28316
28503
|
var question = _ref.question,
|
|
28317
28504
|
customValidator = _ref.customValidator;
|
|
@@ -28319,27 +28506,30 @@ var RatingField = function RatingField(_ref) {
|
|
|
28319
28506
|
kind = question.kind,
|
|
28320
28507
|
isRequired = question.isRequired;
|
|
28321
28508
|
var label = fieldWithFallback(question, "label");
|
|
28322
|
-
return /*#__PURE__*/
|
|
28509
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28323
28510
|
name: name,
|
|
28324
28511
|
validate: validateFieldValue({
|
|
28325
28512
|
kind: kind,
|
|
28326
28513
|
label: label,
|
|
28327
28514
|
isRequired: isRequired,
|
|
28328
28515
|
customValidator: customValidator
|
|
28329
|
-
})
|
|
28330
|
-
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
|
|
28338
|
-
|
|
28339
|
-
|
|
28516
|
+
}),
|
|
28517
|
+
children: function children(_ref2) {
|
|
28518
|
+
var meta = _ref2.meta,
|
|
28519
|
+
field = _ref2.field;
|
|
28520
|
+
return /*#__PURE__*/jsx(Rating$1, _objectSpread$9(_objectSpread$9({}, field), {}, {
|
|
28521
|
+
error: meta.touched ? meta.error : "",
|
|
28522
|
+
label: getLabel(label, isRequired),
|
|
28523
|
+
averageRatingLabel: fieldWithFallback(question, "averageRatingLabel") || RATING_VALUES.AVERAGE.label,
|
|
28524
|
+
highestRatingLabel: fieldWithFallback(question, "highestRatingLabel") || RATING_VALUES.GOOD.label,
|
|
28525
|
+
lowestRatingLabel: fieldWithFallback(question, "lowestRatingLabel") || RATING_VALUES.BAD.label
|
|
28526
|
+
}));
|
|
28527
|
+
}
|
|
28340
28528
|
});
|
|
28341
28529
|
};
|
|
28342
28530
|
|
|
28531
|
+
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; }
|
|
28532
|
+
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; }
|
|
28343
28533
|
var RichTextEditor = function RichTextEditor(_ref) {
|
|
28344
28534
|
var editorRef = _ref.editorRef,
|
|
28345
28535
|
question = _ref.question,
|
|
@@ -28355,45 +28545,50 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
28355
28545
|
var label = fieldWithFallback(question, "label");
|
|
28356
28546
|
var debouncedPlaceholder = useDebounce(fieldWithFallback(question, "placeholder"), 300);
|
|
28357
28547
|
var propsToCompare = preview ? ["debouncedPlaceholder", "error"] : ["debouncedPlaceholder"];
|
|
28358
|
-
return /*#__PURE__*/
|
|
28359
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28380
|
-
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28548
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28549
|
+
className: "neeto-form-engine-input__wrapper",
|
|
28550
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
28551
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28552
|
+
children: label && /*#__PURE__*/jsx("label", {
|
|
28553
|
+
className: "neeto-form-engine-label",
|
|
28554
|
+
children: getLabel(label, isRequired)
|
|
28555
|
+
})
|
|
28556
|
+
}), /*#__PURE__*/jsx(FastField, {
|
|
28557
|
+
debouncedPlaceholder: debouncedPlaceholder,
|
|
28558
|
+
error: errors[name],
|
|
28559
|
+
name: name || nodeId,
|
|
28560
|
+
shouldUpdate: isPropsUnequal(propsToCompare),
|
|
28561
|
+
validate: validateFieldValue({
|
|
28562
|
+
kind: kind,
|
|
28563
|
+
label: label,
|
|
28564
|
+
isRequired: isRequired
|
|
28565
|
+
}),
|
|
28566
|
+
children: function children(_ref2) {
|
|
28567
|
+
var field = _ref2.field,
|
|
28568
|
+
form = _ref2.form,
|
|
28569
|
+
meta = _ref2.meta;
|
|
28570
|
+
return /*#__PURE__*/jsx(Editor$1, _objectSpread$8({
|
|
28571
|
+
className: "neeto-form-engine-rich-text-input",
|
|
28572
|
+
error: meta.touched ? meta.error : "",
|
|
28573
|
+
initialValue: field.value,
|
|
28574
|
+
placeholder: debouncedPlaceholder,
|
|
28575
|
+
ref: editorRef,
|
|
28576
|
+
addons: ["attachments", "block-quote", "code-block", "image-upload"],
|
|
28577
|
+
onBlur: function onBlur() {
|
|
28578
|
+
return form.setFieldTouched(name, true);
|
|
28579
|
+
},
|
|
28580
|
+
onChange: function onChange(value) {
|
|
28581
|
+
return form.setFieldValue(name, value);
|
|
28582
|
+
}
|
|
28583
|
+
}, editorProps), debouncedPlaceholder);
|
|
28391
28584
|
}
|
|
28392
|
-
}
|
|
28393
|
-
})
|
|
28585
|
+
})]
|
|
28586
|
+
});
|
|
28394
28587
|
};
|
|
28395
28588
|
|
|
28396
28589
|
var _excluded$1 = ["value", "iconType", "label", "rating"];
|
|
28590
|
+
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; }
|
|
28591
|
+
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; }
|
|
28397
28592
|
var RatingButton = function RatingButton(_ref) {
|
|
28398
28593
|
var _ref$value = _ref.value,
|
|
28399
28594
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
@@ -28406,56 +28601,68 @@ var RatingButton = function RatingButton(_ref) {
|
|
|
28406
28601
|
};
|
|
28407
28602
|
var Icon = ICONS_MAP[iconType];
|
|
28408
28603
|
var selectedRating = getSelectedRating(value);
|
|
28409
|
-
return /*#__PURE__*/
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28604
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
28605
|
+
children: [/*#__PURE__*/jsxs("button", {
|
|
28606
|
+
className: classnames({
|
|
28607
|
+
active: rating === value
|
|
28608
|
+
}),
|
|
28609
|
+
type: "button",
|
|
28610
|
+
onClick: handleClick,
|
|
28611
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
28612
|
+
size: 24,
|
|
28613
|
+
className: classnames("neeto-form-engine-star-rating__icon", {
|
|
28614
|
+
"neeto-form-engine-star-rating__icon--active": rating <= selectedRating
|
|
28615
|
+
})
|
|
28616
|
+
}), /*#__PURE__*/jsx("label", {
|
|
28617
|
+
className: "neeto-form-engine-label",
|
|
28618
|
+
children: label
|
|
28619
|
+
})]
|
|
28620
|
+
}), /*#__PURE__*/jsx("input", _objectSpread$7({
|
|
28621
|
+
hidden: true,
|
|
28622
|
+
checked: equals(rating, value),
|
|
28623
|
+
type: "radio",
|
|
28624
|
+
value: rating
|
|
28625
|
+
}, otherProps))]
|
|
28626
|
+
});
|
|
28428
28627
|
};
|
|
28429
28628
|
var RatingButton$1 = /*#__PURE__*/React__default.memo(RatingButton);
|
|
28430
28629
|
|
|
28431
28630
|
var _excluded = ["label", "minValue", "maxValue", "error"];
|
|
28631
|
+
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; }
|
|
28632
|
+
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; }
|
|
28432
28633
|
var StarRating = function StarRating(_ref) {
|
|
28433
28634
|
var label = _ref.label,
|
|
28434
28635
|
minValue = _ref.minValue,
|
|
28435
28636
|
maxValue = _ref.maxValue,
|
|
28436
28637
|
error = _ref.error,
|
|
28437
28638
|
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
28438
|
-
return /*#__PURE__*/
|
|
28439
|
-
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating"
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
28448
|
-
|
|
28449
|
-
|
|
28450
|
-
|
|
28451
|
-
|
|
28452
|
-
|
|
28453
|
-
|
|
28454
|
-
"
|
|
28455
|
-
|
|
28639
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28640
|
+
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating",
|
|
28641
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
28642
|
+
className: "neeto-form-engine-input__label-wrapper",
|
|
28643
|
+
children: /*#__PURE__*/jsx("label", {
|
|
28644
|
+
className: "neeto-form-engine-label",
|
|
28645
|
+
children: label
|
|
28646
|
+
})
|
|
28647
|
+
}), /*#__PURE__*/jsx("div", {
|
|
28648
|
+
className: "neeto-form-engine-star-rating__row",
|
|
28649
|
+
children: generateArray(minValue, maxValue).map(function (index) {
|
|
28650
|
+
return /*#__PURE__*/jsx(RatingButton$1, _objectSpread$6({
|
|
28651
|
+
label: index,
|
|
28652
|
+
rating: index
|
|
28653
|
+
}, props), index);
|
|
28654
|
+
})
|
|
28655
|
+
}), !!error && typeof error === "string" && /*#__PURE__*/jsx("p", {
|
|
28656
|
+
className: "neeto-form-engine-input__error",
|
|
28657
|
+
"data-cy": "neeto-form-engine-star-rating-error",
|
|
28658
|
+
children: error
|
|
28659
|
+
})]
|
|
28660
|
+
});
|
|
28456
28661
|
};
|
|
28457
28662
|
var StarRating$1 = /*#__PURE__*/React__default.memo(StarRating);
|
|
28458
28663
|
|
|
28664
|
+
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; }
|
|
28665
|
+
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; }
|
|
28459
28666
|
var StarRatingField = function StarRatingField(_ref) {
|
|
28460
28667
|
var question = _ref.question,
|
|
28461
28668
|
customValidator = _ref.customValidator;
|
|
@@ -28466,30 +28673,31 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
28466
28673
|
maxValue = question.maxValue,
|
|
28467
28674
|
iconType = question.iconType;
|
|
28468
28675
|
var label = fieldWithFallback(question, "label");
|
|
28469
|
-
return /*#__PURE__*/
|
|
28676
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28470
28677
|
name: name,
|
|
28471
28678
|
validate: validateFieldValue({
|
|
28472
28679
|
kind: kind,
|
|
28473
28680
|
label: label,
|
|
28474
28681
|
isRequired: isRequired,
|
|
28475
28682
|
customValidator: customValidator
|
|
28476
|
-
})
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28482
|
-
|
|
28483
|
-
|
|
28484
|
-
|
|
28485
|
-
|
|
28486
|
-
|
|
28487
|
-
|
|
28683
|
+
}),
|
|
28684
|
+
children: function children(_ref2) {
|
|
28685
|
+
var meta = _ref2.meta,
|
|
28686
|
+
field = _ref2.field;
|
|
28687
|
+
return /*#__PURE__*/jsx(StarRating$1, _objectSpread$5({
|
|
28688
|
+
iconType: iconType,
|
|
28689
|
+
maxValue: maxValue,
|
|
28690
|
+
minValue: minValue,
|
|
28691
|
+
name: name,
|
|
28692
|
+
error: meta.touched ? meta.error : "",
|
|
28693
|
+
label: getLabel(label, isRequired)
|
|
28694
|
+
}, field));
|
|
28695
|
+
}
|
|
28488
28696
|
});
|
|
28489
28697
|
};
|
|
28490
28698
|
|
|
28491
|
-
function ownKeys$
|
|
28492
|
-
function _objectSpread$
|
|
28699
|
+
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; }
|
|
28700
|
+
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; }
|
|
28493
28701
|
var TermsField = function TermsField(_ref) {
|
|
28494
28702
|
var question = _ref.question,
|
|
28495
28703
|
customValidator = _ref.customValidator;
|
|
@@ -28498,32 +28706,35 @@ var TermsField = function TermsField(_ref) {
|
|
|
28498
28706
|
isRequired = question.isRequired,
|
|
28499
28707
|
nodeId = question.nodeId;
|
|
28500
28708
|
var label = fieldWithFallback(question, "label", true);
|
|
28501
|
-
return /*#__PURE__*/
|
|
28709
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28502
28710
|
name: name || nodeId,
|
|
28503
28711
|
validate: validateFieldValue({
|
|
28504
28712
|
kind: kind,
|
|
28505
28713
|
label: label,
|
|
28506
28714
|
isRequired: isRequired,
|
|
28507
28715
|
customValidator: customValidator
|
|
28508
|
-
})
|
|
28509
|
-
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
|
|
28716
|
+
}),
|
|
28717
|
+
children: function children(_ref2) {
|
|
28718
|
+
var meta = _ref2.meta,
|
|
28719
|
+
field = _ref2.field;
|
|
28720
|
+
return /*#__PURE__*/jsx("div", {
|
|
28721
|
+
className: "neeto-form-engine-terms",
|
|
28722
|
+
children: /*#__PURE__*/jsx(Checkbox, _objectSpread$4(_objectSpread$4({}, _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
28723
|
+
name: name
|
|
28724
|
+
})), {}, {
|
|
28725
|
+
checked: field.value,
|
|
28726
|
+
error: meta.touched ? meta.error : "",
|
|
28727
|
+
children: /*#__PURE__*/jsx(EditorContent, {
|
|
28728
|
+
content: label
|
|
28729
|
+
})
|
|
28730
|
+
}))
|
|
28731
|
+
});
|
|
28732
|
+
}
|
|
28522
28733
|
});
|
|
28523
28734
|
};
|
|
28524
28735
|
|
|
28525
|
-
function ownKeys$
|
|
28526
|
-
function _objectSpread$
|
|
28736
|
+
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; }
|
|
28737
|
+
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; }
|
|
28527
28738
|
var TextField = function TextField(_ref) {
|
|
28528
28739
|
var _otherProps$onChange;
|
|
28529
28740
|
var question = _ref.question,
|
|
@@ -28558,13 +28769,13 @@ var TextField = function TextField(_ref) {
|
|
|
28558
28769
|
setValue = _useField2$2.setValue,
|
|
28559
28770
|
setTouched = _useField2$2.setTouched;
|
|
28560
28771
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
28561
|
-
return /*#__PURE__*/
|
|
28772
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({
|
|
28562
28773
|
type: type
|
|
28563
28774
|
}, field), {}, {
|
|
28564
28775
|
autoComplete: autoComplete,
|
|
28565
28776
|
label: label,
|
|
28566
28777
|
onKeyDown: onKeyDown
|
|
28567
|
-
}), {
|
|
28778
|
+
})), {}, {
|
|
28568
28779
|
error: touched ? error : "",
|
|
28569
28780
|
name: slugify(label),
|
|
28570
28781
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28579,18 +28790,11 @@ var TextField = function TextField(_ref) {
|
|
|
28579
28790
|
var _QUESTION_TO_COMPONEN;
|
|
28580
28791
|
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) {
|
|
28581
28792
|
var question = _ref.question;
|
|
28582
|
-
return /*#__PURE__*/
|
|
28793
|
+
return /*#__PURE__*/jsx(EditorContent, {
|
|
28583
28794
|
content: fieldWithFallback(question, "label", true)
|
|
28584
28795
|
});
|
|
28585
28796
|
}), _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);
|
|
28586
28797
|
|
|
28587
|
-
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
28588
|
-
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
28589
|
-
var fallback = question["".concat(fieldName, "Fallback")];
|
|
28590
|
-
var field = question[fieldName];
|
|
28591
|
-
var isFieldEmpty = hasRichContent ? isEditorEmpty(field) : isEmpty(field);
|
|
28592
|
-
return isFieldEmpty && isNotNil(fallback) ? fallback : field;
|
|
28593
|
-
};
|
|
28594
28798
|
var getFieldComponent = function getFieldComponent(_ref) {
|
|
28595
28799
|
var kind = _ref.kind;
|
|
28596
28800
|
if (kind in QUESTION_TO_COMPONENT_MAP) return QUESTION_TO_COMPONENT_MAP[kind];
|
|
@@ -28644,21 +28848,24 @@ const SvgSuccess = props => /*#__PURE__*/React$2.createElement("svg", _extends({
|
|
|
28644
28848
|
var Success = function Success() {
|
|
28645
28849
|
var _useTranslation = useTranslation(),
|
|
28646
28850
|
t = _useTranslation.t;
|
|
28647
|
-
return /*#__PURE__*/
|
|
28648
|
-
className: "flex h-full w-full flex-col items-center justify-center space-y-4"
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
|
|
28851
|
+
return /*#__PURE__*/jsxs("div", {
|
|
28852
|
+
className: "flex h-full w-full flex-col items-center justify-center space-y-4",
|
|
28853
|
+
children: [/*#__PURE__*/jsx(SvgSuccess, {}), /*#__PURE__*/jsx(Typography, {
|
|
28854
|
+
style: "h1",
|
|
28855
|
+
children: t("neetoForm.successPage.title1")
|
|
28856
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
28857
|
+
style: "h1",
|
|
28858
|
+
children: t("neetoForm.successPage.title2")
|
|
28859
|
+
})]
|
|
28860
|
+
});
|
|
28654
28861
|
};
|
|
28655
28862
|
var Success$1 = /*#__PURE__*/React__default.memo(Success);
|
|
28656
28863
|
|
|
28657
28864
|
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; } } }; }
|
|
28658
28865
|
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); }
|
|
28659
28866
|
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; }
|
|
28660
|
-
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; }
|
|
28661
|
-
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; }
|
|
28867
|
+
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; }
|
|
28868
|
+
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; }
|
|
28662
28869
|
var ExternalForm = function ExternalForm(_ref) {
|
|
28663
28870
|
var _formikInnerRef$curre;
|
|
28664
28871
|
var _ref$preview = _ref.preview,
|
|
@@ -28827,7 +29034,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28827
29034
|
_context.next = 29;
|
|
28828
29035
|
return createSubmission({
|
|
28829
29036
|
formId: formId,
|
|
28830
|
-
values: _objectSpread({
|
|
29037
|
+
values: _objectSpread$2({
|
|
28831
29038
|
neetoFormResponse: {
|
|
28832
29039
|
responses: responses
|
|
28833
29040
|
}
|
|
@@ -28930,9 +29137,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28930
29137
|
mode: "scoped"
|
|
28931
29138
|
});
|
|
28932
29139
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|
|
28933
|
-
return /*#__PURE__*/
|
|
28934
|
-
className: "loader flex h-full w-full items-center justify-center"
|
|
28935
|
-
|
|
29140
|
+
return /*#__PURE__*/jsx("div", {
|
|
29141
|
+
className: "loader flex h-full w-full items-center justify-center",
|
|
29142
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
29143
|
+
});
|
|
28936
29144
|
}
|
|
28937
29145
|
var title = form.title,
|
|
28938
29146
|
_form$questions = form.questions,
|
|
@@ -28942,96 +29150,107 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28942
29150
|
return !_destroy;
|
|
28943
29151
|
}) : questions;
|
|
28944
29152
|
if (displayThankYou && showSuccess) {
|
|
28945
|
-
return /*#__PURE__*/
|
|
28946
|
-
}
|
|
28947
|
-
return /*#__PURE__*/
|
|
28948
|
-
|
|
28949
|
-
|
|
28950
|
-
|
|
28951
|
-
|
|
28952
|
-
|
|
28953
|
-
|
|
28954
|
-
|
|
28955
|
-
|
|
28956
|
-
|
|
28957
|
-
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
28967
|
-
|
|
28968
|
-
|
|
28969
|
-
|
|
28970
|
-
|
|
28971
|
-
|
|
28972
|
-
|
|
28973
|
-
|
|
28974
|
-
|
|
28975
|
-
|
|
28976
|
-
|
|
28977
|
-
|
|
28978
|
-
|
|
28979
|
-
|
|
28980
|
-
|
|
28981
|
-
|
|
28982
|
-
|
|
28983
|
-
|
|
28984
|
-
|
|
28985
|
-
|
|
28986
|
-
|
|
28987
|
-
|
|
28988
|
-
|
|
28989
|
-
|
|
28990
|
-
|
|
28991
|
-
|
|
28992
|
-
|
|
28993
|
-
|
|
28994
|
-
|
|
28995
|
-
|
|
28996
|
-
|
|
28997
|
-
|
|
28998
|
-
|
|
28999
|
-
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
|
|
29005
|
-
|
|
29006
|
-
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29014
|
-
|
|
29015
|
-
|
|
29016
|
-
|
|
29017
|
-
|
|
29018
|
-
|
|
29019
|
-
|
|
29020
|
-
|
|
29021
|
-
|
|
29022
|
-
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
|
|
29029
|
-
|
|
29030
|
-
|
|
29031
|
-
|
|
29153
|
+
return /*#__PURE__*/jsx(Success$1, {});
|
|
29154
|
+
}
|
|
29155
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
29156
|
+
children: [showTitle && /*#__PURE__*/jsx("div", {
|
|
29157
|
+
className: "py-6 text-center",
|
|
29158
|
+
children: /*#__PURE__*/jsx(Typography, _objectSpread$2(_objectSpread$2({
|
|
29159
|
+
className: "neeto-ui-text-gray-800",
|
|
29160
|
+
style: "h4",
|
|
29161
|
+
weight: "semibold"
|
|
29162
|
+
}, titleProps), {}, {
|
|
29163
|
+
children: formTitle || title
|
|
29164
|
+
}))
|
|
29165
|
+
}), /*#__PURE__*/jsx(Formik, {
|
|
29166
|
+
onSubmit: onSubmit,
|
|
29167
|
+
enableReinitialize: true,
|
|
29168
|
+
innerRef: formikInnerRef,
|
|
29169
|
+
initialValues: generateInitValues({
|
|
29170
|
+
questions: questions,
|
|
29171
|
+
initialValues: submission === null || submission === void 0 ? void 0 : submission.responses,
|
|
29172
|
+
localValues: preserveValues ? localValues : initialValues,
|
|
29173
|
+
fieldCodes: enablePreFilling ? getQueryParams({
|
|
29174
|
+
toCamelCase: false
|
|
29175
|
+
}) : {}
|
|
29176
|
+
}),
|
|
29177
|
+
children: function children(_ref5) {
|
|
29178
|
+
var isSubmitting = _ref5.isSubmitting,
|
|
29179
|
+
errors = _ref5.errors,
|
|
29180
|
+
setFieldError = _ref5.setFieldError,
|
|
29181
|
+
handleReset = _ref5.handleReset;
|
|
29182
|
+
return /*#__PURE__*/jsxs(FormikWrap, {
|
|
29183
|
+
formId: formId,
|
|
29184
|
+
preserveValues: preserveValues,
|
|
29185
|
+
onError: handleScrollToError,
|
|
29186
|
+
onValuesChange: onChange,
|
|
29187
|
+
children: [/*#__PURE__*/jsxs(Form$3, _objectSpread$2(_objectSpread$2({
|
|
29188
|
+
noValidate: true,
|
|
29189
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
29190
|
+
className: classnames("neeto-form-engine-form relative space-y-4", _defineProperty$6({}, className, className)),
|
|
29191
|
+
onChange: function onChange(event) {
|
|
29192
|
+
if (isEmpty(errors)) return;
|
|
29193
|
+
setFieldError(event.target.name, "");
|
|
29194
|
+
}
|
|
29195
|
+
}, formDomProps), {}, {
|
|
29196
|
+
onReset: function onReset(e) {
|
|
29197
|
+
return _onReset(e, handleReset);
|
|
29198
|
+
},
|
|
29199
|
+
children: [(submission === null || submission === void 0 ? void 0 : submission.isLoading) && /*#__PURE__*/jsx("div", {
|
|
29200
|
+
className: "neeto-ui-bg-gray-100 absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center opacity-75",
|
|
29201
|
+
children: /*#__PURE__*/jsx(Spinner$2, {})
|
|
29202
|
+
}), renderedQuestions.map(function (question) {
|
|
29203
|
+
var _question$id;
|
|
29204
|
+
var FieldComponent = getFieldComponent(question);
|
|
29205
|
+
return /*#__PURE__*/createElement(FieldComponent, {
|
|
29206
|
+
editorProps: editorProps,
|
|
29207
|
+
editorRef: editorRef,
|
|
29208
|
+
preview: preview,
|
|
29209
|
+
question: question,
|
|
29210
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
29211
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
29212
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
29213
|
+
});
|
|
29214
|
+
}), showEmptyState && isEmpty(renderedQuestions) && /*#__PURE__*/jsxs("div", {
|
|
29215
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
29216
|
+
children: [/*#__PURE__*/jsx(SvgNoQuestions, {}), /*#__PURE__*/jsx(Typography, {
|
|
29217
|
+
style: "h3",
|
|
29218
|
+
weight: "semibold",
|
|
29219
|
+
children: t("neetoForm.questions.common.notFound")
|
|
29220
|
+
})]
|
|
29221
|
+
}), footer, !isEmpty(renderedQuestions) && /*#__PURE__*/jsxs("div", {
|
|
29222
|
+
className: "mt-8 flex items-center justify-between",
|
|
29223
|
+
children: [cancelButtonProps && /*#__PURE__*/jsx(Button$1, _objectSpread$2({
|
|
29224
|
+
label: t("neetoForm.common.cancel"),
|
|
29225
|
+
style: "secondary"
|
|
29226
|
+
}, cancelButtonProps)), /*#__PURE__*/jsx("div", {
|
|
29227
|
+
className: "flex gap-x-2",
|
|
29228
|
+
children: renderButtonsInOrder([/*#__PURE__*/jsx(Button$1, _objectSpread$2({
|
|
29229
|
+
disabled: isSubmitting || isSubmitted,
|
|
29230
|
+
label: t("neetoForm.common.submit"),
|
|
29231
|
+
loading: isSubmitting,
|
|
29232
|
+
type: "submit"
|
|
29233
|
+
}, submitButtonProps), "submit"), /*#__PURE__*/jsx(Button$1, _objectSpread$2({
|
|
29234
|
+
label: t("neetoForm.common.reset"),
|
|
29235
|
+
style: "secondary",
|
|
29236
|
+
type: "reset"
|
|
29237
|
+
}, resetButtonProps), "reset")], isPresent$1(cancelButtonProps))
|
|
29238
|
+
})]
|
|
29239
|
+
})]
|
|
29240
|
+
})), !customSubmitHandler && /*#__PURE__*/jsx(Callout, {
|
|
29241
|
+
callout: {
|
|
29242
|
+
isVisible: isPresent$1(error),
|
|
29243
|
+
title: t("neetoForm.callouts.submitError"),
|
|
29244
|
+
message: error
|
|
29245
|
+
},
|
|
29246
|
+
onClose: function onClose() {
|
|
29247
|
+
return setError(null);
|
|
29248
|
+
}
|
|
29249
|
+
})]
|
|
29250
|
+
});
|
|
29032
29251
|
}
|
|
29033
|
-
})
|
|
29034
|
-
})
|
|
29252
|
+
})]
|
|
29253
|
+
});
|
|
29035
29254
|
};
|
|
29036
29255
|
|
|
29037
29256
|
var dist = {};
|
|
@@ -31559,13 +31778,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31559
31778
|
var _default = dist.default = _Linkify2.default;
|
|
31560
31779
|
|
|
31561
31780
|
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
31562
|
-
return /*#__PURE__*/
|
|
31781
|
+
return /*#__PURE__*/jsx("a", {
|
|
31563
31782
|
className: "neeto-ui-text-primary-500 hover:underline",
|
|
31564
31783
|
href: decoratedHref,
|
|
31565
|
-
key: key,
|
|
31566
31784
|
rel: "noreferrer",
|
|
31567
|
-
target: "_blank"
|
|
31568
|
-
|
|
31785
|
+
target: "_blank",
|
|
31786
|
+
children: decoratedText
|
|
31787
|
+
}, key);
|
|
31569
31788
|
};
|
|
31570
31789
|
var filterResponses = removeBy({
|
|
31571
31790
|
kind: QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
@@ -31574,27 +31793,33 @@ var filterResponses = removeBy({
|
|
|
31574
31793
|
|
|
31575
31794
|
var FileUpload = function FileUpload(_ref) {
|
|
31576
31795
|
var files = _ref.files;
|
|
31577
|
-
return /*#__PURE__*/
|
|
31578
|
-
className: "space-y-2"
|
|
31579
|
-
|
|
31580
|
-
|
|
31581
|
-
|
|
31582
|
-
|
|
31583
|
-
|
|
31584
|
-
|
|
31585
|
-
|
|
31586
|
-
|
|
31587
|
-
|
|
31588
|
-
|
|
31589
|
-
|
|
31590
|
-
|
|
31591
|
-
|
|
31796
|
+
return /*#__PURE__*/jsx("div", {
|
|
31797
|
+
className: "space-y-2",
|
|
31798
|
+
children: files === null || files === void 0 ? void 0 : files.map(function (_ref2, index) {
|
|
31799
|
+
var url = _ref2.url,
|
|
31800
|
+
name = _ref2.name;
|
|
31801
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
31802
|
+
className: "break-all",
|
|
31803
|
+
style: "body2",
|
|
31804
|
+
children: /*#__PURE__*/jsx(_default, {
|
|
31805
|
+
componentDecorator: function componentDecorator() {
|
|
31806
|
+
return linkifyDecorator(url, name, index);
|
|
31807
|
+
},
|
|
31808
|
+
children: url
|
|
31809
|
+
})
|
|
31810
|
+
}, index);
|
|
31811
|
+
})
|
|
31812
|
+
});
|
|
31592
31813
|
};
|
|
31593
31814
|
|
|
31815
|
+
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; }
|
|
31816
|
+
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; }
|
|
31594
31817
|
var getValue = function getValue(_ref) {
|
|
31595
31818
|
var value = _ref.value,
|
|
31596
31819
|
kind = _ref.kind;
|
|
31597
|
-
if (isEmpty(value)) return /*#__PURE__*/
|
|
31820
|
+
if (isEmpty(value)) return /*#__PURE__*/jsx("i", {
|
|
31821
|
+
children: t$4("neetoForm.common.unanswered")
|
|
31822
|
+
});
|
|
31598
31823
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31599
31824
|
return value && dateFormat.date(value);
|
|
31600
31825
|
}
|
|
@@ -31638,51 +31863,58 @@ var Submission = function Submission(_ref2) {
|
|
|
31638
31863
|
var renderSubmittedValue = function renderSubmittedValue(kind, value) {
|
|
31639
31864
|
switch (kind) {
|
|
31640
31865
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
31641
|
-
return /*#__PURE__*/
|
|
31866
|
+
return /*#__PURE__*/jsx(EditorContent, {
|
|
31642
31867
|
content: getEditorContent(getValue({
|
|
31643
31868
|
value: value,
|
|
31644
31869
|
kind: kind
|
|
31645
31870
|
}))
|
|
31646
31871
|
});
|
|
31647
31872
|
case QUESTION_KIND.PHONE.value:
|
|
31648
|
-
return isPresent$1(value) ? /*#__PURE__*/
|
|
31873
|
+
return isPresent$1(value) ? /*#__PURE__*/jsx(PhoneNumber$1, {
|
|
31649
31874
|
value: value,
|
|
31650
31875
|
showEmoji: true
|
|
31651
31876
|
}) : "-";
|
|
31652
31877
|
case QUESTION_KIND.FILE_UPLOAD.value:
|
|
31653
|
-
return isPresent$1(value) ? /*#__PURE__*/
|
|
31878
|
+
return isPresent$1(value) ? /*#__PURE__*/jsx(FileUpload, {
|
|
31654
31879
|
files: value
|
|
31655
31880
|
}) : "-";
|
|
31656
31881
|
default:
|
|
31657
|
-
return /*#__PURE__*/
|
|
31882
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
31658
31883
|
weight: "semibold"
|
|
31659
|
-
}, answerProps),
|
|
31660
|
-
|
|
31661
|
-
|
|
31662
|
-
|
|
31663
|
-
|
|
31664
|
-
|
|
31884
|
+
}, answerProps), {}, {
|
|
31885
|
+
children: /*#__PURE__*/jsx(_default, {
|
|
31886
|
+
componentDecorator: linkifyDecorator,
|
|
31887
|
+
children: getValue({
|
|
31888
|
+
value: value,
|
|
31889
|
+
kind: kind
|
|
31890
|
+
})
|
|
31891
|
+
})
|
|
31892
|
+
}));
|
|
31665
31893
|
}
|
|
31666
31894
|
};
|
|
31667
31895
|
if (isLoading) {
|
|
31668
|
-
return /*#__PURE__*/
|
|
31669
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31670
|
-
|
|
31671
|
-
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
31675
|
-
|
|
31676
|
-
|
|
31677
|
-
|
|
31678
|
-
|
|
31679
|
-
|
|
31680
|
-
|
|
31681
|
-
|
|
31682
|
-
|
|
31683
|
-
|
|
31684
|
-
|
|
31685
|
-
|
|
31896
|
+
return /*#__PURE__*/jsx("div", {
|
|
31897
|
+
className: "flex h-full w-full items-center justify-center",
|
|
31898
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
31899
|
+
});
|
|
31900
|
+
}
|
|
31901
|
+
return /*#__PURE__*/jsx("div", {
|
|
31902
|
+
className: classnames("mx-auto flex h-full w-full flex-col items-start", _defineProperty$6({}, className, className)),
|
|
31903
|
+
children: filteredResponses.map(function (_ref3) {
|
|
31904
|
+
var kind = _ref3.kind,
|
|
31905
|
+
label = _ref3.label,
|
|
31906
|
+
value = _ref3.value;
|
|
31907
|
+
return /*#__PURE__*/jsxs("div", {
|
|
31908
|
+
className: "mb-4",
|
|
31909
|
+
children: [/*#__PURE__*/jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
31910
|
+
style: "h5",
|
|
31911
|
+
weight: "light"
|
|
31912
|
+
}, questionLabelProps), {}, {
|
|
31913
|
+
children: label
|
|
31914
|
+
})), renderSubmittedValue(kind, value)]
|
|
31915
|
+
}, label);
|
|
31916
|
+
})
|
|
31917
|
+
});
|
|
31686
31918
|
};
|
|
31687
31919
|
|
|
31688
31920
|
var getPreFillableQuestions = function getPreFillableQuestions(questions) {
|
|
@@ -31746,6 +31978,8 @@ var buildQueryParameters = function buildQueryParameters(responses, questions) {
|
|
|
31746
31978
|
return queryParameters;
|
|
31747
31979
|
};
|
|
31748
31980
|
|
|
31981
|
+
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; }
|
|
31982
|
+
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; }
|
|
31749
31983
|
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; } } }; }
|
|
31750
31984
|
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); }
|
|
31751
31985
|
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; }
|
|
@@ -31830,81 +32064,94 @@ var UrlBuilder = function UrlBuilder(_ref) {
|
|
|
31830
32064
|
mode: "scoped"
|
|
31831
32065
|
});
|
|
31832
32066
|
if (isLoading || form.isQuestionsLoading) {
|
|
31833
|
-
return /*#__PURE__*/
|
|
31834
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31835
|
-
|
|
32067
|
+
return /*#__PURE__*/jsx("div", {
|
|
32068
|
+
className: "flex h-full w-full items-center justify-center",
|
|
32069
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
32070
|
+
});
|
|
31836
32071
|
}
|
|
31837
32072
|
var title = form.title,
|
|
31838
32073
|
questions = form.questions;
|
|
31839
32074
|
var modifiedQuestions = getPreFillableQuestions(questions);
|
|
31840
|
-
return /*#__PURE__*/
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
|
|
31863
|
-
|
|
31864
|
-
|
|
31865
|
-
|
|
31866
|
-
|
|
31867
|
-
|
|
31868
|
-
|
|
31869
|
-
|
|
31870
|
-
|
|
31871
|
-
|
|
31872
|
-
|
|
31873
|
-
|
|
32075
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
32076
|
+
children: [showTitle && /*#__PURE__*/jsx("div", {
|
|
32077
|
+
className: "py-6 text-center",
|
|
32078
|
+
children: /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
|
|
32079
|
+
className: "neeto-ui-text-gray-800",
|
|
32080
|
+
style: "h4",
|
|
32081
|
+
weight: "semibold"
|
|
32082
|
+
}, titleProps), {}, {
|
|
32083
|
+
children: formTitle || title
|
|
32084
|
+
}))
|
|
32085
|
+
}), /*#__PURE__*/jsx(Formik, {
|
|
32086
|
+
onSubmit: onSubmit,
|
|
32087
|
+
enableReinitialize: true,
|
|
32088
|
+
initialValues: generateInitValues({
|
|
32089
|
+
questions: modifiedQuestions
|
|
32090
|
+
}),
|
|
32091
|
+
innerRef: formikInnerRef,
|
|
32092
|
+
children: function children(_ref3) {
|
|
32093
|
+
var isSubmitting = _ref3.isSubmitting,
|
|
32094
|
+
errors = _ref3.errors,
|
|
32095
|
+
setFieldError = _ref3.setFieldError,
|
|
32096
|
+
handleReset = _ref3.handleReset;
|
|
32097
|
+
return /*#__PURE__*/jsx(FormikWrap, {
|
|
32098
|
+
formId: formId,
|
|
32099
|
+
preserveValues: false,
|
|
32100
|
+
onError: handleScrollToError,
|
|
32101
|
+
onValuesChange: onChange,
|
|
32102
|
+
children: /*#__PURE__*/jsxs(Form$3, _objectSpread(_objectSpread({
|
|
32103
|
+
noValidate: true,
|
|
32104
|
+
ref: mergeRefs(formRef, keyPressRef),
|
|
32105
|
+
className: classnames("neeto-form-engine-form relative space-y-4", className),
|
|
32106
|
+
onChange: function onChange(event) {
|
|
32107
|
+
if (isEmpty(errors)) return;
|
|
32108
|
+
setFieldError(event.target.name, "");
|
|
32109
|
+
}
|
|
32110
|
+
}, formDomProps), {}, {
|
|
32111
|
+
onReset: function onReset(e) {
|
|
32112
|
+
return _onReset(e, handleReset);
|
|
32113
|
+
},
|
|
32114
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
32115
|
+
className: "neeto-form-engine-questions-wrapper space-y-4 overflow-auto pr-4",
|
|
32116
|
+
children: [modifiedQuestions.map(function (question) {
|
|
32117
|
+
var _question$id;
|
|
32118
|
+
var FieldComponent = getFieldComponent(question);
|
|
32119
|
+
return /*#__PURE__*/createElement(FieldComponent, {
|
|
32120
|
+
editorProps: editorProps,
|
|
32121
|
+
editorRef: editorRef,
|
|
32122
|
+
question: question,
|
|
32123
|
+
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
32124
|
+
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
32125
|
+
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
32126
|
+
});
|
|
32127
|
+
}), showEmptyState && isEmpty(modifiedQuestions) && /*#__PURE__*/jsxs("div", {
|
|
32128
|
+
className: "flex flex-col items-center justify-center gap-y-4 py-8",
|
|
32129
|
+
children: [/*#__PURE__*/jsx(SvgNoQuestions, {}), /*#__PURE__*/jsx(Typography, {
|
|
32130
|
+
style: "h3",
|
|
32131
|
+
weight: "semibold",
|
|
32132
|
+
children: t("neetoForm.questions.common.notFound")
|
|
32133
|
+
})]
|
|
32134
|
+
})]
|
|
32135
|
+
}), !isEmpty(modifiedQuestions) && /*#__PURE__*/jsxs("div", {
|
|
32136
|
+
className: "mt-8 flex items-center justify-start gap-x-2",
|
|
32137
|
+
children: [/*#__PURE__*/jsx(Button$1, _objectSpread({
|
|
32138
|
+
disabled: isSubmitting,
|
|
32139
|
+
label: t("neetoForm.common.generateLink"),
|
|
32140
|
+
loading: isSubmitting,
|
|
32141
|
+
type: "submit"
|
|
32142
|
+
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/jsx(Button$1, _objectSpread({
|
|
32143
|
+
label: t("neetoForm.common.reset"),
|
|
32144
|
+
style: "secondary",
|
|
32145
|
+
type: "reset"
|
|
32146
|
+
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/jsx(Button$1, _objectSpread({
|
|
32147
|
+
label: t("neetoForm.common.cancel")
|
|
32148
|
+
}, cancelButtonProps))]
|
|
32149
|
+
})]
|
|
32150
|
+
}))
|
|
32151
|
+
});
|
|
31874
32152
|
}
|
|
31875
|
-
})
|
|
31876
|
-
|
|
31877
|
-
}, modifiedQuestions.map(function (question) {
|
|
31878
|
-
var _question$id;
|
|
31879
|
-
var FieldComponent = getFieldComponent(question);
|
|
31880
|
-
return /*#__PURE__*/React__default.createElement(FieldComponent, {
|
|
31881
|
-
editorProps: editorProps,
|
|
31882
|
-
editorRef: editorRef,
|
|
31883
|
-
question: question,
|
|
31884
|
-
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
31885
|
-
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
31886
|
-
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
31887
|
-
});
|
|
31888
|
-
}), showEmptyState && isEmpty(modifiedQuestions) && /*#__PURE__*/React__default.createElement("div", {
|
|
31889
|
-
className: "flex flex-col items-center justify-center gap-y-4 py-8"
|
|
31890
|
-
}, /*#__PURE__*/React__default.createElement(SvgNoQuestions, null), /*#__PURE__*/React__default.createElement(Typography, {
|
|
31891
|
-
style: "h3",
|
|
31892
|
-
weight: "semibold"
|
|
31893
|
-
}, t("neetoForm.questions.common.notFound")))), !isEmpty(modifiedQuestions) && /*#__PURE__*/React__default.createElement("div", {
|
|
31894
|
-
className: "mt-8 flex items-center justify-start gap-x-2"
|
|
31895
|
-
}, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31896
|
-
disabled: isSubmitting,
|
|
31897
|
-
label: t("neetoForm.common.generateLink"),
|
|
31898
|
-
loading: isSubmitting,
|
|
31899
|
-
type: "submit"
|
|
31900
|
-
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31901
|
-
label: t("neetoForm.common.reset"),
|
|
31902
|
-
style: "secondary",
|
|
31903
|
-
type: "reset"
|
|
31904
|
-
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31905
|
-
label: t("neetoForm.common.cancel")
|
|
31906
|
-
}, cancelButtonProps)))));
|
|
31907
|
-
}));
|
|
32153
|
+
})]
|
|
32154
|
+
});
|
|
31908
32155
|
};
|
|
31909
32156
|
|
|
31910
32157
|
var useFormSubmission = function useFormSubmission(_ref) {
|