@bigbinary/neeto-form-frontend 3.13.1 → 3.13.2
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 -0
- package/dist/BuildForm.js +34 -20
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +2 -2
- package/dist/UrlBuilder.js +2 -2
- package/dist/cjs/BuildForm.js +33 -19
- 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 +3 -3
- package/dist/{constants-Bx5mJ_UK.js → constants-CDhYxmSQ.js} +6 -9
- package/dist/{constants-Bx5mJ_UK.js.map → constants-CDhYxmSQ.js.map} +1 -1
- package/dist/{constants-T3w90EO4.js → constants-R6y-Scns.js} +6 -9
- package/dist/{constants-T3w90EO4.js.map → constants-R6y-Scns.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/{utils-Dgp-XRJx.js → utils-BZCJOPIJ.js} +2 -2
- package/dist/{utils-Dgp-XRJx.js.map → utils-BZCJOPIJ.js.map} +1 -1
- package/dist/{utils-CtH5-JaK.js → utils-sLnx21A2.js} +2 -2
- package/dist/{utils-CtH5-JaK.js.map → utils-sLnx21A2.js.map} +1 -1
- package/package.json +14 -14
- package/types.d.ts +2 -5
package/dist/ExternalForm.js
CHANGED
|
@@ -26,8 +26,8 @@ import { a as isBlank, g as getComponentDisplayName, p as parseServerError } fro
|
|
|
26
26
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
27
27
|
import Check from '@bigbinary/neeto-icons/Check';
|
|
28
28
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
29
|
-
import { C as CALLOUT_STYLES, b as CALLOUT_POSITIONS } from './constants-
|
|
30
|
-
import { c as clientI18nInstance, d as getWithExpiry, g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, e as generateFormResponse, f as clearLocalStorageValues } from './utils-
|
|
29
|
+
import { C as CALLOUT_STYLES, b as CALLOUT_POSITIONS } from './constants-R6y-Scns.js';
|
|
30
|
+
import { c as clientI18nInstance, d as getWithExpiry, g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, r as renderButtonsInOrder, m as mergeRefs, e as generateFormResponse, f as clearLocalStorageValues } from './utils-sLnx21A2.js';
|
|
31
31
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
32
32
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
33
33
|
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 { map, mergeLeft, filter, pluck, isEmpty } from 'ramda';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
|
-
import { g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs } from './utils-
|
|
13
|
+
import { g as generateInitValues, F as FormikWrap, a as getFieldComponent, b as buildAutoCompleteAttribute, m as mergeRefs } from './utils-sLnx21A2.js';
|
|
14
14
|
import { b as usePublicForm } from './constants-DBuFEVFA.js';
|
|
15
15
|
import { parsePhoneNumber } from 'libphonenumber-js';
|
|
16
|
-
import { Q as QUESTIONS_WITHOUT_FIELD_CODE, a as QUESTION_KIND } from './constants-
|
|
16
|
+
import { Q as QUESTIONS_WITHOUT_FIELD_CODE, a as QUESTION_KIND } from './constants-R6y-Scns.js';
|
|
17
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
18
|
import './index-BGEdOqsc.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-Dq9-rvtB.js');
|
|
9
|
-
var constants$1 = require('../constants-
|
|
9
|
+
var constants$1 = require('../constants-CDhYxmSQ.js');
|
|
10
10
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var dnd = require('@hello-pangea/dnd');
|
|
@@ -28,6 +28,7 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
|
28
28
|
var i18next = require('i18next');
|
|
29
29
|
var uuid = require('uuid');
|
|
30
30
|
var NoData = require('@bigbinary/neetoui/NoData');
|
|
31
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
31
32
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
32
33
|
var Pane = require('@bigbinary/neetoui/Pane');
|
|
33
34
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
@@ -38,7 +39,6 @@ var Select = require('@bigbinary/neetoui/formik/Select');
|
|
|
38
39
|
var Switch = require('@bigbinary/neetoui/formik/Switch');
|
|
39
40
|
var Textarea = require('@bigbinary/neetoui/formik/Textarea');
|
|
40
41
|
var NeetoEditor = require('@bigbinary/neeto-editor/Editor');
|
|
41
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
42
42
|
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
43
43
|
var utils$1 = require('@bigbinary/neeto-editor/utils');
|
|
44
44
|
var yup = require('yup');
|
|
@@ -570,20 +570,37 @@ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref7) {
|
|
|
570
570
|
};
|
|
571
571
|
var formatQuestionAttributesForClone = ramda.when(isChoiceQuestion, ramda.assoc("isCloning", true));
|
|
572
572
|
|
|
573
|
+
var HelpText = reactUtils.withT(function (_ref) {
|
|
574
|
+
var t = _ref.t,
|
|
575
|
+
href = _ref.href;
|
|
576
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
577
|
+
children: [t("neetoForm.questions.common.helpText.learnAbout"), " ", /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
578
|
+
href: href,
|
|
579
|
+
label: t("neetoForm.questions.common.helpText.howToAddNewQuestions"),
|
|
580
|
+
style: "link",
|
|
581
|
+
target: "_blank"
|
|
582
|
+
})]
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
|
|
573
586
|
var AddFirstQuestion = function AddFirstQuestion(_ref) {
|
|
574
587
|
var onAdd = _ref.onAdd,
|
|
575
588
|
isDisabled = _ref.isDisabled,
|
|
576
|
-
|
|
589
|
+
disabledAddButtonHelpPopoverProps = _ref.disabledAddButtonHelpPopoverProps;
|
|
577
590
|
var _useTranslation = reactI18next.useTranslation(),
|
|
578
591
|
t = _useTranslation.t;
|
|
579
|
-
var
|
|
592
|
+
var _disabledAddButtonHel = disabledAddButtonHelpPopoverProps.helpLinkProps,
|
|
593
|
+
_disabledAddButtonHel2 = _disabledAddButtonHel === void 0 ? {} : _disabledAddButtonHel,
|
|
594
|
+
href = _disabledAddButtonHel2.href;
|
|
580
595
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
581
596
|
className: "flex h-full flex-col items-center justify-center py-8",
|
|
582
597
|
children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
|
|
583
|
-
showTooltipWhenButtonDisabled: true,
|
|
584
598
|
className: "min-h-80",
|
|
585
|
-
|
|
586
|
-
|
|
599
|
+
helpText: neetoCist.isPresent(href) ? /*#__PURE__*/jsxRuntime.jsx(HelpText, {
|
|
600
|
+
href: href
|
|
601
|
+
}) : null,
|
|
602
|
+
primaryButtonProps: constants$1.buildAddQuestionButtonProps(onAdd, isDisabled),
|
|
603
|
+
title: t("neetoForm.questions.common.noData")
|
|
587
604
|
})
|
|
588
605
|
});
|
|
589
606
|
};
|
|
@@ -2117,17 +2134,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
2117
2134
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2118
2135
|
var AddQuestion = function AddQuestion(_ref) {
|
|
2119
2136
|
var onAdd = _ref.onAdd,
|
|
2120
|
-
|
|
2137
|
+
disabledAddButtonHelpPopoverProps = _ref.disabledAddButtonHelpPopoverProps,
|
|
2121
2138
|
isDisabled = _ref.isDisabled,
|
|
2122
2139
|
addQuestionHelpProps = _ref.addQuestionHelpProps;
|
|
2123
|
-
var
|
|
2140
|
+
var helpPopoverProps = isDisabled ? constants$1.buildDisabledAddButtonHelpPopoverProps(disabledAddButtonHelpPopoverProps) : {};
|
|
2124
2141
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2125
2142
|
className: "mb-8 flex w-full items-center gap-x-1",
|
|
2126
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
2127
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2128
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread({}, constants$1.buildAddQuestionButtonProps(onAdd, isDisabled)))
|
|
2129
|
-
})
|
|
2130
|
-
})), neetoCist.isPresent(addQuestionHelpProps) && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2143
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread({}, constants$1.buildAddQuestionButtonProps(onAdd, isDisabled))), isDisabled && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread({}, helpPopoverProps)), neetoCist.isPresent(addQuestionHelpProps) && !isDisabled && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2131
2144
|
children: /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread({}, addQuestionHelpProps))
|
|
2132
2145
|
})]
|
|
2133
2146
|
});
|
|
@@ -2142,7 +2155,7 @@ var Form = function Form(_ref) {
|
|
|
2142
2155
|
isKindAlreadyActive = _ref.isKindAlreadyActive,
|
|
2143
2156
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
2144
2157
|
isDisabledFieldLabel = _ref.isDisabledFieldLabel,
|
|
2145
|
-
|
|
2158
|
+
disabledAddButtonHelpPopoverProps = _ref.disabledAddButtonHelpPopoverProps,
|
|
2146
2159
|
isFormEnabled = _ref.isFormEnabled,
|
|
2147
2160
|
savedTitle = _ref.savedTitle,
|
|
2148
2161
|
formTitle = _ref.formTitle,
|
|
@@ -2347,13 +2360,13 @@ var Form = function Form(_ref) {
|
|
|
2347
2360
|
className: "mb-8 flex w-full items-center gap-x-1",
|
|
2348
2361
|
children: /*#__PURE__*/jsxRuntime.jsx(AddQuestion, {
|
|
2349
2362
|
addQuestionHelpProps: addQuestionHelpProps,
|
|
2350
|
-
|
|
2363
|
+
disabledAddButtonHelpPopoverProps: disabledAddButtonHelpPopoverProps,
|
|
2351
2364
|
isDisabled: ramda.isEmpty(availableQuestionKinds),
|
|
2352
2365
|
onAdd: handleAdd
|
|
2353
2366
|
})
|
|
2354
2367
|
})]
|
|
2355
2368
|
}) : /*#__PURE__*/jsxRuntime.jsx(AddFirstQuestion, {
|
|
2356
|
-
|
|
2369
|
+
disabledAddButtonHelpPopoverProps: disabledAddButtonHelpPopoverProps,
|
|
2357
2370
|
isDisabled: ramda.isEmpty(availableQuestionKinds),
|
|
2358
2371
|
onAdd: handleAdd
|
|
2359
2372
|
})
|
|
@@ -2401,7 +2414,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2401
2414
|
onLanguageChange = _ref$onLanguageChange === void 0 ? neetoCist.noop : _ref$onLanguageChange,
|
|
2402
2415
|
_ref$addQuestionHelpP = _ref.addQuestionHelpProps,
|
|
2403
2416
|
addQuestionHelpProps = _ref$addQuestionHelpP === void 0 ? {} : _ref$addQuestionHelpP,
|
|
2404
|
-
|
|
2417
|
+
_ref$disabledAddButto = _ref.disabledAddButtonHelpPopoverProps,
|
|
2418
|
+
disabledAddButtonHelpPopoverProps = _ref$disabledAddButto === void 0 ? {} : _ref$disabledAddButto,
|
|
2405
2419
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
2406
2420
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
2407
2421
|
_ref$allowAdditionalG = _ref.allowAdditionalGuests,
|
|
@@ -2456,7 +2470,7 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2456
2470
|
additionalActionOptions: additionalActionOptions,
|
|
2457
2471
|
advancedFeatures: advancedFeatures,
|
|
2458
2472
|
availableLanguages: availableLanguages,
|
|
2459
|
-
|
|
2473
|
+
disabledAddButtonHelpPopoverProps: disabledAddButtonHelpPopoverProps,
|
|
2460
2474
|
formDescription: formDescription,
|
|
2461
2475
|
formTitle: formTitle,
|
|
2462
2476
|
getActiveKindDetails: getActiveKindDetails,
|