adminlte.js 56 KB

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