7 lines
11 KiB
JavaScript
7 lines
11 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=[],n=e=>{"loading"===document.readyState?(t.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of t)e()})),t.push(e)):e()},s=(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:n}=window.getComputedStyle(e);"none"===n&&(n="block"),e.style.display=n;const s=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=`${s}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 l{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)}))}}n((()=>{new l(document.body).holdTransition(),setTimeout((()=>{document.body.classList.add("app-loaded")}),400)}));const a=".lte.push-menu",r=`open${a}`,c=`collapse${a}`,d="sidebar-mini",m="sidebar-collapse",p="sidebar-open",h="sidebar-expand",u=`[class*="${h}"]`,v='[data-lte-toggle="sidebar"]',y={sidebarBreakpoint:992};class g{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},y),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(m),document.body.classList.add(p),this._element.dispatchEvent(e)}collapse(){const e=new Event(c);document.body.classList.remove(p),document.body.classList.add(m),this._element.dispatchEvent(e)}addSidebarBreakPoint(){var e,t,n;const s=null!==(t=null===(e=document.querySelector(u))||void 0===e?void 0:e.classList)&&void 0!==t?t:[],i=null!==(n=Array.from(s).find((e=>e.startsWith(h))))&&void 0!==n?n:"",o=document.getElementsByClassName(i)[0],l=window.getComputedStyle(o,"::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(m)&&this.collapse())}toggle(){document.body.classList.contains(m)?this.expand():this.collapse()}init(){this.addSidebarBreakPoint()}}n((()=>{var e;const t=null===document||void 0===document?void 0:document.querySelector(".app-sidebar");if(t){const e=new g(t,y);e.init(),window.addEventListener("resize",(()=>{e.init()}))}const n=document.createElement("div");n.className="side
|
||
|
//# sourceMappingURL=adminlte.min.js.map
|