@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.cjs CHANGED
@@ -29219,6 +29219,7 @@ var UploadEnabledKey = "uploadEnabled";
29219
29219
  var FirstDayOfWeekKey = "firstDayOfWeek";
29220
29220
  var DefaultCountryCodeKey = "defaultCountry";
29221
29221
  var ImageResizeKey = "imageResize";
29222
+ var ChoiceImageResizeKey = "choiceImageResize";
29222
29223
  var ShowFlagKey = "showFlag";
29223
29224
  var NameKey = "name";
29224
29225
  var DurationKey = "duration";
@@ -29229,6 +29230,8 @@ var FormatDescriptionTypeKey = "formatDescriptionType";
29229
29230
  var LocationTypeKey = "locationType";
29230
29231
  var FormatDescriptionKey = "formatDescription";
29231
29232
  var LocationIdsKey = "locationIds";
29233
+ var MeetingTypeKey = "meetingType";
29234
+ var StaffStrategySelectionKey = "staffStrategySelection";
29232
29235
  var RepeaterFieldsKey = "fields";
29233
29236
  var RepeaterLayoutKey = "layout";
29234
29237
  var ScoreKey = "score";
@@ -29340,9 +29343,10 @@ function resolveArrayComponent(arrayComponent) {
29340
29343
  }
29341
29344
  }
29342
29345
  function takeCheckboxGroupViewProperties(checkboxGroup) {
29346
+ var _checkboxGroup$mediaS;
29343
29347
  return {
29344
29348
  [HideLabelKey]: !checkboxGroup.showLabel,
29345
- [AddOtherKey]: checkboxGroup.customOption != null,
29349
+ [AddOtherKey]: !!checkboxGroup.customOption,
29346
29350
  [OptionsKey]: checkboxGroup.options.map((option) => makeOptionView(option)),
29347
29351
  [NumberOfColumnsKey]: numericNumberOfColumns(checkboxGroup.numberOfColumns ?? NumberOfColumns3.ONE),
29348
29352
  [DefaultValueKey]: checkboxGroup.options.filter((option) => option.default).map((option) => option.value),
@@ -29355,13 +29359,16 @@ function takeCheckboxGroupViewProperties(checkboxGroup) {
29355
29359
  ...checkboxGroup.customOption && {
29356
29360
  [AddOtherLabelKey]: checkboxGroup.customOption.label,
29357
29361
  [AddOtherPlaceholderKey]: checkboxGroup.customOption.placeholder
29362
+ },
29363
+ ...((_checkboxGroup$mediaS = checkboxGroup.mediaSettings) == null ? void 0 : _checkboxGroup$mediaS.imageFit) && {
29364
+ [ChoiceImageResizeKey]: checkboxGroup.mediaSettings.imageFit === ImageFit3.CONTAIN ? "contain" : "cover"
29358
29365
  }
29359
29366
  };
29360
29367
  }
29361
29368
  function takeTagsViewProperties(tags) {
29362
29369
  return {
29363
29370
  [HideLabelKey]: !tags.showLabel,
29364
- [AddOtherKey]: tags.customOption != null,
29371
+ [AddOtherKey]: !!tags.customOption,
29365
29372
  [OptionsKey]: tags.options.map((option) => makeOptionView(option)),
29366
29373
  [NumberOfColumnsKey]: numericNumberOfColumns(tags.numberOfColumns ?? NumberOfColumns3.ONE),
29367
29374
  [DefaultValueKey]: tags.options.filter((option) => option.default).map((option) => option.value),
@@ -29435,6 +29442,9 @@ function takeNumberInputViewProperties(numberInput) {
29435
29442
  },
29436
29443
  ...numberInput.placeholder && {
29437
29444
  [PlaceholderKey]: numberInput.placeholder
29445
+ },
29446
+ ...typeof numberInput.default === "number" && {
29447
+ [DefaultValueKey]: numberInput.default
29438
29448
  }
29439
29449
  };
29440
29450
  }
@@ -29520,6 +29530,9 @@ function takeTextInputViewProperties(textInput) {
29520
29530
  },
29521
29531
  ...textInput.placeholder && {
29522
29532
  [PlaceholderKey]: textInput.placeholder
29533
+ },
29534
+ ...textInput.default && {
29535
+ [DefaultValueKey]: textInput.default
29523
29536
  }
29524
29537
  };
29525
29538
  }
@@ -29534,6 +29547,9 @@ function takePasswordViewProperties(password) {
29534
29547
  },
29535
29548
  ...password.placeholder && {
29536
29549
  [PlaceholderKey]: password.placeholder
29550
+ },
29551
+ ...password.default && {
29552
+ [DefaultValueKey]: password.default
29537
29553
  }
29538
29554
  };
29539
29555
  }
@@ -29542,7 +29558,7 @@ function takeRadioGroupViewProperties(radioGroup) {
29542
29558
  const options = radioGroup.options ?? [];
29543
29559
  return {
29544
29560
  [HideLabelKey]: !radioGroup.showLabel,
29545
- [AddOtherKey]: radioGroup.customOption != null,
29561
+ [AddOtherKey]: !!radioGroup.customOption,
29546
29562
  [NumberOfColumnsKey]: numericNumberOfColumns(radioGroup.numberOfColumns ?? NumberOfColumns3.ONE),
29547
29563
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29548
29564
  ...radioGroup.description && {
@@ -29565,7 +29581,7 @@ function takeDropdownViewProperties(dropdown) {
29565
29581
  const options = dropdown.options ?? [];
29566
29582
  return {
29567
29583
  [HideLabelKey]: !dropdown.showLabel,
29568
- [AddOtherKey]: dropdown.customOption != null,
29584
+ [AddOtherKey]: !!dropdown.customOption,
29569
29585
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29570
29586
  ...dropdown.description && {
29571
29587
  [DescriptionKey]: dropdown.description
@@ -29596,6 +29612,9 @@ function takeDateTimeViewProperties(dateTimeInput) {
29596
29612
  ...dateTimeInput.label && {
29597
29613
  [LabelKey]: dateTimeInput.label
29598
29614
  },
29615
+ ...dateTimeInput.default && {
29616
+ [DefaultValueKey]: dateTimeInput.default
29617
+ },
29599
29618
  [Use24HourFormatKey]: dateTimeInput == null ? void 0 : dateTimeInput.use24HourFormat
29600
29619
  };
29601
29620
  }
@@ -29609,6 +29628,9 @@ function takeDateInputViewProperties(dateInput) {
29609
29628
  },
29610
29629
  ...dateInput.label && {
29611
29630
  [LabelKey]: dateInput.label
29631
+ },
29632
+ ...dateInput.default && {
29633
+ [DefaultValueKey]: dateInput.default
29612
29634
  }
29613
29635
  };
29614
29636
  }
@@ -29622,6 +29644,9 @@ function takeTimeInputViewProperties(timeInput) {
29622
29644
  ...timeInput.label && {
29623
29645
  [LabelKey]: timeInput.label
29624
29646
  },
29647
+ ...timeInput.default && {
29648
+ [DefaultValueKey]: timeInput.default
29649
+ },
29625
29650
  [Use24HourFormatKey]: timeInput.use24HourFormat
29626
29651
  };
29627
29652
  }
@@ -29637,6 +29662,9 @@ function takeDatePickerViewProperties(datePicker) {
29637
29662
  ...datePicker.label && {
29638
29663
  [LabelKey]: datePicker.label
29639
29664
  },
29665
+ ...datePicker.default && {
29666
+ [DefaultValueKey]: datePicker.default
29667
+ },
29640
29668
  [FirstDayOfWeekKey]: datePicker == null ? void 0 : datePicker.firstDayOfWeek
29641
29669
  };
29642
29670
  }
@@ -29662,6 +29690,7 @@ function takeServiceDropdownViewProperties(servicesDropdownOptions) {
29662
29690
  const options = servicesDropdownOptions.options ?? [];
29663
29691
  return {
29664
29692
  [HideLabelKey]: !servicesDropdownOptions.showLabel,
29693
+ [AddOtherKey]: !!servicesDropdownOptions.customOption,
29665
29694
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29666
29695
  ...servicesDropdownOptions.label && {
29667
29696
  [LabelKey]: servicesDropdownOptions.label
@@ -29715,6 +29744,11 @@ function takeMultilineAddressViewProperties(multilineAddress) {
29715
29744
  hideLabel: !showLabel
29716
29745
  };
29717
29746
  }
29747
+ var staffStrategyV2toV1 = {
29748
+ [StaffStrategySelection3.AUTOMATIC]: "AUTOMATIC",
29749
+ [StaffStrategySelection3.HIGH_TO_LOW_PRIORITY]: "PRIORITY_HIGH_TO_LOW",
29750
+ [StaffStrategySelection3.LOW_TO_HIGH_PRIORITY]: "PRIORITY_LOW_TO_HIGH"
29751
+ };
29718
29752
  function takeAppointmentViewProperties(appointmentOptions) {
29719
29753
  const {
29720
29754
  label,
@@ -29725,6 +29759,8 @@ function takeAppointmentViewProperties(appointmentOptions) {
29725
29759
  format,
29726
29760
  description,
29727
29761
  showLabel,
29762
+ meetingType,
29763
+ staffStrategySelection,
29728
29764
  phoneOptions,
29729
29765
  videoConferenceOptions,
29730
29766
  inPersonOptions
@@ -29751,6 +29787,12 @@ function takeAppointmentViewProperties(appointmentOptions) {
29751
29787
  [FormatKey]: format,
29752
29788
  [FormatDescriptionTypeKey]: format,
29753
29789
  [StaffIdsKey]: staffIds,
29790
+ ...meetingType && {
29791
+ [MeetingTypeKey]: meetingType
29792
+ },
29793
+ ...staffStrategySelection && {
29794
+ [StaffStrategySelectionKey]: staffStrategyV2toV1[staffStrategySelection] ?? staffStrategySelection
29795
+ },
29754
29796
  ...transformFormatInfoToView(inPersonOptions, videoConferenceOptions, phoneOptions)
29755
29797
  };
29756
29798
  }
@@ -29791,7 +29833,7 @@ function takeDonationsInputViewProperties(donationInput) {
29791
29833
  const options = donationInput.options ?? [];
29792
29834
  return {
29793
29835
  [HideLabelKey]: !donationInput.showLabel,
29794
- [AddOtherKey]: donationInput.customOption != null,
29836
+ [AddOtherKey]: !!donationInput.customOption,
29795
29837
  [NumberOfColumnsKey]: numericNumberOfColumns(donationInput.numberOfColumns ?? NumberOfColumns3.ONE),
29796
29838
  [OptionsKey]: options.map((option) => makeOptionView(option)),
29797
29839
  ...donationInput.description && {
@@ -29831,6 +29873,9 @@ function takePaymentInputViewProperties(paymentInput) {
29831
29873
  },
29832
29874
  ...paymentInput.placeholder && {
29833
29875
  [PlaceholderKey]: paymentInput.placeholder
29876
+ },
29877
+ ...typeof paymentInput.default === "number" && {
29878
+ [DefaultValueKey]: paymentInput.default
29834
29879
  }
29835
29880
  };
29836
29881
  }