adminlte.js 52 KB

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