@wix/form-public 0.209.0 → 0.211.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
@@ -70,7 +70,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
70
70
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
71
71
 
72
72
  // ../../node_modules/@wix/ambassador-forms-v4-form/es/build/types.impl.js
73
- var Format, DayOfWeek, ValidationFormat, ProductType, PriceType, PropertiesTypeEnum, FieldFieldType, StringTypeFormatEnumFormat, InputFieldStringComponentType, NodeType, StylesBackgroundType, GradientType, WidthType, PluginContainerDataAlignment, Type, Target, TextAlignment, LineStyle, Width, Alignment, ViewMode, LayoutType, Orientation, Crop, ThumbnailsAlignment, GIFType, Source, Position, MapType, ViewRole, VoteRole, PollLayoutType, PollLayoutDirection, BackgroundType, DecorationType, FontType, ImageStylesPosition, AspectRatio, Resizing, Placement, CardStylesType, CardStylesAlignment, CardStylesLayout, AppType, InitialExpandedItems, Direction, VerticalAlignment, NullValue, Scaling, LayoutDataImagePosition, Origin, LayoutDataBackgroundType, BackdropType, VerticalAlignmentAlignment, ResponsivenessBehaviour, DesignTarget, ImageScalingScaling, ImagePositionPosition, CardDataBackgroundType, ListStyle, Indentation, ImagePosition, AlignmentEnumAlignment, ImageFit, NumberOfColumns, FirstDayOfWeekEnumFirstDayOfWeek, InputFieldNumberComponentType, InputFieldBooleanComponentType, ArrayItemsItemType, PropertiesTypePropertiesTypeEnum, ArrayComponentType, InputFieldWixFileComponentType, UploadFileFormat, InputFieldPaymentComponentType, AddressComponentType, DefaultCountryConfigType, ObjectArrayComponentType, InputFieldSchedulingComponentType, AppointmentFormat, MeetingType, StaffStrategySelection, InputFieldInputType, FormFieldContactInfoEmailInfoTag, FormFieldContactInfoPhoneInfoTag, AddressInfoTag, ConfirmationLevel, SubscriptionChannel, FormFieldContactInfoContactField, DisplayFieldDisplayFieldType, OverrideEntityType, Kind, EmailInfoTag, PhoneInfoTag, Tag, OptInLevel, ContactField, SpamFilterProtectionLevel, RequiredIndicator, RequiredIndicatorPlacement, UrlTargetEnumTarget, SubmitSuccessAction, ChangeableProperty, OverrideEntityTypeEnumOverrideEntityType, Operator, ResultsDisplay, ContactAutofill, Fieldset, SortOrder, CountFormsFieldset, ListFormsOrderEnumListFormsOrder, FilterType, ListFormsOrder, ListDeletedFormsOrder, FieldInputType, WebhookIdentityType;
73
+ var Format, DayOfWeek, ValidationFormat, ProductType, PriceType, PropertiesTypeEnum, FieldFieldType, StringTypeFormatEnumFormat, InputFieldStringComponentType, NodeType, StylesBackgroundType, GradientType, WidthType, PluginContainerDataAlignment, Type, Target, TextAlignment, LineStyle, Width, Alignment, ViewMode, LayoutType, Orientation, Crop, ThumbnailsAlignment, GIFType, Source, Position, MapType, ViewRole, VoteRole, PollLayoutType, PollLayoutDirection, BackgroundType, DecorationType, FontType, ImageStylesPosition, AspectRatio, Resizing, Placement, CardStylesType, CardStylesAlignment, CardStylesLayout, AppType, InitialExpandedItems, Direction, VerticalAlignment, NullValue, Scaling, LayoutDataImagePosition, Origin, LayoutDataBackgroundType, BackdropType, VerticalAlignmentAlignment, ResponsivenessBehaviour, DesignTarget, ImageScalingScaling, ImagePositionPosition, CardDataBackgroundType, ListStyle, Indentation, ImagePosition, AlignmentEnumAlignment, ImageFit, NumberOfColumns, FirstDayOfWeekEnumFirstDayOfWeek, InputFieldNumberComponentType, InputFieldBooleanComponentType, ArrayItemsItemType, PropertiesTypePropertiesTypeEnum, ArrayComponentType, InputFieldWixFileComponentType, UploadFileFormat, InputFieldPaymentComponentType, AddressComponentType, DefaultCountryConfigType, ObjectArrayComponentType, InputFieldSchedulingComponentType, AppointmentFormat, MeetingType, StaffStrategySelection, InputFieldInputType, FormFieldContactInfoEmailInfoTag, FormFieldContactInfoPhoneInfoTag, AddressInfoTag, ConfirmationLevel, SubscriptionChannel, FormFieldContactInfoContactField, DisplayFieldDisplayFieldType, OverrideEntityType, Kind, EmailInfoTag, PhoneInfoTag, Tag, OptInLevel, ContactField, SpamFilterProtectionLevel, RequiredIndicator, RequiredIndicatorPlacement, UrlTargetEnumTarget, SubmitSuccessAction, ChangeableProperty, OverrideEntityTypeEnumOverrideEntityType, Operator, ResultsDisplay, ContactAutofill, SubmissionAccess, Fieldset, SortOrder, CountFormsFieldset, ListFormsOrderEnumListFormsOrder, FilterType, ListFormsOrder, ListDeletedFormsOrder, FieldInputType, WebhookIdentityType;
74
74
  var init_types_impl = __esm({
75
75
  "../../node_modules/@wix/ambassador-forms-v4-form/es/build/types.impl.js"() {
76
76
  (function(Format6) {
@@ -704,6 +704,7 @@ var init_types_impl = __esm({
704
704
  SubmitSuccessAction5["NO_ACTION"] = "NO_ACTION";
705
705
  SubmitSuccessAction5["THANK_YOU_MESSAGE"] = "THANK_YOU_MESSAGE";
706
706
  SubmitSuccessAction5["REDIRECT"] = "REDIRECT";
707
+ SubmitSuccessAction5["POPUP"] = "POPUP";
707
708
  })(SubmitSuccessAction || (SubmitSuccessAction = {}));
708
709
  (function(ChangeableProperty4) {
709
710
  ChangeableProperty4["UNKNOWN_CHANGEABLE_PROPERTY"] = "UNKNOWN_CHANGEABLE_PROPERTY";
@@ -756,6 +757,12 @@ var init_types_impl = __esm({
756
757
  ContactAutofill5["MEMBER_DATA"] = "MEMBER_DATA";
757
758
  ContactAutofill5["FORM_INPUT"] = "FORM_INPUT";
758
759
  })(ContactAutofill || (ContactAutofill = {}));
760
+ (function(SubmissionAccess2) {
761
+ SubmissionAccess2["UNKNOWN_SUBMISSION_ACCESS"] = "UNKNOWN_SUBMISSION_ACCESS";
762
+ SubmissionAccess2["OWNER_AND_COLLABORATORS"] = "OWNER_AND_COLLABORATORS";
763
+ SubmissionAccess2["MEMBERS"] = "MEMBERS";
764
+ SubmissionAccess2["PUBLIC"] = "PUBLIC";
765
+ })(SubmissionAccess || (SubmissionAccess = {}));
759
766
  (function(Fieldset2) {
760
767
  Fieldset2["UNKNOWN"] = "UNKNOWN";
761
768
  Fieldset2["NESTED_FORMS"] = "NESTED_FORMS";
@@ -27908,6 +27915,7 @@ function useFormView() {
27908
27915
  }
27909
27916
  return context;
27910
27917
  }
27918
+ var FormValuesContext = /* @__PURE__ */ React42.createContext(void 0);
27911
27919
 
27912
27920
  // ../form-fields/dist/esm/ui/form/components/form/create-form-fields.js
27913
27921
  var createFormFields = (_ref) => {
@@ -27937,16 +27945,18 @@ var createFormFields = (_ref) => {
27937
27945
  }
27938
27946
  }, /* @__PURE__ */ React42__namespace.default.createElement(FormViewContext.Provider, {
27939
27947
  value: form
27948
+ }, /* @__PURE__ */ React42__namespace.default.createElement(FormValuesContext.Provider, {
27949
+ value: values
27940
27950
  }, /* @__PURE__ */ React42__namespace.default.createElement(FormField, {
27941
27951
  key: formField.id,
27942
27952
  field: formField,
27943
27953
  values,
27944
27954
  errors,
27945
- onFieldChange,
27946
27955
  onBlur,
27947
27956
  onFocus,
27957
+ onFieldChange,
27948
27958
  FieldLayout
27949
- }))))));
27959
+ })))))));
27950
27960
  return {
27951
27961
  id: formField.id,
27952
27962
  fieldType: formField.fieldType,
@@ -31341,8 +31351,7 @@ var getFieldErrors = async (fieldsToValidate, form, addressTemplates, externalDa
31341
31351
  return fieldErrors;
31342
31352
  };
31343
31353
  var findErrorByNormalizedPath = (fieldsToValidate, errorPath) => {
31344
- const path = errorPath.split("/").length > 2 ? errorPath.split("/").at(0) : errorPath;
31345
- return !!fieldsToValidate.find((field) => path === field.path);
31354
+ return !!fieldsToValidate.find((field) => errorPath === field.path || errorPath.startsWith(`${field.path}/`));
31346
31355
  };
31347
31356
  function setValue(object, path, value) {
31348
31357
  const delimiter = "/";
@@ -32833,7 +32842,7 @@ var NORMALIZED_VALUE = {
32833
32842
  [FIELD_TYPES.MLA_STREET_NAME]: acceptStringValue,
32834
32843
  [FIELD_TYPES.MLA_STREET_NUMBER]: acceptStringValue,
32835
32844
  [FIELD_TYPES.MLA_APARTMENT]: acceptStringValue,
32836
- [FIELD_TYPES.FULL_NAME]: acceptObjectValue,
32845
+ [FIELD_TYPES.FULL_NAME]: acceptFullNameValue,
32837
32846
  [FIELD_TYPES.FULL_NAME_FIRST_NAME]: acceptStringValue,
32838
32847
  [FIELD_TYPES.FULL_NAME_LAST_NAME]: acceptStringValue,
32839
32848
  [FIELD_TYPES.VAT_ID]: normalizeVatIDValue,
@@ -33029,6 +33038,10 @@ function acceptObjectValue({ fieldValue }) {
33029
33038
  }
33030
33039
  return typeof fieldValue === "object" ? fieldValue : EMPTY_VALUE;
33031
33040
  }
33041
+ function acceptFullNameValue(args) {
33042
+ const result2 = acceptObjectValue(args);
33043
+ return result2 === EMPTY_VALUE ? {} : result2;
33044
+ }
33032
33045
  function acceptRatingValue({ fieldValue }) {
33033
33046
  const isEmptyValue = fieldValue === 0 || fieldValue === EMPTY_VALUE;
33034
33047
  if (isEmptyValue) {