@bigbinary/neeto-form-frontend 4.4.32 → 4.4.33
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 +3 -0
- package/dist/.ready +1 -1
- package/dist/BuildForm.js +34 -4
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +2 -2
- package/dist/UrlBuilder.js +2 -2
- package/dist/cjs/BuildForm.js +34 -4
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +2 -2
- package/dist/cjs/UrlBuilder.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{utils-BGOMnbfz.js → utils-Xnit8PUn.js} +2 -2
- package/dist/cjs/{utils-BGOMnbfz.js.map → utils-Xnit8PUn.js.map} +1 -1
- package/dist/cjs/v2/BuildForm.js +34 -4
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +2 -2
- package/dist/cjs/v2/UrlBuilder.js +2 -2
- package/dist/cjs/v2/index.js +2 -2
- package/dist/cjs/v2/{utils-Del875LZ.js → utils-DO12kVcq.js} +2 -2
- package/dist/cjs/v2/{utils-Del875LZ.js.map → utils-DO12kVcq.js.map} +1 -1
- package/dist/cjs/v2/{yup-7xdcVVow.js → yup-DH3aFnam.js} +5 -2
- package/dist/cjs/v2/yup-DH3aFnam.js.map +1 -0
- package/dist/cjs/{yup-ClZ8UAn4.js → yup-DZgfXVgs.js} +5 -2
- package/dist/cjs/yup-DZgfXVgs.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/{utils-DJxVM1eN.js → utils-Chj7ZOKi.js} +2 -2
- package/dist/{utils-DJxVM1eN.js.map → utils-Chj7ZOKi.js.map} +1 -1
- package/dist/v2/BuildForm.js +34 -4
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +2 -2
- package/dist/v2/UrlBuilder.js +2 -2
- package/dist/v2/index.js +2 -2
- package/dist/v2/{utils-DsxkYUMo.js → utils-CW12NXEG.js} +2 -2
- package/dist/v2/{utils-DsxkYUMo.js.map → utils-CW12NXEG.js.map} +1 -1
- package/dist/v2/{yup-Ddfa0GAg.js → yup-Cddsv0mm.js} +5 -2
- package/dist/v2/yup-Cddsv0mm.js.map +1 -0
- package/dist/{yup-5EabgWxl.js → yup-CwN-8JrO.js} +5 -2
- package/dist/yup-CwN-8JrO.js.map +1 -0
- package/package.json +3 -3
- package/types.d.ts +4 -0
- package/dist/cjs/v2/yup-7xdcVVow.js.map +0 -1
- package/dist/cjs/yup-ClZ8UAn4.js.map +0 -1
- package/dist/v2/yup-Ddfa0GAg.js.map +0 -1
- package/dist/yup-5EabgWxl.js.map +0 -1
package/dist/ExternalForm.js
CHANGED
|
@@ -25,8 +25,8 @@ import { a as isBlank, g as getComponentDisplayName, p as parseServerError } fro
|
|
|
25
25
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
26
26
|
import Check from '@bigbinary/neeto-icons/Check';
|
|
27
27
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
28
|
-
import { C as CALLOUT_POSITIONS, b as CALLOUT_STYLES, L as LAST_ELEMENTS_THRESHOLD, Q as QUESTION_KIND } from './yup-
|
|
29
|
-
import { c as clientI18nInstance, d as getWithExpiry, e as clearEmailVerificationDetails, F as FormikWrap, g as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, a as generateInitValues, f as generateFormResponse, h as clearLocalStorageValues } from './utils-
|
|
28
|
+
import { C as CALLOUT_POSITIONS, b as CALLOUT_STYLES, L as LAST_ELEMENTS_THRESHOLD, Q as QUESTION_KIND } from './yup-CwN-8JrO.js';
|
|
29
|
+
import { c as clientI18nInstance, d as getWithExpiry, e as clearEmailVerificationDetails, F as FormikWrap, g as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, a as generateInitValues, f as generateFormResponse, h as clearLocalStorageValues } from './utils-Chj7ZOKi.js';
|
|
30
30
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
31
31
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
32
32
|
import '@bigbinary/neeto-commons-frontend/constants';
|
package/dist/UrlBuilder.js
CHANGED
|
@@ -10,10 +10,10 @@ import Button from '@bigbinary/neetoui/Button';
|
|
|
10
10
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
11
11
|
import { mergeLeft, map, filter, pluck, isEmpty } from 'ramda';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
|
-
import { F as FormikWrap, g as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs, a as generateInitValues } from './utils-
|
|
13
|
+
import { F as FormikWrap, g as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs, a as generateInitValues } from './utils-Chj7ZOKi.js';
|
|
14
14
|
import { d as usePublicForm } from './constants-fjoeNdhb.js';
|
|
15
15
|
import { parsePhoneNumber } from 'libphonenumber-js';
|
|
16
|
-
import { Q as QUESTION_KIND, a as QUESTIONS_WITHOUT_FIELD_CODE } from './yup-
|
|
16
|
+
import { Q as QUESTION_KIND, a as QUESTIONS_WITHOUT_FIELD_CODE } from './yup-CwN-8JrO.js';
|
|
17
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
18
|
import './index-Cx0yvXwJ.js';
|
|
19
19
|
import '@babel/runtime/helpers/typeof';
|
package/dist/cjs/BuildForm.js
CHANGED
|
@@ -6,7 +6,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
|
|
|
6
6
|
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
7
7
|
var ramda = require('ramda');
|
|
8
8
|
var constants = require('./constants-CUBwzMb-.js');
|
|
9
|
-
var yup = require('./yup-
|
|
9
|
+
var yup = require('./yup-DZgfXVgs.js');
|
|
10
10
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var dnd = require('@hello-pangea/dnd');
|
|
@@ -1203,6 +1203,7 @@ var Form$1 = function Form(_ref) {
|
|
|
1203
1203
|
errors = _useFormikContext.errors,
|
|
1204
1204
|
submitCount = _useFormikContext.submitCount;
|
|
1205
1205
|
var hideQuestionHelpDocUrl = useHelpDoc("hideQuestion");
|
|
1206
|
+
var sendSmsUpdatesHelpDocUrl = useHelpDoc("smsUpdates");
|
|
1206
1207
|
var readOnlyHelpDocUrl = useHelpDoc("readOnly");
|
|
1207
1208
|
var responseVisibleOnlyToHostHelpDocUrl = useHelpDoc("responseVisibleOnlyToHost");
|
|
1208
1209
|
var _useBuildFormStore = buildForm.useBuildFormStore(function (store) {
|
|
@@ -1221,7 +1222,10 @@ var Form$1 = function Form(_ref) {
|
|
|
1221
1222
|
var isFieldCodeEnabled = advancedFeatures.fieldCode,
|
|
1222
1223
|
markResponsesAsReadOnly = advancedFeatures.markResponsesAsReadOnly,
|
|
1223
1224
|
restrictResponseVisibilityToHost = advancedFeatures.restrictResponseVisibilityToHost,
|
|
1224
|
-
enforceMinWordsInMultiLineTexts = advancedFeatures.enforceMinWordsInMultiLineTexts
|
|
1225
|
+
enforceMinWordsInMultiLineTexts = advancedFeatures.enforceMinWordsInMultiLineTexts,
|
|
1226
|
+
showSmsUpdatesToggle = advancedFeatures.smsUpdates,
|
|
1227
|
+
isSmsUpdatesDisabled = advancedFeatures.smsUpdatesDisabled,
|
|
1228
|
+
isSmsUpdatesEnabledByDefault = advancedFeatures.smsUpdatesEnabledByDefault;
|
|
1225
1229
|
var kind = values.kind;
|
|
1226
1230
|
var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
|
|
1227
1231
|
var questionKindUniquenessPattern = ramda.mergeLeft(isEdit && kindUniqueOn ? kindUniqueOn(values) : {}, {
|
|
@@ -1249,9 +1253,10 @@ var Form$1 = function Form(_ref) {
|
|
|
1249
1253
|
var canRestrictResponseVisibilityToHost = restrictResponseVisibilityToHost && !ramda.includes(kind, yup.NON_HIDEABLE_FIELDS);
|
|
1250
1254
|
var canMarkResponsesAsReadOnly = markResponsesAsReadOnly && !ramda.includes(kind, yup.NON_READ_ONLY_FIELDS);
|
|
1251
1255
|
var isTextarea = kind === constants.QUESTION_TYPES.TEXTAREA;
|
|
1256
|
+
var shouldShowSendSmsUpdatesSwitch = kind === constants.QUESTION_TYPES.PHONE && showSmsUpdatesToggle;
|
|
1252
1257
|
var isBasicSettingsVisible = !isRequired && (!isImmutable || shouldShowHideSwitch);
|
|
1253
1258
|
var shouldShowRequiredSwitch = isBasicSettingsVisible && !isImmutable && !ramda.includes(kind, [constants.QUESTION_TYPES.PARAGRAPH, constants.QUESTION_TYPES.ADDRESS, constants.QUESTION_TYPES.SPOT]);
|
|
1254
|
-
var isSettingsBlockVisible = kind !== constants.QUESTION_TYPES.SPOT && (isBasicSettingsVisible || canMarkResponsesAsReadOnly || isTextarea);
|
|
1259
|
+
var isSettingsBlockVisible = kind !== constants.QUESTION_TYPES.SPOT && (isBasicSettingsVisible || canMarkResponsesAsReadOnly || isTextarea || shouldShowSendSmsUpdatesSwitch);
|
|
1255
1260
|
var handleKindChange = function handleKindChange(option) {
|
|
1256
1261
|
var data = buildQuestionData(option);
|
|
1257
1262
|
updateFormState(data);
|
|
@@ -1267,13 +1272,17 @@ var Form$1 = function Form(_ref) {
|
|
|
1267
1272
|
type: kind,
|
|
1268
1273
|
label: label
|
|
1269
1274
|
});
|
|
1270
|
-
|
|
1275
|
+
var data = createFieldData({
|
|
1271
1276
|
kind: questionKind,
|
|
1272
1277
|
isRequired: isRequired,
|
|
1273
1278
|
questions: questions,
|
|
1274
1279
|
selectedLanguage: selectedLanguage,
|
|
1275
1280
|
isUsingDefaultQuestionKinds: isUsingDefaultQuestionKinds
|
|
1276
1281
|
});
|
|
1282
|
+
if (kind === constants.QUESTION_TYPES.PHONE && showSmsUpdatesToggle) {
|
|
1283
|
+
data.sendSmsUpdates = Boolean(isSmsUpdatesEnabledByDefault);
|
|
1284
|
+
}
|
|
1285
|
+
return data;
|
|
1277
1286
|
};
|
|
1278
1287
|
var updateFormState = function updateFormState(data) {
|
|
1279
1288
|
setValues(data);
|
|
@@ -1333,6 +1342,11 @@ var Form$1 = function Form(_ref) {
|
|
|
1333
1342
|
name: "isResponseVisibleOnlyToHost",
|
|
1334
1343
|
labelProps: responseVisibleOnlyToHostSwitchLabelProps(responseVisibleOnlyToHostHelpDocUrl)
|
|
1335
1344
|
})]
|
|
1345
|
+
}), shouldShowSendSmsUpdatesSwitch && /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
1346
|
+
disabled: isSmsUpdatesDisabled,
|
|
1347
|
+
label: t("neetoForm.common.sendSmsUpdates"),
|
|
1348
|
+
name: "sendSmsUpdates",
|
|
1349
|
+
labelProps: sendSmsUpdatesSwitchLabelProps(sendSmsUpdatesHelpDocUrl)
|
|
1336
1350
|
}), canMarkResponsesAsReadOnly && /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
1337
1351
|
label: t("neetoForm.common.readOnly"),
|
|
1338
1352
|
labelProps: readOnlySwitchLabelProps(readOnlyHelpDocUrl),
|
|
@@ -2867,6 +2881,22 @@ var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
|
|
|
2867
2881
|
}
|
|
2868
2882
|
} : undefined;
|
|
2869
2883
|
};
|
|
2884
|
+
var sendSmsUpdatesSwitchLabelProps = function sendSmsUpdatesSwitchLabelProps(helpUrl) {
|
|
2885
|
+
return helpUrl ? {
|
|
2886
|
+
helpIconProps: {
|
|
2887
|
+
"data-testid": "help-popover-button",
|
|
2888
|
+
popoverProps: {
|
|
2889
|
+
description: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2890
|
+
children: [i18next.t("neetoForm.questions.common.questionFields.field.sendSmsUpdatesHelpDescription"), /*#__PURE__*/jsxRuntime.jsx("br", {}), i18next.t("neetoForm.questions.common.questionFields.field.sendSmsUpdatesIntegrationNote")]
|
|
2891
|
+
}),
|
|
2892
|
+
helpLinkProps: {
|
|
2893
|
+
href: helpUrl,
|
|
2894
|
+
label: i18next.t("neetoForm.common.viewHelpArticle")
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
} : undefined;
|
|
2899
|
+
};
|
|
2870
2900
|
var responseVisibleOnlyToHostSwitchLabelProps = function responseVisibleOnlyToHostSwitchLabelProps(helpUrl) {
|
|
2871
2901
|
return {
|
|
2872
2902
|
helpIconProps: {
|