@bigbinary/neeto-form-frontend 4.4.39 → 4.4.41
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/.ready +1 -1
- package/dist/cjs/v2/BuildForm.js +123 -330
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +2 -2
- package/dist/cjs/v2/UrlBuilder.js +2 -2
- package/dist/cjs/v2/index.js +3 -5
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/cjs/v2/{utils-ChwdTdnN.js → utils-vhbB2fwp.js} +2 -2
- package/dist/cjs/v2/{utils-ChwdTdnN.js.map → utils-vhbB2fwp.js.map} +1 -1
- package/dist/cjs/v2/{yup-CKeWnmJ3.js → yup-Rnk6JNb8.js} +1 -9
- package/dist/cjs/v2/{yup-CKeWnmJ3.js.map → yup-Rnk6JNb8.js.map} +1 -1
- package/dist/v2/BuildForm.js +129 -336
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +2 -2
- package/dist/v2/UrlBuilder.js +2 -2
- package/dist/v2/index.js +3 -5
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/main.css +1 -1
- package/dist/v2/main.css.map +1 -1
- package/dist/v2/{utils-B8sTYkWG.js → utils-B1ExnkqT.js} +2 -2
- package/dist/v2/{utils-B8sTYkWG.js.map → utils-B1ExnkqT.js.map} +1 -1
- package/dist/v2/{yup-Cf-x7SqN.js → yup-DItlKUzb.js} +2 -9
- package/dist/v2/{yup-Cf-x7SqN.js.map → yup-DItlKUzb.js.map} +1 -1
- package/package.json +5 -5
package/dist/v2/BuildForm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Alert, Dialog, Typography, Tooltip, DropdownMenu, Button, Empty, Switch as Switch$1, Sheet, Select, Accordion, Label,
|
|
1
|
+
import { Alert, Dialog, Typography, Tooltip, DropdownMenu, Button, Empty, Switch as Switch$1, Sheet, Select, Accordion, Label, MultiEmailInput, Checkbox, Slider, Spinner } from '@bigbinary/neeto-atoms';
|
|
2
2
|
import { useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { isPresent, truncate, findBy,
|
|
5
|
-
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, prop, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, isNil, append, pluck,
|
|
4
|
+
import { isPresent, truncate, findBy, slugify, existsBy, isNotPresent, findById, findIndexById, hyphenate, nullSafe, modifyBy, removeBy, noop } from '@bigbinary/neeto-cist';
|
|
5
|
+
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, prop, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, isNil, append, pluck, paths, difference, startsWith, split, last, either, F, T } from 'ramda';
|
|
6
6
|
import { j as useDeleteQuestion, b as useForm, k as useCreateQuestion, l as useUpdateQuestion, m as useReorderQuestions, Q as QUERY_KEYS } from './useFormApi-B5a0zkAT.js';
|
|
7
|
-
import { o as QUESTION_ACTIONS, q as INDEPENDENT_LABELS_MAP, r as buildDisplayLabel,
|
|
7
|
+
import { o as QUESTION_ACTIONS, q as INDEPENDENT_LABELS_MAP, r as buildDisplayLabel, c as isFunction, s as SELECTABLE_KINDS, t as isAutoGeneratedQuestion, g as fieldWithFallback, u as isRichTextQuestion, v as SPOT_QUESTION_FIELD_CODE, w as isNameQuestion, N as NON_BASIC_LATIN_CHARACTERS_REGEX, x as RESERVED_FIELD_CODES, y as renameKey, j as LABEL_FIELDS, z as isDefaultLanguage, B as buildAddQuestionButtonProps, F as validateEditorContent, G as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, H as MIN_WORDS, J as isImmutableField, a as QUESTIONS_WITHOUT_FIELD_CODE, K as NON_HIDEABLE_FIELDS, O as NON_READ_ONLY_FIELDS, T as OPINION_LABEL_MAX_LENGTH, U as RICH_TEXT_QUESTIONS, h as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, V as generateDefaultOptions, W as MINIMUM_ADDRESS_FIELDS, X as getDeletedRecords, Z as randomId, _ as getActiveRecords, $ as FILE_TYPES_MAP, a0 as FILE_GROUPS, a1 as OPINION_SCALE_MIN_VALUE_OPTIONS, a2 as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, a3 as MINIMUM_OPTIONS, a4 as IMAGE_HEIGHT_SLIDER_DEFAULTS, a5 as RATING_OPTIONS, a6 as STAR_RATING_MIN_VALUE_OPTIONS, a7 as STAR_RATING_MAX_VALUE_OPTIONS, a8 as STAR_RATING_ICONS_MAP, a9 as YES_NO_ICONS_MAP, aa as buildDisabledAddButtonHelpPopoverProps, ab as buildReorderPayload, ac as QUESTIONS_INITIAL_VALUE, ad as isMandatoryField, ae as QUESTION_KINDS, Q as QUESTION_KIND, af as getActiveQuestionKindDetails, ag as DEFAULT_AVAILABLE_LANGUAGES, ah as DEFAULT_ADVANCED_FEATURES } from './yup-DItlKUzb.js';
|
|
8
8
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
|
-
import {
|
|
9
|
+
import { createElement, useRef, useEffect, useState } from 'react';
|
|
10
10
|
import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
|
|
11
11
|
import { withT, isMetaKeyPressed, useStateWithDependency, useFuncDebounce, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
12
|
-
import { showThumbsUpToastr, withEventTargetValue
|
|
12
|
+
import { showThumbsUpToastr, withEventTargetValue } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
13
13
|
import { a as useBuildFormStore } from './buildForm-CpdYPz4r.js';
|
|
14
14
|
import { Q as QUESTION_TYPES, C as CAPTCHA_TYPES } from './constants-BlY0KFT4.js';
|
|
15
15
|
import { shallow } from 'zustand/shallow';
|
|
@@ -17,7 +17,7 @@ import { useTranslation, Trans } from 'react-i18next';
|
|
|
17
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
18
|
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
19
19
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
20
|
-
import { GripVertical, ListTodo
|
|
20
|
+
import { GripVertical, ListTodo } from 'lucide-react';
|
|
21
21
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
22
22
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
23
23
|
import { t } from 'i18next';
|
|
@@ -29,9 +29,6 @@ import { isEditorEmpty } from '@bigbinary/neeto-editor/v2/utils';
|
|
|
29
29
|
import * as yup from 'yup';
|
|
30
30
|
import OptionFields from '@bigbinary/neeto-molecules/v2/OptionFields';
|
|
31
31
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
32
|
-
import CreatableSelect from 'react-select/creatable';
|
|
33
|
-
import _toArray from '@babel/runtime/helpers/toArray';
|
|
34
|
-
import { components } from 'react-select';
|
|
35
32
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
36
33
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
37
34
|
import HelpPopover from '@bigbinary/neeto-molecules/v2/HelpPopover';
|
|
@@ -265,11 +262,6 @@ var Card = function Card(_ref) {
|
|
|
265
262
|
canManageQuestions = _ref.canManageQuestions,
|
|
266
263
|
_ref$extraMenuItems = _ref.extraMenuItems,
|
|
267
264
|
extraMenuItems = _ref$extraMenuItems === void 0 ? [] : _ref$extraMenuItems;
|
|
268
|
-
var _useState = useState(false),
|
|
269
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
270
|
-
isTooltipEnabled = _useState2[0],
|
|
271
|
-
setIsTooltipEnabled = _useState2[1];
|
|
272
|
-
var questionLabelRef = useRef(null);
|
|
273
265
|
var _useTranslation = useTranslation(),
|
|
274
266
|
t = _useTranslation.t;
|
|
275
267
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
@@ -279,11 +271,6 @@ var Card = function Card(_ref) {
|
|
|
279
271
|
isSingular = _getActiveKindDetails.isSingular,
|
|
280
272
|
KindIcon = _getActiveKindDetails.icon;
|
|
281
273
|
var questionLabel = buildDisplayLabel(question);
|
|
282
|
-
useEffect(function () {
|
|
283
|
-
var element = questionLabelRef.current;
|
|
284
|
-
if (isNotPresent(element)) return;
|
|
285
|
-
setIsTooltipEnabled(isElementOverflowing(element));
|
|
286
|
-
}, [questionLabel]);
|
|
287
274
|
return /*#__PURE__*/jsxs("div", {
|
|
288
275
|
"data-testid": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
289
276
|
className: classnames("border-border bg-card neeto-form-nano-form__card flex h-10 w-full items-center justify-between gap-2 overflow-hidden rounded-md border p-2", {
|
|
@@ -297,19 +284,12 @@ var Card = function Card(_ref) {
|
|
|
297
284
|
children: [KindIcon && /*#__PURE__*/jsx(KindIcon, {
|
|
298
285
|
className: "text-muted-foreground shrink-0",
|
|
299
286
|
"data-testid": "question-card-kind-icon",
|
|
300
|
-
size:
|
|
301
|
-
}), /*#__PURE__*/jsx(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
children:
|
|
306
|
-
className: "min-w-0 grow truncate",
|
|
307
|
-
"data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
|
|
308
|
-
ref: questionLabelRef,
|
|
309
|
-
variant: "body2",
|
|
310
|
-
weight: "medium",
|
|
311
|
-
children: questionLabel
|
|
312
|
-
})
|
|
287
|
+
size: 20
|
|
288
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
289
|
+
className: "min-w-0 grow truncate",
|
|
290
|
+
"data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
|
|
291
|
+
variant: "body2",
|
|
292
|
+
children: questionLabel
|
|
313
293
|
})]
|
|
314
294
|
}), canManageQuestions && /*#__PURE__*/jsx(MoreDropdown, {
|
|
315
295
|
dropdownButtonProps: {
|
|
@@ -346,8 +326,8 @@ var Card = function Card(_ref) {
|
|
|
346
326
|
});
|
|
347
327
|
};
|
|
348
328
|
|
|
349
|
-
function ownKeys$
|
|
350
|
-
function _objectSpread$
|
|
329
|
+
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; }
|
|
330
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
351
331
|
var Questions = function Questions(_ref) {
|
|
352
332
|
var questions = _ref.questions,
|
|
353
333
|
isDeletable = _ref.isDeletable,
|
|
@@ -367,7 +347,7 @@ var Questions = function Questions(_ref) {
|
|
|
367
347
|
var droppableProps = _ref2.droppableProps,
|
|
368
348
|
placeholder = _ref2.placeholder,
|
|
369
349
|
innerRef = _ref2.innerRef;
|
|
370
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$
|
|
350
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$h(_objectSpread$h({}, droppableProps), {}, {
|
|
371
351
|
className: "space-y-2",
|
|
372
352
|
ref: innerRef,
|
|
373
353
|
children: [questions.map(function (question, index) {
|
|
@@ -382,16 +362,16 @@ var Questions = function Questions(_ref) {
|
|
|
382
362
|
var draggableProps = _ref3.draggableProps,
|
|
383
363
|
dragHandleProps = _ref3.dragHandleProps,
|
|
384
364
|
innerRef = _ref3.innerRef;
|
|
385
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$
|
|
365
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$h(_objectSpread$h(_objectSpread$h({}, draggableProps), dragHandleProps), {}, {
|
|
386
366
|
className: "flex items-center gap-1",
|
|
387
367
|
ref: innerRef,
|
|
388
|
-
|
|
368
|
+
"data-testid": canManageQuestions ? "question-card-drag-handle" : undefined,
|
|
369
|
+
children: [canManageQuestions && /*#__PURE__*/jsx("span", {
|
|
389
370
|
className: "text-muted-foreground hover:text-foreground shrink-0 cursor-grab transition-all duration-300 ease-in-out",
|
|
390
|
-
"data-testid": "question-card-drag-handle",
|
|
391
371
|
children: /*#__PURE__*/jsx(GripVertical, {
|
|
392
372
|
size: 16
|
|
393
373
|
})
|
|
394
|
-
})
|
|
374
|
+
}), /*#__PURE__*/jsx("div", {
|
|
395
375
|
className: "min-w-0 grow",
|
|
396
376
|
children: /*#__PURE__*/jsx(Card, {
|
|
397
377
|
allQuestionKinds: allQuestionKinds,
|
|
@@ -426,9 +406,9 @@ var arrayHelpers = {
|
|
|
426
406
|
moveItem: moveItem
|
|
427
407
|
};
|
|
428
408
|
|
|
429
|
-
var _excluded$
|
|
430
|
-
function ownKeys$
|
|
431
|
-
function _objectSpread$
|
|
409
|
+
var _excluded$9 = ["fields"];
|
|
410
|
+
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; }
|
|
411
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
432
412
|
var isChoiceQuestion = function isChoiceQuestion(question) {
|
|
433
413
|
return includes(question === null || question === void 0 ? void 0 : question.kind, SELECTABLE_KINDS);
|
|
434
414
|
};
|
|
@@ -513,7 +493,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref4) {
|
|
|
513
493
|
var nextItems = _toConsumableArray(items);
|
|
514
494
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
515
495
|
var orderedItems = nextItems.map(function (item, index) {
|
|
516
|
-
return _objectSpread$
|
|
496
|
+
return _objectSpread$g(_objectSpread$g({}, item), {}, {
|
|
517
497
|
displayOrder: index
|
|
518
498
|
});
|
|
519
499
|
});
|
|
@@ -535,7 +515,7 @@ var createFieldData = function createFieldData(_ref5) {
|
|
|
535
515
|
selectedLanguage: selectedLanguage,
|
|
536
516
|
isUsingDefaultQuestionKinds: isUsingDefaultQuestionKinds
|
|
537
517
|
});
|
|
538
|
-
return _objectSpread$
|
|
518
|
+
return _objectSpread$g(_objectSpread$g(_objectSpread$g({}, modifiedDefaultValues), {}, {
|
|
539
519
|
metadata: metadata
|
|
540
520
|
}, typeof isRequired === "boolean" && {
|
|
541
521
|
isRequired: isRequired
|
|
@@ -563,11 +543,11 @@ var duplicateFieldData = function duplicateFieldData(_ref6) {
|
|
|
563
543
|
var defaultAttributeNames = keys(questionKind.defaults || {});
|
|
564
544
|
var _pick = pick(defaultAttributeNames, item),
|
|
565
545
|
fields = _pick.fields,
|
|
566
|
-
defaultAttributes = _objectWithoutProperties(_pick, _excluded$
|
|
546
|
+
defaultAttributes = _objectWithoutProperties(_pick, _excluded$9);
|
|
567
547
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : t("neetoForm.common.clonedElementLabel", {
|
|
568
548
|
label: label
|
|
569
549
|
});
|
|
570
|
-
return _objectSpread$
|
|
550
|
+
return _objectSpread$g(_objectSpread$g({}, defaultAttributes), {}, {
|
|
571
551
|
isRequired: isRequired,
|
|
572
552
|
kind: kind,
|
|
573
553
|
label: newQuestionLabel,
|
|
@@ -708,13 +688,13 @@ var KindOption = function KindOption(_ref) {
|
|
|
708
688
|
});
|
|
709
689
|
};
|
|
710
690
|
|
|
711
|
-
var _excluded$
|
|
712
|
-
function ownKeys$
|
|
713
|
-
function _objectSpread$
|
|
691
|
+
var _excluded$8 = ["label", "name"];
|
|
692
|
+
function ownKeys$f(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; }
|
|
693
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
714
694
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
715
695
|
var label = _ref.label,
|
|
716
696
|
name = _ref.name,
|
|
717
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
697
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
718
698
|
var _useFormikContext = useFormikContext(),
|
|
719
699
|
dirty = _useFormikContext.dirty,
|
|
720
700
|
isValid = _useFormikContext.isValid,
|
|
@@ -729,7 +709,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
729
709
|
var end = element.value.length;
|
|
730
710
|
element.setSelectionRange(end, end);
|
|
731
711
|
};
|
|
732
|
-
return /*#__PURE__*/jsx(Textarea$1, _objectSpread$
|
|
712
|
+
return /*#__PURE__*/jsx(Textarea$1, _objectSpread$f({
|
|
733
713
|
label: label,
|
|
734
714
|
name: name,
|
|
735
715
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -743,8 +723,8 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
743
723
|
}, otherProps));
|
|
744
724
|
};
|
|
745
725
|
|
|
746
|
-
function ownKeys$
|
|
747
|
-
function _objectSpread$
|
|
726
|
+
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; }
|
|
727
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
748
728
|
var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
749
729
|
var kind = _ref.kind,
|
|
750
730
|
isLabelDisabled = _ref.isLabelDisabled,
|
|
@@ -757,24 +737,23 @@ var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
|
757
737
|
t = _useTranslation.t;
|
|
758
738
|
var shouldShowPlaceholder = includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
759
739
|
return /*#__PURE__*/jsxs("div", {
|
|
760
|
-
className: "space-y-
|
|
761
|
-
children: [/*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$
|
|
740
|
+
className: "space-y-6",
|
|
741
|
+
children: [/*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$e({
|
|
762
742
|
required: true,
|
|
763
743
|
disabled: isLabelDisabled,
|
|
764
744
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
765
745
|
name: "label",
|
|
766
746
|
placeholder: DEFAULT_PLACEHOLDERS[kind],
|
|
767
747
|
onChange: withEventTargetValue(handleLabelChange)
|
|
768
|
-
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$
|
|
769
|
-
className: "neeto-form-nano-placeholder-input neeto-form-nano-placeholder-input-".concat(kind),
|
|
748
|
+
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$e({
|
|
770
749
|
name: "placeholder",
|
|
771
750
|
label: t("neetoForm.questions.common.questionFields.field.placeholder")
|
|
772
751
|
}, placeholderProps))]
|
|
773
752
|
});
|
|
774
753
|
};
|
|
775
754
|
|
|
776
|
-
function ownKeys$
|
|
777
|
-
function _objectSpread$
|
|
755
|
+
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; }
|
|
756
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
778
757
|
var Name = function Name(_ref) {
|
|
779
758
|
var isLabelDisabled = _ref.isLabelDisabled,
|
|
780
759
|
_handleLabelChange = _ref.handleLabelChange;
|
|
@@ -793,9 +772,9 @@ var Name = function Name(_ref) {
|
|
|
793
772
|
children: [!usesCustomSubmissionComponent && /*#__PURE__*/jsx(Switch, {
|
|
794
773
|
label: t("neetoForm.common.splitAsFirstAndLastNames"),
|
|
795
774
|
name: "isSplitMode",
|
|
796
|
-
size: "
|
|
775
|
+
size: "default"
|
|
797
776
|
}), isSplitMode && !usesCustomSubmissionComponent ? /*#__PURE__*/jsxs(Fragment, {
|
|
798
|
-
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
777
|
+
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
799
778
|
handleLabelChange: function handleLabelChange(value) {
|
|
800
779
|
return _handleLabelChange(value, LABEL_FIELDS.FIRST_NAME);
|
|
801
780
|
},
|
|
@@ -807,7 +786,7 @@ var Name = function Name(_ref) {
|
|
|
807
786
|
label: t("neetoForm.questions.common.questionFields.field.firstNamePlaceholder"),
|
|
808
787
|
name: "firstNamePlaceholder"
|
|
809
788
|
}
|
|
810
|
-
})), /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
789
|
+
})), /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
811
790
|
handleLabelChange: function handleLabelChange(value) {
|
|
812
791
|
return _handleLabelChange(value, LABEL_FIELDS.LAST_NAME);
|
|
813
792
|
},
|
|
@@ -820,7 +799,7 @@ var Name = function Name(_ref) {
|
|
|
820
799
|
name: "lastNamePlaceholder"
|
|
821
800
|
}
|
|
822
801
|
}))]
|
|
823
|
-
}) : /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
802
|
+
}) : /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
824
803
|
labelProps: {
|
|
825
804
|
name: LABEL_FIELDS.FULL_NAME
|
|
826
805
|
},
|
|
@@ -854,7 +833,7 @@ var Properties = function Properties(_ref) {
|
|
|
854
833
|
});
|
|
855
834
|
}
|
|
856
835
|
return /*#__PURE__*/jsxs("div", {
|
|
857
|
-
className: "space-y-
|
|
836
|
+
className: "space-y-6",
|
|
858
837
|
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, {
|
|
859
838
|
handleLabelChange: handleLabelChange,
|
|
860
839
|
isLabelDisabled: isLabelDisabled,
|
|
@@ -960,17 +939,17 @@ var RequiredSwitch = withT(function (_ref) {
|
|
|
960
939
|
children: /*#__PURE__*/jsx(Switch, {
|
|
961
940
|
label: t("neetoForm.common.required"),
|
|
962
941
|
name: "isRequired",
|
|
963
|
-
size: "
|
|
942
|
+
size: "default"
|
|
964
943
|
})
|
|
965
944
|
});
|
|
966
945
|
});
|
|
967
946
|
|
|
968
|
-
var _excluded$
|
|
969
|
-
function ownKeys$
|
|
970
|
-
function _objectSpread$
|
|
947
|
+
var _excluded$7 = ["maxLength"];
|
|
948
|
+
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; }
|
|
949
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
971
950
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
972
951
|
var maxLength = _ref.maxLength,
|
|
973
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
952
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
974
953
|
var _useField = useField(props),
|
|
975
954
|
_useField2 = _slicedToArray(_useField, 3),
|
|
976
955
|
value = _useField2[0].value,
|
|
@@ -981,7 +960,7 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
981
960
|
}
|
|
982
961
|
}, [value, maxLength, setValue]);
|
|
983
962
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
984
|
-
return /*#__PURE__*/jsx(Input, _objectSpread$
|
|
963
|
+
return /*#__PURE__*/jsx(Input, _objectSpread$c(_objectSpread$c({}, props), shouldShowMaxLength && {
|
|
985
964
|
maxLength: maxLength
|
|
986
965
|
}));
|
|
987
966
|
};
|
|
@@ -1030,7 +1009,7 @@ var Textarea = function Textarea() {
|
|
|
1030
1009
|
checked: isMinWordsEnabled,
|
|
1031
1010
|
label: t("neetoForm.questions.textarea.minimumWords"),
|
|
1032
1011
|
labelProps: MIN_WORDS_SWITCH_LABEL_PROPS,
|
|
1033
|
-
size: "
|
|
1012
|
+
size: "default",
|
|
1034
1013
|
onCheckedChange: handleToggleChange
|
|
1035
1014
|
}), isMinWordsEnabled && /*#__PURE__*/jsx(Input, {
|
|
1036
1015
|
className: "w-42 ms-14",
|
|
@@ -1042,8 +1021,8 @@ var Textarea = function Textarea() {
|
|
|
1042
1021
|
});
|
|
1043
1022
|
};
|
|
1044
1023
|
|
|
1045
|
-
function ownKeys$
|
|
1046
|
-
function _objectSpread$
|
|
1024
|
+
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; }
|
|
1025
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1047
1026
|
var Form$1 = function Form(_ref) {
|
|
1048
1027
|
var questions = _ref.questions,
|
|
1049
1028
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -1176,17 +1155,18 @@ var Form$1 = function Form(_ref) {
|
|
|
1176
1155
|
};
|
|
1177
1156
|
return /*#__PURE__*/jsx(Sheet.Body, {
|
|
1178
1157
|
children: /*#__PURE__*/jsxs("div", {
|
|
1179
|
-
className: "w-full space-y-
|
|
1158
|
+
className: "w-full space-y-6",
|
|
1180
1159
|
children: [/*#__PURE__*/jsx(Select, {
|
|
1181
1160
|
isClearable: true,
|
|
1182
1161
|
isSearchable: true,
|
|
1183
1162
|
formatOptionLabel: function formatOptionLabel(option) {
|
|
1184
|
-
return /*#__PURE__*/jsx(KindOption, _objectSpread$
|
|
1163
|
+
return /*#__PURE__*/jsx(KindOption, _objectSpread$b({}, option));
|
|
1185
1164
|
},
|
|
1186
1165
|
formatTriggerLabel: prop("label"),
|
|
1187
1166
|
isDisabled: isEdit,
|
|
1188
1167
|
options: kindOptions,
|
|
1189
1168
|
ref: initialFocusRef,
|
|
1169
|
+
size: "large",
|
|
1190
1170
|
value: buildDefaultValueForKind(questionKind),
|
|
1191
1171
|
label: t("neetoForm.questions.common.questionFields.field.questionType"),
|
|
1192
1172
|
onChange: handleKindChange
|
|
@@ -1195,37 +1175,37 @@ var Form$1 = function Form(_ref) {
|
|
|
1195
1175
|
isLabelDisabled: isLabelDisabled
|
|
1196
1176
|
}), shouldShowRequiredSwitch && /*#__PURE__*/jsx(RequiredSwitch, {})]
|
|
1197
1177
|
}) : /*#__PURE__*/jsxs("div", {
|
|
1198
|
-
className: "space-y-
|
|
1178
|
+
className: "space-y-6",
|
|
1199
1179
|
children: [/*#__PURE__*/jsx(Properties, {
|
|
1200
1180
|
handleLabelChange: handleLabelChange,
|
|
1201
1181
|
isLabelDisabled: isLabelDisabled,
|
|
1202
1182
|
kind: kind,
|
|
1203
1183
|
questionProps: questionProps
|
|
1204
1184
|
}), isSettingsBlockVisible && /*#__PURE__*/jsxs("div", {
|
|
1205
|
-
className: "space-y-
|
|
1185
|
+
className: "space-y-6",
|
|
1206
1186
|
"data-testid": "settings-card",
|
|
1207
1187
|
children: [isBasicSettingsVisible && /*#__PURE__*/jsxs(Fragment, {
|
|
1208
1188
|
children: [shouldShowRequiredSwitch && /*#__PURE__*/jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsx(Switch, {
|
|
1209
1189
|
label: t("neetoForm.common.hideQuestion"),
|
|
1210
1190
|
name: "isHidden",
|
|
1211
|
-
size: "
|
|
1191
|
+
size: "default",
|
|
1212
1192
|
labelProps: hideSwitchLabelProps(hideQuestionHelpDocUrl)
|
|
1213
1193
|
}), canRestrictResponseVisibilityToHost && /*#__PURE__*/jsx(Switch, {
|
|
1214
1194
|
label: t("neetoForm.common.responseVisibleOnlyToHost"),
|
|
1215
1195
|
name: "isResponseVisibleOnlyToHost",
|
|
1216
|
-
size: "
|
|
1196
|
+
size: "default",
|
|
1217
1197
|
labelProps: responseVisibleOnlyToHostSwitchLabelProps(responseVisibleOnlyToHostHelpDocUrl)
|
|
1218
1198
|
})]
|
|
1219
1199
|
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsx(Switch, {
|
|
1220
1200
|
label: t("neetoForm.common.readOnly"),
|
|
1221
1201
|
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1222
1202
|
name: "isReadOnly",
|
|
1223
|
-
size: "
|
|
1203
|
+
size: "default"
|
|
1224
1204
|
}), shouldShowSendSmsUpdatesSwitch && /*#__PURE__*/jsx(Switch, {
|
|
1225
1205
|
disabled: isSmsUpdatesDisabled,
|
|
1226
1206
|
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1227
1207
|
name: "sendSmsUpdates",
|
|
1228
|
-
size: "
|
|
1208
|
+
size: "default",
|
|
1229
1209
|
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1230
1210
|
}), isTextarea && enforceMinWordsInMultiLineTexts && /*#__PURE__*/jsx(Textarea, {})]
|
|
1231
1211
|
}), shouldShowFieldCode && /*#__PURE__*/jsx(Accordion, {
|
|
@@ -1236,7 +1216,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1236
1216
|
children: /*#__PURE__*/jsx(Accordion.Item, {
|
|
1237
1217
|
title: t("neetoForm.common.advancedProperties"),
|
|
1238
1218
|
children: /*#__PURE__*/jsx("div", {
|
|
1239
|
-
className: "flex flex-col space-y-
|
|
1219
|
+
className: "flex flex-col space-y-6",
|
|
1240
1220
|
children: shouldShowFieldCode && /*#__PURE__*/jsx(FieldCode, {})
|
|
1241
1221
|
})
|
|
1242
1222
|
})
|
|
@@ -1329,16 +1309,16 @@ var formValidationSchema = function formValidationSchema(question) {
|
|
|
1329
1309
|
});
|
|
1330
1310
|
};
|
|
1331
1311
|
|
|
1332
|
-
var _excluded$
|
|
1333
|
-
function ownKeys$
|
|
1334
|
-
function _objectSpread$
|
|
1312
|
+
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "isOpen"];
|
|
1313
|
+
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; }
|
|
1314
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1335
1315
|
var Add = function Add(_ref) {
|
|
1336
1316
|
var question = _ref.question,
|
|
1337
1317
|
onClose = _ref.onClose,
|
|
1338
1318
|
questions = _ref.questions,
|
|
1339
1319
|
handleSelect = _ref.handleSelect,
|
|
1340
1320
|
isOpen = _ref.isOpen,
|
|
1341
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1321
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1342
1322
|
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
1343
1323
|
var _store$formState, _store$formState2, _store$formState3;
|
|
1344
1324
|
return {
|
|
@@ -1395,7 +1375,7 @@ var Add = function Add(_ref) {
|
|
|
1395
1375
|
"data-testid": "add-question-pane-header",
|
|
1396
1376
|
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
1397
1377
|
})
|
|
1398
|
-
}), /*#__PURE__*/jsx(Form$1, _objectSpread$
|
|
1378
|
+
}), /*#__PURE__*/jsx(Form$1, _objectSpread$a({}, _objectSpread$a(_objectSpread$a({}, props), {}, {
|
|
1399
1379
|
question: question,
|
|
1400
1380
|
questions: questions
|
|
1401
1381
|
}))), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
@@ -1409,14 +1389,14 @@ var Add = function Add(_ref) {
|
|
|
1409
1389
|
});
|
|
1410
1390
|
};
|
|
1411
1391
|
|
|
1412
|
-
var _excluded$
|
|
1413
|
-
function ownKeys$
|
|
1414
|
-
function _objectSpread$
|
|
1392
|
+
var _excluded$5 = ["question", "isOpen", "onClose"];
|
|
1393
|
+
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; }
|
|
1394
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1415
1395
|
var Edit = function Edit(_ref) {
|
|
1416
1396
|
var question = _ref.question,
|
|
1417
1397
|
isOpen = _ref.isOpen,
|
|
1418
1398
|
onClose = _ref.onClose,
|
|
1419
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1399
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1420
1400
|
var _useTranslation = useTranslation(),
|
|
1421
1401
|
t = _useTranslation.t;
|
|
1422
1402
|
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
@@ -1462,7 +1442,7 @@ var Edit = function Edit(_ref) {
|
|
|
1462
1442
|
// Sheet keeps children mounted, so this renders once before a
|
|
1463
1443
|
// question is selected; without this those empty values stick.
|
|
1464
1444
|
enableReinitialize: true,
|
|
1465
|
-
initialValues: _objectSpread$
|
|
1445
|
+
initialValues: _objectSpread$9(_objectSpread$9({}, question), {}, {
|
|
1466
1446
|
isMinWordsEnabled: isPresent(question.minWords)
|
|
1467
1447
|
}),
|
|
1468
1448
|
validationSchema: formValidationSchema(question, isFieldCodeEnabled),
|
|
@@ -1473,7 +1453,7 @@ var Edit = function Edit(_ref) {
|
|
|
1473
1453
|
"data-testid": "edit-question-pane-header",
|
|
1474
1454
|
children: t("neetoForm.questions.common.editQuestion")
|
|
1475
1455
|
})
|
|
1476
|
-
}), /*#__PURE__*/jsx(Form$1, _objectSpread$
|
|
1456
|
+
}), /*#__PURE__*/jsx(Form$1, _objectSpread$9(_objectSpread$9({}, _objectSpread$9({
|
|
1477
1457
|
question: question
|
|
1478
1458
|
}, props)), {}, {
|
|
1479
1459
|
isEdit: true
|
|
@@ -1503,7 +1483,7 @@ var Block = function Block(_ref) {
|
|
|
1503
1483
|
children: title
|
|
1504
1484
|
})
|
|
1505
1485
|
}), /*#__PURE__*/jsx("div", {
|
|
1506
|
-
className: "space-y-
|
|
1486
|
+
className: "space-y-6",
|
|
1507
1487
|
children: children
|
|
1508
1488
|
})]
|
|
1509
1489
|
});
|
|
@@ -1521,17 +1501,17 @@ var VARIANTS = {
|
|
|
1521
1501
|
}
|
|
1522
1502
|
};
|
|
1523
1503
|
|
|
1524
|
-
var _excluded$
|
|
1525
|
-
function ownKeys$
|
|
1526
|
-
function _objectSpread$
|
|
1504
|
+
var _excluded$4 = ["open", "className", "children"];
|
|
1505
|
+
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; }
|
|
1506
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1527
1507
|
var Collapsible = function Collapsible(_ref) {
|
|
1528
1508
|
var open = _ref.open,
|
|
1529
1509
|
_ref$className = _ref.className,
|
|
1530
1510
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
1531
1511
|
children = _ref.children,
|
|
1532
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
1512
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
1533
1513
|
return /*#__PURE__*/jsx(AnimatePresence, {
|
|
1534
|
-
children: open && /*#__PURE__*/jsx(motion.div, _objectSpread$
|
|
1514
|
+
children: open && /*#__PURE__*/jsx(motion.div, _objectSpread$8(_objectSpread$8({
|
|
1535
1515
|
animate: "visible",
|
|
1536
1516
|
exit: "hidden",
|
|
1537
1517
|
initial: "hidden",
|
|
@@ -1588,11 +1568,11 @@ var ADDRESS_FIELD_FORM_VALIDATION_SCHEMA = yup.object().shape({
|
|
|
1588
1568
|
});
|
|
1589
1569
|
var ERROR_MESSAGE_DELIMITER$1 = ". ";
|
|
1590
1570
|
|
|
1591
|
-
function ownKeys$
|
|
1592
|
-
function _objectSpread$
|
|
1593
|
-
var removeDuplicateErrorMessages
|
|
1571
|
+
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; }
|
|
1572
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1573
|
+
var removeDuplicateErrorMessages = pipe(filter(isNotNil), map(values), uniq, join(ERROR_MESSAGE_DELIMITER$1));
|
|
1594
1574
|
var getAddressModalInitialValues = function getAddressModalInitialValues(field) {
|
|
1595
|
-
return field ? _objectSpread$
|
|
1575
|
+
return field ? _objectSpread$7(_objectSpread$7({}, field), {}, {
|
|
1596
1576
|
width: ADDRESS_FIELD_WIDTH_OPTIONS[field.width],
|
|
1597
1577
|
fieldType: ADDRESS_FIELD_TYPE_OPTIONS[field.fieldType]
|
|
1598
1578
|
}) : {
|
|
@@ -1614,12 +1594,12 @@ var sanitizeAddressField = function sanitizeAddressField(field, isSelectField, d
|
|
|
1614
1594
|
};
|
|
1615
1595
|
var formatErrorMessage$1 = function formatErrorMessage(error) {
|
|
1616
1596
|
if (typeof error === "string") return error;
|
|
1617
|
-
return removeDuplicateErrorMessages
|
|
1597
|
+
return removeDuplicateErrorMessages(error);
|
|
1618
1598
|
};
|
|
1619
1599
|
|
|
1620
|
-
var _excluded$
|
|
1621
|
-
function ownKeys$
|
|
1622
|
-
function _objectSpread$
|
|
1600
|
+
var _excluded$3 = ["width", "fieldType"];
|
|
1601
|
+
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; }
|
|
1602
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1623
1603
|
var ManagePane = function ManagePane(_ref) {
|
|
1624
1604
|
var isOpen = _ref.isOpen,
|
|
1625
1605
|
selectedFieldId = _ref.selectedFieldId,
|
|
@@ -1639,14 +1619,14 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1639
1619
|
var handleSubmit = function handleSubmit(_ref2) {
|
|
1640
1620
|
var width = _ref2.width,
|
|
1641
1621
|
fieldType = _ref2.fieldType,
|
|
1642
|
-
field = _objectWithoutProperties(_ref2, _excluded$
|
|
1622
|
+
field = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1643
1623
|
var deletedFields = getDeletedRecords(allFields);
|
|
1644
1624
|
var isSelectField = fieldType.value === ADDRESS_FIELD_TYPES.SELECT;
|
|
1645
1625
|
var sanitizedField = sanitizeAddressField(field, isSelectField, defaultOptions);
|
|
1646
1626
|
if (isNil(selectedFieldId)) {
|
|
1647
1627
|
var position = fields.length;
|
|
1648
1628
|
var id = "draft-".concat(randomId());
|
|
1649
|
-
var newField = _objectSpread$
|
|
1629
|
+
var newField = _objectSpread$6(_objectSpread$6({
|
|
1650
1630
|
id: id
|
|
1651
1631
|
}, sanitizedField), {}, {
|
|
1652
1632
|
altId: "alt-".concat(randomId()),
|
|
@@ -1658,7 +1638,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1658
1638
|
setValue([].concat(_toConsumableArray(nextFields), _toConsumableArray(deletedFields)));
|
|
1659
1639
|
} else {
|
|
1660
1640
|
var selectedFieldIndex = findIndexById(selectedFieldId, fields);
|
|
1661
|
-
setValue(assoc(selectedFieldIndex, _objectSpread$
|
|
1641
|
+
setValue(assoc(selectedFieldIndex, _objectSpread$6(_objectSpread$6({}, sanitizedField), {}, {
|
|
1662
1642
|
width: width.value,
|
|
1663
1643
|
fieldType: fieldType.value
|
|
1664
1644
|
}), [].concat(_toConsumableArray(fields), _toConsumableArray(deletedFields))));
|
|
@@ -1730,7 +1710,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1730
1710
|
children: /*#__PURE__*/jsx(Switch, {
|
|
1731
1711
|
label: t("neetoForm.common.required"),
|
|
1732
1712
|
name: "isRequired",
|
|
1733
|
-
size: "
|
|
1713
|
+
size: "default"
|
|
1734
1714
|
})
|
|
1735
1715
|
})]
|
|
1736
1716
|
})
|
|
@@ -1880,21 +1860,21 @@ var Captcha = withT(function (_ref) {
|
|
|
1880
1860
|
});
|
|
1881
1861
|
});
|
|
1882
1862
|
|
|
1883
|
-
var _excluded$
|
|
1884
|
-
function ownKeys$
|
|
1885
|
-
function _objectSpread$
|
|
1863
|
+
var _excluded$2 = ["name", "title", "className"];
|
|
1864
|
+
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; }
|
|
1865
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1886
1866
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
1887
1867
|
var name = _ref.name,
|
|
1888
1868
|
title = _ref.title,
|
|
1889
1869
|
_ref$className = _ref.className,
|
|
1890
1870
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
1891
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
1871
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
1892
1872
|
return /*#__PURE__*/jsxs(Label, {
|
|
1893
1873
|
className: classnames("flex items-center justify-start gap-2 ", className),
|
|
1894
1874
|
"data-testid": "neeto-form-engine-".concat(hyphenate(title && name), "-toggle-label"),
|
|
1895
|
-
children: [/*#__PURE__*/jsx(Switch, _objectSpread$
|
|
1896
|
-
size: "
|
|
1897
|
-
}, _objectSpread$
|
|
1875
|
+
children: [/*#__PURE__*/jsx(Switch, _objectSpread$5(_objectSpread$5({
|
|
1876
|
+
size: "default"
|
|
1877
|
+
}, _objectSpread$5(_objectSpread$5({}, otherProps), {}, {
|
|
1898
1878
|
name: name
|
|
1899
1879
|
})), {}, {
|
|
1900
1880
|
"data-testid": "neeto-form-engine-".concat(hyphenate(title && name), "-switch")
|
|
@@ -1906,6 +1886,8 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1906
1886
|
});
|
|
1907
1887
|
};
|
|
1908
1888
|
|
|
1889
|
+
var VALID_DOMAIN_REGEX = /^(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z0-9-]{2,63}$/;
|
|
1890
|
+
var ERROR_MESSAGE_DELIMITER = ". ";
|
|
1909
1891
|
var DOMAIN_RESTRICTION_TRANSLATIONS = {
|
|
1910
1892
|
whitelistedDomains: {
|
|
1911
1893
|
title: t("neetoForm.domainRestriction.whitelistedDomains.label"),
|
|
@@ -1923,223 +1905,20 @@ var EMAIL_VERIFICATION_TRANSLATIONS = {
|
|
|
1923
1905
|
popoverDescription: t("neetoForm.emailVerification.popoverDescription")
|
|
1924
1906
|
};
|
|
1925
1907
|
|
|
1926
|
-
|
|
1927
|
-
function
|
|
1928
|
-
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), true).forEach(function (r) { _defineProperty(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; }
|
|
1929
|
-
var STYLES = {
|
|
1930
|
-
border: {
|
|
1931
|
-
"default": "1px solid var(--input)",
|
|
1932
|
-
error: "1px solid var(--error-solid) !important"
|
|
1933
|
-
},
|
|
1934
|
-
color: {
|
|
1935
|
-
"default": "var(--foreground)",
|
|
1936
|
-
error: "var(--error-foreground) !important"
|
|
1937
|
-
}
|
|
1938
|
-
};
|
|
1939
|
-
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1940
|
-
return /*#__PURE__*/jsx(components.MultiValueRemove, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1941
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "".concat(hyphenize(props.data.label), "-remove-icon"))),
|
|
1942
|
-
children: /*#__PURE__*/jsx(X, {
|
|
1943
|
-
size: 16
|
|
1944
|
-
})
|
|
1945
|
-
}));
|
|
1946
|
-
};
|
|
1947
|
-
var ValueContainer = function ValueContainer(_ref) {
|
|
1948
|
-
var children = _ref.children,
|
|
1949
|
-
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1950
|
-
var _useTranslation = useTranslation(),
|
|
1951
|
-
t = _useTranslation.t;
|
|
1952
|
-
var getValue = props.getValue,
|
|
1953
|
-
_props$selectProps = props.selectProps,
|
|
1954
|
-
isFocused = _props$selectProps.isFocused,
|
|
1955
|
-
visibleDomainsCount = _props$selectProps.visibleDomainsCount;
|
|
1956
|
-
var value = getValue();
|
|
1957
|
-
var _children = _toArray(children),
|
|
1958
|
-
firstChild = _children[0],
|
|
1959
|
-
rest = _children.slice(1);
|
|
1960
|
-
var shouldCollapse = !isFocused && value.length > visibleDomainsCount;
|
|
1961
|
-
return /*#__PURE__*/jsxs(components.ValueContainer, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1962
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "multi-domain-input-container")),
|
|
1963
|
-
children: [shouldCollapse ? firstChild.slice(0, visibleDomainsCount) : firstChild, shouldCollapse && /*#__PURE__*/jsx(Badge, {
|
|
1964
|
-
variant: "secondary",
|
|
1965
|
-
label: t("neetoForm.common.remainingItemsCount", {
|
|
1966
|
-
count: value.length - visibleDomainsCount
|
|
1967
|
-
})
|
|
1968
|
-
}), rest]
|
|
1969
|
-
}));
|
|
1970
|
-
};
|
|
1971
|
-
var ClearIndicator = function ClearIndicator(props) {
|
|
1972
|
-
return /*#__PURE__*/jsx(components.ClearIndicator, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1973
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "clear-all-button")),
|
|
1974
|
-
children: /*#__PURE__*/jsx(X, {
|
|
1975
|
-
className: "cursor-pointer",
|
|
1976
|
-
size: 16
|
|
1977
|
-
})
|
|
1978
|
-
}));
|
|
1979
|
-
};
|
|
1980
|
-
var ERROR_MESSAGE_DELIMITER = ". ";
|
|
1981
|
-
var DELIMITER_KEYS = ["Enter", "Tab", ",", " "];
|
|
1982
|
-
var DOMAIN_SEPARATION_REGEX = /[^\s,]+/g;
|
|
1983
|
-
var FLEXIBLE_DOMAIN_REGEX = /^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/;
|
|
1984
|
-
var VALID_DOMAIN_REGEX = /^(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z0-9-]{2,63}$/;
|
|
1985
|
-
var DOMAIN_VALIDATION_SCHEMA = yup.string().required(t("neetoForm.error.requiredField", {
|
|
1986
|
-
label: t("neetoForm.common.domain")
|
|
1987
|
-
})).test("verify domains", t("neetoForm.error.invalidDomain"), function (domain) {
|
|
1988
|
-
return VALID_DOMAIN_REGEX.test(domain);
|
|
1989
|
-
});
|
|
1990
|
-
var CUSTOM_STYLES = {
|
|
1991
|
-
input: assoc("overflow", "hidden"),
|
|
1992
|
-
multiValue: function multiValue(styles, _ref2) {
|
|
1993
|
-
var valid = _ref2.data.valid;
|
|
1994
|
-
return _objectSpread$6(_objectSpread$6({}, styles), {}, {
|
|
1995
|
-
border: valid ? STYLES.border["default"] : STYLES.border.error,
|
|
1996
|
-
color: valid ? STYLES.color["default"] : STYLES.color.error
|
|
1997
|
-
});
|
|
1998
|
-
}
|
|
1999
|
-
};
|
|
2000
|
-
var CUSTOM_COMPONENTS = {
|
|
2001
|
-
DropdownIndicator: null,
|
|
2002
|
-
MultiValueRemove: MultiValueRemove,
|
|
2003
|
-
ValueContainer: ValueContainer,
|
|
2004
|
-
ClearIndicator: ClearIndicator
|
|
2005
|
-
};
|
|
2006
|
-
|
|
2007
|
-
var removeDuplicateErrorMessages = pipe(filter(isNotNil), uniq, join(ERROR_MESSAGE_DELIMITER));
|
|
1908
|
+
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; }
|
|
1909
|
+
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), true).forEach(function (r) { _defineProperty(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; }
|
|
2008
1910
|
var formatDomainInputOptions = function formatDomainInputOptions(domain) {
|
|
2009
|
-
var isValid;
|
|
2010
|
-
try {
|
|
2011
|
-
DOMAIN_VALIDATION_SCHEMA.validateSync(domain);
|
|
2012
|
-
isValid = true;
|
|
2013
|
-
} catch (_unused) {
|
|
2014
|
-
isValid = false;
|
|
2015
|
-
}
|
|
2016
1911
|
return {
|
|
2017
1912
|
label: domain,
|
|
2018
1913
|
value: domain,
|
|
2019
|
-
valid:
|
|
1914
|
+
valid: VALID_DOMAIN_REGEX.test(domain)
|
|
2020
1915
|
};
|
|
2021
1916
|
};
|
|
2022
|
-
var pruneDuplicates = pipe(pluck("value"), uniq, map(formatDomainInputOptions));
|
|
2023
|
-
var getValidDomains = function getValidDomains(domains) {
|
|
2024
|
-
return domains.filter(function (domain) {
|
|
2025
|
-
return domain === null || domain === void 0 ? void 0 : domain.valid;
|
|
2026
|
-
});
|
|
2027
|
-
};
|
|
2028
|
-
var getValidDomainsCount = function getValidDomainsCount(domains) {
|
|
2029
|
-
return getValidDomains(domains).length;
|
|
2030
|
-
};
|
|
2031
1917
|
var formatErrorMessage = function formatErrorMessage(error) {
|
|
1918
|
+
if (!error) return "";
|
|
2032
1919
|
if (typeof error === "string") return error;
|
|
2033
|
-
return
|
|
2034
|
-
};
|
|
2035
|
-
|
|
2036
|
-
var _excluded$2 = ["label", "value", "onChange", "error", "onBlur"];
|
|
2037
|
-
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; }
|
|
2038
|
-
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), true).forEach(function (r) { _defineProperty(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; }
|
|
2039
|
-
var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
2040
|
-
var _ref$label = _ref.label,
|
|
2041
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
2042
|
-
_ref$value = _ref.value,
|
|
2043
|
-
value = _ref$value === void 0 ? [] : _ref$value,
|
|
2044
|
-
_ref$onChange = _ref.onChange,
|
|
2045
|
-
onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
|
|
2046
|
-
_ref$error = _ref.error,
|
|
2047
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
2048
|
-
_ref$onBlur = _ref.onBlur,
|
|
2049
|
-
onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,
|
|
2050
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
2051
|
-
var _useState = useState(""),
|
|
2052
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2053
|
-
inputValue = _useState2[0],
|
|
2054
|
-
setInputValue = _useState2[1];
|
|
2055
|
-
var _useState3 = useState(false),
|
|
2056
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
2057
|
-
isFocused = _useState4[0],
|
|
2058
|
-
setIsFocused = _useState4[1];
|
|
2059
|
-
var _useTranslation = useTranslation(),
|
|
2060
|
-
t = _useTranslation.t;
|
|
2061
|
-
var handleFilterDomains = function handleFilterDomains() {
|
|
2062
|
-
return onChange(getValidDomains(value));
|
|
2063
|
-
};
|
|
2064
|
-
var handleDomainChange = function handleDomainChange() {
|
|
2065
|
-
var inputValues = inputValue.match(DOMAIN_SEPARATION_REGEX) || [];
|
|
2066
|
-
var domainMatches = filter(test(FLEXIBLE_DOMAIN_REGEX), inputValues);
|
|
2067
|
-
var domains = domainMatches.map(formatDomainInputOptions);
|
|
2068
|
-
onChange(pruneDuplicates([].concat(_toConsumableArray(value), _toConsumableArray(domains))));
|
|
2069
|
-
setInputValue("");
|
|
2070
|
-
};
|
|
2071
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
2072
|
-
if (!inputValue) return;
|
|
2073
|
-
if (includes(event.key, DELIMITER_KEYS)) {
|
|
2074
|
-
handleDomainChange();
|
|
2075
|
-
event.preventDefault();
|
|
2076
|
-
event.stopPropagation();
|
|
2077
|
-
}
|
|
2078
|
-
};
|
|
2079
|
-
var onCreateOption = function onCreateOption(input) {
|
|
2080
|
-
var domain = formatDomainInputOptions(input);
|
|
2081
|
-
onChange(pruneDuplicates([].concat(_toConsumableArray(value), [domain])));
|
|
2082
|
-
};
|
|
2083
|
-
var handleBlur = function handleBlur(event) {
|
|
2084
|
-
inputValue ? handleDomainChange() : onBlur(event);
|
|
2085
|
-
setIsFocused(false);
|
|
2086
|
-
};
|
|
2087
|
-
var isFilterDomainsLinkVisible = value.length > getValidDomainsCount(value);
|
|
2088
|
-
return /*#__PURE__*/jsxs("div", {
|
|
2089
|
-
className: "input__wrapper email-input__wrapper",
|
|
2090
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
2091
|
-
className: "email-input__label-wrapper",
|
|
2092
|
-
children: /*#__PURE__*/jsx(Label, {
|
|
2093
|
-
className: "email-input__label",
|
|
2094
|
-
"data-testid": "".concat(hyphenize(label), "-input-label"),
|
|
2095
|
-
children: label
|
|
2096
|
-
})
|
|
2097
|
-
}), /*#__PURE__*/jsx(CreatableSelect, _objectSpread$5({
|
|
2098
|
-
isMulti: true,
|
|
2099
|
-
required: true,
|
|
2100
|
-
classNamePrefix: "neeto-ui-react-select",
|
|
2101
|
-
components: CUSTOM_COMPONENTS,
|
|
2102
|
-
menuIsOpen: false,
|
|
2103
|
-
visibleDomainsCount: 3,
|
|
2104
|
-
className: classnames("react-select__container react-select__container--medium email-input__select", {
|
|
2105
|
-
"react-select__container--error": !!error
|
|
2106
|
-
}),
|
|
2107
|
-
styles: _objectSpread$5(_objectSpread$5({}, CUSTOM_STYLES), {}, {
|
|
2108
|
-
control: mergeLeft({
|
|
2109
|
-
maxHeight: "200px",
|
|
2110
|
-
overflowY: "auto"
|
|
2111
|
-
})
|
|
2112
|
-
}),
|
|
2113
|
-
onBlur: handleBlur,
|
|
2114
|
-
onFocus: function onFocus() {
|
|
2115
|
-
return setIsFocused(true);
|
|
2116
|
-
},
|
|
2117
|
-
onInputChange: setInputValue,
|
|
2118
|
-
onKeyDown: handleKeyDown
|
|
2119
|
-
}, _objectSpread$5({
|
|
2120
|
-
inputValue: inputValue,
|
|
2121
|
-
isFocused: isFocused,
|
|
2122
|
-
onChange: onChange,
|
|
2123
|
-
onCreateOption: onCreateOption,
|
|
2124
|
-
value: value
|
|
2125
|
-
}, otherProps))), !!error && /*#__PURE__*/jsxs("p", {
|
|
2126
|
-
className: "input__error",
|
|
2127
|
-
"data-testid": "".concat(hyphenize(label), "-input-error"),
|
|
2128
|
-
children: [formatErrorMessage(error), isFilterDomainsLinkVisible && /*#__PURE__*/jsxs("span", {
|
|
2129
|
-
className: "font-semibold cursor-pointer",
|
|
2130
|
-
onClick: handleFilterDomains,
|
|
2131
|
-
children: [ERROR_MESSAGE_DELIMITER, t("neetoForm.domainRestriction.removeInvalidDomains")]
|
|
2132
|
-
})]
|
|
2133
|
-
}), /*#__PURE__*/jsx("p", {
|
|
2134
|
-
className: "input__help-text",
|
|
2135
|
-
"data-testid": "".concat(hyphenize(label), "-input-help"),
|
|
2136
|
-
children: t("neetoForm.domainRestriction.helpText")
|
|
2137
|
-
})]
|
|
2138
|
-
});
|
|
1920
|
+
return pipe(filter(isNotNil), uniq, join(ERROR_MESSAGE_DELIMITER))(error);
|
|
2139
1921
|
};
|
|
2140
|
-
|
|
2141
|
-
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; }
|
|
2142
|
-
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), true).forEach(function (r) { _defineProperty(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; }
|
|
2143
1922
|
var validateDomains = function validateDomains(value) {
|
|
2144
1923
|
var schema = yup.array().of(yup.string().test("verify domains", t("neetoForm.error.invalidDomain"), function (domain) {
|
|
2145
1924
|
return VALID_DOMAIN_REGEX.test(domain);
|
|
@@ -2210,12 +1989,16 @@ var EmailDomains = function EmailDomains(_ref) {
|
|
|
2210
1989
|
var formattedDomains = map(formatDomainInputOptions, domains);
|
|
2211
1990
|
return /*#__PURE__*/jsx("div", {
|
|
2212
1991
|
className: "mb-4",
|
|
2213
|
-
children: /*#__PURE__*/jsx(
|
|
1992
|
+
children: /*#__PURE__*/jsx(MultiEmailInput, {
|
|
2214
1993
|
label: label,
|
|
2215
|
-
|
|
2216
|
-
error: meta.touched ? meta.error : "",
|
|
1994
|
+
entryType: "domain",
|
|
1995
|
+
error: meta.touched ? formatErrorMessage(meta.error) : "",
|
|
1996
|
+
helpText: t("neetoForm.domainRestriction.helpText"),
|
|
2217
1997
|
placeholder: t("neetoForm.domainRestriction.placeholder"),
|
|
2218
1998
|
value: formattedDomains,
|
|
1999
|
+
filterInvalidEmails: {
|
|
2000
|
+
label: t("neetoForm.domainRestriction.removeInvalidDomains")
|
|
2001
|
+
},
|
|
2219
2002
|
onBlur: function onBlur() {
|
|
2220
2003
|
return setTouched(true);
|
|
2221
2004
|
},
|
|
@@ -2266,7 +2049,7 @@ var VerifyEmails = function VerifyEmails() {
|
|
|
2266
2049
|
label: title,
|
|
2267
2050
|
labelProps: buildHelpPopoverLabelProps(popoverDescription, helpLink),
|
|
2268
2051
|
name: "isVerificationEnabled",
|
|
2269
|
-
size: "
|
|
2052
|
+
size: "default"
|
|
2270
2053
|
})
|
|
2271
2054
|
});
|
|
2272
2055
|
};
|
|
@@ -2280,7 +2063,7 @@ var Email = function Email(_ref) {
|
|
|
2280
2063
|
_useFormikContext$val3 = _useFormikContext$val.isDomainBlacklistingEnabled,
|
|
2281
2064
|
isDomainBlacklistingEnabled = _useFormikContext$val3 === void 0 ? false : _useFormikContext$val3;
|
|
2282
2065
|
return /*#__PURE__*/jsx("div", {
|
|
2283
|
-
className: "flex flex-col space-y-
|
|
2066
|
+
className: "flex flex-col space-y-6",
|
|
2284
2067
|
children: !usesCustomSubmissionComponent && /*#__PURE__*/jsxs(Fragment, {
|
|
2285
2068
|
children: [/*#__PURE__*/jsx(RestrictDomainsBlock, {
|
|
2286
2069
|
domainName: "whitelistedDomains",
|
|
@@ -2411,7 +2194,7 @@ var OpinionScale = function OpinionScale() {
|
|
|
2411
2194
|
"data-testid": "neeto-form-engine-opinion-scale-show-labels-switch",
|
|
2412
2195
|
label: t("neetoForm.questions.opinionScale.showLabels"),
|
|
2413
2196
|
name: "hasOpinionLabels",
|
|
2414
|
-
size: "
|
|
2197
|
+
size: "default"
|
|
2415
2198
|
}), hasOpinionLabels && /*#__PURE__*/jsxs("div", {
|
|
2416
2199
|
className: "flex space-x-4",
|
|
2417
2200
|
children: [/*#__PURE__*/jsx(Input, {
|
|
@@ -2511,12 +2294,12 @@ var Options = function Options(_ref) {
|
|
|
2511
2294
|
className: "space-y-4",
|
|
2512
2295
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
2513
2296
|
name: "isPictureChoice",
|
|
2514
|
-
size: "
|
|
2297
|
+
size: "default",
|
|
2515
2298
|
label: t("neetoForm.questions.common.questionFields.field.addPicturesToOptions")
|
|
2516
2299
|
}), isPictureChoice && /*#__PURE__*/jsxs(Fragment, {
|
|
2517
2300
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
2518
2301
|
name: "shouldFitImages",
|
|
2519
|
-
size: "
|
|
2302
|
+
size: "default",
|
|
2520
2303
|
label: t("neetoForm.questions.common.questionFields.field.fitImages"),
|
|
2521
2304
|
labelProps: {
|
|
2522
2305
|
helpIconProps: {
|
|
@@ -2865,6 +2648,7 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
2865
2648
|
initialFocusRef: initialFocusRef,
|
|
2866
2649
|
isOpen: isOpen,
|
|
2867
2650
|
onClose: onClose,
|
|
2651
|
+
size: "large",
|
|
2868
2652
|
children: /*#__PURE__*/jsx(Component, _objectSpread$1({}, _objectSpread$1({
|
|
2869
2653
|
availableQuestionKinds: availableQuestionKinds,
|
|
2870
2654
|
initialFocusRef: initialFocusRef,
|
|
@@ -3017,6 +2801,15 @@ var Form = function Form(_ref) {
|
|
|
3017
2801
|
setSelectedAction(QUESTION_ACTIONS.EDIT);
|
|
3018
2802
|
setIsManageQuestionPaneOpen(true);
|
|
3019
2803
|
};
|
|
2804
|
+
|
|
2805
|
+
// The embeddable builder has no inline properties panel, so a bare card click
|
|
2806
|
+
// would only highlight the question. Open the edit pane on click so the
|
|
2807
|
+
// interaction has a purpose (drag still reorders — @hello-pangea/dnd
|
|
2808
|
+
// separates click from drag). Falls back to select-only when questions are
|
|
2809
|
+
// not manageable, so read-only consumers are unaffected.
|
|
2810
|
+
var handleQuestionClick = function handleQuestionClick(question) {
|
|
2811
|
+
return canManageQuestions ? handleEdit(question) : handleSelect(question);
|
|
2812
|
+
};
|
|
3020
2813
|
var handleClone = function handleClone(question) {
|
|
3021
2814
|
var values = duplicateFieldData({
|
|
3022
2815
|
item: question,
|
|
@@ -3121,7 +2914,7 @@ var Form = function Form(_ref) {
|
|
|
3121
2914
|
onClone: handleClone,
|
|
3122
2915
|
onDelete: handleDelete,
|
|
3123
2916
|
onEdit: handleEdit,
|
|
3124
|
-
onSelect:
|
|
2917
|
+
onSelect: handleQuestionClick
|
|
3125
2918
|
})
|
|
3126
2919
|
}), canManageQuestions && /*#__PURE__*/jsx("div", {
|
|
3127
2920
|
className: "mb-8 flex w-full items-center gap-x-1",
|