@wix/form-public 0.160.0 → 0.162.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 +60 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +60 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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, ValidationFormat, ProductType, PriceType, FieldFieldType, StringTypeFormatEnumFormat, InputFieldStringComponentType, NodeType, 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, VerticalAlignmentAlignment, ResponsivenessBehaviour, DesignTarget, ImagePosition, AlignmentEnumAlignment, ImageFit, NumberOfColumns, FirstDayOfWeekEnumFirstDayOfWeek, InputFieldNumberComponentType, InputFieldBooleanComponentType, ArrayItemsItemType, PropertiesTypePropertiesTypeEnum, ArrayComponentType, InputFieldWixFileComponentType, UploadFileFormat, InputFieldPaymentComponentType, AddressComponentType, DefaultCountryConfigType, ObjectArrayComponentType, InputFieldSchedulingComponentType, AppointmentFormat, InputFieldInputType, FormFieldContactInfoEmailInfoTag, FormFieldContactInfoPhoneInfoTag, AddressInfoTag, ConfirmationLevel, FormFieldContactInfoContactField, DisplayFieldDisplayFieldType, OverrideEntityType, Kind, EmailInfoTag, PhoneInfoTag, Tag, OptInLevel, ContactField, SpamFilterProtectionLevel, RequiredIndicator, RequiredIndicatorPlacement, UrlTargetEnumTarget, SubmitSuccessAction, ChangeableProperty, OverrideEntityTypeEnumOverrideEntityType, Operator, ResultsDisplay, Fieldset, SortOrder, CountFormsFieldset, ListFormsOrderEnumListFormsOrder, FilterType, ListFormsOrder, ListDeletedFormsOrder, FieldInputType, WebhookIdentityType;
|
|
73
|
+
var Format, ValidationFormat, ProductType, PriceType, FieldFieldType, StringTypeFormatEnumFormat, InputFieldStringComponentType, NodeType, 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, VerticalAlignmentAlignment, ResponsivenessBehaviour, DesignTarget, ImagePosition, AlignmentEnumAlignment, ImageFit, NumberOfColumns, FirstDayOfWeekEnumFirstDayOfWeek, InputFieldNumberComponentType, InputFieldBooleanComponentType, ArrayItemsItemType, PropertiesTypePropertiesTypeEnum, ArrayComponentType, InputFieldWixFileComponentType, UploadFileFormat, InputFieldPaymentComponentType, AddressComponentType, DefaultCountryConfigType, ObjectArrayComponentType, InputFieldSchedulingComponentType, AppointmentFormat, InputFieldInputType, FormFieldContactInfoEmailInfoTag, FormFieldContactInfoPhoneInfoTag, AddressInfoTag, ConfirmationLevel, 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;
|
|
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) {
|
|
@@ -384,6 +384,10 @@ var init_types_impl = __esm({
|
|
|
384
384
|
LayoutDataImagePosition4["BOTTOM_LEFT"] = "BOTTOM_LEFT";
|
|
385
385
|
LayoutDataImagePosition4["BOTTOM_RIGHT"] = "BOTTOM_RIGHT";
|
|
386
386
|
})(LayoutDataImagePosition || (LayoutDataImagePosition = {}));
|
|
387
|
+
(function(Origin2) {
|
|
388
|
+
Origin2["IMAGE"] = "IMAGE";
|
|
389
|
+
Origin2["LAYOUT"] = "LAYOUT";
|
|
390
|
+
})(Origin || (Origin = {}));
|
|
387
391
|
(function(VerticalAlignmentAlignment5) {
|
|
388
392
|
VerticalAlignmentAlignment5["TOP"] = "TOP";
|
|
389
393
|
VerticalAlignmentAlignment5["MIDDLE"] = "MIDDLE";
|
|
@@ -662,6 +666,11 @@ var init_types_impl = __esm({
|
|
|
662
666
|
ResultsDisplay3["PASSING_STATUS"] = "PASSING_STATUS";
|
|
663
667
|
ResultsDisplay3["SCORE_AND_PASSING_STATUS"] = "SCORE_AND_PASSING_STATUS";
|
|
664
668
|
})(ResultsDisplay || (ResultsDisplay = {}));
|
|
669
|
+
(function(ContactAutofill2) {
|
|
670
|
+
ContactAutofill2["UNKNOWN_CONTACT_AUTOFILL"] = "UNKNOWN_CONTACT_AUTOFILL";
|
|
671
|
+
ContactAutofill2["MEMBER_DATA"] = "MEMBER_DATA";
|
|
672
|
+
ContactAutofill2["FORM_INPUT"] = "FORM_INPUT";
|
|
673
|
+
})(ContactAutofill || (ContactAutofill = {}));
|
|
665
674
|
(function(Fieldset2) {
|
|
666
675
|
Fieldset2["UNKNOWN"] = "UNKNOWN";
|
|
667
676
|
Fieldset2["NESTED_FORMS"] = "NESTED_FORMS";
|
|
@@ -21290,12 +21299,52 @@ var init_get_validation = __esm({
|
|
|
21290
21299
|
}
|
|
21291
21300
|
});
|
|
21292
21301
|
|
|
21302
|
+
// ../form-multiline-address/dist/esm/lib/format-multiline-address.js
|
|
21303
|
+
function formatStreetNumber(streetAddress) {
|
|
21304
|
+
const number = (streetAddress == null ? void 0 : streetAddress.number) || "";
|
|
21305
|
+
const apt = streetAddress != null && streetAddress.apt ? `-${streetAddress.apt}` : "";
|
|
21306
|
+
return number ? `${number}${apt}` : "";
|
|
21307
|
+
}
|
|
21308
|
+
function formatAddressLine(isStreetFormat, streetAddress, addressLine) {
|
|
21309
|
+
if (!isStreetFormat) {
|
|
21310
|
+
return addressLine;
|
|
21311
|
+
}
|
|
21312
|
+
const streetNumber = formatStreetNumber(streetAddress);
|
|
21313
|
+
return `${(streetAddress == null ? void 0 : streetAddress.name) || ""} ${streetNumber}`;
|
|
21314
|
+
}
|
|
21315
|
+
function formatMultilineAddress(submission, options) {
|
|
21316
|
+
const country = import_locale_dataset_javascript2.default.getCountryByShortKey(submission.country);
|
|
21317
|
+
const streetAddress = {
|
|
21318
|
+
name: submission.streetName,
|
|
21319
|
+
number: submission.streetNumber,
|
|
21320
|
+
apt: submission.apartment
|
|
21321
|
+
};
|
|
21322
|
+
const isStreetFormat = Object.values(streetAddress).some(Boolean);
|
|
21323
|
+
const resolvedCountry = country && options != null && options.translateCountry ? options.translateCountry(country.displayName, options.language) : submission.country;
|
|
21324
|
+
const formattedAddress = import_locale_dataset_javascript2.default.getFormattedAddress({
|
|
21325
|
+
country: resolvedCountry,
|
|
21326
|
+
subdivision: submission.subdivision,
|
|
21327
|
+
city: submission.city,
|
|
21328
|
+
zipCode: submission.postalCode,
|
|
21329
|
+
addressLine1: formatAddressLine(isStreetFormat, streetAddress, submission.addressLine),
|
|
21330
|
+
addressLine2: submission.addressLine2
|
|
21331
|
+
}, country == null ? void 0 : country.key);
|
|
21332
|
+
return formattedAddress.replace(/^[\s,]+|[\s,]+$/g, "");
|
|
21333
|
+
}
|
|
21334
|
+
var import_locale_dataset_javascript2;
|
|
21335
|
+
var init_format_multiline_address = __esm({
|
|
21336
|
+
"../form-multiline-address/dist/esm/lib/format-multiline-address.js"() {
|
|
21337
|
+
import_locale_dataset_javascript2 = __toESM(require_index_bundle());
|
|
21338
|
+
}
|
|
21339
|
+
});
|
|
21340
|
+
|
|
21293
21341
|
// ../form-multiline-address/dist/esm/index.js
|
|
21294
21342
|
var esm_exports2 = {};
|
|
21295
21343
|
__export(esm_exports2, {
|
|
21296
21344
|
ADDRESS_FORM_ID_BY_COUNTRY: () => ADDRESS_FORM_ID_BY_COUNTRY,
|
|
21297
21345
|
COUNTRY_CODES: () => COUNTRY_CODES,
|
|
21298
21346
|
MultilineAddressToolkit: () => MultilineAddressToolkit,
|
|
21347
|
+
formatMultilineAddress: () => formatMultilineAddress,
|
|
21299
21348
|
getCountryField: () => getCountryField,
|
|
21300
21349
|
getCountryFieldLayout: () => getCountryFieldLayout,
|
|
21301
21350
|
getMultilineAddressValidation: () => getMultilineAddressValidation,
|
|
@@ -21309,6 +21358,7 @@ var init_esm3 = __esm({
|
|
|
21309
21358
|
init_country_codes();
|
|
21310
21359
|
init_map_subdivision_replaced_by();
|
|
21311
21360
|
init_get_validation();
|
|
21361
|
+
init_format_multiline_address();
|
|
21312
21362
|
}
|
|
21313
21363
|
});
|
|
21314
21364
|
|
|
@@ -32742,12 +32792,12 @@ async function createI18n(locale) {
|
|
|
32742
32792
|
ns: ["translation", FORM_VIEWER_NAMESPACE],
|
|
32743
32793
|
resources: {}
|
|
32744
32794
|
});
|
|
32745
|
-
const [fieldTranslations,
|
|
32795
|
+
const [fieldTranslations, localeDataset4] = await Promise.all([
|
|
32746
32796
|
loadFieldViewerTranslations(locale),
|
|
32747
32797
|
fetchLocaleDatasetTranslations(locale)
|
|
32748
32798
|
]);
|
|
32749
32799
|
i18nInstance.addResources(locale, FORM_VIEWER_NAMESPACE, fieldTranslations);
|
|
32750
|
-
i18nInstance.addResources(locale, FORM_VIEWER_NAMESPACE,
|
|
32800
|
+
i18nInstance.addResources(locale, FORM_VIEWER_NAMESPACE, localeDataset4);
|
|
32751
32801
|
return i18nInstance;
|
|
32752
32802
|
}
|
|
32753
32803
|
var FormProvider = ({
|
|
@@ -36214,14 +36264,14 @@ function useAddressFields(key) {
|
|
|
36214
36264
|
init_esm3();
|
|
36215
36265
|
|
|
36216
36266
|
// ../form-fields/dist/esm/hooks/use-address-label.js
|
|
36217
|
-
var
|
|
36267
|
+
var import_locale_dataset_javascript3 = __toESM(require_index_bundle());
|
|
36218
36268
|
function useAddressLabel(addressPart) {
|
|
36219
36269
|
const {
|
|
36220
36270
|
t
|
|
36221
36271
|
} = useTranslation();
|
|
36222
36272
|
const countryCode = useCountryCode();
|
|
36223
|
-
const country = countryCode &&
|
|
36224
|
-
const addressKeys = country ? country.addressPartDisplayNames :
|
|
36273
|
+
const country = countryCode && import_locale_dataset_javascript3.default.getCountryByShortKey(countryCode);
|
|
36274
|
+
const addressKeys = country ? country.addressPartDisplayNames : import_locale_dataset_javascript3.default.getDefaultAddressDisplayNames();
|
|
36225
36275
|
const labelKey = addressKeys[addressPart];
|
|
36226
36276
|
const label = labelKey ? t(labelKey) : "";
|
|
36227
36277
|
return label;
|
|
@@ -36399,7 +36449,7 @@ Country.Description = Description;
|
|
|
36399
36449
|
Country.Error = Error2;
|
|
36400
36450
|
|
|
36401
36451
|
// ../form-fields/dist/esm/ui/multiline-address-field/headless/subdivision-field-headless.js
|
|
36402
|
-
var
|
|
36452
|
+
var import_locale_dataset_javascript4 = __toESM(require_index_bundle());
|
|
36403
36453
|
init_esm3();
|
|
36404
36454
|
var Subdivision = (_ref) => {
|
|
36405
36455
|
let {
|
|
@@ -36420,7 +36470,7 @@ var Subdivision = (_ref) => {
|
|
|
36420
36470
|
} = useTranslation();
|
|
36421
36471
|
const countryCode = useCountryCode();
|
|
36422
36472
|
const countryCodeAlpha3 = countryCode ? COUNTRY_CODES[countryCode] : void 0;
|
|
36423
|
-
const country = countryCode && (0,
|
|
36473
|
+
const country = countryCode && (0, import_locale_dataset_javascript4.getCountryByShortKey)(countryCode);
|
|
36424
36474
|
const subdivisionOptions = React42.useMemo(() => {
|
|
36425
36475
|
var _country$subdivisions;
|
|
36426
36476
|
const subdivisions = mapSubdivisionReplacedBy((country == null || (_country$subdivisions = country.subdivisions) == null ? void 0 : _country$subdivisions.list) || [], countryCodeAlpha3);
|
|
@@ -38795,7 +38845,7 @@ var valueToNumber = (value) => {
|
|
|
38795
38845
|
init_esm();
|
|
38796
38846
|
|
|
38797
38847
|
// ../form-fields/dist/esm/ui/phone-input-field/phone-input/phone-input-utils.js
|
|
38798
|
-
var
|
|
38848
|
+
var import_locale_dataset_javascript5 = __toESM(require_index_bundle());
|
|
38799
38849
|
function parseCountryCodeFromPhoneNumber(phoneNumber) {
|
|
38800
38850
|
const parsedNumber = phoneNumber ? parsePhoneNumber4(phoneNumber) : void 0;
|
|
38801
38851
|
const parsedCountryCode = parsedNumber == null ? void 0 : parsedNumber.country;
|
|
@@ -38809,7 +38859,7 @@ function parseCountryCodeFromPhoneNumber(phoneNumber) {
|
|
|
38809
38859
|
}
|
|
38810
38860
|
function getCallingCode2(countryCode) {
|
|
38811
38861
|
var _localeDataset$getCou;
|
|
38812
|
-
return countryCode && ((_localeDataset$getCou =
|
|
38862
|
+
return countryCode && ((_localeDataset$getCou = import_locale_dataset_javascript5.default.getCountryByKey(countryCode)) == null ? void 0 : _localeDataset$getCou.dialCode);
|
|
38813
38863
|
}
|
|
38814
38864
|
function parseLocalPhone(value, country) {
|
|
38815
38865
|
if (value && country) {
|