@wix/form-public 0.208.0 → 0.210.0

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 CHANGED
@@ -25897,7 +25897,8 @@ var FileFormatMap = {
25897
25897
  Image: "image/*",
25898
25898
  Audio: "audio/*",
25899
25899
  Document: ".ai, .cdr, .csv, .doc, .docb, .docx, .dot, .dotx, .dwg, .eps, .epub, .fla, .gpx, .ical, .icalendar, .ics, .ifb, .indd, .ipynb, .key, .kml, .kmz, .mobi, .mtf, .mtx, .numbers, .odg, .odp, .ods, .odt, .otp, .ots, .ott, .oxps, .pages, .pdf, .pdn, .pkg, .pot, .potx, .pps, .ppsx, .ppt, .pptx, .psd, .pub, .rtf, .sldx, .txt, .json, .vcf, .xcf, .xls, .xlsx, .xlt, .xltx, .xlw, .xps,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",
25900
- Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive"
25900
+ Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
25901
+ Model3D: ".gltf, .glb"
25901
25902
  };
25902
25903
 
25903
25904
  // ../form-fields/dist/esm/utils/date-format-parts.js
@@ -27907,6 +27908,7 @@ function useFormView() {
27907
27908
  }
27908
27909
  return context;
27909
27910
  }
27911
+ var FormValuesContext = /* @__PURE__ */ React42.createContext(void 0);
27910
27912
 
27911
27913
  // ../form-fields/dist/esm/ui/form/components/form/create-form-fields.js
27912
27914
  var createFormFields = (_ref) => {
@@ -27936,16 +27938,18 @@ var createFormFields = (_ref) => {
27936
27938
  }
27937
27939
  }, /* @__PURE__ */ React42__namespace.default.createElement(FormViewContext.Provider, {
27938
27940
  value: form
27941
+ }, /* @__PURE__ */ React42__namespace.default.createElement(FormValuesContext.Provider, {
27942
+ value: values
27939
27943
  }, /* @__PURE__ */ React42__namespace.default.createElement(FormField, {
27940
27944
  key: formField.id,
27941
27945
  field: formField,
27942
27946
  values,
27943
27947
  errors,
27944
- onFieldChange,
27945
27948
  onBlur,
27946
27949
  onFocus,
27950
+ onFieldChange,
27947
27951
  FieldLayout
27948
- }))))));
27952
+ })))))));
27949
27953
  return {
27950
27954
  id: formField.id,
27951
27955
  fieldType: formField.fieldType,
@@ -29213,6 +29217,7 @@ var UploadFileFormat3;
29213
29217
  UploadFileFormat4["AUDIO"] = "AUDIO";
29214
29218
  UploadFileFormat4["DOCUMENT"] = "DOCUMENT";
29215
29219
  UploadFileFormat4["ARCHIVE"] = "ARCHIVE";
29220
+ UploadFileFormat4["MODEL_3D"] = "MODEL_3D";
29216
29221
  })(UploadFileFormat3 || (UploadFileFormat3 = {}));
29217
29222
  var PaymentComponentType;
29218
29223
  (function(PaymentComponentType2) {
@@ -29539,6 +29544,8 @@ function takeWixFileInputViewProperties(fileUpload, validation) {
29539
29544
  return "Document";
29540
29545
  case UploadFileFormat3.ARCHIVE:
29541
29546
  return "Archive";
29547
+ case UploadFileFormat3.MODEL_3D:
29548
+ return "Model3D";
29542
29549
  default:
29543
29550
  throw new Error(`Unknown file format: ${format}`);
29544
29551
  }
@@ -31337,8 +31344,7 @@ var getFieldErrors = async (fieldsToValidate, form, addressTemplates, externalDa
31337
31344
  return fieldErrors;
31338
31345
  };
31339
31346
  var findErrorByNormalizedPath = (fieldsToValidate, errorPath) => {
31340
- const path = errorPath.split("/").length > 2 ? errorPath.split("/").at(0) : errorPath;
31341
- return !!fieldsToValidate.find((field) => path === field.path);
31347
+ return !!fieldsToValidate.find((field) => errorPath === field.path || errorPath.startsWith(`${field.path}/`));
31342
31348
  };
31343
31349
  function setValue(object, path, value) {
31344
31350
  const delimiter = "/";
@@ -32829,7 +32835,7 @@ var NORMALIZED_VALUE = {
32829
32835
  [FIELD_TYPES.MLA_STREET_NAME]: acceptStringValue,
32830
32836
  [FIELD_TYPES.MLA_STREET_NUMBER]: acceptStringValue,
32831
32837
  [FIELD_TYPES.MLA_APARTMENT]: acceptStringValue,
32832
- [FIELD_TYPES.FULL_NAME]: acceptObjectValue,
32838
+ [FIELD_TYPES.FULL_NAME]: acceptFullNameValue,
32833
32839
  [FIELD_TYPES.FULL_NAME_FIRST_NAME]: acceptStringValue,
32834
32840
  [FIELD_TYPES.FULL_NAME_LAST_NAME]: acceptStringValue,
32835
32841
  [FIELD_TYPES.VAT_ID]: normalizeVatIDValue,
@@ -33025,6 +33031,10 @@ function acceptObjectValue({ fieldValue }) {
33025
33031
  }
33026
33032
  return typeof fieldValue === "object" ? fieldValue : EMPTY_VALUE;
33027
33033
  }
33034
+ function acceptFullNameValue(args) {
33035
+ const result2 = acceptObjectValue(args);
33036
+ return result2 === EMPTY_VALUE ? {} : result2;
33037
+ }
33028
33038
  function acceptRatingValue({ fieldValue }) {
33029
33039
  const isEmptyValue = fieldValue === 0 || fieldValue === EMPTY_VALUE;
33030
33040
  if (isEmptyValue) {