@wix/form-public 0.202.0 → 0.204.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
@@ -19563,9 +19563,29 @@ function buildObjectArrayValidation(target, objectArrayOptions, validationMode)
19563
19563
  ...objectArrayOptions.minItems && validationMode !== ValidationMode.UNRESTRICTED_UPDATE && {
19564
19564
  minItems: objectArrayOptions.minItems
19565
19565
  },
19566
- items: {
19567
- $ref: target
19566
+ items: objectArrayOptions.itemProperties ? buildItemPropertiesSchema(objectArrayOptions.itemProperties) : { $ref: target }
19567
+ };
19568
+ }
19569
+ function buildItemPropertiesSchema(itemProperties) {
19570
+ const typeMap = {
19571
+ STRING: "string",
19572
+ NUMBER: "number",
19573
+ BOOLEAN: "boolean"
19574
+ };
19575
+ const properties = {};
19576
+ const required = [];
19577
+ for (const [key, value] of Object.entries(itemProperties)) {
19578
+ const jsonType = value.propertiesType && typeMap[value.propertiesType];
19579
+ if (jsonType) {
19580
+ properties[key] = { type: jsonType };
19581
+ required.push(key);
19568
19582
  }
19583
+ }
19584
+ return {
19585
+ type: "object",
19586
+ properties,
19587
+ required,
19588
+ additionalProperties: false
19569
19589
  };
19570
19590
  }
19571
19591
  function buildPaymentValidation(paymentOptions, validationMode) {
@@ -30077,6 +30097,8 @@ function resolveObjectArrayComponent(objectArrayComponent) {
30077
30097
  switch (objectArrayComponent.componentType) {
30078
30098
  case ObjectArrayComponentType3.REPEATER:
30079
30099
  return takeRepeaterViewProperties(objectArrayComponent.repeaterOptions);
30100
+ case ObjectArrayComponentType3.PIKACHU:
30101
+ return takePikachuViewProperties(objectArrayComponent.pikachuOptions);
30080
30102
  default:
30081
30103
  throw new Error(`Unknown object array component type: ${objectArrayComponent.componentType}`);
30082
30104
  }
@@ -30093,6 +30115,21 @@ function takeRepeaterViewProperties(repeater) {
30093
30115
  }
30094
30116
  };
30095
30117
  }
30118
+ var ProviderNameKey = "providerName";
30119
+ var FilterKey = "filter";
30120
+ function takePikachuViewProperties(pikachu) {
30121
+ return {
30122
+ [LabelKey]: pikachu.label,
30123
+ [HideLabelKey]: !pikachu.showLabel,
30124
+ [ProviderNameKey]: pikachu.providerName,
30125
+ ...pikachu.description && {
30126
+ [DescriptionKey]: pikachu.description
30127
+ },
30128
+ ...pikachu.filter && {
30129
+ [FilterKey]: pikachu.filter
30130
+ }
30131
+ };
30132
+ }
30096
30133
  function resolveQuizFieldSettings(quizFieldSettings) {
30097
30134
  var _quizFieldSettings$co;
30098
30135
  const correctAnswers = quizFieldSettings == null || (_quizFieldSettings$co = quizFieldSettings.correctAnswersList) == null ? void 0 : _quizFieldSettings$co.correctAnswers;