mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
7 lines
9.5 KiB
JavaScript
7 lines
9.5 KiB
JavaScript
/*!
|
|
* AdminLTE v4.0.0-alpha2 (https://adminlte.io)
|
|
* Copyright 2014-2023 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=[],s=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)},i=(e,t=500)=>{e.style.removeProperty("display");let{display:s}=window.getComputedStyle(e);"none"===s&&(s="block"),e.style.display=s;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)},o="hold-transition";class a{constructor(e){this._element=e}holdTransition(){let e;window.addEventListener("resize",(()=>{document.body.classList.add(o),clearTimeout(e),e=setTimeout((()=>{document.body.classList.remove(o)}),400)}))}}s((()=>{new a(document.body).holdTransition(),setTimeout((()=>{document.body.classList.add("app-loaded")}),400)}));const l=".lte.push-menu",r=`open${l}`,d=`collapse${l}`,c="sidebar-mini",p="sidebar-collapse",m="sidebar-open",h="sidebar-expand",v=`[class*="${h}"]`,u='[data-lte-toggle="sidebar"]',g={sidebarBreakpoint:992};class y{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},g),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(p),document.body.classList.add(m),this._element.dispatchEvent(e)}collapse(){const e=new Event(d);document.body.classList.remove(m),document.body.classList.add(p),this._element.dispatchEvent(e)}addSidebarBreakPoint(){var e,t,s;const n=null!==(t=null===(e=document.querySelector(v))||void 0===e?void 0:e.classList)&&void 0!==t?t:[],i=null!==(s=Array.from(n).find((e=>e.startsWith(h))))&&void 0!==s?s:"",o=document.getElementsByClassName(i)[0],a=window.getComputedStyle(o,"::before").getPropertyValue("content");this._config=Object.assign(Object.assign({},this._config),{sidebarBreakpoint:Number(a.replace(/[^\d.-]/g,""))}),window.innerWidth<=this._config.sidebarBreakpoint?this.collapse():(document.body.classList.contains(c)||this.expand(),document.body.classList.contains(c)&&document.body.classList.contains(p)&&this.collapse())}toggle(){document.body.classList.contains(p)?this.expand():this.collapse()}init(){this.addSidebarBreakPoint()}}s((()=>{var e;const t=null===document||void 0===document?void 0:document.querySelector(".app-sidebar");if(t){const e=new y(t,g);e.init(),window.addEventListener("resize",(()=>{e.init()}))}const s=document.createElement("div");s.className="sidebar-overlay",null===(e=document.querySelector(".app-wrapper"))||void 0===e||e.append(s),s.addEventListener("touchstart",(e=>{e.preventDefault();const t=e.currentTarget;new y(t,g).collapse()})),s.addEventListener("click",(e=>{e.preventDefault();const t=e.currentTarget;new y(t,g).collapse()})),document.querySelectorAll(u).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(u)),t&&(null==e||e.preventDefault(),new y(t,g).toggle())}))}))}));const _=".lte.treeview",f=`expanded${_}`,b=`collapsed${_}`,w="menu-open",L=".nav-treeview",E={animationSpeed:300};class S{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},E),t)}open(){var e;const t=new Event(f);this._element.classList.add(w);const s=null===(e=this._element)||void 0===e?void 0:e.querySelector(L);s&&i(s,this._config.animationSpeed),this._element.dispatchEvent(t)}close(){var e;const t=new Event(b);this._element.classList.remove(w);const s=null===(e=this._element)||void 0===e?void 0:e.querySelector(L);s&&n(s,this._config.animationSpeed),this._element.dispatchEvent(t)}toggle(){this._element.classList.contains(w)?this.close():this.open()}}s((()=>{document.querySelectorAll('[data-lte-toggle="treeview"]').forEach((e=>{e.addEventListener("click",(e=>{const t=e.target,s=t.closest(".nav-item"),n=t.closest(".nav-link");"#"!==(null==t?void 0:t.getAttribute("href"))&&"#"!==(null==n?void 0:n.getAttribute("href"))||e.preventDefault(),s&&new S(s,E).toggle()}))}))}));const x=".lte.direct-chat",T=`expanded${x}`,P=`collapsed${x}`,$="direct-chat-contacts-open";class q{constructor(e){this._element=e}toggle(){if(this._element.classList.contains($)){const e=new Event(P);this._element.classList.remove($),this._element.dispatchEvent(e)}else{const e=new Event(T);this._element.classList.add($),this._element.dispatchEvent(e)}}}s((()=>{document.querySelectorAll('[data-lte-toggle="chat-pane"]').forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest(".direct-chat");t&&new q(t).toggle()}))}))}));const z=".lte.card-widget",k=`collapsed${z}`,A=`expanded${z}`,D=`remove${z}`,B=`maximized${z}`,j=`minimized${z}`,O="card",C="collapsed-card",M="collapsing-card",H="expanding-card",W="was-collapsed",N="maximized-card",V='[data-lte-toggle="card-remove"]',F='[data-lte-toggle="card-collapse"]',G='[data-lte-toggle="card-maximize"]',I=`.${O}`,J=".card-body",K=".card-footer",Q={animationSpeed:500,collapseTrigger:F,removeTrigger:V,maximizeTrigger:G};class R{constructor(e,t){this._element=e,this._parent=e.closest(I),e.classList.contains(O)&&(this._parent=e),this._config=Object.assign(Object.assign({},Q),t)}collapse(){var e,t;const s=new Event(k);this._parent&&(this._parent.classList.add(M),(null===(e=this._parent)||void 0===e?void 0:e.querySelectorAll(`${J}, ${K}`)).forEach((e=>{e instanceof HTMLElement&&n(e,this._config.animationSpeed)})),setTimeout((()=>{this._parent&&(this._parent.classList.add(C),this._parent.classList.remove(M))}),this._config.animationSpeed)),null===(t=this._element)||void 0===t||t.dispatchEvent(s)}expand(){var e,t;const s=new Event(A);this._parent&&(this._parent.classList.add(H),(null===(e=this._parent)||void 0===e?void 0:e.querySelectorAll(`${J}, ${K}`)).forEach((e=>{e instanceof HTMLElement&&i(e,this._config.animationSpeed)})),setTimeout((()=>{this._parent&&(this._parent.classList.remove(C),this._parent.classList.remove(H))}),this._config.animationSpeed)),null===(t=this._element)||void 0===t||t.dispatchEvent(s)}remove(){var e;const t=new Event(D);this._parent&&n(this._parent,this._config.animationSpeed),null===(e=this._element)||void 0===e||e.dispatchEvent(t)}toggle(){var e;(null===(e=this._parent)||void 0===e?void 0:e.classList.contains(C))?this.expand():this.collapse()}maximize(){var e;const t=new Event(B);this._parent&&(this._parent.style.height=`${this._parent.offsetHeight}px`,this._parent.style.width=`${this._parent.offsetWidth}px`,this._parent.style.transition="all .15s",setTimeout((()=>{const e=document.querySelector("html");e&&e.classList.add(N),this._parent&&(this._parent.classList.add(N),this._parent.classList.contains(C)&&this._parent.classList.add(W))}),150)),null===(e=this._element)||void 0===e||e.dispatchEvent(t)}minimize(){var e;const t=new Event(j);this._parent&&(this._parent.style.height="auto",this._parent.style.width="auto",this._parent.style.transition="all .15s",setTimeout((()=>{var e;const t=document.querySelector("html");t&&t.classList.remove(N),this._parent&&(this._parent.classList.remove(N),(null===(e=this._parent)||void 0===e?void 0:e.classList.contains(W))&&this._parent.classList.remove(W))}),10)),null===(e=this._element)||void 0===e||e.dispatchEvent(t)}toggleMaximize(){var e;(null===(e=this._parent)||void 0===e?void 0:e.classList.contains(N))?this.minimize():this.maximize()}}s((()=>{document.querySelectorAll(F).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const t=e.target;new R(t,Q).toggle()}))})),document.querySelectorAll(V).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const t=e.target;new R(t,Q).remove()}))})),document.querySelectorAll(G).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const t=e.target;new R(t,Q).toggleMaximize()}))}))})),e.CardWidget=R,e.DirectChat=q,e.Layout=a,e.PushMenu=y,e.Treeview=S}));
|
|
//# sourceMappingURL=adminlte.min.js.map
|