adminlte.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905
  1. /*!
  2. * AdminLTE v3.0.3 (https://adminlte.io)
  3. * Copyright 2014-2020 Colorlib <http://colorlib.com>
  4. * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  8. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  9. (global = global || self, factory(global.adminlte = {}));
  10. }(this, (function (exports) { 'use strict';
  11. /**
  12. * --------------------------------------------
  13. * AdminLTE ControlSidebar.js
  14. * License MIT
  15. * --------------------------------------------
  16. */
  17. var ControlSidebar = function ($) {
  18. /**
  19. * Constants
  20. * ====================================================
  21. */
  22. var NAME = 'ControlSidebar';
  23. var DATA_KEY = 'lte.controlsidebar';
  24. var EVENT_KEY = "." + DATA_KEY;
  25. var JQUERY_NO_CONFLICT = $.fn[NAME];
  26. var Event = {
  27. COLLAPSED: "collapsed" + EVENT_KEY,
  28. EXPANDED: "expanded" + EVENT_KEY
  29. };
  30. var Selector = {
  31. CONTROL_SIDEBAR: '.control-sidebar',
  32. CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
  33. DATA_TOGGLE: '[data-widget="control-sidebar"]',
  34. CONTENT: '.content-wrapper',
  35. HEADER: '.main-header',
  36. FOOTER: '.main-footer'
  37. };
  38. var ClassName = {
  39. CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
  40. CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
  41. CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open',
  42. LAYOUT_FIXED: 'layout-fixed',
  43. NAVBAR_FIXED: 'layout-navbar-fixed',
  44. NAVBAR_SM_FIXED: 'layout-sm-navbar-fixed',
  45. NAVBAR_MD_FIXED: 'layout-md-navbar-fixed',
  46. NAVBAR_LG_FIXED: 'layout-lg-navbar-fixed',
  47. NAVBAR_XL_FIXED: 'layout-xl-navbar-fixed',
  48. FOOTER_FIXED: 'layout-footer-fixed',
  49. FOOTER_SM_FIXED: 'layout-sm-footer-fixed',
  50. FOOTER_MD_FIXED: 'layout-md-footer-fixed',
  51. FOOTER_LG_FIXED: 'layout-lg-footer-fixed',
  52. FOOTER_XL_FIXED: 'layout-xl-footer-fixed'
  53. };
  54. var Default = {
  55. controlsidebarSlide: true,
  56. scrollbarTheme: 'os-theme-light',
  57. scrollbarAutoHide: 'l'
  58. };
  59. /**
  60. * Class Definition
  61. * ====================================================
  62. */
  63. var ControlSidebar =
  64. /*#__PURE__*/
  65. function () {
  66. function ControlSidebar(element, config) {
  67. this._element = element;
  68. this._config = config;
  69. this._init();
  70. } // Public
  71. var _proto = ControlSidebar.prototype;
  72. _proto.collapse = function collapse() {
  73. // Show the control sidebar
  74. if (this._config.controlsidebarSlide) {
  75. $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
  76. $('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
  77. $(Selector.CONTROL_SIDEBAR).hide();
  78. $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
  79. $(this).dequeue();
  80. });
  81. } else {
  82. $('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN);
  83. }
  84. var collapsedEvent = $.Event(Event.COLLAPSED);
  85. $(this._element).trigger(collapsedEvent);
  86. };
  87. _proto.show = function show() {
  88. // Collapse the control sidebar
  89. if (this._config.controlsidebarSlide) {
  90. $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
  91. $(Selector.CONTROL_SIDEBAR).show().delay(10).queue(function () {
  92. $('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
  93. $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
  94. $(this).dequeue();
  95. });
  96. $(this).dequeue();
  97. });
  98. } else {
  99. $('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN);
  100. }
  101. var expandedEvent = $.Event(Event.EXPANDED);
  102. $(this._element).trigger(expandedEvent);
  103. };
  104. _proto.toggle = function toggle() {
  105. var shouldClose = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE);
  106. if (shouldClose) {
  107. // Close the control sidebar
  108. this.collapse();
  109. } else {
  110. // Open the control sidebar
  111. this.show();
  112. }
  113. } // Private
  114. ;
  115. _proto._init = function _init() {
  116. var _this = this;
  117. this._fixHeight();
  118. this._fixScrollHeight();
  119. $(window).resize(function () {
  120. _this._fixHeight();
  121. _this._fixScrollHeight();
  122. });
  123. $(window).scroll(function () {
  124. if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)) {
  125. _this._fixScrollHeight();
  126. }
  127. });
  128. };
  129. _proto._fixScrollHeight = function _fixScrollHeight() {
  130. var heights = {
  131. scroll: $(document).height(),
  132. window: $(window).height(),
  133. header: $(Selector.HEADER).outerHeight(),
  134. footer: $(Selector.FOOTER).outerHeight()
  135. };
  136. var positions = {
  137. bottom: Math.abs(heights.window + $(window).scrollTop() - heights.scroll),
  138. top: $(window).scrollTop()
  139. };
  140. var navbarFixed = false;
  141. var footerFixed = false;
  142. if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
  143. if ($('body').hasClass(ClassName.NAVBAR_FIXED) || $('body').hasClass(ClassName.NAVBAR_SM_FIXED) || $('body').hasClass(ClassName.NAVBAR_MD_FIXED) || $('body').hasClass(ClassName.NAVBAR_LG_FIXED) || $('body').hasClass(ClassName.NAVBAR_XL_FIXED)) {
  144. if ($(Selector.HEADER).css("position") === "fixed") {
  145. navbarFixed = true;
  146. }
  147. }
  148. if ($('body').hasClass(ClassName.FOOTER_FIXED) || $('body').hasClass(ClassName.FOOTER_SM_FIXED) || $('body').hasClass(ClassName.FOOTER_MD_FIXED) || $('body').hasClass(ClassName.FOOTER_LG_FIXED) || $('body').hasClass(ClassName.FOOTER_XL_FIXED)) {
  149. if ($(Selector.FOOTER).css("position") === "fixed") {
  150. footerFixed = true;
  151. }
  152. }
  153. if (positions.top === 0 && positions.bottom === 0) {
  154. $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer);
  155. $(Selector.CONTROL_SIDEBAR).css('top', heights.header);
  156. $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header + heights.footer));
  157. } else if (positions.bottom <= heights.footer) {
  158. if (footerFixed === false) {
  159. $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer - positions.bottom);
  160. $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.footer - positions.bottom));
  161. } else {
  162. $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer);
  163. }
  164. } else if (positions.top <= heights.header) {
  165. if (navbarFixed === false) {
  166. $(Selector.CONTROL_SIDEBAR).css('top', heights.header - positions.top);
  167. $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header - positions.top));
  168. } else {
  169. $(Selector.CONTROL_SIDEBAR).css('top', heights.header);
  170. }
  171. } else {
  172. if (navbarFixed === false) {
  173. $(Selector.CONTROL_SIDEBAR).css('top', 0);
  174. $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window);
  175. } else {
  176. $(Selector.CONTROL_SIDEBAR).css('top', heights.header);
  177. }
  178. }
  179. }
  180. };
  181. _proto._fixHeight = function _fixHeight() {
  182. var heights = {
  183. window: $(window).height(),
  184. header: $(Selector.HEADER).outerHeight(),
  185. footer: $(Selector.FOOTER).outerHeight()
  186. };
  187. if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
  188. var sidebarHeight = heights.window - heights.header;
  189. if ($('body').hasClass(ClassName.FOOTER_FIXED) || $('body').hasClass(ClassName.FOOTER_SM_FIXED) || $('body').hasClass(ClassName.FOOTER_MD_FIXED) || $('body').hasClass(ClassName.FOOTER_LG_FIXED) || $('body').hasClass(ClassName.FOOTER_XL_FIXED)) {
  190. if ($(Selector.FOOTER).css("position") === "fixed") {
  191. sidebarHeight = heights.window - heights.header - heights.footer;
  192. }
  193. }
  194. $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', sidebarHeight);
  195. if (typeof $.fn.overlayScrollbars !== 'undefined') {
  196. $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).overlayScrollbars({
  197. className: this._config.scrollbarTheme,
  198. sizeAutoCapable: true,
  199. scrollbars: {
  200. autoHide: this._config.scrollbarAutoHide,
  201. clickScrolling: true
  202. }
  203. });
  204. }
  205. }
  206. } // Static
  207. ;
  208. ControlSidebar._jQueryInterface = function _jQueryInterface(operation) {
  209. return this.each(function () {
  210. var data = $(this).data(DATA_KEY);
  211. var _options = $.extend({}, Default, $(this).data());
  212. if (!data) {
  213. data = new ControlSidebar(this, _options);
  214. $(this).data(DATA_KEY, data);
  215. }
  216. if (data[operation] === 'undefined') {
  217. throw new Error(operation + " is not a function");
  218. }
  219. data[operation]();
  220. });
  221. };
  222. return ControlSidebar;
  223. }();
  224. /**
  225. *
  226. * Data Api implementation
  227. * ====================================================
  228. */
  229. $(document).on('click', Selector.DATA_TOGGLE, function (event) {
  230. event.preventDefault();
  231. ControlSidebar._jQueryInterface.call($(this), 'toggle');
  232. });
  233. /**
  234. * jQuery API
  235. * ====================================================
  236. */
  237. $.fn[NAME] = ControlSidebar._jQueryInterface;
  238. $.fn[NAME].Constructor = ControlSidebar;
  239. $.fn[NAME].noConflict = function () {
  240. $.fn[NAME] = JQUERY_NO_CONFLICT;
  241. return ControlSidebar._jQueryInterface;
  242. };
  243. return ControlSidebar;
  244. }(jQuery);
  245. /**
  246. * --------------------------------------------
  247. * AdminLTE Layout.js
  248. * License MIT
  249. * --------------------------------------------
  250. */
  251. var Layout = function ($) {
  252. /**
  253. * Constants
  254. * ====================================================
  255. */
  256. var NAME = 'Layout';
  257. var DATA_KEY = 'lte.layout';
  258. var JQUERY_NO_CONFLICT = $.fn[NAME];
  259. var Selector = {
  260. HEADER: '.main-header',
  261. MAIN_SIDEBAR: '.main-sidebar',
  262. SIDEBAR: '.main-sidebar .sidebar',
  263. CONTENT: '.content-wrapper',
  264. BRAND: '.brand-link',
  265. CONTENT_HEADER: '.content-header',
  266. WRAPPER: '.wrapper',
  267. CONTROL_SIDEBAR: '.control-sidebar',
  268. CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
  269. CONTROL_SIDEBAR_BTN: '[data-widget="control-sidebar"]',
  270. LAYOUT_FIXED: '.layout-fixed',
  271. FOOTER: '.main-footer',
  272. PUSHMENU_BTN: '[data-widget="pushmenu"]',
  273. LOGIN_BOX: '.login-box',
  274. REGISTER_BOX: '.register-box'
  275. };
  276. var ClassName = {
  277. HOLD: 'hold-transition',
  278. SIDEBAR: 'main-sidebar',
  279. CONTENT_FIXED: 'content-fixed',
  280. SIDEBAR_FOCUSED: 'sidebar-focused',
  281. LAYOUT_FIXED: 'layout-fixed',
  282. NAVBAR_FIXED: 'layout-navbar-fixed',
  283. FOOTER_FIXED: 'layout-footer-fixed',
  284. LOGIN_PAGE: 'login-page',
  285. REGISTER_PAGE: 'register-page',
  286. CONTROL_SIDEBAR_SLIDE_OPEN: 'control-sidebar-slide-open',
  287. CONTROL_SIDEBAR_OPEN: 'control-sidebar-open'
  288. };
  289. var Default = {
  290. scrollbarTheme: 'os-theme-light',
  291. scrollbarAutoHide: 'l',
  292. panelAutoHeight: true,
  293. loginRegisterAutoHeight: true
  294. };
  295. /**
  296. * Class Definition
  297. * ====================================================
  298. */
  299. var Layout =
  300. /*#__PURE__*/
  301. function () {
  302. function Layout(element, config) {
  303. this._config = config;
  304. this._element = element;
  305. this._init();
  306. } // Public
  307. var _proto = Layout.prototype;
  308. _proto.fixLayoutHeight = function fixLayoutHeight(extra) {
  309. if (extra === void 0) {
  310. extra = null;
  311. }
  312. var control_sidebar = 0;
  313. if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || extra == 'control_sidebar') {
  314. control_sidebar = $(Selector.CONTROL_SIDEBAR_CONTENT).height();
  315. }
  316. var heights = {
  317. window: $(window).height(),
  318. header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
  319. footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
  320. sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
  321. control_sidebar: control_sidebar
  322. };
  323. var max = this._max(heights);
  324. var offset = this._config.panelAutoHeight;
  325. if (offset === true) {
  326. offset = 0;
  327. }
  328. if (offset !== false) {
  329. if (max == heights.control_sidebar) {
  330. $(Selector.CONTENT).css('min-height', max + offset);
  331. } else if (max == heights.window) {
  332. $(Selector.CONTENT).css('min-height', max + offset - heights.header - heights.footer);
  333. } else {
  334. $(Selector.CONTENT).css('min-height', max + offset - heights.header);
  335. }
  336. }
  337. if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
  338. if (offset !== false) {
  339. $(Selector.CONTENT).css('min-height', max + offset - heights.header - heights.footer);
  340. }
  341. if (typeof $.fn.overlayScrollbars !== 'undefined') {
  342. $(Selector.SIDEBAR).overlayScrollbars({
  343. className: this._config.scrollbarTheme,
  344. sizeAutoCapable: true,
  345. scrollbars: {
  346. autoHide: this._config.scrollbarAutoHide,
  347. clickScrolling: true
  348. }
  349. });
  350. }
  351. }
  352. };
  353. _proto.fixLoginRegisterHeight = function fixLoginRegisterHeight() {
  354. if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length === 0) {
  355. $('body, html').css('height', 'auto');
  356. } else if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length !== 0) {
  357. var box_height = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height();
  358. if ($('body').css('min-height') !== box_height) {
  359. $('body').css('min-height', box_height);
  360. }
  361. }
  362. } // Private
  363. ;
  364. _proto._init = function _init() {
  365. var _this = this;
  366. // Activate layout height watcher
  367. this.fixLayoutHeight();
  368. if (this._config.loginRegisterAutoHeight === true) {
  369. this.fixLoginRegisterHeight();
  370. } else if (Number.isInteger(this._config.loginRegisterAutoHeight)) {
  371. setInterval(this.fixLoginRegisterHeight, this._config.loginRegisterAutoHeight);
  372. }
  373. $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', function () {
  374. _this.fixLayoutHeight();
  375. });
  376. $(Selector.PUSHMENU_BTN).on('collapsed.lte.pushmenu shown.lte.pushmenu', function () {
  377. _this.fixLayoutHeight();
  378. });
  379. $(Selector.CONTROL_SIDEBAR_BTN).on('collapsed.lte.controlsidebar', function () {
  380. _this.fixLayoutHeight();
  381. }).on('expanded.lte.controlsidebar', function () {
  382. _this.fixLayoutHeight('control_sidebar');
  383. });
  384. $(window).resize(function () {
  385. _this.fixLayoutHeight();
  386. });
  387. $('body.hold-transition').removeClass('hold-transition');
  388. };
  389. _proto._max = function _max(numbers) {
  390. // Calculate the maximum number in a list
  391. var max = 0;
  392. Object.keys(numbers).forEach(function (key) {
  393. if (numbers[key] > max) {
  394. max = numbers[key];
  395. }
  396. });
  397. return max;
  398. } // Static
  399. ;
  400. Layout._jQueryInterface = function _jQueryInterface(config) {
  401. if (config === void 0) {
  402. config = '';
  403. }
  404. return this.each(function () {
  405. var data = $(this).data(DATA_KEY);
  406. var _options = $.extend({}, Default, $(this).data());
  407. if (!data) {
  408. data = new Layout($(this), _options);
  409. $(this).data(DATA_KEY, data);
  410. }
  411. if (config === 'init' || config === '') {
  412. data['_init']();
  413. } else if (config === 'fixLayoutHeight' || config === 'fixLoginRegisterHeight') {
  414. data[config]();
  415. }
  416. });
  417. };
  418. return Layout;
  419. }();
  420. /**
  421. * Data API
  422. * ====================================================
  423. */
  424. $(window).on('load', function () {
  425. Layout._jQueryInterface.call($('body'));
  426. });
  427. $(Selector.SIDEBAR + ' a').on('focusin', function () {
  428. $(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED);
  429. });
  430. $(Selector.SIDEBAR + ' a').on('focusout', function () {
  431. $(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED);
  432. });
  433. /**
  434. * jQuery API
  435. * ====================================================
  436. */
  437. $.fn[NAME] = Layout._jQueryInterface;
  438. $.fn[NAME].Constructor = Layout;
  439. $.fn[NAME].noConflict = function () {
  440. $.fn[NAME] = JQUERY_NO_CONFLICT;
  441. return Layout._jQueryInterface;
  442. };
  443. return Layout;
  444. }(jQuery);
  445. /**
  446. * --------------------------------------------
  447. * AdminLTE PushMenu.js
  448. * License MIT
  449. * --------------------------------------------
  450. */
  451. var PushMenu = function ($) {
  452. /**
  453. * Constants
  454. * ====================================================
  455. */
  456. var NAME = 'PushMenu';
  457. var DATA_KEY = 'lte.pushmenu';
  458. var EVENT_KEY = "." + DATA_KEY;
  459. var JQUERY_NO_CONFLICT = $.fn[NAME];
  460. var Event = {
  461. COLLAPSED: "collapsed" + EVENT_KEY,
  462. SHOWN: "shown" + EVENT_KEY
  463. };
  464. var Default = {
  465. autoCollapseSize: 992,
  466. enableRemember: false,
  467. noTransitionAfterReload: true
  468. };
  469. var Selector = {
  470. TOGGLE_BUTTON: '[data-widget="pushmenu"]',
  471. SIDEBAR_MINI: '.sidebar-mini',
  472. SIDEBAR_COLLAPSED: '.sidebar-collapse',
  473. BODY: 'body',
  474. OVERLAY: '#sidebar-overlay',
  475. WRAPPER: '.wrapper'
  476. };
  477. var ClassName = {
  478. SIDEBAR_OPEN: 'sidebar-open',
  479. COLLAPSED: 'sidebar-collapse',
  480. OPEN: 'sidebar-open'
  481. };
  482. /**
  483. * Class Definition
  484. * ====================================================
  485. */
  486. var PushMenu =
  487. /*#__PURE__*/
  488. function () {
  489. function PushMenu(element, options) {
  490. this._element = element;
  491. this._options = $.extend({}, Default, options);
  492. if (!$(Selector.OVERLAY).length) {
  493. this._addOverlay();
  494. }
  495. this._init();
  496. } // Public
  497. var _proto = PushMenu.prototype;
  498. _proto.expand = function expand() {
  499. if (this._options.autoCollapseSize) {
  500. if ($(window).width() <= this._options.autoCollapseSize) {
  501. $(Selector.BODY).addClass(ClassName.OPEN);
  502. }
  503. }
  504. $(Selector.BODY).removeClass(ClassName.COLLAPSED);
  505. if (this._options.enableRemember) {
  506. localStorage.setItem("remember" + EVENT_KEY, ClassName.OPEN);
  507. }
  508. var shownEvent = $.Event(Event.SHOWN);
  509. $(this._element).trigger(shownEvent);
  510. };
  511. _proto.collapse = function collapse() {
  512. if (this._options.autoCollapseSize) {
  513. if ($(window).width() <= this._options.autoCollapseSize) {
  514. $(Selector.BODY).removeClass(ClassName.OPEN);
  515. }
  516. }
  517. $(Selector.BODY).addClass(ClassName.COLLAPSED);
  518. if (this._options.enableRemember) {
  519. localStorage.setItem("remember" + EVENT_KEY, ClassName.COLLAPSED);
  520. }
  521. var collapsedEvent = $.Event(Event.COLLAPSED);
  522. $(this._element).trigger(collapsedEvent);
  523. };
  524. _proto.toggle = function toggle() {
  525. if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED)) {
  526. this.collapse();
  527. } else {
  528. this.expand();
  529. }
  530. };
  531. _proto.autoCollapse = function autoCollapse(resize) {
  532. if (resize === void 0) {
  533. resize = false;
  534. }
  535. if (this._options.autoCollapseSize) {
  536. if ($(window).width() <= this._options.autoCollapseSize) {
  537. if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
  538. this.collapse();
  539. }
  540. } else if (resize == true) {
  541. if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
  542. $(Selector.BODY).removeClass(ClassName.OPEN);
  543. }
  544. }
  545. }
  546. };
  547. _proto.remember = function remember() {
  548. if (this._options.enableRemember) {
  549. var toggleState = localStorage.getItem("remember" + EVENT_KEY);
  550. if (toggleState == ClassName.COLLAPSED) {
  551. if (this._options.noTransitionAfterReload) {
  552. $("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function () {
  553. $(this).removeClass('hold-transition');
  554. $(this).dequeue();
  555. });
  556. } else {
  557. $("body").addClass(ClassName.COLLAPSED);
  558. }
  559. } else {
  560. if (this._options.noTransitionAfterReload) {
  561. $("body").addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function () {
  562. $(this).removeClass('hold-transition');
  563. $(this).dequeue();
  564. });
  565. } else {
  566. $("body").removeClass(ClassName.COLLAPSED);
  567. }
  568. }
  569. }
  570. } // Private
  571. ;
  572. _proto._init = function _init() {
  573. var _this = this;
  574. this.remember();
  575. this.autoCollapse();
  576. $(window).resize(function () {
  577. _this.autoCollapse(true);
  578. });
  579. };
  580. _proto._addOverlay = function _addOverlay() {
  581. var _this2 = this;
  582. var overlay = $('<div />', {
  583. id: 'sidebar-overlay'
  584. });
  585. overlay.on('click', function () {
  586. _this2.collapse();
  587. });
  588. $(Selector.WRAPPER).append(overlay);
  589. } // Static
  590. ;
  591. PushMenu._jQueryInterface = function _jQueryInterface(operation) {
  592. return this.each(function () {
  593. var data = $(this).data(DATA_KEY);
  594. var _options = $.extend({}, Default, $(this).data());
  595. if (!data) {
  596. data = new PushMenu(this, _options);
  597. $(this).data(DATA_KEY, data);
  598. }
  599. if (typeof operation === 'string' && operation.match(/collapse|expand|toggle/)) {
  600. data[operation]();
  601. }
  602. });
  603. };
  604. return PushMenu;
  605. }();
  606. /**
  607. * Data API
  608. * ====================================================
  609. */
  610. $(document).on('click', Selector.TOGGLE_BUTTON, function (event) {
  611. event.preventDefault();
  612. var button = event.currentTarget;
  613. if ($(button).data('widget') !== 'pushmenu') {
  614. button = $(button).closest(Selector.TOGGLE_BUTTON);
  615. }
  616. PushMenu._jQueryInterface.call($(button), 'toggle');
  617. });
  618. $(window).on('load', function () {
  619. PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON));
  620. });
  621. /**
  622. * jQuery API
  623. * ====================================================
  624. */
  625. $.fn[NAME] = PushMenu._jQueryInterface;
  626. $.fn[NAME].Constructor = PushMenu;
  627. $.fn[NAME].noConflict = function () {
  628. $.fn[NAME] = JQUERY_NO_CONFLICT;
  629. return PushMenu._jQueryInterface;
  630. };
  631. return PushMenu;
  632. }(jQuery);
  633. /**
  634. * --------------------------------------------
  635. * AdminLTE Treeview.js
  636. * License MIT
  637. * --------------------------------------------
  638. */
  639. var Treeview = function ($) {
  640. /**
  641. * Constants
  642. * ====================================================
  643. */
  644. var NAME = 'Treeview';
  645. var DATA_KEY = 'lte.treeview';
  646. var EVENT_KEY = "." + DATA_KEY;
  647. var JQUERY_NO_CONFLICT = $.fn[NAME];
  648. var Event = {
  649. SELECTED: "selected" + EVENT_KEY,
  650. EXPANDED: "expanded" + EVENT_KEY,
  651. COLLAPSED: "collapsed" + EVENT_KEY,
  652. LOAD_DATA_API: "load" + EVENT_KEY
  653. };
  654. var Selector = {
  655. LI: '.nav-item',
  656. LINK: '.nav-link',
  657. TREEVIEW_MENU: '.nav-treeview',
  658. OPEN: '.menu-open',
  659. DATA_WIDGET: '[data-widget="treeview"]'
  660. };
  661. var ClassName = {
  662. LI: 'nav-item',
  663. LINK: 'nav-link',
  664. TREEVIEW_MENU: 'nav-treeview',
  665. OPEN: 'menu-open',
  666. SIDEBAR_COLLAPSED: 'sidebar-collapse'
  667. };
  668. var Default = {
  669. trigger: Selector.DATA_WIDGET + " " + Selector.LINK,
  670. animationSpeed: 300,
  671. accordion: true,
  672. expandSidebar: false,
  673. sidebarButtonSelector: '[data-widget="pushmenu"]'
  674. };
  675. /**
  676. * Class Definition
  677. * ====================================================
  678. */
  679. var Treeview =
  680. /*#__PURE__*/
  681. function () {
  682. function Treeview(element, config) {
  683. this._config = config;
  684. this._element = element;
  685. } // Public
  686. var _proto = Treeview.prototype;
  687. _proto.init = function init() {
  688. this._setupListeners();
  689. };
  690. _proto.expand = function expand(treeviewMenu, parentLi) {
  691. var _this = this;
  692. var expandedEvent = $.Event(Event.EXPANDED);
  693. if (this._config.accordion) {
  694. var openMenuLi = parentLi.siblings(Selector.OPEN).first();
  695. var openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first();
  696. this.collapse(openTreeview, openMenuLi);
  697. }
  698. treeviewMenu.stop().slideDown(this._config.animationSpeed, function () {
  699. parentLi.addClass(ClassName.OPEN);
  700. $(_this._element).trigger(expandedEvent);
  701. });
  702. if (this._config.expandSidebar) {
  703. this._expandSidebar();
  704. }
  705. };
  706. _proto.collapse = function collapse(treeviewMenu, parentLi) {
  707. var _this2 = this;
  708. var collapsedEvent = $.Event(Event.COLLAPSED);
  709. treeviewMenu.stop().slideUp(this._config.animationSpeed, function () {
  710. parentLi.removeClass(ClassName.OPEN);
  711. $(_this2._element).trigger(collapsedEvent);
  712. treeviewMenu.find(Selector.OPEN + " > " + Selector.TREEVIEW_MENU).slideUp();
  713. treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN);
  714. });
  715. };
  716. _proto.toggle = function toggle(event) {
  717. var $relativeTarget = $(event.currentTarget);
  718. var $parent = $relativeTarget.parent();
  719. var treeviewMenu = $parent.find('> ' + Selector.TREEVIEW_MENU);
  720. if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
  721. if (!$parent.is(Selector.LI)) {
  722. treeviewMenu = $parent.parent().find('> ' + Selector.TREEVIEW_MENU);
  723. }
  724. if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
  725. return;
  726. }
  727. }
  728. event.preventDefault();
  729. var parentLi = $relativeTarget.parents(Selector.LI).first();
  730. var isOpen = parentLi.hasClass(ClassName.OPEN);
  731. if (isOpen) {
  732. this.collapse($(treeviewMenu), parentLi);
  733. } else {
  734. this.expand($(treeviewMenu), parentLi);
  735. }
  736. } // Private
  737. ;
  738. _proto._setupListeners = function _setupListeners() {
  739. var _this3 = this;
  740. $(document).on('click', this._config.trigger, function (event) {
  741. _this3.toggle(event);
  742. });
  743. };
  744. _proto._expandSidebar = function _expandSidebar() {
  745. if ($('body').hasClass(ClassName.SIDEBAR_COLLAPSED)) {
  746. $(this._config.sidebarButtonSelector).PushMenu('expand');
  747. }
  748. } // Static
  749. ;
  750. Treeview._jQueryInterface = function _jQueryInterface(config) {
  751. return this.each(function () {
  752. var data = $(this).data(DATA_KEY);
  753. var _options = $.extend({}, Default, $(this).data());
  754. if (!data) {
  755. data = new Treeview($(this), _options);
  756. $(this).data(DATA_KEY, data);
  757. }
  758. if (config === 'init') {
  759. data[config]();
  760. }
  761. });
  762. };
  763. return Treeview;
  764. }();
  765. /**
  766. * Data API
  767. * ====================================================
  768. */
  769. $(window).on(Event.LOAD_DATA_API, function () {
  770. $(Selector.DATA_WIDGET).each(function () {
  771. Treeview._jQueryInterface.call($(this), 'init');
  772. });
  773. });
  774. /**
  775. * jQuery API
  776. * ====================================================
  777. */
  778. $.fn[NAME] = Treeview._jQueryInterface;
  779. $.fn[NAME].Constructor = Treeview;
  780. $.fn[NAME].noConflict = function () {
  781. $.fn[NAME] = JQUERY_NO_CONFLICT;
  782. return Treeview._jQueryInterface;
  783. };
  784. return Treeview;
  785. }(jQuery);
  786. /**
  787. * --------------------------------------------
  788. * AdminLTE DirectChat.js
  789. * License MIT
  790. * --------------------------------------------
  791. */
  792. var DirectChat = function ($) {
  793. /**
  794. * Constants
  795. * ====================================================
  796. */
  797. var NAME = 'DirectChat';
  798. var DATA_KEY = 'lte.directchat';
  799. var JQUERY_NO_CONFLICT = $.fn[NAME];
  800. var Event = {
  801. TOGGLED: "toggled{EVENT_KEY}"
  802. };
  803. var Selector = {
  804. DATA_TOGGLE: '[data-widget="chat-pane-toggle"]',
  805. DIRECT_CHAT: '.direct-chat'
  806. };
  807. var ClassName = {
  808. DIRECT_CHAT_OPEN: 'direct-chat-contacts-open'
  809. };
  810. /**
  811. * Class Definition
  812. * ====================================================
  813. */
  814. var DirectChat =
  815. /*#__PURE__*/
  816. function () {
  817. function DirectChat(element, config) {
  818. this._element = element;
  819. }
  820. var _proto = DirectChat.prototype;
  821. _proto.toggle = function toggle() {
  822. $(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN);
  823. var toggledEvent = $.Event(Event.TOGGLED);
  824. $(this._element).trigger(toggledEvent);
  825. } // Static
  826. ;
  827. DirectChat._jQueryInterface = function _jQueryInterface(config) {
  828. return this.each(function () {
  829. var data = $(this).data(DATA_KEY);
  830. if (!data) {
  831. data = new DirectChat($(this));
  832. $(this).data(DATA_KEY, data);
  833. }
  834. data[config]();
  835. });
  836. };
  837. return DirectChat;
  838. }();
  839. /**
  840. *
  841. * Data Api implementation
  842. * ====================================================
  843. */
  844. $(document).on('click', Selector.DATA_TOGGLE, function (event) {
  845. if (event) event.preventDefault();
  846. DirectChat._jQueryInterface.call($(this), 'toggle');
  847. });
  848. /**
  849. * jQuery API
  850. * ====================================================
  851. */
  852. $.fn[NAME] = DirectChat._jQueryInterface;
  853. $.fn[NAME].Constructor = DirectChat;
  854. $.fn[NAME].noConflict = function () {
  855. $.fn[NAME] = JQUERY_NO_CONFLICT;
  856. return DirectChat._jQueryInterface;
  857. };
  858. return DirectChat;
  859. }(jQuery);
  860. /**
  861. * --------------------------------------------
  862. * AdminLTE TodoList.js
  863. * License MIT
  864. * --------------------------------------------
  865. */
  866. var TodoList = function ($) {
  867. /**
  868. * Constants
  869. * ====================================================
  870. */
  871. var NAME = 'TodoList';
  872. var DATA_KEY = 'lte.todolist';
  873. var JQUERY_NO_CONFLICT = $.fn[NAME];
  874. var Selector = {
  875. DATA_TOGGLE: '[data-widget="todo-list"]'
  876. };
  877. var ClassName = {
  878. TODO_LIST_DONE: 'done'
  879. };
  880. var Default = {
  881. onCheck: function onCheck(item) {
  882. return item;
  883. },
  884. onUnCheck: function onUnCheck(item) {
  885. return item;
  886. }
  887. };
  888. /**
  889. * Class Definition
  890. * ====================================================
  891. */
  892. var TodoList =
  893. /*#__PURE__*/
  894. function () {
  895. function TodoList(element, config) {
  896. this._config = config;
  897. this._element = element;
  898. this._init();
  899. } // Public
  900. var _proto = TodoList.prototype;
  901. _proto.toggle = function toggle(item) {
  902. item.parents('li').toggleClass(ClassName.TODO_LIST_DONE);
  903. if (!$(item).prop('checked')) {
  904. this.unCheck($(item));
  905. return;
  906. }
  907. this.check(item);
  908. };
  909. _proto.check = function check(item) {
  910. this._config.onCheck.call(item);
  911. };
  912. _proto.unCheck = function unCheck(item) {
  913. this._config.onUnCheck.call(item);
  914. } // Private
  915. ;
  916. _proto._init = function _init() {
  917. var that = this;
  918. $(Selector.DATA_TOGGLE).find('input:checkbox:checked').parents('li').toggleClass(ClassName.TODO_LIST_DONE);
  919. $(Selector.DATA_TOGGLE).on('change', 'input:checkbox', function (event) {
  920. that.toggle($(event.target));
  921. });
  922. } // Static
  923. ;
  924. TodoList._jQueryInterface = function _jQueryInterface(config) {
  925. return this.each(function () {
  926. var data = $(this).data(DATA_KEY);
  927. var _options = $.extend({}, Default, $(this).data());
  928. if (!data) {
  929. data = new TodoList($(this), _options);
  930. $(this).data(DATA_KEY, data);
  931. }
  932. if (config === 'init') {
  933. data[config]();
  934. }
  935. });
  936. };
  937. return TodoList;
  938. }();
  939. /**
  940. * Data API
  941. * ====================================================
  942. */
  943. $(window).on('load', function () {
  944. TodoList._jQueryInterface.call($(Selector.DATA_TOGGLE));
  945. });
  946. /**
  947. * jQuery API
  948. * ====================================================
  949. */
  950. $.fn[NAME] = TodoList._jQueryInterface;
  951. $.fn[NAME].Constructor = TodoList;
  952. $.fn[NAME].noConflict = function () {
  953. $.fn[NAME] = JQUERY_NO_CONFLICT;
  954. return TodoList._jQueryInterface;
  955. };
  956. return TodoList;
  957. }(jQuery);
  958. /**
  959. * --------------------------------------------
  960. * AdminLTE CardWidget.js
  961. * License MIT
  962. * --------------------------------------------
  963. */
  964. var CardWidget = function ($) {
  965. /**
  966. * Constants
  967. * ====================================================
  968. */
  969. var NAME = 'CardWidget';
  970. var DATA_KEY = 'lte.cardwidget';
  971. var EVENT_KEY = "." + DATA_KEY;
  972. var JQUERY_NO_CONFLICT = $.fn[NAME];
  973. var Event = {
  974. EXPANDED: "expanded" + EVENT_KEY,
  975. COLLAPSED: "collapsed" + EVENT_KEY,
  976. MAXIMIZED: "maximized" + EVENT_KEY,
  977. MINIMIZED: "minimized" + EVENT_KEY,
  978. REMOVED: "removed" + EVENT_KEY
  979. };
  980. var ClassName = {
  981. CARD: 'card',
  982. COLLAPSED: 'collapsed-card',
  983. COLLAPSING: 'collapsing-card',
  984. EXPANDING: 'expanding-card',
  985. WAS_COLLAPSED: 'was-collapsed',
  986. MAXIMIZED: 'maximized-card'
  987. };
  988. var Selector = {
  989. DATA_REMOVE: '[data-card-widget="remove"]',
  990. DATA_COLLAPSE: '[data-card-widget="collapse"]',
  991. DATA_MAXIMIZE: '[data-card-widget="maximize"]',
  992. CARD: "." + ClassName.CARD,
  993. CARD_HEADER: '.card-header',
  994. CARD_BODY: '.card-body',
  995. CARD_FOOTER: '.card-footer',
  996. COLLAPSED: "." + ClassName.COLLAPSED
  997. };
  998. var Default = {
  999. animationSpeed: 'normal',
  1000. collapseTrigger: Selector.DATA_COLLAPSE,
  1001. removeTrigger: Selector.DATA_REMOVE,
  1002. maximizeTrigger: Selector.DATA_MAXIMIZE,
  1003. collapseIcon: 'fa-minus',
  1004. expandIcon: 'fa-plus',
  1005. maximizeIcon: 'fa-expand',
  1006. minimizeIcon: 'fa-compress'
  1007. };
  1008. var CardWidget =
  1009. /*#__PURE__*/
  1010. function () {
  1011. function CardWidget(element, settings) {
  1012. this._element = element;
  1013. this._parent = element.parents(Selector.CARD).first();
  1014. if (element.hasClass(ClassName.CARD)) {
  1015. this._parent = element;
  1016. }
  1017. this._settings = $.extend({}, Default, settings);
  1018. }
  1019. var _proto = CardWidget.prototype;
  1020. _proto.collapse = function collapse() {
  1021. var _this = this;
  1022. this._parent.addClass(ClassName.COLLAPSING).children(Selector.CARD_BODY + ", " + Selector.CARD_FOOTER).slideUp(this._settings.animationSpeed, function () {
  1023. _this._parent.addClass(ClassName.COLLAPSED).removeClass(ClassName.COLLAPSING);
  1024. });
  1025. this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.collapseIcon).addClass(this._settings.expandIcon).removeClass(this._settings.collapseIcon);
  1026. var collapsed = $.Event(Event.COLLAPSED);
  1027. this._element.trigger(collapsed, this._parent);
  1028. };
  1029. _proto.expand = function expand() {
  1030. var _this2 = this;
  1031. this._parent.addClass(ClassName.EXPANDING).children(Selector.CARD_BODY + ", " + Selector.CARD_FOOTER).slideDown(this._settings.animationSpeed, function () {
  1032. _this2._parent.removeClass(ClassName.COLLAPSED).removeClass(ClassName.EXPANDING);
  1033. });
  1034. this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.expandIcon).addClass(this._settings.collapseIcon).removeClass(this._settings.expandIcon);
  1035. var expanded = $.Event(Event.EXPANDED);
  1036. this._element.trigger(expanded, this._parent);
  1037. };
  1038. _proto.remove = function remove() {
  1039. this._parent.slideUp();
  1040. var removed = $.Event(Event.REMOVED);
  1041. this._element.trigger(removed, this._parent);
  1042. };
  1043. _proto.toggle = function toggle() {
  1044. if (this._parent.hasClass(ClassName.COLLAPSED)) {
  1045. this.expand();
  1046. return;
  1047. }
  1048. this.collapse();
  1049. };
  1050. _proto.maximize = function maximize() {
  1051. this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.maximizeIcon).addClass(this._settings.minimizeIcon).removeClass(this._settings.maximizeIcon);
  1052. this._parent.css({
  1053. 'height': this._parent.height(),
  1054. 'width': this._parent.width(),
  1055. 'transition': 'all .15s'
  1056. }).delay(150).queue(function () {
  1057. $(this).addClass(ClassName.MAXIMIZED);
  1058. $('html').addClass(ClassName.MAXIMIZED);
  1059. if ($(this).hasClass(ClassName.COLLAPSED)) {
  1060. $(this).addClass(ClassName.WAS_COLLAPSED);
  1061. }
  1062. $(this).dequeue();
  1063. });
  1064. var maximized = $.Event(Event.MAXIMIZED);
  1065. this._element.trigger(maximized, this._parent);
  1066. };
  1067. _proto.minimize = function minimize() {
  1068. this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.minimizeIcon).addClass(this._settings.maximizeIcon).removeClass(this._settings.minimizeIcon);
  1069. this._parent.css('cssText', 'height:' + this._parent[0].style.height + ' !important;' + 'width:' + this._parent[0].style.width + ' !important; transition: all .15s;').delay(10).queue(function () {
  1070. $(this).removeClass(ClassName.MAXIMIZED);
  1071. $('html').removeClass(ClassName.MAXIMIZED);
  1072. $(this).css({
  1073. 'height': 'inherit',
  1074. 'width': 'inherit'
  1075. });
  1076. if ($(this).hasClass(ClassName.WAS_COLLAPSED)) {
  1077. $(this).removeClass(ClassName.WAS_COLLAPSED);
  1078. }
  1079. $(this).dequeue();
  1080. });
  1081. var MINIMIZED = $.Event(Event.MINIMIZED);
  1082. this._element.trigger(MINIMIZED, this._parent);
  1083. };
  1084. _proto.toggleMaximize = function toggleMaximize() {
  1085. if (this._parent.hasClass(ClassName.MAXIMIZED)) {
  1086. this.minimize();
  1087. return;
  1088. }
  1089. this.maximize();
  1090. } // Private
  1091. ;
  1092. _proto._init = function _init(card) {
  1093. var _this3 = this;
  1094. this._parent = card;
  1095. $(this).find(this._settings.collapseTrigger).click(function () {
  1096. _this3.toggle();
  1097. });
  1098. $(this).find(this._settings.maximizeTrigger).click(function () {
  1099. _this3.toggleMaximize();
  1100. });
  1101. $(this).find(this._settings.removeTrigger).click(function () {
  1102. _this3.remove();
  1103. });
  1104. } // Static
  1105. ;
  1106. CardWidget._jQueryInterface = function _jQueryInterface(config) {
  1107. var data = $(this).data(DATA_KEY);
  1108. var _options = $.extend({}, Default, $(this).data());
  1109. if (!data) {
  1110. data = new CardWidget($(this), _options);
  1111. $(this).data(DATA_KEY, typeof config === 'string' ? data : config);
  1112. }
  1113. if (typeof config === 'string' && config.match(/collapse|expand|remove|toggle|maximize|minimize|toggleMaximize/)) {
  1114. data[config]();
  1115. } else if (typeof config === 'object') {
  1116. data._init($(this));
  1117. }
  1118. };
  1119. return CardWidget;
  1120. }();
  1121. /**
  1122. * Data API
  1123. * ====================================================
  1124. */
  1125. $(document).on('click', Selector.DATA_COLLAPSE, function (event) {
  1126. if (event) {
  1127. event.preventDefault();
  1128. }
  1129. CardWidget._jQueryInterface.call($(this), 'toggle');
  1130. });
  1131. $(document).on('click', Selector.DATA_REMOVE, function (event) {
  1132. if (event) {
  1133. event.preventDefault();
  1134. }
  1135. CardWidget._jQueryInterface.call($(this), 'remove');
  1136. });
  1137. $(document).on('click', Selector.DATA_MAXIMIZE, function (event) {
  1138. if (event) {
  1139. event.preventDefault();
  1140. }
  1141. CardWidget._jQueryInterface.call($(this), 'toggleMaximize');
  1142. });
  1143. /**
  1144. * jQuery API
  1145. * ====================================================
  1146. */
  1147. $.fn[NAME] = CardWidget._jQueryInterface;
  1148. $.fn[NAME].Constructor = CardWidget;
  1149. $.fn[NAME].noConflict = function () {
  1150. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1151. return CardWidget._jQueryInterface;
  1152. };
  1153. return CardWidget;
  1154. }(jQuery);
  1155. /**
  1156. * --------------------------------------------
  1157. * AdminLTE CardRefresh.js
  1158. * License MIT
  1159. * --------------------------------------------
  1160. */
  1161. var CardRefresh = function ($) {
  1162. /**
  1163. * Constants
  1164. * ====================================================
  1165. */
  1166. var NAME = 'CardRefresh';
  1167. var DATA_KEY = 'lte.cardrefresh';
  1168. var EVENT_KEY = "." + DATA_KEY;
  1169. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1170. var Event = {
  1171. LOADED: "loaded" + EVENT_KEY,
  1172. OVERLAY_ADDED: "overlay.added" + EVENT_KEY,
  1173. OVERLAY_REMOVED: "overlay.removed" + EVENT_KEY
  1174. };
  1175. var ClassName = {
  1176. CARD: 'card'
  1177. };
  1178. var Selector = {
  1179. CARD: "." + ClassName.CARD,
  1180. DATA_REFRESH: '[data-card-widget="card-refresh"]'
  1181. };
  1182. var Default = {
  1183. source: '',
  1184. sourceSelector: '',
  1185. params: {},
  1186. trigger: Selector.DATA_REFRESH,
  1187. content: '.card-body',
  1188. loadInContent: true,
  1189. loadOnInit: true,
  1190. responseType: '',
  1191. overlayTemplate: '<div class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>',
  1192. onLoadStart: function onLoadStart() {},
  1193. onLoadDone: function onLoadDone(response) {
  1194. return response;
  1195. }
  1196. };
  1197. var CardRefresh =
  1198. /*#__PURE__*/
  1199. function () {
  1200. function CardRefresh(element, settings) {
  1201. this._element = element;
  1202. this._parent = element.parents(Selector.CARD).first();
  1203. this._settings = $.extend({}, Default, settings);
  1204. this._overlay = $(this._settings.overlayTemplate);
  1205. if (element.hasClass(ClassName.CARD)) {
  1206. this._parent = element;
  1207. }
  1208. if (this._settings.source === '') {
  1209. throw new Error('Source url was not defined. Please specify a url in your CardRefresh source option.');
  1210. }
  1211. }
  1212. var _proto = CardRefresh.prototype;
  1213. _proto.load = function load() {
  1214. this._addOverlay();
  1215. this._settings.onLoadStart.call($(this));
  1216. $.get(this._settings.source, this._settings.params, function (response) {
  1217. if (this._settings.loadInContent) {
  1218. if (this._settings.sourceSelector != '') {
  1219. response = $(response).find(this._settings.sourceSelector).html();
  1220. }
  1221. this._parent.find(this._settings.content).html(response);
  1222. }
  1223. this._settings.onLoadDone.call($(this), response);
  1224. this._removeOverlay();
  1225. }.bind(this), this._settings.responseType !== '' && this._settings.responseType);
  1226. var loadedEvent = $.Event(Event.LOADED);
  1227. $(this._element).trigger(loadedEvent);
  1228. };
  1229. _proto._addOverlay = function _addOverlay() {
  1230. this._parent.append(this._overlay);
  1231. var overlayAddedEvent = $.Event(Event.OVERLAY_ADDED);
  1232. $(this._element).trigger(overlayAddedEvent);
  1233. };
  1234. _proto._removeOverlay = function _removeOverlay() {
  1235. this._parent.find(this._overlay).remove();
  1236. var overlayRemovedEvent = $.Event(Event.OVERLAY_REMOVED);
  1237. $(this._element).trigger(overlayRemovedEvent);
  1238. };
  1239. // Private
  1240. _proto._init = function _init(card) {
  1241. var _this = this;
  1242. $(this).find(this._settings.trigger).on('click', function () {
  1243. _this.load();
  1244. });
  1245. if (this._settings.loadOnInit) {
  1246. this.load();
  1247. }
  1248. } // Static
  1249. ;
  1250. CardRefresh._jQueryInterface = function _jQueryInterface(config) {
  1251. var data = $(this).data(DATA_KEY);
  1252. var _options = $.extend({}, Default, $(this).data());
  1253. if (!data) {
  1254. data = new CardRefresh($(this), _options);
  1255. $(this).data(DATA_KEY, typeof config === 'string' ? data : config);
  1256. }
  1257. if (typeof config === 'string' && config.match(/load/)) {
  1258. data[config]();
  1259. } else {
  1260. data._init($(this));
  1261. }
  1262. };
  1263. return CardRefresh;
  1264. }();
  1265. /**
  1266. * Data API
  1267. * ====================================================
  1268. */
  1269. $(document).on('click', Selector.DATA_REFRESH, function (event) {
  1270. if (event) {
  1271. event.preventDefault();
  1272. }
  1273. CardRefresh._jQueryInterface.call($(this), 'load');
  1274. });
  1275. $(document).ready(function () {
  1276. $(Selector.DATA_REFRESH).each(function () {
  1277. CardRefresh._jQueryInterface.call($(this));
  1278. });
  1279. });
  1280. /**
  1281. * jQuery API
  1282. * ====================================================
  1283. */
  1284. $.fn[NAME] = CardRefresh._jQueryInterface;
  1285. $.fn[NAME].Constructor = CardRefresh;
  1286. $.fn[NAME].noConflict = function () {
  1287. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1288. return CardRefresh._jQueryInterface;
  1289. };
  1290. return CardRefresh;
  1291. }(jQuery);
  1292. /**
  1293. * --------------------------------------------
  1294. * AdminLTE Dropdown.js
  1295. * License MIT
  1296. * --------------------------------------------
  1297. */
  1298. var Dropdown = function ($) {
  1299. /**
  1300. * Constants
  1301. * ====================================================
  1302. */
  1303. var NAME = 'Dropdown';
  1304. var DATA_KEY = 'lte.dropdown';
  1305. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1306. var Selector = {
  1307. NAVBAR: '.navbar',
  1308. DROPDOWN_MENU: '.dropdown-menu',
  1309. DROPDOWN_MENU_ACTIVE: '.dropdown-menu.show',
  1310. DROPDOWN_TOGGLE: '[data-toggle="dropdown"]'
  1311. };
  1312. var ClassName = {
  1313. DROPDOWN_HOVER: 'dropdown-hover',
  1314. DROPDOWN_RIGHT: 'dropdown-menu-right'
  1315. };
  1316. var Default = {};
  1317. /**
  1318. * Class Definition
  1319. * ====================================================
  1320. */
  1321. var Dropdown =
  1322. /*#__PURE__*/
  1323. function () {
  1324. function Dropdown(element, config) {
  1325. this._config = config;
  1326. this._element = element;
  1327. } // Public
  1328. var _proto = Dropdown.prototype;
  1329. _proto.toggleSubmenu = function toggleSubmenu() {
  1330. this._element.siblings().show().toggleClass("show");
  1331. if (!this._element.next().hasClass('show')) {
  1332. this._element.parents('.dropdown-menu').first().find('.show').removeClass("show").hide();
  1333. }
  1334. this._element.parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) {
  1335. $('.dropdown-submenu .show').removeClass("show").hide();
  1336. });
  1337. };
  1338. _proto.fixPosition = function fixPosition() {
  1339. var elm = $(Selector.DROPDOWN_MENU_ACTIVE);
  1340. if (elm.length !== 0) {
  1341. if (elm.hasClass(ClassName.DROPDOWN_RIGHT)) {
  1342. elm.css('left', 'inherit');
  1343. elm.css('right', 0);
  1344. } else {
  1345. elm.css('left', 0);
  1346. elm.css('right', 'inherit');
  1347. }
  1348. var offset = elm.offset();
  1349. var width = elm.width();
  1350. var windowWidth = $(window).width();
  1351. var visiblePart = windowWidth - offset.left;
  1352. if (offset.left < 0) {
  1353. elm.css('left', 'inherit');
  1354. elm.css('right', offset.left - 5);
  1355. } else {
  1356. if (visiblePart < width) {
  1357. elm.css('left', 'inherit');
  1358. elm.css('right', 0);
  1359. }
  1360. }
  1361. }
  1362. } // Static
  1363. ;
  1364. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  1365. return this.each(function () {
  1366. var data = $(this).data(DATA_KEY);
  1367. var _config = $.extend({}, Default, $(this).data());
  1368. if (!data) {
  1369. data = new Dropdown($(this), _config);
  1370. $(this).data(DATA_KEY, data);
  1371. }
  1372. if (config === 'toggleSubmenu' || config == 'fixPosition') {
  1373. data[config]();
  1374. }
  1375. });
  1376. };
  1377. return Dropdown;
  1378. }();
  1379. /**
  1380. * Data API
  1381. * ====================================================
  1382. */
  1383. $(Selector.DROPDOWN_MENU + ' ' + Selector.DROPDOWN_TOGGLE).on("click", function (event) {
  1384. event.preventDefault();
  1385. event.stopPropagation();
  1386. Dropdown._jQueryInterface.call($(this), 'toggleSubmenu');
  1387. });
  1388. $(Selector.NAVBAR + ' ' + Selector.DROPDOWN_TOGGLE).on("click", function (event) {
  1389. event.preventDefault();
  1390. setTimeout(function () {
  1391. Dropdown._jQueryInterface.call($(this), 'fixPosition');
  1392. }, 1);
  1393. });
  1394. /**
  1395. * jQuery API
  1396. * ====================================================
  1397. */
  1398. $.fn[NAME] = Dropdown._jQueryInterface;
  1399. $.fn[NAME].Constructor = Dropdown;
  1400. $.fn[NAME].noConflict = function () {
  1401. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1402. return Dropdown._jQueryInterface;
  1403. };
  1404. return Dropdown;
  1405. }(jQuery);
  1406. /**
  1407. * --------------------------------------------
  1408. * AdminLTE Toasts.js
  1409. * License MIT
  1410. * --------------------------------------------
  1411. */
  1412. var Toasts = function ($) {
  1413. /**
  1414. * Constants
  1415. * ====================================================
  1416. */
  1417. var NAME = 'Toasts';
  1418. var DATA_KEY = 'lte.toasts';
  1419. var EVENT_KEY = "." + DATA_KEY;
  1420. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1421. var Event = {
  1422. INIT: "init" + EVENT_KEY,
  1423. CREATED: "created" + EVENT_KEY,
  1424. REMOVED: "removed" + EVENT_KEY
  1425. };
  1426. var Selector = {
  1427. BODY: 'toast-body',
  1428. CONTAINER_TOP_RIGHT: '#toastsContainerTopRight',
  1429. CONTAINER_TOP_LEFT: '#toastsContainerTopLeft',
  1430. CONTAINER_BOTTOM_RIGHT: '#toastsContainerBottomRight',
  1431. CONTAINER_BOTTOM_LEFT: '#toastsContainerBottomLeft'
  1432. };
  1433. var ClassName = {
  1434. TOP_RIGHT: 'toasts-top-right',
  1435. TOP_LEFT: 'toasts-top-left',
  1436. BOTTOM_RIGHT: 'toasts-bottom-right',
  1437. BOTTOM_LEFT: 'toasts-bottom-left',
  1438. FADE: 'fade'
  1439. };
  1440. var Position = {
  1441. TOP_RIGHT: 'topRight',
  1442. TOP_LEFT: 'topLeft',
  1443. BOTTOM_RIGHT: 'bottomRight',
  1444. BOTTOM_LEFT: 'bottomLeft'
  1445. };
  1446. var Default = {
  1447. position: Position.TOP_RIGHT,
  1448. fixed: true,
  1449. autohide: false,
  1450. autoremove: true,
  1451. delay: 1000,
  1452. fade: true,
  1453. icon: null,
  1454. image: null,
  1455. imageAlt: null,
  1456. imageHeight: '25px',
  1457. title: null,
  1458. subtitle: null,
  1459. close: true,
  1460. body: null,
  1461. class: null
  1462. };
  1463. /**
  1464. * Class Definition
  1465. * ====================================================
  1466. */
  1467. var Toasts =
  1468. /*#__PURE__*/
  1469. function () {
  1470. function Toasts(element, config) {
  1471. this._config = config;
  1472. this._prepareContainer();
  1473. var initEvent = $.Event(Event.INIT);
  1474. $('body').trigger(initEvent);
  1475. } // Public
  1476. var _proto = Toasts.prototype;
  1477. _proto.create = function create() {
  1478. var toast = $('<div class="toast" role="alert" aria-live="assertive" aria-atomic="true"/>');
  1479. toast.data('autohide', this._config.autohide);
  1480. toast.data('animation', this._config.fade);
  1481. if (this._config.class) {
  1482. toast.addClass(this._config.class);
  1483. }
  1484. if (this._config.delay && this._config.delay != 500) {
  1485. toast.data('delay', this._config.delay);
  1486. }
  1487. var toast_header = $('<div class="toast-header">');
  1488. if (this._config.image != null) {
  1489. var toast_image = $('<img />').addClass('rounded mr-2').attr('src', this._config.image).attr('alt', this._config.imageAlt);
  1490. if (this._config.imageHeight != null) {
  1491. toast_image.height(this._config.imageHeight).width('auto');
  1492. }
  1493. toast_header.append(toast_image);
  1494. }
  1495. if (this._config.icon != null) {
  1496. toast_header.append($('<i />').addClass('mr-2').addClass(this._config.icon));
  1497. }
  1498. if (this._config.title != null) {
  1499. toast_header.append($('<strong />').addClass('mr-auto').html(this._config.title));
  1500. }
  1501. if (this._config.subtitle != null) {
  1502. toast_header.append($('<small />').html(this._config.subtitle));
  1503. }
  1504. if (this._config.close == true) {
  1505. var toast_close = $('<button data-dismiss="toast" />').attr('type', 'button').addClass('ml-2 mb-1 close').attr('aria-label', 'Close').append('<span aria-hidden="true">&times;</span>');
  1506. if (this._config.title == null) {
  1507. toast_close.toggleClass('ml-2 ml-auto');
  1508. }
  1509. toast_header.append(toast_close);
  1510. }
  1511. toast.append(toast_header);
  1512. if (this._config.body != null) {
  1513. toast.append($('<div class="toast-body" />').html(this._config.body));
  1514. }
  1515. $(this._getContainerId()).prepend(toast);
  1516. var createdEvent = $.Event(Event.CREATED);
  1517. $('body').trigger(createdEvent);
  1518. toast.toast('show');
  1519. if (this._config.autoremove) {
  1520. toast.on('hidden.bs.toast', function () {
  1521. $(this).delay(200).remove();
  1522. var removedEvent = $.Event(Event.REMOVED);
  1523. $('body').trigger(removedEvent);
  1524. });
  1525. }
  1526. } // Static
  1527. ;
  1528. _proto._getContainerId = function _getContainerId() {
  1529. if (this._config.position == Position.TOP_RIGHT) {
  1530. return Selector.CONTAINER_TOP_RIGHT;
  1531. } else if (this._config.position == Position.TOP_LEFT) {
  1532. return Selector.CONTAINER_TOP_LEFT;
  1533. } else if (this._config.position == Position.BOTTOM_RIGHT) {
  1534. return Selector.CONTAINER_BOTTOM_RIGHT;
  1535. } else if (this._config.position == Position.BOTTOM_LEFT) {
  1536. return Selector.CONTAINER_BOTTOM_LEFT;
  1537. }
  1538. };
  1539. _proto._prepareContainer = function _prepareContainer() {
  1540. if ($(this._getContainerId()).length === 0) {
  1541. var container = $('<div />').attr('id', this._getContainerId().replace('#', ''));
  1542. if (this._config.position == Position.TOP_RIGHT) {
  1543. container.addClass(ClassName.TOP_RIGHT);
  1544. } else if (this._config.position == Position.TOP_LEFT) {
  1545. container.addClass(ClassName.TOP_LEFT);
  1546. } else if (this._config.position == Position.BOTTOM_RIGHT) {
  1547. container.addClass(ClassName.BOTTOM_RIGHT);
  1548. } else if (this._config.position == Position.BOTTOM_LEFT) {
  1549. container.addClass(ClassName.BOTTOM_LEFT);
  1550. }
  1551. $('body').append(container);
  1552. }
  1553. if (this._config.fixed) {
  1554. $(this._getContainerId()).addClass('fixed');
  1555. } else {
  1556. $(this._getContainerId()).removeClass('fixed');
  1557. }
  1558. } // Static
  1559. ;
  1560. Toasts._jQueryInterface = function _jQueryInterface(option, config) {
  1561. return this.each(function () {
  1562. var _options = $.extend({}, Default, config);
  1563. var toast = new Toasts($(this), _options);
  1564. if (option === 'create') {
  1565. toast[option]();
  1566. }
  1567. });
  1568. };
  1569. return Toasts;
  1570. }();
  1571. /**
  1572. * jQuery API
  1573. * ====================================================
  1574. */
  1575. $.fn[NAME] = Toasts._jQueryInterface;
  1576. $.fn[NAME].Constructor = Toasts;
  1577. $.fn[NAME].noConflict = function () {
  1578. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1579. return Toasts._jQueryInterface;
  1580. };
  1581. return Toasts;
  1582. }(jQuery);
  1583. exports.CardRefresh = CardRefresh;
  1584. exports.CardWidget = CardWidget;
  1585. exports.ControlSidebar = ControlSidebar;
  1586. exports.DirectChat = DirectChat;
  1587. exports.Dropdown = Dropdown;
  1588. exports.Layout = Layout;
  1589. exports.PushMenu = PushMenu;
  1590. exports.Toasts = Toasts;
  1591. exports.TodoList = TodoList;
  1592. exports.Treeview = Treeview;
  1593. Object.defineProperty(exports, '__esModule', { value: true });
  1594. })));
  1595. //# sourceMappingURL=adminlte.js.map