adminlte.js 56 KB

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