comand-component-library 4.1.53 → 4.1.54

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.
@@ -4358,8 +4358,8 @@ function Ar(e, n, t, s, i, o) {
4358
4358
  i.systemMessage.show && i.systemMessage.message ? (l(), w(d, {
4359
4359
  key: 0,
4360
4360
  validationStatus: i.systemMessage.validationStatus,
4361
- "system-message": i.systemMessage.message
4362
- }, null, 8, ["validationStatus", "system-message"])) : m("", !0),
4361
+ systemMessage: i.systemMessage.message
4362
+ }, null, 8, ["validationStatus", "systemMessage"])) : m("", !0),
4363
4363
  t.useSlot ? H(e.$slots, "default", { key: 1 }) : (l(!0), r(S, { key: 2 }, q(t.formElements, (u, g) => (l(), w(c, {
4364
4364
  key: g,
4365
4365
  element: u.element || "input",
@@ -5883,13 +5883,12 @@ const Dd = /* @__PURE__ */ V(pd, [["render", Fd]]), Md = {
5883
5883
  this.formData.error && e.originalEvent.preventDefault();
5884
5884
  return;
5885
5885
  }
5886
- e.originalEvent.preventDefault(), console.log("recaptcha available", window.grecaptcha), this.reCaptchaWebsiteKey && window.grecaptcha ? (console.log("recaptcha"), grecaptcha.ready(() => {
5887
- console.log("recaptcha ready"), grecaptcha.execute(this.reCaptchaWebsiteKey, { action: "submit" }).then((n) => this.submitForm(n)).catch((n) => console.log("recaptcha error", n));
5888
- })) : this.submitForm();
5886
+ e.originalEvent.preventDefault(), this.reCaptchaWebsiteKey && window.grecaptcha ? grecaptcha.ready(() => {
5887
+ grecaptcha.execute(this.reCaptchaWebsiteKey, { action: "submit" }).then((n) => this.submitForm(n)).catch((n) => console.log("recaptcha error", n));
5888
+ }) : this.submitForm();
5889
5889
  },
5890
5890
  submitForm(e) {
5891
5891
  var s;
5892
- console.log("submitForm", e);
5893
5892
  const n = new FormData();
5894
5893
  e && n.set("recaptchaToken", e);
5895
5894
  const t = Object.keys(this.configuration);
@@ -5898,8 +5897,13 @@ const Dd = /* @__PURE__ */ V(pd, [["render", Fd]]), Md = {
5898
5897
  fetch(this.formAction, { method: ((s = this.cmdForm) == null ? void 0 : s.formMethod) || "POST", body: n }).then((i) => {
5899
5898
  if (i.ok) {
5900
5899
  this.$refs.form.showMessage("success", this.getMessage("basic_form.system_message.success.message_sent_successfully"));
5901
- for (let o in this.formData)
5902
- o === "salutation" ? this.formData[o].value = this.configuration.salutation.default : o === "acceptPrivacy" ? this.formData[o].value = !1 : this.formData[o].value = "";
5900
+ try {
5901
+ this.formData.error = !1;
5902
+ for (let o in this.formData)
5903
+ this.formData[o].error && (this.formData[o].error = !1), typeof this.formData[o].value == "string" ? o === "salutation" ? this.formData[o].value = this.configuration.salutation.default : this.formData[o].value = "" : o === "acceptPrivacy" && (this.formData[o].value = !1);
5904
+ } catch (o) {
5905
+ console.error(o);
5906
+ }
5903
5907
  } else
5904
5908
  this.$refs.form.showMessage("error", this.getMessage("basic_form.system_message.error.message_could_not_be_sent"));
5905
5909
  }).catch((i) => {
@@ -18508,7 +18512,7 @@ function c_(e, n, t, s, i, o) {
18508
18512
  })
18509
18513
  ], 64);
18510
18514
  }
18511
- const bo = /* @__PURE__ */ V(e_, [["render", c_]]), u_ = "comand-component-library", m_ = "4.1.53", h_ = "GPL-3.0-only", p_ = "CoManD-UI", f_ = "module", g_ = {
18515
+ const bo = /* @__PURE__ */ V(e_, [["render", c_]]), u_ = "comand-component-library", m_ = "4.1.54", h_ = "GPL-3.0-only", p_ = "CoManD-UI", f_ = "module", g_ = {
18512
18516
  prepublishOnly: "npm run build-lib",
18513
18517
  dev: "vite",
18514
18518
  build: "vite build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "4.1.53",
3
+ "version": "4.1.54",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "CoManD-UI",
6
6
  "private": false,
@@ -497,11 +497,8 @@ export default {
497
497
  // prevent original levent form CmdForm (to avoid submit and reload)
498
498
  event.originalEvent.preventDefault()
499
499
 
500
- console.log("recaptcha available", window.grecaptcha)
501
500
  if(this.reCaptchaWebsiteKey && window.grecaptcha) {
502
- console.log("recaptcha")
503
501
  grecaptcha.ready(() => {
504
- console.log("recaptcha ready")
505
502
  grecaptcha.execute(this.reCaptchaWebsiteKey, {action: "submit"}).then(token => this.submitForm(token)).catch(error => console.log("recaptcha error", error))
506
503
  })
507
504
  } else {
@@ -509,7 +506,6 @@ export default {
509
506
  }
510
507
  },
511
508
  submitForm(token) {
512
- console.log("submitForm", token);
513
509
  // custom submit of form-data
514
510
  const customSubmitFormData = new FormData()
515
511
 
@@ -528,14 +524,29 @@ export default {
528
524
  fetch(this.formAction, {method: this.cmdForm?.formMethod || "POST", body: customSubmitFormData}).then((response) => {
529
525
  if(response.ok) {
530
526
  this.$refs.form.showMessage("success", this.getMessage("basic_form.system_message.success.message_sent_successfully"))
531
- for (let key in this.formData) {
532
- if(key === "salutation") {
533
- this.formData[key].value = this.configuration.salutation.default
534
- } else if(key === "acceptPrivacy") {
535
- this.formData[key].value = false
536
- } else {
537
- this.formData[key].value = ""
527
+ try {
528
+ // reset global validation-status
529
+ this.formData.error = false
530
+
531
+ for (let key in this.formData) {
532
+ // reset field-validation-status
533
+ if(this.formData[key].error) {
534
+ this.formData[key].error = false
535
+ }
536
+
537
+ // reset field-values
538
+ if(typeof this.formData[key].value === "string") {
539
+ if(key === "salutation") {
540
+ this.formData[key].value = this.configuration.salutation.default
541
+ } else {
542
+ this.formData[key].value = ""
543
+ }
544
+ } else if(key === "acceptPrivacy") {
545
+ this.formData[key].value = false
546
+ }
538
547
  }
548
+ } catch (error) {
549
+ console.error(error)
539
550
  }
540
551
  } else {
541
552
  this.$refs.form.showMessage("error", this.getMessage("basic_form.system_message.error.message_could_not_be_sent"))
@@ -7,7 +7,7 @@
7
7
  legend.text
8
8
  }}
9
9
  </legend>
10
- <CmdSystemMessage v-if="systemMessage.show && systemMessage.message" :validationStatus="systemMessage.validationStatus" :system-message="systemMessage.message"/>
10
+ <CmdSystemMessage v-if="systemMessage.show && systemMessage.message" :validationStatus="systemMessage.validationStatus" :systemMessage="systemMessage.message"/>
11
11
  <!-- begin default-slot-content -->
12
12
  <slot v-if="useSlot"></slot>
13
13
  <!-- end default-slot-content -->