@bigbinary/neeto-form-frontend 3.8.3 → 3.9.0
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 +12 -4
- package/dist/BuildForm.js +128 -55
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +1 -1
- package/dist/UrlBuilder.js +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 +128 -55
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +1 -1
- package/dist/cjs/UrlBuilder.js +1 -1
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{utils-e4298243.js → utils-3eb74c1b.js} +17 -8
- package/dist/utils-3eb74c1b.js.map +1 -0
- package/dist/{utils-4918956b.js → utils-6039d7d2.js} +18 -9
- package/dist/utils-6039d7d2.js.map +1 -0
- package/package.json +1 -1
- 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
|
@@ -179,11 +179,19 @@
|
|
|
179
179
|
"mb": "MB"
|
|
180
180
|
},
|
|
181
181
|
"domainRestriction": {
|
|
182
|
-
"
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
"whitelistedDomains": {
|
|
183
|
+
"label": "Accept emails only from specific domains",
|
|
184
|
+
"description": "Only emails having the following domains will be accepted.",
|
|
185
|
+
"popoverDescription": "Enter domains that should be permitted. Only emails with these domains will be accepted."
|
|
186
|
+
},
|
|
187
|
+
"blacklistedDomains": {
|
|
188
|
+
"label": "Accept only business emails",
|
|
189
|
+
"description": "Emails having the following domains will be rejected.",
|
|
190
|
+
"popoverDescription": "Enter domains that should be restricted. Emails with these domains will not be accepted."
|
|
191
|
+
},
|
|
185
192
|
"helpText": "Press space, tab or enter key after adding a domain.",
|
|
186
|
-
"removeInvalidDomains": "Click here to remove invalid domains."
|
|
193
|
+
"removeInvalidDomains": "Click here to remove invalid domains.",
|
|
194
|
+
"placeholder": "Please enter the email domains"
|
|
187
195
|
},
|
|
188
196
|
"smsReminder": {
|
|
189
197
|
"popoverDescription": "This question is displayed because SMS reminders are enabled. To remove this question, please disable SMS reminders."
|
package/dist/BuildForm.js
CHANGED
|
@@ -16,7 +16,7 @@ import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
|
|
|
16
16
|
import { isMetaKeyPressed, withT, useStateWithDependency, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
17
17
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
18
18
|
import { useTranslation, Trans } from 'react-i18next';
|
|
19
|
-
import { a as useBuildFormStore } from './buildForm-
|
|
19
|
+
import { a as useBuildFormStore } from './buildForm-dfd708c6.js';
|
|
20
20
|
import { shallow } from 'zustand/shallow';
|
|
21
21
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
22
22
|
import { f as fieldWithFallback, i as isFunction } from './index-2664c3e7.js';
|
|
@@ -893,7 +893,6 @@ var Form$1 = function Form(_ref) {
|
|
|
893
893
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
894
894
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
895
895
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
896
|
-
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
897
896
|
_ref$isEdit = _ref.isEdit,
|
|
898
897
|
isEdit = _ref$isEdit === void 0 ? false : _ref$isEdit;
|
|
899
898
|
var _useTranslation = useTranslation(),
|
|
@@ -904,6 +903,15 @@ var Form$1 = function Form(_ref) {
|
|
|
904
903
|
setErrors = _useFormikContext.setErrors,
|
|
905
904
|
setTouched = _useFormikContext.setTouched;
|
|
906
905
|
var hideQuestionHelpDoc = useBuildFormStore(path(["formState", "helpDocUrls", "hideQuestion"]));
|
|
906
|
+
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
907
|
+
var _store$formState, _store$formState2;
|
|
908
|
+
return {
|
|
909
|
+
enableDomainWhitelisting: (_store$formState = store["formState"]) === null || _store$formState === void 0 ? void 0 : _store$formState["enableDomainWhitelisting"],
|
|
910
|
+
enableDomainBlacklisting: (_store$formState2 = store["formState"]) === null || _store$formState2 === void 0 ? void 0 : _store$formState2["enableDomainBlacklisting"]
|
|
911
|
+
};
|
|
912
|
+
}, shallow),
|
|
913
|
+
enableDomainWhitelisting = _useBuildFormStore.enableDomainWhitelisting,
|
|
914
|
+
enableDomainBlacklisting = _useBuildFormStore.enableDomainBlacklisting;
|
|
907
915
|
var kind = values.kind;
|
|
908
916
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
909
917
|
var questionKindUniquenessPattern = mergeLeft(isEdit && additionalQuestionKindPattern ? additionalQuestionKindPattern(values) : {}, {
|
|
@@ -983,7 +991,8 @@ var Form$1 = function Form(_ref) {
|
|
|
983
991
|
}), hasAdditionalData && renderAdditionalData({
|
|
984
992
|
kind: kind,
|
|
985
993
|
questionProps: questionProps,
|
|
986
|
-
|
|
994
|
+
enableDomainWhitelisting: enableDomainWhitelisting,
|
|
995
|
+
enableDomainBlacklisting: enableDomainBlacklisting
|
|
987
996
|
})]
|
|
988
997
|
}), isSettingsBlockVisible && /*#__PURE__*/jsxs(Block, {
|
|
989
998
|
dataCy: "settings-card",
|
|
@@ -1229,9 +1238,43 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
1229
1238
|
});
|
|
1230
1239
|
};
|
|
1231
1240
|
|
|
1232
|
-
var _excluded$3 = ["children"];
|
|
1233
1241
|
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; }
|
|
1234
1242
|
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(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; }
|
|
1243
|
+
var TitleWithHelpPopover = function TitleWithHelpPopover(_ref) {
|
|
1244
|
+
var title = _ref.title,
|
|
1245
|
+
description = _ref.description,
|
|
1246
|
+
helpLink = _ref.helpLink;
|
|
1247
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1248
|
+
className: "flex gap-2",
|
|
1249
|
+
children: [title, /*#__PURE__*/jsx(HelpPopover, _objectSpread$8({
|
|
1250
|
+
description: description,
|
|
1251
|
+
popoverProps: {
|
|
1252
|
+
position: "top"
|
|
1253
|
+
}
|
|
1254
|
+
}, helpLink && {
|
|
1255
|
+
helpLinkProps: {
|
|
1256
|
+
href: helpLink
|
|
1257
|
+
}
|
|
1258
|
+
}))]
|
|
1259
|
+
});
|
|
1260
|
+
};
|
|
1261
|
+
|
|
1262
|
+
var DOMAIN_RESTRICTION_TRANSLATIONS = {
|
|
1263
|
+
whitelistedDomains: {
|
|
1264
|
+
title: t("neetoForm.domainRestriction.whitelistedDomains.label"),
|
|
1265
|
+
description: t("neetoForm.domainRestriction.whitelistedDomains.description"),
|
|
1266
|
+
popoverDescription: t("neetoForm.domainRestriction.whitelistedDomains.popoverDescription")
|
|
1267
|
+
},
|
|
1268
|
+
blacklistedDomains: {
|
|
1269
|
+
title: t("neetoForm.domainRestriction.blacklistedDomains.label"),
|
|
1270
|
+
description: t("neetoForm.domainRestriction.blacklistedDomains.description"),
|
|
1271
|
+
popoverDescription: t("neetoForm.domainRestriction.blacklistedDomains.popoverDescription")
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
var _excluded$3 = ["children"];
|
|
1276
|
+
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; }
|
|
1277
|
+
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(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; }
|
|
1235
1278
|
var STYLES = {
|
|
1236
1279
|
border: {
|
|
1237
1280
|
"default": "1px solid rgb(var(--neeto-ui-gray-400))",
|
|
@@ -1243,8 +1286,8 @@ var STYLES = {
|
|
|
1243
1286
|
}
|
|
1244
1287
|
};
|
|
1245
1288
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1246
|
-
return /*#__PURE__*/jsx(components.MultiValueRemove, _objectSpread$
|
|
1247
|
-
innerProps: _objectSpread$
|
|
1289
|
+
return /*#__PURE__*/jsx(components.MultiValueRemove, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1290
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty({}, "data-cy", "".concat(hyphenize(props.data.label), "-remove-icon"))),
|
|
1248
1291
|
children: /*#__PURE__*/jsx(Close, {
|
|
1249
1292
|
size: 16
|
|
1250
1293
|
})
|
|
@@ -1264,8 +1307,8 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1264
1307
|
firstChild = _children[0],
|
|
1265
1308
|
rest = _children.slice(1);
|
|
1266
1309
|
var shouldCollapse = !isFocused && value.length > visibleDomainsCount;
|
|
1267
|
-
return /*#__PURE__*/jsxs(components.ValueContainer, _objectSpread$
|
|
1268
|
-
innerProps: _objectSpread$
|
|
1310
|
+
return /*#__PURE__*/jsxs(components.ValueContainer, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1311
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty({}, "data-cy", "multi-domain-input-container")),
|
|
1269
1312
|
children: [shouldCollapse ? firstChild.slice(0, visibleDomainsCount) : firstChild, shouldCollapse && /*#__PURE__*/jsx(Tag, {
|
|
1270
1313
|
style: "secondary",
|
|
1271
1314
|
label: t("neetoForm.common.remainingItemsCount", {
|
|
@@ -1275,8 +1318,8 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1275
1318
|
}));
|
|
1276
1319
|
};
|
|
1277
1320
|
var ClearIndicator = function ClearIndicator(props) {
|
|
1278
|
-
return /*#__PURE__*/jsx(components.ClearIndicator, _objectSpread$
|
|
1279
|
-
innerProps: _objectSpread$
|
|
1321
|
+
return /*#__PURE__*/jsx(components.ClearIndicator, _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
1322
|
+
innerProps: _objectSpread$7(_objectSpread$7({}, props.innerProps), {}, _defineProperty({}, "data-cy", "clear-all-button")),
|
|
1280
1323
|
children: /*#__PURE__*/jsx(Close, {
|
|
1281
1324
|
className: "cursor-pointer",
|
|
1282
1325
|
size: 16
|
|
@@ -1297,7 +1340,7 @@ var CUSTOM_STYLES = {
|
|
|
1297
1340
|
input: assoc("overflow", "hidden"),
|
|
1298
1341
|
multiValue: function multiValue(styles, _ref2) {
|
|
1299
1342
|
var valid = _ref2.data.valid;
|
|
1300
|
-
return _objectSpread$
|
|
1343
|
+
return _objectSpread$7(_objectSpread$7({}, styles), {}, {
|
|
1301
1344
|
border: valid ? STYLES.border["default"] : STYLES.border.error,
|
|
1302
1345
|
color: valid ? STYLES.color["default"] : STYLES.color.error
|
|
1303
1346
|
});
|
|
@@ -1340,8 +1383,8 @@ var formatErrorMessage = function formatErrorMessage(error) {
|
|
|
1340
1383
|
};
|
|
1341
1384
|
|
|
1342
1385
|
var _excluded$2 = ["label", "value", "onChange", "error", "onBlur"];
|
|
1343
|
-
function ownKeys$
|
|
1344
|
-
function _objectSpread$
|
|
1386
|
+
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; }
|
|
1387
|
+
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(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; }
|
|
1345
1388
|
var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
1346
1389
|
var _ref$label = _ref.label,
|
|
1347
1390
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -1400,7 +1443,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1400
1443
|
"data-cy": "".concat(hyphenize(label), "-input-label"),
|
|
1401
1444
|
children: label
|
|
1402
1445
|
})
|
|
1403
|
-
}), /*#__PURE__*/jsx(CreatableSelect, _objectSpread$
|
|
1446
|
+
}), /*#__PURE__*/jsx(CreatableSelect, _objectSpread$6({
|
|
1404
1447
|
isMulti: true,
|
|
1405
1448
|
required: true,
|
|
1406
1449
|
classNamePrefix: "neeto-ui-react-select",
|
|
@@ -1410,7 +1453,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1410
1453
|
className: classnames("neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select", {
|
|
1411
1454
|
"neeto-ui-react-select__container--error": !!error
|
|
1412
1455
|
}),
|
|
1413
|
-
styles: _objectSpread$
|
|
1456
|
+
styles: _objectSpread$6(_objectSpread$6({}, CUSTOM_STYLES), {}, {
|
|
1414
1457
|
control: mergeLeft({
|
|
1415
1458
|
maxHeight: "200px",
|
|
1416
1459
|
overflowY: "auto"
|
|
@@ -1422,7 +1465,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
|
|
|
1422
1465
|
},
|
|
1423
1466
|
onInputChange: setInputValue,
|
|
1424
1467
|
onKeyDown: handleKeyDown
|
|
1425
|
-
}, _objectSpread$
|
|
1468
|
+
}, _objectSpread$6({
|
|
1426
1469
|
inputValue: inputValue,
|
|
1427
1470
|
isFocused: isFocused,
|
|
1428
1471
|
onChange: onChange,
|
|
@@ -1480,9 +1523,13 @@ var validateDomains = function validateDomains(value) {
|
|
|
1480
1523
|
}());
|
|
1481
1524
|
};
|
|
1482
1525
|
|
|
1483
|
-
var
|
|
1526
|
+
var EmailDomains = function EmailDomains(_ref) {
|
|
1527
|
+
var name = _ref.name,
|
|
1528
|
+
label = _ref.label;
|
|
1529
|
+
var _useTranslation = useTranslation(),
|
|
1530
|
+
t = _useTranslation.t;
|
|
1484
1531
|
var _useField = useField({
|
|
1485
|
-
name:
|
|
1532
|
+
name: name,
|
|
1486
1533
|
validate: validateDomains
|
|
1487
1534
|
}),
|
|
1488
1535
|
_useField2 = _slicedToArray(_useField, 3),
|
|
@@ -1492,15 +1539,14 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1492
1539
|
_useField2$ = _useField2[2],
|
|
1493
1540
|
setValue = _useField2$.setValue,
|
|
1494
1541
|
setTouched = _useField2$.setTouched;
|
|
1495
|
-
var _useTranslation = useTranslation(),
|
|
1496
|
-
t = _useTranslation.t;
|
|
1497
1542
|
var formattedDomains = map(formatDomainInputOptions, domains);
|
|
1498
1543
|
return /*#__PURE__*/jsx("div", {
|
|
1499
1544
|
className: "mb-4",
|
|
1500
1545
|
children: /*#__PURE__*/jsx(MultiDomainInput, {
|
|
1546
|
+
label: label,
|
|
1547
|
+
name: name,
|
|
1501
1548
|
error: meta.touched ? meta.error : "",
|
|
1502
|
-
|
|
1503
|
-
name: "restrictedDomains",
|
|
1549
|
+
placeholder: t("neetoForm.domainRestriction.placeholder"),
|
|
1504
1550
|
value: formattedDomains,
|
|
1505
1551
|
onBlur: function onBlur() {
|
|
1506
1552
|
return setTouched(true);
|
|
@@ -1512,34 +1558,52 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1512
1558
|
});
|
|
1513
1559
|
};
|
|
1514
1560
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1561
|
+
var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
|
|
1562
|
+
var switchName = _ref.switchName,
|
|
1563
|
+
domainName = _ref.domainName,
|
|
1564
|
+
isDomainRestrictionEnabled = _ref.isDomainRestrictionEnabled;
|
|
1565
|
+
var _DOMAIN_RESTRICTION_T = DOMAIN_RESTRICTION_TRANSLATIONS[domainName],
|
|
1566
|
+
title = _DOMAIN_RESTRICTION_T.title,
|
|
1567
|
+
description = _DOMAIN_RESTRICTION_T.description,
|
|
1568
|
+
popoverDescription = _DOMAIN_RESTRICTION_T.popoverDescription;
|
|
1569
|
+
var helpLink = useBuildFormStore(path(["formState", "helpDocUrls", domainName]));
|
|
1524
1570
|
return /*#__PURE__*/jsxs("div", {
|
|
1525
1571
|
className: "flex flex-col space-y-4",
|
|
1526
1572
|
children: [/*#__PURE__*/jsx(SwitchBlock, {
|
|
1527
1573
|
className: "mt-4",
|
|
1528
|
-
name:
|
|
1529
|
-
title: /*#__PURE__*/
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
popoverProps: {
|
|
1534
|
-
position: "top"
|
|
1535
|
-
}
|
|
1536
|
-
}, helpDocUrl && {
|
|
1537
|
-
helpLinkProps: {
|
|
1538
|
-
href: helpDocUrl
|
|
1539
|
-
}
|
|
1540
|
-
}))]
|
|
1574
|
+
name: switchName,
|
|
1575
|
+
title: /*#__PURE__*/jsx(TitleWithHelpPopover, {
|
|
1576
|
+
helpLink: helpLink,
|
|
1577
|
+
title: title,
|
|
1578
|
+
description: popoverDescription
|
|
1541
1579
|
})
|
|
1542
|
-
}), isDomainRestrictionEnabled && /*#__PURE__*/jsx(
|
|
1580
|
+
}), isDomainRestrictionEnabled && /*#__PURE__*/jsx(EmailDomains, {
|
|
1581
|
+
label: description,
|
|
1582
|
+
name: domainName
|
|
1583
|
+
})]
|
|
1584
|
+
});
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
var Email = function Email(_ref) {
|
|
1588
|
+
var enableDomainWhitelisting = _ref.enableDomainWhitelisting,
|
|
1589
|
+
enableDomainBlacklisting = _ref.enableDomainBlacklisting;
|
|
1590
|
+
var _useFormikContext = useFormikContext(),
|
|
1591
|
+
_useFormikContext$val = _useFormikContext.values,
|
|
1592
|
+
_useFormikContext$val2 = _useFormikContext$val.isDomainWhitelistingEnabled,
|
|
1593
|
+
isDomainWhitelistingEnabled = _useFormikContext$val2 === void 0 ? false : _useFormikContext$val2,
|
|
1594
|
+
_useFormikContext$val3 = _useFormikContext$val.isDomainBlacklistingEnabled,
|
|
1595
|
+
isDomainBlacklistingEnabled = _useFormikContext$val3 === void 0 ? false : _useFormikContext$val3;
|
|
1596
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1597
|
+
className: "flex flex-col space-y-4",
|
|
1598
|
+
children: [enableDomainWhitelisting && /*#__PURE__*/jsx(RestrictDomainsBlock, {
|
|
1599
|
+
domainName: "whitelistedDomains",
|
|
1600
|
+
isDomainRestrictionEnabled: isDomainWhitelistingEnabled,
|
|
1601
|
+
switchName: "isDomainWhitelistingEnabled"
|
|
1602
|
+
}), enableDomainBlacklisting && /*#__PURE__*/jsx(RestrictDomainsBlock, {
|
|
1603
|
+
domainName: "blacklistedDomains",
|
|
1604
|
+
isDomainRestrictionEnabled: isDomainBlacklistingEnabled,
|
|
1605
|
+
switchName: "isDomainBlacklistingEnabled"
|
|
1606
|
+
})]
|
|
1543
1607
|
});
|
|
1544
1608
|
};
|
|
1545
1609
|
|
|
@@ -1897,7 +1961,8 @@ var transformValueForOption = function transformValueForOption(_ref) {
|
|
|
1897
1961
|
var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
1898
1962
|
var kind = _ref2.kind,
|
|
1899
1963
|
questionProps = _ref2.questionProps,
|
|
1900
|
-
|
|
1964
|
+
enableDomainWhitelisting = _ref2.enableDomainWhitelisting,
|
|
1965
|
+
enableDomainBlacklisting = _ref2.enableDomainBlacklisting;
|
|
1901
1966
|
switch (kind) {
|
|
1902
1967
|
case CHECKBOX:
|
|
1903
1968
|
case RADIO:
|
|
@@ -1914,7 +1979,10 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
1914
1979
|
case CAPTCHA:
|
|
1915
1980
|
return /*#__PURE__*/jsx(Captcha, {});
|
|
1916
1981
|
case EMAIL:
|
|
1917
|
-
return
|
|
1982
|
+
return enableDomainWhitelisting || enableDomainBlacklisting ? /*#__PURE__*/jsx(Email, {
|
|
1983
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
1984
|
+
enableDomainWhitelisting: enableDomainWhitelisting
|
|
1985
|
+
}) : null;
|
|
1918
1986
|
default:
|
|
1919
1987
|
return null;
|
|
1920
1988
|
}
|
|
@@ -1999,7 +2067,7 @@ var AddQuestion = function AddQuestion(_ref) {
|
|
|
1999
2067
|
}));
|
|
2000
2068
|
};
|
|
2001
2069
|
|
|
2002
|
-
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", "
|
|
2070
|
+
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"];
|
|
2003
2071
|
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; }
|
|
2004
2072
|
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(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; }
|
|
2005
2073
|
var Form = function Form(_ref) {
|
|
@@ -2027,7 +2095,8 @@ var Form = function Form(_ref) {
|
|
|
2027
2095
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2028
2096
|
showActionBlock = _ref.showActionBlock,
|
|
2029
2097
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
2030
|
-
|
|
2098
|
+
enableDomainBlacklisting = _ref.enableDomainBlacklisting,
|
|
2099
|
+
enableDomainWhitelisting = _ref.enableDomainWhitelisting,
|
|
2031
2100
|
helpDocUrls = _ref.helpDocUrls,
|
|
2032
2101
|
formDomProps = _objectWithoutProperties(_ref, _excluded);
|
|
2033
2102
|
var containerRef = useRef();
|
|
@@ -2076,9 +2145,11 @@ var Form = function Form(_ref) {
|
|
|
2076
2145
|
submitForm: submitForm,
|
|
2077
2146
|
resetForm: resetForm,
|
|
2078
2147
|
selectedLanguage: selectedLanguage,
|
|
2079
|
-
helpDocUrls: helpDocUrls
|
|
2148
|
+
helpDocUrls: helpDocUrls,
|
|
2149
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
2150
|
+
enableDomainWhitelisting: enableDomainWhitelisting
|
|
2080
2151
|
});
|
|
2081
|
-
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls]);
|
|
2152
|
+
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls, enableDomainBlacklisting, enableDomainWhitelisting]);
|
|
2082
2153
|
var questions = values.questions;
|
|
2083
2154
|
var handleSelect = function handleSelect(question) {
|
|
2084
2155
|
setSelectedQuestion(question);
|
|
@@ -2221,7 +2292,6 @@ var Form = function Form(_ref) {
|
|
|
2221
2292
|
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
2222
2293
|
availableQuestionKinds: availableQuestionKinds,
|
|
2223
2294
|
buildRequestArgs: buildRequestArgs,
|
|
2224
|
-
enableDomainRestriction: enableDomainRestriction,
|
|
2225
2295
|
enableFieldCode: enableFieldCode,
|
|
2226
2296
|
getActiveKindDetails: getActiveKindDetails,
|
|
2227
2297
|
handleSelect: handleSelect,
|
|
@@ -2284,8 +2354,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2284
2354
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
2285
2355
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
2286
2356
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2287
|
-
_ref$
|
|
2288
|
-
|
|
2357
|
+
_ref$enableDomainBlac = _ref.enableDomainBlacklisting,
|
|
2358
|
+
enableDomainBlacklisting = _ref$enableDomainBlac === void 0 ? true : _ref$enableDomainBlac,
|
|
2359
|
+
_ref$enableDomainWhit = _ref.enableDomainWhitelisting,
|
|
2360
|
+
enableDomainWhitelisting = _ref$enableDomainWhit === void 0 ? true : _ref$enableDomainWhit,
|
|
2289
2361
|
helpDocUrls = _ref.helpDocUrls,
|
|
2290
2362
|
className = _ref.className;
|
|
2291
2363
|
var queryClient = useQueryClient();
|
|
@@ -2369,7 +2441,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2369
2441
|
buildRequestArgs: buildRequestArgs,
|
|
2370
2442
|
cancelButtonProps: cancelButtonProps,
|
|
2371
2443
|
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
2372
|
-
|
|
2444
|
+
enableDomainBlacklisting: enableDomainBlacklisting,
|
|
2445
|
+
enableDomainWhitelisting: enableDomainWhitelisting,
|
|
2373
2446
|
enableFieldCode: enableFieldCode,
|
|
2374
2447
|
formDescription: formDescription,
|
|
2375
2448
|
formTitle: formTitle,
|