@invoice-sdk/widget 1.124.4 → 1.124.5
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-CNB26P5W.js → index-Cnbz4UeV.js} +3 -3
- package/dist/{index-6Tzpgq-I.js → index-Cpz5mfwZ.js} +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/{loading-BCCQ18FQ.js → loading-XZIu7zzO.js} +2 -2
- package/dist/{widget-D4LFWjW1.js → widget-n_Wylz1g.js} +2 -2
- package/package.json +1 -1
|
@@ -5056,7 +5056,7 @@ function YB(e) {
|
|
|
5056
5056
|
}
|
|
5057
5057
|
async function wd(e) {
|
|
5058
5058
|
if (ce(e), !TA) {
|
|
5059
|
-
const { InvoiceRegisterWidget: i } = await import("./widget-
|
|
5059
|
+
const { InvoiceRegisterWidget: i } = await import("./widget-n_Wylz1g.js");
|
|
5060
5060
|
TA = i;
|
|
5061
5061
|
}
|
|
5062
5062
|
const A = Ee(e.selector), t = await TA(
|
|
@@ -5077,7 +5077,7 @@ async function wd(e) {
|
|
|
5077
5077
|
}
|
|
5078
5078
|
async function Md(e) {
|
|
5079
5079
|
if (ce(e), !WA) {
|
|
5080
|
-
const { EContractWidget: t } = await import("./widget-
|
|
5080
|
+
const { EContractWidget: t } = await import("./widget-n_Wylz1g.js");
|
|
5081
5081
|
WA = t;
|
|
5082
5082
|
}
|
|
5083
5083
|
const A = Ee(e.selector);
|
|
@@ -5123,7 +5123,7 @@ async function zd(e) {
|
|
|
5123
5123
|
}
|
|
5124
5124
|
};
|
|
5125
5125
|
}
|
|
5126
|
-
XA || (XA = (await import("./index-
|
|
5126
|
+
XA || (XA = (await import("./index-Cpz5mfwZ.js")).createInvoiceRequestFlow);
|
|
5127
5127
|
const i = XA({
|
|
5128
5128
|
uuid: t,
|
|
5129
5129
|
orderInfo: e.orderInfo || { code: "", address: "", total: "" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as O, f as G, e as te, b as ne, o as re, p as ie, s as ae, q as oe } from "./loading-
|
|
2
|
-
import { t, c as Q, j as se } from "./index-
|
|
1
|
+
import { c as O, f as G, e as te, b as ne, o as re, p as ie, s as ae, q as oe } from "./loading-XZIu7zzO.js";
|
|
2
|
+
import { t, c as Q, j as se } from "./index-Cnbz4UeV.js";
|
|
3
3
|
function B(i) {
|
|
4
4
|
const n = i.trim();
|
|
5
5
|
return n ? n.length < 2 || n.length > 250 ? { valid: !1, error: t("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(n) ? { valid: !1, error: t("invalid_characters") } : { valid: !0 } : { valid: !1, error: t("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>`,Q}const m=g("prev"),d=g("next");m.style.left="8px",d.style.right="8px",s.appendChild(m),s.appendChild(d);let w=n,x=e,T=a;const E=()=>window.matchMedia("(max-width: 414px)").matches;function p(){const H=u.getBoundingClientRect(),Q=s.getBoundingClientRect(),k=H.top-Q.top+H.height/2;m.style.top=`${k}px`,d.style.top=`${k}px`,m.style.transform="translateY(-50%)",d.style.transform="translateY(-50%)"}function M(){const H=u.firstElementChild;return H?H.getBoundingClientRect().width+24:300}function S(H){u.scrollBy({left:H*M(),behavior:"smooth"})}function f(){if(E())return;const H=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,d.disabled=u.scrollLeft>=H-2}m.addEventListener("click",()=>S(-1)),d.addEventListener("click",()=>S(1)),u.addEventListener("scroll",f);function v(){if(u.innerHTML="",!w||w.length===0){const H=document.createElement("div");H.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",H.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(H);return}w.forEach(H=>{const Q=H._id===T,k=x.includes(H.code),{container:R}=Xs({pkg:H,type:t,isDiscounted:k,promotion:A,isSelected:Q,isRenew:i,onSelect:()=>{c((h||i)&&Q?"":H._id)}});R.classList.add("wgt:snap-start"),u.appendChild(R)}),requestAnimationFrame(()=>{p(),f()})}v();let N=!1,J=0,P=0;u.addEventListener("mousedown",H=>{N=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),J=H.pageX,P=u.scrollLeft});const X=()=>{N&&(N=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",X),u.addEventListener("mouseleave",X),u.addEventListener("mousemove",H=>{N&&(H.preventDefault(),u.scrollLeft=P-(H.pageX-J)*1.5)}),u.addEventListener("wheel",H=>{H.preventDefault(),u.scrollLeft+=H.deltaY},{passive:!1});const B=new ResizeObserver(()=>p());return B.observe(u),B.observe(s),{container:o,render:v,setSelectedPackageId(H){T=H,v()},updateData(H,Q=null,k=null){w=H||w,Q!==null&&(x=Q),k!==null&&(T=k),v()},updateDiscountedOnly(H){x=H,v()}}}const Ss="1.124.
|
|
129
|
+
</svg>`,Q}const m=g("prev"),d=g("next");m.style.left="8px",d.style.right="8px",s.appendChild(m),s.appendChild(d);let w=n,x=e,T=a;const E=()=>window.matchMedia("(max-width: 414px)").matches;function p(){const H=u.getBoundingClientRect(),Q=s.getBoundingClientRect(),k=H.top-Q.top+H.height/2;m.style.top=`${k}px`,d.style.top=`${k}px`,m.style.transform="translateY(-50%)",d.style.transform="translateY(-50%)"}function M(){const H=u.firstElementChild;return H?H.getBoundingClientRect().width+24:300}function S(H){u.scrollBy({left:H*M(),behavior:"smooth"})}function f(){if(E())return;const H=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,d.disabled=u.scrollLeft>=H-2}m.addEventListener("click",()=>S(-1)),d.addEventListener("click",()=>S(1)),u.addEventListener("scroll",f);function v(){if(u.innerHTML="",!w||w.length===0){const H=document.createElement("div");H.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",H.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(H);return}w.forEach(H=>{const Q=H._id===T,k=x.includes(H.code),{container:R}=Xs({pkg:H,type:t,isDiscounted:k,promotion:A,isSelected:Q,isRenew:i,onSelect:()=>{c((h||i)&&Q?"":H._id)}});R.classList.add("wgt:snap-start"),u.appendChild(R)}),requestAnimationFrame(()=>{p(),f()})}v();let N=!1,J=0,P=0;u.addEventListener("mousedown",H=>{N=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),J=H.pageX,P=u.scrollLeft});const X=()=>{N&&(N=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",X),u.addEventListener("mouseleave",X),u.addEventListener("mousemove",H=>{N&&(H.preventDefault(),u.scrollLeft=P-(H.pageX-J)*1.5)}),u.addEventListener("wheel",H=>{H.preventDefault(),u.scrollLeft+=H.deltaY},{passive:!1});const B=new ResizeObserver(()=>p());return B.observe(u),B.observe(s),{container:o,render:v,setSelectedPackageId(H){T=H,v()},updateData(H,Q=null,k=null){w=H||w,Q!==null&&(x=Q),k!==null&&(T=k),v()},updateDiscountedOnly(H){x=H,v()}}}const Ss="1.124.5";async function Hs({search:t,bank:n}){return(await Sn.get(`${TA}`,{params:{isActive:!0,search:t||null,type:"service",bank:n}})).data}async function Ls({bank:t}){return(await Sn.get(`${TA}`,{params:{isActive:!0,type:"initial_fee",bank:t}})).data}async function Js({bank:t,hasRenew:n,isCashRegister:e,customerType:A}){return(await Sn.get(`${TA}`,{params:{isActive:!0,type:"service",bank:t,hasRenew:n,limit:99,isCashRegister:e,customerType:"ENTERPRISE"}})).data}async function Ps({bank:t}){return(await Sn.get(`${TA}`,{params:{isActive:!0,type:"signature",bank:t,limit:99}})).data}async function bs(t){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(A=>{n.append("legalRepresentativeIdCard",A)}),n.append("isRenew",t.isRenew),n.append("isCashRegister",t.isCashRegister),await Sn.post(Yc,n,{headers:{"Content-Type":"multipart/form-data","X-Invoice-Widget-Mode":wA(),"X-Invoice-Widget-Version":Ss}})}async function Ds(t){return await Sn.get(`${Gc}/${t}/status`)}async function Ks({isRenewable:t,serialNumber:n}={}){const e={isRenewable:!!t,serialNumber:(n??"").trim()};return console.log("PROMO params:",e),(await Sn.get($c,{params:e})).data}async function zs(t){return await Sn.post(`${ni}/${t}`)}async function Os(t){return await Sn.get(`${ti}/${encodeURIComponent(t)}`)}async function Vs(t,n){try{return await Sn.post(`${Ai}/${encodeURIComponent(t)}`,n)}catch(e){throw e}}async function Rs(t){return await Sn.get(`${ei}/${encodeURIComponent(t)}`)}async function Gs(t,n){try{return await Sn.post(`${ai}/${encodeURIComponent(t)}`,n)}catch(e){throw e}}function Ys({name:t,value:n,feeLabel:e,required:A,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=DA({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=e,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 iA(){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 e=document.createElement("div");return e.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(e),t.appendChild(n),{container:t,open:()=>{t.style.display="flex"},close:()=>{t.style.display="none"}}}function js({promotion:t,onSelect:n,isHidden:e=!1,isSelectable:A=!0}){const a=document.createElement("div");if(e)return a.style.display="none",{container:a};A&&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=hA(Bt());s.textContent=t[r],i.appendChild(s);const{container:u}=DA({checked:t.isSelected,onChange:()=>{let g=!t.isSelected;n(t.code,g)},isIconCheckbox:!0});A||(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 Fs({value:t="",placeholder:n="",onInputChange:e=void 0}){const A=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=A,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 e=="function"&&c.addEventListener("input",e),h.appendChild(c),{container:a}}function Zs({theme:t,debounceTimer:n,typedUnits:e,onSearchComplete:A}){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);async function r(){n&&clearTimeout(n),e!==""?n=setTimeout(async()=>{try{const T=e.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g,"."),E=await Hs({search:T,bank:t});E&&(h=E),A&&A()}catch(T){console.error("Error searching packages:",T),It.error(q("errorSearchingPackages"),{autoClose:5e3,closeButton:!0,icon:!0})}},500):(h=a,A&&A())}const u=Fs({value:"",placeholder:q("searchUnits"),onInputChange:T=>{e=T.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 d=document.createElement("div");d.className="wgt:flex wgt:items-center wgt:justify-center wgt:py-8",d.innerHTML=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as u, g as p, l as d, C as l, G as w, n as m, o as f, I as E, p as R, S as y, q as C, e as I, r as v, u as o, w as T, O as h } from "./index-
|
|
1
|
+
import { k as u, g as p, l as d, C as l, G as w, n as m, o as f, I as E, p as R, S as y, q as C, e as I, r as v, u as o, w as T, O as h } from "./index-Cnbz4UeV.js";
|
|
2
2
|
function _({
|
|
3
3
|
title: e,
|
|
4
4
|
isDisabled: t = !1,
|
|
@@ -73,7 +73,7 @@ async function U(e, t) {
|
|
|
73
73
|
}
|
|
74
74
|
})).data;
|
|
75
75
|
}
|
|
76
|
-
const $ = (e) => new Intl.NumberFormat("vi-VN").format(e), O = "1.124.
|
|
76
|
+
const $ = (e) => new Intl.NumberFormat("vi-VN").format(e), O = "1.124.5";
|
|
77
77
|
async function k({ search: e, bank: t }) {
|
|
78
78
|
return (await n.get(`${o}`, {
|
|
79
79
|
params: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as g, g as ch, a as ot, s as Lt, c as dt, b as wh, d as ph, e as eh, f as Ch, m as fh, h as Xh, i as Bh, v as Nh } from "./index-
|
|
2
|
-
import { c as qt, a as Vt, g as It, b as Eh, f as kn, d as Hh, e as Mt, h as Ph, i as kh, j as yh, k as vh, l as Qh, m as Lh, n as Ih } from "./loading-
|
|
1
|
+
import { t as g, g as ch, a as ot, s as Lt, c as dt, b as wh, d as ph, e as eh, f as Ch, m as fh, h as Xh, i as Bh, v as Nh } from "./index-Cnbz4UeV.js";
|
|
2
|
+
import { c as qt, a as Vt, g as It, b as Eh, f as kn, d as Hh, e as Mt, h as Ph, i as kh, j as yh, k as vh, l as Qh, m as Lh, n as Ih } from "./loading-XZIu7zzO.js";
|
|
3
3
|
import { g as Ah } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
4
4
|
function d0({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
5
5
|
const e = document.createElement("div");
|