@bigbinary/neeto-form-frontend 3.8.1 → 3.8.3

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.
Files changed (48) hide show
  1. package/app/javascript/src/translations/en.json +4 -2
  2. package/dist/BuildForm.js +22 -7
  3. package/dist/BuildForm.js.map +1 -1
  4. package/dist/ExternalForm.js +5 -9
  5. package/dist/ExternalForm.js.map +1 -1
  6. package/dist/Submission.js +2 -2
  7. package/dist/UrlBuilder.js +5 -11
  8. package/dist/UrlBuilder.js.map +1 -1
  9. package/dist/cjs/BuildForm.js +22 -7
  10. package/dist/cjs/BuildForm.js.map +1 -1
  11. package/dist/cjs/ExternalForm.js +5 -9
  12. package/dist/cjs/ExternalForm.js.map +1 -1
  13. package/dist/cjs/Submission.js +2 -2
  14. package/dist/cjs/UrlBuilder.js +5 -11
  15. package/dist/cjs/UrlBuilder.js.map +1 -1
  16. package/dist/cjs/hooks.js +2 -2
  17. package/dist/cjs/index.js +6 -10
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/{constants-43eac775.js → constants-4d9fc943.js} +1 -7
  20. package/dist/{constants-43eac775.js.map → constants-4d9fc943.js.map} +1 -1
  21. package/dist/{constants-ca5ca2b1.js → constants-56bf4022.js} +2 -2
  22. package/dist/{constants-ca5ca2b1.js.map → constants-56bf4022.js.map} +1 -1
  23. package/dist/{constants-3d8a5374.js → constants-75b78b3a.js} +2 -7
  24. package/dist/{constants-3d8a5374.js.map → constants-75b78b3a.js.map} +1 -1
  25. package/dist/{constants-669f203a.js → constants-d9148acf.js} +2 -2
  26. package/dist/{constants-669f203a.js.map → constants-d9148acf.js.map} +1 -1
  27. package/dist/hooks.js +2 -2
  28. package/dist/index.js +6 -10
  29. package/dist/index.js.map +1 -1
  30. package/dist/main.css +1 -1
  31. package/dist/main.css.map +1 -1
  32. package/dist/{useFormApi-ca36173e.js → useFormApi-408d0060.js} +1 -3
  33. package/dist/useFormApi-408d0060.js.map +1 -0
  34. package/dist/{useFormApi-d733cb8d.js → useFormApi-e3476a20.js} +2 -3
  35. package/dist/useFormApi-e3476a20.js.map +1 -0
  36. package/dist/{useFormSubmission-866195bb.js → useFormSubmission-46db678f.js} +2 -2
  37. package/dist/{useFormSubmission-866195bb.js.map → useFormSubmission-46db678f.js.map} +1 -1
  38. package/dist/{useFormSubmission-f8866b84.js → useFormSubmission-e2e84587.js} +2 -2
  39. package/dist/{useFormSubmission-f8866b84.js.map → useFormSubmission-e2e84587.js.map} +1 -1
  40. package/dist/{utils-4a844c8d.js → utils-4918956b.js} +60 -529
  41. package/dist/utils-4918956b.js.map +1 -0
  42. package/dist/{utils-6b8cacdd.js → utils-e4298243.js} +56 -530
  43. package/dist/utils-e4298243.js.map +1 -0
  44. package/package.json +9 -9
  45. package/dist/useFormApi-ca36173e.js.map +0 -1
  46. package/dist/useFormApi-d733cb8d.js.map +0 -1
  47. package/dist/utils-4a844c8d.js.map +0 -1
  48. package/dist/utils-6b8cacdd.js.map +0 -1
@@ -56,7 +56,8 @@
56
56
  "mathCaptcha": "Match captcha",
57
57
  "remainingItemsCount": "{{count}} more",
58
58
  "domain": "Domain",
59
- "domains": "Domains"
59
+ "domains": "Domains",
60
+ "viewHelpArticle": "View help article"
60
61
  },
61
62
  "fields": {
62
63
  "mcf": "Multiple choice",
@@ -128,7 +129,8 @@
128
129
  "fieldCodeTitle": "Advanced settings",
129
130
  "fieldCode": "Field code",
130
131
  "fieldCodeHelpDescription": "If you change the field code, any existing shared links containing the old field code as query parameter, will not work correctly. <Link>View help article</Link> for more information.",
131
- "questionType": "Question type"
132
+ "questionType": "Question type",
133
+ "hideQuestionHelpDescription": "When enabled, this question will not be visible in the created form. It can be used for tracking UTM parameters."
132
134
  }
133
135
  }
134
136
  },
package/dist/BuildForm.js CHANGED
@@ -7,9 +7,9 @@ import { isPresent, truncate, findBy, isNotPresent, slugify, filterBy, hyphenate
7
7
  import { showThumbsUpToastr, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
8
8
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
9
9
  import { equals, includes, __, reduce, assoc, path, when, isEmpty, reject, keys, pick, omit, pluck, modify, without, mergeLeft, isNil, pipe, filter, isNotNil, uniq, join, map, test, difference, prop, split, last, concat, F } from 'ramda';
10
- import { e as useDeleteQuestion, f as useFetchQuestions, g as useCreateQuestion, h as useUpdateQuestion, i as useReorderQuestions, Q as QUERY_KEYS } from './useFormApi-d733cb8d.js';
11
- import { Q as QUESTION_KIND } from './constants-3d8a5374.js';
12
- import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, A as AUTO_GENERATED_KINDS, a as IMMUTABLE_KINDS, h as htmlToPlainText, i as isElementOverflowing, D as Drag, Q as QUESTION_TYPES, S as SELECTABLE_KINDS, b as RESERVED_FIELD_CODES, c as QUESTIONS_WITHOUT_FIELD_CODE, N as NON_HIDEABLE_FIELDS, C as CAPTCHA_TYPES, F as FILE_TYPES_MAP, d as FILE_GROUPS, M as MINIMUM_OPTIONS, e as RATING_OPTIONS, f as STAR_RATING_MIN_VALUE_OPTIONS, g as STAR_RATING_MAX_VALUE_OPTIONS, j as STAR_RATING_ICONS_MAP, k as QUESTION_ACTIONS, l as QUESTION_KINDS, m as getActiveQuestionKindDetails, n as DEFAULT_AVAILABLE_LANGUAGES, o as QUESTIONS_INITIAL_VALUE, p as MANDATORY_KINDS } from './constants-669f203a.js';
10
+ import { e as useDeleteQuestion, f as useFetchQuestions, g as useCreateQuestion, h as useUpdateQuestion, i as useReorderQuestions, Q as QUERY_KEYS } from './useFormApi-e3476a20.js';
11
+ import { Q as QUESTION_KIND } from './constants-75b78b3a.js';
12
+ import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, A as AUTO_GENERATED_KINDS, a as IMMUTABLE_KINDS, h as htmlToPlainText, i as isElementOverflowing, D as Drag, Q as QUESTION_TYPES, S as SELECTABLE_KINDS, b as RESERVED_FIELD_CODES, c as QUESTIONS_WITHOUT_FIELD_CODE, N as NON_HIDEABLE_FIELDS, C as CAPTCHA_TYPES, F as FILE_TYPES_MAP, d as FILE_GROUPS, M as MINIMUM_OPTIONS, e as RATING_OPTIONS, f as STAR_RATING_MIN_VALUE_OPTIONS, g as STAR_RATING_MAX_VALUE_OPTIONS, j as STAR_RATING_ICONS_MAP, k as QUESTION_ACTIONS, l as QUESTION_KINDS, m as getActiveQuestionKindDetails, n as DEFAULT_AVAILABLE_LANGUAGES, o as QUESTIONS_INITIAL_VALUE, p as MANDATORY_KINDS } from './constants-d9148acf.js';
13
13
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
14
14
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
15
15
  import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
@@ -903,6 +903,7 @@ var Form$1 = function Form(_ref) {
903
903
  setValues = _useFormikContext.setValues,
904
904
  setErrors = _useFormikContext.setErrors,
905
905
  setTouched = _useFormikContext.setTouched;
906
+ var hideQuestionHelpDoc = useBuildFormStore(path(["formState", "helpDocUrls", "hideQuestion"]));
906
907
  var kind = values.kind;
907
908
  var questionKinds = isEdit ? allQuestionKinds : availableQuestionKinds;
908
909
  var questionKindUniquenessPattern = mergeLeft(isEdit && additionalQuestionKindPattern ? additionalQuestionKindPattern(values) : {}, {
@@ -989,6 +990,7 @@ var Form$1 = function Form(_ref) {
989
990
  title: t("neetoForm.common.settings"),
990
991
  children: [!isImmutable && /*#__PURE__*/jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsx(Switch, {
991
992
  label: t("neetoForm.common.hideQuestion"),
993
+ labelProps: hideSwitchLabelProps(hideQuestionHelpDoc),
992
994
  name: "isHidden"
993
995
  })]
994
996
  }), shouldShowFieldCode && /*#__PURE__*/jsx(FieldCode, {})]
@@ -1943,6 +1945,19 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
1943
1945
  value: transformValueForOption(questionKind)
1944
1946
  } : undefined;
1945
1947
  };
1948
+ var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
1949
+ return helpUrl ? {
1950
+ helpIconProps: {
1951
+ popoverProps: {
1952
+ description: t("neetoForm.questions.common.questionFields.field.hideQuestionHelpDescription"),
1953
+ helpLinkProps: {
1954
+ href: helpUrl,
1955
+ label: t("neetoForm.common.viewHelpArticle")
1956
+ }
1957
+ }
1958
+ }
1959
+ } : undefined;
1960
+ };
1946
1961
 
1947
1962
  var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
1948
1963
  function ownKeys$3(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; }
@@ -2142,7 +2157,7 @@ var Form = function Form(_ref) {
2142
2157
  return setIsDeleteAlertOpen(false);
2143
2158
  }
2144
2159
  }), /*#__PURE__*/jsxs(Form$3, _objectSpread$1(_objectSpread$1({
2145
- className: "neeto-form-nano-form-wrapper flex h-full flex-col"
2160
+ className: "flex flex-col h-full neeto-form-nano-form-wrapper"
2146
2161
  }, formDomProps), {}, {
2147
2162
  noValidate: true,
2148
2163
  children: [formTitle && /*#__PURE__*/jsx(Overview, {
@@ -2153,7 +2168,7 @@ var Form = function Form(_ref) {
2153
2168
  title: formTitle,
2154
2169
  onLanguageChange: handleLanguageChange
2155
2170
  }), /*#__PURE__*/jsx("div", {
2156
- className: "neeto-form-nano-form-wrapper__body min-h-0 w-full flex-grow space-y-6 overflow-y-auto px-6 pb-6",
2171
+ className: "flex-grow w-full min-h-0 pb-6 space-y-6 overflow-y-auto neeto-form-nano-form-wrapper__body md:px-6",
2157
2172
  children: hasActiveQuestions ? /*#__PURE__*/jsxs("div", {
2158
2173
  className: "space-y-6",
2159
2174
  ref: containerRef,
@@ -2180,7 +2195,7 @@ var Form = function Form(_ref) {
2180
2195
  onSelect: handleSelect
2181
2196
  })
2182
2197
  }), /*#__PURE__*/jsx("div", {
2183
- className: "mb-8 w-full",
2198
+ className: "w-full mb-8",
2184
2199
  children: /*#__PURE__*/jsx(AddQuestion, {
2185
2200
  disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
2186
2201
  isDisabled: isEmpty(availableQuestionKinds),
@@ -2193,7 +2208,7 @@ var Form = function Form(_ref) {
2193
2208
  onAdd: handleAdd
2194
2209
  })
2195
2210
  }), (showActionBlock || dirty) && /*#__PURE__*/jsx("div", {
2196
- className: "neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer neeto-ui-bg-white sticky bottom-0 flex flex-shrink-0 justify-end border-t px-6 py-4",
2211
+ className: "sticky bottom-0 flex justify-end flex-shrink-0 px-6 py-4 border-t neeto-ui-border-gray-300 neeto-form-nano-form-wrapper__footer neeto-ui-bg-white",
2197
2212
  children: /*#__PURE__*/jsx(ActionBlock, {
2198
2213
  submitButtonProps: submitButtonProps,
2199
2214
  isSubmitting: isReordering,