@bigbinary/neeto-form-frontend 1.2.39 → 1.2.40
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 +13 -3
- package/dist/index.cjs.js +241 -86
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +244 -89
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/types.d.ts +25 -6
package/dist/index.js
CHANGED
|
@@ -2,23 +2,23 @@ import * as React$2 from 'react';
|
|
|
2
2
|
import React__default, { useState, useRef, useEffect, useContext, useLayoutEffect as useLayoutEffect$1, forwardRef, useImperativeHandle, Fragment, useReducer, useCallback as useCallback$1, useMemo as useMemo$1, createContext, createElement } from 'react';
|
|
3
3
|
import { useField, useFormikContext, FieldArray, Form as Form$1, Formik, Field, FastField } from 'formik';
|
|
4
4
|
import { noop as noop$4, slugify, filterBy, findBy, removeBy, isPresent as isPresent$1, isNotEmpty, findById, notEqualsDeep } from '@bigbinary/neeto-cist';
|
|
5
|
+
import { withEventTargetValue, showThumbsUpToastr, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
5
6
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
6
|
-
import {
|
|
7
|
-
import { assoc, prop, isEmpty, path, values, compose as compose$1, trim, useWith, split, either, isNil, equals, difference, reject, pluck, keys, pick, omit, insert, not, pipe as pipe$1, toLower, map, includes, identity, isNotNil, times, filter as filter$1 } from 'ramda';
|
|
7
|
+
import { Tooltip, Dropdown as Dropdown$2, Alert, Typography, Button as Button$1, Label, Checkbox as Checkbox$1, Toastr, MultiEmailInput, DatePicker, Radio as Radio$1, Select, Textarea as Textarea$1, Input as Input$2, Spinner as Spinner$2 } from '@bigbinary/neetoui';
|
|
8
|
+
import { assoc, prop, isEmpty, path, values, compose as compose$1, trim, useWith, split, either, isNil, equals, difference, reject, pluck, keys, pick, omit, insert, not, pipe as pipe$1, toLower, map, includes, identity, isNotNil, times, clamp as clamp$2, filter as filter$1 } from 'ramda';
|
|
8
9
|
import { useQuery, useQueryClient, useMutation } from 'react-query';
|
|
9
10
|
import i18next, { t as t$4 } from 'i18next';
|
|
10
|
-
import { Input, Email as Email$2, Phone as Phone$2, Up, Down, MenuHorizontal, Delete, Plus, NeetoInvisible, Checkbox as Checkbox$2, Radio, Dropdown as Dropdown$3, Rating as Rating$4, Smiley, Calendar, Upload, Check, Close, FileGeneric } from '@bigbinary/neeto-icons';
|
|
11
|
+
import { Input, Email as Email$2, Phone as Phone$2, Globe, Up, Down, MenuHorizontal, Delete, Plus, NeetoInvisible, Checkbox as Checkbox$2, Radio, Dropdown as Dropdown$3, Rating as Rating$4, Smiley, Calendar, Upload, Check, Close, FileGeneric } from '@bigbinary/neeto-icons';
|
|
12
|
+
import { useMutationWithInvalidation, withImmutableActions, withT, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
11
13
|
import axios from 'axios';
|
|
12
14
|
import ReactDOM, { unstable_batchedUpdates, flushSync as flushSync$1 } from 'react-dom';
|
|
13
15
|
import { Input as Input$1, Textarea, Checkbox, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
14
16
|
import { useTranslation, Trans } from 'react-i18next';
|
|
15
|
-
import { withImmutableActions, withT, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
16
17
|
import { create as create$1 } from 'zustand';
|
|
17
18
|
import classnames from 'classnames';
|
|
18
|
-
import { Editor as Editor$1, isEditorEmpty, EditorContent } from '@bigbinary/neeto-editor';
|
|
19
19
|
import * as yup from 'yup';
|
|
20
20
|
import { object, array, string } from 'yup';
|
|
21
|
-
import {
|
|
21
|
+
import { Editor as Editor$1, isEditorEmpty, EditorContent } from '@bigbinary/neeto-editor';
|
|
22
22
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
23
23
|
import dayjs from 'dayjs';
|
|
24
24
|
import { validation, PhoneNumberInput, PhoneNumber as PhoneNumber$1 } from '@bigbinary/neeto-molecules/PhoneNumber';
|
|
@@ -510,11 +510,19 @@ var updateForm = function updateForm(formId, payload) {
|
|
|
510
510
|
var destroyForm = function destroyForm(formId) {
|
|
511
511
|
return axios["delete"](getFormsUrl(formId));
|
|
512
512
|
};
|
|
513
|
-
var getQuestions = function getQuestions(formId) {
|
|
514
|
-
return axios.get(getQuestionsUrl(formId)
|
|
513
|
+
var getQuestions = function getQuestions(formId, language) {
|
|
514
|
+
return axios.get(getQuestionsUrl(formId), {
|
|
515
|
+
params: {
|
|
516
|
+
language: language
|
|
517
|
+
}
|
|
518
|
+
});
|
|
515
519
|
};
|
|
516
|
-
var getPublicQuestions = function getPublicQuestions(formId) {
|
|
517
|
-
return axios.get("".concat(BASE_URL, "/api/v1/forms/").concat(formId, "/public/questions/")
|
|
520
|
+
var getPublicQuestions = function getPublicQuestions(formId, language) {
|
|
521
|
+
return axios.get("".concat(BASE_URL, "/api/v1/forms/").concat(formId, "/public/questions/"), {
|
|
522
|
+
params: {
|
|
523
|
+
language: language
|
|
524
|
+
}
|
|
525
|
+
});
|
|
518
526
|
};
|
|
519
527
|
var updateQuestions = function updateQuestions(formId, payload) {
|
|
520
528
|
return axios.patch(getQuestionsUrl(formId), payload);
|
|
@@ -553,21 +561,25 @@ var neetoFormApi = {
|
|
|
553
561
|
updatePublicSubmission: updatePublicSubmission
|
|
554
562
|
};
|
|
555
563
|
|
|
556
|
-
var _excluded$b = ["formId", "preview"],
|
|
564
|
+
var _excluded$b = ["formId", "preview", "language"],
|
|
557
565
|
_excluded3$1 = ["formId", "submissionId"];
|
|
558
566
|
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
559
567
|
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
560
568
|
var useForm = function useForm(_ref) {
|
|
561
569
|
var formId = _ref.formId,
|
|
562
|
-
preview = _ref.preview,
|
|
570
|
+
_ref$preview = _ref.preview,
|
|
571
|
+
preview = _ref$preview === void 0 ? null : _ref$preview,
|
|
572
|
+
_ref$language = _ref.language,
|
|
573
|
+
language = _ref$language === void 0 ? "en" : _ref$language,
|
|
563
574
|
options = _objectWithoutProperties$1(_ref, _excluded$b);
|
|
564
|
-
return useQuery([QUERY_KEYS.QUESTIONS, preview ? "preview/".concat(formId) : formId], function () {
|
|
565
|
-
return neetoFormApi.getPublicQuestions(formId);
|
|
575
|
+
return useQuery([QUERY_KEYS.QUESTIONS, preview ? "preview/".concat(formId) : formId, language], function () {
|
|
576
|
+
return neetoFormApi.getPublicQuestions(formId, language);
|
|
566
577
|
}, _objectSpread$f({
|
|
567
578
|
keepPreviousData: true
|
|
568
579
|
}, options));
|
|
569
580
|
};
|
|
570
581
|
var useCreateForm = function useCreateForm(options) {
|
|
582
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "en";
|
|
571
583
|
var queryClient = useQueryClient();
|
|
572
584
|
return useMutation(neetoFormApi.createForm, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
573
585
|
onSuccess: function onSuccess(form) {
|
|
@@ -575,14 +587,15 @@ var useCreateForm = function useCreateForm(options) {
|
|
|
575
587
|
queryClient.setQueryData(QUERY_KEYS.QUESTIONS, function (forms) {
|
|
576
588
|
return forms && [].concat(_toConsumableArray$1(forms), [form]);
|
|
577
589
|
});
|
|
578
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, form.id], form);
|
|
579
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id)], form);
|
|
590
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, form.id, language], form);
|
|
591
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id), language], form);
|
|
580
592
|
queryClient.invalidateQueries([QUERY_KEYS.FORMS]);
|
|
581
593
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options, form);
|
|
582
594
|
}
|
|
583
595
|
}));
|
|
584
596
|
};
|
|
585
597
|
var useUpdateForm = function useUpdateForm(options) {
|
|
598
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "en";
|
|
586
599
|
var queryClient = useQueryClient();
|
|
587
600
|
return useMutation(function (_ref2) {
|
|
588
601
|
var id = _ref2.id,
|
|
@@ -591,25 +604,25 @@ var useUpdateForm = function useUpdateForm(options) {
|
|
|
591
604
|
}, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
592
605
|
onSuccess: function onSuccess(data, _ref3) {
|
|
593
606
|
var id = _ref3.id;
|
|
594
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id], function (form) {
|
|
607
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], function (form) {
|
|
595
608
|
return _objectSpread$f(_objectSpread$f({}, form), {}, {
|
|
596
609
|
title: data.title
|
|
597
610
|
});
|
|
598
611
|
});
|
|
599
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id)], function (form) {
|
|
612
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language], function (form) {
|
|
600
613
|
return _objectSpread$f(_objectSpread$f({}, form), {}, {
|
|
601
614
|
title: data.title,
|
|
602
615
|
questions: data.questions
|
|
603
616
|
});
|
|
604
617
|
});
|
|
605
618
|
queryClient.invalidateQueries([QUERY_KEYS.FORMS]);
|
|
606
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id]);
|
|
607
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id)]);
|
|
619
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id, language]);
|
|
620
|
+
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language]);
|
|
608
621
|
options.onSuccess && options.onSuccess(data);
|
|
609
622
|
}
|
|
610
623
|
}));
|
|
611
624
|
};
|
|
612
|
-
var useUpdateQuestions = function useUpdateQuestions(options) {
|
|
625
|
+
var useUpdateQuestions = function useUpdateQuestions(options, language) {
|
|
613
626
|
var queryClient = useQueryClient();
|
|
614
627
|
return useMutation(function (_ref4) {
|
|
615
628
|
var id = _ref4.id,
|
|
@@ -622,12 +635,12 @@ var useUpdateQuestions = function useUpdateQuestions(options) {
|
|
|
622
635
|
}
|
|
623
636
|
var data = args[0],
|
|
624
637
|
id = args[1].id;
|
|
625
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id], function (form) {
|
|
638
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, id, language], function (form) {
|
|
626
639
|
return _objectSpread$f(_objectSpread$f({}, form), {}, {
|
|
627
640
|
questions: data.questions
|
|
628
641
|
});
|
|
629
642
|
});
|
|
630
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id)], function (form) {
|
|
643
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), language], function (form) {
|
|
631
644
|
return _objectSpread$f(_objectSpread$f({}, form), {}, {
|
|
632
645
|
questions: data.questions
|
|
633
646
|
});
|
|
@@ -642,27 +655,23 @@ var useForms = function useForms(options) {
|
|
|
642
655
|
}, options));
|
|
643
656
|
};
|
|
644
657
|
var useDeleteForm = function useDeleteForm(options) {
|
|
645
|
-
|
|
646
|
-
return useMutation(function (_ref5) {
|
|
658
|
+
return useMutationWithInvalidation(function (_ref5) {
|
|
647
659
|
var id = _ref5.id;
|
|
648
660
|
return neetoFormApi.destroyForm(id);
|
|
649
661
|
}, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
662
|
+
keysToInvalidate: function keysToInvalidate(_, _ref6) {
|
|
663
|
+
var id = _ref6.id;
|
|
664
|
+
return [QUERY_KEYS.FORMS, [QUERY_KEYS.QUESTIONS, id], [QUERY_KEYS.QUESTIONS, "preview/".concat(id)]];
|
|
665
|
+
},
|
|
650
666
|
onSuccess: function onSuccess() {
|
|
651
|
-
|
|
652
|
-
args[_key2] = arguments[_key2];
|
|
653
|
-
}
|
|
654
|
-
var id = args[1].id;
|
|
655
|
-
queryClient.invalidateQueries([QUERY_KEYS.FORMS]);
|
|
656
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, id]);
|
|
657
|
-
queryClient.invalidateQueries([QUERY_KEYS.QUESTIONS, "preview/".concat(id)]);
|
|
658
|
-
options.onSuccess && options.onSuccess.apply(options, args);
|
|
667
|
+
options.onSuccess && options.onSuccess.apply(options, arguments);
|
|
659
668
|
}
|
|
660
669
|
}));
|
|
661
670
|
};
|
|
662
|
-
var useSubmission = function useSubmission(
|
|
663
|
-
var formId =
|
|
664
|
-
submissionId =
|
|
665
|
-
options = _objectWithoutProperties$1(
|
|
671
|
+
var useSubmission = function useSubmission(_ref8) {
|
|
672
|
+
var formId = _ref8.formId,
|
|
673
|
+
submissionId = _ref8.submissionId,
|
|
674
|
+
options = _objectWithoutProperties$1(_ref8, _excluded3$1);
|
|
666
675
|
return useQuery([QUERY_KEYS.SUBMISSION, formId, submissionId], function () {
|
|
667
676
|
return neetoFormApi.getPublicSubmission(formId, submissionId);
|
|
668
677
|
}, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
@@ -671,15 +680,15 @@ var useSubmission = function useSubmission(_ref7) {
|
|
|
671
680
|
};
|
|
672
681
|
var useCreateSubmission = function useCreateSubmission(options) {
|
|
673
682
|
var queryClient = useQueryClient();
|
|
674
|
-
return useMutation(function (
|
|
675
|
-
var formId =
|
|
676
|
-
values =
|
|
683
|
+
return useMutation(function (_ref9) {
|
|
684
|
+
var formId = _ref9.formId,
|
|
685
|
+
values = _ref9.values;
|
|
677
686
|
return neetoFormApi.submitPublicForm(formId, values);
|
|
678
687
|
}, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
679
688
|
onSuccess: function onSuccess() {
|
|
680
689
|
var _data$submission, _data$submission2;
|
|
681
|
-
for (var
|
|
682
|
-
args[
|
|
690
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
691
|
+
args[_key2] = arguments[_key2];
|
|
683
692
|
}
|
|
684
693
|
var data = args[0],
|
|
685
694
|
formId = args[1].formId;
|
|
@@ -692,15 +701,15 @@ var useCreateSubmission = function useCreateSubmission(options) {
|
|
|
692
701
|
};
|
|
693
702
|
var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
694
703
|
var queryClient = useQueryClient();
|
|
695
|
-
return useMutation(function (
|
|
696
|
-
var formId =
|
|
697
|
-
values =
|
|
704
|
+
return useMutation(function (_ref10) {
|
|
705
|
+
var formId = _ref10.formId,
|
|
706
|
+
values = _ref10.values;
|
|
698
707
|
return neetoFormApi.updatePublicSubmission(formId, values);
|
|
699
708
|
}, _objectSpread$f(_objectSpread$f({}, options), {}, {
|
|
700
709
|
onSuccess: function onSuccess() {
|
|
701
710
|
var _data$submission3;
|
|
702
|
-
for (var
|
|
703
|
-
args[
|
|
711
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
712
|
+
args[_key3] = arguments[_key3];
|
|
704
713
|
}
|
|
705
714
|
var data = args[0],
|
|
706
715
|
formId = args[1].formId;
|
|
@@ -802,12 +811,12 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
802
811
|
nodeId: "37683bae-da1b-4890-ade9-0664006dc57d"
|
|
803
812
|
}]
|
|
804
813
|
});
|
|
805
|
-
var THUMBS_UP = {
|
|
806
|
-
icon: "👍",
|
|
807
|
-
className: "w-20"
|
|
808
|
-
};
|
|
809
814
|
var QUESTIONS_WITHOUT_FIELD_CODE = ["paragraph", "termsandcondition", "condition", "file_upload"];
|
|
810
815
|
var RESERVED_FIELD_CODES = ["month", "date", "time"];
|
|
816
|
+
var DEFAULT_AVAILABLE_LANGUAGES = [{
|
|
817
|
+
code: "en",
|
|
818
|
+
name: "English"
|
|
819
|
+
}];
|
|
811
820
|
|
|
812
821
|
function _arrayWithHoles$3(arr) {
|
|
813
822
|
if (Array.isArray(arr)) return arr;
|
|
@@ -9864,6 +9873,60 @@ var useBuildFormState = function useBuildFormState() {
|
|
|
9864
9873
|
return useBuildFormStore(prop("formState"));
|
|
9865
9874
|
};
|
|
9866
9875
|
|
|
9876
|
+
var ChangeLanguageDropdown = function ChangeLanguageDropdown(_ref) {
|
|
9877
|
+
var dirty = _ref.dirty,
|
|
9878
|
+
initialLanguage = _ref.initialLanguage,
|
|
9879
|
+
languages = _ref.languages,
|
|
9880
|
+
onChange = _ref.onChange;
|
|
9881
|
+
var _useState = useState(false),
|
|
9882
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
9883
|
+
isUnsavedChangesAlertOpen = _useState2[0],
|
|
9884
|
+
setIsUnsavedChangesAlertOpen = _useState2[1];
|
|
9885
|
+
var _useState3 = useState(initialLanguage),
|
|
9886
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
9887
|
+
selectedLanguage = _useState4[0],
|
|
9888
|
+
setSelectedLanguage = _useState4[1];
|
|
9889
|
+
var _useTranslation = useTranslation(),
|
|
9890
|
+
t = _useTranslation.t;
|
|
9891
|
+
var languageChangeHandler = function languageChangeHandler(code) {
|
|
9892
|
+
if (!dirty) {
|
|
9893
|
+
onChange(code);
|
|
9894
|
+
return;
|
|
9895
|
+
}
|
|
9896
|
+
setSelectedLanguage(code);
|
|
9897
|
+
setIsUnsavedChangesAlertOpen(true);
|
|
9898
|
+
};
|
|
9899
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
9900
|
+
content: t("neetoForm.questions.changeLanguage")
|
|
9901
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Dropdown$2, {
|
|
9902
|
+
buttonStyle: "text",
|
|
9903
|
+
icon: Globe,
|
|
9904
|
+
position: "top-start"
|
|
9905
|
+
}, /*#__PURE__*/React__default.createElement(Dropdown$2.Menu, null, languages.map(function (_ref2) {
|
|
9906
|
+
var code = _ref2.code,
|
|
9907
|
+
name = _ref2.name;
|
|
9908
|
+
return /*#__PURE__*/React__default.createElement(Dropdown$2.MenuItem.Button, {
|
|
9909
|
+
isActive: initialLanguage === code,
|
|
9910
|
+
key: code,
|
|
9911
|
+
onClick: function onClick() {
|
|
9912
|
+
return languageChangeHandler(code);
|
|
9913
|
+
}
|
|
9914
|
+
}, name);
|
|
9915
|
+
}))))), /*#__PURE__*/React__default.createElement(Alert, {
|
|
9916
|
+
isOpen: isUnsavedChangesAlertOpen,
|
|
9917
|
+
message: t("neetoForm.questions.unsavedChangesAlert.message"),
|
|
9918
|
+
submitButtonLabel: t("neetoForm.questions.unsavedChangesAlert.discard"),
|
|
9919
|
+
title: t("neetoForm.questions.unsavedChangesAlert.title"),
|
|
9920
|
+
onClose: function onClose() {
|
|
9921
|
+
return setIsUnsavedChangesAlertOpen(false);
|
|
9922
|
+
},
|
|
9923
|
+
onSubmit: function onSubmit() {
|
|
9924
|
+
onChange(selectedLanguage);
|
|
9925
|
+
setIsUnsavedChangesAlertOpen(false);
|
|
9926
|
+
}
|
|
9927
|
+
}));
|
|
9928
|
+
};
|
|
9929
|
+
|
|
9867
9930
|
var ListItem = function ListItem(_ref) {
|
|
9868
9931
|
var _ref$icon = _ref.icon,
|
|
9869
9932
|
Icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
@@ -10218,6 +10281,7 @@ var FILE_TYPES = {
|
|
|
10218
10281
|
IMAGES: "images",
|
|
10219
10282
|
AUDIO_VIDEO: "audio/video"
|
|
10220
10283
|
};
|
|
10284
|
+
var MULTIPLE_CHOICE_FIELD_MIN_OPTIONS = 2;
|
|
10221
10285
|
var SINGLE_CHOICE_FIELD_MIN_OPTIONS$1 = 2;
|
|
10222
10286
|
var DROPDOWN_FIELD_MIN_OPTIONS$1 = 2;
|
|
10223
10287
|
var STAR_RATING_ICONS_MAP = {
|
|
@@ -10239,6 +10303,8 @@ var FILE_GROUPS = [{
|
|
|
10239
10303
|
label: t$4("neetoForm.fileTypes.audioVideo"),
|
|
10240
10304
|
name: FILE_TYPES.AUDIO_VIDEO
|
|
10241
10305
|
}];
|
|
10306
|
+
var STAR_RATING_MIN_COUNT = 0;
|
|
10307
|
+
var STAR_RATING_MAX_COUNT = 10;
|
|
10242
10308
|
|
|
10243
10309
|
var Dropdown$1 = function Dropdown(_ref) {
|
|
10244
10310
|
var item = _ref.item,
|
|
@@ -10540,7 +10606,10 @@ var MultipleChoice$1 = function MultipleChoice(_ref) {
|
|
|
10540
10606
|
disabled: isLabelDisabled,
|
|
10541
10607
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
10542
10608
|
name: "".concat(name, ".label"),
|
|
10543
|
-
rows: 1
|
|
10609
|
+
rows: 1,
|
|
10610
|
+
placeholder: t("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
10611
|
+
what: t("neetoForm.common.hobbies")
|
|
10612
|
+
})
|
|
10544
10613
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
10545
10614
|
className: "w-full"
|
|
10546
10615
|
}, /*#__PURE__*/React__default.createElement(FieldArray, {
|
|
@@ -10559,14 +10628,17 @@ var MultipleChoice$1 = function MultipleChoice(_ref) {
|
|
|
10559
10628
|
}, /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
|
|
10560
10629
|
required: true,
|
|
10561
10630
|
disabled: freezeOptions,
|
|
10562
|
-
name: "".concat(name, ".optionsAttributes.").concat(index, ".label")
|
|
10631
|
+
name: "".concat(name, ".optionsAttributes.").concat(index, ".label"),
|
|
10632
|
+
placeholder: t("neetoForm.questions.common.questionFields.field.numberedOption", {
|
|
10633
|
+
number: index + 1
|
|
10634
|
+
})
|
|
10563
10635
|
}), !freezeOptions && /*#__PURE__*/React__default.createElement(Button$1, {
|
|
10564
|
-
className: classnames({
|
|
10565
|
-
invisible: index === 0
|
|
10566
|
-
}),
|
|
10567
10636
|
icon: Delete,
|
|
10568
10637
|
size: "small",
|
|
10569
10638
|
style: "text",
|
|
10639
|
+
className: classnames({
|
|
10640
|
+
invisible: index < MULTIPLE_CHOICE_FIELD_MIN_OPTIONS
|
|
10641
|
+
}),
|
|
10570
10642
|
tooltipProps: {
|
|
10571
10643
|
position: "top",
|
|
10572
10644
|
content: t("neetoForm.common.delete")
|
|
@@ -10783,7 +10855,10 @@ var SingleChoice$1 = function SingleChoice(_ref) {
|
|
|
10783
10855
|
disabled: isLabelDisabled,
|
|
10784
10856
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
10785
10857
|
name: "".concat(name, ".label"),
|
|
10786
|
-
rows: 1
|
|
10858
|
+
rows: 1,
|
|
10859
|
+
placeholder: t("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
10860
|
+
what: t("neetoForm.common.country")
|
|
10861
|
+
})
|
|
10787
10862
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
10788
10863
|
className: "w-full"
|
|
10789
10864
|
}, /*#__PURE__*/React__default.createElement(FieldArray, {
|
|
@@ -10843,6 +10918,26 @@ var SingleChoice$1 = function SingleChoice(_ref) {
|
|
|
10843
10918
|
}));
|
|
10844
10919
|
};
|
|
10845
10920
|
|
|
10921
|
+
var validateStarRatingCount = function validateStarRatingCount(value) {
|
|
10922
|
+
try {
|
|
10923
|
+
var schema = yup.number().integer().transform(function (value) {
|
|
10924
|
+
return isNaN(value) ? null : value;
|
|
10925
|
+
}).min(STAR_RATING_MIN_COUNT, t$4("neetoForm.error.minCount", {
|
|
10926
|
+
field: t$4("neetoForm.common.count"),
|
|
10927
|
+
value: STAR_RATING_MIN_COUNT
|
|
10928
|
+
})).max(STAR_RATING_MAX_COUNT, t$4("neetoForm.error.maxCount", {
|
|
10929
|
+
field: t$4("neetoForm.common.count"),
|
|
10930
|
+
value: STAR_RATING_MAX_COUNT
|
|
10931
|
+
})).nullable().required(t$4("neetoForm.common.fieldReq", {
|
|
10932
|
+
field: t$4("neetoForm.common.count")
|
|
10933
|
+
}));
|
|
10934
|
+
schema.validateSync(value);
|
|
10935
|
+
return undefined;
|
|
10936
|
+
} catch (error) {
|
|
10937
|
+
return error.message;
|
|
10938
|
+
}
|
|
10939
|
+
};
|
|
10940
|
+
|
|
10846
10941
|
var StarRating$3 = function StarRating(_ref) {
|
|
10847
10942
|
var name = _ref.name,
|
|
10848
10943
|
isRequired = _ref.isRequired,
|
|
@@ -10852,8 +10947,19 @@ var StarRating$3 = function StarRating(_ref) {
|
|
|
10852
10947
|
t = _useTranslation.t;
|
|
10853
10948
|
var _useField = useField("".concat(name, ".shape")),
|
|
10854
10949
|
_useField2 = _slicedToArray$3(_useField, 3),
|
|
10855
|
-
|
|
10856
|
-
|
|
10950
|
+
shape = _useField2[0].value;
|
|
10951
|
+
_useField2[1];
|
|
10952
|
+
var setShape = _useField2[2].setValue;
|
|
10953
|
+
var _useField3 = useField({
|
|
10954
|
+
name: "".concat(name, ".count"),
|
|
10955
|
+
validate: validateStarRatingCount
|
|
10956
|
+
}),
|
|
10957
|
+
_useField4 = _slicedToArray$3(_useField3, 3),
|
|
10958
|
+
countField = _useField4[0],
|
|
10959
|
+
_useField4$ = _useField4[1],
|
|
10960
|
+
countTouched = _useField4$.touched,
|
|
10961
|
+
countError = _useField4$.error,
|
|
10962
|
+
setCount = _useField4[2].setValue;
|
|
10857
10963
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10858
10964
|
className: "space-y-4"
|
|
10859
10965
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -10864,19 +10970,22 @@ var StarRating$3 = function StarRating(_ref) {
|
|
|
10864
10970
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
10865
10971
|
name: "".concat(name, ".label"),
|
|
10866
10972
|
rows: 1
|
|
10867
|
-
})), /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
|
|
10973
|
+
})), /*#__PURE__*/React__default.createElement(InputWithMaxLength, _extends$8({
|
|
10974
|
+
required: true
|
|
10975
|
+
}, countField, {
|
|
10976
|
+
error: countTouched ? countError : "",
|
|
10868
10977
|
label: t("neetoForm.common.count"),
|
|
10869
|
-
max:
|
|
10870
|
-
min:
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
}), /*#__PURE__*/React__default.createElement(Label, null, t("neetoForm.common.icon")), /*#__PURE__*/React__default.createElement("div", {
|
|
10978
|
+
max: STAR_RATING_MAX_COUNT,
|
|
10979
|
+
min: STAR_RATING_MIN_COUNT,
|
|
10980
|
+
type: "number",
|
|
10981
|
+
onChange: withEventTargetValue(setCount)
|
|
10982
|
+
})), /*#__PURE__*/React__default.createElement(Label, null, t("neetoForm.common.icon")), /*#__PURE__*/React__default.createElement("div", {
|
|
10874
10983
|
className: "flex gap-2"
|
|
10875
10984
|
}, Object.entries(STAR_RATING_ICONS_MAP).map(function (_ref2) {
|
|
10876
10985
|
var _ref3 = _slicedToArray$3(_ref2, 2),
|
|
10877
10986
|
name = _ref3[0],
|
|
10878
10987
|
Shape = _ref3[1];
|
|
10879
|
-
var isActive = name ===
|
|
10988
|
+
var isActive = name === shape;
|
|
10880
10989
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10881
10990
|
key: name,
|
|
10882
10991
|
className: classnames("flex h-10 w-10 items-center justify-center gap-2", "neeto-ui-border-gray-800 neeto-ui-rounded-full cursor-pointer border", "transition-all duration-300 ease-in-out", {
|
|
@@ -10884,7 +10993,7 @@ var StarRating$3 = function StarRating(_ref) {
|
|
|
10884
10993
|
"neeto-ui-text-white neeto-ui-bg-gray-800": isActive
|
|
10885
10994
|
}),
|
|
10886
10995
|
onClick: function onClick() {
|
|
10887
|
-
return
|
|
10996
|
+
return setShape(name);
|
|
10888
10997
|
}
|
|
10889
10998
|
}, /*#__PURE__*/React__default.createElement(Shape, null));
|
|
10890
10999
|
})), !isRequired && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -10972,22 +11081,28 @@ var Editor = function Editor(_ref) {
|
|
|
10972
11081
|
name: fieldName,
|
|
10973
11082
|
validate: validateContent
|
|
10974
11083
|
}),
|
|
10975
|
-
_useField2 = _slicedToArray$3(_useField,
|
|
11084
|
+
_useField2 = _slicedToArray$3(_useField, 3),
|
|
10976
11085
|
value = _useField2[0].value,
|
|
10977
|
-
|
|
11086
|
+
_useField2$ = _useField2[1],
|
|
11087
|
+
touched = _useField2$.touched,
|
|
11088
|
+
error = _useField2$.error,
|
|
11089
|
+
setTouched = _useField2[2].setTouched;
|
|
10978
11090
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10979
11091
|
className: "w-full cursor-auto"
|
|
10980
11092
|
}, /*#__PURE__*/React__default.createElement(Editor$1, {
|
|
10981
|
-
error: error,
|
|
10982
11093
|
className: "px-2 pb-2",
|
|
10983
11094
|
contentClassName: "border-none",
|
|
10984
11095
|
disabled: isLabelDisabled,
|
|
11096
|
+
error: touched ? error : "",
|
|
10985
11097
|
errorWrapperClassName: "border-none",
|
|
10986
11098
|
id: "editor",
|
|
10987
11099
|
initialValue: value,
|
|
10988
11100
|
menuClassName: "border-none",
|
|
10989
11101
|
name: fieldName,
|
|
10990
11102
|
ref: editorRef,
|
|
11103
|
+
onBlur: function onBlur() {
|
|
11104
|
+
setTouched(true);
|
|
11105
|
+
},
|
|
10991
11106
|
onChange: function onChange(text) {
|
|
10992
11107
|
var _editorRef$current$ed;
|
|
10993
11108
|
setFieldValue((_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 || (_editorRef$current$ed = _editorRef$current$ed.contentComponent) === null || _editorRef$current$ed === void 0 || (_editorRef$current$ed = _editorRef$current$ed.props) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.name, text);
|
|
@@ -11115,9 +11230,9 @@ var QUESTION_KINDS = [{
|
|
|
11115
11230
|
defaults: {
|
|
11116
11231
|
label: "",
|
|
11117
11232
|
isRequired: false,
|
|
11118
|
-
optionsAttributes:
|
|
11233
|
+
optionsAttributes: new Array(MULTIPLE_CHOICE_FIELD_MIN_OPTIONS).fill({
|
|
11119
11234
|
label: ""
|
|
11120
|
-
}
|
|
11235
|
+
})
|
|
11121
11236
|
}
|
|
11122
11237
|
}, {
|
|
11123
11238
|
type: "radio",
|
|
@@ -11569,7 +11684,7 @@ var List = function List(_ref) {
|
|
|
11569
11684
|
})))));
|
|
11570
11685
|
};
|
|
11571
11686
|
|
|
11572
|
-
var _excluded$5 = ["questionKinds", "showAddQuestionDivider", "onValueChange", "showActionBlock", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "kindUniqueOn", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode"];
|
|
11687
|
+
var _excluded$5 = ["questionKinds", "showAddQuestionDivider", "onValueChange", "showActionBlock", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "kindUniqueOn", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange"];
|
|
11573
11688
|
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11574
11689
|
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11575
11690
|
var Form = function Form(_ref) {
|
|
@@ -11589,6 +11704,11 @@ var Form = function Form(_ref) {
|
|
|
11589
11704
|
isDisabledFieldLabel = _ref.isDisabledFieldLabel,
|
|
11590
11705
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
11591
11706
|
enableFieldCode = _ref.enableFieldCode,
|
|
11707
|
+
formTitle = _ref.formTitle,
|
|
11708
|
+
formDescription = _ref.formDescription,
|
|
11709
|
+
selectedLanguage = _ref.selectedLanguage,
|
|
11710
|
+
availableLanguages = _ref.availableLanguages,
|
|
11711
|
+
onLanguageChange = _ref.onLanguageChange,
|
|
11592
11712
|
formDomProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
11593
11713
|
var _useTranslation = useTranslation(),
|
|
11594
11714
|
t = _useTranslation.t;
|
|
@@ -11702,7 +11822,24 @@ var Form = function Form(_ref) {
|
|
|
11702
11822
|
noValidate: true
|
|
11703
11823
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
11704
11824
|
className: "w-full flex-grow overflow-y-auto"
|
|
11705
|
-
},
|
|
11825
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11826
|
+
className: "mb-4"
|
|
11827
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11828
|
+
className: "flex items-center justify-between"
|
|
11829
|
+
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
11830
|
+
"data-cy": "meeting-header",
|
|
11831
|
+
lineHeight: "normal",
|
|
11832
|
+
style: "h4",
|
|
11833
|
+
weight: "semibold"
|
|
11834
|
+
}, formTitle), availableLanguages.length > 1 && /*#__PURE__*/React__default.createElement(ChangeLanguageDropdown, {
|
|
11835
|
+
dirty: dirty,
|
|
11836
|
+
initialLanguage: selectedLanguage,
|
|
11837
|
+
languages: availableLanguages,
|
|
11838
|
+
onChange: function onChange(code) {
|
|
11839
|
+
resetForm();
|
|
11840
|
+
onLanguageChange(code);
|
|
11841
|
+
}
|
|
11842
|
+
})), formDescription), hasActiveQuestions ? /*#__PURE__*/React__default.createElement(FieldArray, {
|
|
11706
11843
|
name: "questions"
|
|
11707
11844
|
}, function (_ref2) {
|
|
11708
11845
|
var insert = _ref2.insert,
|
|
@@ -11856,20 +11993,27 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
11856
11993
|
allowAdditionalGuests = _ref$allowAdditionalG === void 0 ? false : _ref$allowAdditionalG,
|
|
11857
11994
|
disabledAddButtonTooltipProps = _ref.disabledAddButtonTooltipProps,
|
|
11858
11995
|
_ref$enableFieldCode = _ref.enableFieldCode,
|
|
11859
|
-
enableFieldCode = _ref$enableFieldCode === void 0 ? false : _ref$enableFieldCode
|
|
11996
|
+
enableFieldCode = _ref$enableFieldCode === void 0 ? false : _ref$enableFieldCode,
|
|
11997
|
+
_ref$availableLanguag = _ref.availableLanguages,
|
|
11998
|
+
availableLanguages = _ref$availableLanguag === void 0 ? DEFAULT_AVAILABLE_LANGUAGES : _ref$availableLanguag,
|
|
11999
|
+
formDescription = _ref.formDescription,
|
|
12000
|
+
_ref$formTitle = _ref.formTitle,
|
|
12001
|
+
formTitle = _ref$formTitle === void 0 ? "" : _ref$formTitle,
|
|
12002
|
+
_ref$selectedLanguage = _ref.selectedLanguage,
|
|
12003
|
+
selectedLanguage = _ref$selectedLanguage === void 0 ? "en" : _ref$selectedLanguage,
|
|
12004
|
+
_ref$onLanguageChange = _ref.onLanguageChange,
|
|
12005
|
+
onLanguageChange = _ref$onLanguageChange === void 0 ? noop$4 : _ref$onLanguageChange;
|
|
11860
12006
|
var queryClient = useQueryClient();
|
|
11861
12007
|
var _useUpdateQuestions = useUpdateQuestions({
|
|
11862
12008
|
formId: id,
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
onSuccess: function onSuccess() {
|
|
11867
|
-
return Toastr.success("", THUMBS_UP);
|
|
11868
|
-
}
|
|
12009
|
+
language: selectedLanguage,
|
|
12010
|
+
onError: Toastr.error,
|
|
12011
|
+
onSuccess: showThumbsUpToastr
|
|
11869
12012
|
}),
|
|
11870
12013
|
updateQuestions = _useUpdateQuestions.mutateAsync;
|
|
11871
12014
|
var _useForm = useForm({
|
|
11872
12015
|
formId: id,
|
|
12016
|
+
language: selectedLanguage,
|
|
11873
12017
|
onSuccess: function onSuccess(data) {
|
|
11874
12018
|
return onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(data);
|
|
11875
12019
|
},
|
|
@@ -11903,15 +12047,17 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
11903
12047
|
return updateQuestions({
|
|
11904
12048
|
id: id,
|
|
11905
12049
|
values: _objectSpread$b({
|
|
11906
|
-
neetoFormQuestion: payload
|
|
12050
|
+
neetoFormQuestion: _objectSpread$b(_objectSpread$b({}, payload), {}, {
|
|
12051
|
+
language: selectedLanguage
|
|
12052
|
+
})
|
|
11907
12053
|
}, buildRequestArgs)
|
|
11908
12054
|
});
|
|
11909
12055
|
};
|
|
11910
12056
|
var onValueChange = function onValueChange(questions) {
|
|
11911
|
-
var _queryClient$getQuery = queryClient.getQueryState([QUERY_KEYS.QUESTIONS, id]),
|
|
12057
|
+
var _queryClient$getQuery = queryClient.getQueryState([QUERY_KEYS.QUESTIONS, id, selectedLanguage]),
|
|
11912
12058
|
dataUpdateCount = _queryClient$getQuery.dataUpdateCount;
|
|
11913
12059
|
if (dataUpdateCount > 0) {
|
|
11914
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id)], assoc("questions", questions));
|
|
12060
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(id), selectedLanguage], assoc("questions", questions));
|
|
11915
12061
|
}
|
|
11916
12062
|
};
|
|
11917
12063
|
var isDeletable = isQuestionDeletable !== null && isQuestionDeletable !== void 0 ? isQuestionDeletable : function (question) {
|
|
@@ -11940,16 +12086,21 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
11940
12086
|
var errors = _ref3.errors,
|
|
11941
12087
|
setFieldError = _ref3.setFieldError;
|
|
11942
12088
|
return /*#__PURE__*/React__default.createElement(Form, _extends$8({}, _objectSpread$b(_objectSpread$b({}, formDomProps), {}, {
|
|
12089
|
+
availableLanguages: availableLanguages,
|
|
11943
12090
|
cancelButtonProps: cancelButtonProps,
|
|
11944
12091
|
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
11945
12092
|
enableFieldCode: enableFieldCode,
|
|
12093
|
+
formDescription: formDescription,
|
|
12094
|
+
formTitle: formTitle,
|
|
11946
12095
|
getActiveKindDetails: getActiveKindDetails,
|
|
11947
12096
|
isDeletable: isDeletable,
|
|
11948
12097
|
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
11949
12098
|
isKindAlreadyActive: isKindAlreadyActive,
|
|
11950
12099
|
isRequiredField: isRequiredField,
|
|
11951
12100
|
kindUniqueOn: kindUniqueOn,
|
|
12101
|
+
onLanguageChange: onLanguageChange,
|
|
11952
12102
|
onValueChange: onValueChange,
|
|
12103
|
+
selectedLanguage: selectedLanguage,
|
|
11953
12104
|
showActionBlock: showActionBlock,
|
|
11954
12105
|
showAddQuestionDivider: showAddQuestionDivider,
|
|
11955
12106
|
submitButtonProps: submitButtonProps
|
|
@@ -26618,6 +26769,7 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
26618
26769
|
isRequired = question.isRequired,
|
|
26619
26770
|
count = question.count,
|
|
26620
26771
|
shape = question.shape;
|
|
26772
|
+
var sanitizedCount = clamp$2(0, 10, parseInt(count)) || 0;
|
|
26621
26773
|
return /*#__PURE__*/React__default.createElement(Field, {
|
|
26622
26774
|
name: name,
|
|
26623
26775
|
validate: validateFieldValue({
|
|
@@ -26630,11 +26782,11 @@ var StarRatingField = function StarRatingField(_ref) {
|
|
|
26630
26782
|
var meta = _ref2.meta,
|
|
26631
26783
|
field = _ref2.field;
|
|
26632
26784
|
return /*#__PURE__*/React__default.createElement(StarRating$1, _extends$8({
|
|
26633
|
-
count: count,
|
|
26634
|
-
error: meta.touched ? meta.error : "",
|
|
26635
|
-
label: getLabel$1(label, isRequired),
|
|
26636
26785
|
name: name,
|
|
26637
|
-
shape: shape
|
|
26786
|
+
shape: shape,
|
|
26787
|
+
count: sanitizedCount,
|
|
26788
|
+
error: meta.touched ? meta.error : "",
|
|
26789
|
+
label: getLabel$1(label, isRequired)
|
|
26638
26790
|
}, field));
|
|
26639
26791
|
});
|
|
26640
26792
|
};
|
|
@@ -26851,7 +27003,9 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
26851
27003
|
_ref$autoCompleteKind = _ref.autoCompleteKinds,
|
|
26852
27004
|
autoCompleteKinds = _ref$autoCompleteKind === void 0 ? [] : _ref$autoCompleteKind,
|
|
26853
27005
|
_ref$enablePreFilling = _ref.enablePreFilling,
|
|
26854
|
-
enablePreFilling = _ref$enablePreFilling === void 0 ? false : _ref$enablePreFilling
|
|
27006
|
+
enablePreFilling = _ref$enablePreFilling === void 0 ? false : _ref$enablePreFilling,
|
|
27007
|
+
_ref$language = _ref.language,
|
|
27008
|
+
language = _ref$language === void 0 ? "en" : _ref$language;
|
|
26855
27009
|
var _useState = useState(false),
|
|
26856
27010
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
26857
27011
|
isSubmitted = _useState2[0],
|
|
@@ -27062,6 +27216,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
27062
27216
|
var _useForm = useForm({
|
|
27063
27217
|
formId: formId,
|
|
27064
27218
|
preview: preview,
|
|
27219
|
+
language: language,
|
|
27065
27220
|
onError: Toastr.error,
|
|
27066
27221
|
enabled: !preview,
|
|
27067
27222
|
placeholderData: {
|