UNPKG

@zoff-tech/zt-bottom-drawer

Version:
5 lines 3.2 kB
import{i as o,w as t,r as i,h as s,H as e,e as r}from"./p-f6c816ce.js";import{findIonContent as n,printIonContentErrorMsg as a,getScrollElement as l}from"@utils/content";import{createKeyboardController as c}from"@utils/keyboard/keyboard-controller";import{g as d}from"./p-0b9b2444.js";import{clamp as p}from"@utils/helpers"; /*! * (C) Ionic http://ionicframework.com - MIT License */const f=(i,s)=>{o((()=>{const o=i.scrollTop;const e=i.scrollHeight-i.clientHeight;const r=10;const n=e-r;const a=o-n;const l=p(0,1-a/r,1);t((()=>{s.style.setProperty("--opacity-scale",l.toString())}))}))};const b="ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports (backdrop-filter: blur(0)){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}.footer-collapse-fade ion-toolbar{--opacity-scale:inherit}";const h="ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md{box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12)}.footer-md.ion-no-border{box-shadow:none}";const u=class{constructor(o){i(this,o);this.keyboardCtrl=null;this.checkCollapsibleFooter=()=>{const o=d(this);if(o!=="ios"){return}const{collapse:t}=this;const i=t==="fade";this.destroyCollapsibleFooter();if(i){const o=this.el.closest("ion-app,ion-page,.ion-page,page-inner");const t=o?n(o):null;if(!t){a(this.el);return}this.setupFadeFooter(t)}};this.setupFadeFooter=async o=>{const t=this.scrollEl=await l(o);this.contentScrollCallback=()=>{f(t,this.el)};t.addEventListener("scroll",this.contentScrollCallback);f(t,this.el)};this.keyboardVisible=false;this.collapse=undefined;this.translucent=false}componentDidLoad(){this.checkCollapsibleFooter()}componentDidUpdate(){this.checkCollapsibleFooter()}async connectedCallback(){this.keyboardCtrl=await c((async(o,t)=>{if(o===false&&t!==undefined){await t}this.keyboardVisible=o}))}disconnectedCallback(){if(this.keyboardCtrl){this.keyboardCtrl.destroy()}}destroyCollapsibleFooter(){if(this.scrollEl&&this.contentScrollCallback){this.scrollEl.removeEventListener("scroll",this.contentScrollCallback);this.contentScrollCallback=undefined}}render(){const{translucent:o,collapse:t}=this;const i=d(this);const r=this.el.closest("ion-tabs");const n=r===null||r===void 0?void 0:r.querySelector(":scope > ion-tab-bar");return s(e,{role:"contentinfo",class:{[i]:true,[`footer-${i}`]:true,[`footer-translucent`]:o,[`footer-translucent-${i}`]:o,["footer-toolbar-padding"]:!this.keyboardVisible&&(!n||n.slot!=="bottom"),[`footer-collapse-${t}`]:t!==undefined}},i==="ios"&&o&&s("div",{class:"footer-background"}),s("slot",null))}get el(){return r(this)}};u.style={ios:b,md:h};export{u as ion_footer}; //# sourceMappingURL=p-3b823c11.entry.js.map