@visitscotland/component-library 5.33.0 → 5.34.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.
@@ -25406,6 +25406,17 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_ren
25406
25406
  type: String,
25407
25407
  required: !0
25408
25408
  },
25409
+ /**
25410
+ * If set to false, remove the recaptcha from the form and don't check it when verifying a
25411
+ * submission.
25412
+ *
25413
+ * This is necessary for in person forms which won't be available on the web, and which can
25414
+ * be submitted many times from one device.
25415
+ */
25416
+ usesRecaptcha: {
25417
+ type: Boolean,
25418
+ default: !0
25419
+ },
25409
25420
  /**
25410
25421
  * Recaptcha site key string
25411
25422
  */
@@ -25692,7 +25703,7 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_ren
25692
25703
  function n(r) {
25693
25704
  return r.validation && r.validation.required;
25694
25705
  }
25695
- this.isTest || this.onRecaptchaVerify(), this.triggerValidate = !0;
25706
+ this.usesRecaptcha && !this.isTest && this.onRecaptchaVerify(), this.triggerValidate = !0;
25696
25707
  const t = this.formData.fields.filter(n);
25697
25708
  t.length === 0 ? this.formIsInvalid = !1 : t.forEach((r) => {
25698
25709
  if (!/\S/.test(this.form[r.name])) {
@@ -25701,7 +25712,7 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_ren
25701
25712
  }
25702
25713
  }), this.showErrorMessage = this.formIsInvalid, Object.entries(this.conditionalFields).forEach(([r, a]) => {
25703
25714
  a || (this.form[r] = "");
25704
- }), this.errorFields.length > 0 && (this.formIsInvalid = !0), !this.formIsInvalid && this.recaptchaVerified ? this.isMarketo ? this.marketoSubmit() : this.axiosSubmit() : (this.showErrorMessage = !0, this.reAlertErrors = !0, setTimeout(() => {
25715
+ }), this.errorFields.length > 0 && (this.formIsInvalid = !0), !this.formIsInvalid && (this.recaptchaVerified || !this.usesRecaptcha) ? this.isMarketo ? this.marketoSubmit() : this.axiosSubmit() : (this.showErrorMessage = !0, this.reAlertErrors = !0, setTimeout(() => {
25705
25716
  this.reAlertErrors = !1;
25706
25717
  }, 100));
25707
25718
  },
@@ -25888,7 +25899,8 @@ function _sfc_render$J(e, n, t, r, a, s) {
25888
25899
  }, 1032, ["label", "label-for", "class"]))), 128))
25889
25900
  ]),
25890
25901
  renderSlot(e.$slots, "hidden-fields"),
25891
- createVNode(d, {
25902
+ t.usesRecaptcha ? (openBlock(), createBlock(d, {
25903
+ key: 0,
25892
25904
  onVerified: s.onRecaptchaVerify,
25893
25905
  "site-key": t.recaptchaKey,
25894
25906
  invalid: !a.recaptchaVerified && a.showErrorMessage,
@@ -25897,7 +25909,7 @@ function _sfc_render$J(e, n, t, r, a, s) {
25897
25909
  class: "mt-300",
25898
25910
  "textarea-label": t.recaptchaTextareaLabel,
25899
25911
  "re-alert-errors": a.reAlertErrors
25900
- }, null, 8, ["onVerified", "site-key", "invalid", "language", "error-msg", "textarea-label", "re-alert-errors"]),
25912
+ }, null, 8, ["onVerified", "site-key", "invalid", "language", "error-msg", "textarea-label", "re-alert-errors"])) : createCommentVNode("", !0),
25901
25913
  createVNode(f, {
25902
25914
  variant: "primary",
25903
25915
  type: "submit",