@bigbinary/neeto-form-frontend 4.4.72-beta1 → 4.5.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 +4 -1
- package/dist/.ready +1 -1
- package/dist/BuildForm.js +28 -4
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +22 -17
- package/dist/ExternalForm.js.map +1 -1
- package/dist/Submission.js +30 -10
- package/dist/Submission.js.map +1 -1
- package/dist/UrlBuilder.js +2 -2
- package/dist/cjs/BuildForm.js +27 -3
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +21 -16
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/Submission.js +29 -9
- package/dist/cjs/Submission.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/{utils-BHn1TXSC.js → utils-CMHI5Y0n.js} +56 -26
- package/dist/cjs/utils-CMHI5Y0n.js.map +1 -0
- package/dist/cjs/v2/BuildForm.js +27 -3
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +19 -13
- package/dist/cjs/v2/ExternalForm.js.map +1 -1
- package/dist/cjs/v2/Submission.js +30 -10
- package/dist/cjs/v2/Submission.js.map +1 -1
- package/dist/cjs/v2/UrlBuilder.js +3 -2
- package/dist/cjs/v2/UrlBuilder.js.map +1 -1
- package/dist/cjs/v2/index.js +2 -2
- package/dist/cjs/v2/{utils-7ObrGr4O.js → utils-EWbfo6xy.js} +29 -5
- package/dist/cjs/v2/utils-EWbfo6xy.js.map +1 -0
- package/dist/cjs/v2/{yup-D2FUYjqU.js → yup-IIVrobcB.js} +8 -2
- package/dist/cjs/v2/yup-IIVrobcB.js.map +1 -0
- package/dist/cjs/{yup-DD46Fc7X.js → yup--rmEVYDi.js} +8 -2
- package/dist/cjs/yup--rmEVYDi.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/{utils-DQC5qi6q.js → utils-BQ-x2S1l.js} +56 -26
- package/dist/utils-BQ-x2S1l.js.map +1 -0
- package/dist/v2/BuildForm.js +29 -5
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +20 -14
- package/dist/v2/ExternalForm.js.map +1 -1
- package/dist/v2/Submission.js +31 -11
- package/dist/v2/Submission.js.map +1 -1
- package/dist/v2/UrlBuilder.js +3 -2
- package/dist/v2/UrlBuilder.js.map +1 -1
- package/dist/v2/index.js +2 -2
- package/dist/v2/{utils-Do7H0nQ3.js → utils-BgLYgJEU.js} +29 -5
- package/dist/v2/utils-BgLYgJEU.js.map +1 -0
- package/dist/v2/{yup-BRPSFuNj.js → yup-CnlHwBP1.js} +8 -3
- package/dist/v2/yup-CnlHwBP1.js.map +1 -0
- package/dist/{yup-Ccwwlg6e.js → yup-BWdsrAJJ.js} +8 -3
- package/dist/yup-BWdsrAJJ.js.map +1 -0
- package/package.json +7 -7
- package/types.d.ts +5 -0
- package/dist/cjs/utils-BHn1TXSC.js.map +0 -1
- package/dist/cjs/v2/utils-7ObrGr4O.js.map +0 -1
- package/dist/cjs/v2/yup-D2FUYjqU.js.map +0 -1
- package/dist/cjs/yup-DD46Fc7X.js.map +0 -1
- package/dist/utils-DQC5qi6q.js.map +0 -1
- package/dist/v2/utils-Do7H0nQ3.js.map +0 -1
- package/dist/v2/yup-BRPSFuNj.js.map +0 -1
- package/dist/yup-Ccwwlg6e.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import 'classnames';
|
|
|
11
11
|
import '@bigbinary/neeto-cist';
|
|
12
12
|
import '@bigbinary/neetoui/Spinner';
|
|
13
13
|
import 'ramda';
|
|
14
|
-
import './yup-
|
|
14
|
+
import './yup-BWdsrAJJ.js';
|
|
15
15
|
import 'i18next';
|
|
16
16
|
import '@babel/runtime/helpers/defineProperty';
|
|
17
17
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -69,7 +69,9 @@ import '@bigbinary/neetoui/Pane';
|
|
|
69
69
|
import '@bigbinary/neetoui/formik/ActionBlock';
|
|
70
70
|
import '@bigbinary/neetoui/formik/Form';
|
|
71
71
|
import 'formik';
|
|
72
|
+
import '@bigbinary/neeto-icons/Info';
|
|
72
73
|
import '@bigbinary/neetoui/Accordion';
|
|
74
|
+
import '@bigbinary/neetoui/Callout';
|
|
73
75
|
import '@bigbinary/neetoui/formik/Select';
|
|
74
76
|
import '@bigbinary/neetoui/formik/Switch';
|
|
75
77
|
import '@bigbinary/neetoui/formik/Textarea';
|
|
@@ -95,9 +97,8 @@ import '@bigbinary/neeto-molecules/HelpPopover';
|
|
|
95
97
|
import '@bigbinary/neeto-hotkeys';
|
|
96
98
|
import '@bigbinary/neeto-icons/Warning';
|
|
97
99
|
import '@bigbinary/neeto-molecules/PageLoader';
|
|
98
|
-
import '@bigbinary/neetoui/Callout';
|
|
99
100
|
import '@bigbinary/neeto-icons/Check';
|
|
100
|
-
import './utils-
|
|
101
|
+
import './utils-BQ-x2S1l.js';
|
|
101
102
|
import 'libphonenumber-js';
|
|
102
103
|
import '@bigbinary/neeto-editor-frontend/EditorContent';
|
|
103
104
|
import '@bigbinary/neetoui/MultiEmailInput';
|
|
@@ -116,7 +117,6 @@ import '@bigbinary/neeto-icons/CheckCircle';
|
|
|
116
117
|
import '@bigbinary/neeto-molecules/FileUpload';
|
|
117
118
|
import '@bigbinary/neetoui/Radio';
|
|
118
119
|
import '@bigbinary/neeto-icons/Image';
|
|
119
|
-
import '@bigbinary/neeto-icons/Info';
|
|
120
120
|
import '@bigbinary/neetoui/Textarea';
|
|
121
121
|
import '@honeybadger-io/js';
|
|
122
122
|
import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
@@ -20,7 +20,7 @@ import { isEditorEmpty } from '@bigbinary/neeto-editor-frontend/utils';
|
|
|
20
20
|
import { validation, PhoneNumberInput } from '@bigbinary/neeto-molecules/PhoneNumber';
|
|
21
21
|
import { p as parseTime } from './date-D1QLSrIi.js';
|
|
22
22
|
import i18next from 'i18next';
|
|
23
|
-
import { Q as QUESTION_KIND, S as SCHEMA_LESS_QUESTION_KINDS, A as ADDRESS_FIELD_TYPES, c as SPOT_QUESTION_DEFAULT_VALUE, Y as YES_NO_VALUES, P as PARENTHESES_REGEX, R as RATING_VALUES, E as EMAIL_REGEX, I as INTEGER_REGEX, D as DECIMAL_REGEX, d as SIX_DIGIT_NUMBER_REGEX, e as ADDRESS_FIELD_WIDTHS, f as LABEL_FIELDS, g as generateArray, h as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, i as RADIO_DESELECT_KEYS, j as RATING_OPTIONS, k as ICONS_MAP, l as YES_NO_DISPLAY_ICONS_MAP } from './yup-
|
|
23
|
+
import { Q as QUESTION_KIND, S as SCHEMA_LESS_QUESTION_KINDS, A as ADDRESS_FIELD_TYPES, c as SPOT_QUESTION_DEFAULT_VALUE, Y as YES_NO_VALUES, P as PARENTHESES_REGEX, R as RATING_VALUES, E as EMAIL_REGEX, I as INTEGER_REGEX, D as DECIMAL_REGEX, d as SIX_DIGIT_NUMBER_REGEX, e as ADDRESS_FIELD_WIDTHS, f as LABEL_FIELDS, g as generateArray, h as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, i as RADIO_DESELECT_KEYS, W as WHATSAPP_CONSENT_FIELD, j as RATING_OPTIONS, k as ICONS_MAP, l as YES_NO_DISPLAY_ICONS_MAP } from './yup-BWdsrAJJ.js';
|
|
24
24
|
import _toArray from '@babel/runtime/helpers/toArray';
|
|
25
25
|
import * as yup from 'yup';
|
|
26
26
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -39,7 +39,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
39
39
|
import axios from 'axios';
|
|
40
40
|
import CheckCircle from '@bigbinary/neeto-icons/CheckCircle';
|
|
41
41
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
42
|
-
import
|
|
42
|
+
import Callout from '@bigbinary/neetoui/Callout';
|
|
43
43
|
import { FileUpload } from '@bigbinary/neeto-molecules/FileUpload';
|
|
44
44
|
import Label from '@bigbinary/neetoui/Label';
|
|
45
45
|
import Checkbox from '@bigbinary/neetoui/Checkbox';
|
|
@@ -1658,7 +1658,7 @@ var VerifyCode = function VerifyCode(_ref) {
|
|
|
1658
1658
|
questionId: questionId,
|
|
1659
1659
|
isResendDisabled: calloutDetails.style === CALLOUT_STYLES.ERROR,
|
|
1660
1660
|
sendVerificationCode: handleSendVerificationCode
|
|
1661
|
-
}), calloutDetails.message && /*#__PURE__*/jsx(
|
|
1661
|
+
}), calloutDetails.message && /*#__PURE__*/jsx(Callout, {
|
|
1662
1662
|
style: calloutDetails.style,
|
|
1663
1663
|
children: calloutDetails.message
|
|
1664
1664
|
})]
|
|
@@ -2347,11 +2347,35 @@ var OptionsField = function OptionsField(_ref) {
|
|
|
2347
2347
|
});
|
|
2348
2348
|
};
|
|
2349
2349
|
|
|
2350
|
+
var WhatsappConsentField = function WhatsappConsentField(_ref) {
|
|
2351
|
+
var label = _ref.label,
|
|
2352
|
+
hasPhoneNumber = _ref.hasPhoneNumber;
|
|
2353
|
+
var _useField = useField(WHATSAPP_CONSENT_FIELD),
|
|
2354
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
2355
|
+
_useField2$0$value = _useField2[0].value,
|
|
2356
|
+
value = _useField2$0$value === void 0 ? false : _useField2$0$value,
|
|
2357
|
+
setValue = _useField2[2].setValue;
|
|
2358
|
+
useEffect(function () {
|
|
2359
|
+
if (!hasPhoneNumber && value) setValue(false);
|
|
2360
|
+
}, [hasPhoneNumber, value, setValue]);
|
|
2361
|
+
if (!hasPhoneNumber) return null;
|
|
2362
|
+
return /*#__PURE__*/jsx(Checkbox, {
|
|
2363
|
+
label: label,
|
|
2364
|
+
checked: value,
|
|
2365
|
+
"data-testid": "whatsapp-consent-checkbox",
|
|
2366
|
+
name: WHATSAPP_CONSENT_FIELD,
|
|
2367
|
+
onChange: function onChange(event) {
|
|
2368
|
+
return setValue(event.target.checked);
|
|
2369
|
+
}
|
|
2370
|
+
});
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2350
2373
|
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
2351
|
-
var _getPhoneData;
|
|
2352
2374
|
var question = _ref.question,
|
|
2353
2375
|
autoComplete = _ref.autoComplete,
|
|
2354
|
-
isLastFewElements = _ref.isLastFewElements
|
|
2376
|
+
isLastFewElements = _ref.isLastFewElements,
|
|
2377
|
+
_ref$whatsappConsent = _ref.whatsappConsent,
|
|
2378
|
+
whatsappConsent = _ref$whatsappConsent === void 0 ? null : _ref$whatsappConsent;
|
|
2355
2379
|
var name = question.id,
|
|
2356
2380
|
kind = question.kind,
|
|
2357
2381
|
isRequired = question.isRequired,
|
|
@@ -2374,26 +2398,32 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
2374
2398
|
_useField2$2 = _useField2[2],
|
|
2375
2399
|
setValue = _useField2$2.setValue,
|
|
2376
2400
|
setTouched = _useField2$2.setTouched;
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2401
|
+
var phoneData = getPhoneData(value);
|
|
2402
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2403
|
+
children: [/*#__PURE__*/jsx(PhoneNumberInput, {
|
|
2404
|
+
autoComplete: autoComplete,
|
|
2405
|
+
label: label,
|
|
2406
|
+
value: value,
|
|
2407
|
+
className: "neeto-form-engine-input__wrapper items-stretch",
|
|
2408
|
+
disabled: isReadOnly,
|
|
2409
|
+
error: touched ? error : "",
|
|
2410
|
+
initialCountryCode: phoneData === null || phoneData === void 0 ? void 0 : phoneData.country,
|
|
2411
|
+
placeholder: fieldWithFallback(question, "placeholder"),
|
|
2412
|
+
required: isRequired,
|
|
2413
|
+
selectProps: {
|
|
2414
|
+
isDisabled: isReadOnly,
|
|
2415
|
+
menuPlacement: isLastFewElements ? "top" : "auto",
|
|
2416
|
+
menuPortalTarget: document.body,
|
|
2417
|
+
menuPosition: "fixed"
|
|
2418
|
+
},
|
|
2419
|
+
onBlur: function onBlur() {
|
|
2420
|
+
return setTouched(true);
|
|
2421
|
+
},
|
|
2422
|
+
onChange: setValue
|
|
2423
|
+
}), whatsappConsent && /*#__PURE__*/jsx(WhatsappConsentField, {
|
|
2424
|
+
hasPhoneNumber: Boolean(phoneData === null || phoneData === void 0 ? void 0 : phoneData.number),
|
|
2425
|
+
label: whatsappConsent.label
|
|
2426
|
+
})]
|
|
2397
2427
|
});
|
|
2398
2428
|
};
|
|
2399
2429
|
|
|
@@ -2919,4 +2949,4 @@ var getVisibleOptions = function getVisibleOptions(options) {
|
|
|
2919
2949
|
};
|
|
2920
2950
|
|
|
2921
2951
|
export { FormikWrap as F, buildAutoCompleteAttribute as a, buildDateQueryParameters as b, generateInitValues as c, clientI18nInstance as d, getWithExpiry as e, clearEmailVerificationDetails as f, getFieldComponent as g, generateFormResponse as h, clearLocalStorageValues as i, mergeRefs as m, renderButtonsInOrder as r };
|
|
2922
|
-
//# sourceMappingURL=utils-
|
|
2952
|
+
//# sourceMappingURL=utils-BQ-x2S1l.js.map
|