@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.cjs.js
CHANGED
|
@@ -21,6 +21,7 @@ var classnames = require('classnames');
|
|
|
21
21
|
var yup = require('yup');
|
|
22
22
|
var neetoEditor = require('@bigbinary/neeto-editor');
|
|
23
23
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
24
|
+
var useHotkeys = require('@bigbinary/neeto-hotkeys');
|
|
24
25
|
var dayjs = require('dayjs');
|
|
25
26
|
var PhoneNumber$1 = require('@bigbinary/neeto-molecules/PhoneNumber');
|
|
26
27
|
var path = require('path');
|
|
@@ -57,6 +58,7 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
|
57
58
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
58
59
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
59
60
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
61
|
+
var useHotkeys__default = /*#__PURE__*/_interopDefaultLegacy(useHotkeys);
|
|
60
62
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
61
63
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
62
64
|
var localeData__default = /*#__PURE__*/_interopDefaultLegacy(localeData);
|
|
@@ -130,6 +132,7 @@ var QUERY_KEYS = {
|
|
|
130
132
|
FORMIK: "neetoFormFormik"
|
|
131
133
|
};
|
|
132
134
|
var DIRECT_UPLOAD_URL = "/api/direct_uploads";
|
|
135
|
+
var FIELD_CODE_DOC = "https://help.neetocal.com/public/p-0ee1deebdb";
|
|
133
136
|
|
|
134
137
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
135
138
|
if (source == null) return {};
|
|
@@ -10209,16 +10212,21 @@ var validateFieldCode = validateSchema(yup__namespace.string().trim().required(i
|
|
|
10209
10212
|
var FieldCode = reactUtils.withT(function (_ref) {
|
|
10210
10213
|
var t = _ref.t,
|
|
10211
10214
|
name = _ref.name;
|
|
10212
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
10213
|
-
className: "flex flex-col space-y-3"
|
|
10214
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
10215
|
-
className: "mt-4",
|
|
10216
|
-
style: "h4"
|
|
10217
|
-
}, t("neetoForm.questions.common.advancedProperties")), /*#__PURE__*/React__default["default"].createElement(InputWithMaxLength, {
|
|
10215
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(InputWithMaxLength, {
|
|
10218
10216
|
required: true,
|
|
10217
|
+
className: "mt-14",
|
|
10219
10218
|
label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
|
|
10220
10219
|
name: "".concat(name, ".fieldCode"),
|
|
10221
|
-
validate: validateFieldCode
|
|
10220
|
+
validate: validateFieldCode,
|
|
10221
|
+
labelProps: {
|
|
10222
|
+
helpIconProps: {
|
|
10223
|
+
icon: neetoIcons.Info,
|
|
10224
|
+
className: "cursor-pointer",
|
|
10225
|
+
onClick: function onClick() {
|
|
10226
|
+
return window.open(FIELD_CODE_DOC, "_blank", "noopener,noreferrer");
|
|
10227
|
+
}
|
|
10228
|
+
}
|
|
10229
|
+
}
|
|
10222
10230
|
}));
|
|
10223
10231
|
});
|
|
10224
10232
|
|
|
@@ -11377,18 +11385,6 @@ var Question = function Question(_ref) {
|
|
|
11377
11385
|
});
|
|
11378
11386
|
};
|
|
11379
11387
|
|
|
11380
|
-
var moveItem = function moveItem(arr, sourceIndex, destinationIndex) {
|
|
11381
|
-
if (sourceIndex === destinationIndex) return arr;
|
|
11382
|
-
if (arr instanceof Array && arr[sourceIndex] !== undefined) {
|
|
11383
|
-
var removedItem = arr.splice(sourceIndex, 1)[0];
|
|
11384
|
-
arr.splice(destinationIndex, 0, removedItem);
|
|
11385
|
-
}
|
|
11386
|
-
return arr;
|
|
11387
|
-
};
|
|
11388
|
-
var arrayHelpers = {
|
|
11389
|
-
moveItem: moveItem
|
|
11390
|
-
};
|
|
11391
|
-
|
|
11392
11388
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
11393
11389
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
11394
11390
|
// generators (like Math.random()).
|
|
@@ -11454,6 +11450,18 @@ function v4(options, buf, offset) {
|
|
|
11454
11450
|
return unsafeStringify(rnds);
|
|
11455
11451
|
}
|
|
11456
11452
|
|
|
11453
|
+
var moveItem = function moveItem(arr, sourceIndex, destinationIndex) {
|
|
11454
|
+
if (sourceIndex === destinationIndex) return arr;
|
|
11455
|
+
if (arr instanceof Array && arr[sourceIndex] !== undefined) {
|
|
11456
|
+
var removedItem = arr.splice(sourceIndex, 1)[0];
|
|
11457
|
+
arr.splice(destinationIndex, 0, removedItem);
|
|
11458
|
+
}
|
|
11459
|
+
return arr;
|
|
11460
|
+
};
|
|
11461
|
+
var arrayHelpers = {
|
|
11462
|
+
moveItem: moveItem
|
|
11463
|
+
};
|
|
11464
|
+
|
|
11457
11465
|
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; }
|
|
11458
11466
|
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; }
|
|
11459
11467
|
var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
|
|
@@ -27151,7 +27159,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
27151
27159
|
questions: []
|
|
27152
27160
|
} : _useForm$data,
|
|
27153
27161
|
isLoading = _useForm.isLoading;
|
|
27154
|
-
var keyPressRef =
|
|
27162
|
+
var keyPressRef = useHotkeys__default["default"]("command+enter", ((_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit) || neetoCist.noop, {
|
|
27155
27163
|
mode: "scoped"
|
|
27156
27164
|
});
|
|
27157
27165
|
if (isLoading || form.isQuestionsLoading || !!submissionId && submission !== null && submission !== void 0 && submission.isLoading) {
|