@invoice-sdk/widget 1.117.2 → 1.117.3

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.
@@ -1,12 +1,12 @@
1
1
  var X = Object.defineProperty;
2
- var W = Object.getOwnPropertySymbols;
2
+ var R = Object.getOwnPropertySymbols;
3
3
  var G = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
4
- var O = (n, i, t) => i in n ? X(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t, P = (n, i) => {
4
+ var W = (n, i, t) => i in n ? X(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t, O = (n, i) => {
5
5
  for (var t in i || (i = {}))
6
- G.call(i, t) && O(n, t, i[t]);
7
- if (W)
8
- for (var t of W(i))
9
- I.call(i, t) && O(n, t, i[t]);
6
+ G.call(i, t) && W(n, t, i[t]);
7
+ if (R)
8
+ for (var t of R(i))
9
+ I.call(i, t) && W(n, t, i[t]);
10
10
  return n;
11
11
  };
12
12
  var Z = (n, i, t) => new Promise((e, s) => {
@@ -25,8 +25,8 @@ var Z = (n, i, t) => new Promise((e, s) => {
25
25
  }, p = (c) => c.done ? e(c.value) : Promise.resolve(c.value).then(o, a);
26
26
  p((t = t.apply(n, i)).next());
27
27
  });
28
- import { c as q, f as $, e as J, b as K, o as z, s as Q } from "./loading-C3ucr0cT.js";
29
- import { t as r, c as R } from "./index-COFYTrh_.js";
28
+ import { c as P, f as $, e as J, b as K, o as z, s as Q } from "./loading-rwAF7i1q.js";
29
+ import { t as r, c as q } from "./index-CeiOdPnU.js";
30
30
  function Y({ defaultValues: n = {}, onChange: i } = {}) {
31
31
  const t = {
32
32
  representativeName: n.representativeName || "",
@@ -36,7 +36,7 @@ function Y({ defaultValues: n = {}, onChange: i } = {}) {
36
36
  }, e = document.createElement("div");
37
37
  e.className = "wgt:space-y-2";
38
38
  function s() {
39
- typeof i == "function" && i(P({}, t));
39
+ typeof i == "function" && i(O({}, t));
40
40
  }
41
41
  function o({ label: g, required: l, name: h, type: M = "text", placeholder: v }) {
42
42
  const w = document.createElement("div");
@@ -80,7 +80,7 @@ function Y({ defaultValues: n = {}, onChange: i } = {}) {
80
80
  return t.representativeName.trim() || l(p), t.email.trim() || l(x), g;
81
81
  }
82
82
  function E() {
83
- return P({}, t);
83
+ return O({}, t);
84
84
  }
85
85
  return { container: e, getValues: E, validate: L };
86
86
  }
@@ -100,7 +100,7 @@ function D({
100
100
  }, s = document.createElement("div");
101
101
  s.className = "wgt:space-y-2";
102
102
  function o() {
103
- typeof i == "function" && i(P({}, e));
103
+ typeof i == "function" && i(O({}, e));
104
104
  }
105
105
  function a({ label: N, required: d, name: u, type: _ = "text", placeholder: V }) {
106
106
  const F = document.createElement("div");
@@ -136,7 +136,7 @@ function D({
136
136
  "wgt:bg-semantic-error-50"
137
137
  ), o();
138
138
  });
139
- const l = q({
139
+ const l = P({
140
140
  type: "button",
141
141
  title: r("fetch_info"),
142
142
  className: "wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:font-semibold wgt:rounded-lg wgt:flex-shrink-0 wgt:text-primary wgt:bg-white wgt:border wgt:border-primary",
@@ -153,7 +153,7 @@ function D({
153
153
  }
154
154
  try {
155
155
  l.disabled = !0;
156
- const d = yield t(N, P({}, e));
156
+ const d = yield t(N, O({}, e));
157
157
  if (!d || typeof d != "object") return;
158
158
  d.representativeName != null && (e.representativeName = String(d.representativeName || ""), M.value = e.representativeName), d.buyerAddress != null && (e.buyerAddress = String(d.buyerAddress || ""), w.value = e.buyerAddress), o();
159
159
  } catch (d) {
@@ -208,7 +208,7 @@ function D({
208
208
  return !e.noTaxCode && !e.taxCode.trim() && d(g), e.representativeName.trim() || d(M), e.performerName.trim() || d(C), e.email.trim() || d(S), e.phone.trim() || d(T), N;
209
209
  }
210
210
  function H() {
211
- return P({}, e);
211
+ return O({}, e);
212
212
  }
213
213
  return { container: s, getValues: H, validate: A };
214
214
  }
@@ -308,14 +308,14 @@ function ee({
308
308
  )), v.appendChild(w), p.appendChild(v);
309
309
  const C = document.createElement("div");
310
310
  C.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
311
- const B = q({
311
+ const B = P({
312
312
  type: "button",
313
313
  title: "Đóng",
314
314
  className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-white wgt:text-primary wgt:border wgt:border-primary",
315
315
  handleClick: () => {
316
316
  typeof s == "function" && s();
317
317
  }
318
- }), S = q({
318
+ }), S = P({
319
319
  type: "button",
320
320
  title: "Xác nhận",
321
321
  className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-primary wgt:text-white",
@@ -437,7 +437,7 @@ function te({
437
437
  A.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", A.textContent = r("invoiceform_note"), a.appendChild(A);
438
438
  const H = document.createElement("div");
439
439
  H.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
440
- const N = q({
440
+ const N = P({
441
441
  type: "button",
442
442
  title: r("btn_preview"),
443
443
  className: "wgt:min-w-[163px] wgt:text-white",
@@ -465,34 +465,37 @@ function te({
465
465
  data: d.data
466
466
  }), y = (F = (V = (_ = b == null ? void 0 : b.finalData) != null ? _ : b == null ? void 0 : b.data) != null ? V : b) != null ? F : {}, j = String((y == null ? void 0 : y.status) || "").trim().toLowerCase();
467
467
  if (f(), j === "invoiced") {
468
- R({
468
+ q({
469
469
  message: r("invoice_success"),
470
470
  description: r("invoice_description"),
471
471
  // okLabel: t('close'),
472
472
  isSuccess: !0,
473
473
  hideOkButton: !0,
474
- theme: t
474
+ theme: t,
475
+ closeOnClickOutside: !1
475
476
  }).open();
476
477
  return;
477
478
  }
478
479
  if (j === "failed") {
479
- R({
480
+ q({
480
481
  message: r("invoice_failed"),
481
482
  description: r("invoice_description_failed"),
482
483
  // okLabel: t('close'),
483
484
  isSuccess: !1,
484
485
  hideOkButton: !0,
485
- theme: t
486
+ theme: t,
487
+ closeOnClickOutside: !1
486
488
  }).open();
487
489
  return;
488
490
  }
489
491
  } catch (b) {
490
- f(), R({
492
+ f(), q({
491
493
  message: r("invoice_failed"),
492
494
  description: r("invoice_description_failed"),
493
495
  // okLabel: t('close'),
494
496
  isSuccess: !1,
495
497
  hideOkButton: !0,
498
+ closeOnClickOutside: !1,
496
499
  theme: t
497
500
  }).open(), console.error(b);
498
501
  }