@bigbinary/neeto-form-frontend 4.4.36 → 4.4.37
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 +104 -130
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +15 -41
- package/dist/cjs/v2/ExternalForm.js.map +1 -1
- package/dist/cjs/v2/Submission.js +4 -3
- package/dist/cjs/v2/Submission.js.map +1 -1
- package/dist/cjs/v2/UrlBuilder.js +5 -32
- package/dist/cjs/v2/UrlBuilder.js.map +1 -1
- package/dist/cjs/v2/index.js +26 -56
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/cjs/v2/{utils-DO12kVcq.js → utils-DHGS4O20.js} +9 -14
- package/dist/cjs/v2/utils-DHGS4O20.js.map +1 -0
- package/dist/cjs/v2/{yup-DH3aFnam.js → yup-B-A1W_Vi.js} +26 -48
- package/dist/cjs/v2/yup-B-A1W_Vi.js.map +1 -0
- package/dist/v2/BuildForm.js +104 -130
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +14 -40
- package/dist/v2/ExternalForm.js.map +1 -1
- package/dist/v2/Submission.js +4 -3
- package/dist/v2/Submission.js.map +1 -1
- package/dist/v2/UrlBuilder.js +5 -32
- package/dist/v2/UrlBuilder.js.map +1 -1
- package/dist/v2/index.js +21 -51
- 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-CW12NXEG.js → utils-CemGJeLy.js} +6 -11
- package/dist/v2/utils-CemGJeLy.js.map +1 -0
- package/dist/v2/{yup-Cddsv0mm.js → yup-eUr74YY2.js} +21 -43
- package/dist/v2/yup-eUr74YY2.js.map +1 -0
- package/package.json +5 -3
- package/dist/cjs/v2/utils-DO12kVcq.js.map +0 -1
- package/dist/cjs/v2/yup-DH3aFnam.js.map +0 -1
- package/dist/v2/utils-CW12NXEG.js.map +0 -1
- package/dist/v2/yup-Cddsv0mm.js.map +0 -1
package/dist/v2/BuildForm.js
CHANGED
|
@@ -4,7 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, findById, findIndexById, hyphenate, noop, nullSafe, modifyBy, removeBy } from '@bigbinary/neeto-cist';
|
|
5
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, test, 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 { n as QUESTION_ACTIONS, o as INDEPENDENT_LABELS_MAP, q as buildDisplayLabel, r as isElementOverflowing, 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, Y as randomId, Z as getActiveRecords, _ as FILE_TYPES_MAP, $ as FILE_GROUPS, a0 as OPINION_SCALE_MIN_VALUE_OPTIONS, a1 as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, a2 as MINIMUM_OPTIONS, a3 as IMAGE_HEIGHT_SLIDER_DEFAULTS, a4 as RATING_OPTIONS, a5 as STAR_RATING_MIN_VALUE_OPTIONS, a6 as STAR_RATING_MAX_VALUE_OPTIONS, a7 as STAR_RATING_ICONS_MAP, a8 as buildDisabledAddButtonHelpPopoverProps, a9 as buildReorderPayload, aa as QUESTIONS_INITIAL_VALUE, ab as isMandatoryField, ac as QUESTION_KINDS, Q as QUESTION_KIND, ad as getActiveQuestionKindDetails, ae as DEFAULT_AVAILABLE_LANGUAGES, af as DEFAULT_ADVANCED_FEATURES } from './yup-
|
|
7
|
+
import { n as QUESTION_ACTIONS, o as INDEPENDENT_LABELS_MAP, q as buildDisplayLabel, r as isElementOverflowing, 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, Y as randomId, Z as getActiveRecords, _ as FILE_TYPES_MAP, $ as FILE_GROUPS, a0 as OPINION_SCALE_MIN_VALUE_OPTIONS, a1 as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, a2 as MINIMUM_OPTIONS, a3 as IMAGE_HEIGHT_SLIDER_DEFAULTS, a4 as RATING_OPTIONS, a5 as STAR_RATING_MIN_VALUE_OPTIONS, a6 as STAR_RATING_MAX_VALUE_OPTIONS, a7 as STAR_RATING_ICONS_MAP, a8 as buildDisabledAddButtonHelpPopoverProps, a9 as buildReorderPayload, aa as QUESTIONS_INITIAL_VALUE, ab as isMandatoryField, ac as QUESTION_KINDS, Q as QUESTION_KIND, ad as getActiveQuestionKindDetails, ae as DEFAULT_AVAILABLE_LANGUAGES, af as DEFAULT_ADVANCED_FEATURES } from './yup-eUr74YY2.js';
|
|
8
8
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
9
|
import { useState, useRef, useEffect, createElement } from 'react';
|
|
10
10
|
import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
|
|
@@ -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
|
|
20
|
+
import { GripVertical, ListTodo, X } 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';
|
|
@@ -31,7 +31,6 @@ import OptionFields from '@bigbinary/neeto-molecules/v2/OptionFields';
|
|
|
31
31
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
32
32
|
import CreatableSelect from 'react-select/creatable';
|
|
33
33
|
import _toArray from '@babel/runtime/helpers/toArray';
|
|
34
|
-
import Close from '@bigbinary/neeto-icons/Close';
|
|
35
34
|
import { components } from 'react-select';
|
|
36
35
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
37
36
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
@@ -40,31 +39,8 @@ import '@bigbinary/neeto-commons-frontend/constants';
|
|
|
40
39
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
41
40
|
import 'axios';
|
|
42
41
|
import '@bigbinary/neeto-commons-frontend/utils';
|
|
43
|
-
import '@bigbinary/neeto-icons/Address';
|
|
44
|
-
import '@bigbinary/neeto-icons/Calendar';
|
|
45
|
-
import '@bigbinary/neeto-icons/Captcha';
|
|
46
|
-
import '@bigbinary/neeto-icons/Checkbox';
|
|
47
|
-
import '@bigbinary/neeto-icons/DropdownClosed';
|
|
48
|
-
import '@bigbinary/neeto-icons/Email';
|
|
49
|
-
import '@bigbinary/neeto-icons/FileUpload';
|
|
50
|
-
import '@bigbinary/neeto-icons/Group';
|
|
51
|
-
import '@bigbinary/neeto-icons/Hash';
|
|
52
|
-
import '@bigbinary/neeto-icons/Header';
|
|
53
|
-
import '@bigbinary/neeto-icons/Location';
|
|
54
|
-
import '@bigbinary/neeto-icons/LongText';
|
|
55
|
-
import '@bigbinary/neeto-icons/MessageSquare';
|
|
56
|
-
import '@bigbinary/neeto-icons/NeetoInvisible';
|
|
57
|
-
import '@bigbinary/neeto-icons/PhoneRing';
|
|
58
|
-
import '@bigbinary/neeto-icons/Radio';
|
|
59
|
-
import '@bigbinary/neeto-icons/Rating';
|
|
60
|
-
import '@bigbinary/neeto-icons/Scale';
|
|
61
|
-
import '@bigbinary/neeto-icons/Sms';
|
|
62
|
-
import '@bigbinary/neeto-icons/Terms';
|
|
63
|
-
import '@bigbinary/neeto-icons/TextLines';
|
|
64
|
-
import '@bigbinary/neeto-icons/UserRoundedRect';
|
|
65
42
|
import 'dompurify';
|
|
66
43
|
import '@babel/runtime/helpers/typeof';
|
|
67
|
-
import '@bigbinary/neeto-icons/Plus';
|
|
68
44
|
import 'zustand';
|
|
69
45
|
import './index-CUrkh_zd.js';
|
|
70
46
|
import '@bigbinary/neeto-editor/utils';
|
|
@@ -149,15 +125,12 @@ var DeleteSmsReminderModal = function DeleteSmsReminderModal(_ref) {
|
|
|
149
125
|
onClose: onClose,
|
|
150
126
|
children: [/*#__PURE__*/jsx(Dialog.Header, {
|
|
151
127
|
children: /*#__PURE__*/jsx(Dialog.Title, {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
variant: "h2",
|
|
155
|
-
weight: "medium",
|
|
156
|
-
children: path(["smsReminder", "deleteModal", "title"], hostSpecificData)
|
|
157
|
-
})
|
|
128
|
+
"data-testid": "delete-sms-reminder-modal-header",
|
|
129
|
+
children: path(["smsReminder", "deleteModal", "title"], hostSpecificData)
|
|
158
130
|
})
|
|
159
131
|
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
160
132
|
children: /*#__PURE__*/jsx(Typography, {
|
|
133
|
+
color: "muted",
|
|
161
134
|
"data-testid": "delete-sms-reminder-modal-description",
|
|
162
135
|
variant: "body2",
|
|
163
136
|
children: path(["smsReminder", "deleteModal", "description"], hostSpecificData)
|
|
@@ -183,6 +156,7 @@ var DeleteSpotModal = function DeleteSpotModal(_ref) {
|
|
|
183
156
|
})
|
|
184
157
|
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
185
158
|
children: /*#__PURE__*/jsx(Typography, {
|
|
159
|
+
color: "muted",
|
|
186
160
|
"data-testid": "delete-spot-modal-description",
|
|
187
161
|
variant: "body2",
|
|
188
162
|
children: description
|
|
@@ -218,6 +192,9 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
218
192
|
variant: "outline"
|
|
219
193
|
},
|
|
220
194
|
disabled: isReorderingQuestions,
|
|
195
|
+
dropdownProps: {
|
|
196
|
+
className: "w-max"
|
|
197
|
+
},
|
|
221
198
|
label: selectedLanguageName,
|
|
222
199
|
children: /*#__PURE__*/jsx(DropdownMenu.Menu, {
|
|
223
200
|
children: availableLanguages.map(function (_ref2) {
|
|
@@ -248,9 +225,7 @@ var Overview = function Overview(_ref) {
|
|
|
248
225
|
className: "flex items-center justify-between",
|
|
249
226
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
250
227
|
"data-testid": "neeto-form-engine-overview-title",
|
|
251
|
-
|
|
252
|
-
variant: "h2",
|
|
253
|
-
weight: "semibold",
|
|
228
|
+
variant: "h4",
|
|
254
229
|
children: title
|
|
255
230
|
}), /*#__PURE__*/jsxs("div", {
|
|
256
231
|
className: "flex shrink-0 items-center justify-between space-x-1",
|
|
@@ -262,13 +237,14 @@ var Overview = function Overview(_ref) {
|
|
|
262
237
|
variant: "outline"
|
|
263
238
|
},
|
|
264
239
|
dropdownProps: {
|
|
265
|
-
|
|
240
|
+
className: "w-max",
|
|
266
241
|
position: "bottom-start"
|
|
267
242
|
},
|
|
268
243
|
menuItems: additionalActionOptions
|
|
269
244
|
})]
|
|
270
245
|
})]
|
|
271
246
|
}), /*#__PURE__*/jsx(Typography, {
|
|
247
|
+
color: "muted",
|
|
272
248
|
"data-testid": "neeto-form-engine-overview-description",
|
|
273
249
|
variant: "body2",
|
|
274
250
|
children: description
|
|
@@ -310,8 +286,8 @@ var Card = function Card(_ref) {
|
|
|
310
286
|
}, [questionLabel]);
|
|
311
287
|
return /*#__PURE__*/jsxs("div", {
|
|
312
288
|
"data-testid": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
313
|
-
className: classnames("
|
|
314
|
-
"border-primary
|
|
289
|
+
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", {
|
|
290
|
+
"border-primary neeto-form-nano-form__card--active": isActive
|
|
315
291
|
}),
|
|
316
292
|
onClick: function onClick() {
|
|
317
293
|
return onSelect(question);
|
|
@@ -319,7 +295,7 @@ var Card = function Card(_ref) {
|
|
|
319
295
|
children: [/*#__PURE__*/jsxs("div", {
|
|
320
296
|
className: "flex min-w-0 grow items-center gap-2",
|
|
321
297
|
children: [KindIcon && /*#__PURE__*/jsx(KindIcon, {
|
|
322
|
-
className: "
|
|
298
|
+
className: "text-muted-foreground shrink-0",
|
|
323
299
|
"data-testid": "question-card-kind-icon",
|
|
324
300
|
size: 16
|
|
325
301
|
}), /*#__PURE__*/jsx(Tooltip, {
|
|
@@ -329,7 +305,6 @@ var Card = function Card(_ref) {
|
|
|
329
305
|
children: /*#__PURE__*/jsx(Typography, {
|
|
330
306
|
className: "min-w-0 grow truncate",
|
|
331
307
|
"data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
|
|
332
|
-
lineHeight: "snug",
|
|
333
308
|
ref: questionLabelRef,
|
|
334
309
|
variant: "body2",
|
|
335
310
|
weight: "medium",
|
|
@@ -341,7 +316,7 @@ var Card = function Card(_ref) {
|
|
|
341
316
|
className: "shrink-0"
|
|
342
317
|
},
|
|
343
318
|
dropdownProps: {
|
|
344
|
-
|
|
319
|
+
className: "w-max"
|
|
345
320
|
},
|
|
346
321
|
menuItems: [{
|
|
347
322
|
"data-testid": "edit-question",
|
|
@@ -411,9 +386,9 @@ var Questions = function Questions(_ref) {
|
|
|
411
386
|
className: "flex items-center gap-1",
|
|
412
387
|
ref: innerRef,
|
|
413
388
|
children: [canManageQuestions && /*#__PURE__*/jsx("span", _objectSpread$j(_objectSpread$j({}, dragHandleProps), {}, {
|
|
414
|
-
className: "
|
|
389
|
+
className: "text-muted-foreground hover:text-foreground shrink-0 cursor-grab transition-all duration-300 ease-in-out",
|
|
415
390
|
"data-testid": "question-card-drag-handle",
|
|
416
|
-
children: /*#__PURE__*/jsx(
|
|
391
|
+
children: /*#__PURE__*/jsx(GripVertical, {
|
|
417
392
|
size: 16
|
|
418
393
|
})
|
|
419
394
|
})), /*#__PURE__*/jsx("div", {
|
|
@@ -654,6 +629,7 @@ var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
|
654
629
|
helpText: isPresent(href) ? /*#__PURE__*/jsx(HelpText, {
|
|
655
630
|
href: href
|
|
656
631
|
}) : null,
|
|
632
|
+
icon: ListTodo,
|
|
657
633
|
primaryButtonProps: buildAddQuestionButtonProps(onAdd, isDisabled),
|
|
658
634
|
title: t("neetoForm.questions.common.noData")
|
|
659
635
|
})
|
|
@@ -712,7 +688,7 @@ var KindOption = function KindOption(_ref) {
|
|
|
712
688
|
return /*#__PURE__*/jsxs("div", {
|
|
713
689
|
className: "flex items-start gap-2",
|
|
714
690
|
children: [Icon && /*#__PURE__*/jsx(Icon, {
|
|
715
|
-
className: "
|
|
691
|
+
className: "text-foreground mt-0.5 shrink-0",
|
|
716
692
|
"data-testid": "kind-option-icon",
|
|
717
693
|
size: 16
|
|
718
694
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -721,7 +697,8 @@ var KindOption = function KindOption(_ref) {
|
|
|
721
697
|
variant: "body2",
|
|
722
698
|
children: label
|
|
723
699
|
}), description && /*#__PURE__*/jsx(Typography, {
|
|
724
|
-
className: "
|
|
700
|
+
className: "mt-0.5",
|
|
701
|
+
color: "muted",
|
|
725
702
|
"data-testid": "kind-option-description",
|
|
726
703
|
variant: "body3",
|
|
727
704
|
children: description
|
|
@@ -814,7 +791,8 @@ var Name = function Name(_ref) {
|
|
|
814
791
|
className: "space-y-4",
|
|
815
792
|
children: [!usesCustomSubmissionComponent && /*#__PURE__*/jsx(Switch, {
|
|
816
793
|
label: t("neetoForm.common.splitAsFirstAndLastNames"),
|
|
817
|
-
name: "isSplitMode"
|
|
794
|
+
name: "isSplitMode",
|
|
795
|
+
size: "lg"
|
|
818
796
|
}), isSplitMode && !usesCustomSubmissionComponent ? /*#__PURE__*/jsxs(Fragment, {
|
|
819
797
|
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$f(_objectSpread$f({}, commonProps), {}, {
|
|
820
798
|
handleLabelChange: function handleLabelChange(value) {
|
|
@@ -980,7 +958,8 @@ var RequiredSwitch = withT(function (_ref) {
|
|
|
980
958
|
className: "w-full",
|
|
981
959
|
children: /*#__PURE__*/jsx(Switch, {
|
|
982
960
|
label: t("neetoForm.common.required"),
|
|
983
|
-
name: "isRequired"
|
|
961
|
+
name: "isRequired",
|
|
962
|
+
size: "lg"
|
|
984
963
|
})
|
|
985
964
|
});
|
|
986
965
|
});
|
|
@@ -1050,6 +1029,7 @@ var Textarea = function Textarea() {
|
|
|
1050
1029
|
checked: isMinWordsEnabled,
|
|
1051
1030
|
label: t("neetoForm.questions.textarea.minimumWords"),
|
|
1052
1031
|
labelProps: MIN_WORDS_SWITCH_LABEL_PROPS,
|
|
1032
|
+
size: "lg",
|
|
1053
1033
|
onCheckedChange: handleToggleChange
|
|
1054
1034
|
}), isMinWordsEnabled && /*#__PURE__*/jsx(Input, {
|
|
1055
1035
|
className: "w-42 ms-14",
|
|
@@ -1227,20 +1207,24 @@ var Form$1 = function Form(_ref) {
|
|
|
1227
1207
|
children: [shouldShowRequiredSwitch && /*#__PURE__*/jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsx(Switch, {
|
|
1228
1208
|
label: t("neetoForm.common.hideQuestion"),
|
|
1229
1209
|
name: "isHidden",
|
|
1210
|
+
size: "lg",
|
|
1230
1211
|
labelProps: hideSwitchLabelProps(hideQuestionHelpDocUrl)
|
|
1231
1212
|
}), canRestrictResponseVisibilityToHost && /*#__PURE__*/jsx(Switch, {
|
|
1232
1213
|
label: t("neetoForm.common.responseVisibleOnlyToHost"),
|
|
1233
1214
|
name: "isResponseVisibleOnlyToHost",
|
|
1215
|
+
size: "lg",
|
|
1234
1216
|
labelProps: responseVisibleOnlyToHostSwitchLabelProps(responseVisibleOnlyToHostHelpDocUrl)
|
|
1235
1217
|
})]
|
|
1236
1218
|
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsx(Switch, {
|
|
1237
1219
|
label: t("neetoForm.common.readOnly"),
|
|
1238
1220
|
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1239
|
-
name: "isReadOnly"
|
|
1221
|
+
name: "isReadOnly",
|
|
1222
|
+
size: "lg"
|
|
1240
1223
|
}), shouldShowSendSmsUpdatesSwitch && /*#__PURE__*/jsx(Switch, {
|
|
1241
1224
|
disabled: isSmsUpdatesDisabled,
|
|
1242
1225
|
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1243
1226
|
name: "sendSmsUpdates",
|
|
1227
|
+
size: "lg",
|
|
1244
1228
|
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1245
1229
|
}), isTextarea && enforceMinWordsInMultiLineTexts && /*#__PURE__*/jsx(Textarea, {})]
|
|
1246
1230
|
}), shouldShowFieldCode && /*#__PURE__*/jsx(Accordion, {
|
|
@@ -1398,30 +1382,27 @@ var Add = function Add(_ref) {
|
|
|
1398
1382
|
}
|
|
1399
1383
|
});
|
|
1400
1384
|
};
|
|
1401
|
-
return /*#__PURE__*/jsxs(
|
|
1385
|
+
return /*#__PURE__*/jsxs(Form$2, {
|
|
1386
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1387
|
+
formikProps: {
|
|
1388
|
+
initialValues: INITIAL_VALUES,
|
|
1389
|
+
validationSchema: formValidationSchema(INITIAL_VALUES, isFieldCodeEnabled),
|
|
1390
|
+
onSubmit: handleSubmit
|
|
1391
|
+
},
|
|
1402
1392
|
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
1403
1393
|
children: /*#__PURE__*/jsx(Sheet.Title, {
|
|
1404
1394
|
"data-testid": "add-question-pane-header",
|
|
1405
1395
|
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
1406
1396
|
})
|
|
1407
|
-
}), /*#__PURE__*/jsx(Form$
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
questions: questions
|
|
1417
|
-
}))), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
1418
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1419
|
-
cancelButtonProps: {
|
|
1420
|
-
onClick: onClose
|
|
1421
|
-
},
|
|
1422
|
-
isSubmitting: isCreating
|
|
1423
|
-
})
|
|
1424
|
-
})]
|
|
1397
|
+
}), /*#__PURE__*/jsx(Form$1, _objectSpread$c({}, _objectSpread$c(_objectSpread$c({}, props), {}, {
|
|
1398
|
+
question: question,
|
|
1399
|
+
questions: questions
|
|
1400
|
+
}))), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
1401
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1402
|
+
cancelButtonProps: {
|
|
1403
|
+
onClick: onClose
|
|
1404
|
+
},
|
|
1405
|
+
isSubmitting: isCreating
|
|
1425
1406
|
})
|
|
1426
1407
|
})]
|
|
1427
1408
|
});
|
|
@@ -1474,42 +1455,33 @@ var Edit = function Edit(_ref) {
|
|
|
1474
1455
|
}
|
|
1475
1456
|
});
|
|
1476
1457
|
};
|
|
1477
|
-
return /*#__PURE__*/jsxs(
|
|
1458
|
+
return /*#__PURE__*/jsxs(Form$2, {
|
|
1459
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1460
|
+
formikProps: {
|
|
1461
|
+
// Sheet keeps children mounted, so this renders once before a
|
|
1462
|
+
// question is selected; without this those empty values stick.
|
|
1463
|
+
enableReinitialize: true,
|
|
1464
|
+
initialValues: _objectSpread$b(_objectSpread$b({}, question), {}, {
|
|
1465
|
+
isMinWordsEnabled: isPresent(question.minWords)
|
|
1466
|
+
}),
|
|
1467
|
+
validationSchema: formValidationSchema(question, isFieldCodeEnabled),
|
|
1468
|
+
onSubmit: handleSubmit
|
|
1469
|
+
},
|
|
1478
1470
|
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
1479
1471
|
children: /*#__PURE__*/jsx(Sheet.Title, {
|
|
1480
|
-
|
|
1481
|
-
children:
|
|
1482
|
-
"data-testid": "edit-question-pane-header",
|
|
1483
|
-
variant: "h2",
|
|
1484
|
-
children: t("neetoForm.questions.common.editQuestion")
|
|
1485
|
-
})
|
|
1472
|
+
"data-testid": "edit-question-pane-header",
|
|
1473
|
+
children: t("neetoForm.questions.common.editQuestion")
|
|
1486
1474
|
})
|
|
1487
|
-
}), /*#__PURE__*/jsx(Form$
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
},
|
|
1498
|
-
children: /*#__PURE__*/jsxs(Fragment, {
|
|
1499
|
-
children: [/*#__PURE__*/jsx(Sheet.Body, {
|
|
1500
|
-
children: /*#__PURE__*/jsx(Form$1, _objectSpread$b(_objectSpread$b({}, _objectSpread$b({
|
|
1501
|
-
question: question
|
|
1502
|
-
}, props)), {}, {
|
|
1503
|
-
isEdit: true
|
|
1504
|
-
}))
|
|
1505
|
-
}), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
1506
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1507
|
-
cancelButtonProps: {
|
|
1508
|
-
onClick: onClose
|
|
1509
|
-
},
|
|
1510
|
-
isSubmitting: isUpdating
|
|
1511
|
-
})
|
|
1512
|
-
})]
|
|
1475
|
+
}), /*#__PURE__*/jsx(Form$1, _objectSpread$b(_objectSpread$b({}, _objectSpread$b({
|
|
1476
|
+
question: question
|
|
1477
|
+
}, props)), {}, {
|
|
1478
|
+
isEdit: true
|
|
1479
|
+
})), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
1480
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1481
|
+
cancelButtonProps: {
|
|
1482
|
+
onClick: onClose
|
|
1483
|
+
},
|
|
1484
|
+
isSubmitting: isUpdating
|
|
1513
1485
|
})
|
|
1514
1486
|
})]
|
|
1515
1487
|
});
|
|
@@ -1526,8 +1498,7 @@ var Block = function Block(_ref) {
|
|
|
1526
1498
|
className: "flex items-center justify-between",
|
|
1527
1499
|
"data-testid": "properties-header",
|
|
1528
1500
|
children: /*#__PURE__*/jsx(Typography, {
|
|
1529
|
-
variant: "
|
|
1530
|
-
weight: "semibold",
|
|
1501
|
+
variant: "h6",
|
|
1531
1502
|
children: title
|
|
1532
1503
|
})
|
|
1533
1504
|
}), /*#__PURE__*/jsx("div", {
|
|
@@ -1702,20 +1673,12 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1702
1673
|
}
|
|
1703
1674
|
};
|
|
1704
1675
|
};
|
|
1705
|
-
return /*#__PURE__*/
|
|
1676
|
+
return /*#__PURE__*/jsx(Sheet, {
|
|
1706
1677
|
initialFocusRef: initialFocusRef,
|
|
1707
1678
|
isOpen: isOpen,
|
|
1708
1679
|
onClose: onClose,
|
|
1709
|
-
children:
|
|
1710
|
-
|
|
1711
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
1712
|
-
"data-testid": "add-address-field-title",
|
|
1713
|
-
variant: "h2",
|
|
1714
|
-
weight: "semibold",
|
|
1715
|
-
children: title
|
|
1716
|
-
})
|
|
1717
|
-
})
|
|
1718
|
-
}), /*#__PURE__*/jsx(Form$2, {
|
|
1680
|
+
children: /*#__PURE__*/jsx(Form$2, {
|
|
1681
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1719
1682
|
formikProps: {
|
|
1720
1683
|
initialValues: initialValues,
|
|
1721
1684
|
validationSchema: ADDRESS_FIELD_FORM_VALIDATION_SCHEMA,
|
|
@@ -1726,7 +1689,12 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1726
1689
|
var values = _ref3.values,
|
|
1727
1690
|
setFieldValue = _ref3.setFieldValue;
|
|
1728
1691
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1729
|
-
children: [/*#__PURE__*/jsx(Sheet.
|
|
1692
|
+
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
1693
|
+
children: /*#__PURE__*/jsx(Sheet.Title, {
|
|
1694
|
+
"data-testid": "add-address-field-title",
|
|
1695
|
+
children: title
|
|
1696
|
+
})
|
|
1697
|
+
}), /*#__PURE__*/jsx(Sheet.Body, {
|
|
1730
1698
|
children: /*#__PURE__*/jsxs("div", {
|
|
1731
1699
|
className: "w-full space-y-6",
|
|
1732
1700
|
children: [/*#__PURE__*/jsx(Input, {
|
|
@@ -1760,7 +1728,8 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1760
1728
|
className: "flex items-center gap-4",
|
|
1761
1729
|
children: /*#__PURE__*/jsx(Switch, {
|
|
1762
1730
|
label: t("neetoForm.common.required"),
|
|
1763
|
-
name: "isRequired"
|
|
1731
|
+
name: "isRequired",
|
|
1732
|
+
size: "lg"
|
|
1764
1733
|
})
|
|
1765
1734
|
})]
|
|
1766
1735
|
})
|
|
@@ -1782,7 +1751,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1782
1751
|
})]
|
|
1783
1752
|
});
|
|
1784
1753
|
}
|
|
1785
|
-
})
|
|
1754
|
+
})
|
|
1786
1755
|
});
|
|
1787
1756
|
};
|
|
1788
1757
|
|
|
@@ -1922,7 +1891,9 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1922
1891
|
return /*#__PURE__*/jsxs(Label, {
|
|
1923
1892
|
className: classnames("flex items-center justify-start gap-2 ", className),
|
|
1924
1893
|
"data-testid": "neeto-form-engine-".concat(hyphenate(title && name), "-toggle-label"),
|
|
1925
|
-
children: [/*#__PURE__*/jsx(Switch, _objectSpread$7(_objectSpread$7({
|
|
1894
|
+
children: [/*#__PURE__*/jsx(Switch, _objectSpread$7(_objectSpread$7({
|
|
1895
|
+
size: "lg"
|
|
1896
|
+
}, _objectSpread$7(_objectSpread$7({}, otherProps), {}, {
|
|
1926
1897
|
name: name
|
|
1927
1898
|
})), {}, {
|
|
1928
1899
|
"data-testid": "neeto-form-engine-".concat(hyphenate(title && name), "-switch")
|
|
@@ -1956,18 +1927,18 @@ function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
1956
1927
|
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; }
|
|
1957
1928
|
var STYLES = {
|
|
1958
1929
|
border: {
|
|
1959
|
-
"default": "1px solid
|
|
1960
|
-
error: "1px solid
|
|
1930
|
+
"default": "1px solid var(--input)",
|
|
1931
|
+
error: "1px solid var(--error-solid) !important"
|
|
1961
1932
|
},
|
|
1962
1933
|
color: {
|
|
1963
|
-
"default": "
|
|
1964
|
-
error: "
|
|
1934
|
+
"default": "var(--foreground)",
|
|
1935
|
+
error: "var(--error-foreground) !important"
|
|
1965
1936
|
}
|
|
1966
1937
|
};
|
|
1967
1938
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1968
1939
|
return /*#__PURE__*/jsx(components.MultiValueRemove, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1969
1940
|
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "".concat(hyphenize(props.data.label), "-remove-icon"))),
|
|
1970
|
-
children: /*#__PURE__*/jsx(
|
|
1941
|
+
children: /*#__PURE__*/jsx(X, {
|
|
1971
1942
|
size: 16
|
|
1972
1943
|
})
|
|
1973
1944
|
}));
|
|
@@ -1999,7 +1970,7 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1999
1970
|
var ClearIndicator = function ClearIndicator(props) {
|
|
2000
1971
|
return /*#__PURE__*/jsx(components.ClearIndicator, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
2001
1972
|
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "clear-all-button")),
|
|
2002
|
-
children: /*#__PURE__*/jsx(
|
|
1973
|
+
children: /*#__PURE__*/jsx(X, {
|
|
2003
1974
|
className: "cursor-pointer",
|
|
2004
1975
|
size: 16
|
|
2005
1976
|
})
|
|
@@ -2293,7 +2264,8 @@ var VerifyEmails = function VerifyEmails() {
|
|
|
2293
2264
|
children: /*#__PURE__*/jsx(Switch, {
|
|
2294
2265
|
label: title,
|
|
2295
2266
|
labelProps: buildHelpPopoverLabelProps(popoverDescription, helpLink),
|
|
2296
|
-
name: "isVerificationEnabled"
|
|
2267
|
+
name: "isVerificationEnabled",
|
|
2268
|
+
size: "lg"
|
|
2297
2269
|
})
|
|
2298
2270
|
});
|
|
2299
2271
|
};
|
|
@@ -2385,8 +2357,7 @@ var FileUpload = function FileUpload() {
|
|
|
2385
2357
|
}), /*#__PURE__*/jsxs("div", {
|
|
2386
2358
|
className: "flex flex-col space-y-3",
|
|
2387
2359
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
2388
|
-
variant: "
|
|
2389
|
-
weight: "semibold",
|
|
2360
|
+
variant: "h6",
|
|
2390
2361
|
children: t("neetoForm.fileUpload.fileTypes")
|
|
2391
2362
|
}), /*#__PURE__*/jsx("div", {
|
|
2392
2363
|
className: "flex space-x-4",
|
|
@@ -2438,7 +2409,8 @@ var OpinionScale = function OpinionScale() {
|
|
|
2438
2409
|
}), /*#__PURE__*/jsx(Switch, {
|
|
2439
2410
|
"data-testid": "neeto-form-engine-opinion-scale-show-labels-switch",
|
|
2440
2411
|
label: t("neetoForm.questions.opinionScale.showLabels"),
|
|
2441
|
-
name: "hasOpinionLabels"
|
|
2412
|
+
name: "hasOpinionLabels",
|
|
2413
|
+
size: "lg"
|
|
2442
2414
|
}), hasOpinionLabels && /*#__PURE__*/jsxs("div", {
|
|
2443
2415
|
className: "flex space-x-4",
|
|
2444
2416
|
children: [/*#__PURE__*/jsx(Input, {
|
|
@@ -2538,10 +2510,12 @@ var Options = function Options(_ref) {
|
|
|
2538
2510
|
className: "space-y-4",
|
|
2539
2511
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
2540
2512
|
name: "isPictureChoice",
|
|
2513
|
+
size: "lg",
|
|
2541
2514
|
label: t("neetoForm.questions.common.questionFields.field.addPicturesToOptions")
|
|
2542
2515
|
}), isPictureChoice && /*#__PURE__*/jsxs(Fragment, {
|
|
2543
2516
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
2544
2517
|
name: "shouldFitImages",
|
|
2518
|
+
size: "lg",
|
|
2545
2519
|
label: t("neetoForm.questions.common.questionFields.field.fitImages"),
|
|
2546
2520
|
labelProps: {
|
|
2547
2521
|
helpIconProps: {
|
|
@@ -2646,9 +2620,9 @@ var StarRating = function StarRating() {
|
|
|
2646
2620
|
var isActive = name === iconType;
|
|
2647
2621
|
return /*#__PURE__*/jsx("div", {
|
|
2648
2622
|
"data-testid": "neeto-form-engine-star-rating-icon-".concat(name),
|
|
2649
|
-
className: classnames("flex h-10 w-10 items-center justify-center gap-2", "
|
|
2650
|
-
"text-foreground
|
|
2651
|
-
"
|
|
2623
|
+
className: classnames("flex h-10 w-10 items-center justify-center gap-2", "border-foreground cursor-pointer rounded-full border", "transition-all duration-300 ease-in-out", {
|
|
2624
|
+
"text-foreground bg-muted": !isActive,
|
|
2625
|
+
"text-background bg-foreground": isActive
|
|
2652
2626
|
}),
|
|
2653
2627
|
onClick: function onClick() {
|
|
2654
2628
|
return setIconType(name);
|