@bigbinary/neeto-form-frontend 1.2.19 → 1.2.21

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/dist/index.js CHANGED
@@ -7,7 +7,7 @@ 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';
@@ -94,6 +94,7 @@ var QUERY_KEYS = {
94
94
  FORMIK: "neetoFormFormik"
95
95
  };
96
96
  var DIRECT_UPLOAD_URL = "/api/direct_uploads";
97
+ var FIELD_CODE_DOC = "https://help.neetocal.com/public/p-0ee1deebdb";
97
98
 
98
99
  function _objectWithoutPropertiesLoose$2(source, excluded) {
99
100
  if (source == null) return {};
@@ -10026,7 +10027,7 @@ var Accordion = function Accordion(_ref) {
10026
10027
  }, label)), /*#__PURE__*/React__default.createElement("div", {
10027
10028
  className: "neeto-form-engine-question-accordion__header-action-block flex items-center gap-2"
10028
10029
  }, /*#__PURE__*/React__default.createElement("button", {
10029
- className: "outline-none flex items-center justify-center border-0 bg-transparent",
10030
+ className: "flex items-center justify-center border-0 bg-transparent outline-none",
10030
10031
  type: "button",
10031
10032
  onClick: onToggle
10032
10033
  }, isExpanded ? /*#__PURE__*/React__default.createElement(Up, null) : /*#__PURE__*/React__default.createElement(Down, null)), (onDuplicate || shouldShowDeleteOption) && /*#__PURE__*/React__default.createElement(Dropdown$2, {
@@ -10034,7 +10035,7 @@ var Accordion = function Accordion(_ref) {
10034
10035
  position: "bottom-end",
10035
10036
  customTarget: function customTarget() {
10036
10037
  return /*#__PURE__*/React__default.createElement("button", {
10037
- className: "outline-none flex items-center justify-center border-0 bg-transparent",
10038
+ className: "flex items-center justify-center border-0 bg-transparent outline-none",
10038
10039
  type: "button"
10039
10040
  }, /*#__PURE__*/React__default.createElement(MenuHorizontal, null));
10040
10041
  }
@@ -10173,16 +10174,21 @@ var validateFieldCode = validateSchema(yup.string().trim().required(t$4("neetoFo
10173
10174
  var FieldCode = withT(function (_ref) {
10174
10175
  var t = _ref.t,
10175
10176
  name = _ref.name;
10176
- return /*#__PURE__*/React__default.createElement("div", {
10177
- className: "flex flex-col space-y-3"
10178
- }, /*#__PURE__*/React__default.createElement(Typography, {
10179
- className: "mt-4",
10180
- style: "h4"
10181
- }, t("neetoForm.questions.common.advancedProperties")), /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
10177
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(InputWithMaxLength, {
10182
10178
  required: true,
10179
+ className: "mt-14",
10183
10180
  label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
10184
10181
  name: "".concat(name, ".fieldCode"),
10185
- 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
+ }
10186
10192
  }));
10187
10193
  });
10188
10194
 
@@ -15929,7 +15935,8 @@ var generateInitValues = function generateInitValues(_ref7) {
15929
15935
  initialValues = _ref7$initialValues === void 0 ? [] : _ref7$initialValues,
15930
15936
  _ref7$localValues = _ref7.localValues,
15931
15937
  localValues = _ref7$localValues === void 0 ? {} : _ref7$localValues,
15932
- fieldCodes = _ref7.fieldCodes;
15938
+ _ref7$fieldCodes = _ref7.fieldCodes,
15939
+ fieldCodes = _ref7$fieldCodes === void 0 ? {} : _ref7$fieldCodes;
15933
15940
  var initValues = {};
15934
15941
  var valuesMap = {};
15935
15942
  if (initialValues) {
@@ -27068,7 +27075,9 @@ var ExternalForm = function ExternalForm(_ref) {
27068
27075
  var _editorRef$current, _formDomProps$onReset;
27069
27076
  if (clearValuesOnReset) {
27070
27077
  clearLocalStorageValues("".concat(formId, "/values"));
27071
- setLocalValues(generateInitValues(questions));
27078
+ setLocalValues(generateInitValues({
27079
+ questions: questions
27080
+ }));
27072
27081
  submissionId && queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, submissionId], {
27073
27082
  responses: []
27074
27083
  });