adminlte.js 52 KB

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