@bigbinary/neeto-form-frontend 1.2.18 → 1.2.20
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 +0 -1
- package/dist/index.cjs.js +28 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +29 -22
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -7,18 +7,19 @@ import { Typography, Dropdown as Dropdown$2, Tooltip, Button as Button$1, Label,
|
|
|
7
7
|
import { assoc, prop, isEmpty, path, values, compose as compose$1, trim, useWith, split, either, isNil, equals, difference, reject, pluck, keys, pick, omit, insert, not, pipe as pipe$1, toLower, map, includes, isNotNil, times } from 'ramda';
|
|
8
8
|
import { useQuery, useQueryClient, useMutation } from 'react-query';
|
|
9
9
|
import i18next, { t as t$4 } from 'i18next';
|
|
10
|
-
import { Input, Email as Email$2, Phone as Phone$2, Up, Down, MenuHorizontal, Delete, Plus, NeetoInvisible, MultipleChoice as MultipleChoice$2, ListDot, Dropdown as Dropdown$3, Rating as Rating$4, Smiley, Checkbox as Checkbox$2, Calendar, Upload, Check, Close, FileGeneric } from '@bigbinary/neeto-icons';
|
|
10
|
+
import { Input, Email as Email$2, Phone as Phone$2, Up, Down, MenuHorizontal, Info, Delete, Plus, NeetoInvisible, MultipleChoice as MultipleChoice$2, ListDot, Dropdown as Dropdown$3, Rating as Rating$4, Smiley, Checkbox as Checkbox$2, Calendar, Upload, Check, Close, FileGeneric } from '@bigbinary/neeto-icons';
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import ReactDOM, { unstable_batchedUpdates, flushSync as flushSync$1 } from 'react-dom';
|
|
13
13
|
import { Input as Input$1, Textarea, Checkbox, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
14
14
|
import { useTranslation, Trans } from 'react-i18next';
|
|
15
|
-
import { withImmutableActions, withT, useDebounce
|
|
15
|
+
import { withImmutableActions, withT, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
16
16
|
import { create as create$1 } from 'zustand';
|
|
17
17
|
import classnames from 'classnames';
|
|
18
18
|
import * as yup from 'yup';
|
|
19
19
|
import { object, array, string } from 'yup';
|
|
20
20
|
import { Editor as Editor$1, isEditorEmpty, EditorContent } from '@bigbinary/neeto-editor';
|
|
21
21
|
import { withEventTargetValue, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
22
|
+
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
22
23
|
import dayjs from 'dayjs';
|
|
23
24
|
import { validation, PhoneNumberInput, PhoneNumber as PhoneNumber$1 } from '@bigbinary/neeto-molecules/PhoneNumber';
|
|
24
25
|
import path$1 from 'path';
|
|
@@ -93,6 +94,7 @@ var QUERY_KEYS = {
|
|
|
93
94
|
FORMIK: "neetoFormFormik"
|
|
94
95
|
};
|
|
95
96
|
var DIRECT_UPLOAD_URL = "/api/direct_uploads";
|
|
97
|
+
var FIELD_CODE_DOC = "https://help.neetocal.com/public/p-0ee1deebdb";
|
|
96
98
|
|
|
97
99
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
98
100
|
if (source == null) return {};
|
|
@@ -10172,16 +10174,21 @@ var validateFieldCode = validateSchema(yup.string().trim().required(t$4("neetoFo
|
|
|
10172
10174
|
var FieldCode = withT(function (_ref) {
|
|
10173
10175
|
var t = _ref.t,
|
|
10174
10176
|
name = _ref.name;
|
|
10175
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
10176
|
-
className: "flex flex-col space-y-3"
|
|
10177
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
10178
|
-
className: "mt-4",
|
|
10179
|
-
style: "h4"
|
|
10180
|
-
}, t("neetoForm.questions.common.advancedProperties")), /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
|
|
10177
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
|
|
10181
10178
|
required: true,
|
|
10179
|
+
className: "mt-14",
|
|
10182
10180
|
label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
|
|
10183
10181
|
name: "".concat(name, ".fieldCode"),
|
|
10184
|
-
validate: validateFieldCode
|
|
10182
|
+
validate: validateFieldCode,
|
|
10183
|
+
labelProps: {
|
|
10184
|
+
helpIconProps: {
|
|
10185
|
+
icon: Info,
|
|
10186
|
+
className: "cursor-pointer",
|
|
10187
|
+
onClick: function onClick() {
|
|
10188
|
+
return window.open(FIELD_CODE_DOC, "_blank", "noopener,noreferrer");
|
|
10189
|
+
}
|
|
10190
|
+
}
|
|
10191
|
+
}
|
|
10185
10192
|
}));
|
|
10186
10193
|
});
|
|
10187
10194
|
|
|
@@ -11340,18 +11347,6 @@ var Question = function Question(_ref) {
|
|
|
11340
11347
|
});
|
|
11341
11348
|
};
|
|
11342
11349
|
|
|
11343
|
-
var moveItem = function moveItem(arr, sourceIndex, destinationIndex) {
|
|
11344
|
-
if (sourceIndex === destinationIndex) return arr;
|
|
11345
|
-
if (arr instanceof Array && arr[sourceIndex] !== undefined) {
|
|
11346
|
-
var removedItem = arr.splice(sourceIndex, 1)[0];
|
|
11347
|
-
arr.splice(destinationIndex, 0, removedItem);
|
|
11348
|
-
}
|
|
11349
|
-
return arr;
|
|
11350
|
-
};
|
|
11351
|
-
var arrayHelpers = {
|
|
11352
|
-
moveItem: moveItem
|
|
11353
|
-
};
|
|
11354
|
-
|
|
11355
11350
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
11356
11351
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
11357
11352
|
// generators (like Math.random()).
|
|
@@ -11417,6 +11412,18 @@ function v4(options, buf, offset) {
|
|
|
11417
11412
|
return unsafeStringify(rnds);
|
|
11418
11413
|
}
|
|
11419
11414
|
|
|
11415
|
+
var moveItem = function moveItem(arr, sourceIndex, destinationIndex) {
|
|
11416
|
+
if (sourceIndex === destinationIndex) return arr;
|
|
11417
|
+
if (arr instanceof Array && arr[sourceIndex] !== undefined) {
|
|
11418
|
+
var removedItem = arr.splice(sourceIndex, 1)[0];
|
|
11419
|
+
arr.splice(destinationIndex, 0, removedItem);
|
|
11420
|
+
}
|
|
11421
|
+
return arr;
|
|
11422
|
+
};
|
|
11423
|
+
var arrayHelpers = {
|
|
11424
|
+
moveItem: moveItem
|
|
11425
|
+
};
|
|
11426
|
+
|
|
11420
11427
|
function ownKeys$b(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; }
|
|
11421
11428
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11422
11429
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
@@ -27114,7 +27121,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
27114
27121
|
questions: []
|
|
27115
27122
|
} : _useForm$data,
|
|
27116
27123
|
isLoading = _useForm.isLoading;
|
|
27117
|
-
var keyPressRef =
|
|
27124
|
+
var keyPressRef = useHotkeys("command+enter", ((_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit) || noop$4, {
|
|
27118
27125
|
mode: "scoped"
|
|
27119
27126
|
});
|
|
27120
27127
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|