@wix/form-public 0.190.0 → 0.191.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.js CHANGED
@@ -29193,6 +29193,7 @@ var UploadEnabledKey = "uploadEnabled";
29193
29193
  var FirstDayOfWeekKey = "firstDayOfWeek";
29194
29194
  var DefaultCountryCodeKey = "defaultCountry";
29195
29195
  var ImageResizeKey = "imageResize";
29196
+ var ChoiceImageResizeKey = "choiceImageResize";
29196
29197
  var ShowFlagKey = "showFlag";
29197
29198
  var NameKey = "name";
29198
29199
  var DurationKey = "duration";
@@ -29203,6 +29204,8 @@ var FormatDescriptionTypeKey = "formatDescriptionType";
29203
29204
  var LocationTypeKey = "locationType";
29204
29205
  var FormatDescriptionKey = "formatDescription";
29205
29206
  var LocationIdsKey = "locationIds";
29207
+ var MeetingTypeKey = "meetingType";
29208
+ var StaffStrategySelectionKey = "staffStrategySelection";
29206
29209
  var RepeaterFieldsKey = "fields";
29207
29210
  var RepeaterLayoutKey = "layout";
29208
29211
  var ScoreKey = "score";
@@ -29314,9 +29317,10 @@ function resolveArrayComponent(arrayComponent) {
29314
29317
  }
29315
29318
  }
29316
29319
  function takeCheckboxGroupViewProperties(checkboxGroup) {
29320
+ var _checkboxGroup$mediaS;
29317
29321
  return {
29318
29322
  [HideLabelKey]: !checkboxGroup.showLabel,
29319
- [AddOtherKey]: checkboxGroup.customOption != null,
29323
+ [AddOtherKey]: !!checkboxGroup.customOption,
29320
29324
  [OptionsKey]: checkboxGroup.options.map((option) => makeOptionView(option)),
29321
29325
  [NumberOfColumnsKey]: numericNumberOfColumns(checkboxGroup.numberOfColumns ?? NumberOfColumns3.ONE),
29322
29326
  [DefaultValueKey]: checkboxGroup.options.filter((option) => option.default).map((option) => option.value),
@@ -29329,13 +29333,16 @@ function takeCheckboxGroupViewProperties(checkboxGroup) {
29329
29333
  ...checkboxGroup.customOption && {
29330
29334
  [AddOtherLabelKey]: checkboxGroup.customOption.label,
29331
29335
  [AddOtherPlaceholderKey]: checkboxGroup.customOption.placeholder
29336
+ },
29337
+ ...((_checkboxGroup$mediaS = checkboxGroup.mediaSettings) == null ? void 0 : _checkboxGroup$mediaS.imageFit) && {
29338
+ [ChoiceImageResizeKey]: checkboxGroup.mediaSettings.imageFit === ImageFit3.CONTAIN ? "contain" : "cover"
29332
29339
  }
29333
29340
  };
29334
29341
  }
29335
29342
  function takeTagsViewProperties(tags) {
29336
29343
  return {
29337
29344
  [HideLabelKey]: !tags.showLabel,
29338
- [AddOtherKey]: tags.customOption != null,
29345
+ [AddOtherKey]: !!tags.customOption,
29339
29346
  [OptionsKey]: tags.options.map((option) => makeOptionView(option)),
29340
29347
  [NumberOfColumnsKey]: numericNumberOfColumns(tags.numberOfColumns ?? NumberOfColumns3.ONE),
29341
29348
  [DefaultValueKey]: tags.options.filter((option) => option.default).map((option) => option.value),
@@ -29409,6 +29416,9 @@ function takeNumberInputViewProperties(numberInput) {
29409
29416
  },
29410
29417
  ...numberInput.placeholder && {
29411
29418
  [PlaceholderKey]: numberInput.placeholder
29419
+ },
29420
+ ...typeof numberInput.default === "number" && {
29421
+ [DefaultValueKey]: numberInput.default
29412
29422
  }
29413
29423
  };
29414
29424
  }
@@ -29494,6 +29504,9 @@ function takeTextInputViewProperties(textInput) {
29494
29504
  },
29495
29505
  ...textInput.placeholder && {
29496
29506
  [PlaceholderKey]: textInput.placeholder
29507
+ },
29508
+ ...textInput.default && {
29509
+ [DefaultValueKey]: textInput.default
29497
29510
  }
29498
29511
  };
29499
29512
  }
@@ -29508,6 +29521,9 @@ function takePasswordViewProperties(password) {
29508
29521
  },
29509
29522
  ...password.placeholder && {
29510
29523
  [PlaceholderKey]: password.placeholder
29524
+ },
29525
+ ...password.default && {
29526
+ [DefaultValueKey]: password.default
29511
29527
  }
29512
29528
  };
29513
29529
  }
@@ -29516,7 +29532,7 @@ function takeRadioGroupViewProperties(radioGroup) {
29516
29532
  const options = radioGroup.options ?? [];
29517
29533
  return {
29518
29534
  [HideLabelKey]: !radioGroup.showLabel,
29519
- [AddOtherKey]: radioGroup.customOption != null,
29535
+ [AddOtherKey]: !!radioGroup.customOption,
29520
29536
  [NumberOfColumnsKey]: numericNumberOfColumns(radioGroup.numberOfColumns ?? NumberOfColumns3.ONE),
29521
29537
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29522
29538
  ...radioGroup.description && {
@@ -29539,7 +29555,7 @@ function takeDropdownViewProperties(dropdown) {
29539
29555
  const options = dropdown.options ?? [];
29540
29556
  return {
29541
29557
  [HideLabelKey]: !dropdown.showLabel,
29542
- [AddOtherKey]: dropdown.customOption != null,
29558
+ [AddOtherKey]: !!dropdown.customOption,
29543
29559
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29544
29560
  ...dropdown.description && {
29545
29561
  [DescriptionKey]: dropdown.description
@@ -29570,6 +29586,9 @@ function takeDateTimeViewProperties(dateTimeInput) {
29570
29586
  ...dateTimeInput.label && {
29571
29587
  [LabelKey]: dateTimeInput.label
29572
29588
  },
29589
+ ...dateTimeInput.default && {
29590
+ [DefaultValueKey]: dateTimeInput.default
29591
+ },
29573
29592
  [Use24HourFormatKey]: dateTimeInput == null ? void 0 : dateTimeInput.use24HourFormat
29574
29593
  };
29575
29594
  }
@@ -29583,6 +29602,9 @@ function takeDateInputViewProperties(dateInput) {
29583
29602
  },
29584
29603
  ...dateInput.label && {
29585
29604
  [LabelKey]: dateInput.label
29605
+ },
29606
+ ...dateInput.default && {
29607
+ [DefaultValueKey]: dateInput.default
29586
29608
  }
29587
29609
  };
29588
29610
  }
@@ -29596,6 +29618,9 @@ function takeTimeInputViewProperties(timeInput) {
29596
29618
  ...timeInput.label && {
29597
29619
  [LabelKey]: timeInput.label
29598
29620
  },
29621
+ ...timeInput.default && {
29622
+ [DefaultValueKey]: timeInput.default
29623
+ },
29599
29624
  [Use24HourFormatKey]: timeInput.use24HourFormat
29600
29625
  };
29601
29626
  }
@@ -29611,6 +29636,9 @@ function takeDatePickerViewProperties(datePicker) {
29611
29636
  ...datePicker.label && {
29612
29637
  [LabelKey]: datePicker.label
29613
29638
  },
29639
+ ...datePicker.default && {
29640
+ [DefaultValueKey]: datePicker.default
29641
+ },
29614
29642
  [FirstDayOfWeekKey]: datePicker == null ? void 0 : datePicker.firstDayOfWeek
29615
29643
  };
29616
29644
  }
@@ -29636,6 +29664,7 @@ function takeServiceDropdownViewProperties(servicesDropdownOptions) {
29636
29664
  const options = servicesDropdownOptions.options ?? [];
29637
29665
  return {
29638
29666
  [HideLabelKey]: !servicesDropdownOptions.showLabel,
29667
+ [AddOtherKey]: !!servicesDropdownOptions.customOption,
29639
29668
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29640
29669
  ...servicesDropdownOptions.label && {
29641
29670
  [LabelKey]: servicesDropdownOptions.label
@@ -29689,6 +29718,11 @@ function takeMultilineAddressViewProperties(multilineAddress) {
29689
29718
  hideLabel: !showLabel
29690
29719
  };
29691
29720
  }
29721
+ var staffStrategyV2toV1 = {
29722
+ [StaffStrategySelection3.AUTOMATIC]: "AUTOMATIC",
29723
+ [StaffStrategySelection3.HIGH_TO_LOW_PRIORITY]: "PRIORITY_HIGH_TO_LOW",
29724
+ [StaffStrategySelection3.LOW_TO_HIGH_PRIORITY]: "PRIORITY_LOW_TO_HIGH"
29725
+ };
29692
29726
  function takeAppointmentViewProperties(appointmentOptions) {
29693
29727
  const {
29694
29728
  label,
@@ -29699,6 +29733,8 @@ function takeAppointmentViewProperties(appointmentOptions) {
29699
29733
  format,
29700
29734
  description,
29701
29735
  showLabel,
29736
+ meetingType,
29737
+ staffStrategySelection,
29702
29738
  phoneOptions,
29703
29739
  videoConferenceOptions,
29704
29740
  inPersonOptions
@@ -29725,6 +29761,12 @@ function takeAppointmentViewProperties(appointmentOptions) {
29725
29761
  [FormatKey]: format,
29726
29762
  [FormatDescriptionTypeKey]: format,
29727
29763
  [StaffIdsKey]: staffIds,
29764
+ ...meetingType && {
29765
+ [MeetingTypeKey]: meetingType
29766
+ },
29767
+ ...staffStrategySelection && {
29768
+ [StaffStrategySelectionKey]: staffStrategyV2toV1[staffStrategySelection] ?? staffStrategySelection
29769
+ },
29728
29770
  ...transformFormatInfoToView(inPersonOptions, videoConferenceOptions, phoneOptions)
29729
29771
  };
29730
29772
  }
@@ -29765,7 +29807,7 @@ function takeDonationsInputViewProperties(donationInput) {
29765
29807
  const options = donationInput.options ?? [];
29766
29808
  return {
29767
29809
  [HideLabelKey]: !donationInput.showLabel,
29768
- [AddOtherKey]: donationInput.customOption != null,
29810
+ [AddOtherKey]: !!donationInput.customOption,
29769
29811
  [NumberOfColumnsKey]: numericNumberOfColumns(donationInput.numberOfColumns ?? NumberOfColumns3.ONE),
29770
29812
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29771
29813
  ...donationInput.description && {
@@ -29805,6 +29847,9 @@ function takePaymentInputViewProperties(paymentInput) {
29805
29847
  },
29806
29848
  ...paymentInput.placeholder && {
29807
29849
  [PlaceholderKey]: paymentInput.placeholder
29850
+ },
29851
+ ...typeof paymentInput.default === "number" && {
29852
+ [DefaultValueKey]: paymentInput.default
29808
29853
  }
29809
29854
  };
29810
29855
  }