adminlte.js 51 KB

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