@miden-npm/vue 0.0.2 → 0.1.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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { inject as we, defineComponent as _, useAttrs as D, createElementBlock as d, openBlock as r, mergeProps as E, unref as t, createElementVNode as l, computed as k, normalizeClass as S, renderSlot as P, createBlock as w, toDisplayString as $, ref as x, onMounted as te, watch as H, onBeforeUnmount as le, normalizeStyle as ie, createCommentVNode as C, createVNode as m, Fragment as W, renderList as ue, createTextVNode as J, nextTick as ce, withCtx as ke } from "vue";
1
+ import { inject as we, defineComponent as _, useAttrs as D, createElementBlock as d, openBlock as r, mergeProps as E, unref as t, createElementVNode as l, computed as k, normalizeClass as S, renderSlot as I, createBlock as w, toDisplayString as $, ref as x, onMounted as te, watch as P, onBeforeUnmount as le, createVNode as m, normalizeStyle as ie, createCommentVNode as C, Fragment as W, renderList as ue, createTextVNode as J, nextTick as ce, withCtx as ke } from "vue";
2
2
  const de = Symbol("MidenPGConfig");
3
3
  function ro(o) {
4
4
  if (!(o != null && o.publishableKey))
@@ -134,14 +134,14 @@ const pe = (o) => o == null || typeof o != "object" ? !1 : Object.values(o).ever
134
134
  disabled: s.value,
135
135
  onClick: i
136
136
  }, [
137
- P(u.$slots, "prefix"),
137
+ I(u.$slots, "prefix"),
138
138
  u.loading ? (r(), w(fe, { key: 0 })) : (r(), d("div", De, [
139
139
  u.label ? (r(), d("p", {
140
140
  key: 0,
141
141
  class: S(["mb-0", h(u.size)])
142
- }, $(u.label), 3)) : P(u.$slots, "default", { key: 1 })
142
+ }, $(u.label), 3)) : I(u.$slots, "default", { key: 1 })
143
143
  ])),
144
- P(u.$slots, "suffix")
144
+ I(u.$slots, "suffix")
145
145
  ], 10, Te));
146
146
  }
147
147
  }), Ee = { class: "mb-0 text-body-3xs font-normal text-red-500" }, he = /* @__PURE__ */ _({
@@ -176,7 +176,7 @@ async function me(o, a, e) {
176
176
  }
177
177
  const Ae = {
178
178
  key: 0,
179
- class: "absolute inset-0 grid place-items-center bg-white/60"
179
+ class: "w-full h-48 flex flex-col justify-center items-center"
180
180
  }, Ie = /* @__PURE__ */ _({
181
181
  __name: "checkout-iframe",
182
182
  props: {
@@ -207,12 +207,12 @@ const Ae = {
207
207
  s.value && s.value.parentNode && s.value.parentNode.removeChild(s.value), s.value = null;
208
208
  }
209
209
  function h(y) {
210
- var A;
210
+ if (!n.value) return;
211
211
  p();
212
212
  const g = document.createElement("iframe");
213
213
  g.src = y;
214
214
  const v = a.style;
215
- v.width && (g.style.width = v.width), v.height && (g.style.height = v.height), v.border && (g.style.border = v.border), v.borderRadius && (g.style.borderRadius = v.borderRadius), v.overflow && (g.style.overflow = v.overflow), (A = n.value) == null || A.appendChild(g), s.value = g;
215
+ v.width && (g.style.width = v.width), v.height && (g.style.height = v.height), v.border && (g.style.border = v.border), v.borderRadius && (g.style.borderRadius = v.borderRadius), v.overflow && (g.style.overflow = v.overflow), n.value.appendChild(g), s.value = g;
216
216
  }
217
217
  async function u() {
218
218
  if (a.url) {
@@ -242,27 +242,22 @@ const Ae = {
242
242
  }
243
243
  }
244
244
  return te(() => {
245
- n.value && u();
246
- }), H(
245
+ u();
246
+ }), P(
247
247
  () => a.url,
248
248
  (y) => {
249
249
  y && h(y);
250
250
  }
251
251
  ), le(() => {
252
252
  p();
253
- }), (y, g) => (r(), d("div", {
254
- class: "relative",
253
+ }), (y, g) => c.value ? (r(), d("div", Ae, [
254
+ m(fe)
255
+ ])) : (r(), d("div", {
256
+ key: 1,
257
+ ref_key: "containerRef",
258
+ ref: n,
255
259
  style: ie(e.value)
256
- }, [
257
- l("div", {
258
- ref_key: "containerRef",
259
- ref: n,
260
- class: "w-full h-full"
261
- }, null, 512),
262
- c.value ? (r(), d("div", Ae, [
263
- m(fe)
264
- ])) : C("", !0)
265
- ], 4));
260
+ }, null, 4));
266
261
  }
267
262
  }), Pe = { key: 1 }, uo = /* @__PURE__ */ _({
268
263
  __name: "checkout-button",
@@ -394,7 +389,7 @@ const Ae = {
394
389
  l("div", Oe, [
395
390
  l("div", Ye, [
396
391
  l("div", Ge, [
397
- P(n.$slots, "default")
392
+ I(n.$slots, "default")
398
393
  ]),
399
394
  l("div", We, [
400
395
  s[2] || (s[2] = l("p", { class: "text-light-white-100 text-body-2xs font-regular" }, " Powered by Buzapay ", -1)),
@@ -413,7 +408,7 @@ const Ae = {
413
408
  ])
414
409
  ]));
415
410
  }
416
- }), Xe = ["src", "height", "alt"], I = /* @__PURE__ */ _({
411
+ }), Xe = ["src", "height", "alt"], A = /* @__PURE__ */ _({
417
412
  __name: "image",
418
413
  props: {
419
414
  src: {},
@@ -454,7 +449,7 @@ const Ae = {
454
449
  if (s.value) return;
455
450
  const v = e.defaultValue ?? (e.options.length ? e.options[0].value : "");
456
451
  i.value = v, v && (n("update:modelValue", v), n("selectedChange", v));
457
- }), H(
452
+ }), P(
458
453
  () => e.modelValue,
459
454
  (v) => {
460
455
  s.value && (i.value = v ?? "");
@@ -470,7 +465,7 @@ const Ae = {
470
465
  const h = k(
471
466
  () => e.type === "horizontal" ? "flex-row gap-5" : "flex-col gap-6"
472
467
  ), { options: u, type: y, className: g } = e;
473
- return (v, A) => (r(), d("div", {
468
+ return (v, H) => (r(), d("div", {
474
469
  class: S(["flex", h.value, t(g)]),
475
470
  role: "radiogroup",
476
471
  "aria-orientation": t(y) === "horizontal" ? "horizontal" : "vertical",
@@ -579,17 +574,17 @@ const Ae = {
579
574
  hasValueCopy: y,
580
575
  value: g,
581
576
  valueCustomClass: v,
582
- alignRight: A
577
+ alignRight: H
583
578
  } = a;
584
579
  return (N, T) => t(c) === "vertical" ? (r(), d("div", {
585
580
  key: 0,
586
- class: S(["flex flex-col gap-1", t(A) ? "text-right items-end" : ""])
581
+ class: S(["flex flex-col gap-1", t(H) ? "text-right items-end" : ""])
587
582
  }, [
588
583
  l("p", {
589
584
  class: S(t(p))
590
585
  }, $(e.value), 3),
591
586
  l("div", ut, [
592
- n.value ? (r(), w(I, {
587
+ n.value ? (r(), w(A, {
593
588
  key: 0,
594
589
  src: t(h),
595
590
  alt: t(g),
@@ -608,7 +603,7 @@ const Ae = {
608
603
  copyText: t(g),
609
604
  color: "#9DBFDE"
610
605
  }, null, 8, ["copyText"])) : C("", !0),
611
- s.value ? (r(), w(I, {
606
+ s.value ? (r(), w(A, {
612
607
  key: 4,
613
608
  src: t(h),
614
609
  alt: t(g),
@@ -621,7 +616,7 @@ const Ae = {
621
616
  class: S(t(p))
622
617
  }, $(e.value), 3),
623
618
  l("div", dt, [
624
- n.value ? (r(), w(I, {
619
+ n.value ? (r(), w(A, {
625
620
  key: 0,
626
621
  src: t(h),
627
622
  alt: t(g),
@@ -636,7 +631,7 @@ const Ae = {
636
631
  copyText: t(g),
637
632
  color: "#9DBFDE"
638
633
  }, null, 8, ["copyText"])) : C("", !0),
639
- s.value ? (r(), w(I, {
634
+ s.value ? (r(), w(A, {
640
635
  key: 2,
641
636
  src: t(h),
642
637
  alt: t(g),
@@ -752,7 +747,7 @@ const Ae = {
752
747
  emits: ["update:modelValue", "blur", "copied"],
753
748
  setup(o, { emit: a }) {
754
749
  const e = o, n = a, s = k(() => e.modelValue !== void 0), i = x(e.modelValue ?? e.defaultValue ?? ""), c = x(""), p = x(""), h = x(null);
755
- H(
750
+ P(
756
751
  () => e.modelValue,
757
752
  (b) => {
758
753
  s.value && (i.value = b ?? "");
@@ -777,7 +772,7 @@ const Ae = {
777
772
  function v(b) {
778
773
  e.rules.includes("numeric") && Ve(b);
779
774
  }
780
- const A = k(
775
+ const H = k(
781
776
  () => e.disabled ? "bg-grey-50 cursor-not-allowed" : "bg-white"
782
777
  ), N = k(
783
778
  () => e.validationError || p.value ? "border-red-300 bg-red-50" : "border-grey-100"
@@ -802,11 +797,11 @@ const Ae = {
802
797
  l("div", {
803
798
  class: S([
804
799
  "border-c px-3 py-2 flex items-center justify-between rounded-md h-12",
805
- A.value,
800
+ H.value,
806
801
  N.value
807
802
  ])
808
803
  }, [
809
- P(b.$slots, "prefix"),
804
+ I(b.$slots, "prefix"),
810
805
  l("input", {
811
806
  ref_key: "inputEl",
812
807
  ref: h,
@@ -821,8 +816,8 @@ const Ae = {
821
816
  onKeydown: v
822
817
  }, null, 40, $t),
823
818
  b.loading ? (r(), d("div", St)) : (r(), d(W, { key: 0 }, [
824
- P(b.$slots, "suffix"),
825
- b.showCopyIcon && i.value.trim() !== "" ? (r(), w(I, {
819
+ I(b.$slots, "suffix"),
820
+ b.showCopyIcon && i.value.trim() !== "" ? (r(), w(A, {
826
821
  key: 0,
827
822
  src: "assets/images/copyIcon.svg",
828
823
  alt: "copy",
@@ -925,12 +920,12 @@ const Ae = {
925
920
  emits: ["update:modelValue", "change"],
926
921
  setup(o, { emit: a }) {
927
922
  const e = o, n = a, s = x(!1), i = x(e.defaultValue ?? e.modelValue ?? ""), c = x([...e.options]), p = x(-1), h = x(null), u = x(null), y = x(null), g = k(() => e.modelValue !== void 0);
928
- H(
923
+ P(
929
924
  () => e.modelValue,
930
925
  (f) => {
931
926
  g.value && (i.value = f ?? "");
932
927
  }
933
- ), H(
928
+ ), P(
934
929
  () => e.options,
935
930
  (f) => {
936
931
  c.value = [...f];
@@ -940,7 +935,7 @@ const Ae = {
940
935
  const v = k(() => {
941
936
  const f = g.value ? e.modelValue : i.value;
942
937
  return e.options.find((B) => B.value === f) ?? null;
943
- }), A = k(() => {
938
+ }), H = k(() => {
944
939
  var f;
945
940
  return ((f = v.value) == null ? void 0 : f.label) || e.placeholder || (e.label ? `Select ${e.label}` : "Select an option");
946
941
  });
@@ -966,7 +961,7 @@ const Ae = {
966
961
  const B = f.target, L = h.value, V = u.value;
967
962
  L && !L.contains(B) && V && !V.contains(B) && T();
968
963
  }
969
- H(s, (f) => {
964
+ P(s, (f) => {
970
965
  f ? document.addEventListener("mousedown", b) : document.removeEventListener("mousedown", b);
971
966
  }), le(
972
967
  () => document.removeEventListener("mousedown", b)
@@ -1080,9 +1075,9 @@ const Ae = {
1080
1075
  onKeydown: j
1081
1076
  }, [
1082
1077
  l("div", qt, [
1083
- P(f.$slots, "prefix"),
1078
+ I(f.$slots, "prefix"),
1084
1079
  l("div", Kt, [
1085
- v.value && t(se) === "country" && v.value.countryCode ? (r(), w(I, {
1080
+ v.value && t(se) === "country" && v.value.countryCode ? (r(), w(A, {
1086
1081
  key: 0,
1087
1082
  src: `https://flagcdn.com/w40/${v.value.countryCode.toLowerCase()}.png`,
1088
1083
  alt: v.value.countryCode,
@@ -1091,7 +1086,7 @@ const Ae = {
1091
1086
  }, null, 8, ["src", "alt"])) : C("", !0),
1092
1087
  l("p", {
1093
1088
  class: S(["text-body-2xs font-normal mb-0", (L = v.value) != null && L.label ? "text-sub-copy" : "text-grey-500"])
1094
- }, $(A.value), 3)
1089
+ }, $(H.value), 3)
1095
1090
  ])
1096
1091
  ]),
1097
1092
  t(_e) ? (r(), d("span", Rt)) : s.value ? (r(), w(It, {
@@ -1137,7 +1132,7 @@ const Ae = {
1137
1132
  ne === p.value ? "bg-gray-100" : ""
1138
1133
  ])
1139
1134
  }, [
1140
- t(se) === "country" && V.countryCode ? (r(), w(I, {
1135
+ t(se) === "country" && V.countryCode ? (r(), w(A, {
1141
1136
  key: 0,
1142
1137
  src: `https://flagcdn.com/w40/${V.countryCode.toLowerCase()}.png`,
1143
1138
  alt: V.countryCode,
@@ -1270,7 +1265,7 @@ const Ae = {
1270
1265
  }, 1e3);
1271
1266
  }), le(() => {
1272
1267
  i.value && (clearInterval(i.value), i.value = null);
1273
- }), H(s, (p) => {
1268
+ }), P(s, (p) => {
1274
1269
  p < 0 && i.value && (clearInterval(i.value), i.value = null);
1275
1270
  }), (p, h) => (r(), d("div", ol, [
1276
1271
  l("p", al, " Amount to Pay " + $(p.amountDisplay), 1),
@@ -1504,7 +1499,7 @@ const Ae = {
1504
1499
  })
1505
1500
  ], 64)) : (r(), d("div", Dl, [
1506
1501
  l("div", El, [
1507
- m(I, {
1502
+ m(A, {
1508
1503
  src: "../../../assets/images/stable-coin-qr-code.png",
1509
1504
  alt: "QR Code",
1510
1505
  width: 122,
@@ -1641,7 +1636,7 @@ const Ae = {
1641
1636
  l("div", Gl, [
1642
1637
  e.value === "PAYMENT" || e.value === "STABLE_COIN_PAYMENT" ? (r(), d("div", Wl, [
1643
1638
  e.value === "PAYMENT" ? (r(), d("div", Jl, [
1644
- (y = h.options) != null && y.imageUrl ? (r(), w(I, {
1639
+ (y = h.options) != null && y.imageUrl ? (r(), w(A, {
1645
1640
  key: 0,
1646
1641
  src: h.options.imageUrl,
1647
1642
  alt: "Merchant Logo",