adminlte.js 57 KB

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