@bigbinary/neeto-form-frontend 4.4.10 → 4.4.12
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/README.md +1 -3
- package/app/javascript/src/translations/ar.json +9 -1
- package/app/javascript/src/translations/bg.json +9 -1
- package/app/javascript/src/translations/ca.json +9 -1
- package/app/javascript/src/translations/cs.json +9 -1
- package/app/javascript/src/translations/da.json +9 -1
- package/app/javascript/src/translations/de.json +9 -1
- package/app/javascript/src/translations/en.json +9 -1
- package/app/javascript/src/translations/es-MX.json +9 -1
- package/app/javascript/src/translations/es.json +9 -1
- package/app/javascript/src/translations/et.json +9 -1
- package/app/javascript/src/translations/fi.json +9 -1
- package/app/javascript/src/translations/fil.json +9 -1
- package/app/javascript/src/translations/fr.json +9 -1
- package/app/javascript/src/translations/he.json +9 -1
- package/app/javascript/src/translations/hi.json +9 -1
- package/app/javascript/src/translations/hr.json +9 -1
- package/app/javascript/src/translations/hu.json +9 -1
- package/app/javascript/src/translations/id.json +9 -1
- package/app/javascript/src/translations/it.json +9 -1
- package/app/javascript/src/translations/ja.json +9 -1
- package/app/javascript/src/translations/ko.json +9 -1
- package/app/javascript/src/translations/nl.json +9 -1
- package/app/javascript/src/translations/pl.json +9 -1
- package/app/javascript/src/translations/pt-BR.json +9 -1
- package/app/javascript/src/translations/pt.json +9 -1
- package/app/javascript/src/translations/ro.json +9 -1
- package/app/javascript/src/translations/ru.json +9 -1
- package/app/javascript/src/translations/sk.json +9 -1
- package/app/javascript/src/translations/sl.json +9 -1
- package/app/javascript/src/translations/sv.json +9 -1
- package/app/javascript/src/translations/th.json +9 -1
- package/app/javascript/src/translations/tr.json +9 -1
- package/app/javascript/src/translations/uk.json +9 -1
- package/app/javascript/src/translations/vi.json +9 -1
- package/app/javascript/src/translations/zh-CN.json +9 -1
- package/app/javascript/src/translations/zh-TW.json +9 -1
- package/dist/.ready +1 -0
- package/dist/BuildForm.js +120 -66
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +4 -4
- package/dist/ExternalForm.js.map +1 -1
- package/dist/UrlBuilder.js +2 -2
- package/dist/cjs/BuildForm.js +120 -66
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +4 -4
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +2 -2
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/{utils-CI844li1.js → utils-H7u9B9Jq.js} +16 -3
- package/dist/utils-H7u9B9Jq.js.map +1 -0
- package/dist/{utils-baAzU7l8.js → utils-QSMxxdQN.js} +16 -3
- package/dist/utils-QSMxxdQN.js.map +1 -0
- package/dist/{yup-CSYHMEsr.js → yup-B3JGBWm7.js} +19 -4
- package/dist/yup-B3JGBWm7.js.map +1 -0
- package/dist/{yup-DMlViLLB.js → yup-DfKhsn0t.js} +20 -3
- package/dist/yup-DfKhsn0t.js.map +1 -0
- package/package.json +8 -8
- package/types.d.ts +1 -0
- package/dist/utils-CI844li1.js.map +0 -1
- package/dist/utils-baAzU7l8.js.map +0 -1
- package/dist/yup-CSYHMEsr.js.map +0 -1
- package/dist/yup-DMlViLLB.js.map +0 -1
package/dist/BuildForm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, findById,
|
|
|
4
4
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
5
5
|
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, isNil, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, append, pluck, test, paths, difference, prop, startsWith, split, last, either, F, T } from 'ramda';
|
|
6
6
|
import { k as useDeleteQuestion, Q as QUESTION_TYPES, b as useForm, l as useCreateQuestion, m as useUpdateQuestion, C as CAPTCHA_TYPES, n as useReorderQuestions, i as QUERY_KEYS } from './constants-Cj0XxE8a.js';
|
|
7
|
-
import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as Drag, o as SELECTABLE_KINDS, p as isAutoGeneratedQuestion, q as isRichTextQuestion, r as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, s as RESERVED_FIELD_CODES, t as renameKey, f as LABEL_FIELDS, u as isDefaultLanguage, v as buildAddQuestionButtonProps, w as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, x as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE,
|
|
7
|
+
import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as Drag, o as SELECTABLE_KINDS, p as isAutoGeneratedQuestion, q as isRichTextQuestion, r as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, s as RESERVED_FIELD_CODES, t as renameKey, f as LABEL_FIELDS, u as isDefaultLanguage, v as buildAddQuestionButtonProps, w as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, x as MIN_WORDS, y as isImmutableField, Q as QUESTIONS_WITHOUT_FIELD_CODE, z as NON_HIDEABLE_FIELDS, B as NON_READ_ONLY_FIELDS, O as OPINION_LABEL_MAX_LENGTH, G as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, H as generateDefaultOptions, J as MINIMUM_ADDRESS_FIELDS, K as getDeletedRecords, T as randomId, U as getActiveRecords, V as FILE_TYPES_MAP, W as FILE_GROUPS, X as OPINION_SCALE_MIN_VALUE_OPTIONS, Y as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, Z as MINIMUM_OPTIONS, _ as IMAGE_HEIGHT_SLIDER_DEFAULTS, $ as RATING_OPTIONS, a0 as STAR_RATING_MIN_VALUE_OPTIONS, a1 as STAR_RATING_MAX_VALUE_OPTIONS, a2 as STAR_RATING_ICONS_MAP, a3 as buildDisabledAddButtonHelpPopoverProps, a4 as buildReorderPayload, a5 as QUESTIONS_INITIAL_VALUE, a6 as isMandatoryField, a7 as QUESTION_KINDS, a as QUESTION_KIND, a8 as getActiveQuestionKindDetails, a9 as DEFAULT_AVAILABLE_LANGUAGES, aa as DEFAULT_ADVANCED_FEATURES } from './yup-B3JGBWm7.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';
|
|
@@ -35,9 +35,10 @@ import { useFormikContext, useField } from 'formik';
|
|
|
35
35
|
import Accordion from '@bigbinary/neetoui/Accordion';
|
|
36
36
|
import Select from '@bigbinary/neetoui/formik/Select';
|
|
37
37
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
38
|
-
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
38
|
+
import Textarea$1 from '@bigbinary/neetoui/formik/Textarea';
|
|
39
39
|
import NeetoEditor from '@bigbinary/neeto-editor/Editor';
|
|
40
40
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
41
|
+
import Switch$1 from '@bigbinary/neetoui/Switch';
|
|
41
42
|
import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
|
|
42
43
|
import * as yup from 'yup';
|
|
43
44
|
import OptionFields from '@bigbinary/neeto-molecules/OptionFields';
|
|
@@ -297,58 +298,62 @@ var Card = function Card(_ref) {
|
|
|
297
298
|
setIsTooltipEnabled(isElementOverflowing(element));
|
|
298
299
|
}, [questionLabel]);
|
|
299
300
|
return /*#__PURE__*/jsxs("div", {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
"neeto-ui-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
301
|
+
className: "flex items-center gap-0.5",
|
|
302
|
+
children: [canManageQuestions && /*#__PURE__*/jsx(Drag, {
|
|
303
|
+
className: "neeto-ui-text-gray-400 hover:neeto-ui-text-gray-500 transition-all ease-in-out duration-300 shrink-0 cursor-grab -ml-1",
|
|
304
|
+
size: 16
|
|
305
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
306
|
+
"data-testid": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
307
|
+
className: classnames("neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-white neeto-form-nano-form__card flex h-10 grow items-center justify-between gap-1 border p-2", {
|
|
308
|
+
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
309
|
+
}),
|
|
310
|
+
onClick: function onClick() {
|
|
311
|
+
return onSelect(question);
|
|
312
|
+
},
|
|
313
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
314
|
+
className: "flex min-w-0 grow items-center gap-1",
|
|
315
|
+
children: /*#__PURE__*/jsx(Tooltip, {
|
|
316
|
+
content: questionLabel,
|
|
317
|
+
disabled: !isTooltipEnabled,
|
|
318
|
+
position: "top",
|
|
319
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
320
|
+
className: "line-clamp-2 min-w-0 grow truncate break-words",
|
|
321
|
+
"data-testid": "".concat(slugify(questionLabel), "-question-card-label"),
|
|
322
|
+
lineHeight: "snug",
|
|
323
|
+
ref: questionLabelRef,
|
|
324
|
+
style: "body2",
|
|
325
|
+
weight: "medium",
|
|
326
|
+
children: questionLabel
|
|
327
|
+
})
|
|
323
328
|
})
|
|
329
|
+
}), canManageQuestions && /*#__PURE__*/jsx(MoreDropdown, {
|
|
330
|
+
dropdownButtonProps: {
|
|
331
|
+
className: "shrink-0"
|
|
332
|
+
},
|
|
333
|
+
dropdownProps: {
|
|
334
|
+
strategy: "fixed"
|
|
335
|
+
},
|
|
336
|
+
menuItems: [{
|
|
337
|
+
"data-testid": "edit-question",
|
|
338
|
+
key: "edit",
|
|
339
|
+
label: t("neetoForm.common.edit"),
|
|
340
|
+
onClick: onEdit
|
|
341
|
+
}, {
|
|
342
|
+
"data-testid": "clone-question",
|
|
343
|
+
key: "clone",
|
|
344
|
+
label: t("neetoForm.common.clone"),
|
|
345
|
+
isVisible: !isSingular && isFunction(onClone),
|
|
346
|
+
onClick: onClone
|
|
347
|
+
}, {
|
|
348
|
+
"data-testid": "delete-question",
|
|
349
|
+
key: "delete",
|
|
350
|
+
label: t("neetoForm.common.delete"),
|
|
351
|
+
isVisible: isFunction(onDelete),
|
|
352
|
+
onClick: function onClick() {
|
|
353
|
+
return onDelete(question);
|
|
354
|
+
}
|
|
355
|
+
}]
|
|
324
356
|
})]
|
|
325
|
-
}), canManageQuestions && /*#__PURE__*/jsx(MoreDropdown, {
|
|
326
|
-
dropdownButtonProps: {
|
|
327
|
-
className: "shrink-0"
|
|
328
|
-
},
|
|
329
|
-
dropdownProps: {
|
|
330
|
-
strategy: "fixed"
|
|
331
|
-
},
|
|
332
|
-
menuItems: [{
|
|
333
|
-
"data-testid": "edit-question",
|
|
334
|
-
key: "edit",
|
|
335
|
-
label: t("neetoForm.common.edit"),
|
|
336
|
-
onClick: onEdit
|
|
337
|
-
}, {
|
|
338
|
-
"data-testid": "clone-question",
|
|
339
|
-
key: "clone",
|
|
340
|
-
label: t("neetoForm.common.clone"),
|
|
341
|
-
isVisible: !isSingular && isFunction(onClone),
|
|
342
|
-
onClick: onClone
|
|
343
|
-
}, {
|
|
344
|
-
"data-testid": "delete-question",
|
|
345
|
-
key: "delete",
|
|
346
|
-
label: t("neetoForm.common.delete"),
|
|
347
|
-
isVisible: isFunction(onDelete),
|
|
348
|
-
onClick: function onClick() {
|
|
349
|
-
return onDelete(question);
|
|
350
|
-
}
|
|
351
|
-
}]
|
|
352
357
|
})]
|
|
353
358
|
});
|
|
354
359
|
};
|
|
@@ -661,7 +666,9 @@ var INITIAL_VALUES = {
|
|
|
661
666
|
kind: "",
|
|
662
667
|
label: "",
|
|
663
668
|
fieldCode: "",
|
|
664
|
-
isSplitMode: false
|
|
669
|
+
isSplitMode: false,
|
|
670
|
+
minWords: null,
|
|
671
|
+
isMinWordsEnabled: false
|
|
665
672
|
};
|
|
666
673
|
var VALID_FIELD_CODE_REGEX = /^[a-z0-9]+(_[a-z0-9]+)*$/;
|
|
667
674
|
var DRAFT_ID_PREFIX = "draft-";
|
|
@@ -691,7 +698,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
691
698
|
var end = element.value.length;
|
|
692
699
|
element.setSelectionRange(end, end);
|
|
693
700
|
};
|
|
694
|
-
return /*#__PURE__*/jsx(Textarea, _objectSpread$g({
|
|
701
|
+
return /*#__PURE__*/jsx(Textarea$1, _objectSpread$g({
|
|
695
702
|
label: label,
|
|
696
703
|
name: name,
|
|
697
704
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -992,6 +999,38 @@ var FieldCode = function FieldCode() {
|
|
|
992
999
|
});
|
|
993
1000
|
};
|
|
994
1001
|
|
|
1002
|
+
var Textarea = function Textarea() {
|
|
1003
|
+
var _useTranslation = useTranslation(),
|
|
1004
|
+
t = _useTranslation.t;
|
|
1005
|
+
var _useField = useField("minWords"),
|
|
1006
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
1007
|
+
setMinWords = _useField2[2].setValue;
|
|
1008
|
+
var _useField3 = useField("isMinWordsEnabled"),
|
|
1009
|
+
_useField4 = _slicedToArray(_useField3, 3),
|
|
1010
|
+
isMinWordsEnabled = _useField4[0].value,
|
|
1011
|
+
setIsMinWordsEnabled = _useField4[2].setValue;
|
|
1012
|
+
var handleToggleChange = function handleToggleChange() {
|
|
1013
|
+
var isEnabled = !isMinWordsEnabled;
|
|
1014
|
+
setIsMinWordsEnabled(isEnabled);
|
|
1015
|
+
setMinWords(isEnabled ? MIN_WORDS.DEFAULT : null);
|
|
1016
|
+
};
|
|
1017
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1018
|
+
className: "flex flex-col gap-2",
|
|
1019
|
+
children: [/*#__PURE__*/jsx(Switch$1, {
|
|
1020
|
+
checked: isMinWordsEnabled,
|
|
1021
|
+
label: t("neetoForm.questions.textarea.minimumWords"),
|
|
1022
|
+
labelProps: MIN_WORDS_SWITCH_LABEL_PROPS,
|
|
1023
|
+
onChange: handleToggleChange
|
|
1024
|
+
}), isMinWordsEnabled && /*#__PURE__*/jsx(Input, {
|
|
1025
|
+
className: "w-42 ms-14",
|
|
1026
|
+
max: MIN_WORDS.MAX,
|
|
1027
|
+
min: MIN_WORDS.MIN,
|
|
1028
|
+
name: "minWords",
|
|
1029
|
+
type: "number"
|
|
1030
|
+
})]
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
|
|
995
1034
|
var Form$1 = function Form(_ref) {
|
|
996
1035
|
var questions = _ref.questions,
|
|
997
1036
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -1035,7 +1074,8 @@ var Form$1 = function Form(_ref) {
|
|
|
1035
1074
|
usesCustomSubmissionComponent = _useBuildFormStore.usesCustomSubmissionComponent;
|
|
1036
1075
|
var isFieldCodeEnabled = advancedFeatures.fieldCode,
|
|
1037
1076
|
markResponsesAsReadOnly = advancedFeatures.markResponsesAsReadOnly,
|
|
1038
|
-
restrictResponseVisibilityToHost = advancedFeatures.restrictResponseVisibilityToHost
|
|
1077
|
+
restrictResponseVisibilityToHost = advancedFeatures.restrictResponseVisibilityToHost,
|
|
1078
|
+
enforceMinWordsInMultiLineTexts = advancedFeatures.enforceMinWordsInMultiLineTexts;
|
|
1039
1079
|
var kind = values.kind;
|
|
1040
1080
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
1041
1081
|
var questionKindUniquenessPattern = mergeLeft(isEdit && kindUniqueOn ? kindUniqueOn(values) : {}, {
|
|
@@ -1062,8 +1102,9 @@ var Form$1 = function Form(_ref) {
|
|
|
1062
1102
|
var shouldShowHideSwitch = isFieldCodeEnabled && !usesCustomSubmissionComponent && !includes(kind, NON_HIDEABLE_FIELDS);
|
|
1063
1103
|
var canRestrictResponseVisibilityToHost = restrictResponseVisibilityToHost && !includes(kind, NON_HIDEABLE_FIELDS);
|
|
1064
1104
|
var canMarkResponsesAsReadOnly = markResponsesAsReadOnly && !includes(kind, NON_READ_ONLY_FIELDS);
|
|
1105
|
+
var isTextarea = kind === QUESTION_TYPES.TEXTAREA;
|
|
1065
1106
|
var isBasicSettingsVisible = !isRequired && (!isImmutable || shouldShowHideSwitch);
|
|
1066
|
-
var isSettingsBlockVisible = kind !== QUESTION_TYPES.SPOT && (isBasicSettingsVisible || canMarkResponsesAsReadOnly);
|
|
1107
|
+
var isSettingsBlockVisible = kind !== QUESTION_TYPES.SPOT && (isBasicSettingsVisible || canMarkResponsesAsReadOnly || isTextarea);
|
|
1067
1108
|
var handleKindChange = function handleKindChange(option) {
|
|
1068
1109
|
var data = buildQuestionData(option);
|
|
1069
1110
|
updateFormState(data);
|
|
@@ -1142,7 +1183,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1142
1183
|
label: t("neetoForm.common.readOnly"),
|
|
1143
1184
|
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
1144
1185
|
name: "isReadOnly"
|
|
1145
|
-
})]
|
|
1186
|
+
}), isTextarea && enforceMinWordsInMultiLineTexts && /*#__PURE__*/jsx(Textarea, {})]
|
|
1146
1187
|
}), shouldShowFieldCode && /*#__PURE__*/jsx(Accordion, {
|
|
1147
1188
|
className: "neeto-form-nano-advanced-properties-accordion",
|
|
1148
1189
|
"data-testid": "advanced-properties-card",
|
|
@@ -1232,6 +1273,11 @@ var formValidationSchema = function formValidationSchema(question) {
|
|
|
1232
1273
|
})
|
|
1233
1274
|
})) : schema.notRequired();
|
|
1234
1275
|
}),
|
|
1276
|
+
minWords: yup.number().nullable().when(["kind", "isMinWordsEnabled"], function (kind, isMinWordsEnabled, schema) {
|
|
1277
|
+
if (kind !== QUESTION_TYPES.TEXTAREA) return schema.notRequired();
|
|
1278
|
+
if (!isMinWordsEnabled) return schema.notRequired();
|
|
1279
|
+
return schema.typeError(t("neetoForm.questions.textarea.minimumWordsMinError")).required(t("neetoForm.questions.textarea.minimumWordsMinError")).min(MIN_WORDS.MIN, t("neetoForm.questions.textarea.minimumWordsMinError")).max(MIN_WORDS.MAX, t("neetoForm.questions.textarea.minimumWordsMaxError"));
|
|
1280
|
+
}),
|
|
1235
1281
|
highestRatingLabel: yup.string().nullable(),
|
|
1236
1282
|
averageRatingLabel: yup.string().nullable(),
|
|
1237
1283
|
lowestRatingLabel: yup.string().nullable(),
|
|
@@ -1380,7 +1426,9 @@ var Edit = function Edit(_ref) {
|
|
|
1380
1426
|
})
|
|
1381
1427
|
}), /*#__PURE__*/jsx(Form$2, {
|
|
1382
1428
|
formikProps: {
|
|
1383
|
-
initialValues: question,
|
|
1429
|
+
initialValues: _objectSpread$b(_objectSpread$b({}, question), {}, {
|
|
1430
|
+
isMinWordsEnabled: isPresent(question.minWords)
|
|
1431
|
+
}),
|
|
1384
1432
|
validationSchema: formValidationSchema(question, isFieldCodeEnabled),
|
|
1385
1433
|
onSubmit: handleSubmit
|
|
1386
1434
|
},
|
|
@@ -2523,7 +2571,8 @@ var StarRating = function StarRating() {
|
|
|
2523
2571
|
});
|
|
2524
2572
|
};
|
|
2525
2573
|
|
|
2526
|
-
var _excluded$1 = ["
|
|
2574
|
+
var _excluded$1 = ["minWords"],
|
|
2575
|
+
_excluded2 = ["fields"];
|
|
2527
2576
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2528
2577
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2529
2578
|
var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
@@ -2643,19 +2692,24 @@ var readOnlySwitchLabelProps = function readOnlySwitchLabelProps(helpUrl) {
|
|
|
2643
2692
|
}
|
|
2644
2693
|
};
|
|
2645
2694
|
};
|
|
2646
|
-
var transformValues = function transformValues(
|
|
2647
|
-
|
|
2695
|
+
var transformValues = function transformValues(_ref4) {
|
|
2696
|
+
var minWords = _ref4.minWords,
|
|
2697
|
+
values = _objectWithoutProperties(_ref4, _excluded$1);
|
|
2698
|
+
var rest = omit(["isMinWordsEnabled"], values);
|
|
2699
|
+
switch (rest.kind) {
|
|
2648
2700
|
case QUESTION_TYPES.ADDRESS:
|
|
2649
2701
|
{
|
|
2650
|
-
var
|
|
2651
|
-
fields =
|
|
2652
|
-
|
|
2653
|
-
return _objectSpread$2(_objectSpread$2({},
|
|
2702
|
+
var _rest$fields = rest.fields,
|
|
2703
|
+
fields = _rest$fields === void 0 ? [] : _rest$fields,
|
|
2704
|
+
addressRest = _objectWithoutProperties(rest, _excluded2);
|
|
2705
|
+
return _objectSpread$2(_objectSpread$2({}, addressRest), {}, {
|
|
2654
2706
|
fieldsAttributes: map(renameKey("deleted", "_destroy"), omitDraftId(fields))
|
|
2655
2707
|
});
|
|
2656
2708
|
}
|
|
2657
2709
|
default:
|
|
2658
|
-
return
|
|
2710
|
+
return _objectSpread$2(_objectSpread$2({}, rest), {}, {
|
|
2711
|
+
minWords: minWords !== null && minWords !== void 0 ? minWords : ""
|
|
2712
|
+
});
|
|
2659
2713
|
}
|
|
2660
2714
|
};
|
|
2661
2715
|
|