You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1790 lines
52 KiB

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