@atomsolution/invoice-widget 1.76.0 → 1.76.2
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.
|
@@ -5014,7 +5014,7 @@ let re = null, Ce = null;
|
|
|
5014
5014
|
function dB(t) {
|
|
5015
5015
|
return L(this, null, function* () {
|
|
5016
5016
|
if (t.mode && Mt(t.mode), t.baseUrl && ft(t.mode, t.baseUrl), t.language && _t(t.language), t.onRefreshToken && Gc(t.onRefreshToken), t.accessTokenKey && Oc(t.accessTokenKey), t.refreshTokenKey && (t.refreshTokenKey, void 0), !Ce) {
|
|
5017
|
-
const { InvoiceRegisterWidget: i } = yield import("./widget-
|
|
5017
|
+
const { InvoiceRegisterWidget: i } = yield import("./widget-DmRmTgTq.js");
|
|
5018
5018
|
Ce = i;
|
|
5019
5019
|
}
|
|
5020
5020
|
const A = typeof t.selector == "string" ? document.querySelector(t.selector) : t.selector;
|
|
@@ -5040,7 +5040,7 @@ function dB(t) {
|
|
|
5040
5040
|
function lB(t) {
|
|
5041
5041
|
return L(this, null, function* () {
|
|
5042
5042
|
if (t.mode && Mt(t.mode), t.baseUrl && ft(t.mode, t.baseUrl), t.language && _t(t.language), !re) {
|
|
5043
|
-
const { EContractWidget: e } = yield import("./widget-
|
|
5043
|
+
const { EContractWidget: e } = yield import("./widget-DmRmTgTq.js");
|
|
5044
5044
|
re = e;
|
|
5045
5045
|
}
|
|
5046
5046
|
const A = typeof t.selector == "string" ? document.querySelector(t.selector) : t.selector;
|
package/dist/index.esm.js
CHANGED
package/dist/index.umd.js
CHANGED
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</svg>`:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
|
110
110
|
<path d="M9 6L15 12L9 18" stroke="#0E121B" stroke-width="2"
|
|
111
111
|
stroke-linecap="round" stroke-linejoin="round"/>
|
|
112
|
-
</svg>`,m}const o=i("prev"),s=i("next");o.style.left="8px",s.style.right="8px",e.appendChild(o),e.appendChild(s);let D=A,k=C,z=Q;const l=()=>window.matchMedia("(max-width: 414px)").matches;function f(){const H=h.getBoundingClientRect(),m=e.getBoundingClientRect(),x=H.top-m.top+H.height/2;o.style.top=`${x}px`,s.style.top=`${x}px`,o.style.transform="translateY(-50%)",s.style.transform="translateY(-50%)"}function v(){const H=h.firstElementChild;return H?H.getBoundingClientRect().width+24:300}function O(H){h.scrollBy({left:H*v(),behavior:"smooth"})}function q(){if(l())return;const H=h.scrollWidth-h.clientWidth;o.disabled=h.scrollLeft<=0,s.disabled=h.scrollLeft>=H-2}o.addEventListener("click",()=>O(-1)),s.addEventListener("click",()=>O(1)),h.addEventListener("scroll",q);function M(){if(h.innerHTML="",!D||D.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=u("noPackageFound")||"Không tìm thấy gói phù hợp",h.appendChild(H);return}D.forEach(H=>{const m=H._id===z,x=k.includes(H.code),{container:y}=hc({pkg:H,type:g,isDiscounted:x,promotion:B,isSelected:m,isRenew:n,onSelect:()=>{E((I||n)&&m?"":H._id)}});y.classList.add("wgt:snap-start"),h.appendChild(y)}),requestAnimationFrame(()=>{f(),q()})}M();let T=!1,R=0,L=0;h.addEventListener("mousedown",H=>{T=!0,h.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),R=H.pageX,L=h.scrollLeft});const X=()=>{T&&(T=!1,h.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",X),h.addEventListener("mouseleave",X),h.addEventListener("mousemove",H=>{T&&(H.preventDefault(),h.scrollLeft=L-(H.pageX-R)*1.5)}),h.addEventListener("wheel",H=>{H.preventDefault(),h.scrollLeft+=H.deltaY},{passive:!1});const d=new ResizeObserver(()=>f());return d.observe(h),d.observe(e),{container:t,render:M,setSelectedPackageId(H){z=H,M()},updateData(H,m=null,x=null){D=H||D,m!==null&&(k=m),x!==null&&(z=x),M()},updateDiscountedOnly(H){k=H,M()}}}const oc="1.76.
|
|
112
|
+
</svg>`,m}const o=i("prev"),s=i("next");o.style.left="8px",s.style.right="8px",e.appendChild(o),e.appendChild(s);let D=A,k=C,z=Q;const l=()=>window.matchMedia("(max-width: 414px)").matches;function f(){const H=h.getBoundingClientRect(),m=e.getBoundingClientRect(),x=H.top-m.top+H.height/2;o.style.top=`${x}px`,s.style.top=`${x}px`,o.style.transform="translateY(-50%)",s.style.transform="translateY(-50%)"}function v(){const H=h.firstElementChild;return H?H.getBoundingClientRect().width+24:300}function O(H){h.scrollBy({left:H*v(),behavior:"smooth"})}function q(){if(l())return;const H=h.scrollWidth-h.clientWidth;o.disabled=h.scrollLeft<=0,s.disabled=h.scrollLeft>=H-2}o.addEventListener("click",()=>O(-1)),s.addEventListener("click",()=>O(1)),h.addEventListener("scroll",q);function M(){if(h.innerHTML="",!D||D.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=u("noPackageFound")||"Không tìm thấy gói phù hợp",h.appendChild(H);return}D.forEach(H=>{const m=H._id===z,x=k.includes(H.code),{container:y}=hc({pkg:H,type:g,isDiscounted:x,promotion:B,isSelected:m,isRenew:n,onSelect:()=>{E((I||n)&&m?"":H._id)}});y.classList.add("wgt:snap-start"),h.appendChild(y)}),requestAnimationFrame(()=>{f(),q()})}M();let T=!1,R=0,L=0;h.addEventListener("mousedown",H=>{T=!0,h.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),R=H.pageX,L=h.scrollLeft});const X=()=>{T&&(T=!1,h.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",X),h.addEventListener("mouseleave",X),h.addEventListener("mousemove",H=>{T&&(H.preventDefault(),h.scrollLeft=L-(H.pageX-R)*1.5)}),h.addEventListener("wheel",H=>{H.preventDefault(),h.scrollLeft+=H.deltaY},{passive:!1});const d=new ResizeObserver(()=>f());return d.observe(h),d.observe(e),{container:t,render:M,setSelectedPackageId(H){z=H,M()},updateData(H,m=null,x=null){D=H||D,m!==null&&(k=m),x!==null&&(z=x),M()},updateDiscountedOnly(H){k=H,M()}}}const oc="1.76.2";function ic(C){return $(this,arguments,function*({search:g,bank:A}){return(yield eg.get(`${NC}`,{params:{isActive:!0,search:g||null,type:"service",bank:A}})).data})}function ac(A){return $(this,arguments,function*({bank:g}){return(yield eg.get(`${NC}`,{params:{isActive:!0,type:"initial_fee",bank:g}})).data})}function sc(B){return $(this,arguments,function*({bank:g,hasRenew:A,isCashRegister:C}){return(yield eg.get(`${NC}`,{params:{isActive:!0,type:"service",bank:g,hasRenew:A,isCashRegister:C,limit:99}})).data})}function rc(A){return $(this,arguments,function*({bank:g}){return(yield eg.get(`${NC}`,{params:{isActive:!0,type:"signature",bank:g,limit:99}})).data})}function cE(g){return $(this,null,function*(){const A=new FormData;return A.append("eInvoiceRegistration",JSON.stringify(g.eInvoiceRegistration)),A.append("provider",g.provider),A.append("bank",g.bank),A.append("packages",JSON.stringify(g.packages)),A.append("promotionCodes",JSON.stringify(g.promotionCodes)),A.append("logo",g.logo),A.append("organizationRegistrationCert",g.organizationRegistrationCert),g.legalRepresentativeIdCard.forEach(B=>{A.append("legalRepresentativeIdCard",B)}),A.append("isRenew",g.isRenew),yield eg.post(kt,A,{headers:{"Content-Type":"multipart/form-data","X-Invoice-Widget-Mode":FC(),"X-Invoice-Widget-Version":oc}})})}function wc(g){return $(this,null,function*(){return yield eg.get(`${Tt}/${g}/status`)})}function uc(){return $(this,arguments,function*({isRenewable:g,serialNumber:A}={}){const C={isRenewable:!!g,serialNumber:(A!=null?A:"").trim()};return(yield eg.get(Xt,{params:C})).data})}function Dc(g){return $(this,null,function*(){return yield eg.post(`${Gt}/${g}`)})}function fc({name:g,value:A,feeLabel:C,required:B,description:Q,isChecked:I=!0,onChange:E=null}){const n=document.createElement("label");n.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 t=BB({name:g,value:A,checked:I,onChange:i=>{console.log("Checkbox state changed to:",i),E&&E(i)}});n.appendChild(t.container);const e=document.createElement("div");e.className="wgt:flex wgt:flex-col wgt:gap-1";const c=document.createElement("div");c.className="wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";const h=document.createElement("span");h.className="wgt:text-base wgt:font-semibold wgt:text-text-sub-600",h.textContent=C,c.appendChild(h);{const i=document.createElement("span");i.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(" "),i.textContent=u("required"),c.appendChild(i)}e.appendChild(c);const a=document.createElement("p");return a.className="wgt:text-text-soft-400 wgt:text-sm",a.textContent=Q,e.appendChild(a),n.appendChild(e),{container:n}}function VB(){const g=document.createElement("div");g.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",g.style.display="none";const A=document.createElement("div");A.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 C=document.createElement("div");return C.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",A.appendChild(C),g.appendChild(A),{container:g,open:()=>{g.style.display="flex"},close:()=>{g.style.display="none"}}}function mc({promotion:g,onSelect:A,isDisabled:C=!1}){const B=document.createElement("div");B.className="wgt:w-full wgt:flex wgt:items-center wgt:relative wgt:h-[6.75rem]"+(C?" wgt:opacity-50":"");const Q=document.createElement("div");Q.className="wgt:absolute wgt:top-0 wgt:left-0 wgt:z-0",Q.innerHTML=`<svg width="177" height="108" viewBox="0 0 177 108" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
113
113
|
<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"/>
|
|
114
114
|
</svg>
|
|
115
115
|
`;const I=document.createElement("div");I.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 E=document.createElement("div");E.className="wgt:flex wgt:items-start wgt:flex-col wgt:relative";const n=document.createElement("h3");n.className=["wgt:text-base","wgt:font-semibold","wgt:text-gray-500","wgt:mb-1","wgt:text-primary"].join(" "),n.textContent=g.code,E.appendChild(n);const t=document.createElement("p");t.className=["wgt:text-sm","wgt:text-text-sub-600","wgt:mb-2"].join(" ");const e=JC(Gg());t.textContent=g[e],E.appendChild(t);const{container:c}=BB({checked:g.isSelected,onChange:()=>{let a=!g.isSelected;A(g.code,a)},isIconCheckbox:!0,disabled:C||g.isSelected});c.className="wgt:absolute wgt:top-0 wgt:right-0",E.appendChild(c),I.appendChild(E);const h=document.createElement("p");return h.className=["wgt:text-xs","wgt:font-normal","wgt:text-right","wgt:text-[#335CFF]","wgt:italic"].join(" "),h.textContent=`${u("validityPeriod")}: ${u("expiredDate")} ${g.expiredAt.split("T")[0]}`,I.appendChild(h),B.appendChild(Q),B.appendChild(I),{container:B}}function lc({theme:g,debounceTimer:A,typedUnits:C,onSearchComplete:B}){let Q=[],I=[];const E=document.createElement("div");E.className="wgt:flex wgt:flex-col wgt:gap-3";const n=document.createElement("div");n.className="wgt:flex wgt:flex-col wgt:gap-4",E.appendChild(n);const t=document.createElement("h2");t.className="wgt:text-xl wgt:font-bold wgt:text-text-black",t.innerText=u("selectInvoicePackage");const e=document.createElement("span");e.className="wgt:text-sm wgt:text-red-500 wgt:ml-1",e.innerText="*",t.appendChild(e),n.appendChild(t);function c(){return $(this,null,function*(){A&&clearTimeout(A),C!==""?A=setTimeout(()=>$(null,null,function*(){try{const z=C.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g,"."),l=yield ic({search:z,bank:g});l&&(I=l),B&&B()}catch(z){console.error("Error searching packages:",z),kg.error(u("errorSearchingPackages"),{autoClose:5e3,closeButton:!0,icon:!0})}}),500):(I=Q,B&&B())})}const h=cc({value:"",placeholder:u("searchUnits"),onInputChange:z=>{C=z.target.value.replace(/\D/g,""),c()}});n.appendChild(h.container);const a=document.createElement("div");a.className="wgt:flex wgt:flex-col wgt:gap-2",E.appendChild(a);const i=document.createElement("h3");i.className="wgt:text-sm wgt:font-semibold wgt:text-[#525866]",i.innerText=u("mostSuitablePackage"),a.appendChild(i);const o=document.createElement("div");a.appendChild(o);const s=document.createElement("div");s.className="wgt:flex wgt:items-center wgt:justify-center wgt:py-8",s.innerHTML=`
|
|
@@ -35,7 +35,7 @@ var V = (g, A, E) => new Promise((B, C) => {
|
|
|
35
35
|
}, n = (I) => I.done ? B(I.value) : Promise.resolve(I.value).then(Q, t);
|
|
36
36
|
n((E = E.apply(g, A)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as w, g as HB, a as wQ, b as oQ, C as aQ, G as iQ, c as sQ, d as kB, e as fg, f as uQ, h as DQ, i as Vg, O as fQ, j as rQ, s as wg, k as Sg, l as mQ, m as PQ, n as qQ, o as vQ, p as MQ, q as lQ, v as TQ } from "./index-
|
|
38
|
+
import { t as w, g as HB, a as wQ, b as oQ, C as aQ, G as iQ, c as sQ, d as kB, e as fg, f as uQ, h as DQ, i as Vg, O as fQ, j as rQ, s as wg, k as Sg, l as mQ, m as PQ, n as qQ, o as vQ, p as MQ, q as lQ, v as TQ } from "./index-DUhdVxVf.js";
|
|
39
39
|
import { g as ZC } from "./_commonjsHelpers-bAxELxBV.js";
|
|
40
40
|
function eC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
41
41
|
const E = document.createElement("div");
|
|
@@ -3042,7 +3042,7 @@ function sC({
|
|
|
3042
3042
|
}
|
|
3043
3043
|
};
|
|
3044
3044
|
}
|
|
3045
|
-
const sE = "1.76.
|
|
3045
|
+
const sE = "1.76.2";
|
|
3046
3046
|
function uE(E) {
|
|
3047
3047
|
return V(this, arguments, function* ({ search: g, bank: A }) {
|
|
3048
3048
|
return (yield SA.get(`${Vg}`, {
|
|
@@ -3155,7 +3155,6 @@ function vE({
|
|
|
3155
3155
|
name: g,
|
|
3156
3156
|
value: A,
|
|
3157
3157
|
checked: Q,
|
|
3158
|
-
// onChange: () => {},
|
|
3159
3158
|
onChange: (o) => {
|
|
3160
3159
|
console.log("Checkbox state changed to:", o), t && t(o);
|
|
3161
3160
|
}
|