@bigbinary/neeto-form-frontend 4.4.28 → 4.4.29

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
@@ -93,7 +93,7 @@ import '@bigbinary/neeto-icons/Warning';
93
93
  import '@bigbinary/neeto-molecules/PageLoader';
94
94
  import '@bigbinary/neetoui/Callout';
95
95
  import '@bigbinary/neeto-icons/Check';
96
- import './utils-CamvCi6R.js';
96
+ import './utils-G-wqcNVe.js';
97
97
  import 'libphonenumber-js';
98
98
  import '@bigbinary/neeto-editor/EditorContent';
99
99
  import '@bigbinary/neetoui/MultiEmailInput';
@@ -266,9 +266,13 @@ var getMultipleOptionsFromURL = function getMultipleOptionsFromURL(_ref2) {
266
266
  var optionsAttributes = _ref2.optionsAttributes,
267
267
  fieldCodes = _ref2.fieldCodes,
268
268
  fieldCode = _ref2.fieldCode;
269
- var fieldCodeValue = resolveQueryParamValue(fieldCodes[fieldCode]);
270
- if (!fieldCodeValue) return new Array(optionsAttributes.length).fill(false);
271
- var allOptions = fieldCodeValue.split(",").map(trim);
269
+ var rawValue = fieldCodes[fieldCode];
270
+ if (!rawValue) return new Array(optionsAttributes.length).fill(false);
271
+
272
+ // Multi-select values arrive either as a comma-separated string (URL params)
273
+ // or as an array (prefill-token JSON payload); support both. Coerce scalars
274
+ // to string so a numeric token value doesn't blow up on `.split`.
275
+ var allOptions = (Array.isArray(rawValue) ? rawValue : String(rawValue).split(",")).map(trim);
272
276
  return optionsAttributes.map(function (option) {
273
277
  return allOptions.includes(option.label);
274
278
  });
@@ -285,9 +289,9 @@ var getStarRatingOrOpinionScaleFromUrl = function getStarRatingOrOpinionScaleFro
285
289
  var getAdditionalGuestsFromUrl = function getAdditionalGuestsFromUrl(_ref4) {
286
290
  var fieldCodes = _ref4.fieldCodes,
287
291
  fieldCode = _ref4.fieldCode;
288
- var fieldCodeValue = resolveQueryParamValue(fieldCodes[fieldCode]);
289
- var allEmails = fieldCodeValue === null || fieldCodeValue === void 0 ? void 0 : fieldCodeValue.split(",");
290
- if (!allEmails) return [];
292
+ var rawValue = fieldCodes[fieldCode];
293
+ if (!rawValue) return [];
294
+ var allEmails = Array.isArray(rawValue) ? rawValue : String(rawValue).split(",");
291
295
  return allEmails.map(function (email) {
292
296
  return {
293
297
  label: email.trim(),
@@ -2738,4 +2742,4 @@ var getVisibleOptions = function getVisibleOptions(options) {
2738
2742
  };
2739
2743
 
2740
2744
  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 };
2741
- //# sourceMappingURL=utils-CamvCi6R.js.map
2745
+ //# sourceMappingURL=utils-G-wqcNVe.js.map