@qikdev/vue-ui 0.3.26 → 0.3.30

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/lib.es.js CHANGED
@@ -4,7 +4,7 @@ var Uh = (e, t, n) => t in e ? Rh(e, t, { enumerable: !0, configurable: !0, writ
4
4
  var ie = (e, t, n) => Uh(e, typeof t != "symbol" ? t + "" : t, n);
5
5
  import { reactive as Gt, defineComponent as Fl, ref as vt, toRefs as of, onMounted as Al, onBeforeUnmount as jh, watch as cr, computed as Fn, createElementBlock as h, openBlock as o, createCommentVNode as _, renderSlot as z, normalizeClass as $, useSlots as qh, provide as Mr, resolveComponent as y, createVNode as c, Fragment as D, createBlock as k, unref as gt, withCtx as f, renderList as A, toDisplayString as b, createTextVNode as O, withDirectives as Z, vShow as ci, withModifiers as B, createElementVNode as T, h as dl, mergeProps as mt, toHandlers as kt, normalizeStyle as Ge, resolveDirective as uf, resolveDynamicComponent as Vt, vModelSelect as Dt, pushScopeId as je, popScopeId as qe, getCurrentScope as Bh, onScopeDispose as zh, getCurrentInstance as Wh, Teleport as df, Transition as Hh, withKeys as we, vModelText as be, TransitionGroup as Gh, nextTick as cf, vModelDynamic as Sn, normalizeProps as ff, guardReactiveProps as Yh } from "vue";
6
6
  import { EventDispatcher as mf } from "@qikdev/sdk";
7
- const Jh = "0.3.26";
7
+ const Jh = "0.3.30";
8
8
  class yn extends Error {
9
9
  }
10
10
  class Kh extends yn {
@@ -31650,7 +31650,9 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31650
31650
  },
31651
31651
  async preSubmit(e) {
31652
31652
  var i, a;
31653
- const t = this, n = JSON.parse(JSON.stringify(e)), r = (i = n._payment) == null ? void 0 : i.total, s = (a = n._payment) == null ? void 0 : a.gateway;
31653
+ const t = this, n = JSON.parse(JSON.stringify(e)), r = (i = n._payment) == null ? void 0 : i.total;
31654
+ r && (n._payment.gateway || this.selectedGateway && (n._payment.gateway = this.selectedGateway));
31655
+ const s = (a = n._payment) == null ? void 0 : a.gateway;
31654
31656
  if (t.form.hasGeographicRequirements) {
31655
31657
  const { coords: l } = await t.$sdk.geo.getPosition().catch(function(u) {
31656
31658
  return console.log("Error", u), {
@@ -31770,14 +31772,14 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31770
31772
  },
31771
31773
  canAdvance(e) {
31772
31774
  if (!this.movedBackwards && e && this.autoadvance) {
31773
- const t = this.$refs.form[this.currentPage], n = (t == null ? void 0 : t.fields) || [], r = this.$sdk.utils.mapFields(n).filter(function({ type: s }) {
31775
+ const t = this.$refs.form[this.currentPage], n = (t == null ? void 0 : t.fields) || [];
31776
+ this.$sdk.utils.mapFields(n).filter(function({ type: s }) {
31774
31777
  switch (s) {
31775
31778
  case "void":
31776
31779
  return !1;
31777
31780
  }
31778
31781
  return !0;
31779
- });
31780
- console.log("Lets autoadvance!!!"), r.length == 1 && this.nextPageAttempt();
31782
+ }).length == 1 && this.nextPageAttempt();
31781
31783
  }
31782
31784
  },
31783
31785
  modelValue(e, t) {
@@ -31810,6 +31812,14 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31810
31812
  this.mounted = !1;
31811
31813
  },
31812
31814
  computed: {
31815
+ selectedGateway() {
31816
+ var t, n, r, s;
31817
+ if ((n = (t = this.submission) == null ? void 0 : t._payment) != null && n.gateway)
31818
+ return (s = (r = this.submission) == null ? void 0 : r._payment) == null ? void 0 : s.gateway;
31819
+ const e = this.gateways.filter(Boolean);
31820
+ if (e.length === 1)
31821
+ return e[0];
31822
+ },
31813
31823
  invalidFields() {
31814
31824
  var e;
31815
31825
  return !this.showBlockers || !this.submitAttempted ? [] : this.buttonDisabled ? ((e = this.formState) == null ? void 0 : e.invalidFields) || [] : [];
@@ -31822,6 +31832,10 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31822
31832
  var e;
31823
31833
  return !!((e = this.paymentConfiguration) != null && e.enabled);
31824
31834
  },
31835
+ gateways() {
31836
+ var e;
31837
+ return ((e = this.paymentConfiguration) == null ? void 0 : e.gateways) || [];
31838
+ },
31825
31839
  requiresPayment() {
31826
31840
  var e;
31827
31841
  return this.paymentEnabled ? parseInt((e = this.model._payment) == null ? void 0 : e.total) > 0 : !1;
@@ -31924,11 +31938,11 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31924
31938
  },
31925
31939
  buttonDisabled() {
31926
31940
  return this.preview ? !0 : this.noGatewaySelectedButPaymentIsRequired ? (console.error(
31927
- "There is no payment gateway selected but payment is required"
31941
+ "Error: There is no payment gateway selected but payment is required"
31928
31942
  ), !0) : this.submitAttempted && this.invalid;
31929
31943
  },
31930
31944
  noGatewaySelectedButPaymentIsRequired() {
31931
- return this.total ? !this.payment.gateway : !1;
31945
+ return this.total ? !this.selectedGateway : !1;
31932
31946
  },
31933
31947
  invalid() {
31934
31948
  var t;
@@ -31947,7 +31961,7 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31947
31961
  return ((e = this.form) == null ? void 0 : e.fields) || [];
31948
31962
  }
31949
31963
  }
31950
- }, Eh = (e) => (je("data-v-b83af107"), e = e(), qe(), e), YA = /* @__PURE__ */ Eh(() => /* @__PURE__ */ T("h3", null, "An error occurred", -1)), JA = { key: 0 }, KA = { key: 1 }, ZA = { key: 2 }, XA = { class: "intent-submit" }, QA = {
31964
+ }, Eh = (e) => (je("data-v-b859ef09"), e = e(), qe(), e), YA = /* @__PURE__ */ Eh(() => /* @__PURE__ */ T("h3", null, "An error occurred", -1)), JA = { key: 0 }, KA = { key: 1 }, ZA = { key: 2 }, XA = { class: "intent-submit" }, QA = {
31951
31965
  key: 0,
31952
31966
  class: "multistep-form"
31953
31967
  }, eN = { class: "multistep-form-sections" }, tN = { class: "multistep-fields" }, nN = { class: "multistep-controls" }, iN = ["tooltip"], rN = ["tooltip"], sN = { class: "multistep-progress" }, aN = {
@@ -32177,7 +32191,7 @@ function uN(e, t, n, r, s, i) {
32177
32191
  ], 64))
32178
32192
  ], 2);
32179
32193
  }
32180
- const dN = /* @__PURE__ */ M(GA, [["render", uN], ["__scopeId", "data-v-b83af107"]]), cN = "init", zc = "ready", fN = "processing", mN = "success", hN = "error", pN = {
32194
+ const dN = /* @__PURE__ */ M(GA, [["render", uN], ["__scopeId", "data-v-b859ef09"]]), cN = "init", zc = "ready", fN = "processing", mN = "success", hN = "error", pN = {
32181
32195
  name: "PaymentMethodForm",
32182
32196
  components: {
32183
32197
  StripeElements: mm,