AdminLTE/dist/js/adminlte.min.js

7 lines
9.7 KiB
JavaScript

/*!
* AdminLTE v3.0.0-beta.1 (https://adminlte.io)
* Copyright 2014-2019 Colorlib <http://colorlib.com>
* Licensed under MIT (https://github.com/almasaeed2010/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.adminlte={})}(this,function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i,t,o,s,r,a,l,c,d,f,h,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(i=jQuery,t="ControlSidebar",o="lte.control.sidebar",s=i.fn[t],r=".control-sidebar",a='[data-widget="control-sidebar"]',l=".main-header",c="control-sidebar-open",d="control-sidebar-slide-open",f={slide:!0},g.prototype.show=function(){this._config.slide?i("body").removeClass(d):i("body").removeClass(c)},g.prototype.collapse=function(){this._config.slide?i("body").addClass(d):i("body").addClass(c)},g.prototype.toggle=function(){this._setMargin(),i("body").hasClass(c)||i("body").hasClass(d)?this.show():this.collapse()},g.prototype._getConfig=function(e){return i.extend({},f,e)},g.prototype._setMargin=function(){i(r).css({top:i(l).innerHeight()})},g._jQueryInterface=function(t){return this.each(function(){var e=i(this).data(o);if(e||(e=new g(this,i(this).data()),i(this).data(o,e)),"undefined"===e[t])throw new Error(t+" is not a function");e[t]()})},h=g,i(document).on("click",a,function(e){e.preventDefault(),h._jQueryInterface.call(i(this),"toggle")}),i.fn[t]=h._jQueryInterface,i.fn[t].Constructor=h,i.fn[t].noConflict=function(){return i.fn[t]=s,h._jQueryInterface},h);function g(e,t){n(this,g),this._element=e,this._config=this._getConfig(t)}var y,_,m,v,b,w,C,S,j,E,x,D,Q,I,A,L,O,P=(y=jQuery,_="Layout",m="lte.layout",v=y.fn[_],b=".main-header",w=".main-sidebar .sidebar",C=".content-wrapper",S=".brand-link",j=".control-sidebar",E=".main-footer",x="hold-transition",D="content-fixed",Q="layout-fixed",I="layout-navbar-fixed",A="layout-footer-fixed",L={scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l"},T.prototype.fixLayoutHeight=function(){var e={window:y(window).height(),header:y(b).outerHeight(),footer:y(E).outerHeight(),sidebar:y(w).height()},t=this._max(e);y("body").hasClass(Q)?(y(C).css("min-height",t-e.header-e.footer),y(j+" .control-sidebar-content").css("height",t-e.header),"undefined"!=typeof y.fn.overlayScrollbars&&(y(w).overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}),y(j+" .control-sidebar-content").overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}))):e.sidebar<e.window?y(C).css("min-height",e.window-e.header-e.footer):y(C).css("min-height",e.sidebar-e.header),y("body").hasClass(I)&&(y(S).css("height",e.header),y(w).css("margin-top",e.header),y(w).css("margin-top",e.header)),y("body").hasClass(A)&&y(C).css("margin-bottom",e.footer),y("body").hasClass(D)&&y(C).css("height",y(C).css("min-height"))},T.prototype._init=function(){var e=this;y("body").removeClass(x),this.fixLayoutHeight(),y(w).on("collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu",function(){e.fixLayoutHeight()}),y(window).resize(function(){e.fixLayoutHeight()}),y("body, html").css("height","auto")},T.prototype._max=function(t){var n=0;return Object.keys(t).forEach(function(e){t[e]>n&&(n=t[e])}),n},T._jQueryInterface=function(n){return this.each(function(){var e=y(this).data(m),t=y.extend({},L,y(this).data());e||(e=new T(y(this),t),y(this).data(m,e)),"init"===n&&e[n]()})},O=T,y(window).on("load",function(){O._jQueryInterface.call(y("body"))}),y.fn[_]=O._jQueryInterface,y.fn[_].Constructor=O,y.fn[_].noConflict=function(){return y.fn[_]=v,O._jQueryInterface},O);function T(e,t){n(this,T),this._config=t,this._element=e,this._init()}var H,k,z,N,M,U,W,X,R,V,q,B,F,G,J=(H=jQuery,k="PushMenu",N="."+(z="lte.pushmenu"),M=H.fn[k],W={autoCollapseSize:!(U={COLLAPSED:"collapsed"+N,SHOWN:"shown"+N}),screenCollapseSize:768},X='[data-widget="pushmenu"]',R="body",V="#sidebar-overlay",q=".wrapper",B="sidebar-collapse",F="sidebar-open",K.prototype.show=function(){H(R).addClass(F).removeClass(B);var e=H.Event(U.SHOWN);H(this._element).trigger(e)},K.prototype.collapse=function(){H(R).removeClass(F).addClass(B);var e=H.Event(U.COLLAPSED);H(this._element).trigger(e)},K.prototype.isShown=function(){return H(window).width()>=this._options.screenCollapseSize?!H(R).hasClass(B):H(R).hasClass(F)},K.prototype.toggle=function(){this.isShown()?this.collapse():this.show()},K.prototype.autoCollapse=function(){this._options.autoCollapseSize&&(H(window).width()<=this._options.autoCollapseSize?this.isShown()&&this.toggle():this.isShown()||this.toggle())},K.prototype._init=function(){var e=this;this.autoCollapse(),H(window).resize(function(){e.autoCollapse()})},K.prototype._addOverlay=function(){var e=this,t=H("<div />",{id:"sidebar-overlay"});t.on("click",function(){e.collapse()}),H(q).append(t)},K._jQueryInterface=function(n){return this.each(function(){var e=H(this).data(z),t=H.extend({},W,H(this).data());e||(e=new K(this,t),H(this).data(z,e)),"init"===n&&e[n]()})},G=K,H(document).on("click",X,function(e){e.preventDefault();var t=e.currentTarget;"pushmenu"!==H(t).data("widget")&&(t=H(t).closest(X)),G._jQueryInterface.call(H(t),"toggle")}),H(window).on("load",function(){G._jQueryInterface.call(H(X))}),H.fn[k]=G._jQueryInterface,H.fn[k].Constructor=G,H.fn[k].noConflict=function(){return H.fn[k]=M,G._jQueryInterface},G);function K(e,t){n(this,K),this._element=e,this._options=H.extend({},W,t),this._init(),H(V).length||this._addOverlay()}var Y,Z,$,ee,te,ne,ie,oe,se,re,ae,le,ce,de=(Y=jQuery,Z="Treeview",ee="."+($="lte.treeview"),te=Y.fn[Z],ne={SELECTED:"selected"+ee,EXPANDED:"expanded"+ee,COLLAPSED:"collapsed"+ee,LOAD_DATA_API:"load"+ee},ie=".nav-item",oe=".nav-treeview",se=".menu-open",ae="menu-open",le={trigger:(re='[data-widget="treeview"]')+" "+".nav-link",animationSpeed:300,accordion:!0},fe.prototype.init=function(){this._setupListeners()},fe.prototype.expand=function(e,t){var n=this,i=Y.Event(ne.EXPANDED);if(this._config.accordion){var o=t.siblings(se).first(),s=o.find(oe).first();this.collapse(s,o)}e.slideDown(this._config.animationSpeed,function(){t.addClass(ae),Y(n._element).trigger(i)})},fe.prototype.collapse=function(e,t){var n=this,i=Y.Event(ne.COLLAPSED);e.slideUp(this._config.animationSpeed,function(){t.removeClass(ae),Y(n._element).trigger(i),e.find(se+" > "+oe).slideUp(),e.find(se).removeClass(ae)})},fe.prototype.toggle=function(e){var t=Y(e.currentTarget),n=t.next();if(n.is(oe)){e.preventDefault();var i=t.parents(ie).first();i.hasClass(ae)?this.collapse(Y(n),i):this.expand(Y(n),i)}},fe.prototype._setupListeners=function(){var t=this;Y(document).on("click",this._config.trigger,function(e){t.toggle(e)})},fe._jQueryInterface=function(n){return this.each(function(){var e=Y(this).data($),t=Y.extend({},le,Y(this).data());e||(e=new fe(Y(this),t),Y(this).data($,e)),"init"===n&&e[n]()})},ce=fe,Y(window).on(ne.LOAD_DATA_API,function(){Y(re).each(function(){ce._jQueryInterface.call(Y(this),"init")})}),Y.fn[Z]=ce._jQueryInterface,Y.fn[Z].Constructor=ce,Y.fn[Z].noConflict=function(){return Y.fn[Z]=te,ce._jQueryInterface},ce);function fe(e,t){n(this,fe),this._config=t,this._element=e}var he,ue,pe,ge,ye,_e,me,ve,be,we,Ce,Se,je,Ee,xe,De,Qe,Ie,Ae=(he=jQuery,ue="Widget",ge="."+(pe="lte.widget"),ye=he.fn[ue],_e={EXPANDED:"expanded"+ge,COLLAPSED:"collapsed"+ge,REMOVED:"removed"+ge},be=".card",we=".card-body",Ce=".card-footer",Se=".fa-minus",je=".fa-plus",Ee="collapsed-card",xe="fa-minus",De="fa-plus",Qe={animationSpeed:"normal",collapseTrigger:ve='[data-widget="collapse"]',removeTrigger:me='[data-widget="remove"]'},Le.prototype.collapse=function(){var e=this;this._parent.children(we+", "+Ce).slideUp(this._settings.animationSpeed,function(){e._parent.addClass(Ee)}),this._element.children(Se).addClass(De).removeClass(xe);var t=he.Event(_e.COLLAPSED);this._element.trigger(t,this._parent)},Le.prototype.expand=function(){var e=this;this._parent.children(we+", "+Ce).slideDown(this._settings.animationSpeed,function(){e._parent.removeClass(Ee)}),this._element.children(je).addClass(xe).removeClass(De);var t=he.Event(_e.EXPANDED);this._element.trigger(t,this._parent)},Le.prototype.remove=function(){this._parent.slideUp();var e=he.Event(_e.REMOVED);this._element.trigger(e,this._parent)},Le.prototype.toggle=function(){this._parent.hasClass(Ee)?this.expand():this.collapse()},Le.prototype._init=function(e){var t=this;this._parent=e,he(this).find(this._settings.collapseTrigger).click(function(){t.toggle()}),he(this).find(this._settings.removeTrigger).click(function(){t.remove()})},Le._jQueryInterface=function(t){return this.each(function(){var e=he(this).data(pe);e||(e=new Le(he(this),e),he(this).data(pe,"string"==typeof t?e:t)),"string"==typeof t&&t.match(/remove|toggle/)?e[t]():"object"===("undefined"==typeof t?"undefined":u(t))&&e._init(he(this))})},Ie=Le,he(document).on("click",ve,function(e){e&&e.preventDefault(),Ie._jQueryInterface.call(he(this),"toggle")}),he(document).on("click",me,function(e){e&&e.preventDefault(),Ie._jQueryInterface.call(he(this),"remove")}),he.fn[ue]=Ie._jQueryInterface,he.fn[ue].Constructor=Ie,he.fn[ue].noConflict=function(){return he.fn[ue]=ye,Ie._jQueryInterface},Ie);function Le(e,t){n(this,Le),this._element=e,this._parent=e.parents(be).first(),this._settings=he.extend({},Qe,t)}e.ControlSidebar=p,e.Layout=P,e.PushMenu=J,e.Treeview=de,e.Widget=Ae,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=adminlte.min.js.map