@wix/form-public 0.203.0 → 0.205.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
@@ -536,6 +536,7 @@ var init_types_impl = __esm({
536
536
  UploadFileFormat4["AUDIO"] = "AUDIO";
537
537
  UploadFileFormat4["DOCUMENT"] = "DOCUMENT";
538
538
  UploadFileFormat4["ARCHIVE"] = "ARCHIVE";
539
+ UploadFileFormat4["MODEL_3D"] = "MODEL_3D";
539
540
  })(UploadFileFormat || (UploadFileFormat = {}));
540
541
  (function(InputFieldPaymentComponentType3) {
541
542
  InputFieldPaymentComponentType3["UNKNOWN_COMPONENT_TYPE"] = "UNKNOWN_COMPONENT_TYPE";
@@ -19563,9 +19564,29 @@ function buildObjectArrayValidation(target, objectArrayOptions, validationMode)
19563
19564
  ...objectArrayOptions.minItems && validationMode !== ValidationMode.UNRESTRICTED_UPDATE && {
19564
19565
  minItems: objectArrayOptions.minItems
19565
19566
  },
19566
- items: {
19567
- $ref: target
19567
+ items: objectArrayOptions.itemProperties ? buildItemPropertiesSchema(objectArrayOptions.itemProperties) : { $ref: target }
19568
+ };
19569
+ }
19570
+ function buildItemPropertiesSchema(itemProperties) {
19571
+ const typeMap = {
19572
+ STRING: "string",
19573
+ NUMBER: "number",
19574
+ BOOLEAN: "boolean"
19575
+ };
19576
+ const properties = {};
19577
+ const required = [];
19578
+ for (const [key, value] of Object.entries(itemProperties)) {
19579
+ const jsonType = value.propertiesType && typeMap[value.propertiesType];
19580
+ if (jsonType) {
19581
+ properties[key] = { type: jsonType };
19582
+ required.push(key);
19568
19583
  }
19584
+ }
19585
+ return {
19586
+ type: "object",
19587
+ properties,
19588
+ required,
19589
+ additionalProperties: false
19569
19590
  };
19570
19591
  }
19571
19592
  function buildPaymentValidation(paymentOptions, validationMode) {
@@ -30077,6 +30098,8 @@ function resolveObjectArrayComponent(objectArrayComponent) {
30077
30098
  switch (objectArrayComponent.componentType) {
30078
30099
  case ObjectArrayComponentType3.REPEATER:
30079
30100
  return takeRepeaterViewProperties(objectArrayComponent.repeaterOptions);
30101
+ case ObjectArrayComponentType3.PIKACHU:
30102
+ return takePikachuViewProperties(objectArrayComponent.pikachuOptions);
30080
30103
  default:
30081
30104
  throw new Error(`Unknown object array component type: ${objectArrayComponent.componentType}`);
30082
30105
  }
@@ -30093,6 +30116,21 @@ function takeRepeaterViewProperties(repeater) {
30093
30116
  }
30094
30117
  };
30095
30118
  }
30119
+ var ProviderNameKey = "providerName";
30120
+ var FilterKey = "filter";
30121
+ function takePikachuViewProperties(pikachu) {
30122
+ return {
30123
+ [LabelKey]: pikachu.label,
30124
+ [HideLabelKey]: !pikachu.showLabel,
30125
+ [ProviderNameKey]: pikachu.providerName,
30126
+ ...pikachu.description && {
30127
+ [DescriptionKey]: pikachu.description
30128
+ },
30129
+ ...pikachu.filter && {
30130
+ [FilterKey]: pikachu.filter
30131
+ }
30132
+ };
30133
+ }
30096
30134
  function resolveQuizFieldSettings(quizFieldSettings) {
30097
30135
  var _quizFieldSettings$co;
30098
30136
  const correctAnswers = quizFieldSettings == null || (_quizFieldSettings$co = quizFieldSettings.correctAnswersList) == null ? void 0 : _quizFieldSettings$co.correctAnswers;
@@ -30433,6 +30471,7 @@ function createLayoutBreakpoints(layout, fieldId) {
30433
30471
  };
30434
30472
  }
30435
30473
  function createPropertiesView(field, path, recursive, isMobile2) {
30474
+ var _field$validation;
30436
30475
  const {
30437
30476
  hidden,
30438
30477
  pii,
@@ -30449,6 +30488,7 @@ function createPropertiesView(field, path, recursive, isMobile2) {
30449
30488
  const {
30450
30489
  required
30451
30490
  } = field.validation ?? {};
30491
+ const availability = (_field$validation = field.validation) == null || (_field$validation = _field$validation.string) == null || (_field$validation = _field$validation.dateOptions) == null ? void 0 : _field$validation.availability;
30452
30492
  const formView = form && recursive ? createFormView({
30453
30493
  form,
30454
30494
  path,
@@ -30468,7 +30508,10 @@ function createPropertiesView(field, path, recursive, isMobile2) {
30468
30508
  ...nestedFormId ? {
30469
30509
  nestedFormId
30470
30510
  } : {},
30471
- ...rest
30511
+ ...rest,
30512
+ ...availability ? {
30513
+ availability
30514
+ } : {}
30472
30515
  };
30473
30516
  }
30474
30517
  function createLayoutView(layout) {