@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/cjs/v2/BuildForm.js
CHANGED
|
@@ -6,7 +6,7 @@ var classnames = require('classnames');
|
|
|
6
6
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
7
7
|
var ramda = require('ramda');
|
|
8
8
|
var useFormApi = require('./useFormApi-DD0_MxNV.js');
|
|
9
|
-
var yup = require('./yup-
|
|
9
|
+
var yup = require('./yup-Rnk6JNb8.js');
|
|
10
10
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var dnd = require('@hello-pangea/dnd');
|
|
@@ -31,9 +31,6 @@ var utils$1 = require('@bigbinary/neeto-editor/v2/utils');
|
|
|
31
31
|
var yup$1 = require('yup');
|
|
32
32
|
var OptionFields = require('@bigbinary/neeto-molecules/v2/OptionFields');
|
|
33
33
|
var framerMotion = require('framer-motion');
|
|
34
|
-
var CreatableSelect = require('react-select/creatable');
|
|
35
|
-
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
36
|
-
var reactSelect = require('react-select');
|
|
37
34
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
38
35
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
39
36
|
var HelpPopover = require('@bigbinary/neeto-molecules/v2/HelpPopover');
|
|
@@ -286,11 +283,6 @@ var Card = function Card(_ref) {
|
|
|
286
283
|
canManageQuestions = _ref.canManageQuestions,
|
|
287
284
|
_ref$extraMenuItems = _ref.extraMenuItems,
|
|
288
285
|
extraMenuItems = _ref$extraMenuItems === void 0 ? [] : _ref$extraMenuItems;
|
|
289
|
-
var _useState = React.useState(false),
|
|
290
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
291
|
-
isTooltipEnabled = _useState2[0],
|
|
292
|
-
setIsTooltipEnabled = _useState2[1];
|
|
293
|
-
var questionLabelRef = React.useRef(null);
|
|
294
286
|
var _useTranslation = reactI18next.useTranslation(),
|
|
295
287
|
t = _useTranslation.t;
|
|
296
288
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
@@ -300,11 +292,6 @@ var Card = function Card(_ref) {
|
|
|
300
292
|
isSingular = _getActiveKindDetails.isSingular,
|
|
301
293
|
KindIcon = _getActiveKindDetails.icon;
|
|
302
294
|
var questionLabel = yup.buildDisplayLabel(question);
|
|
303
|
-
React.useEffect(function () {
|
|
304
|
-
var element = questionLabelRef.current;
|
|
305
|
-
if (neetoCist.isNotPresent(element)) return;
|
|
306
|
-
setIsTooltipEnabled(yup.isElementOverflowing(element));
|
|
307
|
-
}, [questionLabel]);
|
|
308
295
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
309
296
|
"data-testid": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
|
|
310
297
|
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", {
|
|
@@ -318,19 +305,12 @@ var Card = function Card(_ref) {
|
|
|
318
305
|
children: [KindIcon && /*#__PURE__*/jsxRuntime.jsx(KindIcon, {
|
|
319
306
|
className: "text-muted-foreground shrink-0",
|
|
320
307
|
"data-testid": "question-card-kind-icon",
|
|
321
|
-
size:
|
|
322
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
children:
|
|
327
|
-
className: "min-w-0 grow truncate",
|
|
328
|
-
"data-testid": "".concat(neetoCist.slugify(questionLabel), "-question-card-label"),
|
|
329
|
-
ref: questionLabelRef,
|
|
330
|
-
variant: "body2",
|
|
331
|
-
weight: "medium",
|
|
332
|
-
children: questionLabel
|
|
333
|
-
})
|
|
308
|
+
size: 20
|
|
309
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
310
|
+
className: "min-w-0 grow truncate",
|
|
311
|
+
"data-testid": "".concat(neetoCist.slugify(questionLabel), "-question-card-label"),
|
|
312
|
+
variant: "body2",
|
|
313
|
+
children: questionLabel
|
|
334
314
|
})]
|
|
335
315
|
}), canManageQuestions && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
336
316
|
dropdownButtonProps: {
|
|
@@ -367,8 +347,8 @@ var Card = function Card(_ref) {
|
|
|
367
347
|
});
|
|
368
348
|
};
|
|
369
349
|
|
|
370
|
-
function ownKeys$
|
|
371
|
-
function _objectSpread$
|
|
350
|
+
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; }
|
|
351
|
+
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; }
|
|
372
352
|
var Questions = function Questions(_ref) {
|
|
373
353
|
var questions = _ref.questions,
|
|
374
354
|
isDeletable = _ref.isDeletable,
|
|
@@ -388,7 +368,7 @@ var Questions = function Questions(_ref) {
|
|
|
388
368
|
var droppableProps = _ref2.droppableProps,
|
|
389
369
|
placeholder = _ref2.placeholder,
|
|
390
370
|
innerRef = _ref2.innerRef;
|
|
391
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$
|
|
371
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$h(_objectSpread$h({}, droppableProps), {}, {
|
|
392
372
|
className: "space-y-2",
|
|
393
373
|
ref: innerRef,
|
|
394
374
|
children: [questions.map(function (question, index) {
|
|
@@ -403,16 +383,16 @@ var Questions = function Questions(_ref) {
|
|
|
403
383
|
var draggableProps = _ref3.draggableProps,
|
|
404
384
|
dragHandleProps = _ref3.dragHandleProps,
|
|
405
385
|
innerRef = _ref3.innerRef;
|
|
406
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$
|
|
386
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$h(_objectSpread$h(_objectSpread$h({}, draggableProps), dragHandleProps), {}, {
|
|
407
387
|
className: "flex items-center gap-1",
|
|
408
388
|
ref: innerRef,
|
|
409
|
-
|
|
389
|
+
"data-testid": canManageQuestions ? "question-card-drag-handle" : undefined,
|
|
390
|
+
children: [canManageQuestions && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
410
391
|
className: "text-muted-foreground hover:text-foreground shrink-0 cursor-grab transition-all duration-300 ease-in-out",
|
|
411
|
-
"data-testid": "question-card-drag-handle",
|
|
412
392
|
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.GripVertical, {
|
|
413
393
|
size: 16
|
|
414
394
|
})
|
|
415
|
-
})
|
|
395
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
416
396
|
className: "min-w-0 grow",
|
|
417
397
|
children: /*#__PURE__*/jsxRuntime.jsx(Card, {
|
|
418
398
|
allQuestionKinds: allQuestionKinds,
|
|
@@ -447,9 +427,9 @@ var arrayHelpers = {
|
|
|
447
427
|
moveItem: moveItem
|
|
448
428
|
};
|
|
449
429
|
|
|
450
|
-
var _excluded$
|
|
451
|
-
function ownKeys$
|
|
452
|
-
function _objectSpread$
|
|
430
|
+
var _excluded$9 = ["fields"];
|
|
431
|
+
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; }
|
|
432
|
+
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; }
|
|
453
433
|
var isChoiceQuestion = function isChoiceQuestion(question) {
|
|
454
434
|
return ramda.includes(question === null || question === void 0 ? void 0 : question.kind, yup.SELECTABLE_KINDS);
|
|
455
435
|
};
|
|
@@ -534,7 +514,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref4) {
|
|
|
534
514
|
var nextItems = _toConsumableArray(items);
|
|
535
515
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
536
516
|
var orderedItems = nextItems.map(function (item, index) {
|
|
537
|
-
return _objectSpread$
|
|
517
|
+
return _objectSpread$g(_objectSpread$g({}, item), {}, {
|
|
538
518
|
displayOrder: index
|
|
539
519
|
});
|
|
540
520
|
});
|
|
@@ -556,7 +536,7 @@ var createFieldData = function createFieldData(_ref5) {
|
|
|
556
536
|
selectedLanguage: selectedLanguage,
|
|
557
537
|
isUsingDefaultQuestionKinds: isUsingDefaultQuestionKinds
|
|
558
538
|
});
|
|
559
|
-
return _objectSpread$
|
|
539
|
+
return _objectSpread$g(_objectSpread$g(_objectSpread$g({}, modifiedDefaultValues), {}, {
|
|
560
540
|
metadata: metadata
|
|
561
541
|
}, typeof isRequired === "boolean" && {
|
|
562
542
|
isRequired: isRequired
|
|
@@ -584,11 +564,11 @@ var duplicateFieldData = function duplicateFieldData(_ref6) {
|
|
|
584
564
|
var defaultAttributeNames = ramda.keys(questionKind.defaults || {});
|
|
585
565
|
var _pick = ramda.pick(defaultAttributeNames, item),
|
|
586
566
|
fields = _pick.fields,
|
|
587
|
-
defaultAttributes = _objectWithoutProperties(_pick, _excluded$
|
|
567
|
+
defaultAttributes = _objectWithoutProperties(_pick, _excluded$9);
|
|
588
568
|
var newQuestionLabel = yup.isRichTextQuestion(kind) ? label : i18next.t("neetoForm.common.clonedElementLabel", {
|
|
589
569
|
label: label
|
|
590
570
|
});
|
|
591
|
-
return _objectSpread$
|
|
571
|
+
return _objectSpread$g(_objectSpread$g({}, defaultAttributes), {}, {
|
|
592
572
|
isRequired: isRequired,
|
|
593
573
|
kind: kind,
|
|
594
574
|
label: newQuestionLabel,
|
|
@@ -729,13 +709,13 @@ var KindOption = function KindOption(_ref) {
|
|
|
729
709
|
});
|
|
730
710
|
};
|
|
731
711
|
|
|
732
|
-
var _excluded$
|
|
733
|
-
function ownKeys$
|
|
734
|
-
function _objectSpread$
|
|
712
|
+
var _excluded$8 = ["label", "name"];
|
|
713
|
+
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; }
|
|
714
|
+
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; }
|
|
735
715
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
736
716
|
var label = _ref.label,
|
|
737
717
|
name = _ref.name,
|
|
738
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
718
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
739
719
|
var _useFormikContext = formik.useFormikContext(),
|
|
740
720
|
dirty = _useFormikContext.dirty,
|
|
741
721
|
isValid = _useFormikContext.isValid,
|
|
@@ -750,7 +730,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
750
730
|
var end = element.value.length;
|
|
751
731
|
element.setSelectionRange(end, end);
|
|
752
732
|
};
|
|
753
|
-
return /*#__PURE__*/jsxRuntime.jsx(formik$1.Textarea, _objectSpread$
|
|
733
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik$1.Textarea, _objectSpread$f({
|
|
754
734
|
label: label,
|
|
755
735
|
name: name,
|
|
756
736
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -764,8 +744,8 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
764
744
|
}, otherProps));
|
|
765
745
|
};
|
|
766
746
|
|
|
767
|
-
function ownKeys$
|
|
768
|
-
function _objectSpread$
|
|
747
|
+
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; }
|
|
748
|
+
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; }
|
|
769
749
|
var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
770
750
|
var kind = _ref.kind,
|
|
771
751
|
isLabelDisabled = _ref.isLabelDisabled,
|
|
@@ -778,24 +758,23 @@ var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
|
778
758
|
t = _useTranslation.t;
|
|
779
759
|
var shouldShowPlaceholder = ramda.includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
780
760
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
781
|
-
className: "space-y-
|
|
782
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, _objectSpread$
|
|
761
|
+
className: "space-y-6",
|
|
762
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, _objectSpread$e({
|
|
783
763
|
required: true,
|
|
784
764
|
disabled: isLabelDisabled,
|
|
785
765
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
786
766
|
name: "label",
|
|
787
767
|
placeholder: DEFAULT_PLACEHOLDERS[kind],
|
|
788
768
|
onChange: utils.withEventTargetValue(handleLabelChange)
|
|
789
|
-
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, _objectSpread$
|
|
790
|
-
className: "neeto-form-nano-placeholder-input neeto-form-nano-placeholder-input-".concat(kind),
|
|
769
|
+
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsxRuntime.jsx(FormikAdaptiveInput, _objectSpread$e({
|
|
791
770
|
name: "placeholder",
|
|
792
771
|
label: t("neetoForm.questions.common.questionFields.field.placeholder")
|
|
793
772
|
}, placeholderProps))]
|
|
794
773
|
});
|
|
795
774
|
};
|
|
796
775
|
|
|
797
|
-
function ownKeys$
|
|
798
|
-
function _objectSpread$
|
|
776
|
+
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; }
|
|
777
|
+
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; }
|
|
799
778
|
var Name = function Name(_ref) {
|
|
800
779
|
var isLabelDisabled = _ref.isLabelDisabled,
|
|
801
780
|
_handleLabelChange = _ref.handleLabelChange;
|
|
@@ -814,9 +793,9 @@ var Name = function Name(_ref) {
|
|
|
814
793
|
children: [!usesCustomSubmissionComponent && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
815
794
|
label: t("neetoForm.common.splitAsFirstAndLastNames"),
|
|
816
795
|
name: "isSplitMode",
|
|
817
|
-
size: "
|
|
796
|
+
size: "default"
|
|
818
797
|
}), isSplitMode && !usesCustomSubmissionComponent ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
819
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$
|
|
798
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
820
799
|
handleLabelChange: function handleLabelChange(value) {
|
|
821
800
|
return _handleLabelChange(value, yup.LABEL_FIELDS.FIRST_NAME);
|
|
822
801
|
},
|
|
@@ -828,7 +807,7 @@ var Name = function Name(_ref) {
|
|
|
828
807
|
label: t("neetoForm.questions.common.questionFields.field.firstNamePlaceholder"),
|
|
829
808
|
name: "firstNamePlaceholder"
|
|
830
809
|
}
|
|
831
|
-
})), /*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$
|
|
810
|
+
})), /*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
832
811
|
handleLabelChange: function handleLabelChange(value) {
|
|
833
812
|
return _handleLabelChange(value, yup.LABEL_FIELDS.LAST_NAME);
|
|
834
813
|
},
|
|
@@ -841,7 +820,7 @@ var Name = function Name(_ref) {
|
|
|
841
820
|
name: "lastNamePlaceholder"
|
|
842
821
|
}
|
|
843
822
|
}))]
|
|
844
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$
|
|
823
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$d(_objectSpread$d({}, commonProps), {}, {
|
|
845
824
|
labelProps: {
|
|
846
825
|
name: yup.LABEL_FIELDS.FULL_NAME
|
|
847
826
|
},
|
|
@@ -875,7 +854,7 @@ var Properties = function Properties(_ref) {
|
|
|
875
854
|
});
|
|
876
855
|
}
|
|
877
856
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
878
|
-
className: "space-y-
|
|
857
|
+
className: "space-y-6",
|
|
879
858
|
children: [/*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, {
|
|
880
859
|
handleLabelChange: handleLabelChange,
|
|
881
860
|
isLabelDisabled: isLabelDisabled,
|
|
@@ -981,17 +960,17 @@ var RequiredSwitch = reactUtils.withT(function (_ref) {
|
|
|
981
960
|
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
982
961
|
label: t("neetoForm.common.required"),
|
|
983
962
|
name: "isRequired",
|
|
984
|
-
size: "
|
|
963
|
+
size: "default"
|
|
985
964
|
})
|
|
986
965
|
});
|
|
987
966
|
});
|
|
988
967
|
|
|
989
|
-
var _excluded$
|
|
990
|
-
function ownKeys$
|
|
991
|
-
function _objectSpread$
|
|
968
|
+
var _excluded$7 = ["maxLength"];
|
|
969
|
+
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; }
|
|
970
|
+
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; }
|
|
992
971
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
993
972
|
var maxLength = _ref.maxLength,
|
|
994
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
973
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
995
974
|
var _useField = formik.useField(props),
|
|
996
975
|
_useField2 = _slicedToArray(_useField, 3),
|
|
997
976
|
value = _useField2[0].value,
|
|
@@ -1002,7 +981,7 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
1002
981
|
}
|
|
1003
982
|
}, [value, maxLength, setValue]);
|
|
1004
983
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
1005
|
-
return /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, _objectSpread$
|
|
984
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, _objectSpread$c(_objectSpread$c({}, props), shouldShowMaxLength && {
|
|
1006
985
|
maxLength: maxLength
|
|
1007
986
|
}));
|
|
1008
987
|
};
|
|
@@ -1051,7 +1030,7 @@ var Textarea = function Textarea() {
|
|
|
1051
1030
|
checked: isMinWordsEnabled,
|
|
1052
1031
|
label: t("neetoForm.questions.textarea.minimumWords"),
|
|
1053
1032
|
labelProps: yup.MIN_WORDS_SWITCH_LABEL_PROPS,
|
|
1054
|
-
size: "
|
|
1033
|
+
size: "default",
|
|
1055
1034
|
onCheckedChange: handleToggleChange
|
|
1056
1035
|
}), isMinWordsEnabled && /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
|
|
1057
1036
|
className: "w-42 ms-14",
|
|
@@ -1063,8 +1042,8 @@ var Textarea = function Textarea() {
|
|
|
1063
1042
|
});
|
|
1064
1043
|
};
|
|
1065
1044
|
|
|
1066
|
-
function ownKeys$
|
|
1067
|
-
function _objectSpread$
|
|
1045
|
+
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; }
|
|
1046
|
+
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; }
|
|
1068
1047
|
var Form$1 = function Form(_ref) {
|
|
1069
1048
|
var questions = _ref.questions,
|
|
1070
1049
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -1197,17 +1176,18 @@ var Form$1 = function Form(_ref) {
|
|
|
1197
1176
|
};
|
|
1198
1177
|
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Body, {
|
|
1199
1178
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1200
|
-
className: "w-full space-y-
|
|
1179
|
+
className: "w-full space-y-6",
|
|
1201
1180
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Select, {
|
|
1202
1181
|
isClearable: true,
|
|
1203
1182
|
isSearchable: true,
|
|
1204
1183
|
formatOptionLabel: function formatOptionLabel(option) {
|
|
1205
|
-
return /*#__PURE__*/jsxRuntime.jsx(KindOption, _objectSpread$
|
|
1184
|
+
return /*#__PURE__*/jsxRuntime.jsx(KindOption, _objectSpread$b({}, option));
|
|
1206
1185
|
},
|
|
1207
1186
|
formatTriggerLabel: ramda.prop("label"),
|
|
1208
1187
|
isDisabled: isEdit,
|
|
1209
1188
|
options: kindOptions,
|
|
1210
1189
|
ref: initialFocusRef,
|
|
1190
|
+
size: "large",
|
|
1211
1191
|
value: buildDefaultValueForKind(questionKind),
|
|
1212
1192
|
label: t("neetoForm.questions.common.questionFields.field.questionType"),
|
|
1213
1193
|
onChange: handleKindChange
|
|
@@ -1216,37 +1196,37 @@ var Form$1 = function Form(_ref) {
|
|
|
1216
1196
|
isLabelDisabled: isLabelDisabled
|
|
1217
1197
|
}), shouldShowRequiredSwitch && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {})]
|
|
1218
1198
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1219
|
-
className: "space-y-
|
|
1199
|
+
className: "space-y-6",
|
|
1220
1200
|
children: [/*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
1221
1201
|
handleLabelChange: handleLabelChange,
|
|
1222
1202
|
isLabelDisabled: isLabelDisabled,
|
|
1223
1203
|
kind: kind,
|
|
1224
1204
|
questionProps: questionProps
|
|
1225
1205
|
}), isSettingsBlockVisible && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1226
|
-
className: "space-y-
|
|
1206
|
+
className: "space-y-6",
|
|
1227
1207
|
"data-testid": "settings-card",
|
|
1228
1208
|
children: [isBasicSettingsVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1229
1209
|
children: [shouldShowRequiredSwitch && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1230
1210
|
label: t("neetoForm.common.hideQuestion"),
|
|
1231
1211
|
name: "isHidden",
|
|
1232
|
-
size: "
|
|
1212
|
+
size: "default",
|
|
1233
1213
|
labelProps: hideSwitchLabelProps(hideQuestionHelpDocUrl)
|
|
1234
1214
|
}), canRestrictResponseVisibilityToHost && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1235
1215
|
label: t("neetoForm.common.responseVisibleOnlyToHost"),
|
|
1236
1216
|
name: "isResponseVisibleOnlyToHost",
|
|
1237
|
-
size: "
|
|
1217
|
+
size: "default",
|
|
1238
1218
|
labelProps: responseVisibleOnlyToHostSwitchLabelProps(responseVisibleOnlyToHostHelpDocUrl)
|
|
1239
1219
|
})]
|
|
1240
1220
|
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1241
1221
|
label: t("neetoForm.common.readOnly"),
|
|
1242
1222
|
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1243
1223
|
name: "isReadOnly",
|
|
1244
|
-
size: "
|
|
1224
|
+
size: "default"
|
|
1245
1225
|
}), shouldShowSendSmsUpdatesSwitch && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1246
1226
|
disabled: isSmsUpdatesDisabled,
|
|
1247
1227
|
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1248
1228
|
name: "sendSmsUpdates",
|
|
1249
|
-
size: "
|
|
1229
|
+
size: "default",
|
|
1250
1230
|
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1251
1231
|
}), isTextarea && enforceMinWordsInMultiLineTexts && /*#__PURE__*/jsxRuntime.jsx(Textarea, {})]
|
|
1252
1232
|
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Accordion, {
|
|
@@ -1257,7 +1237,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1257
1237
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Accordion.Item, {
|
|
1258
1238
|
title: t("neetoForm.common.advancedProperties"),
|
|
1259
1239
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1260
|
-
className: "flex flex-col space-y-
|
|
1240
|
+
className: "flex flex-col space-y-6",
|
|
1261
1241
|
children: shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})
|
|
1262
1242
|
})
|
|
1263
1243
|
})
|
|
@@ -1350,16 +1330,16 @@ var formValidationSchema = function formValidationSchema(question) {
|
|
|
1350
1330
|
});
|
|
1351
1331
|
};
|
|
1352
1332
|
|
|
1353
|
-
var _excluded$
|
|
1354
|
-
function ownKeys$
|
|
1355
|
-
function _objectSpread$
|
|
1333
|
+
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "isOpen"];
|
|
1334
|
+
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; }
|
|
1335
|
+
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; }
|
|
1356
1336
|
var Add = function Add(_ref) {
|
|
1357
1337
|
var question = _ref.question,
|
|
1358
1338
|
onClose = _ref.onClose,
|
|
1359
1339
|
questions = _ref.questions,
|
|
1360
1340
|
handleSelect = _ref.handleSelect,
|
|
1361
1341
|
isOpen = _ref.isOpen,
|
|
1362
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1342
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1363
1343
|
var _useBuildFormStore = buildForm.useBuildFormStore(function (store) {
|
|
1364
1344
|
var _store$formState, _store$formState2, _store$formState3;
|
|
1365
1345
|
return {
|
|
@@ -1416,7 +1396,7 @@ var Add = function Add(_ref) {
|
|
|
1416
1396
|
"data-testid": "add-question-pane-header",
|
|
1417
1397
|
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
1418
1398
|
})
|
|
1419
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$
|
|
1399
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$a({}, _objectSpread$a(_objectSpread$a({}, props), {}, {
|
|
1420
1400
|
question: question,
|
|
1421
1401
|
questions: questions
|
|
1422
1402
|
}))), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
@@ -1430,14 +1410,14 @@ var Add = function Add(_ref) {
|
|
|
1430
1410
|
});
|
|
1431
1411
|
};
|
|
1432
1412
|
|
|
1433
|
-
var _excluded$
|
|
1434
|
-
function ownKeys$
|
|
1435
|
-
function _objectSpread$
|
|
1413
|
+
var _excluded$5 = ["question", "isOpen", "onClose"];
|
|
1414
|
+
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; }
|
|
1415
|
+
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; }
|
|
1436
1416
|
var Edit = function Edit(_ref) {
|
|
1437
1417
|
var question = _ref.question,
|
|
1438
1418
|
isOpen = _ref.isOpen,
|
|
1439
1419
|
onClose = _ref.onClose,
|
|
1440
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1420
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1441
1421
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1442
1422
|
t = _useTranslation.t;
|
|
1443
1423
|
var _useBuildFormStore = buildForm.useBuildFormStore(function (store) {
|
|
@@ -1483,7 +1463,7 @@ var Edit = function Edit(_ref) {
|
|
|
1483
1463
|
// Sheet keeps children mounted, so this renders once before a
|
|
1484
1464
|
// question is selected; without this those empty values stick.
|
|
1485
1465
|
enableReinitialize: true,
|
|
1486
|
-
initialValues: _objectSpread$
|
|
1466
|
+
initialValues: _objectSpread$9(_objectSpread$9({}, question), {}, {
|
|
1487
1467
|
isMinWordsEnabled: neetoCist.isPresent(question.minWords)
|
|
1488
1468
|
}),
|
|
1489
1469
|
validationSchema: formValidationSchema(question, isFieldCodeEnabled),
|
|
@@ -1494,7 +1474,7 @@ var Edit = function Edit(_ref) {
|
|
|
1494
1474
|
"data-testid": "edit-question-pane-header",
|
|
1495
1475
|
children: t("neetoForm.questions.common.editQuestion")
|
|
1496
1476
|
})
|
|
1497
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$
|
|
1477
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$9(_objectSpread$9({}, _objectSpread$9({
|
|
1498
1478
|
question: question
|
|
1499
1479
|
}, props)), {}, {
|
|
1500
1480
|
isEdit: true
|
|
@@ -1524,7 +1504,7 @@ var Block = function Block(_ref) {
|
|
|
1524
1504
|
children: title
|
|
1525
1505
|
})
|
|
1526
1506
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1527
|
-
className: "space-y-
|
|
1507
|
+
className: "space-y-6",
|
|
1528
1508
|
children: children
|
|
1529
1509
|
})]
|
|
1530
1510
|
});
|
|
@@ -1542,17 +1522,17 @@ var VARIANTS = {
|
|
|
1542
1522
|
}
|
|
1543
1523
|
};
|
|
1544
1524
|
|
|
1545
|
-
var _excluded$
|
|
1546
|
-
function ownKeys$
|
|
1547
|
-
function _objectSpread$
|
|
1525
|
+
var _excluded$4 = ["open", "className", "children"];
|
|
1526
|
+
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; }
|
|
1527
|
+
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; }
|
|
1548
1528
|
var Collapsible = function Collapsible(_ref) {
|
|
1549
1529
|
var open = _ref.open,
|
|
1550
1530
|
_ref$className = _ref.className,
|
|
1551
1531
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
1552
1532
|
children = _ref.children,
|
|
1553
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
1533
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
1554
1534
|
return /*#__PURE__*/jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
1555
|
-
children: open && /*#__PURE__*/jsxRuntime.jsx(framerMotion.motion.div, _objectSpread$
|
|
1535
|
+
children: open && /*#__PURE__*/jsxRuntime.jsx(framerMotion.motion.div, _objectSpread$8(_objectSpread$8({
|
|
1556
1536
|
animate: "visible",
|
|
1557
1537
|
exit: "hidden",
|
|
1558
1538
|
initial: "hidden",
|
|
@@ -1609,11 +1589,11 @@ var ADDRESS_FIELD_FORM_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
|
1609
1589
|
});
|
|
1610
1590
|
var ERROR_MESSAGE_DELIMITER$1 = ". ";
|
|
1611
1591
|
|
|
1612
|
-
function ownKeys$
|
|
1613
|
-
function _objectSpread$
|
|
1614
|
-
var removeDuplicateErrorMessages
|
|
1592
|
+
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; }
|
|
1593
|
+
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; }
|
|
1594
|
+
var removeDuplicateErrorMessages = ramda.pipe(ramda.filter(ramda.isNotNil), ramda.map(ramda.values), ramda.uniq, ramda.join(ERROR_MESSAGE_DELIMITER$1));
|
|
1615
1595
|
var getAddressModalInitialValues = function getAddressModalInitialValues(field) {
|
|
1616
|
-
return field ? _objectSpread$
|
|
1596
|
+
return field ? _objectSpread$7(_objectSpread$7({}, field), {}, {
|
|
1617
1597
|
width: ADDRESS_FIELD_WIDTH_OPTIONS[field.width],
|
|
1618
1598
|
fieldType: ADDRESS_FIELD_TYPE_OPTIONS[field.fieldType]
|
|
1619
1599
|
}) : {
|
|
@@ -1635,12 +1615,12 @@ var sanitizeAddressField = function sanitizeAddressField(field, isSelectField, d
|
|
|
1635
1615
|
};
|
|
1636
1616
|
var formatErrorMessage$1 = function formatErrorMessage(error) {
|
|
1637
1617
|
if (typeof error === "string") return error;
|
|
1638
|
-
return removeDuplicateErrorMessages
|
|
1618
|
+
return removeDuplicateErrorMessages(error);
|
|
1639
1619
|
};
|
|
1640
1620
|
|
|
1641
|
-
var _excluded$
|
|
1642
|
-
function ownKeys$
|
|
1643
|
-
function _objectSpread$
|
|
1621
|
+
var _excluded$3 = ["width", "fieldType"];
|
|
1622
|
+
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; }
|
|
1623
|
+
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; }
|
|
1644
1624
|
var ManagePane = function ManagePane(_ref) {
|
|
1645
1625
|
var isOpen = _ref.isOpen,
|
|
1646
1626
|
selectedFieldId = _ref.selectedFieldId,
|
|
@@ -1660,14 +1640,14 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1660
1640
|
var handleSubmit = function handleSubmit(_ref2) {
|
|
1661
1641
|
var width = _ref2.width,
|
|
1662
1642
|
fieldType = _ref2.fieldType,
|
|
1663
|
-
field = _objectWithoutProperties(_ref2, _excluded$
|
|
1643
|
+
field = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1664
1644
|
var deletedFields = yup.getDeletedRecords(allFields);
|
|
1665
1645
|
var isSelectField = fieldType.value === yup.ADDRESS_FIELD_TYPES.SELECT;
|
|
1666
1646
|
var sanitizedField = sanitizeAddressField(field, isSelectField, defaultOptions);
|
|
1667
1647
|
if (ramda.isNil(selectedFieldId)) {
|
|
1668
1648
|
var position = fields.length;
|
|
1669
1649
|
var id = "draft-".concat(yup.randomId());
|
|
1670
|
-
var newField = _objectSpread$
|
|
1650
|
+
var newField = _objectSpread$6(_objectSpread$6({
|
|
1671
1651
|
id: id
|
|
1672
1652
|
}, sanitizedField), {}, {
|
|
1673
1653
|
altId: "alt-".concat(yup.randomId()),
|
|
@@ -1679,7 +1659,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1679
1659
|
setValue([].concat(_toConsumableArray(nextFields), _toConsumableArray(deletedFields)));
|
|
1680
1660
|
} else {
|
|
1681
1661
|
var selectedFieldIndex = neetoCist.findIndexById(selectedFieldId, fields);
|
|
1682
|
-
setValue(ramda.assoc(selectedFieldIndex, _objectSpread$
|
|
1662
|
+
setValue(ramda.assoc(selectedFieldIndex, _objectSpread$6(_objectSpread$6({}, sanitizedField), {}, {
|
|
1683
1663
|
width: width.value,
|
|
1684
1664
|
fieldType: fieldType.value
|
|
1685
1665
|
}), [].concat(_toConsumableArray(fields), _toConsumableArray(deletedFields))));
|
|
@@ -1751,7 +1731,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1751
1731
|
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1752
1732
|
label: t("neetoForm.common.required"),
|
|
1753
1733
|
name: "isRequired",
|
|
1754
|
-
size: "
|
|
1734
|
+
size: "default"
|
|
1755
1735
|
})
|
|
1756
1736
|
})]
|
|
1757
1737
|
})
|
|
@@ -1901,21 +1881,21 @@ var Captcha = reactUtils.withT(function (_ref) {
|
|
|
1901
1881
|
});
|
|
1902
1882
|
});
|
|
1903
1883
|
|
|
1904
|
-
var _excluded$
|
|
1905
|
-
function ownKeys$
|
|
1906
|
-
function _objectSpread$
|
|
1884
|
+
var _excluded$2 = ["name", "title", "className"];
|
|
1885
|
+
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; }
|
|
1886
|
+
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; }
|
|
1907
1887
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
1908
1888
|
var name = _ref.name,
|
|
1909
1889
|
title = _ref.title,
|
|
1910
1890
|
_ref$className = _ref.className,
|
|
1911
1891
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
1912
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
1892
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
1913
1893
|
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Label, {
|
|
1914
1894
|
className: classnames("flex items-center justify-start gap-2 ", className),
|
|
1915
1895
|
"data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-toggle-label"),
|
|
1916
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, _objectSpread$
|
|
1917
|
-
size: "
|
|
1918
|
-
}, _objectSpread$
|
|
1896
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, _objectSpread$5(_objectSpread$5({
|
|
1897
|
+
size: "default"
|
|
1898
|
+
}, _objectSpread$5(_objectSpread$5({}, otherProps), {}, {
|
|
1919
1899
|
name: name
|
|
1920
1900
|
})), {}, {
|
|
1921
1901
|
"data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-switch")
|
|
@@ -1927,6 +1907,8 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1927
1907
|
});
|
|
1928
1908
|
};
|
|
1929
1909
|
|
|
1910
|
+
var VALID_DOMAIN_REGEX = /^(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z0-9-]{2,63}$/;
|
|
1911
|
+
var ERROR_MESSAGE_DELIMITER = ". ";
|
|
1930
1912
|
var DOMAIN_RESTRICTION_TRANSLATIONS = {
|
|
1931
1913
|
whitelistedDomains: {
|
|
1932
1914
|
title: i18next.t("neetoForm.domainRestriction.whitelistedDomains.label"),
|
|
@@ -1944,223 +1926,20 @@ var EMAIL_VERIFICATION_TRANSLATIONS = {
|
|
|
1944
1926
|
popoverDescription: i18next.t("neetoForm.emailVerification.popoverDescription")
|
|
1945
1927
|
};
|
|
1946
1928
|
|
|
1947
|
-
|
|
1948
|
-
function
|
|
1949
|
-
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; }
|
|
1950
|
-
var STYLES = {
|
|
1951
|
-
border: {
|
|
1952
|
-
"default": "1px solid var(--input)",
|
|
1953
|
-
error: "1px solid var(--error-solid) !important"
|
|
1954
|
-
},
|
|
1955
|
-
color: {
|
|
1956
|
-
"default": "var(--foreground)",
|
|
1957
|
-
error: "var(--error-foreground) !important"
|
|
1958
|
-
}
|
|
1959
|
-
};
|
|
1960
|
-
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1961
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1962
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "".concat(utils.hyphenize(props.data.label), "-remove-icon"))),
|
|
1963
|
-
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.X, {
|
|
1964
|
-
size: 16
|
|
1965
|
-
})
|
|
1966
|
-
}));
|
|
1967
|
-
};
|
|
1968
|
-
var ValueContainer = function ValueContainer(_ref) {
|
|
1969
|
-
var children = _ref.children,
|
|
1970
|
-
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1971
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
1972
|
-
t = _useTranslation.t;
|
|
1973
|
-
var getValue = props.getValue,
|
|
1974
|
-
_props$selectProps = props.selectProps,
|
|
1975
|
-
isFocused = _props$selectProps.isFocused,
|
|
1976
|
-
visibleDomainsCount = _props$selectProps.visibleDomainsCount;
|
|
1977
|
-
var value = getValue();
|
|
1978
|
-
var _children = _toArray(children),
|
|
1979
|
-
firstChild = _children[0],
|
|
1980
|
-
rest = _children.slice(1);
|
|
1981
|
-
var shouldCollapse = !isFocused && value.length > visibleDomainsCount;
|
|
1982
|
-
return /*#__PURE__*/jsxRuntime.jsxs(reactSelect.components.ValueContainer, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1983
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "multi-domain-input-container")),
|
|
1984
|
-
children: [shouldCollapse ? firstChild.slice(0, visibleDomainsCount) : firstChild, shouldCollapse && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
|
|
1985
|
-
variant: "secondary",
|
|
1986
|
-
label: t("neetoForm.common.remainingItemsCount", {
|
|
1987
|
-
count: value.length - visibleDomainsCount
|
|
1988
|
-
})
|
|
1989
|
-
}), rest]
|
|
1990
|
-
}));
|
|
1991
|
-
};
|
|
1992
|
-
var ClearIndicator = function ClearIndicator(props) {
|
|
1993
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1994
|
-
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "clear-all-button")),
|
|
1995
|
-
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.X, {
|
|
1996
|
-
className: "cursor-pointer",
|
|
1997
|
-
size: 16
|
|
1998
|
-
})
|
|
1999
|
-
}));
|
|
2000
|
-
};
|
|
2001
|
-
var ERROR_MESSAGE_DELIMITER = ". ";
|
|
2002
|
-
var DELIMITER_KEYS = ["Enter", "Tab", ",", " "];
|
|
2003
|
-
var DOMAIN_SEPARATION_REGEX = /[^\s,]+/g;
|
|
2004
|
-
var FLEXIBLE_DOMAIN_REGEX = /^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/;
|
|
2005
|
-
var VALID_DOMAIN_REGEX = /^(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z0-9-]{2,63}$/;
|
|
2006
|
-
var DOMAIN_VALIDATION_SCHEMA = yup__namespace.string().required(i18next.t("neetoForm.error.requiredField", {
|
|
2007
|
-
label: i18next.t("neetoForm.common.domain")
|
|
2008
|
-
})).test("verify domains", i18next.t("neetoForm.error.invalidDomain"), function (domain) {
|
|
2009
|
-
return VALID_DOMAIN_REGEX.test(domain);
|
|
2010
|
-
});
|
|
2011
|
-
var CUSTOM_STYLES = {
|
|
2012
|
-
input: ramda.assoc("overflow", "hidden"),
|
|
2013
|
-
multiValue: function multiValue(styles, _ref2) {
|
|
2014
|
-
var valid = _ref2.data.valid;
|
|
2015
|
-
return _objectSpread$6(_objectSpread$6({}, styles), {}, {
|
|
2016
|
-
border: valid ? STYLES.border["default"] : STYLES.border.error,
|
|
2017
|
-
color: valid ? STYLES.color["default"] : STYLES.color.error
|
|
2018
|
-
});
|
|
2019
|
-
}
|
|
2020
|
-
};
|
|
2021
|
-
var CUSTOM_COMPONENTS = {
|
|
2022
|
-
DropdownIndicator: null,
|
|
2023
|
-
MultiValueRemove: MultiValueRemove,
|
|
2024
|
-
ValueContainer: ValueContainer,
|
|
2025
|
-
ClearIndicator: ClearIndicator
|
|
2026
|
-
};
|
|
2027
|
-
|
|
2028
|
-
var removeDuplicateErrorMessages = ramda.pipe(ramda.filter(ramda.isNotNil), ramda.uniq, ramda.join(ERROR_MESSAGE_DELIMITER));
|
|
1929
|
+
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; }
|
|
1930
|
+
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; }
|
|
2029
1931
|
var formatDomainInputOptions = function formatDomainInputOptions(domain) {
|
|
2030
|
-
var isValid;
|
|
2031
|
-
try {
|
|
2032
|
-
DOMAIN_VALIDATION_SCHEMA.validateSync(domain);
|
|
2033
|
-
isValid = true;
|
|
2034
|
-
} catch (_unused) {
|
|
2035
|
-
isValid = false;
|
|
2036
|
-
}
|
|
2037
1932
|
return {
|
|
2038
1933
|
label: domain,
|
|
2039
1934
|
value: domain,
|
|
2040
|
-
valid:
|
|
1935
|
+
valid: VALID_DOMAIN_REGEX.test(domain)
|
|
2041
1936
|
};
|
|
2042
1937
|
};
|
|
2043
|
-
var pruneDuplicates = ramda.pipe(ramda.pluck("value"), ramda.uniq, ramda.map(formatDomainInputOptions));
|
|
2044
|
-
var getValidDomains = function getValidDomains(domains) {
|
|
2045
|
-
return domains.filter(function (domain) {
|
|
2046
|
-
return domain === null || domain === void 0 ? void 0 : domain.valid;
|
|
2047
|
-
});
|
|
2048
|
-
};
|
|
2049
|
-
var getValidDomainsCount = function getValidDomainsCount(domains) {
|
|
2050
|
-
return getValidDomains(domains).length;
|
|
2051
|
-
};
|
|
2052
1938
|
var formatErrorMessage = function formatErrorMessage(error) {
|
|
1939
|
+
if (!error) return "";
|
|
2053
1940
|
if (typeof error === "string") return error;
|
|
2054
|
-
return
|
|
2055
|
-
};
|
|
2056
|
-
|
|
2057
|
-
var _excluded$2 = ["label", "value", "onChange", "error", "onBlur"];
|
|
2058
|
-
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; }
|
|
2059
|
-
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; }
|
|
2060
|
-
var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
2061
|
-
var _ref$label = _ref.label,
|
|
2062
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
2063
|
-
_ref$value = _ref.value,
|
|
2064
|
-
value = _ref$value === void 0 ? [] : _ref$value,
|
|
2065
|
-
_ref$onChange = _ref.onChange,
|
|
2066
|
-
onChange = _ref$onChange === void 0 ? neetoCist.noop : _ref$onChange,
|
|
2067
|
-
_ref$error = _ref.error,
|
|
2068
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
2069
|
-
_ref$onBlur = _ref.onBlur,
|
|
2070
|
-
onBlur = _ref$onBlur === void 0 ? neetoCist.noop : _ref$onBlur,
|
|
2071
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
2072
|
-
var _useState = React.useState(""),
|
|
2073
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2074
|
-
inputValue = _useState2[0],
|
|
2075
|
-
setInputValue = _useState2[1];
|
|
2076
|
-
var _useState3 = React.useState(false),
|
|
2077
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
2078
|
-
isFocused = _useState4[0],
|
|
2079
|
-
setIsFocused = _useState4[1];
|
|
2080
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
2081
|
-
t = _useTranslation.t;
|
|
2082
|
-
var handleFilterDomains = function handleFilterDomains() {
|
|
2083
|
-
return onChange(getValidDomains(value));
|
|
2084
|
-
};
|
|
2085
|
-
var handleDomainChange = function handleDomainChange() {
|
|
2086
|
-
var inputValues = inputValue.match(DOMAIN_SEPARATION_REGEX) || [];
|
|
2087
|
-
var domainMatches = ramda.filter(ramda.test(FLEXIBLE_DOMAIN_REGEX), inputValues);
|
|
2088
|
-
var domains = domainMatches.map(formatDomainInputOptions);
|
|
2089
|
-
onChange(pruneDuplicates([].concat(_toConsumableArray(value), _toConsumableArray(domains))));
|
|
2090
|
-
setInputValue("");
|
|
2091
|
-
};
|
|
2092
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
2093
|
-
if (!inputValue) return;
|
|
2094
|
-
if (ramda.includes(event.key, DELIMITER_KEYS)) {
|
|
2095
|
-
handleDomainChange();
|
|
2096
|
-
event.preventDefault();
|
|
2097
|
-
event.stopPropagation();
|
|
2098
|
-
}
|
|
2099
|
-
};
|
|
2100
|
-
var onCreateOption = function onCreateOption(input) {
|
|
2101
|
-
var domain = formatDomainInputOptions(input);
|
|
2102
|
-
onChange(pruneDuplicates([].concat(_toConsumableArray(value), [domain])));
|
|
2103
|
-
};
|
|
2104
|
-
var handleBlur = function handleBlur(event) {
|
|
2105
|
-
inputValue ? handleDomainChange() : onBlur(event);
|
|
2106
|
-
setIsFocused(false);
|
|
2107
|
-
};
|
|
2108
|
-
var isFilterDomainsLinkVisible = value.length > getValidDomainsCount(value);
|
|
2109
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2110
|
-
className: "input__wrapper email-input__wrapper",
|
|
2111
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2112
|
-
className: "email-input__label-wrapper",
|
|
2113
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Label, {
|
|
2114
|
-
className: "email-input__label",
|
|
2115
|
-
"data-testid": "".concat(utils.hyphenize(label), "-input-label"),
|
|
2116
|
-
children: label
|
|
2117
|
-
})
|
|
2118
|
-
}), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect, _objectSpread$5({
|
|
2119
|
-
isMulti: true,
|
|
2120
|
-
required: true,
|
|
2121
|
-
classNamePrefix: "neeto-ui-react-select",
|
|
2122
|
-
components: CUSTOM_COMPONENTS,
|
|
2123
|
-
menuIsOpen: false,
|
|
2124
|
-
visibleDomainsCount: 3,
|
|
2125
|
-
className: classnames("react-select__container react-select__container--medium email-input__select", {
|
|
2126
|
-
"react-select__container--error": !!error
|
|
2127
|
-
}),
|
|
2128
|
-
styles: _objectSpread$5(_objectSpread$5({}, CUSTOM_STYLES), {}, {
|
|
2129
|
-
control: ramda.mergeLeft({
|
|
2130
|
-
maxHeight: "200px",
|
|
2131
|
-
overflowY: "auto"
|
|
2132
|
-
})
|
|
2133
|
-
}),
|
|
2134
|
-
onBlur: handleBlur,
|
|
2135
|
-
onFocus: function onFocus() {
|
|
2136
|
-
return setIsFocused(true);
|
|
2137
|
-
},
|
|
2138
|
-
onInputChange: setInputValue,
|
|
2139
|
-
onKeyDown: handleKeyDown
|
|
2140
|
-
}, _objectSpread$5({
|
|
2141
|
-
inputValue: inputValue,
|
|
2142
|
-
isFocused: isFocused,
|
|
2143
|
-
onChange: onChange,
|
|
2144
|
-
onCreateOption: onCreateOption,
|
|
2145
|
-
value: value
|
|
2146
|
-
}, otherProps))), !!error && /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
2147
|
-
className: "input__error",
|
|
2148
|
-
"data-testid": "".concat(utils.hyphenize(label), "-input-error"),
|
|
2149
|
-
children: [formatErrorMessage(error), isFilterDomainsLinkVisible && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2150
|
-
className: "font-semibold cursor-pointer",
|
|
2151
|
-
onClick: handleFilterDomains,
|
|
2152
|
-
children: [ERROR_MESSAGE_DELIMITER, t("neetoForm.domainRestriction.removeInvalidDomains")]
|
|
2153
|
-
})]
|
|
2154
|
-
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
2155
|
-
className: "input__help-text",
|
|
2156
|
-
"data-testid": "".concat(utils.hyphenize(label), "-input-help"),
|
|
2157
|
-
children: t("neetoForm.domainRestriction.helpText")
|
|
2158
|
-
})]
|
|
2159
|
-
});
|
|
1941
|
+
return ramda.pipe(ramda.filter(ramda.isNotNil), ramda.uniq, ramda.join(ERROR_MESSAGE_DELIMITER))(error);
|
|
2160
1942
|
};
|
|
2161
|
-
|
|
2162
|
-
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; }
|
|
2163
|
-
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; }
|
|
2164
1943
|
var validateDomains = function validateDomains(value) {
|
|
2165
1944
|
var schema = yup__namespace.array().of(yup__namespace.string().test("verify domains", i18next.t("neetoForm.error.invalidDomain"), function (domain) {
|
|
2166
1945
|
return VALID_DOMAIN_REGEX.test(domain);
|
|
@@ -2231,12 +2010,16 @@ var EmailDomains = function EmailDomains(_ref) {
|
|
|
2231
2010
|
var formattedDomains = ramda.map(formatDomainInputOptions, domains);
|
|
2232
2011
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2233
2012
|
className: "mb-4",
|
|
2234
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
2013
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.MultiEmailInput, {
|
|
2235
2014
|
label: label,
|
|
2236
|
-
|
|
2237
|
-
error: meta.touched ? meta.error : "",
|
|
2015
|
+
entryType: "domain",
|
|
2016
|
+
error: meta.touched ? formatErrorMessage(meta.error) : "",
|
|
2017
|
+
helpText: t("neetoForm.domainRestriction.helpText"),
|
|
2238
2018
|
placeholder: t("neetoForm.domainRestriction.placeholder"),
|
|
2239
2019
|
value: formattedDomains,
|
|
2020
|
+
filterInvalidEmails: {
|
|
2021
|
+
label: t("neetoForm.domainRestriction.removeInvalidDomains")
|
|
2022
|
+
},
|
|
2240
2023
|
onBlur: function onBlur() {
|
|
2241
2024
|
return setTouched(true);
|
|
2242
2025
|
},
|
|
@@ -2287,7 +2070,7 @@ var VerifyEmails = function VerifyEmails() {
|
|
|
2287
2070
|
label: title,
|
|
2288
2071
|
labelProps: buildHelpPopoverLabelProps(popoverDescription, helpLink),
|
|
2289
2072
|
name: "isVerificationEnabled",
|
|
2290
|
-
size: "
|
|
2073
|
+
size: "default"
|
|
2291
2074
|
})
|
|
2292
2075
|
});
|
|
2293
2076
|
};
|
|
@@ -2301,7 +2084,7 @@ var Email = function Email(_ref) {
|
|
|
2301
2084
|
_useFormikContext$val3 = _useFormikContext$val.isDomainBlacklistingEnabled,
|
|
2302
2085
|
isDomainBlacklistingEnabled = _useFormikContext$val3 === void 0 ? false : _useFormikContext$val3;
|
|
2303
2086
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2304
|
-
className: "flex flex-col space-y-
|
|
2087
|
+
className: "flex flex-col space-y-6",
|
|
2305
2088
|
children: !usesCustomSubmissionComponent && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2306
2089
|
children: [/*#__PURE__*/jsxRuntime.jsx(RestrictDomainsBlock, {
|
|
2307
2090
|
domainName: "whitelistedDomains",
|
|
@@ -2432,7 +2215,7 @@ var OpinionScale = function OpinionScale() {
|
|
|
2432
2215
|
"data-testid": "neeto-form-engine-opinion-scale-show-labels-switch",
|
|
2433
2216
|
label: t("neetoForm.questions.opinionScale.showLabels"),
|
|
2434
2217
|
name: "hasOpinionLabels",
|
|
2435
|
-
size: "
|
|
2218
|
+
size: "default"
|
|
2436
2219
|
}), hasOpinionLabels && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2437
2220
|
className: "flex space-x-4",
|
|
2438
2221
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
|
|
@@ -2532,12 +2315,12 @@ var Options = function Options(_ref) {
|
|
|
2532
2315
|
className: "space-y-4",
|
|
2533
2316
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2534
2317
|
name: "isPictureChoice",
|
|
2535
|
-
size: "
|
|
2318
|
+
size: "default",
|
|
2536
2319
|
label: t("neetoForm.questions.common.questionFields.field.addPicturesToOptions")
|
|
2537
2320
|
}), isPictureChoice && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2538
2321
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2539
2322
|
name: "shouldFitImages",
|
|
2540
|
-
size: "
|
|
2323
|
+
size: "default",
|
|
2541
2324
|
label: t("neetoForm.questions.common.questionFields.field.fitImages"),
|
|
2542
2325
|
labelProps: {
|
|
2543
2326
|
helpIconProps: {
|
|
@@ -2886,6 +2669,7 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
2886
2669
|
initialFocusRef: initialFocusRef,
|
|
2887
2670
|
isOpen: isOpen,
|
|
2888
2671
|
onClose: onClose,
|
|
2672
|
+
size: "large",
|
|
2889
2673
|
children: /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$1({}, _objectSpread$1({
|
|
2890
2674
|
availableQuestionKinds: availableQuestionKinds,
|
|
2891
2675
|
initialFocusRef: initialFocusRef,
|
|
@@ -3038,6 +2822,15 @@ var Form = function Form(_ref) {
|
|
|
3038
2822
|
setSelectedAction(yup.QUESTION_ACTIONS.EDIT);
|
|
3039
2823
|
setIsManageQuestionPaneOpen(true);
|
|
3040
2824
|
};
|
|
2825
|
+
|
|
2826
|
+
// The embeddable builder has no inline properties panel, so a bare card click
|
|
2827
|
+
// would only highlight the question. Open the edit pane on click so the
|
|
2828
|
+
// interaction has a purpose (drag still reorders — @hello-pangea/dnd
|
|
2829
|
+
// separates click from drag). Falls back to select-only when questions are
|
|
2830
|
+
// not manageable, so read-only consumers are unaffected.
|
|
2831
|
+
var handleQuestionClick = function handleQuestionClick(question) {
|
|
2832
|
+
return canManageQuestions ? handleEdit(question) : handleSelect(question);
|
|
2833
|
+
};
|
|
3041
2834
|
var handleClone = function handleClone(question) {
|
|
3042
2835
|
var values = duplicateFieldData({
|
|
3043
2836
|
item: question,
|
|
@@ -3142,7 +2935,7 @@ var Form = function Form(_ref) {
|
|
|
3142
2935
|
onClone: handleClone,
|
|
3143
2936
|
onDelete: handleDelete,
|
|
3144
2937
|
onEdit: handleEdit,
|
|
3145
|
-
onSelect:
|
|
2938
|
+
onSelect: handleQuestionClick
|
|
3146
2939
|
})
|
|
3147
2940
|
}), canManageQuestions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3148
2941
|
className: "mb-8 flex w-full items-center gap-x-1",
|