@qikdev/vue-ui 0.3.25 → 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.25";
7
+ const Jh = "0.3.30";
8
8
  class yn extends Error {
9
9
  }
10
10
  class Kh extends yn {
@@ -5179,7 +5179,7 @@ function qg(e, t, n, r, s, i) {
5179
5179
  z(e.$slots, "default", {}, void 0, !0)
5180
5180
  ]);
5181
5181
  }
5182
- const Bg = /* @__PURE__ */ M(Ug, [["render", qg], ["__scopeId", "data-v-3b352542"]]), zg = {}, Wg = { class: "panel-footer" };
5182
+ const Bg = /* @__PURE__ */ M(Ug, [["render", qg], ["__scopeId", "data-v-315be8cb"]]), zg = {}, Wg = { class: "panel-footer" };
5183
5183
  function Hg(e, t, n, r, s, i) {
5184
5184
  return o(), h("div", Wg, [
5185
5185
  z(e.$slots, "default", {}, void 0, !0)
@@ -8587,6 +8587,14 @@ const ub = {
8587
8587
  this.model = this.model;
8588
8588
  },
8589
8589
  methods: {
8590
+ maybeAutoSelectSingleOption() {
8591
+ if (this.loadingAsyncOptions || !this.singleValue || !this.minimum || this.model || this.model === !1 || this.model === 0)
8592
+ return;
8593
+ const e = this.selectableOptions.filter(function(t) {
8594
+ return !t.none;
8595
+ });
8596
+ e.length === 1 && (this.model = e[0]);
8597
+ },
8590
8598
  displayLabelFromValue(e) {
8591
8599
  if (!e)
8592
8600
  return;
@@ -8638,6 +8646,15 @@ const ub = {
8638
8646
  watch: {
8639
8647
  candidate(e) {
8640
8648
  e && (this.addValue(e), this.candidate = null);
8649
+ },
8650
+ selectableOptions: {
8651
+ immediate: !0,
8652
+ handler() {
8653
+ this.maybeAutoSelectSingleOption();
8654
+ }
8655
+ },
8656
+ loadingAsyncOptions() {
8657
+ this.maybeAutoSelectSingleOption();
8641
8658
  }
8642
8659
  },
8643
8660
  computed: {
@@ -8704,7 +8721,7 @@ const ub = {
8704
8721
  }));
8705
8722
  }
8706
8723
  }
8707
- }, db = (e) => (je("data-v-9fabb548"), e = e(), qe(), e), cb = {
8724
+ }, db = (e) => (je("data-v-bf1479ae"), e = e(), qe(), e), cb = {
8708
8725
  key: 0,
8709
8726
  class: "ux-field-title"
8710
8727
  }, fb = {
@@ -8846,7 +8863,7 @@ function Eb(e, t, n, r, s, i) {
8846
8863
  ]))
8847
8864
  ], 2);
8848
8865
  }
8849
- const It = /* @__PURE__ */ M(ub, [["render", Eb], ["__scopeId", "data-v-9fabb548"]]), Mb = {
8866
+ const It = /* @__PURE__ */ M(ub, [["render", Eb], ["__scopeId", "data-v-bf1479ae"]]), Mb = {
8850
8867
  props: {
8851
8868
  total: {
8852
8869
  type: Number,
@@ -29831,16 +29848,7 @@ function Zn(e, t, n, r, s, i) {
29831
29848
  t = t || [], n = Math.max(n, r);
29832
29849
  var a = t.length, l = a >= n;
29833
29850
  if (!l) {
29834
- var u = n - a;
29835
- console.log("ARRAY", {
29836
- meetsMinimum: l,
29837
- array: t,
29838
- extras: d,
29839
- difference: u,
29840
- min: n,
29841
- max: s
29842
- });
29843
- var d = Array(u).fill().map(i);
29851
+ var u = n - a, d = Array(u).fill().map(i);
29844
29852
  return [...t || [], ...d || []];
29845
29853
  }
29846
29854
  return t;
@@ -31642,7 +31650,9 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31642
31650
  },
31643
31651
  async preSubmit(e) {
31644
31652
  var i, a;
31645
- 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;
31646
31656
  if (t.form.hasGeographicRequirements) {
31647
31657
  const { coords: l } = await t.$sdk.geo.getPosition().catch(function(u) {
31648
31658
  return console.log("Error", u), {
@@ -31762,14 +31772,14 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31762
31772
  },
31763
31773
  canAdvance(e) {
31764
31774
  if (!this.movedBackwards && e && this.autoadvance) {
31765
- 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 }) {
31766
31777
  switch (s) {
31767
31778
  case "void":
31768
31779
  return !1;
31769
31780
  }
31770
31781
  return !0;
31771
- });
31772
- console.log("Lets autoadvance!!!"), r.length == 1 && this.nextPageAttempt();
31782
+ }).length == 1 && this.nextPageAttempt();
31773
31783
  }
31774
31784
  },
31775
31785
  modelValue(e, t) {
@@ -31802,6 +31812,14 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31802
31812
  this.mounted = !1;
31803
31813
  },
31804
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
+ },
31805
31823
  invalidFields() {
31806
31824
  var e;
31807
31825
  return !this.showBlockers || !this.submitAttempted ? [] : this.buttonDisabled ? ((e = this.formState) == null ? void 0 : e.invalidFields) || [] : [];
@@ -31814,6 +31832,10 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31814
31832
  var e;
31815
31833
  return !!((e = this.paymentConfiguration) != null && e.enabled);
31816
31834
  },
31835
+ gateways() {
31836
+ var e;
31837
+ return ((e = this.paymentConfiguration) == null ? void 0 : e.gateways) || [];
31838
+ },
31817
31839
  requiresPayment() {
31818
31840
  var e;
31819
31841
  return this.paymentEnabled ? parseInt((e = this.model._payment) == null ? void 0 : e.total) > 0 : !1;
@@ -31916,11 +31938,11 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31916
31938
  },
31917
31939
  buttonDisabled() {
31918
31940
  return this.preview ? !0 : this.noGatewaySelectedButPaymentIsRequired ? (console.error(
31919
- "There is no payment gateway selected but payment is required"
31941
+ "Error: There is no payment gateway selected but payment is required"
31920
31942
  ), !0) : this.submitAttempted && this.invalid;
31921
31943
  },
31922
31944
  noGatewaySelectedButPaymentIsRequired() {
31923
- return this.total ? !this.payment.gateway : !1;
31945
+ return this.total ? !this.selectedGateway : !1;
31924
31946
  },
31925
31947
  invalid() {
31926
31948
  var t;
@@ -31939,7 +31961,7 @@ const Ch = /* @__PURE__ */ M(BA, [["render", zA], ["__scopeId", "data-v-e6afec75
31939
31961
  return ((e = this.form) == null ? void 0 : e.fields) || [];
31940
31962
  }
31941
31963
  }
31942
- }, 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 = {
31943
31965
  key: 0,
31944
31966
  class: "multistep-form"
31945
31967
  }, eN = { class: "multistep-form-sections" }, tN = { class: "multistep-fields" }, nN = { class: "multistep-controls" }, iN = ["tooltip"], rN = ["tooltip"], sN = { class: "multistep-progress" }, aN = {
@@ -32169,7 +32191,7 @@ function uN(e, t, n, r, s, i) {
32169
32191
  ], 64))
32170
32192
  ], 2);
32171
32193
  }
32172
- 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 = {
32173
32195
  name: "PaymentMethodForm",
32174
32196
  components: {
32175
32197
  StripeElements: mm,