@bigbinary/neeto-form-frontend 4.4.22 → 4.4.23

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.
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState, useImperativeHandle, memo, Fragment as Fragment$1 } from 'react';
2
2
  import { useFormikContext, useField, Field as Field$1, FastField } from 'formik';
3
- import { isPresent, isNotEmpty, findBy, filterBy, findById, isNotPresent, hyphenate, noop, toLabelAndValue, getRandomInt, randomPick, slugify, notEqualsDeep } from '@bigbinary/neeto-cist';
3
+ import { isPresent, findBy, isNotEmpty, filterBy, findById, isNotPresent, hyphenate, noop, toLabelAndValue, getRandomInt, randomPick, slugify, notEqualsDeep } from '@bigbinary/neeto-cist';
4
4
  import { i as isFunction, b as isEmptyValues, f as fieldWithFallback } from './index-DhtQJpD_.js';
5
5
  import { dayjs, getFromLocalStorage, setToLocalStorage, removeFromLocalStorage, withEventTargetValue, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
6
6
  import { parsePhoneNumber } from 'libphonenumber-js';
@@ -20,7 +20,7 @@ import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
20
20
  import { validation, PhoneNumberInput } from '@bigbinary/neeto-molecules/PhoneNumber';
21
21
  import i18next from 'i18next';
22
22
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
23
- import { a as QUESTION_KIND, S as SPOT_QUESTION_DEFAULT_VALUE, P as PARENTHESES_REGEX, R as RATING_VALUES, E as EMAIL_REGEX, c as SCHEMA_LESS_QUESTION_KINDS, d as SIX_DIGIT_NUMBER_REGEX, A as ADDRESS_FIELD_TYPES, e as ADDRESS_FIELD_WIDTHS, f as LABEL_FIELDS, g as generateArray, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, h as RADIO_DESELECT_KEYS, i as RATING_OPTIONS, I as ICONS_MAP } from './yup-CEJsbBTM.js';
23
+ import { Q as QUESTION_KIND, A as ADDRESS_FIELD_TYPES, S as SPOT_QUESTION_DEFAULT_VALUE, P as PARENTHESES_REGEX, R as RATING_VALUES, E as EMAIL_REGEX, c as SCHEMA_LESS_QUESTION_KINDS, d as SIX_DIGIT_NUMBER_REGEX, e as ADDRESS_FIELD_WIDTHS, f as LABEL_FIELDS, g as generateArray, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, h as RADIO_DESELECT_KEYS, i as RATING_OPTIONS, I as ICONS_MAP } from './yup-DIWktb9n.js';
24
24
  import _toArray from '@babel/runtime/helpers/toArray';
25
25
  import * as yup from 'yup';
26
26
  import classnames from 'classnames';
@@ -508,7 +508,15 @@ var generateInitValues = function generateInitValues(_ref9) {
508
508
  {
509
509
  var _valuesMap$id$value7, _valuesMap10;
510
510
  initValues[id] = (_valuesMap$id$value7 = (_valuesMap10 = valuesMap) === null || _valuesMap10 === void 0 || (_valuesMap10 = _valuesMap10[id]) === null || _valuesMap10 === void 0 ? void 0 : _valuesMap10.value) !== null && _valuesMap$id$value7 !== void 0 ? _valuesMap$id$value7 : fields.reduce(function (values, field) {
511
- values[field.id] = "";
511
+ var value = resolveQueryParamValue(fieldCodes["".concat(fieldCode, ".").concat(field.label)]);
512
+ if (field.fieldType === ADDRESS_FIELD_TYPES.SELECT) {
513
+ var _field$properties;
514
+ values[field.id] = findBy({
515
+ label: value
516
+ }, (_field$properties = field.properties) === null || _field$properties === void 0 ? void 0 : _field$properties.options) ? value : "";
517
+ } else {
518
+ values[field.id] = value || "";
519
+ }
512
520
  return values;
513
521
  }, {});
514
522
  return;
@@ -2728,4 +2736,4 @@ var getVisibleOptions = function getVisibleOptions(options) {
2728
2736
  };
2729
2737
 
2730
2738
  export { FormikWrap as F, generateInitValues as a, buildAutoCompleteAttribute as b, clientI18nInstance as c, getWithExpiry as d, clearEmailVerificationDetails as e, generateFormResponse as f, getFieldComponent as g, clearLocalStorageValues as h, mergeRefs as m, renderButtonsInOrder as r };
2731
- //# sourceMappingURL=utils-Dub9JEjT.js.map
2739
+ //# sourceMappingURL=utils-C3txY6sk.js.map