@bigbinary/neeto-form-frontend 3.8.3 → 3.9.1
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/ar.json +3 -1
- package/app/javascript/src/translations/de.json +3 -1
- package/app/javascript/src/translations/en.json +12 -4
- package/app/javascript/src/translations/es.json +3 -1
- package/app/javascript/src/translations/fr.json +3 -1
- package/app/javascript/src/translations/it.json +201 -0
- package/app/javascript/src/translations/nl.json +3 -1
- package/app/javascript/src/translations/pl.json +3 -1
- package/app/javascript/src/translations/pt.json +3 -1
- package/app/javascript/src/translations/ru.json +202 -0
- package/dist/BuildForm.js +142 -132
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +12 -12
- package/dist/ExternalForm.js.map +1 -1
- package/dist/Submission.js +1 -1
- package/dist/Submission.js.map +1 -1
- package/dist/UrlBuilder.js +10 -10
- package/dist/UrlBuilder.js.map +1 -1
- package/dist/{buildForm-354c6d6d.js → buildForm-b8eb931e.js} +4 -2
- package/dist/buildForm-b8eb931e.js.map +1 -0
- package/dist/{buildForm-042737cb.js → buildForm-dfd708c6.js} +4 -2
- package/dist/buildForm-dfd708c6.js.map +1 -0
- package/dist/cjs/BuildForm.js +144 -134
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +12 -12
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/Submission.js +1 -1
- package/dist/cjs/Submission.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +10 -10
- package/dist/cjs/UrlBuilder.js.map +1 -1
- package/dist/cjs/hooks.js +3 -3
- package/dist/cjs/index.js +6 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/constants-4d9fc943.js.map +1 -1
- package/dist/constants-75b78b3a.js.map +1 -1
- package/dist/{constants-56bf4022.js → constants-771cca31.js} +2 -3
- package/dist/{constants-56bf4022.js.map → constants-771cca31.js.map} +1 -1
- package/dist/{constants-d9148acf.js → constants-9538731d.js} +2 -3
- package/dist/{constants-d9148acf.js.map → constants-9538731d.js.map} +1 -1
- package/dist/hooks.js +3 -3
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/{useFormApi-408d0060.js → useFormApi-24e05ed2.js} +6 -6
- package/dist/{useFormApi-408d0060.js.map → useFormApi-24e05ed2.js.map} +1 -1
- package/dist/{useFormApi-e3476a20.js → useFormApi-dee63a95.js} +6 -6
- package/dist/{useFormApi-e3476a20.js.map → useFormApi-dee63a95.js.map} +1 -1
- package/dist/{useFormSubmission-e2e84587.js → useFormSubmission-8b23d7aa.js} +2 -2
- package/dist/{useFormSubmission-e2e84587.js.map → useFormSubmission-8b23d7aa.js.map} +1 -1
- package/dist/{useFormSubmission-46db678f.js → useFormSubmission-c4e42402.js} +2 -2
- package/dist/{useFormSubmission-46db678f.js.map → useFormSubmission-c4e42402.js.map} +1 -1
- package/dist/{utils-4918956b.js → utils-58566755.js} +52 -44
- package/dist/utils-58566755.js.map +1 -0
- package/dist/{utils-e4298243.js → utils-d5895099.js} +51 -43
- package/dist/utils-d5895099.js.map +1 -0
- package/package.json +101 -92
- package/types.d.ts +2 -1
- package/dist/buildForm-042737cb.js.map +0 -1
- package/dist/buildForm-354c6d6d.js.map +0 -1
- package/dist/utils-4918956b.js.map +0 -1
- package/dist/utils-e4298243.js.map +0 -1
|
@@ -21,7 +21,9 @@ var useBuildFormStore = create(withImmutableActions(function (set) {
|
|
|
21
21
|
enabled: false,
|
|
22
22
|
title: "",
|
|
23
23
|
richTextFieldsToReset: [],
|
|
24
|
-
helpDocUrls: {}
|
|
24
|
+
helpDocUrls: {},
|
|
25
|
+
enableDomainBlacklisting: true,
|
|
26
|
+
enableDomainWhitelisting: true
|
|
25
27
|
},
|
|
26
28
|
setFormData: function setFormData(arg) {
|
|
27
29
|
return set(modify("formState", isFunction(arg) ? arg : mergeLeft(arg)));
|
|
@@ -33,4 +35,4 @@ var useBuildFormState = function useBuildFormState() {
|
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export { useBuildFormStore as a, useBuildFormState as u };
|
|
36
|
-
//# sourceMappingURL=buildForm-
|
|
38
|
+
//# sourceMappingURL=buildForm-dfd708c6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildForm-dfd708c6.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n values: {},\n dirty: false,\n isSubmitting: false,\n isValid: true,\n errors: [],\n submitForm: noop,\n resetForm: noop,\n selectedLanguage: i18next.resolvedLanguage,\n formId: null,\n enabled: false,\n title: \"\",\n richTextFieldsToReset: [],\n helpDocUrls: {},\n enableDomainBlacklisting: true,\n enableDomainWhitelisting: true,\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","values","dirty","isSubmitting","isValid","errors","submitForm","noop","resetForm","selectedLanguage","i18next","resolvedLanguage","formId","enabled","title","richTextFieldsToReset","helpDocUrls","enableDomainBlacklisting","enableDomainWhitelisting","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,MAAM,CAC9BC,oBAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,KAAK;AACZC,MAAAA,YAAY,EAAE,KAAK;AACnBC,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,UAAU,EAAEC,IAAI;AAChBC,MAAAA,SAAS,EAAED,IAAI;MACfE,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,qBAAqB,EAAE,EAAE;MACzBC,WAAW,EAAE,EAAE;AACfC,MAAAA,wBAAwB,EAAE,IAAI;AAC9BC,MAAAA,wBAAwB,EAAE,IAAA;KAC3B;AAEDC,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACdrB,GAAG,CAACsB,MAAM,CAAC,WAAW,EAAEC,UAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,SAAS,CAACH,GAAG,CAAC,CAAC,CAAC,CAAA;AAAA,KAAA;GACnE,CAAA;AAAA,CAAC,CACJ,EAAC;AAEYI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAAS5B,iBAAiB,CAAC6B,IAAI,CAAC,WAAW,CAAC,CAAC,CAAA;AAAA;;;;"}
|
package/dist/cjs/BuildForm.js
CHANGED
|
@@ -9,16 +9,16 @@ var neetoCist = require('@bigbinary/neeto-cist');
|
|
|
9
9
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
10
10
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
11
11
|
var ramda = require('ramda');
|
|
12
|
-
var useFormApi = require('../useFormApi-
|
|
12
|
+
var useFormApi = require('../useFormApi-24e05ed2.js');
|
|
13
13
|
var constants$1 = require('../constants-4d9fc943.js');
|
|
14
|
-
var constants = require('../constants-
|
|
14
|
+
var constants = require('../constants-771cca31.js');
|
|
15
15
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
16
16
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
17
17
|
var dnd = require('@hello-pangea/dnd');
|
|
18
18
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
19
19
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
20
20
|
var reactI18next = require('react-i18next');
|
|
21
|
-
var buildForm = require('../buildForm-
|
|
21
|
+
var buildForm = require('../buildForm-b8eb931e.js');
|
|
22
22
|
var shallow = require('zustand/shallow');
|
|
23
23
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
24
24
|
var index = require('../index-b6bb805c.js');
|
|
@@ -31,6 +31,7 @@ var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
|
31
31
|
var i18next = require('i18next');
|
|
32
32
|
var Plus = require('@bigbinary/neeto-icons/Plus');
|
|
33
33
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
34
|
+
var uuid = require('uuid');
|
|
34
35
|
var NoData = require('@bigbinary/neetoui/NoData');
|
|
35
36
|
var Pane = require('@bigbinary/neetoui/Pane');
|
|
36
37
|
var Form$2 = require('@bigbinary/neetoui/formik/Form');
|
|
@@ -295,8 +296,8 @@ function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
295
296
|
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
296
297
|
var validateEditorContent = function validateEditorContent(editorRef) {
|
|
297
298
|
return function () {
|
|
298
|
-
var _editorRef$current;
|
|
299
|
-
return (_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && (_editorRef$current = _editorRef$current.editor) !== null && _editorRef$current !== void 0 && _editorRef$current.isEmpty ? i18next.t("neetoForm.common.thisFieldIsRequired") : "";
|
|
299
|
+
var _editorRef$current, _editorRef$current$ed;
|
|
300
|
+
return (_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && (_editorRef$current$ed = _editorRef$current.editor) !== null && _editorRef$current$ed !== void 0 && _editorRef$current$ed.isEmpty ? i18next.t("neetoForm.common.thisFieldIsRequired") : "";
|
|
300
301
|
};
|
|
301
302
|
};
|
|
302
303
|
var buildReorderPayload = function buildReorderPayload(questions) {
|
|
@@ -484,71 +485,6 @@ var Questions = function Questions(_ref) {
|
|
|
484
485
|
});
|
|
485
486
|
};
|
|
486
487
|
|
|
487
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
488
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
489
|
-
// generators (like Math.random()).
|
|
490
|
-
let getRandomValues;
|
|
491
|
-
const rnds8 = new Uint8Array(16);
|
|
492
|
-
function rng() {
|
|
493
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
494
|
-
if (!getRandomValues) {
|
|
495
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
496
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
497
|
-
|
|
498
|
-
if (!getRandomValues) {
|
|
499
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return getRandomValues(rnds8);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
508
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
|
-
const byteToHex = [];
|
|
512
|
-
|
|
513
|
-
for (let i = 0; i < 256; ++i) {
|
|
514
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
function unsafeStringify(arr, offset = 0) {
|
|
518
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
519
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
520
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
524
|
-
var native = {
|
|
525
|
-
randomUUID
|
|
526
|
-
};
|
|
527
|
-
|
|
528
|
-
function v4(options, buf, offset) {
|
|
529
|
-
if (native.randomUUID && !buf && !options) {
|
|
530
|
-
return native.randomUUID();
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
options = options || {};
|
|
534
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
535
|
-
|
|
536
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
537
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
538
|
-
|
|
539
|
-
if (buf) {
|
|
540
|
-
offset = offset || 0;
|
|
541
|
-
|
|
542
|
-
for (let i = 0; i < 16; ++i) {
|
|
543
|
-
buf[offset + i] = rnds[i];
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
return buf;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return unsafeStringify(rnds);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
488
|
var moveItem = function moveItem(arr, sourceIndex, destinationIndex) {
|
|
553
489
|
if (sourceIndex === destinationIndex) return arr;
|
|
554
490
|
if (arr instanceof Array && arr[sourceIndex] !== undefined) {
|
|
@@ -619,7 +555,7 @@ var createFieldData = function createFieldData(_ref3) {
|
|
|
619
555
|
metadata: metadata,
|
|
620
556
|
isRequired: isRequired,
|
|
621
557
|
kind: type,
|
|
622
|
-
nodeId: v4(),
|
|
558
|
+
nodeId: uuid.v4(),
|
|
623
559
|
fieldCode: generateUniqueFieldCode(type, questions)
|
|
624
560
|
});
|
|
625
561
|
};
|
|
@@ -644,7 +580,7 @@ var duplicateFieldData = function duplicateFieldData(_ref4) {
|
|
|
644
580
|
kind: kind,
|
|
645
581
|
label: newQuestionLabel,
|
|
646
582
|
optionsAttributes: optionsAttributes && optionsAttributes.map(ramda.omit(["id"])),
|
|
647
|
-
nodeId: v4(),
|
|
583
|
+
nodeId: uuid.v4(),
|
|
648
584
|
fieldCode: generateUniqueFieldCode(item.kind, questions),
|
|
649
585
|
displayOrder: item.displayOrder + 1
|
|
650
586
|
});
|
|
@@ -804,8 +740,8 @@ var useUpdateEditorContent = function useUpdateEditorContent(_ref) {
|
|
|
804
740
|
return store.formState.richTextFieldsToReset.includes(fieldCode);
|
|
805
741
|
});
|
|
806
742
|
var setEditorContent = function setEditorContent(content) {
|
|
807
|
-
var _editorRef$current$ed;
|
|
808
|
-
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0
|
|
743
|
+
var _editorRef$current$ed, _editorRef$current$ed2;
|
|
744
|
+
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : (_editorRef$current$ed2 = _editorRef$current$ed.commands) === null || _editorRef$current$ed2 === void 0 ? void 0 : _editorRef$current$ed2.setContent(content);
|
|
809
745
|
};
|
|
810
746
|
if (shouldReset) {
|
|
811
747
|
setEditorContent(initialValue);
|
|
@@ -952,7 +888,6 @@ var Form$1 = function Form(_ref) {
|
|
|
952
888
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
953
889
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
954
890
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
955
|
-
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
956
891
|
_ref$isEdit = _ref.isEdit,
|
|
957
892
|
isEdit = _ref$isEdit === void 0 ? false : _ref$isEdit;
|
|
958
893
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -963,6 +898,15 @@ var Form$1 = function Form(_ref) {
|
|
|
963
898
|
setErrors = _useFormikContext.setErrors,
|
|
964
899
|
setTouched = _useFormikContext.setTouched;
|
|
965
900
|
var hideQuestionHelpDoc = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", "hideQuestion"]));
|
|
901
|
+
var _useBuildFormStore = buildForm.useBuildFormStore(function (store) {
|
|
902
|
+
var _store$formState, _store$formState2;
|
|
903
|
+
return {
|
|
904
|
+
enableDomainWhitelisting: (_store$formState = store["formState"]) === null || _store$formState === void 0 ? void 0 : _store$formState["enableDomainWhitelisting"],
|
|
905
|
+
enableDomainBlacklisting: (_store$formState2 = store["formState"]) === null || _store$formState2 === void 0 ? void 0 : _store$formState2["enableDomainBlacklisting"]
|
|
906
|
+
};
|
|
907
|
+
}, shallow.shallow),
|
|
908
|
+
enableDomainWhitelisting = _useBuildFormStore.enableDomainWhitelisting,
|
|
909
|
+
enableDomainBlacklisting = _useBuildFormStore.enableDomainBlacklisting;
|
|
966
910
|
var kind = values.kind;
|
|
967
911
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
968
912
|
var questionKindUniquenessPattern = ramda.mergeLeft(isEdit && additionalQuestionKindPattern ? additionalQuestionKindPattern(values) : {}, {
|
|
@@ -1042,7 +986,8 @@ var Form$1 = function Form(_ref) {
|
|
|
1042
986
|
}), hasAdditionalData && renderAdditionalData({
|
|
1043
987
|
kind: kind,
|
|
1044
988
|
questionProps: questionProps,
|
|
1045
|
-
|
|
989
|
+
enableDomainWhitelisting: enableDomainWhitelisting,
|
|
990
|
+
enableDomainBlacklisting: enableDomainBlacklisting
|
|
1046
991
|
})]
|
|
1047
992
|
}), isSettingsBlockVisible && /*#__PURE__*/jsxRuntime.jsxs(Block, {
|
|
1048
993
|
dataCy: "settings-card",
|
|
@@ -1275,11 +1220,11 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1275
1220
|
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded$4);
|
|
1276
1221
|
return /*#__PURE__*/jsxRuntime.jsxs(Label__default["default"], {
|
|
1277
1222
|
className: classnames__default["default"]("flex items-center justify-start gap-2 ", className),
|
|
1278
|
-
"data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title), "-toggle-label"),
|
|
1223
|
+
"data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-toggle-label"),
|
|
1279
1224
|
children: [/*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], _objectSpread$9(_objectSpread$9({}, _objectSpread$9(_objectSpread$9({}, otherProps), {}, {
|
|
1280
1225
|
name: name
|
|
1281
1226
|
})), {}, {
|
|
1282
|
-
"data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title), "-switch")
|
|
1227
|
+
"data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-switch")
|
|
1283
1228
|
})), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1284
1229
|
component: "span",
|
|
1285
1230
|
style: "body1",
|
|
@@ -1288,9 +1233,43 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1288
1233
|
});
|
|
1289
1234
|
};
|
|
1290
1235
|
|
|
1291
|
-
var _excluded$3 = ["children"];
|
|
1292
1236
|
function ownKeys$8(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; }
|
|
1293
1237
|
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1238
|
+
var TitleWithHelpPopover = function TitleWithHelpPopover(_ref) {
|
|
1239
|
+
var title = _ref.title,
|
|
1240
|
+
description = _ref.description,
|
|
1241
|
+
helpLink = _ref.helpLink;
|
|
1242
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1243
|
+
className: "flex gap-2",
|
|
1244
|
+
children: [title, /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], _objectSpread$8({
|
|
1245
|
+
description: description,
|
|
1246
|
+
popoverProps: {
|
|
1247
|
+
position: "top"
|
|
1248
|
+
}
|
|
1249
|
+
}, helpLink && {
|
|
1250
|
+
helpLinkProps: {
|
|
1251
|
+
href: helpLink
|
|
1252
|
+
}
|
|
1253
|
+
}))]
|
|
1254
|
+
});
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
var DOMAIN_RESTRICTION_TRANSLATIONS = {
|
|
1258
|
+
whitelistedDomains: {
|
|
1259
|
+
title: i18next.t("neetoForm.domainRestriction.whitelistedDomains.label"),
|
|
1260
|
+
description: i18next.t("neetoForm.domainRestriction.whitelistedDomains.description"),
|
|
1261
|
+
popoverDescription: i18next.t("neetoForm.domainRestriction.whitelistedDomains.popoverDescription")
|
|
1262
|
+
},
|
|
1263
|
+
blacklistedDomains: {
|
|
1264
|
+
title: i18next.t("neetoForm.domainRestriction.blacklistedDomains.label"),
|
|
1265
|
+
description: i18next.t("neetoForm.domainRestriction.blacklistedDomains.description"),
|
|
1266
|
+
popoverDescription: i18next.t("neetoForm.domainRestriction.blacklistedDomains.popoverDescription")
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
var _excluded$3 = ["children"];
|
|
1271
|
+
function ownKeys$7(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; }
|
|
1272
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1294
1273
|
var STYLES = {
|
|
1295
1274
|
border: {
|
|
1296
1275
|
"default": "1px solid rgb(var(--neeto-ui-gray-400))",
|
|
@@ -1302,8 +1281,8 @@ var STYLES = {
|
|
|
1302
1281
|
}
|
|
1303
1282
|
};
|
|
1304
1283
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1305
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$
|
|
1306
|
-
innerProps: _objectSpread$
|
|
1284
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1285
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty__default["default"]({}, "data-cy", "".concat(utils.hyphenize(props.data.label), "-remove-icon"))),
|
|
1307
1286
|
children: /*#__PURE__*/jsxRuntime.jsx(Close__default["default"], {
|
|
1308
1287
|
size: 16
|
|
1309
1288
|
})
|
|
@@ -1323,8 +1302,8 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1323
1302
|
firstChild = _children[0],
|
|
1324
1303
|
rest = _children.slice(1);
|
|
1325
1304
|
var shouldCollapse = !isFocused && value.length > visibleDomainsCount;
|
|
1326
|
-
return /*#__PURE__*/jsxRuntime.jsxs(reactSelect.components.ValueContainer, _objectSpread$
|
|
1327
|
-
innerProps: _objectSpread$
|
|
1305
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactSelect.components.ValueContainer, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1306
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty__default["default"]({}, "data-cy", "multi-domain-input-container")),
|
|
1328
1307
|
children: [shouldCollapse ? firstChild.slice(0, visibleDomainsCount) : firstChild, shouldCollapse && /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
|
|
1329
1308
|
style: "secondary",
|
|
1330
1309
|
label: t("neetoForm.common.remainingItemsCount", {
|
|
@@ -1334,8 +1313,8 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1334
1313
|
}));
|
|
1335
1314
|
};
|
|
1336
1315
|
var ClearIndicator = function ClearIndicator(props) {
|
|
1337
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$
|
|
1338
|
-
innerProps: _objectSpread$
|
|
1316
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1317
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty__default["default"]({}, "data-cy", "clear-all-button")),
|
|
1339
1318
|
children: /*#__PURE__*/jsxRuntime.jsx(Close__default["default"], {
|
|
1340
1319
|
className: "cursor-pointer",
|
|
1341
1320
|
size: 16
|
|
@@ -1356,7 +1335,7 @@ var CUSTOM_STYLES = {
|
|
|
1356
1335
|
input: ramda.assoc("overflow", "hidden"),
|
|
1357
1336
|
multiValue: function multiValue(styles, _ref2) {
|
|
1358
1337
|
var valid = _ref2.data.valid;
|
|
1359
|
-
return _objectSpread$
|
|
1338
|
+
return _objectSpread$7(_objectSpread$7({}, styles), {}, {
|
|
1360
1339
|
border: valid ? STYLES.border["default"] : STYLES.border.error,
|
|
1361
1340
|
color: valid ? STYLES.color["default"] : STYLES.color.error
|
|
1362
1341
|
});
|
|
@@ -1399,8 +1378,8 @@ var formatErrorMessage = function formatErrorMessage(error) {
|
|
|
1399
1378
|
};
|
|
1400
1379
|
|
|
1401
1380
|
var _excluded$2 = ["label", "value", "onChange", "error", "onBlur"];
|
|
1402
|
-
function ownKeys$
|
|
1403
|
-
function _objectSpread$
|
|
1381
|
+
function ownKeys$6(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; }
|
|
1382
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1404
1383
|
var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
1405
1384
|
var _ref$label = _ref.label,
|
|
1406
1385
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -1459,7 +1438,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1459
1438
|
"data-cy": "".concat(utils.hyphenize(label), "-input-label"),
|
|
1460
1439
|
children: label
|
|
1461
1440
|
})
|
|
1462
|
-
}), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect__default["default"], _objectSpread$
|
|
1441
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect__default["default"], _objectSpread$6({
|
|
1463
1442
|
isMulti: true,
|
|
1464
1443
|
required: true,
|
|
1465
1444
|
classNamePrefix: "neeto-ui-react-select",
|
|
@@ -1469,7 +1448,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1469
1448
|
className: classnames__default["default"]("neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select", {
|
|
1470
1449
|
"neeto-ui-react-select__container--error": !!error
|
|
1471
1450
|
}),
|
|
1472
|
-
styles: _objectSpread$
|
|
1451
|
+
styles: _objectSpread$6(_objectSpread$6({}, CUSTOM_STYLES), {}, {
|
|
1473
1452
|
control: ramda.mergeLeft({
|
|
1474
1453
|
maxHeight: "200px",
|
|
1475
1454
|
overflowY: "auto"
|
|
@@ -1481,7 +1460,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1481
1460
|
},
|
|
1482
1461
|
onInputChange: setInputValue,
|
|
1483
1462
|
onKeyDown: handleKeyDown
|
|
1484
|
-
}, _objectSpread$
|
|
1463
|
+
}, _objectSpread$6({
|
|
1485
1464
|
inputValue: inputValue,
|
|
1486
1465
|
isFocused: isFocused,
|
|
1487
1466
|
onChange: onChange,
|
|
@@ -1511,8 +1490,8 @@ var validateDomains = function validateDomains(value) {
|
|
|
1511
1490
|
}));
|
|
1512
1491
|
|
|
1513
1492
|
// eslint-disable-next-line no-async-promise-executor
|
|
1514
|
-
return new Promise(
|
|
1515
|
-
var _ref = _asyncToGenerator__default["default"](
|
|
1493
|
+
return new Promise(/*#__PURE__*/function () {
|
|
1494
|
+
var _ref = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(resolve) {
|
|
1516
1495
|
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
1517
1496
|
while (1) switch (_context.prev = _context.next) {
|
|
1518
1497
|
case 0:
|
|
@@ -1539,9 +1518,13 @@ var validateDomains = function validateDomains(value) {
|
|
|
1539
1518
|
}());
|
|
1540
1519
|
};
|
|
1541
1520
|
|
|
1542
|
-
var
|
|
1521
|
+
var EmailDomains = function EmailDomains(_ref) {
|
|
1522
|
+
var name = _ref.name,
|
|
1523
|
+
label = _ref.label;
|
|
1524
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
1525
|
+
t = _useTranslation.t;
|
|
1543
1526
|
var _useField = formik.useField({
|
|
1544
|
-
name:
|
|
1527
|
+
name: name,
|
|
1545
1528
|
validate: validateDomains
|
|
1546
1529
|
}),
|
|
1547
1530
|
_useField2 = _slicedToArray__default["default"](_useField, 3),
|
|
@@ -1551,15 +1534,14 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1551
1534
|
_useField2$ = _useField2[2],
|
|
1552
1535
|
setValue = _useField2$.setValue,
|
|
1553
1536
|
setTouched = _useField2$.setTouched;
|
|
1554
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
1555
|
-
t = _useTranslation.t;
|
|
1556
1537
|
var formattedDomains = ramda.map(formatDomainInputOptions, domains);
|
|
1557
1538
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1558
1539
|
className: "mb-4",
|
|
1559
1540
|
children: /*#__PURE__*/jsxRuntime.jsx(MultiDomainInput, {
|
|
1541
|
+
label: label,
|
|
1542
|
+
name: name,
|
|
1560
1543
|
error: meta.touched ? meta.error : "",
|
|
1561
|
-
|
|
1562
|
-
name: "restrictedDomains",
|
|
1544
|
+
placeholder: t("neetoForm.domainRestriction.placeholder"),
|
|
1563
1545
|
value: formattedDomains,
|
|
1564
1546
|
onBlur: function onBlur() {
|
|
1565
1547
|
return setTouched(true);
|
|
@@ -1571,34 +1553,53 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1571
1553
|
});
|
|
1572
1554
|
};
|
|
1573
1555
|
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1556
|
+
var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
|
|
1557
|
+
var switchName = _ref.switchName,
|
|
1558
|
+
domainName = _ref.domainName,
|
|
1559
|
+
isDomainRestrictionEnabled = _ref.isDomainRestrictionEnabled;
|
|
1560
|
+
var _DOMAIN_RESTRICTION_T = DOMAIN_RESTRICTION_TRANSLATIONS[domainName],
|
|
1561
|
+
title = _DOMAIN_RESTRICTION_T.title,
|
|
1562
|
+
description = _DOMAIN_RESTRICTION_T.description,
|
|
1563
|
+
popoverDescription = _DOMAIN_RESTRICTION_T.popoverDescription;
|
|
1564
|
+
var helpLink = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", domainName]));
|
|
1583
1565
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1584
1566
|
className: "flex flex-col space-y-4",
|
|
1567
|
+
"data-cy": "".concat(neetoCist.hyphenate(switchName), "-container"),
|
|
1585
1568
|
children: [/*#__PURE__*/jsxRuntime.jsx(SwitchBlock, {
|
|
1586
1569
|
className: "mt-4",
|
|
1587
|
-
name:
|
|
1588
|
-
title: /*#__PURE__*/jsxRuntime.
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
popoverProps: {
|
|
1593
|
-
position: "top"
|
|
1594
|
-
}
|
|
1595
|
-
}, helpDocUrl && {
|
|
1596
|
-
helpLinkProps: {
|
|
1597
|
-
href: helpDocUrl
|
|
1598
|
-
}
|
|
1599
|
-
}))]
|
|
1570
|
+
name: switchName,
|
|
1571
|
+
title: /*#__PURE__*/jsxRuntime.jsx(TitleWithHelpPopover, {
|
|
1572
|
+
helpLink: helpLink,
|
|
1573
|
+
title: title,
|
|
1574
|
+
description: popoverDescription
|
|
1600
1575
|
})
|
|
1601
|
-
}), isDomainRestrictionEnabled && /*#__PURE__*/jsxRuntime.jsx(
|
|
1576
|
+
}), isDomainRestrictionEnabled && /*#__PURE__*/jsxRuntime.jsx(EmailDomains, {
|
|
1577
|
+
label: description,
|
|
1578
|
+
name: domainName
|
|
1579
|
+
})]
|
|
1580
|
+
});
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
var Email = function Email(_ref) {
|
|
1584
|
+
var enableDomainWhitelisting = _ref.enableDomainWhitelisting,
|
|
1585
|
+
enableDomainBlacklisting = _ref.enableDomainBlacklisting;
|
|
1586
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
1587
|
+
_useFormikContext$val = _useFormikContext.values,
|
|
1588
|
+
_useFormikContext$val2 = _useFormikContext$val.isDomainWhitelistingEnabled,
|
|
1589
|
+
isDomainWhitelistingEnabled = _useFormikContext$val2 === void 0 ? false : _useFormikContext$val2,
|
|
1590
|
+
_useFormikContext$val3 = _useFormikContext$val.isDomainBlacklistingEnabled,
|
|
1591
|
+
isDomainBlacklistingEnabled = _useFormikContext$val3 === void 0 ? false : _useFormikContext$val3;
|
|
1592
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1593
|
+
className: "flex flex-col space-y-4",
|
|
1594
|
+
children: [enableDomainWhitelisting && /*#__PURE__*/jsxRuntime.jsx(RestrictDomainsBlock, {
|
|
1595
|
+
domainName: "whitelistedDomains",
|
|
1596
|
+
isDomainRestrictionEnabled: isDomainWhitelistingEnabled,
|
|
1597
|
+
switchName: "isDomainWhitelistingEnabled"
|
|
1598
|
+
}), enableDomainBlacklisting && /*#__PURE__*/jsxRuntime.jsx(RestrictDomainsBlock, {
|
|
1599
|
+
domainName: "blacklistedDomains",
|
|
1600
|
+
isDomainRestrictionEnabled: isDomainBlacklistingEnabled,
|
|
1601
|
+
switchName: "isDomainBlacklistingEnabled"
|
|
1602
|
+
})]
|
|
1602
1603
|
});
|
|
1603
1604
|
};
|
|
1604
1605
|
|
|
@@ -1956,7 +1957,8 @@ var transformValueForOption = function transformValueForOption(_ref) {
|
|
|
1956
1957
|
var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
1957
1958
|
var kind = _ref2.kind,
|
|
1958
1959
|
questionProps = _ref2.questionProps,
|
|
1959
|
-
|
|
1960
|
+
enableDomainWhitelisting = _ref2.enableDomainWhitelisting,
|
|
1961
|
+
enableDomainBlacklisting = _ref2.enableDomainBlacklisting;
|
|
1960
1962
|
switch (kind) {
|
|
1961
1963
|
case CHECKBOX:
|
|
1962
1964
|
case RADIO:
|
|
@@ -1973,7 +1975,10 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
1973
1975
|
case CAPTCHA:
|
|
1974
1976
|
return /*#__PURE__*/jsxRuntime.jsx(Captcha, {});
|
|
1975
1977
|
case EMAIL:
|
|
1976
|
-
return
|
|
1978
|
+
return enableDomainWhitelisting || enableDomainBlacklisting ? /*#__PURE__*/jsxRuntime.jsx(Email, {
|
|
1979
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
1980
|
+
enableDomainWhitelisting: enableDomainWhitelisting
|
|
1981
|
+
}) : null;
|
|
1977
1982
|
default:
|
|
1978
1983
|
return null;
|
|
1979
1984
|
}
|
|
@@ -2058,7 +2063,7 @@ var AddQuestion = function AddQuestion(_ref) {
|
|
|
2058
2063
|
}));
|
|
2059
2064
|
};
|
|
2060
2065
|
|
|
2061
|
-
var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "
|
|
2066
|
+
var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "enableDomainBlacklisting", "enableDomainWhitelisting", "helpDocUrls"];
|
|
2062
2067
|
function ownKeys$1(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; }
|
|
2063
2068
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2064
2069
|
var Form = function Form(_ref) {
|
|
@@ -2086,7 +2091,8 @@ var Form = function Form(_ref) {
|
|
|
2086
2091
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2087
2092
|
showActionBlock = _ref.showActionBlock,
|
|
2088
2093
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
2089
|
-
|
|
2094
|
+
enableDomainBlacklisting = _ref.enableDomainBlacklisting,
|
|
2095
|
+
enableDomainWhitelisting = _ref.enableDomainWhitelisting,
|
|
2090
2096
|
helpDocUrls = _ref.helpDocUrls,
|
|
2091
2097
|
formDomProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
2092
2098
|
var containerRef = React.useRef();
|
|
@@ -2135,9 +2141,11 @@ var Form = function Form(_ref) {
|
|
|
2135
2141
|
submitForm: submitForm,
|
|
2136
2142
|
resetForm: resetForm,
|
|
2137
2143
|
selectedLanguage: selectedLanguage,
|
|
2138
|
-
helpDocUrls: helpDocUrls
|
|
2144
|
+
helpDocUrls: helpDocUrls,
|
|
2145
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
2146
|
+
enableDomainWhitelisting: enableDomainWhitelisting
|
|
2139
2147
|
});
|
|
2140
|
-
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls]);
|
|
2148
|
+
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls, enableDomainBlacklisting, enableDomainWhitelisting]);
|
|
2141
2149
|
var questions = values.questions;
|
|
2142
2150
|
var handleSelect = function handleSelect(question) {
|
|
2143
2151
|
setSelectedQuestion(question);
|
|
@@ -2183,7 +2191,7 @@ var Form = function Form(_ref) {
|
|
|
2183
2191
|
enabled: !(isDeleteAlertOpen || isManageQuestionPaneOpen)
|
|
2184
2192
|
});
|
|
2185
2193
|
React.useEffect(function () {
|
|
2186
|
-
onValueChange === null || onValueChange === void 0
|
|
2194
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(questions);
|
|
2187
2195
|
}, [questions]);
|
|
2188
2196
|
var availableQuestionKinds = getAvailableQuestionKinds({
|
|
2189
2197
|
allQuestionKinds: questionKinds,
|
|
@@ -2280,7 +2288,6 @@ var Form = function Form(_ref) {
|
|
|
2280
2288
|
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
2281
2289
|
availableQuestionKinds: availableQuestionKinds,
|
|
2282
2290
|
buildRequestArgs: buildRequestArgs,
|
|
2283
|
-
enableDomainRestriction: enableDomainRestriction,
|
|
2284
2291
|
enableFieldCode: enableFieldCode,
|
|
2285
2292
|
getActiveKindDetails: getActiveKindDetails,
|
|
2286
2293
|
handleSelect: handleSelect,
|
|
@@ -2343,8 +2350,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2343
2350
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
2344
2351
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
2345
2352
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2346
|
-
_ref$
|
|
2347
|
-
|
|
2353
|
+
_ref$enableDomainBlac = _ref.enableDomainBlacklisting,
|
|
2354
|
+
enableDomainBlacklisting = _ref$enableDomainBlac === void 0 ? true : _ref$enableDomainBlac,
|
|
2355
|
+
_ref$enableDomainWhit = _ref.enableDomainWhitelisting,
|
|
2356
|
+
enableDomainWhitelisting = _ref$enableDomainWhit === void 0 ? true : _ref$enableDomainWhit,
|
|
2348
2357
|
helpDocUrls = _ref.helpDocUrls,
|
|
2349
2358
|
className = _ref.className;
|
|
2350
2359
|
var queryClient = reactQuery.useQueryClient();
|
|
@@ -2367,7 +2376,7 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2367
2376
|
isQuestionsLoading = _ref2.isQuestionsLoading;
|
|
2368
2377
|
React.useEffect(function () {
|
|
2369
2378
|
if (data) {
|
|
2370
|
-
onUpdate === null || onUpdate === void 0
|
|
2379
|
+
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(data);
|
|
2371
2380
|
}
|
|
2372
2381
|
}, [data]);
|
|
2373
2382
|
if (isLoading || showLoader && isQuestionsLoading && !isQuestionsPending) {
|
|
@@ -2428,7 +2437,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2428
2437
|
buildRequestArgs: buildRequestArgs,
|
|
2429
2438
|
cancelButtonProps: cancelButtonProps,
|
|
2430
2439
|
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
2431
|
-
|
|
2440
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
2441
|
+
enableDomainWhitelisting: enableDomainWhitelisting,
|
|
2432
2442
|
enableFieldCode: enableFieldCode,
|
|
2433
2443
|
formDescription: formDescription,
|
|
2434
2444
|
formTitle: formTitle,
|