adminlte.js 53 KB

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