@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.js CHANGED
@@ -51810,7 +51810,7 @@ var Success$1 = /*#__PURE__*/React__default.memo(Success);
51810
51810
 
51811
51811
  function cov_2jkcclu7mz() {
51812
51812
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/ExternalForm/index.jsx";
51813
- var hash = "51bd1ad954b6360a0539e2d9c1f4e4c2acb8e797";
51813
+ var hash = "d7d1459f3105ebd090bfe9321a8ed60ddf9ca05f";
51814
51814
  var global = new Function("return this")();
51815
51815
  var gcv = "__coverage__";
51816
51816
  var coverageData = {
@@ -53708,6 +53708,39 @@ function cov_2jkcclu7mz() {
53708
53708
  line: 177
53709
53709
  },
53710
53710
  "25": {
53711
+ loc: {
53712
+ start: {
53713
+ line: 187,
53714
+ column: 4
53715
+ },
53716
+ end: {
53717
+ line: 187,
53718
+ column: 48
53719
+ }
53720
+ },
53721
+ type: "binary-expr",
53722
+ locations: [{
53723
+ start: {
53724
+ line: 187,
53725
+ column: 4
53726
+ },
53727
+ end: {
53728
+ line: 187,
53729
+ column: 40
53730
+ }
53731
+ }, {
53732
+ start: {
53733
+ line: 187,
53734
+ column: 44
53735
+ },
53736
+ end: {
53737
+ line: 187,
53738
+ column: 48
53739
+ }
53740
+ }],
53741
+ line: 187
53742
+ },
53743
+ "26": {
53711
53744
  loc: {
53712
53745
  start: {
53713
53746
  line: 191,
@@ -53740,7 +53773,7 @@ function cov_2jkcclu7mz() {
53740
53773
  }],
53741
53774
  line: 191
53742
53775
  },
53743
- "26": {
53776
+ "27": {
53744
53777
  loc: {
53745
53778
  start: {
53746
53779
  line: 192,
@@ -53791,7 +53824,7 @@ function cov_2jkcclu7mz() {
53791
53824
  }],
53792
53825
  line: 192
53793
53826
  },
53794
- "27": {
53827
+ "28": {
53795
53828
  loc: {
53796
53829
  start: {
53797
53830
  line: 205,
@@ -53824,7 +53857,7 @@ function cov_2jkcclu7mz() {
53824
53857
  }],
53825
53858
  line: 205
53826
53859
  },
53827
- "28": {
53860
+ "29": {
53828
53861
  loc: {
53829
53862
  start: {
53830
53863
  line: 209,
@@ -53857,7 +53890,7 @@ function cov_2jkcclu7mz() {
53857
53890
  }],
53858
53891
  line: 209
53859
53892
  },
53860
- "29": {
53893
+ "30": {
53861
53894
  loc: {
53862
53895
  start: {
53863
53896
  line: 209,
@@ -53890,7 +53923,7 @@ function cov_2jkcclu7mz() {
53890
53923
  }],
53891
53924
  line: 209
53892
53925
  },
53893
- "30": {
53926
+ "31": {
53894
53927
  loc: {
53895
53928
  start: {
53896
53929
  line: 215,
@@ -53923,7 +53956,7 @@ function cov_2jkcclu7mz() {
53923
53956
  }],
53924
53957
  line: 215
53925
53958
  },
53926
- "31": {
53959
+ "32": {
53927
53960
  loc: {
53928
53961
  start: {
53929
53962
  line: 223,
@@ -53956,7 +53989,7 @@ function cov_2jkcclu7mz() {
53956
53989
  }],
53957
53990
  line: 223
53958
53991
  },
53959
- "32": {
53992
+ "33": {
53960
53993
  loc: {
53961
53994
  start: {
53962
53995
  line: 233,
@@ -53989,7 +54022,7 @@ function cov_2jkcclu7mz() {
53989
54022
  }],
53990
54023
  line: 233
53991
54024
  },
53992
- "33": {
54025
+ "34": {
53993
54026
  loc: {
53994
54027
  start: {
53995
54028
  line: 254,
@@ -54022,7 +54055,7 @@ function cov_2jkcclu7mz() {
54022
54055
  }],
54023
54056
  line: 254
54024
54057
  },
54025
- "34": {
54058
+ "35": {
54026
54059
  loc: {
54027
54060
  start: {
54028
54061
  line: 260,
@@ -54055,7 +54088,7 @@ function cov_2jkcclu7mz() {
54055
54088
  }],
54056
54089
  line: 260
54057
54090
  },
54058
- "35": {
54091
+ "36": {
54059
54092
  loc: {
54060
54093
  start: {
54061
54094
  line: 263,
@@ -54088,7 +54121,7 @@ function cov_2jkcclu7mz() {
54088
54121
  }],
54089
54122
  line: 263
54090
54123
  },
54091
- "36": {
54124
+ "37": {
54092
54125
  loc: {
54093
54126
  start: {
54094
54127
  line: 273,
@@ -54121,7 +54154,7 @@ function cov_2jkcclu7mz() {
54121
54154
  }],
54122
54155
  line: 273
54123
54156
  },
54124
- "37": {
54157
+ "38": {
54125
54158
  loc: {
54126
54159
  start: {
54127
54160
  line: 285,
@@ -54154,7 +54187,7 @@ function cov_2jkcclu7mz() {
54154
54187
  }],
54155
54188
  line: 285
54156
54189
  },
54157
- "38": {
54190
+ "39": {
54158
54191
  loc: {
54159
54192
  start: {
54160
54193
  line: 290,
@@ -54196,7 +54229,7 @@ function cov_2jkcclu7mz() {
54196
54229
  }],
54197
54230
  line: 290
54198
54231
  },
54199
- "39": {
54232
+ "40": {
54200
54233
  loc: {
54201
54234
  start: {
54202
54235
  line: 299,
@@ -54229,7 +54262,7 @@ function cov_2jkcclu7mz() {
54229
54262
  }],
54230
54263
  line: 299
54231
54264
  },
54232
- "40": {
54265
+ "41": {
54233
54266
  loc: {
54234
54267
  start: {
54235
54268
  line: 302,
@@ -54262,7 +54295,7 @@ function cov_2jkcclu7mz() {
54262
54295
  }],
54263
54296
  line: 302
54264
54297
  },
54265
- "41": {
54298
+ "42": {
54266
54299
  loc: {
54267
54300
  start: {
54268
54301
  line: 307,
@@ -54295,7 +54328,7 @@ function cov_2jkcclu7mz() {
54295
54328
  }],
54296
54329
  line: 307
54297
54330
  },
54298
- "42": {
54331
+ "43": {
54299
54332
  loc: {
54300
54333
  start: {
54301
54334
  line: 315,
@@ -54328,7 +54361,7 @@ function cov_2jkcclu7mz() {
54328
54361
  }],
54329
54362
  line: 315
54330
54363
  },
54331
- "43": {
54364
+ "44": {
54332
54365
  loc: {
54333
54366
  start: {
54334
54367
  line: 321,
@@ -54489,8 +54522,8 @@ function cov_2jkcclu7mz() {
54489
54522
  "23": [0, 0],
54490
54523
  "24": [0],
54491
54524
  "25": [0, 0],
54492
- "26": [0, 0, 0, 0],
54493
- "27": [0, 0],
54525
+ "26": [0, 0],
54526
+ "27": [0, 0, 0, 0],
54494
54527
  "28": [0, 0],
54495
54528
  "29": [0, 0],
54496
54529
  "30": [0, 0],
@@ -54501,15 +54534,16 @@ function cov_2jkcclu7mz() {
54501
54534
  "35": [0, 0],
54502
54535
  "36": [0, 0],
54503
54536
  "37": [0, 0],
54504
- "38": [0, 0, 0],
54505
- "39": [0, 0],
54537
+ "38": [0, 0],
54538
+ "39": [0, 0, 0],
54506
54539
  "40": [0, 0],
54507
54540
  "41": [0, 0],
54508
54541
  "42": [0, 0],
54509
- "43": [0, 0]
54542
+ "43": [0, 0],
54543
+ "44": [0, 0]
54510
54544
  },
54511
54545
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
54512
- hash: "51bd1ad954b6360a0539e2d9c1f4e4c2acb8e797"
54546
+ hash: "d7d1459f3105ebd090bfe9321a8ed60ddf9ca05f"
54513
54547
  };
54514
54548
  var coverage = global[gcv] || (global[gcv] = {});
54515
54549
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -54862,47 +54896,47 @@ var ExternalForm = function ExternalForm(_ref) {
54862
54896
  questions: []
54863
54897
  }) : _ref16$data,
54864
54898
  isLoading = _ref16.isLoading;
54865
- var keyPressRef = (cov_2jkcclu7mz().s[59]++, useHotKeys("command+enter", (_formikInnerRef$curre = formikInnerRef.current) === null || _formikInnerRef$curre === void 0 ? void 0 : _formikInnerRef$curre.handleSubmit, {
54899
+ var keyPressRef = (cov_2jkcclu7mz().s[59]++, 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]++, noop$4), {
54866
54900
  mode: "scoped"
54867
54901
  }));
54868
54902
  cov_2jkcclu7mz().s[60]++;
54869
- 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)) {
54870
- cov_2jkcclu7mz().b[25][0]++;
54903
+ 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)) {
54904
+ cov_2jkcclu7mz().b[26][0]++;
54871
54905
  cov_2jkcclu7mz().s[61]++;
54872
54906
  return /*#__PURE__*/React__default.createElement("div", {
54873
54907
  className: "loader flex h-full w-full items-center justify-center"
54874
54908
  }, /*#__PURE__*/React__default.createElement(PageLoader, null));
54875
54909
  } else {
54876
- cov_2jkcclu7mz().b[25][1]++;
54910
+ cov_2jkcclu7mz().b[26][1]++;
54877
54911
  }
54878
54912
  var _ref17 = (cov_2jkcclu7mz().s[62]++, form),
54879
54913
  title = _ref17.title,
54880
54914
  questions = _ref17.questions;
54881
- var renderedQuestions = (cov_2jkcclu7mz().s[63]++, preview ? (cov_2jkcclu7mz().b[27][0]++, questions.filter(function (_ref18) {
54915
+ var renderedQuestions = (cov_2jkcclu7mz().s[63]++, preview ? (cov_2jkcclu7mz().b[28][0]++, questions.filter(function (_ref18) {
54882
54916
  var _destroy = _ref18._destroy;
54883
54917
  cov_2jkcclu7mz().f[9]++;
54884
54918
  cov_2jkcclu7mz().s[64]++;
54885
54919
  return !_destroy;
54886
- })) : (cov_2jkcclu7mz().b[27][1]++, questions));
54920
+ })) : (cov_2jkcclu7mz().b[28][1]++, questions));
54887
54921
  cov_2jkcclu7mz().s[65]++;
54888
- if ((cov_2jkcclu7mz().b[29][0]++, displayThankYou) && (cov_2jkcclu7mz().b[29][1]++, showSuccess)) {
54889
- cov_2jkcclu7mz().b[28][0]++;
54922
+ if ((cov_2jkcclu7mz().b[30][0]++, displayThankYou) && (cov_2jkcclu7mz().b[30][1]++, showSuccess)) {
54923
+ cov_2jkcclu7mz().b[29][0]++;
54890
54924
  cov_2jkcclu7mz().s[66]++;
54891
54925
  return /*#__PURE__*/React__default.createElement(Success$1, null);
54892
54926
  } else {
54893
- cov_2jkcclu7mz().b[28][1]++;
54927
+ cov_2jkcclu7mz().b[29][1]++;
54894
54928
  }
54895
54929
  cov_2jkcclu7mz().s[67]++;
54896
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (cov_2jkcclu7mz().b[30][0]++, showTitle) && (cov_2jkcclu7mz().b[30][1]++, /*#__PURE__*/React__default.createElement("div", {
54930
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (cov_2jkcclu7mz().b[31][0]++, showTitle) && (cov_2jkcclu7mz().b[31][1]++, /*#__PURE__*/React__default.createElement("div", {
54897
54931
  className: "py-6 text-center"
54898
54932
  }, /*#__PURE__*/React__default.createElement(Typography, _extends$8({
54899
54933
  className: "neeto-ui-text-gray-800",
54900
54934
  style: "h4",
54901
54935
  weight: "semibold"
54902
- }, titleProps), (cov_2jkcclu7mz().b[31][0]++, formTitle) || (cov_2jkcclu7mz().b[31][1]++, title)))), /*#__PURE__*/React__default.createElement(Formik, {
54936
+ }, titleProps), (cov_2jkcclu7mz().b[32][0]++, formTitle) || (cov_2jkcclu7mz().b[32][1]++, title)))), /*#__PURE__*/React__default.createElement(Formik, {
54903
54937
  enableReinitialize: true,
54904
54938
  innerRef: formikInnerRef,
54905
- 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)),
54939
+ 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)),
54906
54940
  onSubmit: onSubmit
54907
54941
  }, function (_ref19) {
54908
54942
  var isSubmitting = _ref19.isSubmitting,
@@ -54925,11 +54959,11 @@ var ExternalForm = function ExternalForm(_ref) {
54925
54959
  cov_2jkcclu7mz().f[11]++;
54926
54960
  cov_2jkcclu7mz().s[69]++;
54927
54961
  if (!isEmpty(errors)) {
54928
- cov_2jkcclu7mz().b[33][0]++;
54962
+ cov_2jkcclu7mz().b[34][0]++;
54929
54963
  cov_2jkcclu7mz().s[70]++;
54930
54964
  setFieldError(event.target.name, "");
54931
54965
  } else {
54932
- cov_2jkcclu7mz().b[33][1]++;
54966
+ cov_2jkcclu7mz().b[34][1]++;
54933
54967
  }
54934
54968
  }
54935
54969
  }, formDomProps, {
@@ -54938,24 +54972,24 @@ var ExternalForm = function ExternalForm(_ref) {
54938
54972
  cov_2jkcclu7mz().f[12]++;
54939
54973
  cov_2jkcclu7mz().s[71]++;
54940
54974
  if (clearValuesOnReset) {
54941
- cov_2jkcclu7mz().b[34][0]++;
54975
+ cov_2jkcclu7mz().b[35][0]++;
54942
54976
  cov_2jkcclu7mz().s[72]++;
54943
54977
  clearLocalStorageValues("".concat(formId, "/values"));
54944
54978
  cov_2jkcclu7mz().s[73]++;
54945
54979
  setLocalValues(generateInitValues(questions));
54946
54980
  cov_2jkcclu7mz().s[74]++;
54947
- (cov_2jkcclu7mz().b[35][0]++, submissionId) && (cov_2jkcclu7mz().b[35][1]++, queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, submissionId], {
54981
+ (cov_2jkcclu7mz().b[36][0]++, submissionId) && (cov_2jkcclu7mz().b[36][1]++, queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, submissionId], {
54948
54982
  responses: []
54949
54983
  }));
54950
54984
  } else {
54951
- cov_2jkcclu7mz().b[34][1]++;
54985
+ cov_2jkcclu7mz().b[35][1]++;
54952
54986
  }
54953
54987
  cov_2jkcclu7mz().s[75]++;
54954
54988
  handleReset(e);
54955
54989
  cov_2jkcclu7mz().s[76]++;
54956
54990
  formDomProps === null || formDomProps === void 0 ? void 0 : (_formDomProps$onReset = formDomProps.onReset) === null || _formDomProps$onReset === void 0 ? void 0 : _formDomProps$onReset.call(formDomProps, e);
54957
54991
  }
54958
- }), (cov_2jkcclu7mz().b[36][0]++, submission === null || submission === void 0 ? void 0 : submission.isLoading) && (cov_2jkcclu7mz().b[36][1]++, /*#__PURE__*/React__default.createElement("div", {
54992
+ }), (cov_2jkcclu7mz().b[37][0]++, submission === null || submission === void 0 ? void 0 : submission.isLoading) && (cov_2jkcclu7mz().b[37][1]++, /*#__PURE__*/React__default.createElement("div", {
54959
54993
  className: "neeto-ui-bg-gray-100 absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center opacity-75"
54960
54994
  }, /*#__PURE__*/React__default.createElement(Spinner$2, null))), renderedQuestions.map(function (question) {
54961
54995
  var _ref20;
@@ -54966,27 +55000,27 @@ var ExternalForm = function ExternalForm(_ref) {
54966
55000
  customValidator: customValidator === null || customValidator === void 0 ? void 0 : customValidator(question),
54967
55001
  editorProps: editorProps,
54968
55002
  question: question,
54969
- key: (_ref20 = (cov_2jkcclu7mz().b[37][0]++, question.id)) !== null && _ref20 !== void 0 ? _ref20 : (cov_2jkcclu7mz().b[37][1]++, question.nodeId),
55003
+ key: (_ref20 = (cov_2jkcclu7mz().b[38][0]++, question.id)) !== null && _ref20 !== void 0 ? _ref20 : (cov_2jkcclu7mz().b[38][1]++, question.nodeId),
54970
55004
  showPrefixIcon: showPrefixIcons
54971
55005
  });
54972
- }), (cov_2jkcclu7mz().b[38][0]++, showEmptyState) && (cov_2jkcclu7mz().b[38][1]++, isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[38][2]++, /*#__PURE__*/React__default.createElement("div", {
55006
+ }), (cov_2jkcclu7mz().b[39][0]++, showEmptyState) && (cov_2jkcclu7mz().b[39][1]++, isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[39][2]++, /*#__PURE__*/React__default.createElement("div", {
54973
55007
  className: "flex flex-col items-center justify-center gap-y-4 py-8"
54974
55008
  }, /*#__PURE__*/React__default.createElement(SvgNoQuestions, null), /*#__PURE__*/React__default.createElement(Typography, {
54975
55009
  style: "h3",
54976
55010
  weight: "semibold"
54977
- }, t("neetoForm.questions.common.notFound")))), footer, (cov_2jkcclu7mz().b[39][0]++, !isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[39][1]++, /*#__PURE__*/React__default.createElement("div", {
55011
+ }, t("neetoForm.questions.common.notFound")))), footer, (cov_2jkcclu7mz().b[40][0]++, !isEmpty(renderedQuestions)) && (cov_2jkcclu7mz().b[40][1]++, /*#__PURE__*/React__default.createElement("div", {
54978
55012
  className: "mt-8 flex items-center justify-start gap-x-2"
54979
55013
  }, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
54980
- disabled: (cov_2jkcclu7mz().b[40][0]++, isSubmitting) || (cov_2jkcclu7mz().b[40][1]++, isSubmitted),
55014
+ disabled: (cov_2jkcclu7mz().b[41][0]++, isSubmitting) || (cov_2jkcclu7mz().b[41][1]++, isSubmitted),
54981
55015
  loading: isSubmitting,
54982
55016
  type: "submit"
54983
- }, submitButtonProps)), (cov_2jkcclu7mz().b[41][0]++, resetButtonProps) && (cov_2jkcclu7mz().b[41][1]++, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
55017
+ }, submitButtonProps)), (cov_2jkcclu7mz().b[42][0]++, resetButtonProps) && (cov_2jkcclu7mz().b[42][1]++, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
54984
55018
  label: t("neetoForm.common.reset"),
54985
55019
  style: "secondary",
54986
55020
  type: "reset"
54987
- }, resetButtonProps))), (cov_2jkcclu7mz().b[42][0]++, cancelButtonProps) && (cov_2jkcclu7mz().b[42][1]++, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
55021
+ }, resetButtonProps))), (cov_2jkcclu7mz().b[43][0]++, cancelButtonProps) && (cov_2jkcclu7mz().b[43][1]++, /*#__PURE__*/React__default.createElement(Button$1, _extends$8({
54988
55022
  label: "Cancel"
54989
- }, cancelButtonProps)))))), (cov_2jkcclu7mz().b[43][0]++, !customSubmitHandler) && (cov_2jkcclu7mz().b[43][1]++, /*#__PURE__*/React__default.createElement(Callout, {
55023
+ }, cancelButtonProps)))))), (cov_2jkcclu7mz().b[44][0]++, !customSubmitHandler) && (cov_2jkcclu7mz().b[44][1]++, /*#__PURE__*/React__default.createElement(Callout, {
54990
55024
  callout: {
54991
55025
  isVisible: isPresent(error),
54992
55026
  title: t("neetoForm.callouts.submitError"),