@bigbinary/neeto-form-frontend 2.0.2 → 2.0.4
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/de.json +26 -6
- package/app/javascript/src/translations/en.json +7 -7
- package/app/javascript/src/translations/es.json +34 -0
- package/app/javascript/src/translations/fr.json +34 -0
- package/app/javascript/src/translations/nl.json +34 -0
- package/app/javascript/src/translations/pl.json +34 -0
- package/app/javascript/src/translations/pt.json +34 -0
- package/dist/index.cjs.js +73 -43
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +125 -95
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,14 +7,14 @@ import { buildUrl, showThumbsUpToastr, withEventTargetValue, getQueryParams, dat
|
|
|
7
7
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
8
8
|
import { assoc, mergeLeft, compose as compose$1, isEmpty, trim, useWith, path, split, isNotNil, either, isNil, values, equals, modify, prop, range, includes, __, reduce, reject, keys, pick, omit, pluck, without, difference, pipe as pipe$1, last, not, toLower, map, identity, clamp as clamp$2, filter as filter$1 } from 'ramda';
|
|
9
9
|
import { useQuery, useQueryClient, useMutation } from 'react-query';
|
|
10
|
-
import i18next, { t as t$
|
|
10
|
+
import i18next, { t as t$7 } from 'i18next';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
13
13
|
import { useMutationWithInvalidation, withImmutableActions, withT, useStateWithDependency, useOnClickOutside, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
import ReactDOM, { unstable_batchedUpdates, flushSync as flushSync$1 } from 'react-dom';
|
|
16
16
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
17
|
-
import { useTranslation, Trans } from 'react-i18next';
|
|
17
|
+
import { useTranslation, Trans, I18nextProvider } from 'react-i18next';
|
|
18
18
|
import { create as create$2 } from 'zustand';
|
|
19
19
|
import { isEditorEmpty, Editor as Editor$1, EditorContent } from '@bigbinary/neeto-editor';
|
|
20
20
|
import { shallow } from 'zustand/shallow';
|
|
@@ -436,15 +436,15 @@ var QUESTION_KIND = {
|
|
|
436
436
|
};
|
|
437
437
|
var RATING_VALUES = {
|
|
438
438
|
GOOD: {
|
|
439
|
-
label: t$
|
|
439
|
+
label: t$7("neetoForm.common.good"),
|
|
440
440
|
value: "good"
|
|
441
441
|
},
|
|
442
442
|
AVERAGE: {
|
|
443
|
-
label: t$
|
|
443
|
+
label: t$7("neetoForm.common.okay"),
|
|
444
444
|
value: "okay"
|
|
445
445
|
},
|
|
446
446
|
BAD: {
|
|
447
|
-
label: t$
|
|
447
|
+
label: t$7("neetoForm.common.bad"),
|
|
448
448
|
value: "bad"
|
|
449
449
|
}
|
|
450
450
|
};
|
|
@@ -1512,7 +1512,7 @@ var useSyncExternalStoreShim_production_min = {};
|
|
|
1512
1512
|
* LICENSE file in the root directory of this source tree.
|
|
1513
1513
|
*/
|
|
1514
1514
|
var e$2=React__default;function h$3(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k$2="function"===typeof Object.is?Object.is:h$3,l$2=e$2.useState,m$2=e$2.useEffect,n$3=e$2.useLayoutEffect,p$3=e$2.useDebugValue;function q$3(a,b){var d=b(),f=l$2({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n$3(function(){c.value=d;c.getSnapshot=b;r$2(c)&&g({inst:c});},[a,d,b]);m$2(function(){r$2(c)&&g({inst:c});return a(function(){r$2(c)&&g({inst:c});})},[a]);p$3(d);return d}
|
|
1515
|
-
function r$2(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k$2(a,d)}catch(f){return !0}}function t$
|
|
1515
|
+
function r$2(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k$2(a,d)}catch(f){return !0}}function t$6(a,b){return b()}var u$2="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t$6:q$3;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e$2.useSyncExternalStore?e$2.useSyncExternalStore:u$2;
|
|
1516
1516
|
|
|
1517
1517
|
{
|
|
1518
1518
|
shim.exports = useSyncExternalStoreShim_production_min;
|
|
@@ -1531,8 +1531,8 @@ var withSelector_production_min = {};
|
|
|
1531
1531
|
* This source code is licensed under the MIT license found in the
|
|
1532
1532
|
* LICENSE file in the root directory of this source tree.
|
|
1533
1533
|
*/
|
|
1534
|
-
var h$2=React__default,n$2=shimExports;function p$2(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q$2="function"===typeof Object.is?Object.is:p$2,r$1=n$2.useSyncExternalStore,t$
|
|
1535
|
-
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$
|
|
1534
|
+
var h$2=React__default,n$2=shimExports;function p$2(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q$2="function"===typeof Object.is?Object.is:p$2,r$1=n$2.useSyncExternalStore,t$5=h$2.useRef,u$1=h$2.useEffect,v$2=h$2.useMemo,w$1=h$2.useDebugValue;
|
|
1535
|
+
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$5(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v$2(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q$2(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r$1(a,c[0],c[1]);
|
|
1536
1536
|
u$1(function(){f.hasValue=!0;f.value=d;},[d]);w$1(d);return d};
|
|
1537
1537
|
|
|
1538
1538
|
// Default to a dummy "batch" implementation that just runs the callback
|
|
@@ -1614,11 +1614,11 @@ var reactIs_production_min$1 = {};
|
|
|
1614
1614
|
* LICENSE file in the root directory of this source tree.
|
|
1615
1615
|
*/
|
|
1616
1616
|
var b$2="function"===typeof Symbol&&Symbol.for,c$2=b$2?Symbol.for("react.element"):60103,d$1=b$2?Symbol.for("react.portal"):60106,e$1=b$2?Symbol.for("react.fragment"):60107,f$1=b$2?Symbol.for("react.strict_mode"):60108,g$1=b$2?Symbol.for("react.profiler"):60114,h$1=b$2?Symbol.for("react.provider"):60109,k$1=b$2?Symbol.for("react.context"):60110,l$1=b$2?Symbol.for("react.async_mode"):60111,m$1=b$2?Symbol.for("react.concurrent_mode"):60111,n$1=b$2?Symbol.for("react.forward_ref"):60112,p$1=b$2?Symbol.for("react.suspense"):60113,q$1=b$2?
|
|
1617
|
-
Symbol.for("react.suspense_list"):60120,r=b$2?Symbol.for("react.memo"):60115,t$
|
|
1618
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$2:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$
|
|
1619
|
-
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l$1};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z(a)===t$
|
|
1617
|
+
Symbol.for("react.suspense_list"):60120,r=b$2?Symbol.for("react.memo"):60115,t$4=b$2?Symbol.for("react.lazy"):60116,v$1=b$2?Symbol.for("react.block"):60121,w=b$2?Symbol.for("react.fundamental"):60117,x=b$2?Symbol.for("react.responder"):60118,y=b$2?Symbol.for("react.scope"):60119;
|
|
1618
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$2:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$4:case r:case h$1:return a;default:return u}}case d$1:return u}}}function A(a){return z(a)===m$1}reactIs_production_min$1.AsyncMode=l$1;reactIs_production_min$1.ConcurrentMode=m$1;reactIs_production_min$1.ContextConsumer=k$1;reactIs_production_min$1.ContextProvider=h$1;reactIs_production_min$1.Element=c$2;reactIs_production_min$1.ForwardRef=n$1;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$4;reactIs_production_min$1.Memo=r;reactIs_production_min$1.Portal=d$1;
|
|
1619
|
+
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l$1};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z(a)===t$4};
|
|
1620
1620
|
reactIs_production_min$1.isMemo=function(a){return z(a)===r};reactIs_production_min$1.isPortal=function(a){return z(a)===d$1};reactIs_production_min$1.isProfiler=function(a){return z(a)===g$1};reactIs_production_min$1.isStrictMode=function(a){return z(a)===f$1};reactIs_production_min$1.isSuspense=function(a){return z(a)===p$1};
|
|
1621
|
-
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$
|
|
1621
|
+
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$4||a.$$typeof===r||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===n$1||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v$1)};reactIs_production_min$1.typeOf=z;
|
|
1622
1622
|
|
|
1623
1623
|
{
|
|
1624
1624
|
reactIs$2.exports = reactIs_production_min$1;
|
|
@@ -1743,11 +1743,11 @@ var reactIs_production_min = {};
|
|
|
1743
1743
|
* This source code is licensed under the MIT license found in the
|
|
1744
1744
|
* LICENSE file in the root directory of this source tree.
|
|
1745
1745
|
*/
|
|
1746
|
-
var b$1=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
1746
|
+
var b$1=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t$3=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
1747
1747
|
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b$1:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c$1:return r}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b$1;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c$1;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;
|
|
1748
1748
|
reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return v(a)===h};reactIs_production_min.isContextProvider=function(a){return v(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b$1};reactIs_production_min.isForwardRef=function(a){return v(a)===l};reactIs_production_min.isFragment=function(a){return v(a)===d};reactIs_production_min.isLazy=function(a){return v(a)===q};reactIs_production_min.isMemo=function(a){return v(a)===p};
|
|
1749
1749
|
reactIs_production_min.isPortal=function(a){return v(a)===c$1};reactIs_production_min.isProfiler=function(a){return v(a)===f};reactIs_production_min.isStrictMode=function(a){return v(a)===e};reactIs_production_min.isSuspense=function(a){return v(a)===m};reactIs_production_min.isSuspenseList=function(a){return v(a)===n};
|
|
1750
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v;
|
|
1750
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t$3||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v;
|
|
1751
1751
|
|
|
1752
1752
|
{
|
|
1753
1753
|
reactIs.exports = reactIs_production_min;
|
|
@@ -9909,7 +9909,7 @@ var ConnectedDroppable$1 = ConnectedDroppable;
|
|
|
9909
9909
|
var isBlank = compose$1(isEmpty, trim);
|
|
9910
9910
|
var parseServerError = function parseServerError(error) {
|
|
9911
9911
|
var _error$notice;
|
|
9912
|
-
return (_error$notice = error.notice) !== null && _error$notice !== void 0 ? _error$notice : t$
|
|
9912
|
+
return (_error$notice = error.notice) !== null && _error$notice !== void 0 ? _error$notice : t$7("neetoForm.common.somethingWentWrong");
|
|
9913
9913
|
};
|
|
9914
9914
|
var isEmptyValues = function isEmptyValues(obj) {
|
|
9915
9915
|
return either(isNil, isEmpty)(obj) ? true : values(obj).every(function (value) {
|
|
@@ -11601,13 +11601,13 @@ var STAR_RATING_MIN_VALUE_OPTIONS = generateRatingOptions([0, 1]);
|
|
|
11601
11601
|
var FILE_TYPES_MAP = (_FILE_TYPES_MAP = {}, _defineProperty$6(_FILE_TYPES_MAP, FILE_TYPES.DOCUMENTS, ["pdf", "doc", "docx", "xls", "xlsx", "csv", "txt", "rtf", "html", "zip", "md"]), _defineProperty$6(_FILE_TYPES_MAP, FILE_TYPES.IMAGES, ["jpg", "jpeg", "png", "gif"]), _defineProperty$6(_FILE_TYPES_MAP, FILE_TYPES.AUDIO_VIDEO, ["mp3", "wma", "mpg", "flv", "avi"]), _FILE_TYPES_MAP);
|
|
11602
11602
|
var DEFAULT_ALLOWED_FILE_TYPES = values(FILE_TYPES_MAP).flat().join(", ");
|
|
11603
11603
|
var FILE_GROUPS = [{
|
|
11604
|
-
label: t$
|
|
11604
|
+
label: t$7("neetoForm.fileTypes.documents"),
|
|
11605
11605
|
name: FILE_TYPES.DOCUMENTS
|
|
11606
11606
|
}, {
|
|
11607
|
-
label: t$
|
|
11607
|
+
label: t$7("neetoForm.fileTypes.images"),
|
|
11608
11608
|
name: FILE_TYPES.IMAGES
|
|
11609
11609
|
}, {
|
|
11610
|
-
label: t$
|
|
11610
|
+
label: t$7("neetoForm.fileTypes.audioVideo"),
|
|
11611
11611
|
name: FILE_TYPES.AUDIO_VIDEO
|
|
11612
11612
|
}];
|
|
11613
11613
|
|
|
@@ -11635,77 +11635,77 @@ var DEFAULT_OPTIONS$1 = new Array(MINIMUM_OPTIONS).fill({
|
|
|
11635
11635
|
});
|
|
11636
11636
|
var QUESTION_KINDS = [{
|
|
11637
11637
|
type: EMAIL$1,
|
|
11638
|
-
label: t$
|
|
11638
|
+
label: t$7("neetoForm.fields.eif"),
|
|
11639
11639
|
isSingular: true,
|
|
11640
11640
|
defaults: {
|
|
11641
11641
|
label: ""
|
|
11642
11642
|
}
|
|
11643
11643
|
}, {
|
|
11644
11644
|
type: ADDITIONAL_GUESTS$1,
|
|
11645
|
-
label: t$
|
|
11645
|
+
label: t$7("neetoForm.fields.agif"),
|
|
11646
11646
|
isSingular: true,
|
|
11647
11647
|
defaults: {
|
|
11648
|
-
label: t$
|
|
11648
|
+
label: t$7("neetoForm.common.addAdditionalGuests")
|
|
11649
11649
|
}
|
|
11650
11650
|
}, {
|
|
11651
11651
|
type: PHONE$1,
|
|
11652
|
-
label: t$
|
|
11652
|
+
label: t$7("neetoForm.fields.pif"),
|
|
11653
11653
|
isSingular: true,
|
|
11654
11654
|
defaults: {
|
|
11655
11655
|
label: ""
|
|
11656
11656
|
}
|
|
11657
11657
|
}, {
|
|
11658
11658
|
type: NAME$1,
|
|
11659
|
-
label: t$
|
|
11659
|
+
label: t$7("neetoForm.fields.nif"),
|
|
11660
11660
|
isSingular: true,
|
|
11661
11661
|
defaults: {
|
|
11662
11662
|
label: ""
|
|
11663
11663
|
}
|
|
11664
11664
|
}, {
|
|
11665
11665
|
type: TEXT$1,
|
|
11666
|
-
label: t$
|
|
11666
|
+
label: t$7("neetoForm.fields.tif"),
|
|
11667
11667
|
isSingular: false,
|
|
11668
11668
|
defaults: {
|
|
11669
11669
|
label: ""
|
|
11670
11670
|
}
|
|
11671
11671
|
}, {
|
|
11672
11672
|
type: TEXTAREA$1,
|
|
11673
|
-
label: t$
|
|
11673
|
+
label: t$7("neetoForm.fields.qif"),
|
|
11674
11674
|
isSingular: false,
|
|
11675
11675
|
defaults: {
|
|
11676
11676
|
label: ""
|
|
11677
11677
|
}
|
|
11678
11678
|
}, {
|
|
11679
11679
|
type: INTEGER$1,
|
|
11680
|
-
label: t$
|
|
11680
|
+
label: t$7("neetoForm.fields.iif"),
|
|
11681
11681
|
isSingular: false,
|
|
11682
11682
|
defaults: {
|
|
11683
11683
|
label: ""
|
|
11684
11684
|
}
|
|
11685
11685
|
}, {
|
|
11686
11686
|
type: DECIMAL$1,
|
|
11687
|
-
label: t$
|
|
11687
|
+
label: t$7("neetoForm.fields.dif"),
|
|
11688
11688
|
isSingular: false,
|
|
11689
11689
|
defaults: {
|
|
11690
11690
|
label: ""
|
|
11691
11691
|
}
|
|
11692
11692
|
}, {
|
|
11693
11693
|
type: RICH_TEXT$1,
|
|
11694
|
-
label: t$
|
|
11694
|
+
label: t$7("neetoForm.fields.rtf"),
|
|
11695
11695
|
isSingular: false,
|
|
11696
11696
|
defaults: {
|
|
11697
11697
|
label: ""
|
|
11698
11698
|
}
|
|
11699
11699
|
}, {
|
|
11700
11700
|
type: PARAGRAPH,
|
|
11701
|
-
label: t$
|
|
11701
|
+
label: t$7("neetoForm.fields.def"),
|
|
11702
11702
|
isSingular: false,
|
|
11703
11703
|
defaults: {
|
|
11704
11704
|
label: ""
|
|
11705
11705
|
}
|
|
11706
11706
|
}, {
|
|
11707
11707
|
type: CHECKBOX$1,
|
|
11708
|
-
label: t$
|
|
11708
|
+
label: t$7("neetoForm.fields.mcf"),
|
|
11709
11709
|
isSingular: false,
|
|
11710
11710
|
defaults: {
|
|
11711
11711
|
label: "",
|
|
@@ -11714,7 +11714,7 @@ var QUESTION_KINDS = [{
|
|
|
11714
11714
|
}
|
|
11715
11715
|
}, {
|
|
11716
11716
|
type: RADIO$1,
|
|
11717
|
-
label: t$
|
|
11717
|
+
label: t$7("neetoForm.fields.scf"),
|
|
11718
11718
|
isSingular: false,
|
|
11719
11719
|
defaults: {
|
|
11720
11720
|
label: "",
|
|
@@ -11723,7 +11723,7 @@ var QUESTION_KINDS = [{
|
|
|
11723
11723
|
}
|
|
11724
11724
|
}, {
|
|
11725
11725
|
type: DROPDOWN$1,
|
|
11726
|
-
label: t$
|
|
11726
|
+
label: t$7("neetoForm.fields.drf"),
|
|
11727
11727
|
isSingular: false,
|
|
11728
11728
|
defaults: {
|
|
11729
11729
|
label: "",
|
|
@@ -11732,7 +11732,7 @@ var QUESTION_KINDS = [{
|
|
|
11732
11732
|
}
|
|
11733
11733
|
}, {
|
|
11734
11734
|
type: STAR_RATING$2,
|
|
11735
|
-
label: t$
|
|
11735
|
+
label: t$7("neetoForm.fields.rif"),
|
|
11736
11736
|
isSingular: false,
|
|
11737
11737
|
defaults: {
|
|
11738
11738
|
label: "",
|
|
@@ -11743,7 +11743,7 @@ var QUESTION_KINDS = [{
|
|
|
11743
11743
|
}
|
|
11744
11744
|
}, {
|
|
11745
11745
|
type: RATING$2,
|
|
11746
|
-
label: t$
|
|
11746
|
+
label: t$7("neetoForm.fields.fbf"),
|
|
11747
11747
|
isSingular: false,
|
|
11748
11748
|
defaults: {
|
|
11749
11749
|
label: "",
|
|
@@ -11754,24 +11754,24 @@ var QUESTION_KINDS = [{
|
|
|
11754
11754
|
}
|
|
11755
11755
|
}, {
|
|
11756
11756
|
type: TERMS_AND_CONDITION,
|
|
11757
|
-
label: t$
|
|
11757
|
+
label: t$7("neetoForm.fields.tcf"),
|
|
11758
11758
|
isSingular: true,
|
|
11759
11759
|
defaults: {
|
|
11760
11760
|
termsLink: "",
|
|
11761
11761
|
privacyPolicyLink: "",
|
|
11762
11762
|
isRequired: true,
|
|
11763
|
-
label: t$
|
|
11763
|
+
label: t$7("neetoForm.common.agreeTermsAndConditions")
|
|
11764
11764
|
}
|
|
11765
11765
|
}, {
|
|
11766
11766
|
type: CONDITION,
|
|
11767
|
-
label: t$
|
|
11767
|
+
label: t$7("neetoForm.fields.cf"),
|
|
11768
11768
|
defaults: {
|
|
11769
11769
|
isRequired: true,
|
|
11770
|
-
label: t$
|
|
11770
|
+
label: t$7("neetoForm.common.agreeCondition")
|
|
11771
11771
|
}
|
|
11772
11772
|
}, {
|
|
11773
11773
|
type: DATE$1,
|
|
11774
|
-
label: t$
|
|
11774
|
+
label: t$7("neetoForm.fields.date"),
|
|
11775
11775
|
isSingular: false,
|
|
11776
11776
|
defaults: {
|
|
11777
11777
|
label: "",
|
|
@@ -11779,7 +11779,7 @@ var QUESTION_KINDS = [{
|
|
|
11779
11779
|
}
|
|
11780
11780
|
}, {
|
|
11781
11781
|
type: FILE_UPLOAD$2,
|
|
11782
|
-
label: t$
|
|
11782
|
+
label: t$7("neetoForm.fields.fileUpload"),
|
|
11783
11783
|
isSingular: false,
|
|
11784
11784
|
defaults: {
|
|
11785
11785
|
label: "",
|
|
@@ -11790,8 +11790,8 @@ var QUESTION_KINDS = [{
|
|
|
11790
11790
|
|
|
11791
11791
|
// To show the question type as label in accordion
|
|
11792
11792
|
var INDEPENDENT_LABELS_MAP = {
|
|
11793
|
-
paragraph: t$
|
|
11794
|
-
termsandcondition: t$
|
|
11793
|
+
paragraph: t$7("neetoForm.fields.def"),
|
|
11794
|
+
termsandcondition: t$7("neetoForm.fields.tcf")
|
|
11795
11795
|
};
|
|
11796
11796
|
var EMPTY_PARAGRAPH_REGEX = new RegExp(/<p[^>]*?>\s*<\/p>/gi);
|
|
11797
11797
|
|
|
@@ -12086,7 +12086,7 @@ Drag.defaultProps = {
|
|
|
12086
12086
|
var validateEditorContent = function validateEditorContent(editorRef) {
|
|
12087
12087
|
return function () {
|
|
12088
12088
|
var _editorRef$current;
|
|
12089
|
-
return (_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && (_editorRef$current = _editorRef$current.editor) !== null && _editorRef$current !== void 0 && _editorRef$current.isEmpty ? t$
|
|
12089
|
+
return (_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && (_editorRef$current = _editorRef$current.editor) !== null && _editorRef$current !== void 0 && _editorRef$current.isEmpty ? t$7("neetoForm.common.thisFieldIsRequired") : "";
|
|
12090
12090
|
};
|
|
12091
12091
|
};
|
|
12092
12092
|
var buildReorderPayload = function buildReorderPayload(questions) {
|
|
@@ -12366,7 +12366,7 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
12366
12366
|
var label = fieldWithFallback(item, "label");
|
|
12367
12367
|
var defaultAttributeNames = keys(questionKind.defaults || {});
|
|
12368
12368
|
var defaultAttributes = pick(defaultAttributeNames, item);
|
|
12369
|
-
var newQuestionLabel = isRichTextQuestion(kind) ? label : t$
|
|
12369
|
+
var newQuestionLabel = isRichTextQuestion(kind) ? label : t$7("neetoForm.common.clonedElementLabel", {
|
|
12370
12370
|
label: label
|
|
12371
12371
|
});
|
|
12372
12372
|
return _objectSpread$z(_objectSpread$z({}, defaultAttributes), {}, {
|
|
@@ -12452,14 +12452,14 @@ var NAME = QUESTION_TYPES.NAME,
|
|
|
12452
12452
|
var QUESTIONS_WITH_ADDITIONAL_DATA = [].concat(_toConsumableArray$1(SELECTABLE_KINDS), [STAR_RATING$1, RATING$1, FILE_UPLOAD$1]);
|
|
12453
12453
|
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE];
|
|
12454
12454
|
var DEFAULT_PLACEHOLDERS = {
|
|
12455
|
-
CHECKBOX: t$
|
|
12456
|
-
what: t$
|
|
12455
|
+
CHECKBOX: t$7("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
12456
|
+
what: t$7("neetoForm.common.hobbies")
|
|
12457
12457
|
}),
|
|
12458
|
-
RADIO: t$
|
|
12459
|
-
what: t$
|
|
12458
|
+
RADIO: t$7("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
12459
|
+
what: t$7("neetoForm.common.country")
|
|
12460
12460
|
}),
|
|
12461
|
-
DROPDOWN: t$
|
|
12462
|
-
what: t$
|
|
12461
|
+
DROPDOWN: t$7("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
12462
|
+
what: t$7("neetoForm.common.company")
|
|
12463
12463
|
})
|
|
12464
12464
|
};
|
|
12465
12465
|
var INITIAL_VALUES = {
|
|
@@ -12793,34 +12793,34 @@ var Form$1 = function Form(_ref) {
|
|
|
12793
12793
|
|
|
12794
12794
|
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
12795
12795
|
var requiredLabelValidation = function requiredLabelValidation(schema, field) {
|
|
12796
|
-
return schema.trim().required(t$
|
|
12796
|
+
return schema.trim().required(t$7("neetoForm.common.fieldReq", {
|
|
12797
12797
|
field: field
|
|
12798
12798
|
}));
|
|
12799
12799
|
};
|
|
12800
12800
|
var richTextFieldMissingErrorMessage = function richTextFieldMissingErrorMessage(kind) {
|
|
12801
|
-
var field = equals(kind, QUESTION_TYPES.PARAGRAPH) ? t$
|
|
12802
|
-
return t$
|
|
12801
|
+
var field = equals(kind, QUESTION_TYPES.PARAGRAPH) ? t$7("neetoForm.fields.def") : t$7("neetoForm.fields.tcf");
|
|
12802
|
+
return t$7("neetoForm.error.fieldCantBeEmpty", {
|
|
12803
12803
|
field: field
|
|
12804
12804
|
});
|
|
12805
12805
|
};
|
|
12806
12806
|
var formValidationSchema = yup.object().shape({
|
|
12807
|
-
kind: yup.string().trim().required(t$
|
|
12808
|
-
field: t$
|
|
12807
|
+
kind: yup.string().trim().required(t$7("neetoForm.common.fieldReq", {
|
|
12808
|
+
field: t$7("neetoForm.questions.common.questionFields.field.questionType")
|
|
12809
12809
|
})),
|
|
12810
12810
|
label: yup.string().when("kind", function (kind, schema) {
|
|
12811
12811
|
return includes(kind, RICH_TEXT_QUESTIONS) ? schema.test("required", richTextFieldMissingErrorMessage(kind), function (value) {
|
|
12812
12812
|
return !isEditorEmpty(value);
|
|
12813
|
-
}) : requiredLabelValidation(schema, t$
|
|
12813
|
+
}) : requiredLabelValidation(schema, t$7("neetoForm.questions.common.questionFields.field.question"));
|
|
12814
12814
|
}),
|
|
12815
|
-
fieldCode: yup.string().trim().notOneOf(RESERVED_FIELD_CODES, t$
|
|
12816
|
-
return includes(kind, QUESTIONS_WITHOUT_FIELD_CODE) ? schema.notRequired() : requiredLabelValidation(schema, t$
|
|
12815
|
+
fieldCode: yup.string().trim().notOneOf(RESERVED_FIELD_CODES, t$7("neetoForm.error.invalidFieldCode")).when("kind", function (kind, schema) {
|
|
12816
|
+
return includes(kind, QUESTIONS_WITHOUT_FIELD_CODE) ? schema.notRequired() : requiredLabelValidation(schema, t$7("neetoForm.questions.common.questionFields.field.fieldCode"));
|
|
12817
12817
|
}),
|
|
12818
12818
|
optionsAttributes: yup.array().when("_destroy", {
|
|
12819
12819
|
is: true,
|
|
12820
12820
|
otherwise: function otherwise(schema) {
|
|
12821
12821
|
return schema.when("kind", function (kind, schema) {
|
|
12822
12822
|
return includes(kind, SELECTABLE_KINDS) ? schema.of(yup.object().shape({
|
|
12823
|
-
label: requiredLabelValidation(yup.string(), t$
|
|
12823
|
+
label: requiredLabelValidation(yup.string(), t$7("neetoForm.questions.common.questionFields.field.option"))
|
|
12824
12824
|
})) : schema.notRequired();
|
|
12825
12825
|
});
|
|
12826
12826
|
}
|
|
@@ -12830,7 +12830,7 @@ var formValidationSchema = yup.object().shape({
|
|
|
12830
12830
|
lowestRatingLabel: yup.string().nullable()
|
|
12831
12831
|
});
|
|
12832
12832
|
|
|
12833
|
-
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs"];
|
|
12833
|
+
var _excluded$9 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"];
|
|
12834
12834
|
function ownKeys$w(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; }
|
|
12835
12835
|
function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12836
12836
|
var Add = function Add(_ref) {
|
|
@@ -12839,6 +12839,7 @@ var Add = function Add(_ref) {
|
|
|
12839
12839
|
questions = _ref.questions,
|
|
12840
12840
|
handleSelect = _ref.handleSelect,
|
|
12841
12841
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
12842
|
+
isOpen = _ref.isOpen,
|
|
12842
12843
|
props = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
12843
12844
|
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
12844
12845
|
var _store$formState, _store$formState2;
|
|
@@ -12860,6 +12861,7 @@ var Add = function Add(_ref) {
|
|
|
12860
12861
|
createQuestion = _useCreateQuestion.mutate,
|
|
12861
12862
|
isCreating = _useCreateQuestion.isLoading;
|
|
12862
12863
|
var handleSubmit = function handleSubmit(values) {
|
|
12864
|
+
if (isCreating || !isOpen) return;
|
|
12863
12865
|
var displayOrder = question ? question.displayOrder + 1 : questions.length;
|
|
12864
12866
|
createQuestion(_objectSpread$w({
|
|
12865
12867
|
language: language,
|
|
@@ -12906,11 +12908,12 @@ var Add = function Add(_ref) {
|
|
|
12906
12908
|
});
|
|
12907
12909
|
};
|
|
12908
12910
|
|
|
12909
|
-
var _excluded$8 = ["question", "onClose"];
|
|
12911
|
+
var _excluded$8 = ["question", "isOpen", "onClose"];
|
|
12910
12912
|
function ownKeys$v(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; }
|
|
12911
12913
|
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12912
12914
|
var Edit = function Edit(_ref) {
|
|
12913
12915
|
var question = _ref.question,
|
|
12916
|
+
isOpen = _ref.isOpen,
|
|
12914
12917
|
onClose = _ref.onClose,
|
|
12915
12918
|
props = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
12916
12919
|
var _useTranslation = useTranslation(),
|
|
@@ -12927,6 +12930,7 @@ var Edit = function Edit(_ref) {
|
|
|
12927
12930
|
isUpdating = _useUpdateQuestion.isLoading;
|
|
12928
12931
|
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
12929
12932
|
var setSubmitting = _ref2.setSubmitting;
|
|
12933
|
+
if (isUpdating || !isOpen) return;
|
|
12930
12934
|
var payload = {
|
|
12931
12935
|
language: language,
|
|
12932
12936
|
neetoFormQuestion: values
|
|
@@ -13378,6 +13382,7 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
13378
13382
|
children: /*#__PURE__*/jsx(Component, _objectSpread$s({}, _objectSpread$s({
|
|
13379
13383
|
availableQuestionKinds: availableQuestionKinds,
|
|
13380
13384
|
initialFocusRef: initialFocusRef,
|
|
13385
|
+
isOpen: isOpen,
|
|
13381
13386
|
onClose: onClose,
|
|
13382
13387
|
question: question
|
|
13383
13388
|
}, props)))
|
|
@@ -14311,6 +14316,8 @@ var Callout = function Callout(_ref) {
|
|
|
14311
14316
|
});
|
|
14312
14317
|
};
|
|
14313
14318
|
|
|
14319
|
+
var clientI18nInstance = i18next.cloneInstance();
|
|
14320
|
+
|
|
14314
14321
|
var clearLocalStorageValues = function clearLocalStorageValues(key) {
|
|
14315
14322
|
try {
|
|
14316
14323
|
localStorage.removeItem(key);
|
|
@@ -14358,13 +14365,25 @@ var FormikWrap = function FormikWrap(_ref) {
|
|
|
14358
14365
|
children = _ref.children,
|
|
14359
14366
|
formId = _ref.formId,
|
|
14360
14367
|
preserveValues = _ref.preserveValues,
|
|
14361
|
-
onValuesChange = _ref.onValuesChange
|
|
14368
|
+
onValuesChange = _ref.onValuesChange,
|
|
14369
|
+
dataUpdateCount = _ref.dataUpdateCount;
|
|
14362
14370
|
var _useFormikContext = useFormikContext(),
|
|
14363
14371
|
errors = _useFormikContext.errors,
|
|
14364
14372
|
touched = _useFormikContext.touched,
|
|
14365
14373
|
isValid = _useFormikContext.isValid,
|
|
14366
14374
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
14367
|
-
values = _useFormikContext.values
|
|
14375
|
+
values = _useFormikContext.values,
|
|
14376
|
+
validateForm = _useFormikContext.validateForm;
|
|
14377
|
+
var revalidate = function revalidate() {
|
|
14378
|
+
return isPresent$1(errors) && validateForm();
|
|
14379
|
+
};
|
|
14380
|
+
useEffect(function () {
|
|
14381
|
+
revalidate();
|
|
14382
|
+
clientI18nInstance.on("languageChanged", revalidate);
|
|
14383
|
+
return function () {
|
|
14384
|
+
return clientI18nInstance.off("languageChanged", revalidate);
|
|
14385
|
+
};
|
|
14386
|
+
}, [dataUpdateCount]);
|
|
14368
14387
|
var syncValuesWithLocalStorage = function syncValuesWithLocalStorage() {
|
|
14369
14388
|
return preserveValues && !isEmptyValues(values) && setWithExpiry("".concat(formId, "/values"), values);
|
|
14370
14389
|
};
|
|
@@ -14373,16 +14392,16 @@ var FormikWrap = function FormikWrap(_ref) {
|
|
|
14373
14392
|
onValuesChange && onValuesChange(values);
|
|
14374
14393
|
}, [values, formId, preserveValues]);
|
|
14375
14394
|
useEffect(function () {
|
|
14376
|
-
if (
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14395
|
+
if (isSubmitting || isValid) return;
|
|
14396
|
+
|
|
14397
|
+
// include only touched fields
|
|
14398
|
+
var touchedErrors = Object.keys(errors).filter(function (key) {
|
|
14399
|
+
return touched[key];
|
|
14400
|
+
}).reduce(function (obj, key) {
|
|
14401
|
+
obj[key] = errors[key];
|
|
14402
|
+
return obj;
|
|
14403
|
+
}, {});
|
|
14404
|
+
if (isFunction$1(onError)) onError(touchedErrors);
|
|
14386
14405
|
}, [isValid, isSubmitting]);
|
|
14387
14406
|
return children;
|
|
14388
14407
|
};
|
|
@@ -17433,25 +17452,26 @@ function parsePhoneNumberWithError() {
|
|
|
17433
17452
|
return withMetadataArgument(parsePhoneNumberWithError$1, arguments)
|
|
17434
17453
|
}
|
|
17435
17454
|
|
|
17455
|
+
var t$2 = clientI18nInstance.t;
|
|
17436
17456
|
var getInvalidFieldError = function getInvalidFieldError(label) {
|
|
17437
|
-
return t$
|
|
17457
|
+
return t$2("neetoForm.error.invalidField", {
|
|
17438
17458
|
label: label
|
|
17439
17459
|
});
|
|
17440
17460
|
};
|
|
17441
17461
|
var getRequiredFieldError = function getRequiredFieldError(label) {
|
|
17442
|
-
return t$
|
|
17462
|
+
return t$2("neetoForm.error.requiredField", {
|
|
17443
17463
|
label: label
|
|
17444
17464
|
});
|
|
17445
17465
|
};
|
|
17446
17466
|
var getSelectMinError = function getSelectMinError(min) {
|
|
17447
|
-
var entity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "option";
|
|
17448
|
-
return t$
|
|
17467
|
+
var entity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : t$2("neetoForm.common.option");
|
|
17468
|
+
return t$2("neetoForm.error.selectMin", {
|
|
17449
17469
|
min: min,
|
|
17450
17470
|
entity: entity
|
|
17451
17471
|
});
|
|
17452
17472
|
};
|
|
17453
17473
|
var getInvalidTypeError = function getInvalidTypeError(label, type) {
|
|
17454
|
-
return t$
|
|
17474
|
+
return t$2("neetoForm.error.invalidType", {
|
|
17455
17475
|
label: label,
|
|
17456
17476
|
type: type
|
|
17457
17477
|
});
|
|
@@ -17461,6 +17481,7 @@ var _excluded$4 = ["kind", "label", "isRequired", "customValidator"];
|
|
|
17461
17481
|
var _fieldKindValidatorMa;
|
|
17462
17482
|
function ownKeys$k(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; }
|
|
17463
17483
|
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17484
|
+
var t$1 = clientI18nInstance.t;
|
|
17464
17485
|
yup.addMethod(yup.array, "unique", function () {
|
|
17465
17486
|
var field, message;
|
|
17466
17487
|
if (arguments.length > 1) {
|
|
@@ -17496,7 +17517,7 @@ var validateTextField = function validateTextField(_ref) {
|
|
|
17496
17517
|
isRequired = _ref.isRequired;
|
|
17497
17518
|
var schema = yup.string().typeError(getInvalidTypeError(label, "string"));
|
|
17498
17519
|
if (kind === QUESTION_KIND.PHONE.value) {
|
|
17499
|
-
schema = validation(getInvalidFieldError(t$
|
|
17520
|
+
schema = validation(getInvalidFieldError(t$1("neetoForm.common.phoneNumberValidation")));
|
|
17500
17521
|
}
|
|
17501
17522
|
if (isRequired) schema = schema.trim().required(getRequiredFieldError(label));
|
|
17502
17523
|
return schema.trim();
|
|
@@ -17539,18 +17560,20 @@ var validateStarRatingField = function validateStarRatingField(_ref7) {
|
|
|
17539
17560
|
var label = _ref7.label,
|
|
17540
17561
|
isRequired = _ref7.isRequired;
|
|
17541
17562
|
var schema = yup.string().typeError(getInvalidTypeError(label, "string"));
|
|
17542
|
-
if (isRequired)
|
|
17563
|
+
if (isRequired) {
|
|
17564
|
+
schema = schema.required(getSelectMinError("a", t$1("neetoForm.common.rating")));
|
|
17565
|
+
}
|
|
17543
17566
|
return schema.trim();
|
|
17544
17567
|
};
|
|
17545
17568
|
var validateTermsField = function validateTermsField(_ref8) {
|
|
17546
17569
|
var _ref8$isRequired = _ref8.isRequired,
|
|
17547
17570
|
isRequired = _ref8$isRequired === void 0 ? true : _ref8$isRequired;
|
|
17548
|
-
return isRequired ? yup["boolean"]().oneOf([true], t$
|
|
17571
|
+
return isRequired ? yup["boolean"]().oneOf([true], t$1("neetoForm.common.mustAcceptTermsAndConditions")) : yup["boolean"]().notRequired();
|
|
17549
17572
|
};
|
|
17550
17573
|
var validateConditionField = function validateConditionField(_ref9) {
|
|
17551
17574
|
var _ref9$isRequired = _ref9.isRequired,
|
|
17552
17575
|
isRequired = _ref9$isRequired === void 0 ? true : _ref9$isRequired;
|
|
17553
|
-
return isRequired ? yup["boolean"]().oneOf([true], t$
|
|
17576
|
+
return isRequired ? yup["boolean"]().oneOf([true], t$1("neetoForm.common.mustAcceptCondition")) : yup["boolean"]().notRequired();
|
|
17554
17577
|
};
|
|
17555
17578
|
var validateDateField = function validateDateField(_ref10) {
|
|
17556
17579
|
var label = _ref10.label,
|
|
@@ -17569,7 +17592,7 @@ var validateMultiEmailField = function validateMultiEmailField(_ref11) {
|
|
|
17569
17592
|
value: yup.string().email(getInvalidFieldError("Email")).trim()
|
|
17570
17593
|
})).nullable();
|
|
17571
17594
|
if (isRequired) {
|
|
17572
|
-
schema = schema.compact().min(1, getSelectMinError("an", "email"));
|
|
17595
|
+
schema = schema.compact().min(1, getSelectMinError("an", t$1("neetoForm.common.email")));
|
|
17573
17596
|
}
|
|
17574
17597
|
return schema;
|
|
17575
17598
|
};
|
|
@@ -17591,9 +17614,9 @@ var validateFileUploadField = function validateFileUploadField(_ref13) {
|
|
|
17591
17614
|
if (isRequired) {
|
|
17592
17615
|
files_schema = files_schema.of(yup.object().shape({
|
|
17593
17616
|
name: yup.string(),
|
|
17594
|
-
signedId: yup.string().required(t$
|
|
17595
|
-
url: yup.string().required(t$
|
|
17596
|
-
})).unique("name", t$
|
|
17617
|
+
signedId: yup.string().required(t$1("neetoForm.fileUpload.validations.waitForUpload")),
|
|
17618
|
+
url: yup.string().required(t$1("neetoForm.fileUpload.validations.waitForUpload"))
|
|
17619
|
+
})).unique("name", t$1("neetoForm.fileUpload.validations.removeDuplicates")).min(1, multipleFilesAllowed ? t$1("neetoForm.fileUpload.validations.atLeastOneFileRequired") : t$1("neetoForm.fileUpload.validations.fileIsRequired"));
|
|
17597
17620
|
}
|
|
17598
17621
|
return yup.object().shape({
|
|
17599
17622
|
files: files_schema
|
|
@@ -17735,6 +17758,7 @@ var ConditionField = function ConditionField(_ref) {
|
|
|
17735
17758
|
|
|
17736
17759
|
function ownKeys$i(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; }
|
|
17737
17760
|
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17761
|
+
var t = clientI18nInstance.t;
|
|
17738
17762
|
var toEmailValues = function toEmailValues() {
|
|
17739
17763
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17740
17764
|
return values.map(function (value) {
|
|
@@ -18029,23 +18053,21 @@ var renderErrorMessage = function renderErrorMessage(errorObject, maxFileSize, i
|
|
|
18029
18053
|
var code = error.code;
|
|
18030
18054
|
switch (code) {
|
|
18031
18055
|
case ERROR_CODES.FILE_TOO_LARGE:
|
|
18032
|
-
return t
|
|
18056
|
+
return t("neetoForm.fileUpload.dropzone.errors.fileTooLarge", {
|
|
18033
18057
|
fileName: file.name,
|
|
18034
18058
|
maxSize: Math.round(maxFileSize / 1048576)
|
|
18035
18059
|
});
|
|
18036
18060
|
case ERROR_CODES.FILE_INVALID_TYPE:
|
|
18037
|
-
return t
|
|
18061
|
+
return t("neetoForm.fileUpload.dropzone.errors.fileInvalidType", {
|
|
18038
18062
|
fileType: path$1.extname(file.name)
|
|
18039
18063
|
});
|
|
18040
18064
|
case ERROR_CODES.TOO_MANY_FILES:
|
|
18041
18065
|
if (!isMultiple) {
|
|
18042
|
-
return t
|
|
18043
|
-
maxFiles: 1
|
|
18044
|
-
});
|
|
18066
|
+
return t("neetoForm.fileUpload.dropzone.errors.tooManyFiles");
|
|
18045
18067
|
}
|
|
18046
18068
|
}
|
|
18047
18069
|
}
|
|
18048
|
-
return t
|
|
18070
|
+
return t("neetoForm.fileUpload.dropzone.errors.defaultError", {
|
|
18049
18071
|
fileName: file.name
|
|
18050
18072
|
});
|
|
18051
18073
|
};
|
|
@@ -28931,6 +28953,10 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
28931
28953
|
var formikInnerRef = useRef();
|
|
28932
28954
|
var editorRef = useRef();
|
|
28933
28955
|
var queryClient = useQueryClient();
|
|
28956
|
+
useEffect(function () {
|
|
28957
|
+
if (equals(language, clientI18nInstance.resolvedLanguage)) return;
|
|
28958
|
+
clientI18nInstance.changeLanguage(language);
|
|
28959
|
+
}, [language]);
|
|
28934
28960
|
var _useTranslation = useTranslation(),
|
|
28935
28961
|
t = _useTranslation.t;
|
|
28936
28962
|
useEffect(function () {
|
|
@@ -29133,6 +29159,8 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
29133
29159
|
questions: []
|
|
29134
29160
|
} : _useForm$data,
|
|
29135
29161
|
isLoading = _useForm.isLoading;
|
|
29162
|
+
var _queryClient$getQuery = queryClient.getQueryState([QUERY_KEYS.QUESTIONS, formId, language]),
|
|
29163
|
+
dataUpdateCount = _queryClient$getQuery.dataUpdateCount;
|
|
29136
29164
|
var keyPressRef = useHotkeys("command+enter", ((_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit) || noop$4, {
|
|
29137
29165
|
mode: "scoped"
|
|
29138
29166
|
});
|
|
@@ -29152,7 +29180,8 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
29152
29180
|
if (displayThankYou && showSuccess) {
|
|
29153
29181
|
return /*#__PURE__*/jsx(Success$1, {});
|
|
29154
29182
|
}
|
|
29155
|
-
return /*#__PURE__*/jsxs(
|
|
29183
|
+
return /*#__PURE__*/jsxs(I18nextProvider, {
|
|
29184
|
+
i18n: clientI18nInstance,
|
|
29156
29185
|
children: [showTitle && /*#__PURE__*/jsx("div", {
|
|
29157
29186
|
className: "py-6 text-center",
|
|
29158
29187
|
children: /*#__PURE__*/jsx(Typography, _objectSpread$2(_objectSpread$2({
|
|
@@ -29180,6 +29209,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
29180
29209
|
setFieldError = _ref5.setFieldError,
|
|
29181
29210
|
handleReset = _ref5.handleReset;
|
|
29182
29211
|
return /*#__PURE__*/jsxs(FormikWrap, {
|
|
29212
|
+
dataUpdateCount: dataUpdateCount,
|
|
29183
29213
|
formId: formId,
|
|
29184
29214
|
preserveValues: preserveValues,
|
|
29185
29215
|
onError: handleScrollToError,
|
|
@@ -31818,7 +31848,7 @@ var getValue = function getValue(_ref) {
|
|
|
31818
31848
|
var value = _ref.value,
|
|
31819
31849
|
kind = _ref.kind;
|
|
31820
31850
|
if (isEmpty(value)) return /*#__PURE__*/jsx("i", {
|
|
31821
|
-
children: t$
|
|
31851
|
+
children: t$7("neetoForm.common.unanswered")
|
|
31822
31852
|
});
|
|
31823
31853
|
if (kind === QUESTION_KIND.DATE.value) {
|
|
31824
31854
|
return value && dateFormat.date(value);
|
|
@@ -31827,7 +31857,7 @@ var getValue = function getValue(_ref) {
|
|
|
31827
31857
|
return value === null || value === void 0 ? void 0 : value.join(", ");
|
|
31828
31858
|
}
|
|
31829
31859
|
if (kind === QUESTION_KIND.CONDITION.value) {
|
|
31830
|
-
return value ? t$
|
|
31860
|
+
return value ? t$7("neetoForm.common.yes") : t$7("neetoForm.common.no");
|
|
31831
31861
|
}
|
|
31832
31862
|
return value;
|
|
31833
31863
|
};
|