mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
7 lines
7.0 KiB
JavaScript
7 lines
7.0 KiB
JavaScript
/*!
|
|
* AdminLTE v4.0.0-alpha3 (https://adminlte.io)
|
|
* Copyright 2014-2024 Colorlib <https://colorlib.com>
|
|
* Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
|
|
*/
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).adminlte={})}(this,(function(e){"use strict";const t=[],o=e=>{"loading"===document.readyState?(t.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of t)e()})),t.push(e)):e()},n=(e,t=500)=>{e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=`${t}ms`,e.style.boxSizing="border-box",e.style.height=`${e.offsetHeight}px`,e.style.overflow="hidden",window.setTimeout((()=>{e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0"}),1),window.setTimeout((()=>{e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)},s="hold-transition";class i{constructor(e){this._element=e}holdTransition(){let e;window.addEventListener("resize",(()=>{document.body.classList.add(s),clearTimeout(e),e=setTimeout((()=>{document.body.classList.remove(s)}),400)}))}}o((()=>{new i(document.body).holdTransition(),setTimeout((()=>{document.body.classList.add("app-loaded")}),400)}));const l=".lte.push-menu",r=`open${l}`,a=`collapse${l}`,d="sidebar-mini",c="sidebar-collapse",m="sidebar-open",u="sidebar-expand",p=`[class*="${u}"]`,y='[data-lte-toggle="sidebar"]',v={sidebarBreakpoint:992};class h{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},v),t)}menusClose(){document.querySelectorAll(".nav-treeview").forEach((e=>{e.style.removeProperty("display"),e.style.removeProperty("height")}));const e=document.querySelector(".sidebar-menu"),t=null==e?void 0:e.querySelectorAll(".nav-item");t&&t.forEach((e=>{e.classList.remove("menu-open")}))}expand(){const e=new Event(r);document.body.classList.remove(c),document.body.classList.add(m),this._element.dispatchEvent(e)}collapse(){const e=new Event(a);document.body.classList.remove(m),document.body.classList.add(c),this._element.dispatchEvent(e)}addSidebarBreakPoint(){var e,t,o;const n=null!==(t=null===(e=document.querySelector(p))||void 0===e?void 0:e.classList)&&void 0!==t?t:[],s=null!==(o=Array.from(n).find((e=>e.startsWith(u))))&&void 0!==o?o:"",i=document.getElementsByClassName(s)[0],l=window.getComputedStyle(i,"::before").getPropertyValue("content");this._config=Object.assign(Object.assign({},this._config),{sidebarBreakpoint:Number(l.replace(/[^\d.-]/g,""))}),window.innerWidth<=this._config.sidebarBreakpoint?this.collapse():(document.body.classList.contains(d)||this.expand(),document.body.classList.contains(d)&&document.body.classList.contains(c)&&this.collapse())}toggle(){document.body.classList.contains(c)?this.expand():this.collapse()}init(){this.addSidebarBreakPoint()}}o((()=>{var e;const t=null===document||void 0===document?void 0:document.querySelector(".app-sidebar");if(t){const e=new h(t,v);e.init(),window.addEventListener("resize",(()=>{e.init()}))}const o=document.createElement("div");o.className="sidebar-overlay",null===(e=document.querySelector(".app-wrapper"))||void 0===e||e.append(o),o.addEventListener("touchstart",(e=>{e.preventDefault();const t=e.currentTarget;new h(t,v).collapse()})),o.addEventListener("click",(e=>{e.preventDefault();const t=e.currentTarget;new h(t,v).collapse()})),document.querySelectorAll(y).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();let t=e.currentTarget;"sidebar"!==(null==t?void 0:t.dataset.lteToggle)&&(t=null==t?void 0:t.closest(y)),t&&(null==e||e.preventDefault(),new h(t,v).toggle())}))}))}));const g=".lte.treeview",f=`expanded${g}`,b=`collapsed${g}`,w="menu-open",E=".nav-item",S=".nav-treeview",L={animationSpeed:300,accordion:!0};class _{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},L),t)}open(){var e,t;const o=new Event(f);if(this._config.accordion){const t=null===(e=this._element.parentElement)||void 0===e?void 0:e.querySelectorAll(`${E}.${w}`);null==t||t.forEach((e=>{if(e!==this._element.parentElement){e.classList.remove(w);const t=null==e?void 0:e.querySelector(S);t&&n(t,this._config.animationSpeed)}}))}this._element.classList.add(w);const s=null===(t=this._element)||void 0===t?void 0:t.querySelector(S);s&&((e,t=500)=>{e.style.removeProperty("display");let{display:o}=window.getComputedStyle(e);"none"===o&&(o="block"),e.style.display=o;const n=e.offsetHeight;e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0",window.setTimeout((()=>{e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=`${t}ms`,e.style.height=`${n}px`,e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom")}),1),window.setTimeout((()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)})(s,this._config.animationSpeed),this._element.dispatchEvent(o)}close(){var e;const t=new Event(b);this._element.classList.remove(w);const o=null===(e=this._element)||void 0===e?void 0:e.querySelector(S);o&&n(o,this._config.animationSpeed),this._element.dispatchEvent(t)}toggle(){this._element.classList.contains(w)?this.close():this.open()}}o((()=>{document.querySelectorAll('[data-lte-toggle="treeview"]').forEach((e=>{e.addEventListener("click",(e=>{const t=e.target,o=t.closest(E),n=t.closest(".nav-link");"#"!==(null==t?void 0:t.getAttribute("href"))&&"#"!==(null==n?void 0:n.getAttribute("href"))||e.preventDefault(),o&&new _(o,L).toggle()}))}))}));const P=".lte.fullscreen",T=`maximized${P}`,q=`minimized${P}`,x='[data-lte-toggle="fullscreen"]',k='[data-lte-icon="maximize"]',$='[data-lte-icon="minimize"]';class B{constructor(e,t){this._element=e,this._config=t}inFullScreen(){const e=new Event(T),t=document.querySelector(k),o=document.querySelector($);document.documentElement.requestFullscreen(),t&&(t.style.display="none"),o&&(o.style.display="block"),this._element.dispatchEvent(e)}outFullscreen(){const e=new Event(q),t=document.querySelector(k),o=document.querySelector($);document.exitFullscreen(),t&&(t.style.display="block"),o&&(o.style.display="none"),this._element.dispatchEvent(e)}toggleFullScreen(){document.fullscreenEnabled&&(document.fullscreenElement?this.outFullscreen():this.inFullScreen())}}o((()=>{document.querySelectorAll(x).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest(x);t&&new B(t,void 0).toggleFullScreen()}))}))})),e.FullScreen=B,e.Layout=i,e.PushMenu=h,e.Treeview=_}));
|
|
//# sourceMappingURL=adminlte.min.js.map
|