@bigbinary/neeto-form-frontend 1.2.41 → 1.2.43
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/app/javascript/src/translations/en.json +2 -1
- package/dist/index.cjs.js +64 -147
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +67 -150
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
"questions": {
|
|
78
78
|
"deleteAlert": {
|
|
79
79
|
"title": "Delete field?",
|
|
80
|
-
"
|
|
80
|
+
"message_one": "You are deleting the <strong>{{label}}</strong> field.",
|
|
81
|
+
"message_other": "You are deleting the <strong>{{label}}</strong> field for all languages."
|
|
81
82
|
},
|
|
82
83
|
"unsavedChangesAlert": {
|
|
83
84
|
"discard": "Discard changes",
|
package/dist/index.cjs.js
CHANGED
|
@@ -29,6 +29,7 @@ var utc = require('dayjs/plugin/utc');
|
|
|
29
29
|
var weekday = require('dayjs/plugin/weekday');
|
|
30
30
|
var weekOfYear = require('dayjs/plugin/weekOfYear');
|
|
31
31
|
var path = require('path');
|
|
32
|
+
var server = require('react-dom/server');
|
|
32
33
|
|
|
33
34
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
34
35
|
|
|
@@ -642,20 +643,14 @@ var useUpdateForm = function useUpdateForm(options) {
|
|
|
642
643
|
}, _objectSpread$g(_objectSpread$g({}, options), {}, {
|
|
643
644
|
onSuccess: function onSuccess(data, _ref3) {
|
|
644
645
|
var id = _ref3.id;
|
|
645
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language],
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
});
|
|
650
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language], function (form) {
|
|
651
|
-
return _objectSpread$g(_objectSpread$g({}, form), {}, {
|
|
652
|
-
title: data.title,
|
|
653
|
-
questions: data.questions
|
|
654
|
-
});
|
|
655
|
-
});
|
|
646
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], ramda.assoc("title", data.title));
|
|
647
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language], ramda.mergeLeft({
|
|
648
|
+
questions: data.questions,
|
|
649
|
+
title: data.title
|
|
650
|
+
}));
|
|
656
651
|
queryClient.invalidateQueries([QUERY_KEYS.FORMS]);
|
|
657
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id
|
|
658
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id)
|
|
652
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id]);
|
|
653
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id)]);
|
|
659
654
|
options.onSuccess && options.onSuccess(data);
|
|
660
655
|
}
|
|
661
656
|
}));
|
|
@@ -673,6 +668,8 @@ var useUpdateQuestions = function useUpdateQuestions(options, language) {
|
|
|
673
668
|
}
|
|
674
669
|
var data = args[0],
|
|
675
670
|
id = args[1].id;
|
|
671
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id]);
|
|
672
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id)]);
|
|
676
673
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], ramda.assoc("questions", data.questions));
|
|
677
674
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language], ramda.assoc("questions", data.questions));
|
|
678
675
|
options.onSuccess && options.onSuccess.apply(options, args);
|
|
@@ -751,102 +748,12 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
751
748
|
}));
|
|
752
749
|
};
|
|
753
750
|
|
|
754
|
-
({
|
|
755
|
-
questions: [{
|
|
756
|
-
id: "bb101126-4183-4ddf-adff-7563a2be0b19",
|
|
757
|
-
kind: "paragraph",
|
|
758
|
-
displayOrder: 1,
|
|
759
|
-
displayKind: "Description Field",
|
|
760
|
-
label: i18next.t("neetoForm.common.fillTheFormToChat"),
|
|
761
|
-
placeholder: "",
|
|
762
|
-
isRequired: false,
|
|
763
|
-
options: [],
|
|
764
|
-
nodeId: "bb101126-4183-4ddf-adff-7563a2be0b19"
|
|
765
|
-
}, {
|
|
766
|
-
id: "a8e0178e-44df-465e-8acb-ef5d1c08d541",
|
|
767
|
-
kind: "email",
|
|
768
|
-
displayOrder: 2,
|
|
769
|
-
displayKind: "Email Input Field",
|
|
770
|
-
label: i18next.t("neetoForm.common.email"),
|
|
771
|
-
placeholder: "",
|
|
772
|
-
isRequired: true,
|
|
773
|
-
options: [],
|
|
774
|
-
nodeId: "a8e0178e-44df-465e-8acb-ef5d1c08d541"
|
|
775
|
-
}, {
|
|
776
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301ad62d8f6",
|
|
777
|
-
label: i18next.t("neetoForm.common.selectOne"),
|
|
778
|
-
isRequired: false,
|
|
779
|
-
options: [{
|
|
780
|
-
label: "ABC",
|
|
781
|
-
id: "ABC"
|
|
782
|
-
}, {
|
|
783
|
-
label: "EFG",
|
|
784
|
-
id: "EFG"
|
|
785
|
-
}, {
|
|
786
|
-
label: "QWE",
|
|
787
|
-
id: "QWE"
|
|
788
|
-
}],
|
|
789
|
-
kind: "checkbox",
|
|
790
|
-
nodeId: "f32ad8aa-039a-4b70-b3af-b97ed6fc67a6"
|
|
791
|
-
}, {
|
|
792
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301ad62wew",
|
|
793
|
-
label: i18next.t("neetoForm.common.rate"),
|
|
794
|
-
isRequired: true,
|
|
795
|
-
highestRatingLabel: "",
|
|
796
|
-
averageRatingLabel: "",
|
|
797
|
-
lowestRatingLabel: "",
|
|
798
|
-
kind: "rating",
|
|
799
|
-
nodeId: "236a8cb3-b86d-4c30-9c18-f0d69788f6bc"
|
|
800
|
-
}, {
|
|
801
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301ad62d8as",
|
|
802
|
-
label: i18next.t("neetoForm.common.phone"),
|
|
803
|
-
kind: "phone",
|
|
804
|
-
nodeId: "5dd3be53-ec99-48e2-bf21-298b6108cb00"
|
|
805
|
-
}, {
|
|
806
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301ad62d8f32",
|
|
807
|
-
label: i18next.t("neetoForm.common.select"),
|
|
808
|
-
isRequired: false,
|
|
809
|
-
options: [{
|
|
810
|
-
label: "A",
|
|
811
|
-
id: "A"
|
|
812
|
-
}, {
|
|
813
|
-
label: "B",
|
|
814
|
-
id: "B"
|
|
815
|
-
}, {
|
|
816
|
-
label: "C",
|
|
817
|
-
id: "C"
|
|
818
|
-
}],
|
|
819
|
-
kind: "dropdown",
|
|
820
|
-
nodeId: "e65f27ea-a9b9-45b1-a8de-efb27a5b3e72"
|
|
821
|
-
}, {
|
|
822
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301ad62d8f8",
|
|
823
|
-
label: "Nice",
|
|
824
|
-
kind: "paragraph",
|
|
825
|
-
nodeId: "15507c92-4bb5-4428-bc2b-0a7b078a144a"
|
|
826
|
-
}, {
|
|
827
|
-
id: "a7d3e47d-f7a2-4bf9-aaea-d301addw2d8f9",
|
|
828
|
-
label: i18next.t("neetoForm.common.singleChoice"),
|
|
829
|
-
isRequired: false,
|
|
830
|
-
options: [{
|
|
831
|
-
label: "A",
|
|
832
|
-
id: "A"
|
|
833
|
-
}, {
|
|
834
|
-
label: "B",
|
|
835
|
-
id: "B"
|
|
836
|
-
}, {
|
|
837
|
-
label: "C",
|
|
838
|
-
id: "C"
|
|
839
|
-
}],
|
|
840
|
-
kind: "radio",
|
|
841
|
-
nodeId: "37683bae-da1b-4890-ade9-0664006dc57d"
|
|
842
|
-
}]
|
|
843
|
-
});
|
|
844
|
-
var QUESTIONS_WITHOUT_FIELD_CODE = ["paragraph", "termsandcondition", "condition", "file_upload"];
|
|
845
|
-
var RESERVED_FIELD_CODES = ["month", "date", "time"];
|
|
846
751
|
var DEFAULT_AVAILABLE_LANGUAGES = [{
|
|
847
752
|
code: "en",
|
|
848
753
|
name: "English"
|
|
849
754
|
}];
|
|
755
|
+
var QUESTIONS_WITHOUT_FIELD_CODE = ["paragraph", "termsandcondition", "condition", "file_upload"];
|
|
756
|
+
var RESERVED_FIELD_CODES = ["month", "date", "time"];
|
|
850
757
|
|
|
851
758
|
function _arrayWithHoles$3(arr) {
|
|
852
759
|
if (Array.isArray(arr)) return arr;
|
|
@@ -9904,8 +9811,7 @@ var useBuildFormState = function useBuildFormState() {
|
|
|
9904
9811
|
};
|
|
9905
9812
|
|
|
9906
9813
|
var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
9907
|
-
var
|
|
9908
|
-
initialLanguage = _ref.initialLanguage,
|
|
9814
|
+
var initialLanguage = _ref.initialLanguage,
|
|
9909
9815
|
languages = _ref.languages,
|
|
9910
9816
|
onChange = _ref.onChange;
|
|
9911
9817
|
var _useState = React$2.useState(false),
|
|
@@ -9918,6 +9824,8 @@ var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
|
9918
9824
|
setSelectedLanguage = _useState4[1];
|
|
9919
9825
|
var _useTranslation = reactI18next.useTranslation(),
|
|
9920
9826
|
t = _useTranslation.t;
|
|
9827
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
9828
|
+
dirty = _useFormikContext.dirty;
|
|
9921
9829
|
var languageChangeHandler = function languageChangeHandler(code) {
|
|
9922
9830
|
if (!dirty) {
|
|
9923
9831
|
onChange(code);
|
|
@@ -9962,7 +9870,6 @@ var Overview = function Overview(_ref) {
|
|
|
9962
9870
|
description = _ref.description,
|
|
9963
9871
|
availableLanguages = _ref.availableLanguages,
|
|
9964
9872
|
selectedLanguage = _ref.selectedLanguage,
|
|
9965
|
-
dirty = _ref.dirty,
|
|
9966
9873
|
onLanguageChange = _ref.onLanguageChange;
|
|
9967
9874
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9968
9875
|
className: "mb-4 flex-shrink-0"
|
|
@@ -9974,7 +9881,6 @@ var Overview = function Overview(_ref) {
|
|
|
9974
9881
|
style: "h4",
|
|
9975
9882
|
weight: "semibold"
|
|
9976
9883
|
}, title), availableLanguages.length > 1 && /*#__PURE__*/React__default["default"].createElement(ChangeLanguageDropdown, {
|
|
9977
|
-
dirty: dirty,
|
|
9978
9884
|
initialLanguage: selectedLanguage,
|
|
9979
9885
|
languages: availableLanguages,
|
|
9980
9886
|
onChange: onLanguageChange
|
|
@@ -11654,12 +11560,6 @@ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref5) {
|
|
|
11654
11560
|
});
|
|
11655
11561
|
}, allQuestionKinds);
|
|
11656
11562
|
};
|
|
11657
|
-
var sliceLabel = function sliceLabel(label) {
|
|
11658
|
-
if (label && label.length > 23) {
|
|
11659
|
-
return "".concat(label.slice(0, 20), "...");
|
|
11660
|
-
}
|
|
11661
|
-
return label;
|
|
11662
|
-
};
|
|
11663
11563
|
|
|
11664
11564
|
var _path$2, _path2, _path3, _path4, _path5, _path6, _path7;
|
|
11665
11565
|
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
@@ -11742,7 +11642,6 @@ var _excluded$6 = ["questionKinds", "showAddQuestionDivider", "onValueChange", "
|
|
|
11742
11642
|
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; }
|
|
11743
11643
|
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), !0).forEach(function (r) { _defineProperty$6(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; }
|
|
11744
11644
|
var Form = function Form(_ref) {
|
|
11745
|
-
var _INDEPENDENT_LABELS_M, _questions$deleteQues, _questions$deleteQues2;
|
|
11746
11645
|
var questionKinds = _ref.questionKinds,
|
|
11747
11646
|
showAddQuestionDivider = _ref.showAddQuestionDivider,
|
|
11748
11647
|
onValueChange = _ref.onValueChange,
|
|
@@ -11854,14 +11753,23 @@ var Form = function Form(_ref) {
|
|
|
11854
11753
|
resetForm();
|
|
11855
11754
|
onLanguageChange(code);
|
|
11856
11755
|
};
|
|
11756
|
+
var deleteAlertMessageLabel = function deleteAlertMessageLabel() {
|
|
11757
|
+
var questionKind = questions[deleteQuestionIndex].kind;
|
|
11758
|
+
var independentLabel = INDEPENDENT_LABELS_MAP[questionKind];
|
|
11759
|
+
if (ramda.isNotNil(independentLabel)) return independentLabel;
|
|
11760
|
+
var questionLabel = questions[deleteQuestionIndex].label;
|
|
11761
|
+
if (neetoCist.isNotEmpty(questionLabel)) return neetoCist.truncate(questionLabel, 40);
|
|
11762
|
+
return neetoCist.humanize(questionKind);
|
|
11763
|
+
};
|
|
11857
11764
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
11858
11765
|
isOpen: deleteQuestionIndex !== null,
|
|
11859
11766
|
submitButtonLabel: t("neetoForm.common.delete"),
|
|
11860
11767
|
title: t("neetoForm.questions.deleteAlert.title"),
|
|
11861
|
-
message: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
11768
|
+
message: deleteQuestionIndex && /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
11862
11769
|
i18nKey: "neetoForm.questions.deleteAlert.message",
|
|
11863
11770
|
values: {
|
|
11864
|
-
|
|
11771
|
+
count: availableLanguages.length,
|
|
11772
|
+
label: deleteAlertMessageLabel()
|
|
11865
11773
|
}
|
|
11866
11774
|
}),
|
|
11867
11775
|
onClose: function onClose() {
|
|
@@ -11880,7 +11788,6 @@ var Form = function Form(_ref) {
|
|
|
11880
11788
|
noValidate: true
|
|
11881
11789
|
}), formTitle && /*#__PURE__*/React__default["default"].createElement(Overview, {
|
|
11882
11790
|
availableLanguages: availableLanguages,
|
|
11883
|
-
dirty: dirty,
|
|
11884
11791
|
selectedLanguage: selectedLanguage,
|
|
11885
11792
|
description: formDescription,
|
|
11886
11793
|
title: formTitle,
|
|
@@ -11974,29 +11881,34 @@ var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
|
|
|
11974
11881
|
};
|
|
11975
11882
|
|
|
11976
11883
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
11977
|
-
var
|
|
11978
|
-
|
|
11979
|
-
field:
|
|
11980
|
-
});
|
|
11981
|
-
return yup.string().required(errorMessage);
|
|
11884
|
+
var requiredLabelValidation = function requiredLabelValidation(schema, field) {
|
|
11885
|
+
return schema.required(i18next__default["default"].t("neetoForm.common.fieldReq", {
|
|
11886
|
+
field: field
|
|
11887
|
+
}));
|
|
11982
11888
|
};
|
|
11983
11889
|
var formValidationSchema = yup.object().shape({
|
|
11984
11890
|
questions: yup.array().of(yup.object().shape({
|
|
11985
|
-
label:
|
|
11986
|
-
is:
|
|
11987
|
-
|
|
11891
|
+
label: yup.string().when("_destroy", {
|
|
11892
|
+
is: true,
|
|
11893
|
+
otherwise: function otherwise(schema) {
|
|
11894
|
+
return schema.when("kind", {
|
|
11895
|
+
is: "paragraph",
|
|
11896
|
+
then: function then(schema) {
|
|
11897
|
+
return schema.required(i18next__default["default"].t("neetoForm.common.paragraphCantBeEmpty"));
|
|
11898
|
+
},
|
|
11899
|
+
otherwise: function otherwise(schema) {
|
|
11900
|
+
return requiredLabelValidation(schema, i18next__default["default"].t("neetoForm.questions.common.questionFields.field.label"));
|
|
11901
|
+
}
|
|
11902
|
+
});
|
|
11903
|
+
}
|
|
11988
11904
|
}),
|
|
11989
11905
|
kind: yup.string().required(),
|
|
11990
11906
|
fieldCode: yup.string().trim().notOneOf(RESERVED_FIELD_CODES, i18next__default["default"].t("neetoForm.error.invalidFieldCode")).when("kind", function (kind, schema) {
|
|
11991
|
-
return QUESTIONS_WITHOUT_FIELD_CODE.includes(kind) ? schema.notRequired() : schema
|
|
11992
|
-
field: i18next__default["default"].t("neetoForm.questions.common.questionFields.field.fieldCode")
|
|
11993
|
-
}));
|
|
11907
|
+
return QUESTIONS_WITHOUT_FIELD_CODE.includes(kind) ? schema.notRequired() : requiredLabelValidation(schema, i18next__default["default"].t("neetoForm.questions.common.questionFields.field.fieldCode"));
|
|
11994
11908
|
}),
|
|
11995
11909
|
optionsAttributes: yup.array().when("kind", function (kind, schema) {
|
|
11996
11910
|
return ["radio", "checkbox", "dropdown"].includes(kind) ? schema.of(yup.object().shape({
|
|
11997
|
-
label:
|
|
11998
|
-
field: i18next__default["default"].t("neetoForm.questions.common.questionFields.field.option")
|
|
11999
|
-
}))
|
|
11911
|
+
label: requiredLabelValidation(yup.string(), i18next__default["default"].t("neetoForm.questions.common.questionFields.field.option"))
|
|
12000
11912
|
})) : schema.notRequired();
|
|
12001
11913
|
}),
|
|
12002
11914
|
highestRatingLabel: yup.string().nullable(),
|
|
@@ -12085,23 +11997,22 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
12085
11997
|
} : _useForm$data,
|
|
12086
11998
|
questions = _useForm$data2.questions,
|
|
12087
11999
|
isQuestionsLoading = _useForm$data2.isQuestionsLoading,
|
|
12088
|
-
isLoading = _useForm.isLoading
|
|
12000
|
+
isLoading = _useForm.isLoading,
|
|
12001
|
+
refetch = _useForm.refetch;
|
|
12089
12002
|
if (isLoading || showLoader && isQuestionsLoading) {
|
|
12090
12003
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12091
12004
|
className: "flex h-full w-full items-center justify-center py-6"
|
|
12092
12005
|
}, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null));
|
|
12093
12006
|
}
|
|
12094
|
-
var handleSubmit = function handleSubmit(payload
|
|
12095
|
-
var resetForm = _ref2.resetForm;
|
|
12007
|
+
var handleSubmit = function handleSubmit(payload) {
|
|
12096
12008
|
updateQuestions({
|
|
12097
12009
|
id: id,
|
|
12098
12010
|
values: _objectSpread$c({
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
})
|
|
12011
|
+
language: selectedLanguage,
|
|
12012
|
+
neetoFormQuestion: payload
|
|
12102
12013
|
}, buildRequestArgs)
|
|
12103
12014
|
}, {
|
|
12104
|
-
onSuccess:
|
|
12015
|
+
onSuccess: refetch
|
|
12105
12016
|
});
|
|
12106
12017
|
};
|
|
12107
12018
|
var onValueChange = function onValueChange(questions) {
|
|
@@ -12114,8 +12025,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
12114
12025
|
var isDeletable = isQuestionDeletable !== null && isQuestionDeletable !== void 0 ? isQuestionDeletable : function (question) {
|
|
12115
12026
|
return !nonRemovableFields.includes(question.kind);
|
|
12116
12027
|
};
|
|
12117
|
-
var isRequiredField = isFieldRequired !== null && isFieldRequired !== void 0 ? isFieldRequired : function (
|
|
12118
|
-
var kind =
|
|
12028
|
+
var isRequiredField = isFieldRequired !== null && isFieldRequired !== void 0 ? isFieldRequired : function (_ref2) {
|
|
12029
|
+
var kind = _ref2.kind;
|
|
12119
12030
|
return requiredFields.includes(kind);
|
|
12120
12031
|
};
|
|
12121
12032
|
var isDisabledFieldLabel = isFieldLabelDisabled !== null && isFieldLabelDisabled !== void 0 ? isFieldLabelDisabled : function () {
|
|
@@ -12133,9 +12044,9 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
12133
12044
|
},
|
|
12134
12045
|
validationSchema: formValidationSchema,
|
|
12135
12046
|
onSubmit: handleSubmit
|
|
12136
|
-
}, function (
|
|
12137
|
-
var errors =
|
|
12138
|
-
setFieldError =
|
|
12047
|
+
}, function (_ref3) {
|
|
12048
|
+
var errors = _ref3.errors,
|
|
12049
|
+
setFieldError = _ref3.setFieldError;
|
|
12139
12050
|
return /*#__PURE__*/React__default["default"].createElement(Form, _extends$8({}, _objectSpread$c(_objectSpread$c({}, formDomProps), {}, {
|
|
12140
12051
|
availableLanguages: availableLanguages,
|
|
12141
12052
|
cancelButtonProps: cancelButtonProps,
|
|
@@ -29975,6 +29886,12 @@ var getValue = function getValue(_ref2) {
|
|
|
29975
29886
|
}
|
|
29976
29887
|
return value;
|
|
29977
29888
|
};
|
|
29889
|
+
var getEditorContent = function getEditorContent(value) {
|
|
29890
|
+
if (typeof value !== "string") {
|
|
29891
|
+
return server.renderToString(value);
|
|
29892
|
+
}
|
|
29893
|
+
return value;
|
|
29894
|
+
};
|
|
29978
29895
|
var Submission = function Submission(_ref3) {
|
|
29979
29896
|
var _ref3$formId = _ref3.formId,
|
|
29980
29897
|
formId = _ref3$formId === void 0 ? "" : _ref3$formId,
|
|
@@ -30001,10 +29918,10 @@ var Submission = function Submission(_ref3) {
|
|
|
30001
29918
|
switch (kind) {
|
|
30002
29919
|
case QUESTION_KIND.RICH_TEXT.value:
|
|
30003
29920
|
return /*#__PURE__*/React__default["default"].createElement(neetoEditor.EditorContent, {
|
|
30004
|
-
content: getValue({
|
|
29921
|
+
content: getEditorContent(getValue({
|
|
30005
29922
|
value: value,
|
|
30006
29923
|
kind: kind
|
|
30007
|
-
})
|
|
29924
|
+
}))
|
|
30008
29925
|
});
|
|
30009
29926
|
case QUESTION_KIND.PHONE.value:
|
|
30010
29927
|
return neetoCist.isPresent(value) ? /*#__PURE__*/React__default["default"].createElement(PhoneNumber$1.PhoneNumber, {
|