@bigbinary/neeto-form-frontend 1.1.10 → 1.1.11

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.cjs.js CHANGED
@@ -51846,7 +51846,7 @@ var Success$1 = /*#__PURE__*/React__default["default"].memo(Success);
51846
51846
 
51847
51847
  function cov_2jkcclu7mz() {
51848
51848
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/ExternalForm/index.jsx";
51849
- var hash = "51bd1ad954b6360a0539e2d9c1f4e4c2acb8e797";
51849
+ var hash = "d7d1459f3105ebd090bfe9321a8ed60ddf9ca05f";
51850
51850
  var global = new Function("return this")();
51851
51851
  var gcv = "__coverage__";
51852
51852
  var coverageData = {
@@ -53744,6 +53744,39 @@ function cov_2jkcclu7mz() {
53744
53744
  line: 177
53745
53745
  },
53746
53746
  "25": {
53747
+ loc: {
53748
+ start: {
53749
+ line: 187,
53750
+ column: 4
53751
+ },
53752
+ end: {
53753
+ line: 187,
53754
+ column: 48
53755
+ }
53756
+ },
53757
+ type: "binary-expr",
53758
+ locations: [{
53759
+ start: {
53760
+ line: 187,
53761
+ column: 4
53762
+ },
53763
+ end: {
53764
+ line: 187,
53765
+ column: 40
53766
+ }
53767
+ }, {
53768
+ start: {
53769
+ line: 187,
53770
+ column: 44
53771
+ },
53772
+ end: {
53773
+ line: 187,
53774
+ column: 48
53775
+ }
53776
+ }],
53777
+ line: 187
53778
+ },
53779
+ "26": {
53747
53780
  loc: {
53748
53781
  start: {
53749
53782
  line: 191,
@@ -53776,7 +53809,7 @@ function cov_2jkcclu7mz() {
53776
53809
  }],
53777
53810
  line: 191
53778
53811
  },
53779
- "26": {
53812
+ "27": {
53780
53813
  loc: {
53781
53814
  start: {
53782
53815
  line: 192,
@@ -53827,7 +53860,7 @@ function cov_2jkcclu7mz() {
53827
53860
  }],
53828
53861
  line: 192
53829
53862
  },
53830
- "27": {
53863
+ "28": {
53831
53864
  loc: {
53832
53865
  start: {
53833
53866
  line: 205,
@@ -53860,7 +53893,7 @@ function cov_2jkcclu7mz() {
53860
53893
  }],
53861
53894
  line: 205
53862
53895
  },
53863
- "28": {
53896
+ "29": {
53864
53897
  loc: {
53865
53898
  start: {
53866
53899
  line: 209,
@@ -53893,7 +53926,7 @@ function cov_2jkcclu7mz() {
53893
53926
  }],
53894
53927
  line: 209
53895
53928
  },
53896
- "29": {
53929
+ "30": {
53897
53930
  loc: {
53898
53931
  start: {
53899
53932
  line: 209,
@@ -53926,7 +53959,7 @@ function cov_2jkcclu7mz() {
53926
53959
  }],
53927
53960
  line: 209
53928
53961
  },
53929
- "30": {
53962
+ "31": {
53930
53963
  loc: {
53931
53964
  start: {
53932
53965
  line: 215,
@@ -53959,7 +53992,7 @@ function cov_2jkcclu7mz() {
53959
53992
  }],
53960
53993
  line: 215
53961
53994
  },
53962
- "31": {
53995
+ "32": {
53963
53996
  loc: {
53964
53997
  start: {
53965
53998
  line: 223,
@@ -53992,7 +54025,7 @@ function cov_2jkcclu7mz() {
53992
54025
  }],
53993
54026
  line: 223
53994
54027
  },
53995
- "32": {
54028
+ "33": {
53996
54029
  loc: {
53997
54030
  start: {
53998
54031
  line: 233,
@@ -54025,7 +54058,7 @@ function cov_2jkcclu7mz() {
54025
54058
  }],
54026
54059
  line: 233
54027
54060
  },
54028
- "33": {
54061
+ "34": {
54029
54062
  loc: {
54030
54063
  start: {
54031
54064
  line: 254,
@@ -54058,7 +54091,7 @@ function cov_2jkcclu7mz() {
54058
54091
  }],
54059
54092
  line: 254
54060
54093
  },
54061
- "34": {
54094
+ "35": {
54062
54095
  loc: {
54063
54096
  start: {
54064
54097
  line: 260,
@@ -54091,7 +54124,7 @@ function cov_2jkcclu7mz() {
54091
54124
  }],
54092
54125
  line: 260
54093
54126
  },
54094
- "35": {
54127
+ "36": {
54095
54128
  loc: {
54096
54129
  start: {
54097
54130
  line: 263,
@@ -54124,7 +54157,7 @@ function cov_2jkcclu7mz() {
54124
54157
  }],
54125
54158
  line: 263
54126
54159
  },
54127
- "36": {
54160
+ "37": {
54128
54161
  loc: {
54129
54162
  start: {
54130
54163
  line: 273,
@@ -54157,7 +54190,7 @@ function cov_2jkcclu7mz() {
54157
54190
  }],
54158
54191
  line: 273
54159
54192
  },
54160
- "37": {
54193
+ "38": {
54161
54194
  loc: {
54162
54195
  start: {
54163
54196
  line: 285,
@@ -54190,7 +54223,7 @@ function cov_2jkcclu7mz() {
54190
54223
  }],
54191
54224
  line: 285
54192
54225
  },
54193
- "38": {
54226
+ "39": {
54194
54227
  loc: {
54195
54228
  start: {
54196
54229
  line: 290,
@@ -54232,7 +54265,7 @@ function cov_2jkcclu7mz() {
54232
54265
  }],
54233
54266
  line: 290
54234
54267
  },
54235
- "39": {
54268
+ "40": {
54236
54269
  loc: {
54237
54270
  start: {
54238
54271
  line: 299,
@@ -54265,7 +54298,7 @@ function cov_2jkcclu7mz() {
54265
54298
  }],
54266
54299
  line: 299
54267
54300
  },
54268
- "40": {
54301
+ "41": {
54269
54302
  loc: {
54270
54303
  start: {
54271
54304
  line: 302,
@@ -54298,7 +54331,7 @@ function cov_2jkcclu7mz() {
54298
54331
  }],
54299
54332
  line: 302
54300
54333
  },
54301
- "41": {
54334
+ "42": {
54302
54335
  loc: {
54303
54336
  start: {
54304
54337
  line: 307,
@@ -54331,7 +54364,7 @@ function cov_2jkcclu7mz() {
54331
54364
  }],
54332
54365
  line: 307
54333
54366
  },
54334
- "42": {
54367
+ "43": {
54335
54368
  loc: {
54336
54369
  start: {
54337
54370
  line: 315,
@@ -54364,7 +54397,7 @@ function cov_2jkcclu7mz() {
54364
54397
  }],
54365
54398
  line: 315
54366
54399
  },
54367
- "43": {
54400
+ "44": {
54368
54401
  loc: {
54369
54402
  start: {
54370
54403
  line: 321,
@@ -54525,8 +54558,8 @@ function cov_2jkcclu7mz() {
54525
54558
  "23": [0, 0],
54526
54559
  "24": [0],
54527
54560
  "25": [0, 0],
54528
- "26": [0, 0, 0, 0],
54529
- "27": [0, 0],
54561
+ "26": [0, 0],
54562
+ "27": [0, 0, 0, 0],
54530
54563
  "28": [0, 0],
54531
54564
  "29": [0, 0],
54532
54565
  "30": [0, 0],
@@ -54537,15 +54570,16 @@ function cov_2jkcclu7mz() {
54537
54570
  "35": [0, 0],
54538
54571
  "36": [0, 0],
54539
54572
  "37": [0, 0],
54540
- "38": [0, 0, 0],
54541
- "39": [0, 0],
54573
+ "38": [0, 0],
54574
+ "39": [0, 0, 0],
54542
54575
  "40": [0, 0],
54543
54576
  "41": [0, 0],
54544
54577
  "42": [0, 0],
54545
- "43": [0, 0]
54578
+ "43": [0, 0],
54579
+ "44": [0, 0]
54546
54580
  },
54547
54581
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
54548
- hash: "51bd1ad954b6360a0539e2d9c1f4e4c2acb8e797"
54582
+ hash: "d7d1459f3105ebd090bfe9321a8ed60ddf9ca05f"
54549
54583
  };
54550
54584
  var coverage = global[gcv] || (global[gcv] = {});
54551
54585
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -54898,47 +54932,47 @@ var ExternalForm = function ExternalForm(_ref) {
54898
54932
  questions: []
54899
54933
  }) : _ref16$data,
54900
54934
  isLoading = _ref16.isLoading;
54901
- var keyPressRef = (cov_2jkcclu7mz().s[59]++, reactUtils.useHotKeys("command+enter", (_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit, {
54935
+ var keyPressRef = (cov_2jkcclu7mz().s[59]++, reactUtils.useHotKeys("command+enter", (cov_2jkcclu7mz().b[25][0]++, (_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit) || (cov_2jkcclu7mz().b[25][1]++, pure.noop), {
54902
54936
  mode: "scoped"
54903
54937
  }));
54904
54938
  cov_2jkcclu7mz().s[60]++;
54905
- if ((cov_2jkcclu7mz().b[26][0]++, isLoading) || (cov_2jkcclu7mz().b[26][1]++, form.isQuestionsLoading) || (cov_2jkcclu7mz().b[26][2]++, !!submissionId) && (cov_2jkcclu7mz().b[26][3]++, submission !== null && submission !== void 0 && submission.isLoading)) {
54906
- cov_2jkcclu7mz().b[25][0]++;
54939
+ if ((cov_2jkcclu7mz().b[27][0]++, isLoading) || (cov_2jkcclu7mz().b[27][1]++, form.isQuestionsLoading) || (cov_2jkcclu7mz().b[27][2]++, !!submissionId) && (cov_2jkcclu7mz().b[27][3]++, submission !== null && submission !== void 0 && submission.isLoading)) {
54940
+ cov_2jkcclu7mz().b[26][0]++;
54907
54941
  cov_2jkcclu7mz().s[61]++;
54908
54942
  return /*#__PURE__*/React__default["default"].createElement("div", {
54909
54943
  className: "loader flex h-full w-full items-center justify-center"
54910
54944
  }, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null));
54911
54945
  } else {
54912
- cov_2jkcclu7mz().b[25][1]++;
54946
+ cov_2jkcclu7mz().b[26][1]++;
54913
54947
  }
54914
54948
  var _ref17 = (cov_2jkcclu7mz().s[62]++, form),
54915
54949
  title = _ref17.title,
54916
54950
  questions = _ref17.questions;
54917
- var renderedQuestions = (cov_2jkcclu7mz().s[63]++, preview ? (cov_2jkcclu7mz().b[27][0]++, questions.filter(function (_ref18) {
54951
+ var renderedQuestions = (cov_2jkcclu7mz().s[63]++, preview ? (cov_2jkcclu7mz().b[28][0]++, questions.filter(function (_ref18) {
54918
54952
  var _destroy = _ref18._destroy;
54919
54953
  cov_2jkcclu7mz().f[9]++;
54920
54954
  cov_2jkcclu7mz().s[64]++;
54921
54955
  return !_destroy;
54922
- })) : (cov_2jkcclu7mz().b[27][1]++, questions));
54956
+ })) : (cov_2jkcclu7mz().b[28][1]++, questions));
54923
54957
  cov_2jkcclu7mz().s[65]++;
54924
- if ((cov_2jkcclu7mz().b[29][0]++, displayThankYou) && (cov_2jkcclu7mz().b[29][1]++, showSuccess)) {
54925
- cov_2jkcclu7mz().b[28][0]++;
54958
+ if ((cov_2jkcclu7mz().b[30][0]++, displayThankYou) && (cov_2jkcclu7mz().b[30][1]++, showSuccess)) {
54959
+ cov_2jkcclu7mz().b[29][0]++;
54926
54960
  cov_2jkcclu7mz().s[66]++;
54927
54961
  return /*#__PURE__*/React__default["default"].createElement(Success$1, null);
54928
54962
  } else {
54929
- cov_2jkcclu7mz().b[28][1]++;
54963
+ cov_2jkcclu7mz().b[29][1]++;
54930
54964
  }
54931
54965
  cov_2jkcclu7mz().s[67]++;
54932
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, (cov_2jkcclu7mz().b[30][0]++, showTitle) && (cov_2jkcclu7mz().b[30][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
54966
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, (cov_2jkcclu7mz().b[31][0]++, showTitle) && (cov_2jkcclu7mz().b[31][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
54933
54967
  className: "py-6 text-center"
54934
54968
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, _extends$8({
54935
54969
  className: "neeto-ui-text-gray-800",
54936
54970
  style: "h4",
54937
54971
  weight: "semibold"
54938
- }, titleProps), (cov_2jkcclu7mz().b[31][0]++, formTitle) || (cov_2jkcclu7mz().b[31][1]++, title)))), /*#__PURE__*/React__default["default"].createElement(formik.Formik, {
54972
+ }, titleProps), (cov_2jkcclu7mz().b[32][0]++, formTitle) || (cov_2jkcclu7mz().b[32][1]++, title)))), /*#__PURE__*/React__default["default"].createElement(formik.Formik, {
54939
54973
  enableReinitialize: true,
54940
54974
  innerRef: formikInnerRef,
54941
- initialValues: generateInitValues(questions, submission === null || submission === void 0 ? void 0 : submission.responses, preserveValues ? (cov_2jkcclu7mz().b[32][0]++, localValues) : (cov_2jkcclu7mz().b[32][1]++, initialValues)),
54975
+ initialValues: generateInitValues(questions, submission === null || submission === void 0 ? void 0 : submission.responses, preserveValues ? (cov_2jkcclu7mz().b[33][0]++, localValues) : (cov_2jkcclu7mz().b[33][1]++, initialValues)),
54942
54976
  onSubmit: onSubmit
54943
54977
  }, function (_ref19) {
54944
54978
  var isSubmitting = _ref19.isSubmitting,
@@ -54961,11 +54995,11 @@ var ExternalForm = function ExternalForm(_ref) {
54961
54995
  cov_2jkcclu7mz().f[11]++;
54962
54996
  cov_2jkcclu7mz().s[69]++;
54963
54997
  if (!ramda.isEmpty(errors)) {
54964
- cov_2jkcclu7mz().b[33][0]++;
54998
+ cov_2jkcclu7mz().b[34][0]++;
54965
54999
  cov_2jkcclu7mz().s[70]++;
54966
55000
  setFieldError(event.target.name, "");
54967
55001
  } else {
54968
- cov_2jkcclu7mz().b[33][1]++;
55002
+ cov_2jkcclu7mz().b[34][1]++;
54969
55003
  }
54970
55004
  }
54971
55005
  }, formDomProps, {
@@ -54974,24 +55008,24 @@ var ExternalForm = function ExternalForm(_ref) {
54974
55008
  cov_2jkcclu7mz().f[12]++;
54975
55009
  cov_2jkcclu7mz().s[71]++;
54976
55010
  if (clearValuesOnReset) {
54977
- cov_2jkcclu7mz().b[34][0]++;
55011
+ cov_2jkcclu7mz().b[35][0]++;
54978
55012
  cov_2jkcclu7mz().s[72]++;
54979
55013
  clearLocalStorageValues("".concat(formId, "/values"));
54980
55014
  cov_2jkcclu7mz().s[73]++;
54981
55015
  setLocalValues(generateInitValues(questions));
54982
55016
  cov_2jkcclu7mz().s[74]++;
54983
- (cov_2jkcclu7mz().b[35][0]++, submissionId) && (cov_2jkcclu7mz().b[35][1]++, queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, submissionId], {
55017
+ (cov_2jkcclu7mz().b[36][0]++, submissionId) && (cov_2jkcclu7mz().b[36][1]++, queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, submissionId], {
54984
55018
  responses: []
54985
55019
  }));
54986
55020
  } else {
54987
- cov_2jkcclu7mz().b[34][1]++;
55021
+ cov_2jkcclu7mz().b[35][1]++;
54988
55022
  }
54989
55023
  cov_2jkcclu7mz().s[75]++;
54990
55024
  handleReset(e);
54991
55025
  cov_2jkcclu7mz().s[76]++;
54992
55026
  formDomProps === null || formDomProps === void 0 ? void 0 : (_formDomProps$onReset = formDomProps.onReset) === null || _formDomProps$onReset === void 0 ? void 0 : _formDomProps$onReset.call(formDomProps, e);
54993
55027
  }
54994
- }), (cov_2jkcclu7mz().b[36][0]++, submission === null || submission === void 0 ? void 0 : submission.isLoading) && (cov_2jkcclu7mz().b[36][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
55028
+ }), (cov_2jkcclu7mz().b[37][0]++, submission === null || submission === void 0 ? void 0 : submission.isLoading) && (cov_2jkcclu7mz().b[37][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
54995
55029
  className: "neeto-ui-bg-gray-100 absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center opacity-75"
54996
55030
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Spinner, null))), renderedQuestions.map(function (question) {
54997
55031
  var _ref20;
@@ -55002,27 +55036,27 @@ var ExternalForm = function ExternalForm(_ref) {
55002
55036
  customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
55003
55037
  editorProps: editorProps,
55004
55038
  question: question,
55005
- key: (_ref20 = (cov_2jkcclu7mz().b[37][0]++, question.id)) !== null && _ref20 !== void 0 ? _ref20 : (cov_2jkcclu7mz().b[37][1]++, question.nodeId),
55039
+ key: (_ref20 = (cov_2jkcclu7mz().b[38][0]++, question.id)) !== null && _ref20 !== void 0 ? _ref20 : (cov_2jkcclu7mz().b[38][1]++, question.nodeId),
55006
55040
  showPrefixIcon: showPrefixIcons
55007
55041
  });
55008
- }), (cov_2jkcclu7mz().b[38][0]++, showEmptyState) && (cov_2jkcclu7mz().b[38][1]++, ramda.isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[38][2]++, /*#__PURE__*/React__default["default"].createElement("div", {
55042
+ }), (cov_2jkcclu7mz().b[39][0]++, showEmptyState) && (cov_2jkcclu7mz().b[39][1]++, ramda.isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[39][2]++, /*#__PURE__*/React__default["default"].createElement("div", {
55009
55043
  className: "flex flex-col items-center justify-center gap-y-4 py-8"
55010
55044
  }, /*#__PURE__*/React__default["default"].createElement(SvgNoQuestions, null), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
55011
55045
  style: "h3",
55012
55046
  weight: "semibold"
55013
- }, t("neetoForm.questions.common.notFound")))), footer, (cov_2jkcclu7mz().b[39][0]++, !ramda.isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[39][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
55047
+ }, t("neetoForm.questions.common.notFound")))), footer, (cov_2jkcclu7mz().b[40][0]++, !ramda.isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[40][1]++, /*#__PURE__*/React__default["default"].createElement("div", {
55014
55048
  className: "mt-8 flex items-center justify-start gap-x-2"
55015
55049
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$8({
55016
- disabled: (cov_2jkcclu7mz().b[40][0]++, isSubmitting) || (cov_2jkcclu7mz().b[40][1]++, isSubmitted),
55050
+ disabled: (cov_2jkcclu7mz().b[41][0]++, isSubmitting) || (cov_2jkcclu7mz().b[41][1]++, isSubmitted),
55017
55051
  loading: isSubmitting,
55018
55052
  type: "submit"
55019
- }, submitButtonProps)), (cov_2jkcclu7mz().b[41][0]++, resetButtonProps) && (cov_2jkcclu7mz().b[41][1]++, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$8({
55053
+ }, submitButtonProps)), (cov_2jkcclu7mz().b[42][0]++, resetButtonProps) && (cov_2jkcclu7mz().b[42][1]++, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$8({
55020
55054
  label: t("neetoForm.common.reset"),
55021
55055
  style: "secondary",
55022
55056
  type: "reset"
55023
- }, resetButtonProps))), (cov_2jkcclu7mz().b[42][0]++, cancelButtonProps) && (cov_2jkcclu7mz().b[42][1]++, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$8({
55057
+ }, resetButtonProps))), (cov_2jkcclu7mz().b[43][0]++, cancelButtonProps) && (cov_2jkcclu7mz().b[43][1]++, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$8({
55024
55058
  label: "Cancel"
55025
- }, cancelButtonProps)))))), (cov_2jkcclu7mz().b[43][0]++, !customSubmitHandler) && (cov_2jkcclu7mz().b[43][1]++, /*#__PURE__*/React__default["default"].createElement(Callout, {
55059
+ }, cancelButtonProps)))))), (cov_2jkcclu7mz().b[44][0]++, !customSubmitHandler) && (cov_2jkcclu7mz().b[44][1]++, /*#__PURE__*/React__default["default"].createElement(Callout, {
55026
55060
  callout: {
55027
55061
  isVisible: pure.isPresent(error),
55028
55062
  title: t("neetoForm.callouts.submitError"),