@wix/form-public 0.198.0 → 0.200.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 +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -22306,6 +22306,7 @@ var require_messages_en = __commonJS({
|
|
|
22306
22306
|
"dext-url-input.input.error.message.required-error": "Enter a web URL like https://www.example.com.",
|
|
22307
22307
|
"contacts-date-input.input.error.message.format-error": "Enter a month, day and year.",
|
|
22308
22308
|
"signature.input.error.message.required-error.with-upload": "Sign in the box above or upload your signature.",
|
|
22309
|
+
"forms.widget.modals.show-password-tooltip": "Show password",
|
|
22309
22310
|
"contacts-phone.input.error.message.required-error": "Enter a phone number.",
|
|
22310
22311
|
"field.phone.country-selector-button.aria-label": "Select a country code",
|
|
22311
22312
|
"field-context-menu.move-up": "Move up",
|
|
@@ -22351,7 +22352,9 @@ var require_messages_en = __commonJS({
|
|
|
22351
22352
|
"bookings-phone.input.error.message.required-error": "Enter a phone number.",
|
|
22352
22353
|
"form.file-upload.explanation-text": "{count, plural, =1 {# file} other {# files}} uploaded",
|
|
22353
22354
|
"settings.scheduling.meeting-type.info-icon.intro": "How hosts are assigned:",
|
|
22355
|
+
"pikachu.input.error.message.required-error": "Choose an option.",
|
|
22354
22356
|
"contacts-last-name.input.error.message.required-error": "Enter a last name.",
|
|
22357
|
+
"forms.widget.modals.hide-password-tooltip": "Hide password",
|
|
22355
22358
|
"field.signature.mode.selector.aria-label": "Signature input mode",
|
|
22356
22359
|
"phone.input.error.message.not-allowed-value": "Phone numbers with this country code aren't accepted.",
|
|
22357
22360
|
"field.signature.mode.draw.label": "Draw",
|
|
@@ -29426,12 +29429,29 @@ function takeTagsViewProperties(tags) {
|
|
|
29426
29429
|
}
|
|
29427
29430
|
};
|
|
29428
29431
|
}
|
|
29429
|
-
function
|
|
29432
|
+
function makePaymentDefaultValue(options, paymentValidation) {
|
|
29433
|
+
const products = (paymentValidation == null ? void 0 : paymentValidation.products) ?? [];
|
|
29434
|
+
const result2 = options.filter((option) => option.default).map((option) => {
|
|
29435
|
+
var _product$fixedPriceOp;
|
|
29436
|
+
const product = products.find((p) => p.id === option.value);
|
|
29437
|
+
const price = (product == null ? void 0 : product.priceType) === PriceType4.FIXED_PRICE ? (_product$fixedPriceOp = product.fixedPriceOptions) == null ? void 0 : _product$fixedPriceOp.price : "0";
|
|
29438
|
+
return {
|
|
29439
|
+
productId: option.value,
|
|
29440
|
+
price: price ?? "0",
|
|
29441
|
+
quantity: 1
|
|
29442
|
+
};
|
|
29443
|
+
});
|
|
29444
|
+
return result2.length > 0 ? result2 : void 0;
|
|
29445
|
+
}
|
|
29446
|
+
function takeProductCheckboxGroupViewProperties(checkboxGroup, paymentValidation) {
|
|
29447
|
+
const defaultValue = makePaymentDefaultValue(checkboxGroup.options, paymentValidation);
|
|
29430
29448
|
return {
|
|
29431
29449
|
[HideLabelKey]: !checkboxGroup.showLabel,
|
|
29432
29450
|
[ImageResizeKey]: checkboxGroup.imageFit === ImageFit3.CONTAIN ? "FIT" : "CROP",
|
|
29433
29451
|
[OptionsKey]: checkboxGroup.options.map((option) => makeOptionView(option)),
|
|
29434
|
-
|
|
29452
|
+
...defaultValue && {
|
|
29453
|
+
[DefaultValueKey]: defaultValue
|
|
29454
|
+
},
|
|
29435
29455
|
...checkboxGroup.description && {
|
|
29436
29456
|
[DescriptionKey]: checkboxGroup.description
|
|
29437
29457
|
},
|
|
@@ -29749,9 +29769,9 @@ function takeServiceDropdownViewProperties(servicesDropdownOptions) {
|
|
|
29749
29769
|
function resolvePaymentComponent(paymentComponent) {
|
|
29750
29770
|
switch (paymentComponent.componentType) {
|
|
29751
29771
|
case PaymentComponentType.CHECKBOX_GROUP:
|
|
29752
|
-
return takeProductCheckboxGroupViewProperties(paymentComponent.checkboxGroupOptions);
|
|
29772
|
+
return takeProductCheckboxGroupViewProperties(paymentComponent.checkboxGroupOptions, paymentComponent.validation);
|
|
29753
29773
|
case PaymentComponentType.DONATION_INPUT:
|
|
29754
|
-
return takeDonationsInputViewProperties(paymentComponent.donationInputOptions);
|
|
29774
|
+
return takeDonationsInputViewProperties(paymentComponent.donationInputOptions, paymentComponent.validation);
|
|
29755
29775
|
case PaymentComponentType.FIXED_PAYMENT:
|
|
29756
29776
|
return takeFixedPaymentViewProperties(paymentComponent.fixedPaymentOptions);
|
|
29757
29777
|
case PaymentComponentType.PAYMENT_INPUT:
|
|
@@ -29870,9 +29890,9 @@ function transformFormatInfoToView(inPersonOptions, videoConferenceOptions, phon
|
|
|
29870
29890
|
}
|
|
29871
29891
|
return {};
|
|
29872
29892
|
}
|
|
29873
|
-
function takeDonationsInputViewProperties(donationInput) {
|
|
29874
|
-
var _options$find3;
|
|
29893
|
+
function takeDonationsInputViewProperties(donationInput, paymentValidation) {
|
|
29875
29894
|
const options = donationInput.options ?? [];
|
|
29895
|
+
const defaultValue = makePaymentDefaultValue(options, paymentValidation);
|
|
29876
29896
|
return {
|
|
29877
29897
|
[HideLabelKey]: !donationInput.showLabel,
|
|
29878
29898
|
[AddOtherKey]: !!donationInput.customOption,
|
|
@@ -29888,8 +29908,8 @@ function takeDonationsInputViewProperties(donationInput) {
|
|
|
29888
29908
|
[AddOtherLabelKey]: donationInput.customOption.label,
|
|
29889
29909
|
[AddOtherPlaceholderKey]: donationInput.customOption.placeholder
|
|
29890
29910
|
},
|
|
29891
|
-
...
|
|
29892
|
-
[DefaultValueKey]:
|
|
29911
|
+
...defaultValue && {
|
|
29912
|
+
[DefaultValueKey]: defaultValue
|
|
29893
29913
|
}
|
|
29894
29914
|
};
|
|
29895
29915
|
}
|