@bigbinary/neeto-form-frontend 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1700 -1442
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1703 -1445
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,13 +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
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useFormikContext, useField, FieldArray, Form as Form$3, Formik, Field, FastField } from 'formik';
|
|
5
|
-
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';
|
|
6
6
|
import { buildUrl, showThumbsUpToastr, withEventTargetValue, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
7
7
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
8
|
-
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';
|
|
9
9
|
import { useQuery, useQueryClient, useMutation } from 'react-query';
|
|
10
10
|
import i18next, { t as t$4 } from 'i18next';
|
|
11
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
12
|
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
12
13
|
import { useMutationWithInvalidation, withImmutableActions, withT, useStateWithDependency, useOnClickOutside, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
13
14
|
import axios from 'axios';
|
|
@@ -15,6 +16,7 @@ import ReactDOM, { unstable_batchedUpdates, flushSync as flushSync$1 } from 'rea
|
|
|
15
16
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
16
17
|
import { useTranslation, Trans } from 'react-i18next';
|
|
17
18
|
import { create as create$2 } from 'zustand';
|
|
19
|
+
import { isEditorEmpty, Editor as Editor$1, EditorContent } from '@bigbinary/neeto-editor';
|
|
18
20
|
import { shallow } from 'zustand/shallow';
|
|
19
21
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
20
22
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
@@ -25,7 +27,6 @@ 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) {
|
|
@@ -11809,9 +11814,8 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11809
11814
|
var questionKind = selectedQuestion.kind;
|
|
11810
11815
|
var independentLabel = INDEPENDENT_LABELS_MAP[questionKind];
|
|
11811
11816
|
if (isPresent$1(independentLabel)) return independentLabel;
|
|
11812
|
-
var questionLabel = selectedQuestion
|
|
11813
|
-
|
|
11814
|
-
return isPresent$1(questionLabel) ? truncate(questionLabel, 40) : humanize(questionKind);
|
|
11817
|
+
var questionLabel = fieldWithFallback(selectedQuestion, "label");
|
|
11818
|
+
return truncate(questionLabel, 40);
|
|
11815
11819
|
};
|
|
11816
11820
|
var _useDeleteQuestion = useDeleteQuestion(selectedQuestion === null || selectedQuestion === void 0 ? void 0 : selectedQuestion.formId, selectedLanguage, {
|
|
11817
11821
|
onSuccess: function onSuccess() {
|
|
@@ -11838,13 +11842,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
11838
11842
|
}
|
|
11839
11843
|
});
|
|
11840
11844
|
};
|
|
11841
|
-
return /*#__PURE__*/
|
|
11845
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
11842
11846
|
isOpen: isOpen,
|
|
11843
11847
|
onClose: onClose,
|
|
11844
11848
|
isSubmitting: isDeleting,
|
|
11845
11849
|
submitButtonLabel: t("neetoForm.common.delete"),
|
|
11846
11850
|
title: t("neetoForm.questions.deleteAlert.title"),
|
|
11847
|
-
message: isPresent$1(selectedQuestion) && /*#__PURE__*/
|
|
11851
|
+
message: isPresent$1(selectedQuestion) && /*#__PURE__*/jsx(Trans, {
|
|
11848
11852
|
i18nKey: "neetoForm.questions.deleteAlert.message",
|
|
11849
11853
|
values: {
|
|
11850
11854
|
count: languagesCount,
|
|
@@ -11883,34 +11887,42 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
11883
11887
|
var selectedLanguageName = (_findBy = findBy({
|
|
11884
11888
|
code: currentLanguage
|
|
11885
11889
|
}, languages)) === null || _findBy === void 0 ? void 0 : _findBy.name;
|
|
11886
|
-
return /*#__PURE__*/
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
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);
|
|
11899
11923
|
}
|
|
11900
|
-
}
|
|
11901
|
-
})
|
|
11902
|
-
isOpen: isUnsavedChangesAlertOpen,
|
|
11903
|
-
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
11904
|
-
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
11905
|
-
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
11906
|
-
onClose: function onClose() {
|
|
11907
|
-
return setIsUnsavedChangesAlertOpen(false);
|
|
11908
|
-
},
|
|
11909
|
-
onSubmit: function onSubmit() {
|
|
11910
|
-
onChange(selectedLanguage);
|
|
11911
|
-
setIsUnsavedChangesAlertOpen(false);
|
|
11912
|
-
}
|
|
11913
|
-
}));
|
|
11924
|
+
})]
|
|
11925
|
+
});
|
|
11914
11926
|
};
|
|
11915
11927
|
|
|
11916
11928
|
var Overview = function Overview(_ref) {
|
|
@@ -11920,56 +11932,65 @@ var Overview = function Overview(_ref) {
|
|
|
11920
11932
|
selectedLanguage = _ref.selectedLanguage,
|
|
11921
11933
|
onLanguageChange = _ref.onLanguageChange,
|
|
11922
11934
|
additionalActionOptions = _ref.additionalActionOptions;
|
|
11923
|
-
return /*#__PURE__*/
|
|
11924
|
-
className: "neeto-form-nano-form-wrapper__overview mb-4 w-full flex-shrink-0 space-y-4 px-6 pt-6"
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
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
|
+
});
|
|
11952
11969
|
};
|
|
11953
11970
|
|
|
11954
11971
|
var _excluded$c = ["size", "color"],
|
|
11955
11972
|
_excluded2 = ["size", "color"],
|
|
11956
11973
|
_excluded3 = ["size", "color"],
|
|
11957
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; }
|
|
11958
11977
|
var BadSmiley = function BadSmiley(props) {
|
|
11959
11978
|
var size = props.size,
|
|
11960
11979
|
color = props.color,
|
|
11961
11980
|
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
11962
|
-
return /*#__PURE__*/
|
|
11981
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
11963
11982
|
fill: "none",
|
|
11964
11983
|
height: size,
|
|
11965
11984
|
viewBox: "0 0 48 48",
|
|
11966
11985
|
width: size
|
|
11967
|
-
}, other),
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
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
|
+
})]
|
|
11973
11994
|
}));
|
|
11974
11995
|
};
|
|
11975
11996
|
BadSmiley.defaultProps = {
|
|
@@ -11981,17 +12002,19 @@ var OkaySmiley = function OkaySmiley(props) {
|
|
|
11981
12002
|
var size = props.size,
|
|
11982
12003
|
color = props.color,
|
|
11983
12004
|
other = _objectWithoutProperties$1(props, _excluded2);
|
|
11984
|
-
return /*#__PURE__*/
|
|
12005
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
11985
12006
|
fill: "none",
|
|
11986
12007
|
height: size,
|
|
11987
12008
|
viewBox: "0 0 48 48",
|
|
11988
12009
|
width: size
|
|
11989
|
-
}, other),
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
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
|
+
})]
|
|
11995
12018
|
}));
|
|
11996
12019
|
};
|
|
11997
12020
|
OkaySmiley.defaultProps = {
|
|
@@ -12003,17 +12026,19 @@ var GoodSmiley = function GoodSmiley(props) {
|
|
|
12003
12026
|
var size = props.size,
|
|
12004
12027
|
color = props.color,
|
|
12005
12028
|
other = _objectWithoutProperties$1(props, _excluded3);
|
|
12006
|
-
return /*#__PURE__*/
|
|
12029
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12007
12030
|
fill: "none",
|
|
12008
12031
|
height: size,
|
|
12009
12032
|
viewBox: "0 0 48 48",
|
|
12010
12033
|
width: size
|
|
12011
|
-
}, other),
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
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
|
+
})]
|
|
12017
12042
|
}));
|
|
12018
12043
|
};
|
|
12019
12044
|
GoodSmiley.defaultProps = {
|
|
@@ -12025,26 +12050,32 @@ var Drag = function Drag(props) {
|
|
|
12025
12050
|
var size = props.size,
|
|
12026
12051
|
color = props.color,
|
|
12027
12052
|
other = _objectWithoutProperties$1(props, _excluded4);
|
|
12028
|
-
return /*#__PURE__*/
|
|
12053
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$B(_objectSpread$B({
|
|
12029
12054
|
fill: "none",
|
|
12030
12055
|
height: size,
|
|
12031
12056
|
viewBox: "0 0 24 24",
|
|
12032
12057
|
width: size
|
|
12033
|
-
}, other),
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
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
|
+
})]
|
|
12078
|
+
}));
|
|
12048
12079
|
};
|
|
12049
12080
|
Drag.defaultProps = {
|
|
12050
12081
|
color: "currentColor",
|
|
@@ -12084,54 +12115,59 @@ var Card = function Card(_ref) {
|
|
|
12084
12115
|
item: question
|
|
12085
12116
|
}),
|
|
12086
12117
|
kind = _getActiveKindDetails.kind,
|
|
12087
|
-
label = _getActiveKindDetails.label,
|
|
12088
12118
|
isSingular = _getActiveKindDetails.isSingular;
|
|
12119
|
+
var label = fieldWithFallback(question, "label");
|
|
12089
12120
|
var questionLabel = isRichTextQuestion(kind) ? htmlToPlainText(label) : label;
|
|
12090
|
-
return /*#__PURE__*/
|
|
12121
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12091
12122
|
"data-cy": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
12092
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", {
|
|
12093
12124
|
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
12094
12125
|
}),
|
|
12095
12126
|
onClick: function onClick() {
|
|
12096
12127
|
return onSelect(question);
|
|
12097
|
-
}
|
|
12098
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
12099
|
-
className: "flex min-w-0 flex-grow items-center gap-1"
|
|
12100
|
-
}, /*#__PURE__*/React__default.createElement(Drag, {
|
|
12101
|
-
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
12102
|
-
}), /*#__PURE__*/React__default.createElement(Typography, {
|
|
12103
|
-
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
12104
|
-
lineHeight: "snug",
|
|
12105
|
-
style: "body2",
|
|
12106
|
-
weight: "medium"
|
|
12107
|
-
}, questionLabel)), /*#__PURE__*/React__default.createElement(MoreDropdown, {
|
|
12108
|
-
dropdownButtonProps: {
|
|
12109
|
-
className: "shrink-0"
|
|
12110
12128
|
},
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12125
|
-
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
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
|
+
});
|
|
12133
12167
|
};
|
|
12134
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; }
|
|
12135
12171
|
var Questions = function Questions(_ref) {
|
|
12136
12172
|
var questions = _ref.questions,
|
|
12137
12173
|
isDeletable = _ref.isDeletable,
|
|
@@ -12142,39 +12178,42 @@ var Questions = function Questions(_ref) {
|
|
|
12142
12178
|
onClone = _ref.onClone,
|
|
12143
12179
|
onDelete = _ref.onDelete,
|
|
12144
12180
|
onSelect = _ref.onSelect;
|
|
12145
|
-
return /*#__PURE__*/
|
|
12146
|
-
droppableId: "droppable"
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
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
|
+
}
|
|
12178
12217
|
});
|
|
12179
12218
|
};
|
|
12180
12219
|
|
|
@@ -12255,8 +12294,8 @@ var arrayHelpers = {
|
|
|
12255
12294
|
moveItem: moveItem
|
|
12256
12295
|
};
|
|
12257
12296
|
|
|
12258
|
-
function ownKeys$
|
|
12259
|
-
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; }
|
|
12260
12299
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
12261
12300
|
var fieldCodes = pluck("fieldCode", filterBy({
|
|
12262
12301
|
kind: type
|
|
@@ -12292,7 +12331,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref2) {
|
|
|
12292
12331
|
var nextItems = _toConsumableArray$1(items);
|
|
12293
12332
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
12294
12333
|
var orderedItems = nextItems.map(function (item, index) {
|
|
12295
|
-
return _objectSpread$
|
|
12334
|
+
return _objectSpread$z(_objectSpread$z({}, item), {}, {
|
|
12296
12335
|
displayOrder: index
|
|
12297
12336
|
});
|
|
12298
12337
|
});
|
|
@@ -12306,7 +12345,7 @@ var createFieldData = function createFieldData(_ref3) {
|
|
|
12306
12345
|
_ref3$isRequired = _ref3.isRequired,
|
|
12307
12346
|
isRequired = _ref3$isRequired === void 0 ? undefined : _ref3$isRequired,
|
|
12308
12347
|
questions = _ref3.questions;
|
|
12309
|
-
return _objectSpread$
|
|
12348
|
+
return _objectSpread$z(_objectSpread$z({}, defaults), {}, {
|
|
12310
12349
|
metadata: metadata,
|
|
12311
12350
|
isRequired: isRequired,
|
|
12312
12351
|
kind: type,
|
|
@@ -12323,14 +12362,14 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
12323
12362
|
}, questionKinds);
|
|
12324
12363
|
var isRequired = item.isRequired,
|
|
12325
12364
|
kind = item.kind,
|
|
12326
|
-
label = item.label,
|
|
12327
12365
|
optionsAttributes = item.optionsAttributes;
|
|
12366
|
+
var label = fieldWithFallback(item, "label");
|
|
12328
12367
|
var defaultAttributeNames = keys(questionKind.defaults || {});
|
|
12329
12368
|
var defaultAttributes = pick(defaultAttributeNames, item);
|
|
12330
12369
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : t$4("neetoForm.common.clonedElementLabel", {
|
|
12331
12370
|
label: label
|
|
12332
12371
|
});
|
|
12333
|
-
return _objectSpread$
|
|
12372
|
+
return _objectSpread$z(_objectSpread$z({}, defaultAttributes), {}, {
|
|
12334
12373
|
isRequired: isRequired,
|
|
12335
12374
|
kind: kind,
|
|
12336
12375
|
label: newQuestionLabel,
|
|
@@ -12388,11 +12427,13 @@ const SvgNoQuestions = props => /*#__PURE__*/React$2.createElement("svg", _exten
|
|
|
12388
12427
|
|
|
12389
12428
|
var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
12390
12429
|
var children = _ref.children;
|
|
12391
|
-
return /*#__PURE__*/
|
|
12392
|
-
className: "flex h-full flex-col items-center justify-center py-8"
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
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
|
+
});
|
|
12396
12437
|
};
|
|
12397
12438
|
|
|
12398
12439
|
var NAME = QUESTION_TYPES.NAME,
|
|
@@ -12428,6 +12469,8 @@ var INITIAL_VALUES = {
|
|
|
12428
12469
|
};
|
|
12429
12470
|
|
|
12430
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; }
|
|
12431
12474
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
12432
12475
|
var label = _ref.label,
|
|
12433
12476
|
name = _ref.name,
|
|
@@ -12443,7 +12486,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
12443
12486
|
var end = element.value.length;
|
|
12444
12487
|
element.setSelectionRange(end, end);
|
|
12445
12488
|
};
|
|
12446
|
-
return /*#__PURE__*/
|
|
12489
|
+
return /*#__PURE__*/jsx(Textarea, _objectSpread$y({
|
|
12447
12490
|
label: label,
|
|
12448
12491
|
name: name,
|
|
12449
12492
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -12461,19 +12504,23 @@ var Block = function Block(_ref) {
|
|
|
12461
12504
|
var title = _ref.title,
|
|
12462
12505
|
children = _ref.children,
|
|
12463
12506
|
dataCy = _ref.dataCy;
|
|
12464
|
-
return /*#__PURE__*/
|
|
12507
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12465
12508
|
className: "mt-4 space-y-4",
|
|
12466
|
-
"data-cy": dataCy
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
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
|
+
});
|
|
12477
12524
|
};
|
|
12478
12525
|
|
|
12479
12526
|
var useUpdateEditorContent = function useUpdateEditorContent(_ref) {
|
|
@@ -12563,33 +12610,37 @@ var Editor = function Editor() {
|
|
|
12563
12610
|
initialValue: initialValue,
|
|
12564
12611
|
fieldCode: fieldCode
|
|
12565
12612
|
});
|
|
12566
|
-
return /*#__PURE__*/
|
|
12567
|
-
className: "w-full cursor-auto"
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
|
|
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
|
+
});
|
|
12580
12628
|
};
|
|
12581
12629
|
|
|
12582
12630
|
var RequiredSwitch = withT(function (_ref) {
|
|
12583
12631
|
var t = _ref.t;
|
|
12584
|
-
return /*#__PURE__*/
|
|
12585
|
-
className: "w-full"
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
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
|
+
});
|
|
12590
12639
|
});
|
|
12591
12640
|
|
|
12592
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; }
|
|
12593
12644
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
12594
12645
|
var maxLength = _ref.maxLength,
|
|
12595
12646
|
props = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
@@ -12603,38 +12654,40 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
12603
12654
|
}
|
|
12604
12655
|
}, [value, maxLength, setValue]);
|
|
12605
12656
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
12606
|
-
return /*#__PURE__*/
|
|
12657
|
+
return /*#__PURE__*/jsx(Input, _objectSpread$x(_objectSpread$x({}, props), shouldShowMaxLength && {
|
|
12607
12658
|
maxLength: maxLength
|
|
12608
12659
|
}));
|
|
12609
12660
|
};
|
|
12610
12661
|
|
|
12611
12662
|
var FieldCode = withT(function (_ref) {
|
|
12612
12663
|
var t = _ref.t;
|
|
12613
|
-
return /*#__PURE__*/
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
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
|
+
}
|
|
12634
12687
|
}
|
|
12635
12688
|
}
|
|
12636
|
-
}
|
|
12637
|
-
})
|
|
12689
|
+
})
|
|
12690
|
+
});
|
|
12638
12691
|
});
|
|
12639
12692
|
|
|
12640
12693
|
var Form$1 = function Form(_ref) {
|
|
@@ -12692,43 +12745,50 @@ var Form$1 = function Form(_ref) {
|
|
|
12692
12745
|
setErrors({});
|
|
12693
12746
|
setTouched({});
|
|
12694
12747
|
};
|
|
12695
|
-
return /*#__PURE__*/
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
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
|
+
});
|
|
12732
12792
|
};
|
|
12733
12793
|
|
|
12734
12794
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
@@ -12771,8 +12831,8 @@ var formValidationSchema = yup.object().shape({
|
|
|
12771
12831
|
});
|
|
12772
12832
|
|
|
12773
12833
|
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs"];
|
|
12774
|
-
function ownKeys$
|
|
12775
|
-
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; }
|
|
12776
12836
|
var Add = function Add(_ref) {
|
|
12777
12837
|
var question = _ref.question,
|
|
12778
12838
|
onClose = _ref.onClose,
|
|
@@ -12801,7 +12861,7 @@ var Add = function Add(_ref) {
|
|
|
12801
12861
|
isCreating = _useCreateQuestion.isLoading;
|
|
12802
12862
|
var handleSubmit = function handleSubmit(values) {
|
|
12803
12863
|
var displayOrder = question ? question.displayOrder + 1 : questions.length;
|
|
12804
|
-
createQuestion(_objectSpread$
|
|
12864
|
+
createQuestion(_objectSpread$w({
|
|
12805
12865
|
language: language,
|
|
12806
12866
|
neetoFormQuestion: mergeLeft({
|
|
12807
12867
|
displayOrder: displayOrder
|
|
@@ -12816,29 +12876,39 @@ var Add = function Add(_ref) {
|
|
|
12816
12876
|
}
|
|
12817
12877
|
});
|
|
12818
12878
|
};
|
|
12819
|
-
return /*#__PURE__*/
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
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
|
+
});
|
|
12837
12907
|
};
|
|
12838
12908
|
|
|
12839
12909
|
var _excluded$8 = ["question", "onClose"];
|
|
12840
|
-
function ownKeys$
|
|
12841
|
-
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; }
|
|
12842
12912
|
var Edit = function Edit(_ref) {
|
|
12843
12913
|
var question = _ref.question,
|
|
12844
12914
|
onClose = _ref.onClose,
|
|
@@ -12874,25 +12944,35 @@ var Edit = function Edit(_ref) {
|
|
|
12874
12944
|
}
|
|
12875
12945
|
});
|
|
12876
12946
|
};
|
|
12877
|
-
return /*#__PURE__*/
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
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
|
+
});
|
|
12896
12976
|
};
|
|
12897
12977
|
|
|
12898
12978
|
var FileGroup = function FileGroup(_ref) {
|
|
@@ -12900,7 +12980,7 @@ var FileGroup = function FileGroup(_ref) {
|
|
|
12900
12980
|
label = _ref.label,
|
|
12901
12981
|
checked = _ref.checked,
|
|
12902
12982
|
handleAllowedFileTypesChange = _ref.handleAllowedFileTypesChange;
|
|
12903
|
-
return /*#__PURE__*/
|
|
12983
|
+
return /*#__PURE__*/jsx(Checkbox, {
|
|
12904
12984
|
checked: checked,
|
|
12905
12985
|
label: label,
|
|
12906
12986
|
name: name,
|
|
@@ -12946,34 +13026,40 @@ var FileUpload$1 = function FileUpload() {
|
|
|
12946
13026
|
allowedFileTypes: allowedFileTypes
|
|
12947
13027
|
}));
|
|
12948
13028
|
};
|
|
12949
|
-
return /*#__PURE__*/
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
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
|
+
});
|
|
12973
13059
|
};
|
|
12974
13060
|
|
|
12975
|
-
function ownKeys$
|
|
12976
|
-
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; }
|
|
12977
13063
|
var defaultConfig = {
|
|
12978
13064
|
strict: true,
|
|
12979
13065
|
matchKey: "value"
|
|
@@ -12981,7 +13067,7 @@ var defaultConfig = {
|
|
|
12981
13067
|
var findOptionByValue = function findOptionByValue(value) {
|
|
12982
13068
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
12983
13069
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12984
|
-
var configObject = _objectSpread$
|
|
13070
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
12985
13071
|
var matchKey = configObject.matchKey,
|
|
12986
13072
|
strict = configObject.strict;
|
|
12987
13073
|
return options.find(function (option) {
|
|
@@ -12995,7 +13081,7 @@ var filterOptionsByValues = function filterOptionsByValues() {
|
|
|
12995
13081
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
12996
13082
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
12997
13083
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12998
|
-
var configObject = _objectSpread$
|
|
13084
|
+
var configObject = _objectSpread$u(_objectSpread$u({}, defaultConfig), config);
|
|
12999
13085
|
var matchKey = configObject.matchKey,
|
|
13000
13086
|
strict = configObject.strict;
|
|
13001
13087
|
return options.filter(function (option) {
|
|
@@ -13013,7 +13099,7 @@ var destroyFromList = function destroyFromList(items, index) {
|
|
|
13013
13099
|
var nextItems = _toConsumableArray$1(items);
|
|
13014
13100
|
nextItems.splice(index, 1);
|
|
13015
13101
|
if (itemToRemove.id) {
|
|
13016
|
-
nextItems.push(_objectSpread$
|
|
13102
|
+
nextItems.push(_objectSpread$u(_objectSpread$u({}, itemToRemove), {}, {
|
|
13017
13103
|
_destroy: true
|
|
13018
13104
|
}));
|
|
13019
13105
|
}
|
|
@@ -13039,6 +13125,8 @@ var formHelpers = {
|
|
|
13039
13125
|
pushToList: pushToList
|
|
13040
13126
|
};
|
|
13041
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; }
|
|
13042
13130
|
var Options = function Options(_ref) {
|
|
13043
13131
|
var questionProps = _ref.questionProps;
|
|
13044
13132
|
var _useTranslation = useTranslation(),
|
|
@@ -13057,88 +13145,106 @@ var Options = function Options(_ref) {
|
|
|
13057
13145
|
var nextOptions = formHelpers.destroyFromList(optionsAttributes, index);
|
|
13058
13146
|
setOptionsAttributes(nextOptions);
|
|
13059
13147
|
};
|
|
13060
|
-
return /*#__PURE__*/
|
|
13061
|
-
className: "w-full"
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
13111
13207
|
};
|
|
13112
13208
|
|
|
13113
13209
|
var RatingItem = function RatingItem(_ref) {
|
|
13114
13210
|
var children = _ref.children;
|
|
13115
|
-
return /*#__PURE__*/
|
|
13116
|
-
className: "flex w-16 flex-col items-center gap-3"
|
|
13117
|
-
|
|
13211
|
+
return /*#__PURE__*/jsx("div", {
|
|
13212
|
+
className: "flex w-16 flex-col items-center gap-3",
|
|
13213
|
+
children: children
|
|
13214
|
+
});
|
|
13118
13215
|
};
|
|
13119
13216
|
var Rating$2 = function Rating() {
|
|
13120
|
-
return /*#__PURE__*/
|
|
13121
|
-
className: "flex flex-col"
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
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
|
+
});
|
|
13142
13248
|
};
|
|
13143
13249
|
|
|
13144
13250
|
var StarRating$2 = function StarRating() {
|
|
@@ -13151,42 +13257,48 @@ var StarRating$2 = function StarRating() {
|
|
|
13151
13257
|
iconType = _useField2[0].value;
|
|
13152
13258
|
_useField2[1];
|
|
13153
13259
|
var setIconType = _useField2[2].setValue;
|
|
13154
|
-
return /*#__PURE__*/
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
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
|
+
});
|
|
13190
13302
|
};
|
|
13191
13303
|
|
|
13192
13304
|
var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
@@ -13207,15 +13319,15 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
13207
13319
|
case CHECKBOX:
|
|
13208
13320
|
case RADIO:
|
|
13209
13321
|
case DROPDOWN:
|
|
13210
|
-
return /*#__PURE__*/
|
|
13322
|
+
return /*#__PURE__*/jsx(Options, {
|
|
13211
13323
|
questionProps: questionProps
|
|
13212
13324
|
});
|
|
13213
13325
|
case RATING:
|
|
13214
|
-
return /*#__PURE__*/
|
|
13326
|
+
return /*#__PURE__*/jsx(Rating$2, {});
|
|
13215
13327
|
case STAR_RATING:
|
|
13216
|
-
return /*#__PURE__*/
|
|
13328
|
+
return /*#__PURE__*/jsx(StarRating$2, {});
|
|
13217
13329
|
case FILE_UPLOAD:
|
|
13218
|
-
return /*#__PURE__*/
|
|
13330
|
+
return /*#__PURE__*/jsx(FileUpload$1, {});
|
|
13219
13331
|
default:
|
|
13220
13332
|
return null;
|
|
13221
13333
|
}
|
|
@@ -13248,8 +13360,8 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
13248
13360
|
};
|
|
13249
13361
|
|
|
13250
13362
|
var _excluded$7 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
13251
|
-
function ownKeys$
|
|
13252
|
-
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; }
|
|
13253
13365
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
13254
13366
|
var isOpen = _ref.isOpen,
|
|
13255
13367
|
onClose = _ref.onClose,
|
|
@@ -13259,16 +13371,17 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
13259
13371
|
props = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13260
13372
|
var initialFocusRef = useRef(null);
|
|
13261
13373
|
var Component = resolveActionComponent(action);
|
|
13262
|
-
return /*#__PURE__*/
|
|
13374
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
13263
13375
|
initialFocusRef: initialFocusRef,
|
|
13264
13376
|
isOpen: isOpen,
|
|
13265
|
-
onClose: onClose
|
|
13266
|
-
}, /*#__PURE__*/React__default.createElement(Component, _objectSpread$i({
|
|
13267
|
-
availableQuestionKinds: availableQuestionKinds,
|
|
13268
|
-
initialFocusRef: initialFocusRef,
|
|
13269
13377
|
onClose: onClose,
|
|
13270
|
-
|
|
13271
|
-
|
|
13378
|
+
children: /*#__PURE__*/jsx(Component, _objectSpread$s({}, _objectSpread$s({
|
|
13379
|
+
availableQuestionKinds: availableQuestionKinds,
|
|
13380
|
+
initialFocusRef: initialFocusRef,
|
|
13381
|
+
onClose: onClose,
|
|
13382
|
+
question: question
|
|
13383
|
+
}, props)))
|
|
13384
|
+
});
|
|
13272
13385
|
};
|
|
13273
13386
|
|
|
13274
13387
|
var AddQuestion = withT(function (_ref) {
|
|
@@ -13276,23 +13389,26 @@ var AddQuestion = withT(function (_ref) {
|
|
|
13276
13389
|
onAdd = _ref.onAdd,
|
|
13277
13390
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
13278
13391
|
isDisabled = _ref.isDisabled;
|
|
13279
|
-
return /*#__PURE__*/
|
|
13392
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
13280
13393
|
disabled: !isDisabled,
|
|
13281
13394
|
position: "top",
|
|
13282
|
-
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
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
|
+
});
|
|
13291
13407
|
});
|
|
13292
13408
|
|
|
13293
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"];
|
|
13294
|
-
function ownKeys$
|
|
13295
|
-
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; }
|
|
13296
13412
|
var Form = function Form(_ref) {
|
|
13297
13413
|
var questionKinds = _ref.questionKinds,
|
|
13298
13414
|
onValueChange = _ref.onValueChange,
|
|
@@ -13386,7 +13502,7 @@ var Form = function Form(_ref) {
|
|
|
13386
13502
|
questions: questions
|
|
13387
13503
|
});
|
|
13388
13504
|
var displayOrder = selectedQuestion.displayOrder + 1;
|
|
13389
|
-
var payload = _objectSpread$
|
|
13505
|
+
var payload = _objectSpread$r({
|
|
13390
13506
|
language: selectedLanguage,
|
|
13391
13507
|
neetoFormQuestion: mergeLeft({
|
|
13392
13508
|
displayOrder: displayOrder
|
|
@@ -13434,92 +13550,102 @@ var Form = function Form(_ref) {
|
|
|
13434
13550
|
richTextFieldsToReset: pluck("fieldCode", richTextQuestions)
|
|
13435
13551
|
});
|
|
13436
13552
|
};
|
|
13437
|
-
return /*#__PURE__*/
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
13519
13645
|
};
|
|
13520
13646
|
|
|
13521
|
-
function ownKeys$
|
|
13522
|
-
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; }
|
|
13523
13649
|
var BuildForm = function BuildForm(_ref) {
|
|
13524
13650
|
var id = _ref.id,
|
|
13525
13651
|
onUpdate = _ref.onUpdate,
|
|
@@ -13597,9 +13723,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13597
13723
|
questions = _useFetchQuestions$da2.questions,
|
|
13598
13724
|
isLoading = _useFetchQuestions.isLoading;
|
|
13599
13725
|
if (isLoading || showLoader && isQuestionsLoading) {
|
|
13600
|
-
return /*#__PURE__*/
|
|
13601
|
-
className: "flex h-full w-full items-center justify-center py-6"
|
|
13602
|
-
|
|
13726
|
+
return /*#__PURE__*/jsx("div", {
|
|
13727
|
+
className: "flex h-full w-full items-center justify-center py-6",
|
|
13728
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
13729
|
+
});
|
|
13603
13730
|
}
|
|
13604
13731
|
var handleSubmit = function handleSubmit(_ref2, _ref3) {
|
|
13605
13732
|
var questions = _ref2.questions;
|
|
@@ -13635,57 +13762,62 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
13635
13762
|
var defaultQuestionKinds = allowAdditionalGuests ? QUESTION_KINDS : removeBy({
|
|
13636
13763
|
type: QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
13637
13764
|
}, QUESTION_KINDS);
|
|
13638
|
-
return /*#__PURE__*/
|
|
13639
|
-
className: classnames("neeto-form-nano-form-outer-wrapper relative", className)
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
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
|
-
|
|
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
|
+
}));
|
|
13679
13808
|
}
|
|
13680
|
-
})
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
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
|
+
});
|
|
13684
13814
|
};
|
|
13685
13815
|
|
|
13686
13816
|
var NeetoFormProvider = function NeetoFormProvider(_ref) {
|
|
13687
13817
|
var children = _ref.children;
|
|
13688
|
-
return /*#__PURE__*/
|
|
13818
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
13819
|
+
children: children
|
|
13820
|
+
});
|
|
13689
13821
|
};
|
|
13690
13822
|
|
|
13691
13823
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -14071,25 +14203,29 @@ var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
|
14071
14203
|
var Spinner = function Spinner(_ref) {
|
|
14072
14204
|
var _ref$size = _ref.size,
|
|
14073
14205
|
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
14074
|
-
return /*#__PURE__*/
|
|
14075
|
-
className: "neeto-form-engine-spinner"
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
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
|
+
});
|
|
14089
14223
|
};
|
|
14090
14224
|
var Spinner$1 = /*#__PURE__*/React__default.memo(Spinner);
|
|
14091
14225
|
|
|
14092
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; }
|
|
14093
14229
|
var Button = function Button(_ref) {
|
|
14094
14230
|
var label = _ref.label,
|
|
14095
14231
|
_ref$loading = _ref.loading,
|
|
@@ -14099,19 +14235,23 @@ var Button = function Button(_ref) {
|
|
|
14099
14235
|
_ref$className = _ref.className,
|
|
14100
14236
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
14101
14237
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14102
|
-
return /*#__PURE__*/
|
|
14238
|
+
return /*#__PURE__*/jsxs("button", _objectSpread$p(_objectSpread$p({
|
|
14103
14239
|
className: classnames("neeto-form-engine-button", className)
|
|
14104
|
-
}, otherProps),
|
|
14240
|
+
}, otherProps), {}, {
|
|
14241
|
+
children: [loading && /*#__PURE__*/jsx(ButtonLoader, {}), success && /*#__PURE__*/jsx(Success$2, {}), label]
|
|
14242
|
+
}));
|
|
14105
14243
|
};
|
|
14106
14244
|
var ButtonLoader = function ButtonLoader() {
|
|
14107
|
-
return /*#__PURE__*/
|
|
14108
|
-
className: "neeto-form-engine-button__loader"
|
|
14109
|
-
|
|
14245
|
+
return /*#__PURE__*/jsx("div", {
|
|
14246
|
+
className: "neeto-form-engine-button__loader",
|
|
14247
|
+
children: /*#__PURE__*/jsx(Spinner$1, {})
|
|
14248
|
+
});
|
|
14110
14249
|
};
|
|
14111
14250
|
var Success$2 = function Success() {
|
|
14112
|
-
return /*#__PURE__*/
|
|
14113
|
-
className: "neeto-form-engine-button__success"
|
|
14114
|
-
|
|
14251
|
+
return /*#__PURE__*/jsx("div", {
|
|
14252
|
+
className: "neeto-form-engine-button__success",
|
|
14253
|
+
children: /*#__PURE__*/jsx(Check, {})
|
|
14254
|
+
});
|
|
14115
14255
|
};
|
|
14116
14256
|
|
|
14117
14257
|
var CALLOUT_STYLES = {
|
|
@@ -14139,29 +14279,36 @@ var Callout = function Callout(_ref) {
|
|
|
14139
14279
|
primaryButton = callout.primaryButton,
|
|
14140
14280
|
secondaryButton = callout.secondaryButton;
|
|
14141
14281
|
if (!isVisible) return null;
|
|
14142
|
-
return /*#__PURE__*/
|
|
14282
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14143
14283
|
className: classnames("neeto-form-engine-callout", _defineProperty$6({
|
|
14144
14284
|
"neeto-form-engine-callout--error": style === CALLOUT_STYLES.ERROR,
|
|
14145
14285
|
"neeto-form-engine-callout--info": style === CALLOUT_STYLES.INFO,
|
|
14146
14286
|
"neeto-form-engine-callout--static": position === CALLOUT_POSITIONS.STATIC,
|
|
14147
14287
|
"neeto-form-engine-callout--absolute": position === CALLOUT_POSITIONS.ABSOLUTE
|
|
14148
|
-
}, className, className))
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
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
|
+
});
|
|
14165
14312
|
};
|
|
14166
14313
|
|
|
14167
14314
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
@@ -15859,9 +16006,9 @@ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o
|
|
|
15859
16006
|
|
|
15860
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; }
|
|
15861
16008
|
|
|
15862
|
-
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; }
|
|
15863
16010
|
|
|
15864
|
-
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; }
|
|
15865
16012
|
|
|
15866
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; }
|
|
15867
16014
|
var DEFAULT_OPTIONS = {
|
|
@@ -15888,7 +16035,7 @@ var DEFAULT_OPTIONS = {
|
|
|
15888
16035
|
function formatNumber(input, format, options, metadata) {
|
|
15889
16036
|
// Apply default options.
|
|
15890
16037
|
if (options) {
|
|
15891
|
-
options = _objectSpread$
|
|
16038
|
+
options = _objectSpread$o(_objectSpread$o({}, DEFAULT_OPTIONS), options);
|
|
15892
16039
|
} else {
|
|
15893
16040
|
options = DEFAULT_OPTIONS;
|
|
15894
16041
|
}
|
|
@@ -16033,9 +16180,9 @@ function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry,
|
|
|
16033
16180
|
}
|
|
16034
16181
|
}
|
|
16035
16182
|
|
|
16036
|
-
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; }
|
|
16037
16184
|
|
|
16038
|
-
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; }
|
|
16039
16186
|
|
|
16040
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; }
|
|
16041
16188
|
|
|
@@ -16147,7 +16294,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
16147
16294
|
}, {
|
|
16148
16295
|
key: "format",
|
|
16149
16296
|
value: function format(_format, options) {
|
|
16150
|
-
return formatNumber(this, _format, options ? _objectSpread$
|
|
16297
|
+
return formatNumber(this, _format, options ? _objectSpread$n(_objectSpread$n({}, options), {}, {
|
|
16151
16298
|
v2: true
|
|
16152
16299
|
}) : {
|
|
16153
16300
|
v2: true
|
|
@@ -17190,20 +17337,20 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
17190
17337
|
};
|
|
17191
17338
|
}
|
|
17192
17339
|
|
|
17193
|
-
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; }
|
|
17194
17341
|
|
|
17195
|
-
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; }
|
|
17196
17343
|
|
|
17197
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; }
|
|
17198
17345
|
function parsePhoneNumberWithError$2(text, options, metadata) {
|
|
17199
|
-
return parse$1(text, _objectSpread$
|
|
17346
|
+
return parse$1(text, _objectSpread$m(_objectSpread$m({}, options), {}, {
|
|
17200
17347
|
v2: true
|
|
17201
17348
|
}), metadata);
|
|
17202
17349
|
}
|
|
17203
17350
|
|
|
17204
|
-
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; }
|
|
17205
17352
|
|
|
17206
|
-
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; }
|
|
17207
17354
|
|
|
17208
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; }
|
|
17209
17356
|
|
|
@@ -17251,7 +17398,7 @@ function normalizeArguments(args) {
|
|
|
17251
17398
|
}
|
|
17252
17399
|
|
|
17253
17400
|
if (arg_2) {
|
|
17254
|
-
options = _objectSpread$
|
|
17401
|
+
options = _objectSpread$l({
|
|
17255
17402
|
defaultCountry: arg_2
|
|
17256
17403
|
}, options);
|
|
17257
17404
|
}
|
|
@@ -17312,8 +17459,8 @@ var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
|
17312
17459
|
|
|
17313
17460
|
var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
17314
17461
|
var _fieldKindValidatorMa;
|
|
17315
|
-
function ownKeys$
|
|
17316
|
-
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; }
|
|
17317
17464
|
yup.addMethod(yup.array, "unique", function () {
|
|
17318
17465
|
var field, message;
|
|
17319
17466
|
if (arguments.length > 1) {
|
|
@@ -17462,7 +17609,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17462
17609
|
return function (value) {
|
|
17463
17610
|
if (!(kind in fieldKindValidatorMap)) return;
|
|
17464
17611
|
var validator = fieldKindValidatorMap[kind];
|
|
17465
|
-
var schema = customValidator || validator(_objectSpread$
|
|
17612
|
+
var schema = customValidator || validator(_objectSpread$k({
|
|
17466
17613
|
kind: kind,
|
|
17467
17614
|
label: label,
|
|
17468
17615
|
isRequired: isRequired
|
|
@@ -17499,7 +17646,7 @@ var validateFieldValue = function validateFieldValue(_ref14) {
|
|
|
17499
17646
|
};
|
|
17500
17647
|
|
|
17501
17648
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
17502
|
-
var
|
|
17649
|
+
var _jsx2;
|
|
17503
17650
|
var question = _ref.question,
|
|
17504
17651
|
customValidator = _ref.customValidator;
|
|
17505
17652
|
var name = question.id,
|
|
@@ -17528,31 +17675,33 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
17528
17675
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
17529
17676
|
isInputVisible = _useState2[0],
|
|
17530
17677
|
setIsInputVisible = _useState2[1];
|
|
17531
|
-
return /*#__PURE__*/
|
|
17532
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
|
|
17539
|
-
|
|
17540
|
-
|
|
17541
|
-
|
|
17542
|
-
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
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
|
+
});
|
|
17552
17701
|
};
|
|
17553
17702
|
|
|
17554
|
-
function ownKeys$
|
|
17555
|
-
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; }
|
|
17556
17705
|
var ConditionField = function ConditionField(_ref) {
|
|
17557
17706
|
var question = _ref.question,
|
|
17558
17707
|
customValidator = _ref.customValidator;
|
|
@@ -17561,30 +17710,31 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17561
17710
|
isRequired = question.isRequired,
|
|
17562
17711
|
nodeId = question.nodeId;
|
|
17563
17712
|
var label = fieldWithFallback(question, "label");
|
|
17564
|
-
return /*#__PURE__*/
|
|
17713
|
+
return /*#__PURE__*/jsx(Field, {
|
|
17565
17714
|
name: name || nodeId,
|
|
17566
17715
|
validate: validateFieldValue({
|
|
17567
17716
|
kind: kind,
|
|
17568
17717
|
label: label,
|
|
17569
17718
|
isRequired: isRequired,
|
|
17570
17719
|
customValidator: customValidator
|
|
17571
|
-
})
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17576
|
-
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
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
|
+
}
|
|
17583
17733
|
});
|
|
17584
17734
|
};
|
|
17585
17735
|
|
|
17586
|
-
function ownKeys$
|
|
17587
|
-
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; }
|
|
17588
17738
|
var toEmailValues = function toEmailValues() {
|
|
17589
17739
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17590
17740
|
return values.map(function (value) {
|
|
@@ -17677,7 +17827,7 @@ var generateInitValues = function generateInitValues(_ref7) {
|
|
|
17677
17827
|
var valuesMap = {};
|
|
17678
17828
|
if (initialValues) {
|
|
17679
17829
|
valuesMap = initialValues.reduce(function (acc, answer) {
|
|
17680
|
-
return _objectSpread$
|
|
17830
|
+
return _objectSpread$i(_objectSpread$i({}, acc), {}, _defineProperty$6({}, answer.questionId, {
|
|
17681
17831
|
value: answer.value,
|
|
17682
17832
|
optionIds: answer.optionIds
|
|
17683
17833
|
}));
|
|
@@ -17909,8 +18059,8 @@ var getSelectedRating = function getSelectedRating(value) {
|
|
|
17909
18059
|
};
|
|
17910
18060
|
|
|
17911
18061
|
var _excluded$3 = ["value"];
|
|
17912
|
-
function ownKeys$
|
|
17913
|
-
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; }
|
|
17914
18064
|
dayjs.extend(weekOfYear);
|
|
17915
18065
|
dayjs.extend(weekday);
|
|
17916
18066
|
dayjs.extend(localeData);
|
|
@@ -17925,47 +18075,52 @@ var DateField = function DateField(_ref) {
|
|
|
17925
18075
|
var label = fieldWithFallback(question, "label");
|
|
17926
18076
|
var _QUESTION_KIND$kind$t = QUESTION_KIND[kind.toUpperCase()].type,
|
|
17927
18077
|
type = _QUESTION_KIND$kind$t === void 0 ? "date" : _QUESTION_KIND$kind$t;
|
|
17928
|
-
return /*#__PURE__*/
|
|
17929
|
-
className: "neeto-form-engine-input__wrapper"
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
17938
|
-
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
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
|
+
});
|
|
17965
18120
|
};
|
|
17966
18121
|
|
|
17967
|
-
function ownKeys$
|
|
17968
|
-
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; }
|
|
17969
18124
|
var EmailField = function EmailField(_ref) {
|
|
17970
18125
|
var question = _ref.question,
|
|
17971
18126
|
customValidator = _ref.customValidator,
|
|
@@ -17994,12 +18149,12 @@ var EmailField = function EmailField(_ref) {
|
|
|
17994
18149
|
setValue = _useField2$2.setValue,
|
|
17995
18150
|
setTouched = _useField2$2.setTouched;
|
|
17996
18151
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
17997
|
-
return /*#__PURE__*/
|
|
18152
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$g(_objectSpread$g({}, _objectSpread$g(_objectSpread$g({
|
|
17998
18153
|
type: type
|
|
17999
18154
|
}, field), {}, {
|
|
18000
18155
|
autoComplete: autoComplete,
|
|
18001
18156
|
label: label
|
|
18002
|
-
}), {
|
|
18157
|
+
})), {}, {
|
|
18003
18158
|
error: touched ? error : "",
|
|
18004
18159
|
name: kind,
|
|
18005
18160
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -19501,9 +19656,9 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
19501
19656
|
|
|
19502
19657
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19503
19658
|
|
|
19504
|
-
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; }
|
|
19505
19660
|
|
|
19506
|
-
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; }
|
|
19507
19662
|
|
|
19508
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; }
|
|
19509
19664
|
|
|
@@ -19539,7 +19694,7 @@ var Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
19539
19694
|
};
|
|
19540
19695
|
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
19541
19696
|
|
|
19542
|
-
return /*#__PURE__*/React__default.createElement(Fragment, null, children(_objectSpread$
|
|
19697
|
+
return /*#__PURE__*/React__default.createElement(Fragment$1, null, children(_objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
19543
19698
|
open: open
|
|
19544
19699
|
})));
|
|
19545
19700
|
});
|
|
@@ -19873,7 +20028,7 @@ var initialState = {
|
|
|
19873
20028
|
function useDropzone() {
|
|
19874
20029
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19875
20030
|
|
|
19876
|
-
var _defaultProps$options = _objectSpread$
|
|
20031
|
+
var _defaultProps$options = _objectSpread$f(_objectSpread$f({}, defaultProps), options),
|
|
19877
20032
|
accept = _defaultProps$options.accept,
|
|
19878
20033
|
disabled = _defaultProps$options.disabled,
|
|
19879
20034
|
getFilesFromEvent = _defaultProps$options.getFilesFromEvent,
|
|
@@ -20190,7 +20345,7 @@ function useDropzone() {
|
|
|
20190
20345
|
onDrop = _ref2.onDrop,
|
|
20191
20346
|
rest = _objectWithoutProperties(_ref2, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
|
|
20192
20347
|
|
|
20193
|
-
return _objectSpread$
|
|
20348
|
+
return _objectSpread$f(_objectSpread$f(_defineProperty({
|
|
20194
20349
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
20195
20350
|
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
20196
20351
|
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
@@ -20229,7 +20384,7 @@ function useDropzone() {
|
|
|
20229
20384
|
tabIndex: -1
|
|
20230
20385
|
}, refKey, inputRef);
|
|
20231
20386
|
|
|
20232
|
-
return _objectSpread$
|
|
20387
|
+
return _objectSpread$f(_objectSpread$f({}, inputProps), rest);
|
|
20233
20388
|
};
|
|
20234
20389
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
20235
20390
|
var fileCount = draggedFiles.length;
|
|
@@ -20242,7 +20397,7 @@ function useDropzone() {
|
|
|
20242
20397
|
maxFiles: maxFiles
|
|
20243
20398
|
});
|
|
20244
20399
|
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
20245
|
-
return _objectSpread$
|
|
20400
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20246
20401
|
isDragAccept: isDragAccept,
|
|
20247
20402
|
isDragReject: isDragReject,
|
|
20248
20403
|
isFocused: isFocused && !disabled,
|
|
@@ -20258,22 +20413,22 @@ function reducer(state, action) {
|
|
|
20258
20413
|
/* istanbul ignore next */
|
|
20259
20414
|
switch (action.type) {
|
|
20260
20415
|
case 'focus':
|
|
20261
|
-
return _objectSpread$
|
|
20416
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20262
20417
|
isFocused: true
|
|
20263
20418
|
});
|
|
20264
20419
|
|
|
20265
20420
|
case 'blur':
|
|
20266
|
-
return _objectSpread$
|
|
20421
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20267
20422
|
isFocused: false
|
|
20268
20423
|
});
|
|
20269
20424
|
|
|
20270
20425
|
case 'openDialog':
|
|
20271
|
-
return _objectSpread$
|
|
20426
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20272
20427
|
isFileDialogActive: true
|
|
20273
20428
|
});
|
|
20274
20429
|
|
|
20275
20430
|
case 'closeDialog':
|
|
20276
|
-
return _objectSpread$
|
|
20431
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20277
20432
|
isFileDialogActive: false
|
|
20278
20433
|
});
|
|
20279
20434
|
|
|
@@ -20281,19 +20436,19 @@ function reducer(state, action) {
|
|
|
20281
20436
|
/* eslint no-case-declarations: 0 */
|
|
20282
20437
|
var isDragActive = action.isDragActive,
|
|
20283
20438
|
draggedFiles = action.draggedFiles;
|
|
20284
|
-
return _objectSpread$
|
|
20439
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20285
20440
|
draggedFiles: draggedFiles,
|
|
20286
20441
|
isDragActive: isDragActive
|
|
20287
20442
|
});
|
|
20288
20443
|
|
|
20289
20444
|
case 'setFiles':
|
|
20290
|
-
return _objectSpread$
|
|
20445
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20291
20446
|
acceptedFiles: action.acceptedFiles,
|
|
20292
20447
|
fileRejections: action.fileRejections
|
|
20293
20448
|
});
|
|
20294
20449
|
|
|
20295
20450
|
case 'reset':
|
|
20296
|
-
return _objectSpread$
|
|
20451
|
+
return _objectSpread$f(_objectSpread$f({}, state), {}, {
|
|
20297
20452
|
isFileDialogActive: false,
|
|
20298
20453
|
isDragActive: false,
|
|
20299
20454
|
draggedFiles: [],
|
|
@@ -20306,8 +20461,8 @@ function reducer(state, action) {
|
|
|
20306
20461
|
}
|
|
20307
20462
|
}
|
|
20308
20463
|
|
|
20309
|
-
function ownKeys$
|
|
20310
|
-
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; }
|
|
20311
20466
|
var useFileUpload = function useFileUpload(_ref) {
|
|
20312
20467
|
var disabled = _ref.disabled,
|
|
20313
20468
|
accept = _ref.accept,
|
|
@@ -20407,7 +20562,7 @@ var useFileUpload = function useFileUpload(_ref) {
|
|
|
20407
20562
|
var uploadedFile = findBy({
|
|
20408
20563
|
name: file.name
|
|
20409
20564
|
}, newFiles);
|
|
20410
|
-
return _objectSpread$
|
|
20565
|
+
return _objectSpread$e(_objectSpread$e({}, file), uploadedFile);
|
|
20411
20566
|
})
|
|
20412
20567
|
});
|
|
20413
20568
|
} else {
|
|
@@ -20466,6 +20621,8 @@ const SvgFileUpload = props => /*#__PURE__*/React$2.createElement("svg", _extend
|
|
|
20466
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"
|
|
20467
20622
|
})));
|
|
20468
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; }
|
|
20469
20626
|
var DropZone = function DropZone(_ref) {
|
|
20470
20627
|
var isDragActive = _ref.isDragActive,
|
|
20471
20628
|
getRootProps = _ref.getRootProps,
|
|
@@ -20478,54 +20635,63 @@ var DropZone = function DropZone(_ref) {
|
|
|
20478
20635
|
var _useTranslation = useTranslation(),
|
|
20479
20636
|
t = _useTranslation.t;
|
|
20480
20637
|
var shouldShowFileSizeLimit = hasFileSizeLimit && maxFileSize;
|
|
20481
|
-
return /*#__PURE__*/
|
|
20638
|
+
return /*#__PURE__*/jsx("div", _objectSpread$d(_objectSpread$d({}, getRootProps({
|
|
20482
20639
|
className: classnames(["neeto-form-engine-file-upload__dropzone"], {
|
|
20483
20640
|
"neeto-form-engine-file-upload__dropzone--drag-active": isDragActive
|
|
20484
20641
|
})
|
|
20485
|
-
}),
|
|
20486
|
-
|
|
20487
|
-
|
|
20488
|
-
|
|
20489
|
-
|
|
20490
|
-
|
|
20491
|
-
|
|
20492
|
-
|
|
20493
|
-
|
|
20494
|
-
|
|
20495
|
-
|
|
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
|
-
|
|
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
|
+
}));
|
|
20529
20695
|
};
|
|
20530
20696
|
|
|
20531
20697
|
var createDefinition = function (propNames) { return ({
|
|
@@ -27835,51 +28001,55 @@ var Progress = function Progress(_ref) {
|
|
|
27835
28001
|
transition: transition
|
|
27836
28002
|
}
|
|
27837
28003
|
};
|
|
27838
|
-
return /*#__PURE__*/
|
|
27839
|
-
className: "neeto-form-engine-progress__circle"
|
|
27840
|
-
|
|
27841
|
-
|
|
27842
|
-
|
|
27843
|
-
|
|
27844
|
-
|
|
27845
|
-
|
|
27846
|
-
|
|
27847
|
-
|
|
27848
|
-
|
|
27849
|
-
|
|
27850
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
27883
28053
|
};
|
|
27884
28054
|
|
|
27885
28055
|
var FILE_MIME_TYPES = {
|
|
@@ -27931,48 +28101,56 @@ var FilePreview = withT(function (_ref) {
|
|
|
27931
28101
|
isUploading = _ref.isUploading,
|
|
27932
28102
|
cancel = _ref.cancel,
|
|
27933
28103
|
progress = _ref.progress;
|
|
27934
|
-
return /*#__PURE__*/
|
|
28104
|
+
return /*#__PURE__*/jsxs("li", {
|
|
27935
28105
|
className: "neeto-form-engine-file-upload__uploaded-list-item",
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27940
|
-
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
27946
|
-
|
|
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
|
-
|
|
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);
|
|
27976
28154
|
});
|
|
27977
28155
|
|
|
27978
28156
|
var FileUploadField = function FileUploadField(_ref) {
|
|
@@ -28022,42 +28200,47 @@ var FileUploadField = function FileUploadField(_ref) {
|
|
|
28022
28200
|
var isUploadingFile = function isUploadingFile(file) {
|
|
28023
28201
|
return isNotNil(progress[file.name]) && (progress[file.name] !== 100 || !file.url);
|
|
28024
28202
|
};
|
|
28025
|
-
return /*#__PURE__*/
|
|
28026
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
28050
|
-
|
|
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, {
|
|
28051
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",
|
|
28052
|
-
|
|
28053
|
-
}
|
|
28054
|
-
})
|
|
28055
|
-
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"
|
|
28056
|
-
}, error));
|
|
28237
|
+
children: error
|
|
28238
|
+
})]
|
|
28239
|
+
});
|
|
28057
28240
|
};
|
|
28058
28241
|
|
|
28059
|
-
function ownKeys$
|
|
28060
|
-
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; }
|
|
28061
28244
|
var NameField = function NameField(_ref) {
|
|
28062
28245
|
var question = _ref.question,
|
|
28063
28246
|
customValidator = _ref.customValidator,
|
|
@@ -28087,12 +28270,12 @@ var NameField = function NameField(_ref) {
|
|
|
28087
28270
|
setValue = _useField2$2.setValue,
|
|
28088
28271
|
setTouched = _useField2$2.setTouched;
|
|
28089
28272
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
28090
|
-
return /*#__PURE__*/
|
|
28273
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
28091
28274
|
type: type
|
|
28092
28275
|
}, field), {}, {
|
|
28093
28276
|
autoComplete: autoComplete,
|
|
28094
28277
|
label: label
|
|
28095
|
-
}), {
|
|
28278
|
+
})), {}, {
|
|
28096
28279
|
error: touched ? error : "",
|
|
28097
28280
|
name: kind,
|
|
28098
28281
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28115,39 +28298,43 @@ var Choices = function Choices(_ref) {
|
|
|
28115
28298
|
var isCheckBox = type === "checkbox";
|
|
28116
28299
|
var ChoiceWrapper = isCheckBox ? "div" : Radio;
|
|
28117
28300
|
var Component = isCheckBox ? Checkbox : Radio.Item;
|
|
28118
|
-
return /*#__PURE__*/
|
|
28119
|
-
className: "neeto-form-engine-choices__wrapper"
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28125
|
-
|
|
28126
|
-
|
|
28127
|
-
|
|
28128
|
-
|
|
28129
|
-
|
|
28130
|
-
|
|
28131
|
-
|
|
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);
|
|
28132
28326
|
})
|
|
28133
|
-
}, /*#__PURE__*/
|
|
28134
|
-
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
value: option.id,
|
|
28140
|
-
checked: isCheckBox ? (_value$index = value === null || value === void 0 ? void 0 : value[index]) !== null && _value$index !== void 0 ? _value$index : false : value === option.id
|
|
28141
|
-
}));
|
|
28142
|
-
})), !!error && typeof error === "string" && /*#__PURE__*/React__default.createElement("p", {
|
|
28143
|
-
className: "neeto-form-engine-input__error",
|
|
28144
|
-
"data-cy": "neeto-form-engine-".concat(type, "-error")
|
|
28145
|
-
}, 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
|
+
});
|
|
28146
28333
|
};
|
|
28147
28334
|
var Choices$1 = /*#__PURE__*/React__default.memo(Choices);
|
|
28148
28335
|
|
|
28149
|
-
function ownKeys$
|
|
28150
|
-
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; }
|
|
28151
28338
|
var OptionsField = function OptionsField(_ref) {
|
|
28152
28339
|
var question = _ref.question,
|
|
28153
28340
|
customValidator = _ref.customValidator;
|
|
@@ -28170,7 +28357,7 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28170
28357
|
value: option.id
|
|
28171
28358
|
};
|
|
28172
28359
|
}) : options.map(function (option) {
|
|
28173
|
-
return _objectSpread$
|
|
28360
|
+
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
28174
28361
|
label: fieldWithFallback(option, "label")
|
|
28175
28362
|
});
|
|
28176
28363
|
});
|
|
@@ -28181,31 +28368,32 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
28181
28368
|
return validateField(name);
|
|
28182
28369
|
});
|
|
28183
28370
|
};
|
|
28184
|
-
return /*#__PURE__*/
|
|
28371
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28185
28372
|
name: name,
|
|
28186
28373
|
validate: validateFieldValue({
|
|
28187
28374
|
kind: kind,
|
|
28188
28375
|
label: label,
|
|
28189
28376
|
isRequired: isRequired,
|
|
28190
28377
|
customValidator: customValidator
|
|
28191
|
-
})
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
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
|
+
}
|
|
28209
28397
|
});
|
|
28210
28398
|
};
|
|
28211
28399
|
|
|
@@ -28234,7 +28422,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28234
28422
|
_useField2$2 = _useField2[2],
|
|
28235
28423
|
setValue = _useField2$2.setValue,
|
|
28236
28424
|
setTouched = _useField2$2.setTouched;
|
|
28237
|
-
return /*#__PURE__*/
|
|
28425
|
+
return /*#__PURE__*/jsx(PhoneNumberInput, {
|
|
28238
28426
|
autoComplete: autoComplete,
|
|
28239
28427
|
label: label,
|
|
28240
28428
|
value: value,
|
|
@@ -28251,6 +28439,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
28251
28439
|
};
|
|
28252
28440
|
|
|
28253
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; }
|
|
28254
28444
|
var Rating = function Rating(_ref) {
|
|
28255
28445
|
var name = _ref.name,
|
|
28256
28446
|
label = _ref.label,
|
|
@@ -28269,38 +28459,46 @@ var Rating = function Rating(_ref) {
|
|
|
28269
28459
|
var Icon = _ref2.icon,
|
|
28270
28460
|
modifier = _ref2.modifier,
|
|
28271
28461
|
rating = _ref2.value;
|
|
28272
|
-
return /*#__PURE__*/
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
|
|
28276
|
-
|
|
28277
|
-
|
|
28278
|
-
|
|
28279
|
-
|
|
28280
|
-
|
|
28281
|
-
|
|
28282
|
-
|
|
28283
|
-
|
|
28284
|
-
|
|
28285
|
-
|
|
28286
|
-
|
|
28287
|
-
|
|
28288
|
-
|
|
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);
|
|
28289
28481
|
});
|
|
28290
28482
|
};
|
|
28291
|
-
return /*#__PURE__*/
|
|
28292
|
-
className: "neeto-form-engine-rating"
|
|
28293
|
-
|
|
28294
|
-
|
|
28295
|
-
|
|
28296
|
-
|
|
28297
|
-
|
|
28298
|
-
|
|
28299
|
-
"
|
|
28300
|
-
|
|
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
|
+
});
|
|
28301
28497
|
};
|
|
28302
28498
|
var Rating$1 = /*#__PURE__*/React__default.memo(Rating);
|
|
28303
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; }
|
|
28304
28502
|
var RatingField = function RatingField(_ref) {
|
|
28305
28503
|
var question = _ref.question,
|
|
28306
28504
|
customValidator = _ref.customValidator;
|
|
@@ -28308,27 +28506,30 @@ var RatingField = function RatingField(_ref) {
|
|
|
28308
28506
|
kind = question.kind,
|
|
28309
28507
|
isRequired = question.isRequired;
|
|
28310
28508
|
var label = fieldWithFallback(question, "label");
|
|
28311
|
-
return /*#__PURE__*/
|
|
28509
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28312
28510
|
name: name,
|
|
28313
28511
|
validate: validateFieldValue({
|
|
28314
28512
|
kind: kind,
|
|
28315
28513
|
label: label,
|
|
28316
28514
|
isRequired: isRequired,
|
|
28317
28515
|
customValidator: customValidator
|
|
28318
|
-
})
|
|
28319
|
-
|
|
28320
|
-
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
28324
|
-
|
|
28325
|
-
|
|
28326
|
-
|
|
28327
|
-
|
|
28328
|
-
|
|
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
|
+
}
|
|
28329
28528
|
});
|
|
28330
28529
|
};
|
|
28331
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; }
|
|
28332
28533
|
var RichTextEditor = function RichTextEditor(_ref) {
|
|
28333
28534
|
var editorRef = _ref.editorRef,
|
|
28334
28535
|
question = _ref.question,
|
|
@@ -28344,45 +28545,50 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
28344
28545
|
var label = fieldWithFallback(question, "label");
|
|
28345
28546
|
var debouncedPlaceholder = useDebounce(fieldWithFallback(question, "placeholder"), 300);
|
|
28346
28547
|
var propsToCompare = preview ? ["debouncedPlaceholder", "error"] : ["debouncedPlaceholder"];
|
|
28347
|
-
return /*#__PURE__*/
|
|
28348
|
-
className: "neeto-form-engine-input__wrapper"
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
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);
|
|
28380
28584
|
}
|
|
28381
|
-
}
|
|
28382
|
-
})
|
|
28585
|
+
})]
|
|
28586
|
+
});
|
|
28383
28587
|
};
|
|
28384
28588
|
|
|
28385
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; }
|
|
28386
28592
|
var RatingButton = function RatingButton(_ref) {
|
|
28387
28593
|
var _ref$value = _ref.value,
|
|
28388
28594
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
@@ -28395,56 +28601,68 @@ var RatingButton = function RatingButton(_ref) {
|
|
|
28395
28601
|
};
|
|
28396
28602
|
var Icon = ICONS_MAP[iconType];
|
|
28397
28603
|
var selectedRating = getSelectedRating(value);
|
|
28398
|
-
return /*#__PURE__*/
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28409
|
-
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
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
|
+
});
|
|
28417
28627
|
};
|
|
28418
28628
|
var RatingButton$1 = /*#__PURE__*/React__default.memo(RatingButton);
|
|
28419
28629
|
|
|
28420
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; }
|
|
28421
28633
|
var StarRating = function StarRating(_ref) {
|
|
28422
28634
|
var label = _ref.label,
|
|
28423
28635
|
minValue = _ref.minValue,
|
|
28424
28636
|
maxValue = _ref.maxValue,
|
|
28425
28637
|
error = _ref.error,
|
|
28426
28638
|
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
28427
|
-
return /*#__PURE__*/
|
|
28428
|
-
className: "neeto-form-engine-input__wrapper neeto-form-engine-star-rating"
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28435
|
-
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28443
|
-
"
|
|
28444
|
-
|
|
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
|
+
});
|
|
28445
28661
|
};
|
|
28446
28662
|
var StarRating$1 = /*#__PURE__*/React__default.memo(StarRating);
|
|
28447
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; }
|
|
28448
28666
|
var StarRatingField = function StarRatingField(_ref) {
|
|
28449
28667
|
var question = _ref.question,
|
|
28450
28668
|
customValidator = _ref.customValidator;
|
|
@@ -28455,30 +28673,31 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
28455
28673
|
maxValue = question.maxValue,
|
|
28456
28674
|
iconType = question.iconType;
|
|
28457
28675
|
var label = fieldWithFallback(question, "label");
|
|
28458
|
-
return /*#__PURE__*/
|
|
28676
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28459
28677
|
name: name,
|
|
28460
28678
|
validate: validateFieldValue({
|
|
28461
28679
|
kind: kind,
|
|
28462
28680
|
label: label,
|
|
28463
28681
|
isRequired: isRequired,
|
|
28464
28682
|
customValidator: customValidator
|
|
28465
|
-
})
|
|
28466
|
-
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
|
|
28471
|
-
|
|
28472
|
-
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
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
|
+
}
|
|
28477
28696
|
});
|
|
28478
28697
|
};
|
|
28479
28698
|
|
|
28480
|
-
function ownKeys$
|
|
28481
|
-
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; }
|
|
28482
28701
|
var TermsField = function TermsField(_ref) {
|
|
28483
28702
|
var question = _ref.question,
|
|
28484
28703
|
customValidator = _ref.customValidator;
|
|
@@ -28487,32 +28706,35 @@ var TermsField = function TermsField(_ref) {
|
|
|
28487
28706
|
isRequired = question.isRequired,
|
|
28488
28707
|
nodeId = question.nodeId;
|
|
28489
28708
|
var label = fieldWithFallback(question, "label", true);
|
|
28490
|
-
return /*#__PURE__*/
|
|
28709
|
+
return /*#__PURE__*/jsx(Field, {
|
|
28491
28710
|
name: name || nodeId,
|
|
28492
28711
|
validate: validateFieldValue({
|
|
28493
28712
|
kind: kind,
|
|
28494
28713
|
label: label,
|
|
28495
28714
|
isRequired: isRequired,
|
|
28496
28715
|
customValidator: customValidator
|
|
28497
|
-
})
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
|
|
28504
|
-
|
|
28505
|
-
|
|
28506
|
-
|
|
28507
|
-
|
|
28508
|
-
|
|
28509
|
-
|
|
28510
|
-
|
|
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
|
+
}
|
|
28511
28733
|
});
|
|
28512
28734
|
};
|
|
28513
28735
|
|
|
28514
|
-
function ownKeys$
|
|
28515
|
-
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; }
|
|
28516
28738
|
var TextField = function TextField(_ref) {
|
|
28517
28739
|
var _otherProps$onChange;
|
|
28518
28740
|
var question = _ref.question,
|
|
@@ -28547,13 +28769,13 @@ var TextField = function TextField(_ref) {
|
|
|
28547
28769
|
setValue = _useField2$2.setValue,
|
|
28548
28770
|
setTouched = _useField2$2.setTouched;
|
|
28549
28771
|
var handleFieldChange = withEventTargetValue(setValue);
|
|
28550
|
-
return /*#__PURE__*/
|
|
28772
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({
|
|
28551
28773
|
type: type
|
|
28552
28774
|
}, field), {}, {
|
|
28553
28775
|
autoComplete: autoComplete,
|
|
28554
28776
|
label: label,
|
|
28555
28777
|
onKeyDown: onKeyDown
|
|
28556
|
-
}), {
|
|
28778
|
+
})), {}, {
|
|
28557
28779
|
error: touched ? error : "",
|
|
28558
28780
|
name: slugify(label),
|
|
28559
28781
|
placeholder: fieldWithFallback(question, "placeholder"),
|
|
@@ -28568,18 +28790,11 @@ var TextField = function TextField(_ref) {
|
|
|
28568
28790
|
var _QUESTION_TO_COMPONEN;
|
|
28569
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) {
|
|
28570
28792
|
var question = _ref.question;
|
|
28571
|
-
return /*#__PURE__*/
|
|
28793
|
+
return /*#__PURE__*/jsx(EditorContent, {
|
|
28572
28794
|
content: fieldWithFallback(question, "label", true)
|
|
28573
28795
|
});
|
|
28574
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);
|
|
28575
28797
|
|
|
28576
|
-
var fieldWithFallback = function fieldWithFallback(question, fieldName) {
|
|
28577
|
-
var hasRichContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
28578
|
-
var fallback = question["".concat(fieldName, "Fallback")];
|
|
28579
|
-
var field = question[fieldName];
|
|
28580
|
-
var isFieldEmpty = hasRichContent ? isEditorEmpty(field) : isEmpty(field);
|
|
28581
|
-
return isFieldEmpty && isNotNil(fallback) ? fallback : field;
|
|
28582
|
-
};
|
|
28583
28798
|
var getFieldComponent = function getFieldComponent(_ref) {
|
|
28584
28799
|
var kind = _ref.kind;
|
|
28585
28800
|
if (kind in QUESTION_TO_COMPONENT_MAP) return QUESTION_TO_COMPONENT_MAP[kind];
|
|
@@ -28633,21 +28848,24 @@ const SvgSuccess = props => /*#__PURE__*/React$2.createElement("svg", _extends({
|
|
|
28633
28848
|
var Success = function Success() {
|
|
28634
28849
|
var _useTranslation = useTranslation(),
|
|
28635
28850
|
t = _useTranslation.t;
|
|
28636
|
-
return /*#__PURE__*/
|
|
28637
|
-
className: "flex h-full w-full flex-col items-center justify-center space-y-4"
|
|
28638
|
-
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28642
|
-
|
|
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
|
+
});
|
|
28643
28861
|
};
|
|
28644
28862
|
var Success$1 = /*#__PURE__*/React__default.memo(Success);
|
|
28645
28863
|
|
|
28646
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; } } }; }
|
|
28647
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); }
|
|
28648
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; }
|
|
28649
|
-
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; }
|
|
28650
|
-
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; }
|
|
28651
28869
|
var ExternalForm = function ExternalForm(_ref) {
|
|
28652
28870
|
var _formikInnerRef$curre;
|
|
28653
28871
|
var _ref$preview = _ref.preview,
|
|
@@ -28816,7 +29034,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28816
29034
|
_context.next = 29;
|
|
28817
29035
|
return createSubmission({
|
|
28818
29036
|
formId: formId,
|
|
28819
|
-
values: _objectSpread({
|
|
29037
|
+
values: _objectSpread$2({
|
|
28820
29038
|
neetoFormResponse: {
|
|
28821
29039
|
responses: responses
|
|
28822
29040
|
}
|
|
@@ -28919,9 +29137,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28919
29137
|
mode: "scoped"
|
|
28920
29138
|
});
|
|
28921
29139
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|
|
28922
|
-
return /*#__PURE__*/
|
|
28923
|
-
className: "loader flex h-full w-full items-center justify-center"
|
|
28924
|
-
|
|
29140
|
+
return /*#__PURE__*/jsx("div", {
|
|
29141
|
+
className: "loader flex h-full w-full items-center justify-center",
|
|
29142
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
29143
|
+
});
|
|
28925
29144
|
}
|
|
28926
29145
|
var title = form.title,
|
|
28927
29146
|
_form$questions = form.questions,
|
|
@@ -28931,96 +29150,107 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28931
29150
|
return !_destroy;
|
|
28932
29151
|
}) : questions;
|
|
28933
29152
|
if (displayThankYou && showSuccess) {
|
|
28934
|
-
return /*#__PURE__*/
|
|
28935
|
-
}
|
|
28936
|
-
return /*#__PURE__*/
|
|
28937
|
-
|
|
28938
|
-
|
|
28939
|
-
|
|
28940
|
-
|
|
28941
|
-
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
|
|
28946
|
-
|
|
28947
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
29021
29251
|
}
|
|
29022
|
-
})
|
|
29023
|
-
})
|
|
29252
|
+
})]
|
|
29253
|
+
});
|
|
29024
29254
|
};
|
|
29025
29255
|
|
|
29026
29256
|
var dist = {};
|
|
@@ -31548,13 +31778,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31548
31778
|
var _default = dist.default = _Linkify2.default;
|
|
31549
31779
|
|
|
31550
31780
|
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
31551
|
-
return /*#__PURE__*/
|
|
31781
|
+
return /*#__PURE__*/jsx("a", {
|
|
31552
31782
|
className: "neeto-ui-text-primary-500 hover:underline",
|
|
31553
31783
|
href: decoratedHref,
|
|
31554
|
-
key: key,
|
|
31555
31784
|
rel: "noreferrer",
|
|
31556
|
-
target: "_blank"
|
|
31557
|
-
|
|
31785
|
+
target: "_blank",
|
|
31786
|
+
children: decoratedText
|
|
31787
|
+
}, key);
|
|
31558
31788
|
};
|
|
31559
31789
|
var filterResponses = removeBy({
|
|
31560
31790
|
kind: QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
@@ -31563,27 +31793,33 @@ var filterResponses = removeBy({
|
|
|
31563
31793
|
|
|
31564
31794
|
var FileUpload = function FileUpload(_ref) {
|
|
31565
31795
|
var files = _ref.files;
|
|
31566
|
-
return /*#__PURE__*/
|
|
31567
|
-
className: "space-y-2"
|
|
31568
|
-
|
|
31569
|
-
|
|
31570
|
-
|
|
31571
|
-
|
|
31572
|
-
|
|
31573
|
-
|
|
31574
|
-
|
|
31575
|
-
|
|
31576
|
-
|
|
31577
|
-
|
|
31578
|
-
|
|
31579
|
-
|
|
31580
|
-
|
|
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
|
+
});
|
|
31581
31813
|
};
|
|
31582
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; }
|
|
31583
31817
|
var getValue = function getValue(_ref) {
|
|
31584
31818
|
var value = _ref.value,
|
|
31585
31819
|
kind = _ref.kind;
|
|
31586
|
-
if (isEmpty(value)) return /*#__PURE__*/
|
|
31820
|
+
if (isEmpty(value)) return /*#__PURE__*/jsx("i", {
|
|
31821
|
+
children: t$4("neetoForm.common.unanswered")
|
|
31822
|
+
});
|
|
31587
31823
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31588
31824
|
return value && dateFormat.date(value);
|
|
31589
31825
|
}
|
|
@@ -31627,51 +31863,58 @@ var Submission = function Submission(_ref2) {
|
|
|
31627
31863
|
var renderSubmittedValue = function renderSubmittedValue(kind, value) {
|
|
31628
31864
|
switch (kind) {
|
|
31629
31865
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
31630
|
-
return /*#__PURE__*/
|
|
31866
|
+
return /*#__PURE__*/jsx(EditorContent, {
|
|
31631
31867
|
content: getEditorContent(getValue({
|
|
31632
31868
|
value: value,
|
|
31633
31869
|
kind: kind
|
|
31634
31870
|
}))
|
|
31635
31871
|
});
|
|
31636
31872
|
case QUESTION_KIND.PHONE.value:
|
|
31637
|
-
return isPresent$1(value) ? /*#__PURE__*/
|
|
31873
|
+
return isPresent$1(value) ? /*#__PURE__*/jsx(PhoneNumber$1, {
|
|
31638
31874
|
value: value,
|
|
31639
31875
|
showEmoji: true
|
|
31640
31876
|
}) : "-";
|
|
31641
31877
|
case QUESTION_KIND.FILE_UPLOAD.value:
|
|
31642
|
-
return isPresent$1(value) ? /*#__PURE__*/
|
|
31878
|
+
return isPresent$1(value) ? /*#__PURE__*/jsx(FileUpload, {
|
|
31643
31879
|
files: value
|
|
31644
31880
|
}) : "-";
|
|
31645
31881
|
default:
|
|
31646
|
-
return /*#__PURE__*/
|
|
31882
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
31647
31883
|
weight: "semibold"
|
|
31648
|
-
}, answerProps),
|
|
31649
|
-
|
|
31650
|
-
|
|
31651
|
-
|
|
31652
|
-
|
|
31653
|
-
|
|
31884
|
+
}, answerProps), {}, {
|
|
31885
|
+
children: /*#__PURE__*/jsx(_default, {
|
|
31886
|
+
componentDecorator: linkifyDecorator,
|
|
31887
|
+
children: getValue({
|
|
31888
|
+
value: value,
|
|
31889
|
+
kind: kind
|
|
31890
|
+
})
|
|
31891
|
+
})
|
|
31892
|
+
}));
|
|
31654
31893
|
}
|
|
31655
31894
|
};
|
|
31656
31895
|
if (isLoading) {
|
|
31657
|
-
return /*#__PURE__*/
|
|
31658
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31659
|
-
|
|
31660
|
-
|
|
31661
|
-
|
|
31662
|
-
|
|
31663
|
-
|
|
31664
|
-
|
|
31665
|
-
|
|
31666
|
-
|
|
31667
|
-
|
|
31668
|
-
|
|
31669
|
-
|
|
31670
|
-
|
|
31671
|
-
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
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
|
+
});
|
|
31675
31918
|
};
|
|
31676
31919
|
|
|
31677
31920
|
var getPreFillableQuestions = function getPreFillableQuestions(questions) {
|
|
@@ -31735,6 +31978,8 @@ var buildQueryParameters = function buildQueryParameters(responses, questions) {
|
|
|
31735
31978
|
return queryParameters;
|
|
31736
31979
|
};
|
|
31737
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; }
|
|
31738
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; } } }; }
|
|
31739
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); }
|
|
31740
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; }
|
|
@@ -31819,81 +32064,94 @@ var UrlBuilder = function UrlBuilder(_ref) {
|
|
|
31819
32064
|
mode: "scoped"
|
|
31820
32065
|
});
|
|
31821
32066
|
if (isLoading || form.isQuestionsLoading) {
|
|
31822
|
-
return /*#__PURE__*/
|
|
31823
|
-
className: "flex h-full w-full items-center justify-center"
|
|
31824
|
-
|
|
32067
|
+
return /*#__PURE__*/jsx("div", {
|
|
32068
|
+
className: "flex h-full w-full items-center justify-center",
|
|
32069
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
32070
|
+
});
|
|
31825
32071
|
}
|
|
31826
32072
|
var title = form.title,
|
|
31827
32073
|
questions = form.questions;
|
|
31828
32074
|
var modifiedQuestions = getPreFillableQuestions(questions);
|
|
31829
|
-
return /*#__PURE__*/
|
|
31830
|
-
|
|
31831
|
-
|
|
31832
|
-
|
|
31833
|
-
|
|
31834
|
-
|
|
31835
|
-
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
|
|
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
|
+
});
|
|
31863
32152
|
}
|
|
31864
|
-
})
|
|
31865
|
-
|
|
31866
|
-
}, modifiedQuestions.map(function (question) {
|
|
31867
|
-
var _question$id;
|
|
31868
|
-
var FieldComponent = getFieldComponent(question);
|
|
31869
|
-
return /*#__PURE__*/React__default.createElement(FieldComponent, {
|
|
31870
|
-
editorProps: editorProps,
|
|
31871
|
-
editorRef: editorRef,
|
|
31872
|
-
question: question,
|
|
31873
|
-
customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
|
|
31874
|
-
key: (_question$id = question.id) !== null && _question$id !== void 0 ? _question$id : question.nodeId,
|
|
31875
|
-
autoComplete: buildAutoCompleteAttribute(question.kind, autoCompleteKinds, formDomProps)
|
|
31876
|
-
});
|
|
31877
|
-
}), showEmptyState && isEmpty(modifiedQuestions) && /*#__PURE__*/React__default.createElement("div", {
|
|
31878
|
-
className: "flex flex-col items-center justify-center gap-y-4 py-8"
|
|
31879
|
-
}, /*#__PURE__*/React__default.createElement(SvgNoQuestions, null), /*#__PURE__*/React__default.createElement(Typography, {
|
|
31880
|
-
style: "h3",
|
|
31881
|
-
weight: "semibold"
|
|
31882
|
-
}, t("neetoForm.questions.common.notFound")))), !isEmpty(modifiedQuestions) && /*#__PURE__*/React__default.createElement("div", {
|
|
31883
|
-
className: "mt-8 flex items-center justify-start gap-x-2"
|
|
31884
|
-
}, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31885
|
-
disabled: isSubmitting,
|
|
31886
|
-
label: t("neetoForm.common.generateLink"),
|
|
31887
|
-
loading: isSubmitting,
|
|
31888
|
-
type: "submit"
|
|
31889
|
-
}, submitButtonProps)), resetButtonProps && /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31890
|
-
label: t("neetoForm.common.reset"),
|
|
31891
|
-
style: "secondary",
|
|
31892
|
-
type: "reset"
|
|
31893
|
-
}, resetButtonProps)), cancelButtonProps && /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
|
|
31894
|
-
label: t("neetoForm.common.cancel")
|
|
31895
|
-
}, cancelButtonProps)))));
|
|
31896
|
-
}));
|
|
32153
|
+
})]
|
|
32154
|
+
});
|
|
31897
32155
|
};
|
|
31898
32156
|
|
|
31899
32157
|
var useFormSubmission = function useFormSubmission(_ref) {
|