@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.js CHANGED
@@ -510,6 +510,7 @@ var init_types_impl = __esm({
510
510
  UploadFileFormat4["AUDIO"] = "AUDIO";
511
511
  UploadFileFormat4["DOCUMENT"] = "DOCUMENT";
512
512
  UploadFileFormat4["ARCHIVE"] = "ARCHIVE";
513
+ UploadFileFormat4["MODEL_3D"] = "MODEL_3D";
513
514
  })(UploadFileFormat || (UploadFileFormat = {}));
514
515
  (function(InputFieldPaymentComponentType3) {
515
516
  InputFieldPaymentComponentType3["UNKNOWN_COMPONENT_TYPE"] = "UNKNOWN_COMPONENT_TYPE";
@@ -19537,9 +19538,29 @@ function buildObjectArrayValidation(target, objectArrayOptions, validationMode)
19537
19538
  ...objectArrayOptions.minItems && validationMode !== ValidationMode.UNRESTRICTED_UPDATE && {
19538
19539
  minItems: objectArrayOptions.minItems
19539
19540
  },
19540
- items: {
19541
- $ref: target
19541
+ items: objectArrayOptions.itemProperties ? buildItemPropertiesSchema(objectArrayOptions.itemProperties) : { $ref: target }
19542
+ };
19543
+ }
19544
+ function buildItemPropertiesSchema(itemProperties) {
19545
+ const typeMap = {
19546
+ STRING: "string",
19547
+ NUMBER: "number",
19548
+ BOOLEAN: "boolean"
19549
+ };
19550
+ const properties = {};
19551
+ const required = [];
19552
+ for (const [key, value] of Object.entries(itemProperties)) {
19553
+ const jsonType = value.propertiesType && typeMap[value.propertiesType];
19554
+ if (jsonType) {
19555
+ properties[key] = { type: jsonType };
19556
+ required.push(key);
19542
19557
  }
19558
+ }
19559
+ return {
19560
+ type: "object",
19561
+ properties,
19562
+ required,
19563
+ additionalProperties: false
19543
19564
  };
19544
19565
  }
19545
19566
  function buildPaymentValidation(paymentOptions, validationMode) {
@@ -30051,6 +30072,8 @@ function resolveObjectArrayComponent(objectArrayComponent) {
30051
30072
  switch (objectArrayComponent.componentType) {
30052
30073
  case ObjectArrayComponentType3.REPEATER:
30053
30074
  return takeRepeaterViewProperties(objectArrayComponent.repeaterOptions);
30075
+ case ObjectArrayComponentType3.PIKACHU:
30076
+ return takePikachuViewProperties(objectArrayComponent.pikachuOptions);
30054
30077
  default:
30055
30078
  throw new Error(`Unknown object array component type: ${objectArrayComponent.componentType}`);
30056
30079
  }
@@ -30067,6 +30090,21 @@ function takeRepeaterViewProperties(repeater) {
30067
30090
  }
30068
30091
  };
30069
30092
  }
30093
+ var ProviderNameKey = "providerName";
30094
+ var FilterKey = "filter";
30095
+ function takePikachuViewProperties(pikachu) {
30096
+ return {
30097
+ [LabelKey]: pikachu.label,
30098
+ [HideLabelKey]: !pikachu.showLabel,
30099
+ [ProviderNameKey]: pikachu.providerName,
30100
+ ...pikachu.description && {
30101
+ [DescriptionKey]: pikachu.description
30102
+ },
30103
+ ...pikachu.filter && {
30104
+ [FilterKey]: pikachu.filter
30105
+ }
30106
+ };
30107
+ }
30070
30108
  function resolveQuizFieldSettings(quizFieldSettings) {
30071
30109
  var _quizFieldSettings$co;
30072
30110
  const correctAnswers = quizFieldSettings == null || (_quizFieldSettings$co = quizFieldSettings.correctAnswersList) == null ? void 0 : _quizFieldSettings$co.correctAnswers;
@@ -30407,6 +30445,7 @@ function createLayoutBreakpoints(layout, fieldId) {
30407
30445
  };
30408
30446
  }
30409
30447
  function createPropertiesView(field, path, recursive, isMobile2) {
30448
+ var _field$validation;
30410
30449
  const {
30411
30450
  hidden,
30412
30451
  pii,
@@ -30423,6 +30462,7 @@ function createPropertiesView(field, path, recursive, isMobile2) {
30423
30462
  const {
30424
30463
  required
30425
30464
  } = field.validation ?? {};
30465
+ const availability = (_field$validation = field.validation) == null || (_field$validation = _field$validation.string) == null || (_field$validation = _field$validation.dateOptions) == null ? void 0 : _field$validation.availability;
30426
30466
  const formView = form && recursive ? createFormView({
30427
30467
  form,
30428
30468
  path,
@@ -30442,7 +30482,10 @@ function createPropertiesView(field, path, recursive, isMobile2) {
30442
30482
  ...nestedFormId ? {
30443
30483
  nestedFormId
30444
30484
  } : {},
30445
- ...rest
30485
+ ...rest,
30486
+ ...availability ? {
30487
+ availability
30488
+ } : {}
30446
30489
  };
30447
30490
  }
30448
30491
  function createLayoutView(layout) {