adminlte.js 56 KB

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