mirror of https://github.com/ColorlibHQ/AdminLTE
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.
1 line
26 KiB
1 line
26 KiB
{"version":3,"sources":["../../build/js/ControlSidebar.js","../../build/js/Layout.js","../../build/js/PushMenu.js","../../build/js/Treeview.js","../../build/js/Widget.js"],"names":["$","NAME","DATA_KEY","JQUERY_NO_CONFLICT","Selector","ClassName","Default","ControlSidebar","Layout","EVENT_KEY","Event","PushMenu","Treeview","Widget","jQuery","fn","element","config","_element","_config","this","_getConfig","show","slide","removeClass","collapse","addClass","toggle","_setMargin","hasClass","extend","css","outerHeight","_jQueryInterface","operation","each","data","Error","document","on","event","preventDefault","call","Constructor","noConflict","_init","fixLayoutHeight","heights","window","height","max","_max","header","resize","numbers","keys","forEach","key","options","_options","length","_addOverlay","shownEvent","SHOWN","trigger","collapsedEvent","COLLAPSED","width","screenCollapseSize","overlay","append","button","currentTarget","closest","init","_setupListeners","expand","treeviewMenu","parentLi","expandedEvent","EXPANDED","accordion","openMenuLi","siblings","first","openTreeview","find","slideDown","animationSpeed","_this","slideUp","_this2","$relativeTarget","next","is","parents","LOAD_DATA_API","settings","_parent","_settings","children","collapsed","expanded","remove","removed","REMOVED","card","collapseTrigger","click","removeTrigger","match","_typeof"],"mappings":";;;;;+LAOyBA,EAMjBC,EACAC,EAEAC,EAOAC,EAAAA,EAAAA,EAMAC,EAAAA,EAKAC,EASAC,ECpCSP,EAMTC,EACAC,EAEAC,EAMAC,EAAAA,EAAAA,EAAAA,EAWAC,EAWAG,ECrCWR,EAMXC,EACAC,EACAO,EACAN,EAEAO,EAKAJ,EAIAF,EAAAA,EAAAA,EAAAA,EASAC,EAAAA,EAYAM,ECzCWX,EAMXC,EACAC,EACAO,EACAN,EAEAO,EAOAN,EAAAA,EAAAA,EAAAA,EAQAC,EAOAC,EAUAM,EC3CSZ,EAMTC,EACAC,EACAO,EACAN,EAEAO,GAMAN,GAAAA,GAAAA,GAAAA,GAAAA,GAU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lEmB,gBAmEZL,QAAQR,cAEPc,EAAUxG,EAAEU,MAAMA,GAAM+F,cAEzBvF,SAAS8C,QAAQwC,EAASpF,KAAK8E,sBAGtCvE,OA1EmB,WA2EbP,KAAK8E,QAAQrE,SAASxB,SACnBuE,cAIFnD,wBAKPoB,MArFmB,SAqFb6D,mBACCR,QAAUQ,IAEbtF,MAAMkE,KAAKlE,KAAK+E,UAAUQ,iBAAiBC,MAAM,aAC5CjF,aAGLP,MAAMkE,KAAKlE,KAAK+E,UAAUU,eAAeD,MAAM,aAC1CL,cAMFtE,iBAnGY,SAmGKhB,UACfG,KAAKe,KAAK,eACXC,EAAOpC,EAAEoB,MAAMgB,KAAKlC,GAEnBkC,MACI,IAAIvB,EAAOb,EAAEoB,MAAOgB,KACzBhB,MAAMgB,KAAKlC,EAA4B,iBAAXe,EAAsBmB,EAAOnB,IAGvC,iBAAXA,GAAuBA,EAAO6F,MAAM,mBACxC7F,KACsB,YAAlB,oBAAOA,EAAP,YAAA8F,GAAO9F,OACX4B,MAAM7C,EAAEoB,YA/GA,KA0HnBkB,UAAUC,GAAG,QAASnC,GAAwB,SAAUoC,GACpDA,KACIC,oBAGDR,iBAAiBS,KAAK1C,EAAEoB,MAAO,cAGtCkB,UAAUC,GAAG,QAASnC,GAAsB,SAAUoC,GAClDA,KACIC,oBAGDR,iBAAiBS,KAAK1C,EAAEoB,MAAO,cAQtCL,GAAGd,GAAQY,GAAOoB,mBAClBlB,GAAGd,GAAM0C,YAAc9B,KACvBE,GAAGd,GAAM2C,WAAc,oBACrB7B,GAAGd,GAAQE,EACNU,GAAOoB,kBAGTpB","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE ControlSidebar.js\n * License MIT\n * --------------------------------------------\n */\n\nconst ControlSidebar = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'ControlSidebar'\n const DATA_KEY = 'lte.control.sidebar'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const DATA_API_KEY = '.data-api'\n\n const Event = {\n CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const Selector = {\n CONTROL_SIDEBAR: '.control-sidebar',\n DATA_TOGGLE : '[data-widget=\"control-sidebar\"]',\n MAIN_HEADER : '.main-header'\n }\n\n const ClassName = {\n CONTROL_SIDEBAR_OPEN : 'control-sidebar-open',\n CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'\n }\n\n const Default = {\n slide: true\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class ControlSidebar {\n constructor(element, config) {\n this._element = element\n this._config = this._getConfig(config)\n }\n\n // Public\n\n show() {\n // Show the control sidebar\n if (this._config.slide) {\n $('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE)\n } else {\n $('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)\n }\n }\n\n collapse() {\n // Collapse the control sidebar\n if (this._config.slide) {\n $('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE)\n } else {\n $('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)\n }\n }\n\n toggle() {\n this._setMargin()\n\n const shouldOpen = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')\n .hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)\n if (shouldOpen) {\n // Open the control sidebar\n this.show()\n } else {\n // Close the control sidebar\n this.collapse()\n }\n }\n\n // Private\n\n _getConfig(config) {\n return $.extend({}, Default, config)\n }\n\n _setMargin() {\n $(Selector.CONTROL_SIDEBAR).css({\n top: $(Selector.MAIN_HEADER).outerHeight()\n })\n }\n\n // Static\n\n static _jQueryInterface(operation) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new ControlSidebar(this, $(this).data())\n $(this).data(DATA_KEY, data)\n }\n\n if (data[operation] === 'undefined') {\n throw new Error(`${operation} is not a function`)\n }\n\n data[operation]()\n })\n }\n }\n\n /**\n *\n * Data Api implementation\n * ====================================================\n */\n $(document).on('click', Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n ControlSidebar._jQueryInterface.call($(this), 'toggle')\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = ControlSidebar._jQueryInterface\n $.fn[NAME].Constructor = ControlSidebar\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ControlSidebar._jQueryInterface\n }\n\n return ControlSidebar\n})(jQuery)\n\nexport default ControlSidebar\n","/**\n * --------------------------------------------\n * AdminLTE Layout.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Layout = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Layout'\n const DATA_KEY = 'lte.layout'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n SIDEBAR: 'sidebar'\n }\n\n const Selector = {\n SIDEBAR : '.main-sidebar',\n HEADER : '.main-header',\n CONTENT : '.content-wrapper',\n CONTENT_HEADER : '.content-header',\n WRAPPER : '.wrapper',\n CONTROL_SIDEBAR: '.control-sidebar',\n LAYOUT_FIXED : '.layout-fixed',\n FOOTER : '.main-footer'\n }\n\n const ClassName = {\n HOLD : 'hold-transition',\n SIDEBAR : 'main-sidebar',\n LAYOUT_FIXED: 'layout-fixed'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class Layout {\n constructor(element) {\n this._element = element\n\n this._init()\n }\n\n // Public\n\n fixLayoutHeight() {\n const heights = {\n window : $(window).height(),\n header : $(Selector.HEADER).outerHeight(),\n footer : $(Selector.FOOTER).outerHeight(),\n sidebar: $(Selector.SIDEBAR).height()\n }\n const max = this._max(heights)\n\n $(Selector.CONTENT).css('min-height', max - (heights.header))\n $(Selector.SIDEBAR).css('min-height', max - heights.header)\n }\n\n // Private\n\n _init() {\n // Enable transitions\n $('body').removeClass(ClassName.HOLD)\n\n // Activate layout height watcher\n this.fixLayoutHeight()\n $(Selector.SIDEBAR)\n .on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', () => {\n this.fixLayoutHeight()\n })\n\n $(window).resize(() => {\n this.fixLayoutHeight()\n })\n\n $('body, html').css('height', 'auto')\n }\n\n _max(numbers) {\n // Calculate the maximum number in a list\n let max = 0\n\n Object.keys(numbers).forEach((key) => {\n if (numbers[key] > max) {\n max = numbers[key]\n }\n })\n\n return max\n }\n\n // Static\n\n static _jQueryInterface(operation) {\n return this.each(function () {\n let data = $(this)\n .data(DATA_KEY)\n\n if (!data) {\n data = new Layout(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (operation) {\n data[operation]()\n }\n })\n }\n }\n\n /**\n * Data API\n * ====================================================\n */\n $(window).on('load', () => {\n Layout._jQueryInterface.call($('body'))\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Layout._jQueryInterface\n $.fn[NAME].Constructor = Layout\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Layout._jQueryInterface\n }\n\n return Layout\n})(jQuery)\n\nexport default Layout\n","/**\n * --------------------------------------------\n * AdminLTE PushMenu.js\n * License MIT\n * --------------------------------------------\n */\n\nconst PushMenu = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'PushMenu'\n const DATA_KEY = 'lte.pushmenu'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n COLLAPSED: `collapsed${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`\n }\n\n const Default = {\n screenCollapseSize: 768\n }\n\n const Selector = {\n TOGGLE_BUTTON : '[data-widget=\"pushmenu\"]',\n SIDEBAR_MINI : '.sidebar-mini',\n SIDEBAR_COLLAPSED: '.sidebar-collapse',\n BODY : 'body',\n OVERLAY : '#sidebar-overlay',\n WRAPPER : '.wrapper'\n }\n\n const ClassName = {\n SIDEBAR_OPEN: 'sidebar-open',\n COLLAPSED : 'sidebar-collapse',\n OPEN : 'sidebar-open',\n SIDEBAR_MINI: 'sidebar-mini'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class PushMenu {\n constructor(element, options) {\n this._element = element\n this._options = $.extend({}, Default, options)\n\n if (!$(Selector.OVERLAY).length) {\n this._addOverlay()\n }\n }\n\n // Public\n\n show() {\n $(Selector.BODY).addClass(ClassName.OPEN).removeClass(ClassName.COLLAPSED)\n\n const shownEvent = $.Event(Event.SHOWN)\n $(this._element).trigger(shownEvent)\n }\n\n collapse() {\n $(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.COLLAPSED)\n\n const collapsedEvent = $.Event(Event.COLLAPSED)\n $(this._element).trigger(collapsedEvent)\n }\n\n toggle() {\n let isShown\n if ($(window).width() >= this._options.screenCollapseSize) {\n isShown = !$(Selector.BODY).hasClass(ClassName.COLLAPSED)\n } else {\n isShown = $(Selector.BODY).hasClass(ClassName.OPEN)\n }\n\n if (isShown) {\n this.collapse()\n } else {\n this.show()\n }\n }\n\n // Private\n _addOverlay() {\n const overlay = $('<div />', {\n id: 'sidebar-overlay'\n })\n\n overlay.on('click', () => {\n this.collapse()\n })\n\n $(Selector.WRAPPER).append(overlay)\n }\n\n // Static\n\n static _jQueryInterface(operation) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new PushMenu(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (operation) {\n data[operation]()\n }\n })\n }\n }\n\n /**\n * Data API\n * ====================================================\n */\n\n $(document).on('click', Selector.TOGGLE_BUTTON, (event) => {\n event.preventDefault()\n\n let button = event.currentTarget\n\n if ($(button).data('widget') !== 'pushmenu') {\n button = $(button).closest(Selector.TOGGLE_BUTTON)\n }\n\n PushMenu._jQueryInterface.call($(button), 'toggle')\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = PushMenu._jQueryInterface\n $.fn[NAME].Constructor = PushMenu\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return PushMenu._jQueryInterface\n }\n\n return PushMenu\n})(jQuery)\n\nexport default PushMenu\n","/**\n * --------------------------------------------\n * AdminLTE Treeview.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Treeview = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Treeview'\n const DATA_KEY = 'lte.treeview'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n SELECTED : `selected${EVENT_KEY}`,\n EXPANDED : `expanded${EVENT_KEY}`,\n COLLAPSED : `collapsed${EVENT_KEY}`,\n LOAD_DATA_API: `load${EVENT_KEY}`\n }\n\n const Selector = {\n LI : '.nav-item',\n LINK : '.nav-link',\n TREEVIEW_MENU: '.nav-treeview',\n OPEN : '.menu-open',\n DATA_WIDGET : '[data-widget=\"treeview\"]'\n }\n\n const ClassName = {\n LI : 'nav-item',\n LINK : 'nav-link',\n TREEVIEW_MENU: 'nav-treeview',\n OPEN : 'menu-open'\n }\n\n const Default = {\n trigger : `${Selector.DATA_WIDGET} ${Selector.LINK}`,\n animationSpeed: 300,\n accordion : true\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n class Treeview {\n constructor(element, config) {\n this._config = config\n this._element = element\n }\n\n // Public\n\n init() {\n this._setupListeners()\n }\n\n expand(treeviewMenu, parentLi) {\n const expandedEvent = $.Event(Event.EXPANDED)\n\n if (this._config.accordion) {\n const openMenuLi = parentLi.siblings(Selector.OPEN).first()\n const openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first()\n this.collapse(openTreeview, openMenuLi)\n }\n\n treeviewMenu.slideDown(this._config.animationSpeed, () => {\n parentLi.addClass(ClassName.OPEN)\n $(this._element).trigger(expandedEvent)\n })\n }\n\n collapse(treeviewMenu, parentLi) {\n const collapsedEvent = $.Event(Event.COLLAPSED)\n\n treeviewMenu.slideUp(this._config.animationSpeed, () => {\n parentLi.removeClass(ClassName.OPEN)\n $(this._element).trigger(collapsedEvent)\n treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()\n treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN)\n })\n }\n\n toggle(event) {\n const $relativeTarget = $(event.currentTarget)\n const treeviewMenu = $relativeTarget.next()\n\n if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {\n return\n }\n\n event.preventDefault()\n\n const parentLi = $relativeTarget.parents(Selector.LI).first()\n const isOpen = parentLi.hasClass(ClassName.OPEN)\n\n if (isOpen) {\n this.collapse($(treeviewMenu), parentLi)\n } else {\n this.expand($(treeviewMenu), parentLi)\n }\n }\n\n // Private\n\n _setupListeners() {\n $(document).on('click', this._config.trigger, (event) => {\n this.toggle(event)\n })\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend({}, Default, $(this).data())\n\n if (!data) {\n data = new Treeview($(this), _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'init') {\n data[config]()\n }\n })\n }\n }\n\n /**\n * Data API\n * ====================================================\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n $(Selector.DATA_WIDGET).each(function () {\n Treeview._jQueryInterface.call($(this), 'init')\n })\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Treeview._jQueryInterface\n $.fn[NAME].Constructor = Treeview\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Treeview._jQueryInterface\n }\n\n return Treeview\n})(jQuery)\n\nexport default Treeview\n","/**\n * --------------------------------------------\n * AdminLTE Widget.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Widget = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Widget'\n const DATA_KEY = 'lte.widget'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n EXPANDED : `expanded${EVENT_KEY}`,\n COLLAPSED: `collapsed${EVENT_KEY}`,\n REMOVED : `removed${EVENT_KEY}`\n }\n\n const Selector = {\n DATA_REMOVE : '[data-widget=\"remove\"]',\n DATA_COLLAPSE: '[data-widget=\"collapse\"]',\n CARD : '.card',\n CARD_HEADER : '.card-header',\n CARD_BODY : '.card-body',\n CARD_FOOTER : '.card-footer',\n COLLAPSED : '.collapsed-card'\n }\n\n const ClassName = {\n COLLAPSED: 'collapsed-card'\n }\n\n const Default = {\n animationSpeed : 'normal',\n collapseTrigger: Selector.DATA_COLLAPSE,\n removeTrigger : Selector.DATA_REMOVE\n }\n\n class Widget {\n constructor(element, settings) {\n this._element = element\n this._parent = element.parents(Selector.CARD).first()\n this._settings = $.extend({}, Default, settings)\n }\n\n collapse() {\n this._parent.children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)\n .slideUp(this._settings.animationSpeed, () => {\n this._parent.addClass(ClassName.COLLAPSED)\n })\n\n const collapsed = $.Event(Event.COLLAPSED)\n\n this._element.trigger(collapsed, this._parent)\n }\n\n expand() {\n this._parent.children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)\n .slideDown(this._settings.animationSpeed, () => {\n this._parent.removeClass(ClassName.COLLAPSED)\n })\n\n const expanded = $.Event(Event.EXPANDED)\n\n this._element.trigger(expanded, this._parent)\n }\n\n remove() {\n this._parent.slideUp()\n\n const removed = $.Event(Event.REMOVED)\n\n this._element.trigger(removed, this._parent)\n }\n\n toggle() {\n if (this._parent.hasClass(ClassName.COLLAPSED)) {\n this.expand()\n return\n }\n\n this.collapse()\n }\n\n // Private\n\n _init(card) {\n this._parent = card\n\n $(this).find(this._settings.collapseTrigger).click(() => {\n this.toggle()\n })\n\n $(this).find(this._settings.removeTrigger).click(() => {\n this.remove()\n })\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Widget($(this), data)\n $(this).data(DATA_KEY, typeof config === 'string' ? data : config)\n }\n\n if (typeof config === 'string' && config.match(/remove|toggle/)) {\n data[config]()\n } else if (typeof config === 'object') {\n data._init($(this))\n }\n })\n }\n }\n\n /**\n * Data API\n * ====================================================\n */\n\n $(document).on('click', Selector.DATA_COLLAPSE, function (event) {\n if (event) {\n event.preventDefault()\n }\n\n Widget._jQueryInterface.call($(this), 'toggle')\n })\n\n $(document).on('click', Selector.DATA_REMOVE, function (event) {\n if (event) {\n event.preventDefault()\n }\n\n Widget._jQueryInterface.call($(this), 'remove')\n })\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Widget._jQueryInterface\n $.fn[NAME].Constructor = Widget\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Widget._jQueryInterface\n }\n\n return Widget\n})(jQuery)\n\nexport default Widget\n"]} |