@invoice-sdk/widget 1.120.7 → 1.120.9
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-D1Ls5h38.js → index-BVQxhEzI.js} +3 -3
- package/dist/{index-BVU1yLiL.js → index-Ci9DMuK8.js} +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/{loading-D4lDw9v-.js → loading-DzS7fOqH.js} +2 -2
- package/dist/{widget-Ds7OhdnW.js → widget-82wZHnDl.js} +2 -2
- package/package.json +1 -1
|
@@ -5098,7 +5098,7 @@ function id(e) {
|
|
|
5098
5098
|
function Hd(e) {
|
|
5099
5099
|
return S(this, null, function* () {
|
|
5100
5100
|
if (pe(e), !ie) {
|
|
5101
|
-
const { InvoiceRegisterWidget: i } = yield import("./widget-
|
|
5101
|
+
const { InvoiceRegisterWidget: i } = yield import("./widget-82wZHnDl.js");
|
|
5102
5102
|
ie = i;
|
|
5103
5103
|
}
|
|
5104
5104
|
const A = me(e.selector), t = yield ie(
|
|
@@ -5121,7 +5121,7 @@ function Hd(e) {
|
|
|
5121
5121
|
function jd(e) {
|
|
5122
5122
|
return S(this, null, function* () {
|
|
5123
5123
|
if (pe(e), !te) {
|
|
5124
|
-
const { EContractWidget: t } = yield import("./widget-
|
|
5124
|
+
const { EContractWidget: t } = yield import("./widget-82wZHnDl.js");
|
|
5125
5125
|
te = t;
|
|
5126
5126
|
}
|
|
5127
5127
|
const A = me(e.selector);
|
|
@@ -5172,7 +5172,7 @@ function Yd(e) {
|
|
|
5172
5172
|
})
|
|
5173
5173
|
};
|
|
5174
5174
|
}
|
|
5175
|
-
ne || (ne = (yield import("./index-
|
|
5175
|
+
ne || (ne = (yield import("./index-Ci9DMuK8.js")).createInvoiceRequestFlow);
|
|
5176
5176
|
const i = ne({
|
|
5177
5177
|
uuid: t,
|
|
5178
5178
|
orderInfo: e.orderInfo || { code: "", address: "", total: "" },
|
|
@@ -25,8 +25,8 @@ var j = (r, t, e) => new Promise((i, l) => {
|
|
|
25
25
|
}, g = (p) => p.done ? i(p.value) : Promise.resolve(p.value).then(s, a);
|
|
26
26
|
g((e = e.apply(r, t)).next());
|
|
27
27
|
});
|
|
28
|
-
import { c as G, f as te, e as oe, b as le, o as ne, s as de } from "./loading-
|
|
29
|
-
import { t as n, c as J, j as ce } from "./index-
|
|
28
|
+
import { c as G, f as te, e as oe, b as le, o as ne, s as de } from "./loading-DzS7fOqH.js";
|
|
29
|
+
import { t as n, c as J, j as ce } from "./index-BVQxhEzI.js";
|
|
30
30
|
function z(r) {
|
|
31
31
|
const t = r.trim();
|
|
32
32
|
return t ? t.length < 2 || t.length > 250 ? { valid: !1, error: n("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(t) ? { valid: !1, error: n("invalid_characters") } : { valid: !0 } : { valid: !1, error: n("required_name") };
|
package/dist/index.esm.js
CHANGED
package/dist/index.umd.js
CHANGED
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
</svg>`:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
|
127
127
|
<path d="M9 6L15 12L9 18" stroke="#0E121B" stroke-width="2"
|
|
128
128
|
stroke-linecap="round" stroke-linejoin="round"/>
|
|
129
|
-
</svg>`,B}const m=g("prev"),C=g("next");m.style.left="8px",C.style.right="8px",s.appendChild(m),s.appendChild(C);let E=n,v=A,x=a;const p=()=>window.matchMedia("(max-width: 414px)").matches;function w(){const N=u.getBoundingClientRect(),B=s.getBoundingClientRect(),k=N.top-B.top+N.height/2;m.style.top=`${k}px`,C.style.top=`${k}px`,m.style.transform="translateY(-50%)",C.style.transform="translateY(-50%)"}function y(){const N=u.firstElementChild;return N?N.getBoundingClientRect().width+24:300}function X(N){u.scrollBy({left:N*y(),behavior:"smooth"})}function f(){if(p())return;const N=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,C.disabled=u.scrollLeft>=N-2}m.addEventListener("click",()=>X(-1)),C.addEventListener("click",()=>X(1)),u.addEventListener("scroll",f);function Q(){if(u.innerHTML="",!E||E.length===0){const N=document.createElement("div");N.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",N.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(N);return}E.forEach(N=>{const B=N._id===x,k=v.includes(N.code),{container:b}=v1({pkg:N,type:t,isDiscounted:k,promotion:e,isSelected:B,isRenew:i,onSelect:()=>{c((h||i)&&B?"":N._id)}});b.classList.add("wgt:snap-start"),u.appendChild(b)}),requestAnimationFrame(()=>{w(),f()})}Q();let M=!1,H=0,z=0;u.addEventListener("mousedown",N=>{M=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),H=N.pageX,z=u.scrollLeft});const L=()=>{M&&(M=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",L),u.addEventListener("mouseleave",L),u.addEventListener("mousemove",N=>{M&&(N.preventDefault(),u.scrollLeft=z-(N.pageX-H)*1.5)}),u.addEventListener("wheel",N=>{N.preventDefault(),u.scrollLeft+=N.deltaY},{passive:!1});const T=new ResizeObserver(()=>w());return T.observe(u),T.observe(s),{container:o,render:Q,setSelectedPackageId(N){x=N,Q()},updateData(N,B=null,k=null){E=N||E,B!==null&&(v=B),k!==null&&(x=k),Q()},updateDiscountedOnly(N){v=N,Q()}}}const M1="1.120.
|
|
129
|
+
</svg>`,B}const m=g("prev"),C=g("next");m.style.left="8px",C.style.right="8px",s.appendChild(m),s.appendChild(C);let E=n,v=A,x=a;const p=()=>window.matchMedia("(max-width: 414px)").matches;function w(){const N=u.getBoundingClientRect(),B=s.getBoundingClientRect(),k=N.top-B.top+N.height/2;m.style.top=`${k}px`,C.style.top=`${k}px`,m.style.transform="translateY(-50%)",C.style.transform="translateY(-50%)"}function y(){const N=u.firstElementChild;return N?N.getBoundingClientRect().width+24:300}function X(N){u.scrollBy({left:N*y(),behavior:"smooth"})}function f(){if(p())return;const N=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,C.disabled=u.scrollLeft>=N-2}m.addEventListener("click",()=>X(-1)),C.addEventListener("click",()=>X(1)),u.addEventListener("scroll",f);function Q(){if(u.innerHTML="",!E||E.length===0){const N=document.createElement("div");N.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",N.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(N);return}E.forEach(N=>{const B=N._id===x,k=v.includes(N.code),{container:b}=v1({pkg:N,type:t,isDiscounted:k,promotion:e,isSelected:B,isRenew:i,onSelect:()=>{c((h||i)&&B?"":N._id)}});b.classList.add("wgt:snap-start"),u.appendChild(b)}),requestAnimationFrame(()=>{w(),f()})}Q();let M=!1,H=0,z=0;u.addEventListener("mousedown",N=>{M=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),H=N.pageX,z=u.scrollLeft});const L=()=>{M&&(M=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",L),u.addEventListener("mouseleave",L),u.addEventListener("mousemove",N=>{M&&(N.preventDefault(),u.scrollLeft=z-(N.pageX-H)*1.5)}),u.addEventListener("wheel",N=>{N.preventDefault(),u.scrollLeft+=N.deltaY},{passive:!1});const T=new ResizeObserver(()=>w());return T.observe(u),T.observe(s),{container:o,render:Q,setSelectedPackageId(N){x=N,Q()},updateData(N,B=null,k=null){E=N||E,B!==null&&(v=B),k!==null&&(x=k),Q()},updateDiscountedOnly(N){v=N,Q()}}}const M1="1.120.9";function k1(A){return _(this,arguments,function*({search:t,bank:n}){return(yield At.get(`${$A}`,{params:{isActive:!0,search:t||null,type:"service",bank:n}})).data})}function N1(n){return _(this,arguments,function*({bank:t}){return(yield At.get(`${$A}`,{params:{isActive:!0,type:"initial_fee",bank:t}})).data})}function X1(e){return _(this,arguments,function*({bank:t,hasRenew:n,isCashRegister:A}){return(yield At.get(`${$A}`,{params:{isActive:!0,type:"service",bank:t,hasRenew:n,limit:99,isCashRegister:A}})).data})}function H1(n){return _(this,arguments,function*({bank:t}){return(yield At.get(`${$A}`,{params:{isActive:!0,type:"signature",bank:t,limit:99}})).data})}function S1(t){return _(this,null,function*(){const n=new FormData;return n.append("eInvoiceRegistration",JSON.stringify(t.eInvoiceRegistration)),n.append("provider",t.provider),n.append("bank",t.bank),n.append("packages",JSON.stringify(t.packages)),n.append("promotionCodes",JSON.stringify(t.promotionCodes)),n.append("logo",t.logo),n.append("organizationRegistrationCert",t.organizationRegistrationCert),t.legalRepresentativeIdCard.forEach(e=>{n.append("legalRepresentativeIdCard",e)}),n.append("isRenew",t.isRenew),n.append("isCashRegister",t.isCashRegister),yield At.post(Gi,n,{headers:{"Content-Type":"multipart/form-data","X-Invoice-Widget-Mode":UA(),"X-Invoice-Widget-Version":M1}})})}function L1(t){return _(this,null,function*(){return yield At.get(`${Vi}/${t}/status`)})}function J1(){return _(this,arguments,function*({isRenewable:t,serialNumber:n}={}){const A={isRenewable:!!t,serialNumber:(n!=null?n:"").trim()};return console.log("PROMO params:",A),(yield At.get(Ui,{params:A})).data})}function b1(t){return _(this,null,function*(){return yield At.post(`${_i}/${t}`)})}function kh(t){return _(this,null,function*(){return yield At.get(`${$i}/${encodeURIComponent(t)}`)})}function P1(t,n){return _(this,null,function*(){try{return yield At.post(`${no}/${encodeURIComponent(t)}`,n)}catch(A){throw A}})}function z1({name:t,value:n,feeLabel:A,required:e,description:a,isChecked:h=!0,onChange:c=null}){const i=document.createElement("label");i.className=["wgt:relative","wgt:flex","wgt:items-start","wgt:gap-3","wgt:px-4","wgt:py-3","wgt:-mt-4","wgt:@max-2xl:px-0"].join(" ");const o=Ce({name:t,value:n,checked:h,onChange:g=>{console.log("Checkbox state changed to:",g),c&&c(g)}});i.appendChild(o.container);const s=document.createElement("div");s.className="wgt:flex wgt:flex-col wgt:gap-1";const r=document.createElement("div");r.className="wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";const u=document.createElement("span");u.className="wgt:text-base wgt:font-semibold wgt:text-text-sub-600",u.textContent=A,r.appendChild(u);{const g=document.createElement("span");g.className=["wgt:bg-soft-200","wgt:text-text-sub-600","wgt:text-xs","wgt:font-semibold","wgt:px-1.5","wgt:py-1","wgt:rounded-sm"].join(" "),g.textContent=q("required"),r.appendChild(g)}s.appendChild(r);const l=document.createElement("p");return l.className="wgt:text-text-soft-400 wgt:text-sm",l.textContent=a,s.appendChild(l),i.appendChild(s),{container:i}}function KA(){const t=document.createElement("div");t.className="wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm",t.style.display="none";const n=document.createElement("div");n.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";const A=document.createElement("div");return A.className="wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent",n.appendChild(A),t.appendChild(n),{container:t,open:()=>{t.style.display="flex"},close:()=>{t.style.display="none"}}}function K1({promotion:t,onSelect:n,isHidden:A=!1,isSelectable:e=!0}){const a=document.createElement("div");if(A)return a.style.display="none",{container:a};e&&t.isSelected,a.className="wgt:w-full wgt:flex wgt:items-center wgt:relative wgt:h-[6.75rem]";const h=document.createElement("div");h.className="wgt:absolute wgt:top-0 wgt:left-0 wgt:z-0",h.innerHTML=`<svg width="177" height="108" viewBox="0 0 177 108" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
130
130
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0743 3.375H37.1375V0H166.603C172.3 0 176.919 5.65535 176.919 12.6316V95.3684C176.919 102.345 172.3 108 166.603 108H37.1375V104.625H35.0743V108H10.316C4.61862 108 4.15411e-08 102.345 0 95.3684V93.4737C3.41841 93.4737 6.18958 90.0805 6.18958 85.8947C6.18958 81.709 3.41841 78.3158 0 78.3158V72C3.41841 72 6.18958 68.6068 6.18958 64.4211C6.18958 60.2353 3.41841 56.8421 0 56.8421V50.5263C3.41841 50.5263 6.18958 47.1331 6.18958 42.9474C6.18958 38.7616 3.41841 35.3684 0 35.3684V29.0526C3.41841 29.0526 6.18958 25.6594 6.18958 21.4737C6.18958 17.2879 3.41841 13.8947 0 13.8947V12.6316C0 5.65535 4.61862 0 10.316 0H35.0743V3.375ZM35.0743 97.875H37.1375V91.125H35.0743V97.875ZM35.0743 84.375H37.1375V77.625H35.0743V84.375ZM35.0743 70.875H37.1375V64.125H35.0743V70.875ZM35.0743 57.375H37.1375V50.625H35.0743V57.375ZM35.0743 43.875H37.1375V37.125H35.0743V43.875ZM35.0743 30.375H37.1375V23.625H35.0743V30.375ZM35.0743 16.875H37.1375V10.125H35.0743V16.875Z" fill="#C0D5FF"/>
|
|
131
131
|
</svg>
|
|
132
132
|
`;const c=document.createElement("div");c.className="wgt:w-full wgt:relative wgt:z-10 wgt:h-full wgt:bg-white wgt:rounded-tr wgt:rounded-br wgt:px-4 wgt:py-3 wgt:ml-9 wgt:flex wgt:flex-col wgt:justify-between";const i=document.createElement("div");i.className="wgt:flex wgt:items-start wgt:flex-col wgt:relative";const o=document.createElement("h3");o.className=["wgt:text-base","wgt:font-semibold","wgt:text-gray-500","wgt:mb-1","wgt:text-primary"].join(" "),o.textContent=t.code,i.appendChild(o);const s=document.createElement("p");s.className=["wgt:text-sm","wgt:text-text-sub-600","wgt:mb-2"].join(" ");const r=zA(_t());s.textContent=t[r],i.appendChild(s);const{container:u}=Ce({checked:t.isSelected,onChange:()=>{let g=!t.isSelected;n(t.code,g)},isIconCheckbox:!0});e||(u.style.display="none"),u.className="wgt:absolute wgt:top-0 wgt:right-0",i.appendChild(u),c.appendChild(i);const l=document.createElement("p");return l.className=["wgt:text-xs","wgt:font-normal","wgt:text-right","wgt:text-[#335CFF]","wgt:italic"].join(" "),l.textContent=`${q("validityPeriod")}: ${q("expiredDate")} ${t.expiredAt.split("T")[0]}`,c.appendChild(l),a.appendChild(h),a.appendChild(c),{container:a}}function D1({value:t="",placeholder:n="",onInputChange:A=void 0}){const e=n||q("searchUnits"),a=document.createElement("div");a.className="wgt:flex wgt:flex-col";const h=document.createElement("div");h.className="wgt:flex wgt:rounded-lg wgt:border wgt:border-gray-300 wgt:overflow-hidden",a.appendChild(h);const c=document.createElement("input");return c.type="text",c.inputMode="numeric",c.value=t,c.placeholder=e,c.className="wgt:flex-1 wgt:px-4 wgt:py-2 wgt:text-text-sub-600 wgt:placeholder-gray-400 wgt:bg-white wgt:focus:outline-none",typeof A=="function"&&c.addEventListener("input",A),h.appendChild(c),{container:a}}function O1({theme:t,debounceTimer:n,typedUnits:A,onSearchComplete:e}){let a=[],h=[];const c=document.createElement("div");c.className="wgt:flex wgt:flex-col wgt:gap-3";const i=document.createElement("div");i.className="wgt:flex wgt:flex-col wgt:gap-4",c.appendChild(i);const o=document.createElement("h2");o.className="wgt:text-xl wgt:font-bold wgt:text-text-black",o.innerText=q("selectInvoicePackage");const s=document.createElement("span");s.className="wgt:text-sm wgt:text-red-500 wgt:ml-1",s.innerText="*",o.appendChild(s),i.appendChild(o);function r(){return _(this,null,function*(){n&&clearTimeout(n),A!==""?n=setTimeout(()=>_(null,null,function*(){try{const x=A.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g,"."),p=yield k1({search:x,bank:t});p&&(h=p),e&&e()}catch(x){console.error("Error searching packages:",x),Vt.error(q("errorSearchingPackages"),{autoClose:5e3,closeButton:!0,icon:!0})}}),500):(h=a,e&&e())})}const u=D1({value:"",placeholder:q("searchUnits"),onInputChange:x=>{A=x.target.value.replace(/\D/g,""),r()}});i.appendChild(u.container);const l=document.createElement("div");l.className="wgt:flex wgt:flex-col wgt:gap-2",c.appendChild(l);const g=document.createElement("h3");g.className="wgt:text-sm wgt:font-semibold wgt:text-[#525866]",g.innerText=q("mostSuitablePackage"),l.appendChild(g);const m=document.createElement("div");l.appendChild(m);const C=document.createElement("div");C.className="wgt:flex wgt:items-center wgt:justify-center wgt:py-8",C.innerHTML=`
|
|
@@ -14,7 +14,7 @@ var n = (e, t, r) => new Promise((o, c) => {
|
|
|
14
14
|
}, g = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, d);
|
|
15
15
|
g((r = r.apply(e, t)).next());
|
|
16
16
|
});
|
|
17
|
-
import { k as l, g as w, l as f, C as m, G as y, n as E, I as R, S as v, o as C, a as h, p as I, q as p, r as O, O as T } from "./index-
|
|
17
|
+
import { k as l, g as w, l as f, C as m, G as y, n as E, I as R, S as v, o as C, a as h, p as I, q as p, r as O, O as T } from "./index-BVQxhEzI.js";
|
|
18
18
|
function k({
|
|
19
19
|
title: e,
|
|
20
20
|
isDisabled: t = !1,
|
|
@@ -95,7 +95,7 @@ function $(e, t) {
|
|
|
95
95
|
})).data;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const A = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.120.
|
|
98
|
+
const A = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.120.9";
|
|
99
99
|
function U(r) {
|
|
100
100
|
return n(this, arguments, function* ({ search: e, bank: t }) {
|
|
101
101
|
return (yield a.get(`${p}`, {
|
|
@@ -35,8 +35,8 @@ var mn = (t, n, e) => new Promise((c, h) => {
|
|
|
35
35
|
}, o = (u) => u.done ? c(u.value) : Promise.resolve(u.value).then(a, A);
|
|
36
36
|
o((e = e.apply(t, n)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as g, g as _h, a as $h, b as vt, s as n0, c as Ot, d as T1, e as x1, f as d1, m as w1, h as p1, i as C1, v as f1 } from "./index-
|
|
39
|
-
import { c as Qt, a as c0, g as t0, b as X1, f as bn, d as B1, e as e0, h as N1, i as E1, j as H1, k as y1, l as k1, m as P1, n as v1 } from "./loading-
|
|
38
|
+
import { t as g, g as _h, a as $h, b as vt, s as n0, c as Ot, d as T1, e as x1, f as d1, m as w1, h as p1, i as C1, v as f1 } from "./index-BVQxhEzI.js";
|
|
39
|
+
import { c as Qt, a as c0, g as t0, b as X1, f as bn, d as B1, e as e0, h as N1, i as E1, j as H1, k as y1, l as k1, m as P1, n as v1 } from "./loading-DzS7fOqH.js";
|
|
40
40
|
import { g as n1 } from "./_commonjsHelpers-bAxELxBV.js";
|
|
41
41
|
function lh({ steps: t = [], currentStep: n = 1 } = {}) {
|
|
42
42
|
const e = document.createElement("div");
|