adminlte.js 53 KB

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