adminlte.js 56 KB

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