@bigbinary/neeto-form-frontend 4.4.35 → 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/BuildForm.js +4 -4
- package/dist/BuildForm.js.map +1 -1
- package/dist/cjs/BuildForm.js +4 -4
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/v2/BuildForm.js +107 -133
- 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 +107 -133
- 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 +9 -7
- 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/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-B-A1W_Vi.js');
|
|
10
10
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var dnd = require('@hello-pangea/dnd');
|
|
@@ -19,7 +19,7 @@ var reactI18next = require('react-i18next');
|
|
|
19
19
|
var jsxRuntime = require('react/jsx-runtime');
|
|
20
20
|
var MoreDropdown = require('@bigbinary/neeto-molecules/v2/MoreDropdown');
|
|
21
21
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
22
|
-
var
|
|
22
|
+
var lucideReact = require('lucide-react');
|
|
23
23
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
24
24
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
25
25
|
var i18next = require('i18next');
|
|
@@ -33,7 +33,6 @@ var OptionFields = require('@bigbinary/neeto-molecules/v2/OptionFields');
|
|
|
33
33
|
var framerMotion = require('framer-motion');
|
|
34
34
|
var CreatableSelect = require('react-select/creatable');
|
|
35
35
|
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
36
|
-
var Close = require('@bigbinary/neeto-icons/Close');
|
|
37
36
|
var reactSelect = require('react-select');
|
|
38
37
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
39
38
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
@@ -42,31 +41,8 @@ require('@bigbinary/neeto-commons-frontend/constants');
|
|
|
42
41
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
43
42
|
require('axios');
|
|
44
43
|
require('@bigbinary/neeto-commons-frontend/utils');
|
|
45
|
-
require('@bigbinary/neeto-icons/Address');
|
|
46
|
-
require('@bigbinary/neeto-icons/Calendar');
|
|
47
|
-
require('@bigbinary/neeto-icons/Captcha');
|
|
48
|
-
require('@bigbinary/neeto-icons/Checkbox');
|
|
49
|
-
require('@bigbinary/neeto-icons/DropdownClosed');
|
|
50
|
-
require('@bigbinary/neeto-icons/Email');
|
|
51
|
-
require('@bigbinary/neeto-icons/FileUpload');
|
|
52
|
-
require('@bigbinary/neeto-icons/Group');
|
|
53
|
-
require('@bigbinary/neeto-icons/Hash');
|
|
54
|
-
require('@bigbinary/neeto-icons/Header');
|
|
55
|
-
require('@bigbinary/neeto-icons/Location');
|
|
56
|
-
require('@bigbinary/neeto-icons/LongText');
|
|
57
|
-
require('@bigbinary/neeto-icons/MessageSquare');
|
|
58
|
-
require('@bigbinary/neeto-icons/NeetoInvisible');
|
|
59
|
-
require('@bigbinary/neeto-icons/PhoneRing');
|
|
60
|
-
require('@bigbinary/neeto-icons/Radio');
|
|
61
|
-
require('@bigbinary/neeto-icons/Rating');
|
|
62
|
-
require('@bigbinary/neeto-icons/Scale');
|
|
63
|
-
require('@bigbinary/neeto-icons/Sms');
|
|
64
|
-
require('@bigbinary/neeto-icons/Terms');
|
|
65
|
-
require('@bigbinary/neeto-icons/TextLines');
|
|
66
|
-
require('@bigbinary/neeto-icons/UserRoundedRect');
|
|
67
44
|
require('dompurify');
|
|
68
45
|
require('@babel/runtime/helpers/typeof');
|
|
69
|
-
require('@bigbinary/neeto-icons/Plus');
|
|
70
46
|
require('zustand');
|
|
71
47
|
require('./index-C1-XsBQ0.js');
|
|
72
48
|
require('@bigbinary/neeto-editor/utils');
|
|
@@ -170,15 +146,12 @@ var DeleteSmsReminderModal = function DeleteSmsReminderModal(_ref) {
|
|
|
170
146
|
onClose: onClose,
|
|
171
147
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Header, {
|
|
172
148
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Title, {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
variant: "h2",
|
|
176
|
-
weight: "medium",
|
|
177
|
-
children: ramda.path(["smsReminder", "deleteModal", "title"], hostSpecificData)
|
|
178
|
-
})
|
|
149
|
+
"data-testid": "delete-sms-reminder-modal-header",
|
|
150
|
+
children: ramda.path(["smsReminder", "deleteModal", "title"], hostSpecificData)
|
|
179
151
|
})
|
|
180
152
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Body, {
|
|
181
153
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
154
|
+
color: "muted",
|
|
182
155
|
"data-testid": "delete-sms-reminder-modal-description",
|
|
183
156
|
variant: "body2",
|
|
184
157
|
children: ramda.path(["smsReminder", "deleteModal", "description"], hostSpecificData)
|
|
@@ -204,6 +177,7 @@ var DeleteSpotModal = function DeleteSpotModal(_ref) {
|
|
|
204
177
|
})
|
|
205
178
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Body, {
|
|
206
179
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
180
|
+
color: "muted",
|
|
207
181
|
"data-testid": "delete-spot-modal-description",
|
|
208
182
|
variant: "body2",
|
|
209
183
|
children: description
|
|
@@ -239,6 +213,9 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
239
213
|
variant: "outline"
|
|
240
214
|
},
|
|
241
215
|
disabled: isReorderingQuestions,
|
|
216
|
+
dropdownProps: {
|
|
217
|
+
className: "w-max"
|
|
218
|
+
},
|
|
242
219
|
label: selectedLanguageName,
|
|
243
220
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.Menu, {
|
|
244
221
|
children: availableLanguages.map(function (_ref2) {
|
|
@@ -269,9 +246,7 @@ var Overview = function Overview(_ref) {
|
|
|
269
246
|
className: "flex items-center justify-between",
|
|
270
247
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
271
248
|
"data-testid": "neeto-form-engine-overview-title",
|
|
272
|
-
|
|
273
|
-
variant: "h2",
|
|
274
|
-
weight: "semibold",
|
|
249
|
+
variant: "h4",
|
|
275
250
|
children: title
|
|
276
251
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
277
252
|
className: "flex shrink-0 items-center justify-between space-x-1",
|
|
@@ -283,13 +258,14 @@ var Overview = function Overview(_ref) {
|
|
|
283
258
|
variant: "outline"
|
|
284
259
|
},
|
|
285
260
|
dropdownProps: {
|
|
286
|
-
|
|
261
|
+
className: "w-max",
|
|
287
262
|
position: "bottom-start"
|
|
288
263
|
},
|
|
289
264
|
menuItems: additionalActionOptions
|
|
290
265
|
})]
|
|
291
266
|
})]
|
|
292
267
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
268
|
+
color: "muted",
|
|
293
269
|
"data-testid": "neeto-form-engine-overview-description",
|
|
294
270
|
variant: "body2",
|
|
295
271
|
children: description
|
|
@@ -331,8 +307,8 @@ var Card = function Card(_ref) {
|
|
|
331
307
|
}, [questionLabel]);
|
|
332
308
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
333
309
|
"data-testid": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
|
|
334
|
-
className: classnames("
|
|
335
|
-
"border-primary
|
|
310
|
+
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", {
|
|
311
|
+
"border-primary neeto-form-nano-form__card--active": isActive
|
|
336
312
|
}),
|
|
337
313
|
onClick: function onClick() {
|
|
338
314
|
return onSelect(question);
|
|
@@ -340,7 +316,7 @@ var Card = function Card(_ref) {
|
|
|
340
316
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
341
317
|
className: "flex min-w-0 grow items-center gap-2",
|
|
342
318
|
children: [KindIcon && /*#__PURE__*/jsxRuntime.jsx(KindIcon, {
|
|
343
|
-
className: "
|
|
319
|
+
className: "text-muted-foreground shrink-0",
|
|
344
320
|
"data-testid": "question-card-kind-icon",
|
|
345
321
|
size: 16
|
|
346
322
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Tooltip, {
|
|
@@ -350,7 +326,6 @@ var Card = function Card(_ref) {
|
|
|
350
326
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
351
327
|
className: "min-w-0 grow truncate",
|
|
352
328
|
"data-testid": "".concat(neetoCist.slugify(questionLabel), "-question-card-label"),
|
|
353
|
-
lineHeight: "snug",
|
|
354
329
|
ref: questionLabelRef,
|
|
355
330
|
variant: "body2",
|
|
356
331
|
weight: "medium",
|
|
@@ -362,7 +337,7 @@ var Card = function Card(_ref) {
|
|
|
362
337
|
className: "shrink-0"
|
|
363
338
|
},
|
|
364
339
|
dropdownProps: {
|
|
365
|
-
|
|
340
|
+
className: "w-max"
|
|
366
341
|
},
|
|
367
342
|
menuItems: [{
|
|
368
343
|
"data-testid": "edit-question",
|
|
@@ -432,9 +407,9 @@ var Questions = function Questions(_ref) {
|
|
|
432
407
|
className: "flex items-center gap-1",
|
|
433
408
|
ref: innerRef,
|
|
434
409
|
children: [canManageQuestions && /*#__PURE__*/jsxRuntime.jsx("span", _objectSpread$j(_objectSpread$j({}, dragHandleProps), {}, {
|
|
435
|
-
className: "
|
|
410
|
+
className: "text-muted-foreground hover:text-foreground shrink-0 cursor-grab transition-all duration-300 ease-in-out",
|
|
436
411
|
"data-testid": "question-card-drag-handle",
|
|
437
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
412
|
+
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.GripVertical, {
|
|
438
413
|
size: 16
|
|
439
414
|
})
|
|
440
415
|
})), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -675,6 +650,7 @@ var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
|
675
650
|
helpText: neetoCist.isPresent(href) ? /*#__PURE__*/jsxRuntime.jsx(HelpText, {
|
|
676
651
|
href: href
|
|
677
652
|
}) : null,
|
|
653
|
+
icon: lucideReact.ListTodo,
|
|
678
654
|
primaryButtonProps: yup.buildAddQuestionButtonProps(onAdd, isDisabled),
|
|
679
655
|
title: t("neetoForm.questions.common.noData")
|
|
680
656
|
})
|
|
@@ -733,7 +709,7 @@ var KindOption = function KindOption(_ref) {
|
|
|
733
709
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
734
710
|
className: "flex items-start gap-2",
|
|
735
711
|
children: [Icon && /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
736
|
-
className: "
|
|
712
|
+
className: "text-foreground mt-0.5 shrink-0",
|
|
737
713
|
"data-testid": "kind-option-icon",
|
|
738
714
|
size: 16
|
|
739
715
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -742,7 +718,8 @@ var KindOption = function KindOption(_ref) {
|
|
|
742
718
|
variant: "body2",
|
|
743
719
|
children: label
|
|
744
720
|
}), description && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
745
|
-
className: "
|
|
721
|
+
className: "mt-0.5",
|
|
722
|
+
color: "muted",
|
|
746
723
|
"data-testid": "kind-option-description",
|
|
747
724
|
variant: "body3",
|
|
748
725
|
children: description
|
|
@@ -835,7 +812,8 @@ var Name = function Name(_ref) {
|
|
|
835
812
|
className: "space-y-4",
|
|
836
813
|
children: [!usesCustomSubmissionComponent && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
837
814
|
label: t("neetoForm.common.splitAsFirstAndLastNames"),
|
|
838
|
-
name: "isSplitMode"
|
|
815
|
+
name: "isSplitMode",
|
|
816
|
+
size: "lg"
|
|
839
817
|
}), isSplitMode && !usesCustomSubmissionComponent ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
840
818
|
children: [/*#__PURE__*/jsxRuntime.jsx(LabelWithPlaceholder, _objectSpread$f(_objectSpread$f({}, commonProps), {}, {
|
|
841
819
|
handleLabelChange: function handleLabelChange(value) {
|
|
@@ -1001,7 +979,8 @@ var RequiredSwitch = reactUtils.withT(function (_ref) {
|
|
|
1001
979
|
className: "w-full",
|
|
1002
980
|
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1003
981
|
label: t("neetoForm.common.required"),
|
|
1004
|
-
name: "isRequired"
|
|
982
|
+
name: "isRequired",
|
|
983
|
+
size: "lg"
|
|
1005
984
|
})
|
|
1006
985
|
});
|
|
1007
986
|
});
|
|
@@ -1071,6 +1050,7 @@ var Textarea = function Textarea() {
|
|
|
1071
1050
|
checked: isMinWordsEnabled,
|
|
1072
1051
|
label: t("neetoForm.questions.textarea.minimumWords"),
|
|
1073
1052
|
labelProps: yup.MIN_WORDS_SWITCH_LABEL_PROPS,
|
|
1053
|
+
size: "lg",
|
|
1074
1054
|
onCheckedChange: handleToggleChange
|
|
1075
1055
|
}), isMinWordsEnabled && /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
|
|
1076
1056
|
className: "w-42 ms-14",
|
|
@@ -1248,21 +1228,25 @@ var Form$1 = function Form(_ref) {
|
|
|
1248
1228
|
children: [shouldShowRequiredSwitch && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1249
1229
|
label: t("neetoForm.common.hideQuestion"),
|
|
1250
1230
|
name: "isHidden",
|
|
1231
|
+
size: "lg",
|
|
1251
1232
|
labelProps: hideSwitchLabelProps(hideQuestionHelpDocUrl)
|
|
1252
1233
|
}), canRestrictResponseVisibilityToHost && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1253
1234
|
label: t("neetoForm.common.responseVisibleOnlyToHost"),
|
|
1254
1235
|
name: "isResponseVisibleOnlyToHost",
|
|
1236
|
+
size: "lg",
|
|
1255
1237
|
labelProps: responseVisibleOnlyToHostSwitchLabelProps(responseVisibleOnlyToHostHelpDocUrl)
|
|
1256
1238
|
})]
|
|
1239
|
+
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1240
|
+
label: t("neetoForm.common.readOnly"),
|
|
1241
|
+
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1242
|
+
name: "isReadOnly",
|
|
1243
|
+
size: "lg"
|
|
1257
1244
|
}), shouldShowSendSmsUpdatesSwitch && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1258
1245
|
disabled: isSmsUpdatesDisabled,
|
|
1259
1246
|
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1260
1247
|
name: "sendSmsUpdates",
|
|
1248
|
+
size: "lg",
|
|
1261
1249
|
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1262
|
-
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1263
|
-
label: t("neetoForm.common.readOnly"),
|
|
1264
|
-
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1265
|
-
name: "isReadOnly"
|
|
1266
1250
|
}), isTextarea && enforceMinWordsInMultiLineTexts && /*#__PURE__*/jsxRuntime.jsx(Textarea, {})]
|
|
1267
1251
|
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Accordion, {
|
|
1268
1252
|
className: "neeto-form-nano-advanced-properties-accordion",
|
|
@@ -1419,30 +1403,27 @@ var Add = function Add(_ref) {
|
|
|
1419
1403
|
}
|
|
1420
1404
|
});
|
|
1421
1405
|
};
|
|
1422
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
1406
|
+
return /*#__PURE__*/jsxRuntime.jsxs(formik$1.Form, {
|
|
1407
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1408
|
+
formikProps: {
|
|
1409
|
+
initialValues: INITIAL_VALUES,
|
|
1410
|
+
validationSchema: formValidationSchema(INITIAL_VALUES, isFieldCodeEnabled),
|
|
1411
|
+
onSubmit: handleSubmit
|
|
1412
|
+
},
|
|
1423
1413
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Header, {
|
|
1424
1414
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
|
|
1425
1415
|
"data-testid": "add-question-pane-header",
|
|
1426
1416
|
children: t("neetoForm.questions.common.primaryPanel.addQuestion")
|
|
1427
1417
|
})
|
|
1428
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
questions: questions
|
|
1438
|
-
}))), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
1439
|
-
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.ActionBlock, {
|
|
1440
|
-
cancelButtonProps: {
|
|
1441
|
-
onClick: onClose
|
|
1442
|
-
},
|
|
1443
|
-
isSubmitting: isCreating
|
|
1444
|
-
})
|
|
1445
|
-
})]
|
|
1418
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$c({}, _objectSpread$c(_objectSpread$c({}, props), {}, {
|
|
1419
|
+
question: question,
|
|
1420
|
+
questions: questions
|
|
1421
|
+
}))), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
1422
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.ActionBlock, {
|
|
1423
|
+
cancelButtonProps: {
|
|
1424
|
+
onClick: onClose
|
|
1425
|
+
},
|
|
1426
|
+
isSubmitting: isCreating
|
|
1446
1427
|
})
|
|
1447
1428
|
})]
|
|
1448
1429
|
});
|
|
@@ -1495,42 +1476,33 @@ var Edit = function Edit(_ref) {
|
|
|
1495
1476
|
}
|
|
1496
1477
|
});
|
|
1497
1478
|
};
|
|
1498
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
1479
|
+
return /*#__PURE__*/jsxRuntime.jsxs(formik$1.Form, {
|
|
1480
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1481
|
+
formikProps: {
|
|
1482
|
+
// Sheet keeps children mounted, so this renders once before a
|
|
1483
|
+
// question is selected; without this those empty values stick.
|
|
1484
|
+
enableReinitialize: true,
|
|
1485
|
+
initialValues: _objectSpread$b(_objectSpread$b({}, question), {}, {
|
|
1486
|
+
isMinWordsEnabled: neetoCist.isPresent(question.minWords)
|
|
1487
|
+
}),
|
|
1488
|
+
validationSchema: formValidationSchema(question, isFieldCodeEnabled),
|
|
1489
|
+
onSubmit: handleSubmit
|
|
1490
|
+
},
|
|
1499
1491
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Header, {
|
|
1500
1492
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
|
|
1501
|
-
|
|
1502
|
-
children:
|
|
1503
|
-
"data-testid": "edit-question-pane-header",
|
|
1504
|
-
variant: "h2",
|
|
1505
|
-
children: t("neetoForm.questions.common.editQuestion")
|
|
1506
|
-
})
|
|
1493
|
+
"data-testid": "edit-question-pane-header",
|
|
1494
|
+
children: t("neetoForm.questions.common.editQuestion")
|
|
1507
1495
|
})
|
|
1508
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
},
|
|
1519
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1520
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Body, {
|
|
1521
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$b(_objectSpread$b({}, _objectSpread$b({
|
|
1522
|
-
question: question
|
|
1523
|
-
}, props)), {}, {
|
|
1524
|
-
isEdit: true
|
|
1525
|
-
}))
|
|
1526
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
1527
|
-
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.ActionBlock, {
|
|
1528
|
-
cancelButtonProps: {
|
|
1529
|
-
onClick: onClose
|
|
1530
|
-
},
|
|
1531
|
-
isSubmitting: isUpdating
|
|
1532
|
-
})
|
|
1533
|
-
})]
|
|
1496
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$b(_objectSpread$b({}, _objectSpread$b({
|
|
1497
|
+
question: question
|
|
1498
|
+
}, props)), {}, {
|
|
1499
|
+
isEdit: true
|
|
1500
|
+
})), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
1501
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.ActionBlock, {
|
|
1502
|
+
cancelButtonProps: {
|
|
1503
|
+
onClick: onClose
|
|
1504
|
+
},
|
|
1505
|
+
isSubmitting: isUpdating
|
|
1534
1506
|
})
|
|
1535
1507
|
})]
|
|
1536
1508
|
});
|
|
@@ -1547,8 +1519,7 @@ var Block = function Block(_ref) {
|
|
|
1547
1519
|
className: "flex items-center justify-between",
|
|
1548
1520
|
"data-testid": "properties-header",
|
|
1549
1521
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
1550
|
-
variant: "
|
|
1551
|
-
weight: "semibold",
|
|
1522
|
+
variant: "h6",
|
|
1552
1523
|
children: title
|
|
1553
1524
|
})
|
|
1554
1525
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -1723,20 +1694,12 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1723
1694
|
}
|
|
1724
1695
|
};
|
|
1725
1696
|
};
|
|
1726
|
-
return /*#__PURE__*/jsxRuntime.
|
|
1697
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet, {
|
|
1727
1698
|
initialFocusRef: initialFocusRef,
|
|
1728
1699
|
isOpen: isOpen,
|
|
1729
1700
|
onClose: onClose,
|
|
1730
|
-
children:
|
|
1731
|
-
|
|
1732
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
1733
|
-
"data-testid": "add-address-field-title",
|
|
1734
|
-
variant: "h2",
|
|
1735
|
-
weight: "semibold",
|
|
1736
|
-
children: title
|
|
1737
|
-
})
|
|
1738
|
-
})
|
|
1739
|
-
}), /*#__PURE__*/jsxRuntime.jsx(formik$1.Form, {
|
|
1701
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Form, {
|
|
1702
|
+
className: "flex min-h-0 flex-1 flex-col gap-4",
|
|
1740
1703
|
formikProps: {
|
|
1741
1704
|
initialValues: initialValues,
|
|
1742
1705
|
validationSchema: ADDRESS_FIELD_FORM_VALIDATION_SCHEMA,
|
|
@@ -1747,7 +1710,12 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1747
1710
|
var values = _ref3.values,
|
|
1748
1711
|
setFieldValue = _ref3.setFieldValue;
|
|
1749
1712
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1750
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.
|
|
1713
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Header, {
|
|
1714
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
|
|
1715
|
+
"data-testid": "add-address-field-title",
|
|
1716
|
+
children: title
|
|
1717
|
+
})
|
|
1718
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Body, {
|
|
1751
1719
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1752
1720
|
className: "w-full space-y-6",
|
|
1753
1721
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
|
|
@@ -1781,7 +1749,8 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1781
1749
|
className: "flex items-center gap-4",
|
|
1782
1750
|
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
1783
1751
|
label: t("neetoForm.common.required"),
|
|
1784
|
-
name: "isRequired"
|
|
1752
|
+
name: "isRequired",
|
|
1753
|
+
size: "lg"
|
|
1785
1754
|
})
|
|
1786
1755
|
})]
|
|
1787
1756
|
})
|
|
@@ -1803,7 +1772,7 @@ var ManagePane = function ManagePane(_ref) {
|
|
|
1803
1772
|
})]
|
|
1804
1773
|
});
|
|
1805
1774
|
}
|
|
1806
|
-
})
|
|
1775
|
+
})
|
|
1807
1776
|
});
|
|
1808
1777
|
};
|
|
1809
1778
|
|
|
@@ -1943,7 +1912,9 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1943
1912
|
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Label, {
|
|
1944
1913
|
className: classnames("flex items-center justify-start gap-2 ", className),
|
|
1945
1914
|
"data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-toggle-label"),
|
|
1946
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, _objectSpread$7(_objectSpread$7({
|
|
1915
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, _objectSpread$7(_objectSpread$7({
|
|
1916
|
+
size: "lg"
|
|
1917
|
+
}, _objectSpread$7(_objectSpread$7({}, otherProps), {}, {
|
|
1947
1918
|
name: name
|
|
1948
1919
|
})), {}, {
|
|
1949
1920
|
"data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-switch")
|
|
@@ -1977,18 +1948,18 @@ function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
1977
1948
|
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; }
|
|
1978
1949
|
var STYLES = {
|
|
1979
1950
|
border: {
|
|
1980
|
-
"default": "1px solid
|
|
1981
|
-
error: "1px solid
|
|
1951
|
+
"default": "1px solid var(--input)",
|
|
1952
|
+
error: "1px solid var(--error-solid) !important"
|
|
1982
1953
|
},
|
|
1983
1954
|
color: {
|
|
1984
|
-
"default": "
|
|
1985
|
-
error: "
|
|
1955
|
+
"default": "var(--foreground)",
|
|
1956
|
+
error: "var(--error-foreground) !important"
|
|
1986
1957
|
}
|
|
1987
1958
|
};
|
|
1988
1959
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1989
1960
|
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
1990
1961
|
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "".concat(utils.hyphenize(props.data.label), "-remove-icon"))),
|
|
1991
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1962
|
+
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.X, {
|
|
1992
1963
|
size: 16
|
|
1993
1964
|
})
|
|
1994
1965
|
}));
|
|
@@ -2020,7 +1991,7 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
2020
1991
|
var ClearIndicator = function ClearIndicator(props) {
|
|
2021
1992
|
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
2022
1993
|
innerProps: _objectSpread$6(_objectSpread$6({}, props.innerProps), {}, _defineProperty({}, "data-testid", "clear-all-button")),
|
|
2023
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1994
|
+
children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.X, {
|
|
2024
1995
|
className: "cursor-pointer",
|
|
2025
1996
|
size: 16
|
|
2026
1997
|
})
|
|
@@ -2314,7 +2285,8 @@ var VerifyEmails = function VerifyEmails() {
|
|
|
2314
2285
|
children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2315
2286
|
label: title,
|
|
2316
2287
|
labelProps: buildHelpPopoverLabelProps(popoverDescription, helpLink),
|
|
2317
|
-
name: "isVerificationEnabled"
|
|
2288
|
+
name: "isVerificationEnabled",
|
|
2289
|
+
size: "lg"
|
|
2318
2290
|
})
|
|
2319
2291
|
});
|
|
2320
2292
|
};
|
|
@@ -2406,8 +2378,7 @@ var FileUpload = function FileUpload() {
|
|
|
2406
2378
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2407
2379
|
className: "flex flex-col space-y-3",
|
|
2408
2380
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
2409
|
-
variant: "
|
|
2410
|
-
weight: "semibold",
|
|
2381
|
+
variant: "h6",
|
|
2411
2382
|
children: t("neetoForm.fileUpload.fileTypes")
|
|
2412
2383
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2413
2384
|
className: "flex space-x-4",
|
|
@@ -2459,7 +2430,8 @@ var OpinionScale = function OpinionScale() {
|
|
|
2459
2430
|
}), /*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2460
2431
|
"data-testid": "neeto-form-engine-opinion-scale-show-labels-switch",
|
|
2461
2432
|
label: t("neetoForm.questions.opinionScale.showLabels"),
|
|
2462
|
-
name: "hasOpinionLabels"
|
|
2433
|
+
name: "hasOpinionLabels",
|
|
2434
|
+
size: "lg"
|
|
2463
2435
|
}), hasOpinionLabels && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2464
2436
|
className: "flex space-x-4",
|
|
2465
2437
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
|
|
@@ -2559,10 +2531,12 @@ var Options = function Options(_ref) {
|
|
|
2559
2531
|
className: "space-y-4",
|
|
2560
2532
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2561
2533
|
name: "isPictureChoice",
|
|
2534
|
+
size: "lg",
|
|
2562
2535
|
label: t("neetoForm.questions.common.questionFields.field.addPicturesToOptions")
|
|
2563
2536
|
}), isPictureChoice && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2564
2537
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, {
|
|
2565
2538
|
name: "shouldFitImages",
|
|
2539
|
+
size: "lg",
|
|
2566
2540
|
label: t("neetoForm.questions.common.questionFields.field.fitImages"),
|
|
2567
2541
|
labelProps: {
|
|
2568
2542
|
helpIconProps: {
|
|
@@ -2667,9 +2641,9 @@ var StarRating = function StarRating() {
|
|
|
2667
2641
|
var isActive = name === iconType;
|
|
2668
2642
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2669
2643
|
"data-testid": "neeto-form-engine-star-rating-icon-".concat(name),
|
|
2670
|
-
className: classnames("flex h-10 w-10 items-center justify-center gap-2", "
|
|
2671
|
-
"text-foreground
|
|
2672
|
-
"
|
|
2644
|
+
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", {
|
|
2645
|
+
"text-foreground bg-muted": !isActive,
|
|
2646
|
+
"text-background bg-foreground": isActive
|
|
2673
2647
|
}),
|
|
2674
2648
|
onClick: function onClick() {
|
|
2675
2649
|
return setIconType(name);
|