adminlte.js 55 KB

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