@htmlbricks/hb-toast 0.62.7 → 0.62.8
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/main.iife.js +1 -1
- package/main.iife.js.map +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
package/main.iife.js
CHANGED
|
@@ -75,5 +75,5 @@ button.svelte-j9shl9 {margin:0;font-family:inherit;font-size:inherit;line-height
|
|
|
75
75
|
@media (min-width: 1200px) {.fs-1.svelte-j9shl9 {font-size:2.5rem !important;}.fs-2.svelte-j9shl9 {font-size:2rem !important;}.fs-3.svelte-j9shl9 {font-size:1.75rem !important;}.fs-4.svelte-j9shl9 {font-size:1.5rem !important;}
|
|
76
76
|
}
|
|
77
77
|
@media print {.d-print-inline.svelte-j9shl9 {display:inline !important;}.d-print-inline-block.svelte-j9shl9 {display:inline-block !important;}.d-print-block.svelte-j9shl9 {display:block !important;}.d-print-grid.svelte-j9shl9 {display:grid !important;}.d-print-inline-grid.svelte-j9shl9 {display:inline-grid !important;}.d-print-table.svelte-j9shl9 {display:table !important;}.d-print-table-row.svelte-j9shl9 {display:table-row !important;}.d-print-table-cell.svelte-j9shl9 {display:table-cell !important;}.d-print-flex.svelte-j9shl9 {display:flex !important;}.d-print-inline-flex.svelte-j9shl9 {display:inline-flex !important;}.d-print-none.svelte-j9shl9 {display:none !important;}
|
|
78
|
-
}:host {font-family:"Roboto", sans-serif;}#toast.svelte-j9shl9 {position:fixed;z-index:100;}.me-2.svelte-j9shl9 {margin-right:0.5rem !important;}.rounded.svelte-j9shl9 {border-radius:0.25rem !important;}.me-auto.svelte-j9shl9 {margin-right:auto !important;margin-left:5px;}.toast-progress-container.svelte-j9shl9 {position:absolute;bottom:0;left:0;right:0;height:4px;background-color:rgba(0, 0, 0, 0.1);border-radius:0 0 0.375rem 0.375rem;overflow:hidden;}.toast-progress-bar.svelte-j9shl9 {height:100%;border-radius:0 0 0.375rem 0.375rem;opacity:0.9;box-shadow:0 0 8px rgba(0, 0, 0, 0.2);}.bg-primary.svelte-j9shl9 {background-color:rgba(var(--bs-primary-rgb), 0.7) !important;}.bg-secondary.svelte-j9shl9 {background-color:rgba(var(--bs-secondary-rgb), 0.7) !important;}.bg-success.svelte-j9shl9 {background-color:rgba(var(--bs-success-rgb), 0.7) !important;}.bg-danger.svelte-j9shl9 {background-color:rgba(var(--bs-danger-rgb), 0.7) !important;}.bg-warning.svelte-j9shl9 {background-color:rgba(var(--bs-warning-rgb), 0.7) !important;}.bg-info.svelte-j9shl9 {background-color:rgba(var(--bs-info-rgb), 0.7) !important;}.bg-light.svelte-j9shl9 {background-color:rgba(var(--bs-light-rgb), 0.7) !important;}.bg-dark.svelte-j9shl9 {background-color:rgba(var(--bs-dark-rgb), 0.7) !important;}`};function Wr(t,e){Qe(e,!0),hl(t,Nl);function r(h,T){e.$$host.dispatchEvent(new CustomEvent(h,{detail:T}))}let s=st(e,"id",7,""),n=st(e,"show",7,"no"),l=st(e,"content",7,""),o=st(e,"small",7,""),i=st(e,"title",7,""),a=st(e,"img",7,""),m=st(e,"progress",7,""),p=st(e,"timeout"),v=st(e,"level",7,"info"),d=st(e,"position",7,"bottom-right"),b=P(!1),c=null,y=null,w=P(0),A=P(null),k=P(null),lt=P(0),ht=null;const Y=Ft(()=>{const h=Number(m());return Number.isNaN(h)?null:Math.max(0,Math.min(100,h))}),vt=Ft(()=>{if(g(Y)!==null)return g(Y);if(g(lt),!p()||Number(p())<=0||!g(k))return 0;const T=Date.now()-g(k),nt=Number(p()),X=T/nt*100;return Math.min(X,100)}),je=Ft(()=>{const h=g(vt);return h<50?0:Math.min((h-50)*.2,5)});function xe(h){if(h<=0)return"now";const T=Math.floor(h/86400),nt=Math.floor(h%86400/3600),X=Math.floor(h%3600/60),V=h%60,I=[];return h>=86400?(I.push(`${T} ${T===1?"day":"days"}`),I.push(`${nt} ${nt===1?"hour":"hours"}`),I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):h>=3600?(I.push(`${nt} ${nt===1?"hour":"hours"}`),I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):h>=60?(I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):I.push(`${V} ${V===1?"second":"seconds"}`),I.join(" ")+" remaining"}const Ut=Ft(()=>{if(g(w),!o()&&g(Y)!==null)return`${g(vt)}%`;if(!o()&&p()&&Number(p())>0){const h=Math.floor(Number(p())/1e3),T=Math.max(0,h-g(w));return xe(T)}return g(w)===0?"now":g(w)===1?"1 second ago":`${g(w)} seconds ago`}),Cl=Ft(()=>({primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",danger:"bg-danger",warning:"bg-warning",info:"bg-info",light:"bg-light",dark:"bg-dark"})[v()]||"bg-info"),Al=Ft(()=>{const h={"top-left":"position-fixed top-0 start-0 m-3","top-center":"position-fixed top-0 start-50 translate-middle-x m-3","top-right":"position-fixed top-0 end-0 m-3","bottom-left":"position-fixed bottom-0 start-0 m-3","bottom-center":"position-fixed bottom-0 start-50 translate-middle-x m-3","bottom-right":"position-fixed bottom-0 end-0 m-3"};return h[d()]||h["top-right"]});function Rl(){if(g(A)){const h=Date.now();_(w,Math.floor((h-g(A))/1e3),!0)}}function Ol(){!o()&&g(Y)===null&&(_(A,Date.now(),!0),_(w,0),y=setInterval(Rl,1e3))}function Ml(){y&&(clearInterval(y),y=null,_(w,0),_(A,null))}function Il(){g(Y)===null&&p()&&Number(p())>0&&(ht&&clearInterval(ht),_(k,Date.now(),!0),_(lt,0),ht=setInterval(()=>{g(k)&&_(lt,Date.now(),!0)},100))}function Dl(){ht&&(clearInterval(ht),ht=null),_(k,null),_(lt,0)}function Be(){c&&(clearTimeout(c),c=null),Ml(),Dl()}function Pl(){Be(),n("no"),r("toastShow",{id:s(),show:!1})}function Gr(){_(b,!1),setTimeout(()=>{n("no"),Be(),r("toastShow",{id:s(),show:!1,disappear:!0})},1e3)}cr(()=>{n()==="yes"?(_(b,!0),Ol(),Il(),c&&clearTimeout(c),g(Y)===null&&p()&&Number(p())>0&&(c=setTimeout(()=>{Gr()},Number(p())))):(_(b,!1),Be())}),cr(()=>{n()==="yes"&&g(Y)!==null&&g(vt)>=100&&Gr()});var Fl={get id(){return s()},set id(h=""){s(h),W()},get show(){return n()},set show(h="no"){n(h),W()},get content(){return l()},set content(h=""){l(h),W()},get small(){return o()},set small(h=""){o(h),W()},get title(){return i()},set title(h=""){i(h),W()},get img(){return a()},set img(h=""){a(h),W()},get progress(){return m()},set progress(h=""){m(h),W()},get timeout(){return p()},set timeout(h){p(h),W()},get level(){return v()},set level(h="info"){v(h),W()},get position(){return d()},set position(h="bottom-right"){d(h),W()}},Jr=ol();bl("j9shl9",h=>{var T=El();Nt(h,T)});var Ll=qs(Jr);{var ql=h=>{var T=Sl(),nt=qt(T),X=qt(nt);ce(X,e,"header_icon",{},Ct=>{var xt=Tl();Nt(Ct,xt)});var V=Et(X,2),I=qt(V);ce(I,e,"header_strong",{},null);var Bl=Et(I,1,!0);It(V);var Ue=Et(V,2),Ul=qt(Ue);ce(Ul,e,"header_small",{},Ct=>{var xt=nl();Me(()=>Fe(xt,o()||(g(Y)!==null?`${g(vt)}%`:g(Ut)))),Nt(Ct,xt)}),It(Ue);var Yl=Et(Ue,2);Yl.__click=Pl,It(nt);var Ye=Et(nt,2),Xr=qt(Ye);ce(Xr,e,"body",{},null);var Vl=Et(Xr,1,!0);It(Ye);var Hl=Et(Ye,2);{var Kl=Ct=>{var xt=zl(),Zr=qt(xt);It(xt),Me(()=>{qr(Zr,1,`toast-progress-bar ${g(Cl)??""}`,"svelte-j9shl9"),cl(Zr,`width: ${g(vt)??""}%; filter: blur(${g(je)??""}px); transition: width 1s linear, filter 1s ease;`)}),Nt(Ct,xt)};Lr(Hl,Ct=>{(g(Y)!==null||p()&&Number(p())>0)&&Ct(Kl)})}It(T),Me(()=>{qr(T,1,`toast fade show ${g(Al)??""}`,"svelte-j9shl9"),Fe(Bl,i()),Fe(Vl,l())}),Yr(1,T,()=>Hr,()=>({duration:2e3,easing:Kr})),Yr(2,T,()=>Hr,()=>({duration:2e3,easing:Kr})),Nt(h,T)};Lr(Ll,h=>{n()==="yes"&&h(ql)})}return Nt(t,Jr),tr(Fl)}sl(["click"]),customElements.define("hb-toast",kl(Wr,{id:{},show:{},content:{},small:{},title:{},img:{},progress:{},timeout:{},level:{},position:{}},["header_icon","header_strong","header_small","body"],[],!0)),Ve.Component=Wr,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})})(this.toast=this.toast||{});
|
|
78
|
+
}:host {font-family:"Roboto", sans-serif;}#toast.svelte-j9shl9 {position:fixed;z-index:100;}.me-2.svelte-j9shl9 {margin-right:0.5rem !important;}.rounded.svelte-j9shl9 {border-radius:0.25rem !important;}.me-auto.svelte-j9shl9 {margin-right:auto !important;margin-left:5px;}.toast-progress-container.svelte-j9shl9 {position:absolute;bottom:0;left:0;right:0;height:4px;background-color:rgba(0, 0, 0, 0.1);border-radius:0 0 0.375rem 0.375rem;overflow:hidden;}.toast-progress-bar.svelte-j9shl9 {height:100%;border-radius:0 0 0.375rem 0.375rem;opacity:0.9;box-shadow:0 0 8px rgba(0, 0, 0, 0.2);}.bg-primary.svelte-j9shl9 {background-color:rgba(var(--bs-primary-rgb), 0.7) !important;}.bg-secondary.svelte-j9shl9 {background-color:rgba(var(--bs-secondary-rgb), 0.7) !important;}.bg-success.svelte-j9shl9 {background-color:rgba(var(--bs-success-rgb), 0.7) !important;}.bg-danger.svelte-j9shl9 {background-color:rgba(var(--bs-danger-rgb), 0.7) !important;}.bg-warning.svelte-j9shl9 {background-color:rgba(var(--bs-warning-rgb), 0.7) !important;}.bg-info.svelte-j9shl9 {background-color:rgba(var(--bs-info-rgb), 0.7) !important;}.bg-light.svelte-j9shl9 {background-color:rgba(var(--bs-light-rgb), 0.7) !important;}.bg-dark.svelte-j9shl9 {background-color:rgba(var(--bs-dark-rgb), 0.7) !important;}`};function Wr(t,e){Qe(e,!0),hl(t,Nl);function r(h,T){e.$$host.dispatchEvent(new CustomEvent(h,{detail:T}))}let s=st(e,"id",7,""),n=st(e,"show",7,"no"),l=st(e,"content",7,""),o=st(e,"small",7,""),i=st(e,"title",7,""),a=st(e,"img",7,""),m=st(e,"progress",7,""),p=st(e,"timeout"),v=st(e,"level",7,"info"),d=st(e,"position",7,"bottom-right"),b=P(!1),c=null,y=null,w=P(0),A=P(null),k=P(null),lt=P(0),ht=null;const Y=Ft(()=>{if(m()===""||m()===void 0||m()===null)return null;const h=Number(m());return Number.isNaN(h)?null:Math.max(0,Math.min(100,h))}),vt=Ft(()=>{if(g(Y)!==null)return g(Y);if(g(lt),!p()||Number(p())<=0||!g(k))return 0;const T=Date.now()-g(k),nt=Number(p()),X=T/nt*100;return Math.min(X,100)}),je=Ft(()=>{const h=g(vt);return h<50?0:Math.min((h-50)*.2,5)});function xe(h){if(h<=0)return"now";const T=Math.floor(h/86400),nt=Math.floor(h%86400/3600),X=Math.floor(h%3600/60),V=h%60,I=[];return h>=86400?(I.push(`${T} ${T===1?"day":"days"}`),I.push(`${nt} ${nt===1?"hour":"hours"}`),I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):h>=3600?(I.push(`${nt} ${nt===1?"hour":"hours"}`),I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):h>=60?(I.push(`${X} ${X===1?"minute":"minutes"}`),I.push(`${V} ${V===1?"second":"seconds"}`)):I.push(`${V} ${V===1?"second":"seconds"}`),I.join(" ")+" remaining"}const Ut=Ft(()=>{if(g(w),!o()&&g(Y)!==null)return`${g(vt)}%`;if(!o()&&p()&&Number(p())>0){const h=Math.floor(Number(p())/1e3),T=Math.max(0,h-g(w));return xe(T)}return g(w)===0?"now":g(w)===1?"1 second ago":`${g(w)} seconds ago`}),Cl=Ft(()=>({primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",danger:"bg-danger",warning:"bg-warning",info:"bg-info",light:"bg-light",dark:"bg-dark"})[v()]||"bg-info"),Al=Ft(()=>{const h={"top-left":"position-fixed top-0 start-0 m-3","top-center":"position-fixed top-0 start-50 translate-middle-x m-3","top-right":"position-fixed top-0 end-0 m-3","bottom-left":"position-fixed bottom-0 start-0 m-3","bottom-center":"position-fixed bottom-0 start-50 translate-middle-x m-3","bottom-right":"position-fixed bottom-0 end-0 m-3"};return h[d()]||h["top-right"]});function Rl(){if(g(A)){const h=Date.now();_(w,Math.floor((h-g(A))/1e3),!0)}}function Ol(){!o()&&g(Y)===null&&(_(A,Date.now(),!0),_(w,0),y=setInterval(Rl,1e3))}function Ml(){y&&(clearInterval(y),y=null,_(w,0),_(A,null))}function Il(){g(Y)===null&&p()&&Number(p())>0&&(ht&&clearInterval(ht),_(k,Date.now(),!0),_(lt,0),ht=setInterval(()=>{g(k)&&_(lt,Date.now(),!0)},100))}function Dl(){ht&&(clearInterval(ht),ht=null),_(k,null),_(lt,0)}function Be(){c&&(clearTimeout(c),c=null),Ml(),Dl()}function Pl(){Be(),n("no"),r("toastShow",{id:s(),show:!1})}function Gr(){_(b,!1),setTimeout(()=>{n("no"),Be(),r("toastShow",{id:s(),show:!1,disappear:!0})},1e3)}cr(()=>{n()==="yes"?(_(b,!0),Ol(),Il(),c&&clearTimeout(c),g(Y)===null&&p()&&Number(p())>0&&(c=setTimeout(()=>{Gr()},Number(p())))):(_(b,!1),Be())}),cr(()=>{n()==="yes"&&g(Y)!==null&&g(vt)>=100&&Gr()});var Fl={get id(){return s()},set id(h=""){s(h),W()},get show(){return n()},set show(h="no"){n(h),W()},get content(){return l()},set content(h=""){l(h),W()},get small(){return o()},set small(h=""){o(h),W()},get title(){return i()},set title(h=""){i(h),W()},get img(){return a()},set img(h=""){a(h),W()},get progress(){return m()},set progress(h=""){m(h),W()},get timeout(){return p()},set timeout(h){p(h),W()},get level(){return v()},set level(h="info"){v(h),W()},get position(){return d()},set position(h="bottom-right"){d(h),W()}},Jr=ol();bl("j9shl9",h=>{var T=El();Nt(h,T)});var Ll=qs(Jr);{var ql=h=>{var T=Sl(),nt=qt(T),X=qt(nt);ce(X,e,"header_icon",{},Ct=>{var xt=Tl();Nt(Ct,xt)});var V=Et(X,2),I=qt(V);ce(I,e,"header_strong",{},null);var Bl=Et(I,1,!0);It(V);var Ue=Et(V,2),Ul=qt(Ue);ce(Ul,e,"header_small",{},Ct=>{var xt=nl();Me(()=>Fe(xt,o()||(g(Y)!==null?`${g(vt)}%`:g(Ut)))),Nt(Ct,xt)}),It(Ue);var Yl=Et(Ue,2);Yl.__click=Pl,It(nt);var Ye=Et(nt,2),Xr=qt(Ye);ce(Xr,e,"body",{},null);var Vl=Et(Xr,1,!0);It(Ye);var Hl=Et(Ye,2);{var Kl=Ct=>{var xt=zl(),Zr=qt(xt);It(xt),Me(()=>{qr(Zr,1,`toast-progress-bar ${g(Cl)??""}`,"svelte-j9shl9"),cl(Zr,`width: ${g(vt)??""}%; filter: blur(${g(je)??""}px); transition: width 1s linear, filter 1s ease;`)}),Nt(Ct,xt)};Lr(Hl,Ct=>{(g(Y)!==null||p()&&Number(p())>0)&&Ct(Kl)})}It(T),Me(()=>{qr(T,1,`toast fade show ${g(Al)??""}`,"svelte-j9shl9"),Fe(Bl,i()),Fe(Vl,l())}),Yr(1,T,()=>Hr,()=>({duration:2e3,easing:Kr})),Yr(2,T,()=>Hr,()=>({duration:2e3,easing:Kr})),Nt(h,T)};Lr(Ll,h=>{n()==="yes"&&h(ql)})}return Nt(t,Jr),tr(Fl)}sl(["click"]),customElements.define("hb-toast",kl(Wr,{id:{},show:{},content:{},small:{},title:{},img:{},progress:{},timeout:{},level:{},position:{}},["header_icon","header_strong","header_small","body"],[],!0)),Ve.Component=Wr,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})})(this.toast=this.toast||{});
|
|
79
79
|
//# sourceMappingURL=main.iife.js.map
|