1/*! 2 * AdminLTE v4.0.0-beta3 (https://adminlte.io) 3 * Copyright 2014-2024 Colorlib <https://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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.adminlte = {})); 10})(this, (function (exports) { 'use strict'; 11 12 const domContentLoadedCallbacks = []; 13 const onDOMContentLoaded = (callback) => { 14 if (document.readyState === 'loading') { 15 // add listener on the first call when the document is in loading state 16 if (!domContentLoadedCallbacks.length) { 17 document.addEventListener('DOMContentLoaded', () => { 18 for (const callback of domContentLoadedCallbacks) { 19 callback(); 20 } 21 }); 22 } 23 domContentLoadedCallbacks.push(callback); 24 } 25 else { 26 callback(); 27 } 28 }; 29 /* SLIDE UP */ 30 const slideUp = (target, duration = 500) => { 31 target.style.transitionProperty = 'height, margin, padding'; 32 target.style.transitionDuration = `${duration}ms`; 33 target.style.boxSizing = 'border-box'; 34 target.style.height = `${target.offsetHeight}px`; 35 target.style.overflow = 'hidden'; 36 window.setTimeout(() => { 37 target.style.height = '0'; 38 target.style.paddingTop = '0'; 39 target.style.paddingBottom = '0'; 40 target.style.marginTop = '0'; 41 target.style.marginBottom = '0'; 42 }, 1); 43 window.setTimeout(() => { 44 target.style.display = 'none'; 45 target.style.removeProperty('height'); 46 target.style.removeProperty('padding-top'); 47 target.style.removeProperty('padding-bottom'); 48 target.style.removeProperty('margin-top'); 49 target.style.removeProperty('margin-bottom'); 50 target.style.removeProperty('overflow'); 51 target.style.removeProperty('transition-duration'); 52 target.style.removeProperty('transition-property'); 53 }, duration); 54 }; 55 /* SLIDE DOWN */ 56 const slideDown = (target, duration = 500) => { 57 target.style.removeProperty('display'); 58 let { display } = window.getComputedStyle(target); 59 if (display === 'none') { 60 display = 'block'; 61 } 62 target.style.display = display; 63 const height = target.offsetHeight; 64 target.style.overflow = 'hidden'; 65 target.style.height = '0'; 66 target.style.paddingTop = '0'; 67 target.style.paddingBottom = '0'; 68 target.style.marginTop = '0'; 69 target.style.marginBottom = '0'; 70 window.setTimeout(() => { 71 target.style.boxSizing = 'border-box'; 72 target.style.transitionProperty = 'height, margin, padding'; 73 target.style.transitionDuration = `${duration}ms`; 74 target.style.height = `${height}px`; 75 target.style.removeProperty('padding-top'); 76 target.style.removeProperty('padding-bottom'); 77 target.style.removeProperty('margin-top'); 78 target.style.removeProperty('margin-bottom'); 79 }, 1); 80 window.setTimeout(() => { 81 target.style.removeProperty('height'); 82 target.style.removeProperty('overflow'); 83 target.style.removeProperty('transition-duration'); 84 target.style.removeProperty('transition-property'); 85 }, duration); 86 }; 87 88 /** 89 * -------------------------------------------- 90 * @file AdminLTE layout.ts 91 * @description Layout for AdminLTE. 92 * @license MIT 93 * -------------------------------------------- 94 */ 95 /** 96 * ------------------------------------------------------------------------ 97 * Constants 98 * ------------------------------------------------------------------------ 99 */ 100 const CLASS_NAME_HOLD_TRANSITIONS = 'hold-transition'; 101 const CLASS_NAME_APP_LOADED = 'app-loaded'; 102 /** 103 * Class Definition 104 * ==================================================== 105 */ 106 class Layout { 107 constructor(element) { 108 this._element = element; 109 } 110 holdTransition() { 111 let resizeTimer; 112 window.addEventListener('resize', () => { 113 document.body.classList.add(CLASS_NAME_HOLD_TRANSITIONS); 114 clearTimeout(resizeTimer); 115 resizeTimer = setTimeout(() => { 116 document.body.classList.remove(CLASS_NAME_HOLD_TRANSITIONS); 117 }, 400); 118 }); 119 } 120 } 121 onDOMContentLoaded(() => {
122 const data = new Layout(document.body); 123 data.holdTransition(); 124 setTimeout(() => { 125 document.body.classList.add(CLASS_NAME_APP_LOADED); 126 }, 400); 127 }); 128 129 /** 130 * -------------------------------------------- 131 * @file AdminLTE push-menu.ts 132 * @description Push menu for AdminLTE. 133 * @license MIT 134 * -------------------------------------------- 135 */ 136 /** 137 * ------------------------------------------------------------------------ 138 * Constants 139 * ------------------------------------------------------------------------ 140 */ 141 const DATA_KEY$4 = 'lte.push-menu'; 142 const EVENT_KEY$4 = `.${DATA_KEY$4}`; 143 const EVENT_OPEN = `open${EVENT_KEY$4}`; 144 const EVENT_COLLAPSE = `collapse${EVENT_KEY$4}`; 145 const CLASS_NAME_SIDEBAR_MINI = 'sidebar-mini'; 146 const CLASS_NAME_SIDEBAR_COLLAPSE = 'sidebar-collapse'; 147 const CLASS_NAME_SIDEBAR_OPEN = 'sidebar-open'; 148 const CLASS_NAME_SIDEBAR_EXPAND = 'sidebar-expand'; 149 const CLASS_NAME_SIDEBAR_OVERLAY = 'sidebar-overlay'; 150 const CLASS_NAME_MENU_OPEN$1 = 'menu-open'; 151 const SELECTOR_APP_SIDEBAR = '.app-sidebar'; 152 const SELECTOR_SIDEBAR_MENU = '.sidebar-menu'; 153 const SELECTOR_NAV_ITEM$1 = '.nav-item'; 154 const SELECTOR_NAV_TREEVIEW = '.nav-treeview'; 155 const SELECTOR_APP_WRAPPER = '.app-wrapper'; 156 const SELECTOR_SIDEBAR_EXPAND = `[class*="${CLASS_NAME_SIDEBAR_EXPAND}"]`; 157 const SELECTOR_SIDEBAR_TOGGLE = '[data-lte-toggle="sidebar"]'; 158 const Defaults = { 159 sidebarBreakpoint: 992 160 }; 161 /** 162 * Class Definition 163 * ==================================================== 164 */ 165 class PushMenu { 166 constructor(element, config) { 167 this._element = element; 168 this._config = Object.assign(Object.assign({}, Defaults), config); 169 } 170 // TODO 171 menusClose() { 172 const navTreeview = document.querySelectorAll(SELECTOR_NAV_TREEVIEW); 173 navTreeview.forEach(navTree => { 174 navTree.style.removeProperty('display'); 175 navTree.style.removeProperty('height'); 176 }); 177 const navSidebar = document.querySelector(SELECTOR_SIDEBAR_MENU); 178 const navItem = navSidebar === null || navSidebar === void 0 ? void 0 : navSidebar.querySelectorAll(SELECTOR_NAV_ITEM$1); 179 if (navItem) { 180 navItem.forEach(navI => { 181 navI.classList.remove(CLASS_NAME_MENU_OPEN$1); 182 }); 183 } 184 } 185 expand() { 186 const event = new Event(EVENT_OPEN); 187 document.body.classList.remove(CLASS_NAME_SIDEBAR_COLLAPSE); 188 document.body.classList.add(CLASS_NAME_SIDEBAR_OPEN); 189 this._element.dispatchEvent(event); 190 } 191 collapse() { 192 const event = new Event(EVENT_COLLAPSE); 193 document.body.classList.remove(CLASS_NAME_SIDEBAR_OPEN); 194 document.body.classList.add(CLASS_NAME_SIDEBAR_COLLAPSE); 195 this._element.dispatchEvent(event); 196 } 197 addSidebarBreakPoint() { 198 var _a, _b, _c; 199 const sidebarExpandList = (_b = (_a = document.querySelector(SELECTOR_SIDEBAR_EXPAND)) === null || _a === void 0 ? void 0 : _a.classList) !== null && _b !== void 0 ? _b : []; 200 const sidebarExpand = (_c = Array.from(sidebarExpandList).find(className => className.startsWith(CLASS_NAME_SIDEBAR_EXPAND))) !== null && _c !== void 0 ? _c : ''; 201 const sidebar = document.getElementsByClassName(sidebarExpand)[0]; 202 const sidebarContent = window.getComputedStyle(sidebar, '::before').getPropertyValue('content'); 203 this._config = Object.assign(Object.assign({}, this._config), { sidebarBreakpoint: Number(sidebarContent.replace(/[^\d.-]/g, '')) }); 204 if (window.innerWidth <= this._config.sidebarBreakpoint) { 205 this.collapse(); 206 } 207 else { 208 if (!document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI)) { 209 this.expand(); 210 } 211 if (document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI) && document.body.classList.contains(CLASS_NAME_SIDEBAR_COLLAPSE)) { 212 this.collapse(); 213 } 214 } 215 } 216 toggle() { 217 if (document.body.classList.contains(CLASS_NAME_SIDEBAR_COLLAPSE)) { 218 this.expand(); 219 } 220 else { 221 this.collapse(); 222 } 223 } 224 init() { 225 this.addSidebarBreakPoint(); 226 } 227 } 228 /** 229 * ------------------------------------------------------------------------ 230 * Data Api implementation 231 * ------------------------------------------------------------------------ 232 */ 233 onDOMContentLoaded(() => { 234 var _a; 235 const sidebar = document === null || document === void 0 ? void 0 : document.querySelector(SELECTOR_APP_SIDEBAR); 236 if (sidebar) { 237 const data = new PushMenu(sidebar, Defaults); 238 data.init(); 239 window.addEventListener('resize', () => { 240 data.init(); 241 }); 242 } 243 const sidebarOverlay = document.createElement('div'); 244 sidebarOverlay.className = CLASS_NAME_SIDEBAR_OVERLAY; 245 (_a = document.querySelector(SELECTOR_APP_WRAPPER)) === null || _a === void 0 ? void 0 : _a.append(sidebarOverlay); 246 sidebarOverlay.addEventListener('touchstart', event => { 247 event.preventDefault(); 248 const target = event.currentTarget; 249 const data = new PushMenu(target, Defaults); 250 data.collapse(); 251 }, { passive: true }); 252 sidebarOverlay.addEventListener('click', event => { 253 event.preventDefault(); 254 const target = event.currentTarget; 255 const data = new PushMenu(target, Defaults); 256 data.collapse(); 257 }); 258 const fullBtn = document.querySelectorAll(SELECTOR_SIDEBAR_TOGGLE);
259 fullBtn.forEach(btn => { 260 btn.addEventListener('click', event => { 261 event.preventDefault(); 262 let button = event.currentTarget; 263 if ((button === null || button === void 0 ? void 0 : button.dataset.lteToggle) !== 'sidebar') { 264 button = button === null || button === void 0 ? void 0 : button.closest(SELECTOR_SIDEBAR_TOGGLE); 265 } 266 if (button) { 267 event === null || event === void 0 ? void 0 : event.preventDefault(); 268 const data = new PushMenu(button, Defaults); 269 data.toggle(); 270 } 271 }); 272 }); 273 }); 274 275 /** 276 * -------------------------------------------- 277 * @file AdminLTE treeview.ts 278 * @description Treeview plugin for AdminLTE. 279 * @license MIT 280 * -------------------------------------------- 281 */ 282 /** 283 * ------------------------------------------------------------------------ 284 * Constants 285 * ------------------------------------------------------------------------ 286 */ 287 // const NAME = 'Treeview' 288 const DATA_KEY$3 = 'lte.treeview'; 289 const EVENT_KEY$3 = `.${DATA_KEY$3}`; 290 const EVENT_EXPANDED$2 = `expanded${EVENT_KEY$3}`; 291 const EVENT_COLLAPSED$2 = `collapsed${EVENT_KEY$3}`; 292 // const EVENT_LOAD_DATA_API = `load${EVENT_KEY}` 293 const CLASS_NAME_MENU_OPEN = 'menu-open'; 294 const SELECTOR_NAV_ITEM = '.nav-item'; 295 const SELECTOR_NAV_LINK = '.nav-link'; 296 const SELECTOR_TREEVIEW_MENU = '.nav-treeview'; 297 const SELECTOR_DATA_TOGGLE$1 = '[data-lte-toggle="treeview"]'; 298 const Default$1 = { 299 animationSpeed: 300, 300 accordion: true 301 }; 302 /** 303 * Class Definition 304 * ==================================================== 305 */ 306 class Treeview { 307 constructor(element, config) { 308 this._element = element; 309 this._config = Object.assign(Object.assign({}, Default$1), config); 310 } 311 open() { 312 var _a, _b; 313 const event = new Event(EVENT_EXPANDED$2); 314 if (this._config.accordion) { 315 const openMenuList = (_a = this._element.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${SELECTOR_NAV_ITEM}.${CLASS_NAME_MENU_OPEN}`); 316 openMenuList === null || openMenuList === void 0 ? void 0 : openMenuList.forEach(openMenu => { 317 if (openMenu !== this._element.parentElement) { 318 openMenu.classList.remove(CLASS_NAME_MENU_OPEN); 319 const childElement = openMenu === null || openMenu === void 0 ? void 0 : openMenu.querySelector(SELECTOR_TREEVIEW_MENU); 320 if (childElement) { 321 slideUp(childElement, this._config.animationSpeed); 322 } 323 } 324 }); 325 } 326 this._element.classList.add(CLASS_NAME_MENU_OPEN); 327 const childElement = (_b = this._element) === null || _b === void 0 ? void 0 : _b.querySelector(SELECTOR_TREEVIEW_MENU); 328 if (childElement) { 329 slideDown(childElement, this._config.animationSpeed); 330 } 331 this._element.dispatchEvent(event); 332 } 333 close() { 334 var _a; 335 const event = new Event(EVENT_COLLAPSED$2); 336 this._element.classList.remove(CLASS_NAME_MENU_OPEN); 337 const childElement = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector(SELECTOR_TREEVIEW_MENU); 338 if (childElement) { 339 slideUp(childElement, this._config.animationSpeed); 340 } 341 this._element.dispatchEvent(event); 342 } 343 toggle() { 344 if (this._element.classList.contains(CLASS_NAME_MENU_OPEN)) { 345 this.close(); 346 } 347 else { 348 this.open(); 349 } 350 } 351 } 352 /** 353 * ------------------------------------------------------------------------ 354 * Data Api implementation 355 * ------------------------------------------------------------------------ 356 */ 357 onDOMContentLoaded(() => { 358 const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE$1); 359 button.forEach(btn => { 360 btn.addEventListener('click', event => { 361 const target = event.target; 362 const targetItem = target.closest(SELECTOR_NAV_ITEM
362); 363 const targetLink = target.closest(SELECTOR_NAV_LINK); 364 if ((target === null || target === void 0 ? void 0 : target.getAttribute('href')) === '#' || (targetLink === null || targetLink === void 0 ? void 0 : targetLink.getAttribute('href')) === '#') { 365 event.preventDefault(); 366 } 367 if (targetItem) { 368 const data = new Treeview(targetItem, Default$1); 369 data.toggle(); 370 } 371 }); 372 }); 373 }); 374 375 /** 376 * -------------------------------------------- 377 * @file AdminLTE direct-chat.ts 378 * @description Direct chat for AdminLTE. 379 * @license MIT 380 * -------------------------------------------- 381 */ 382 /** 383 * Constants 384 * ==================================================== 385 */ 386 const DATA_KEY$2 = 'lte.direct-chat'; 387 const EVENT_KEY$2 = `.${DATA_KEY$2}`; 388 const EVENT_EXPANDED$1 = `expanded${EVENT_KEY$2}`; 389 const EVENT_COLLAPSED$1 = `collapsed${EVENT_KEY$2}`; 390 const SELECTOR_DATA_TOGGLE = '[data-lte-toggle="chat-pane"]'; 391 const SELECTOR_DIRECT_CHAT = '.direct-chat'; 392 const CLASS_NAME_DIRECT_CHAT_OPEN = 'direct-chat-contacts-open'; 393 /** 394 * Class Definition 395 * ==================================================== 396 */ 397 class DirectChat { 398 constructor(element) { 399 this._element = element; 400 } 401 toggle() { 402 if (this._element.classList.contains(CLASS_NAME_DIRECT_CHAT_OPEN)) { 403 const event = new Event(EVENT_COLLAPSED$1); 404 this._element.classList.remove(CLASS_NAME_DIRECT_CHAT_OPEN); 405 this._element.dispatchEvent(event); 406 } 407 else { 408 const event = new Event(EVENT_EXPANDED$1); 409 this._element.classList.add(CLASS_NAME_DIRECT_CHAT_OPEN); 410 this._element.dispatchEvent(event); 411 } 412 } 413 } 414 /** 415 * 416 * Data Api implementation 417 * ==================================================== 418 */ 419 onDOMContentLoaded(() => { 420 const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE); 421 button.forEach(btn => { 422 btn.addEventListener('click', event => { 423 event.preventDefault(); 424 const target = event.target; 425 const chatPane = target.closest(SELECTOR_DIRECT_CHAT); 426 if (chatPane) { 427 const data = new DirectChat(chatPane); 428 data.toggle(); 429 } 430 }); 431 }); 432 }); 433 434 /** 435 * -------------------------------------------- 436 * @file AdminLTE card-widget.ts 437 * @description Card widget for AdminLTE. 438 * @license MIT 439 * -------------------------------------------- 440 */ 441 /** 442 * Constants 443 * ==================================================== 444 */ 445 const DATA_KEY$1 = 'lte.card-widget'; 446 const EVENT_KEY$1 = `.${DATA_KEY$1}`; 447 const EVENT_COLLAPSED = `collapsed${EVENT_KEY$1}`; 448 const EVENT_EXPANDED = `expanded${EVENT_KEY$1}`; 449 const EVENT_REMOVE = `remove${EVENT_KEY$1}`; 450 const EVENT_MAXIMIZED$1 = `maximized${EVENT_KEY$1}`; 451 const EVENT_MINIMIZED$1 = `minimized${EVENT_KEY$1}`; 452 const CLASS_NAME_CARD = 'card'; 453 const CLASS_NAME_COLLAPSED = 'collapsed-card'; 454 const CLASS_NAME_COLLAPSING = 'collapsing-card'; 455 const CLASS_NAME_EXPANDING = 'expanding-card'; 456 const CLASS_NAME_WAS_COLLAPSED = 'was-collapsed'; 457 const CLASS_NAME_MAXIMIZED = 'maximized-card'; 458 const SELECTOR_DATA_REMOVE = '[data-lte-toggle="card-remove"]'; 459 const SELECTOR_DATA_COLLAPSE = '[data-lte-toggle="card-collapse"]'; 460 const SELECTOR_DATA_MAXIMIZE = '[data-lte-toggle="card-maximize"]'; 461 const SELECTOR_CARD = `.${CLASS_NAME_CARD}`; 462 const SELECTOR_CARD_BODY = '.card-body'; 463 const SELECTOR_CARD_FOOTER = '.card-footer'; 464 const Default = { 465 animationSpeed: 500, 466 collapseTrigger: SELECTOR_DATA_COLLAPSE, 467 removeTrigger: SELECTOR_DATA_REMOVE, 468 maximizeTrigger: SELECTOR_DATA_MAXIMIZE 469 }; 470 class CardWidget { 471 constructor(element, config) { 472 this._element = element; 473 this._parent = element.closest(SELECTOR_CARD); 474 if (element.classList.contains(CLASS_NAME_CARD)) { 475 this._parent = element; 476 } 477 this._config = Object.assign(Object.assign({}, Default), config); 478 } 479 collapse() { 480 var _a, _b; 481 const event = new Event(EVENT_COLLAPSED); 482 if (this._parent) { 483 this._parent.classList.add(CLASS_NAME_COLLAPSING); 484 const elm = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`); 485 elm.forEach(el => { 486 if (el instanceof HTMLElement) { 487 slideUp(el, this._config.animationSpeed); 488 } 489 }); 490 setTimeout(() => { 491 if (this._parent) { 492 this._parent.classList.add(CLASS_NAME_COLLAPSED); 493 this._parent.classList.remove(CLASS_NAME_COLLAPSING); 494 } 495 }, this._config.animationSpeed); 496 } 497 (_b = this._element) === null || _b === void 0 ? void 0 : _b.dis
497patchEvent(event); 498 } 499 expand() { 500 var _a, _b; 501 const event = new Event(EVENT_EXPANDED); 502 if (this._parent) { 503 this._parent.classList.add(CLASS_NAME_EXPANDING); 504 const elm = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`); 505 elm.forEach(el => { 506 if (el instanceof HTMLElement) { 507 slideDown(el, this._config.animationSpeed); 508 } 509 }); 510 setTimeout(() => { 511 if (this._parent) { 512 this._parent.classList.remove(CLASS_NAME_COLLAPSED); 513 this._parent.classList.remove(CLASS_NAME_EXPANDING); 514 } 515 }, this._config.animationSpeed); 516 } 517 (_b = this._element) === null || _b === void 0 ? void 0 : _b.dispatchEvent(event); 518 } 519 remove() { 520 var _a; 521 const event = new Event(EVENT_REMOVE); 522 if (this._parent) { 523 slideUp(this._parent, this._config.animationSpeed); 524 } 525 (_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event); 526 } 527 toggle() { 528 var _a; 529 if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_COLLAPSED)) { 530 this.expand(); 531 return; 532 } 533 this.collapse(); 534 } 535 maximize() { 536 var _a; 537 const event = new Event(EVENT_MAXIMIZED$1); 538 if (this._parent) { 539 this._parent.style.height = `${this._parent.offsetHeight}px`; 540 this._parent.style.width = `${this._parent.offsetWidth}px`; 541 this._parent.style.transition = 'all .15s'; 542 setTimeout(() => { 543 const htmlTag = document.querySelector('html'); 544 if (htmlTag) { 545 htmlTag.classList.add(CLASS_NAME_MAXIMIZED); 546 } 547 if (this._parent) { 548 this._parent.classList.add(CLASS_NAME_MAXIMIZED); 549 if (this._parent.classList.contains(CLASS_NAME_COLLAPSED)) { 550 this._parent.classList.add(CLASS_NAME_WAS_COLLAPSED); 551 } 552 } 553 }, 150); 554 } 555 (_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event); 556 } 557 minimize() { 558 var _a; 559 const event = new Event(EVENT_MINIMIZED$1); 560 if (this._parent) { 561 this._parent.style.height = 'auto'; 562 this._parent.style.width = 'auto'; 563 this._parent.style.transition = 'all .15s'; 564 setTimeout(() => { 565 var _a; 566 const htmlTag = document.querySelector('html'); 567 if (htmlTag) { 568 htmlTag.classList.remove(CLASS_NAME_MAXIMIZED); 569 } 570 if (this._parent) { 571 this._parent.classList.remove(CLASS_NAME_MAXIMIZED); 572 if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_WAS_COLLAPSED)) { 573 this._parent.classList.remove(CLASS_NAME_WAS_COLLAPSED); 574 } 575 } 576 }, 10); 577 } 578 (_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event); 579 } 580 toggleMaximize() { 581 var _a; 582 if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_MAXIMIZED)) { 583 this.minimize(); 584 return; 585 } 586 this.maximize(); 587 } 588 } 589 /** 590 * 591 * Data Api implementation 592 * ==================================================== 593 */ 594 onDOMContentLoaded(() => { 595 const collapseBtn = document.querySelectorAll(SELECTOR_DATA_COLLAPSE);
596 collapseBtn.forEach(btn => { 597 btn.addEventListener('click', event => { 598 event.preventDefault(); 599 const target = event.target; 600 const data = new CardWidget(target, Default); 601 data.toggle(); 602 }); 603 }); 604 const removeBtn = document.querySelectorAll(SELECTOR_DATA_REMOVE); 605 removeBtn.forEach(btn => { 606 btn.addEventListener('click', event => { 607 event.preventDefault(); 608 const target = event.target; 609 const data = new CardWidget(target, Default); 610 data.remove(); 611 }); 612 }); 613 const maxBtn = document.querySelectorAll(SELECTOR_DATA_MAXIMIZE); 614 maxBtn.forEach(btn => { 615 btn.addEventListener('click', event => { 616 event.preventDefault(); 617 const target = event.target; 618 const data = new CardWidget(target, Default); 619 data.toggleMaximize(); 620 }); 621 }); 622 }); 623 624 /** 625 * -------------------------------------------- 626 * @file AdminLTE fullscreen.ts 627 * @description Fullscreen plugin for AdminLTE. 628 * @license MIT 629 * -------------------------------------------- 630 */ 631 /** 632 * Constants 633 * ============================================================================ 634 */ 635 const DATA_KEY = 'lte.fullscreen'; 636 const EVENT_KEY = `.${DATA_KEY}`; 637 const EVENT_MAXIMIZED = `maximized${EVENT_KEY}`; 638 const EVENT_MINIMIZED = `minimized${EVENT_KEY}`; 639 const SELECTOR_FULLSCREEN_TOGGLE = '[data-lte-toggle="fullscreen"]'; 640 const SELECTOR_MAXIMIZE_ICON = '[data-lte-icon="maximize"]'; 641 const SELECTOR_MINIMIZE_ICON = '[data-lte-icon="minimize"]'; 642 /** 643 * Class Definition. 644 * ============================================================================ 645 */ 646 class FullScreen { 647 constructor(element, config) { 648 this._element = element; 649 this._config = config; 650 } 651 inFullScreen() { 652 const event = new Event(EVENT_MAXIMIZED); 653 const iconMaximize = document.querySelector(SELECTOR_MAXIMIZE_ICON); 654 const iconMinimize = document.querySelector(SELECTOR_MINIMIZE_ICON); 655 void document.documentElement.requestFullscreen(); 656 if (iconMaximize) { 657 iconMaximize.style.display = 'none'; 658 } 659 if (iconMinimize) { 660 iconMinimize.style.display = 'block'; 661 } 662 this._element.dispatchEvent(event); 663 } 664 outFullscreen() { 665 const event = new Event(EVENT_MINIMIZED); 666 const iconMaximize = document.querySelector(SELECTOR_MAXIMIZE_ICON); 667 const iconMinimize = document.querySelector(SELECTOR_MINIMIZE_ICON); 668 void document.exitFullscreen(); 669 if (iconMaximize) { 670 iconMaximize.style.display = 'block'; 671 } 672 if (iconMinimize) { 673 iconMinimize.style.display = 'none'; 674 } 675 this._element.dispatchEvent(event); 676 } 677 toggleFullScreen() { 678 if (document.fullscreenEnabled) { 679 if (document.fullscreenElement) { 680 this.outFullscreen(); 681 } 682 else { 683 this.inFullScreen(); 684 } 685 } 686 } 687 } 688 /** 689 * Data Api implementation 690 * ============================================================================ 691 */ 692 onDOMContentLoaded(() => { 693 const buttons = document.querySelectorAll(SELECTOR_FULLSCREEN_TOGGLE); 694 buttons.forEach(btn => { 695 btn.addEventListener('click', event => { 696 event.preventDefault(); 697 const target = event.target; 698 const button = target.closest(SELECTOR_FULLSCREEN_TOGGLE); 699 if (button) { 700 const data = new FullScreen(button, undefined); 701 data.toggleFullScreen(); 702 } 703 }); 704 }); 705 }); 706 707 exports.CardWidget = CardWidget; 708 exports.DirectChat = DirectChat; 709 exports.FullScreen = FullScreen; 710 exports.Layout = Layout; 711 exports.PushMenu = PushMenu; 712 exports.Treeview = Treeview; 713 714})); 715//# sourceMappingURL=adminlte.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.