Bläddra i källkod

Remove unneeded IIFEs (#2774)

XhmikosR 4 år sedan
förälder
incheckning
e848621b32
12 ändrade filer med 1509 tillägg och 1531 borttagningar
  1. 1 0
      build/config/rollup.config.js
  2. 119 121
      build/js/CardRefresh.js
  3. 188 190
      build/js/CardWidget.js
  4. 213 216
      build/js/ControlSidebar.js
  5. 67 69
      build/js/DirectChat.js
  6. 102 104
      build/js/Dropdown.js
  7. 184 186
      build/js/Layout.js
  8. 160 162
      build/js/PushMenu.js
  9. 90 92
      build/js/SiteSearch.js
  10. 161 163
      build/js/Toasts.js
  11. 89 91
      build/js/TodoList.js
  12. 135 137
      build/js/Treeview.js

+ 1 - 0
build/config/rollup.config.js

@@ -21,6 +21,7 @@ module.exports = {
     },
     name: 'adminlte'
   },
+  external: ['jquery'],
   plugins: [
     babel({
       exclude: 'node_modules/**',

+ 119 - 121
build/js/CardRefresh.js

@@ -5,158 +5,156 @@
  * --------------------------------------------
  */
 
-const CardRefresh = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'CardRefresh'
-  const DATA_KEY = 'lte.cardrefresh'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    LOADED: `loaded${EVENT_KEY}`,
-    OVERLAY_ADDED: `overlay.added${EVENT_KEY}`,
-    OVERLAY_REMOVED: `overlay.removed${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const ClassName = {
-    CARD: 'card'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const Selector = {
-    CARD: `.${ClassName.CARD}`,
-    DATA_REFRESH: '[data-card-widget="card-refresh"]'
+const NAME = 'CardRefresh'
+const DATA_KEY = 'lte.cardrefresh'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  LOADED: `loaded${EVENT_KEY}`,
+  OVERLAY_ADDED: `overlay.added${EVENT_KEY}`,
+  OVERLAY_REMOVED: `overlay.removed${EVENT_KEY}`
+}
+
+const ClassName = {
+  CARD: 'card'
+}
+
+const Selector = {
+  CARD: `.${ClassName.CARD}`,
+  DATA_REFRESH: '[data-card-widget="card-refresh"]'
+}
+
+const Default = {
+  source: '',
+  sourceSelector: '',
+  params: {},
+  trigger: Selector.DATA_REFRESH,
+  content: '.card-body',
+  loadInContent: true,
+  loadOnInit: true,
+  responseType: '',
+  overlayTemplate: '<div class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>',
+  onLoadStart() {
+  },
+  onLoadDone(response) {
+    return response
   }
+}
+
+class CardRefresh {
+  constructor(element, settings) {
+    this._element = element
+    this._parent = element.parents(Selector.CARD).first()
+    this._settings = $.extend({}, Default, settings)
+    this._overlay = $(this._settings.overlayTemplate)
 
-  const Default = {
-    source: '',
-    sourceSelector: '',
-    params: {},
-    trigger: Selector.DATA_REFRESH,
-    content: '.card-body',
-    loadInContent: true,
-    loadOnInit: true,
-    responseType: '',
-    overlayTemplate: '<div class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>',
-    onLoadStart() {
-    },
-    onLoadDone(response) {
-      return response
+    if (element.hasClass(ClassName.CARD)) {
+      this._parent = element
+    }
+
+    if (this._settings.source === '') {
+      throw new Error('Source url was not defined. Please specify a url in your CardRefresh source option.')
     }
   }
 
-  class CardRefresh {
-    constructor(element, settings) {
-      this._element = element
-      this._parent = element.parents(Selector.CARD).first()
-      this._settings = $.extend({}, Default, settings)
-      this._overlay = $(this._settings.overlayTemplate)
+  load() {
+    this._addOverlay()
+    this._settings.onLoadStart.call($(this))
 
-      if (element.hasClass(ClassName.CARD)) {
-        this._parent = element
-      }
+    $.get(this._settings.source, this._settings.params, response => {
+      if (this._settings.loadInContent) {
+        if (this._settings.sourceSelector !== '') {
+          response = $(response).find(this._settings.sourceSelector).html()
+        }
 
-      if (this._settings.source === '') {
-        throw new Error('Source url was not defined. Please specify a url in your CardRefresh source option.')
+        this._parent.find(this._settings.content).html(response)
       }
-    }
 
-    load() {
-      this._addOverlay()
-      this._settings.onLoadStart.call($(this))
+      this._settings.onLoadDone.call($(this), response)
+      this._removeOverlay()
+    }, this._settings.responseType !== '' && this._settings.responseType)
 
-      $.get(this._settings.source, this._settings.params, response => {
-        if (this._settings.loadInContent) {
-          if (this._settings.sourceSelector !== '') {
-            response = $(response).find(this._settings.sourceSelector).html()
-          }
+    $(this._element).trigger($.Event(Event.LOADED))
+  }
 
-          this._parent.find(this._settings.content).html(response)
-        }
+  _addOverlay() {
+    this._parent.append(this._overlay)
+    $(this._element).trigger($.Event(Event.OVERLAY_ADDED))
+  }
 
-        this._settings.onLoadDone.call($(this), response)
-        this._removeOverlay()
-      }, this._settings.responseType !== '' && this._settings.responseType)
+  _removeOverlay() {
+    this._parent.find(this._overlay).remove()
+    $(this._element).trigger($.Event(Event.OVERLAY_REMOVED))
+  }
 
-      $(this._element).trigger($.Event(Event.LOADED))
-    }
+  // Private
 
-    _addOverlay() {
-      this._parent.append(this._overlay)
-      $(this._element).trigger($.Event(Event.OVERLAY_ADDED))
-    }
+  _init() {
+    $(this).find(this._settings.trigger).on('click', () => {
+      this.load()
+    })
 
-    _removeOverlay() {
-      this._parent.find(this._overlay).remove()
-      $(this._element).trigger($.Event(Event.OVERLAY_REMOVED))
+    if (this._settings.loadOnInit) {
+      this.load()
     }
+  }
 
-    // Private
+  // Static
 
-    _init() {
-      $(this).find(this._settings.trigger).on('click', () => {
-        this.load()
-      })
+  static _jQueryInterface(config) {
+    let data = $(this).data(DATA_KEY)
+    const _options = $.extend({}, Default, $(this).data())
 
-      if (this._settings.loadOnInit) {
-        this.load()
-      }
+    if (!data) {
+      data = new CardRefresh($(this), _options)
+      $(this).data(DATA_KEY, typeof config === 'string' ? data : config)
     }
 
-    // Static
-
-    static _jQueryInterface(config) {
-      let data = $(this).data(DATA_KEY)
-      const _options = $.extend({}, Default, $(this).data())
-
-      if (!data) {
-        data = new CardRefresh($(this), _options)
-        $(this).data(DATA_KEY, typeof config === 'string' ? data : config)
-      }
-
-      if (typeof config === 'string' && config.match(/load/)) {
-        data[config]()
-      } else {
-        data._init($(this))
-      }
+    if (typeof config === 'string' && config.match(/load/)) {
+      data[config]()
+    } else {
+      data._init($(this))
     }
   }
+}
 
-  /**
-   * Data API
-   * ====================================================
-   */
+/**
+ * Data API
+ * ====================================================
+ */
 
-  $(document).on('click', Selector.DATA_REFRESH, function (event) {
-    if (event) {
-      event.preventDefault()
-    }
+$(document).on('click', Selector.DATA_REFRESH, function (event) {
+  if (event) {
+    event.preventDefault()
+  }
 
-    CardRefresh._jQueryInterface.call($(this), 'load')
-  })
+  CardRefresh._jQueryInterface.call($(this), 'load')
+})
 
-  $(() => {
-    $(Selector.DATA_REFRESH).each(function () {
-      CardRefresh._jQueryInterface.call($(this))
-    })
+$(() => {
+  $(Selector.DATA_REFRESH).each(function () {
+    CardRefresh._jQueryInterface.call($(this))
   })
+})
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = CardRefresh._jQueryInterface
-  $.fn[NAME].Constructor = CardRefresh
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return CardRefresh._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return CardRefresh
-})(jQuery)
+$.fn[NAME] = CardRefresh._jQueryInterface
+$.fn[NAME].Constructor = CardRefresh
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return CardRefresh._jQueryInterface
+}
 
 export default CardRefresh

+ 188 - 190
build/js/CardWidget.js

@@ -5,239 +5,237 @@
  * --------------------------------------------
  */
 
-const CardWidget = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'CardWidget'
-  const DATA_KEY = 'lte.cardwidget'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    EXPANDED: `expanded${EVENT_KEY}`,
-    COLLAPSED: `collapsed${EVENT_KEY}`,
-    MAXIMIZED: `maximized${EVENT_KEY}`,
-    MINIMIZED: `minimized${EVENT_KEY}`,
-    REMOVED: `removed${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const ClassName = {
-    CARD: 'card',
-    COLLAPSED: 'collapsed-card',
-    COLLAPSING: 'collapsing-card',
-    EXPANDING: 'expanding-card',
-    WAS_COLLAPSED: 'was-collapsed',
-    MAXIMIZED: 'maximized-card'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const Selector = {
-    DATA_REMOVE: '[data-card-widget="remove"]',
-    DATA_COLLAPSE: '[data-card-widget="collapse"]',
-    DATA_MAXIMIZE: '[data-card-widget="maximize"]',
-    CARD: `.${ClassName.CARD}`,
-    CARD_HEADER: '.card-header',
-    CARD_BODY: '.card-body',
-    CARD_FOOTER: '.card-footer'
-  }
+const NAME = 'CardWidget'
+const DATA_KEY = 'lte.cardwidget'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  EXPANDED: `expanded${EVENT_KEY}`,
+  COLLAPSED: `collapsed${EVENT_KEY}`,
+  MAXIMIZED: `maximized${EVENT_KEY}`,
+  MINIMIZED: `minimized${EVENT_KEY}`,
+  REMOVED: `removed${EVENT_KEY}`
+}
+
+const ClassName = {
+  CARD: 'card',
+  COLLAPSED: 'collapsed-card',
+  COLLAPSING: 'collapsing-card',
+  EXPANDING: 'expanding-card',
+  WAS_COLLAPSED: 'was-collapsed',
+  MAXIMIZED: 'maximized-card'
+}
+
+const Selector = {
+  DATA_REMOVE: '[data-card-widget="remove"]',
+  DATA_COLLAPSE: '[data-card-widget="collapse"]',
+  DATA_MAXIMIZE: '[data-card-widget="maximize"]',
+  CARD: `.${ClassName.CARD}`,
+  CARD_HEADER: '.card-header',
+  CARD_BODY: '.card-body',
+  CARD_FOOTER: '.card-footer'
+}
+
+const Default = {
+  animationSpeed: 'normal',
+  collapseTrigger: Selector.DATA_COLLAPSE,
+  removeTrigger: Selector.DATA_REMOVE,
+  maximizeTrigger: Selector.DATA_MAXIMIZE,
+  collapseIcon: 'fa-minus',
+  expandIcon: 'fa-plus',
+  maximizeIcon: 'fa-expand',
+  minimizeIcon: 'fa-compress'
+}
+
+class CardWidget {
+  constructor(element, settings) {
+    this._element = element
+    this._parent = element.parents(Selector.CARD).first()
+
+    if (element.hasClass(ClassName.CARD)) {
+      this._parent = element
+    }
 
-  const Default = {
-    animationSpeed: 'normal',
-    collapseTrigger: Selector.DATA_COLLAPSE,
-    removeTrigger: Selector.DATA_REMOVE,
-    maximizeTrigger: Selector.DATA_MAXIMIZE,
-    collapseIcon: 'fa-minus',
-    expandIcon: 'fa-plus',
-    maximizeIcon: 'fa-expand',
-    minimizeIcon: 'fa-compress'
+    this._settings = $.extend({}, Default, settings)
   }
 
-  class CardWidget {
-    constructor(element, settings) {
-      this._element = element
-      this._parent = element.parents(Selector.CARD).first()
-
-      if (element.hasClass(ClassName.CARD)) {
-        this._parent = element
-      }
+  collapse() {
+    this._parent.addClass(ClassName.COLLAPSING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
+      .slideUp(this._settings.animationSpeed, () => {
+        this._parent.addClass(ClassName.COLLAPSED).removeClass(ClassName.COLLAPSING)
+      })
 
-      this._settings = $.extend({}, Default, settings)
-    }
+    this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.collapseIcon)
+      .addClass(this._settings.expandIcon)
+      .removeClass(this._settings.collapseIcon)
 
-    collapse() {
-      this._parent.addClass(ClassName.COLLAPSING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
-        .slideUp(this._settings.animationSpeed, () => {
-          this._parent.addClass(ClassName.COLLAPSED).removeClass(ClassName.COLLAPSING)
-        })
+    this._element.trigger($.Event(Event.COLLAPSED), this._parent)
+  }
 
-      this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.collapseIcon)
-        .addClass(this._settings.expandIcon)
-        .removeClass(this._settings.collapseIcon)
+  expand() {
+    this._parent.addClass(ClassName.EXPANDING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
+      .slideDown(this._settings.animationSpeed, () => {
+        this._parent.removeClass(ClassName.COLLAPSED).removeClass(ClassName.EXPANDING)
+      })
 
-      this._element.trigger($.Event(Event.COLLAPSED), this._parent)
-    }
+    this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.expandIcon)
+      .addClass(this._settings.collapseIcon)
+      .removeClass(this._settings.expandIcon)
 
-    expand() {
-      this._parent.addClass(ClassName.EXPANDING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
-        .slideDown(this._settings.animationSpeed, () => {
-          this._parent.removeClass(ClassName.COLLAPSED).removeClass(ClassName.EXPANDING)
-        })
+    this._element.trigger($.Event(Event.EXPANDED), this._parent)
+  }
 
-      this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.expandIcon)
-        .addClass(this._settings.collapseIcon)
-        .removeClass(this._settings.expandIcon)
+  remove() {
+    this._parent.slideUp()
+    this._element.trigger($.Event(Event.REMOVED), this._parent)
+  }
 
-      this._element.trigger($.Event(Event.EXPANDED), this._parent)
+  toggle() {
+    if (this._parent.hasClass(ClassName.COLLAPSED)) {
+      this.expand()
+      return
     }
 
-    remove() {
-      this._parent.slideUp()
-      this._element.trigger($.Event(Event.REMOVED), this._parent)
-    }
+    this.collapse()
+  }
 
-    toggle() {
-      if (this._parent.hasClass(ClassName.COLLAPSED)) {
-        this.expand()
-        return
+  maximize() {
+    this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.maximizeIcon)
+      .addClass(this._settings.minimizeIcon)
+      .removeClass(this._settings.maximizeIcon)
+    this._parent.css({
+      height: this._parent.height(),
+      width: this._parent.width(),
+      transition: 'all .15s'
+    }).delay(150).queue(function () {
+      $(this).addClass(ClassName.MAXIMIZED)
+      $('html').addClass(ClassName.MAXIMIZED)
+      if ($(this).hasClass(ClassName.COLLAPSED)) {
+        $(this).addClass(ClassName.WAS_COLLAPSED)
       }
 
-      this.collapse()
-    }
-
-    maximize() {
-      this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.maximizeIcon)
-        .addClass(this._settings.minimizeIcon)
-        .removeClass(this._settings.maximizeIcon)
-      this._parent.css({
-        height: this._parent.height(),
-        width: this._parent.width(),
-        transition: 'all .15s'
-      }).delay(150).queue(function () {
-        $(this).addClass(ClassName.MAXIMIZED)
-        $('html').addClass(ClassName.MAXIMIZED)
-        if ($(this).hasClass(ClassName.COLLAPSED)) {
-          $(this).addClass(ClassName.WAS_COLLAPSED)
-        }
-
-        $(this).dequeue()
-      })
+      $(this).dequeue()
+    })
 
-      this._element.trigger($.Event(Event.MAXIMIZED), this._parent)
-    }
+    this._element.trigger($.Event(Event.MAXIMIZED), this._parent)
+  }
 
-    minimize() {
-      this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.minimizeIcon)
-        .addClass(this._settings.maximizeIcon)
-        .removeClass(this._settings.minimizeIcon)
-      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 () {
-        $(this).removeClass(ClassName.MAXIMIZED)
-        $('html').removeClass(ClassName.MAXIMIZED)
-        $(this).css({
-          height: 'inherit',
-          width: 'inherit'
-        })
-        if ($(this).hasClass(ClassName.WAS_COLLAPSED)) {
-          $(this).removeClass(ClassName.WAS_COLLAPSED)
-        }
-
-        $(this).dequeue()
+  minimize() {
+    this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.minimizeIcon)
+      .addClass(this._settings.maximizeIcon)
+      .removeClass(this._settings.minimizeIcon)
+    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 () {
+      $(this).removeClass(ClassName.MAXIMIZED)
+      $('html').removeClass(ClassName.MAXIMIZED)
+      $(this).css({
+        height: 'inherit',
+        width: 'inherit'
       })
+      if ($(this).hasClass(ClassName.WAS_COLLAPSED)) {
+        $(this).removeClass(ClassName.WAS_COLLAPSED)
+      }
 
-      this._element.trigger($.Event(Event.MINIMIZED), this._parent)
-    }
+      $(this).dequeue()
+    })
 
-    toggleMaximize() {
-      if (this._parent.hasClass(ClassName.MAXIMIZED)) {
-        this.minimize()
-        return
-      }
+    this._element.trigger($.Event(Event.MINIMIZED), this._parent)
+  }
 
-      this.maximize()
+  toggleMaximize() {
+    if (this._parent.hasClass(ClassName.MAXIMIZED)) {
+      this.minimize()
+      return
     }
 
-    // Private
+    this.maximize()
+  }
 
-    _init(card) {
-      this._parent = card
+  // Private
 
-      $(this).find(this._settings.collapseTrigger).click(() => {
-        this.toggle()
-      })
+  _init(card) {
+    this._parent = card
 
-      $(this).find(this._settings.maximizeTrigger).click(() => {
-        this.toggleMaximize()
-      })
+    $(this).find(this._settings.collapseTrigger).click(() => {
+      this.toggle()
+    })
 
-      $(this).find(this._settings.removeTrigger).click(() => {
-        this.remove()
-      })
-    }
+    $(this).find(this._settings.maximizeTrigger).click(() => {
+      this.toggleMaximize()
+    })
 
-    // Static
+    $(this).find(this._settings.removeTrigger).click(() => {
+      this.remove()
+    })
+  }
 
-    static _jQueryInterface(config) {
-      let data = $(this).data(DATA_KEY)
-      const _options = $.extend({}, Default, $(this).data())
+  // Static
 
-      if (!data) {
-        data = new CardWidget($(this), _options)
-        $(this).data(DATA_KEY, typeof config === 'string' ? data : config)
-      }
+  static _jQueryInterface(config) {
+    let data = $(this).data(DATA_KEY)
+    const _options = $.extend({}, Default, $(this).data())
 
-      if (typeof config === 'string' && config.match(/collapse|expand|remove|toggle|maximize|minimize|toggleMaximize/)) {
-        data[config]()
-      } else if (typeof config === 'object') {
-        data._init($(this))
-      }
+    if (!data) {
+      data = new CardWidget($(this), _options)
+      $(this).data(DATA_KEY, typeof config === 'string' ? data : config)
     }
-  }
-
-  /**
-   * Data API
-   * ====================================================
-   */
 
-  $(document).on('click', Selector.DATA_COLLAPSE, function (event) {
-    if (event) {
-      event.preventDefault()
+    if (typeof config === 'string' && config.match(/collapse|expand|remove|toggle|maximize|minimize|toggleMaximize/)) {
+      data[config]()
+    } else if (typeof config === 'object') {
+      data._init($(this))
     }
+  }
+}
 
-    CardWidget._jQueryInterface.call($(this), 'toggle')
-  })
-
-  $(document).on('click', Selector.DATA_REMOVE, function (event) {
-    if (event) {
-      event.preventDefault()
-    }
+/**
+ * Data API
+ * ====================================================
+ */
 
-    CardWidget._jQueryInterface.call($(this), 'remove')
-  })
+$(document).on('click', Selector.DATA_COLLAPSE, function (event) {
+  if (event) {
+    event.preventDefault()
+  }
 
-  $(document).on('click', Selector.DATA_MAXIMIZE, function (event) {
-    if (event) {
-      event.preventDefault()
-    }
+  CardWidget._jQueryInterface.call($(this), 'toggle')
+})
 
-    CardWidget._jQueryInterface.call($(this), 'toggleMaximize')
-  })
+$(document).on('click', Selector.DATA_REMOVE, function (event) {
+  if (event) {
+    event.preventDefault()
+  }
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
+  CardWidget._jQueryInterface.call($(this), 'remove')
+})
 
-  $.fn[NAME] = CardWidget._jQueryInterface
-  $.fn[NAME].Constructor = CardWidget
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return CardWidget._jQueryInterface
+$(document).on('click', Selector.DATA_MAXIMIZE, function (event) {
+  if (event) {
+    event.preventDefault()
   }
 
-  return CardWidget
-})(jQuery)
+  CardWidget._jQueryInterface.call($(this), 'toggleMaximize')
+})
+
+/**
+ * jQuery API
+ * ====================================================
+ */
+
+$.fn[NAME] = CardWidget._jQueryInterface
+$.fn[NAME].Constructor = CardWidget
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return CardWidget._jQueryInterface
+}
 
 export default CardWidget

+ 213 - 216
build/js/ControlSidebar.js

@@ -5,286 +5,283 @@
  * --------------------------------------------
  */
 
-const ControlSidebar = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'ControlSidebar'
-  const DATA_KEY = 'lte.controlsidebar'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    COLLAPSED: `collapsed${EVENT_KEY}`,
-    EXPANDED: `expanded${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const Selector = {
-    CONTROL_SIDEBAR: '.control-sidebar',
-    CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
-    DATA_TOGGLE: '[data-widget="control-sidebar"]',
-    HEADER: '.main-header',
-    FOOTER: '.main-footer'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const ClassName = {
-    CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
-    CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
-    CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open',
-    LAYOUT_FIXED: 'layout-fixed',
-    NAVBAR_FIXED: 'layout-navbar-fixed',
-    NAVBAR_SM_FIXED: 'layout-sm-navbar-fixed',
-    NAVBAR_MD_FIXED: 'layout-md-navbar-fixed',
-    NAVBAR_LG_FIXED: 'layout-lg-navbar-fixed',
-    NAVBAR_XL_FIXED: 'layout-xl-navbar-fixed',
-    FOOTER_FIXED: 'layout-footer-fixed',
-    FOOTER_SM_FIXED: 'layout-sm-footer-fixed',
-    FOOTER_MD_FIXED: 'layout-md-footer-fixed',
-    FOOTER_LG_FIXED: 'layout-lg-footer-fixed',
-    FOOTER_XL_FIXED: 'layout-xl-footer-fixed'
-  }
+const NAME = 'ControlSidebar'
+const DATA_KEY = 'lte.controlsidebar'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  COLLAPSED: `collapsed${EVENT_KEY}`,
+  EXPANDED: `expanded${EVENT_KEY}`
+}
+
+const Selector = {
+  CONTROL_SIDEBAR: '.control-sidebar',
+  CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
+  DATA_TOGGLE: '[data-widget="control-sidebar"]',
+  HEADER: '.main-header',
+  FOOTER: '.main-footer'
+}
+
+const ClassName = {
+  CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
+  CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
+  CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open',
+  LAYOUT_FIXED: 'layout-fixed',
+  NAVBAR_FIXED: 'layout-navbar-fixed',
+  NAVBAR_SM_FIXED: 'layout-sm-navbar-fixed',
+  NAVBAR_MD_FIXED: 'layout-md-navbar-fixed',
+  NAVBAR_LG_FIXED: 'layout-lg-navbar-fixed',
+  NAVBAR_XL_FIXED: 'layout-xl-navbar-fixed',
+  FOOTER_FIXED: 'layout-footer-fixed',
+  FOOTER_SM_FIXED: 'layout-sm-footer-fixed',
+  FOOTER_MD_FIXED: 'layout-md-footer-fixed',
+  FOOTER_LG_FIXED: 'layout-lg-footer-fixed',
+  FOOTER_XL_FIXED: 'layout-xl-footer-fixed'
+}
+
+const Default = {
+  controlsidebarSlide: true,
+  scrollbarTheme: 'os-theme-light',
+  scrollbarAutoHide: 'l'
+}
 
-  const Default = {
-    controlsidebarSlide: true,
-    scrollbarTheme: 'os-theme-light',
-    scrollbarAutoHide: 'l'
-  }
+/**
+ * Class Definition
+ * ====================================================
+ */
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+class ControlSidebar {
+  constructor(element, config) {
+    this._element = element
+    this._config = config
+
+    this._init()
+  }
 
-  class ControlSidebar {
-    constructor(element, config) {
-      this._element = element
-      this._config = config
+  // Public
 
-      this._init()
+  collapse() {
+    // Show the control sidebar
+    if (this._config.controlsidebarSlide) {
+      $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
+      $('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
+        $(Selector.CONTROL_SIDEBAR).hide()
+        $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
+        $(this).dequeue()
+      })
+    } else {
+      $('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
     }
 
-    // Public
+    $(this._element).trigger($.Event(Event.COLLAPSED))
+  }
 
-    collapse() {
-      // Show the control sidebar
-      if (this._config.controlsidebarSlide) {
-        $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
-        $('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
-          $(Selector.CONTROL_SIDEBAR).hide()
+  show() {
+    // Collapse the control sidebar
+    if (this._config.controlsidebarSlide) {
+      $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
+      $(Selector.CONTROL_SIDEBAR).show().delay(10).queue(function () {
+        $('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
           $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
           $(this).dequeue()
         })
-      } else {
-        $('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
-      }
-
-      $(this._element).trigger($.Event(Event.COLLAPSED))
+        $(this).dequeue()
+      })
+    } else {
+      $('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
     }
 
-    show() {
-      // Collapse the control sidebar
-      if (this._config.controlsidebarSlide) {
-        $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
-        $(Selector.CONTROL_SIDEBAR).show().delay(10).queue(function () {
-          $('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
-            $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
-            $(this).dequeue()
-          })
-          $(this).dequeue()
-        })
-      } else {
-        $('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
-      }
-
-      $(this._element).trigger($.Event(Event.EXPANDED))
-    }
+    $(this._element).trigger($.Event(Event.EXPANDED))
+  }
 
-    toggle() {
-      const shouldClose = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')
+  toggle() {
+    const shouldClose = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')
         .hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)
-      if (shouldClose) {
-        // Close the control sidebar
-        this.collapse()
-      } else {
-        // Open the control sidebar
-        this.show()
-      }
+    if (shouldClose) {
+      // Close the control sidebar
+      this.collapse()
+    } else {
+      // Open the control sidebar
+      this.show()
     }
+  }
 
-    // Private
+  // Private
 
-    _init() {
+  _init() {
+    this._fixHeight()
+    this._fixScrollHeight()
+
+    $(window).resize(() => {
       this._fixHeight()
       this._fixScrollHeight()
+    })
 
-      $(window).resize(() => {
-        this._fixHeight()
+    $(window).scroll(() => {
+      if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)) {
         this._fixScrollHeight()
-      })
+      }
+    })
+  }
 
-      $(window).scroll(() => {
-        if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)) {
-          this._fixScrollHeight()
-        }
-      })
+  _fixScrollHeight() {
+    if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
+      return
     }
 
-    _fixScrollHeight() {
-      if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
-        return
-      }
-
-      const heights = {
-        scroll: $(document).height(),
-        window: $(window).height(),
-        header: $(Selector.HEADER).outerHeight(),
-        footer: $(Selector.FOOTER).outerHeight()
-      }
-      const positions = {
-        bottom: Math.abs((heights.window + $(window).scrollTop()) - heights.scroll),
-        top: $(window).scrollTop()
-      }
+    const heights = {
+      scroll: $(document).height(),
+      window: $(window).height(),
+      header: $(Selector.HEADER).outerHeight(),
+      footer: $(Selector.FOOTER).outerHeight()
+    }
+    const positions = {
+      bottom: Math.abs((heights.window + $(window).scrollTop()) - heights.scroll),
+      top: $(window).scrollTop()
+    }
 
-      let navbarFixed = false
-      let footerFixed = false
+    let navbarFixed = false
+    let footerFixed = false
 
-      if (
-        $('body').hasClass(ClassName.NAVBAR_FIXED) ||
+    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)
-      ) {
-        if ($(Selector.HEADER).css('position') === 'fixed') {
-          navbarFixed = true
-        }
+    ) {
+      if ($(Selector.HEADER).css('position') === 'fixed') {
+        navbarFixed = true
       }
+    }
 
-      if (
-        $('body').hasClass(ClassName.FOOTER_FIXED) ||
+    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)
-      ) {
-        if ($(Selector.FOOTER).css('position') === 'fixed') {
-          footerFixed = true
-        }
+    ) {
+      if ($(Selector.FOOTER).css('position') === 'fixed') {
+        footerFixed = true
       }
+    }
 
-      if (positions.top === 0 && positions.bottom === 0) {
+    if (positions.top === 0 && positions.bottom === 0) {
+      $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer)
+      $(Selector.CONTROL_SIDEBAR).css('top', heights.header)
+      $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header + heights.footer))
+    } else if (positions.bottom <= heights.footer) {
+      if (footerFixed === false) {
+        $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer - positions.bottom)
+        $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.footer - positions.bottom))
+      } else {
         $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer)
-        $(Selector.CONTROL_SIDEBAR).css('top', heights.header)
-        $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header + heights.footer))
-      } else if (positions.bottom <= heights.footer) {
-        if (footerFixed === false) {
-          $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer - positions.bottom)
-          $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.footer - positions.bottom))
-        } else {
-          $(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer)
-        }
-      } else if (positions.top <= heights.header) {
-        if (navbarFixed === false) {
-          $(Selector.CONTROL_SIDEBAR).css('top', heights.header - positions.top)
-          $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header - positions.top))
-        } else {
-          $(Selector.CONTROL_SIDEBAR).css('top', heights.header)
-        }
-      } else if (navbarFixed === false) {
-        $(Selector.CONTROL_SIDEBAR).css('top', 0)
-        $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window)
+      }
+    } else if (positions.top <= heights.header) {
+      if (navbarFixed === false) {
+        $(Selector.CONTROL_SIDEBAR).css('top', heights.header - positions.top)
+        $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header - positions.top))
       } else {
         $(Selector.CONTROL_SIDEBAR).css('top', heights.header)
       }
+    } else if (navbarFixed === false) {
+      $(Selector.CONTROL_SIDEBAR).css('top', 0)
+      $(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window)
+    } else {
+      $(Selector.CONTROL_SIDEBAR).css('top', heights.header)
     }
+  }
 
-    _fixHeight() {
-      if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
-        return
-      }
+  _fixHeight() {
+    if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
+      return
+    }
 
-      const heights = {
-        window: $(window).height(),
-        header: $(Selector.HEADER).outerHeight(),
-        footer: $(Selector.FOOTER).outerHeight()
-      }
+    const heights = {
+      window: $(window).height(),
+      header: $(Selector.HEADER).outerHeight(),
+      footer: $(Selector.FOOTER).outerHeight()
+    }
 
-      let sidebarHeight = heights.window - heights.header
+    let sidebarHeight = heights.window - heights.header
 
-      if (
-        $('body').hasClass(ClassName.FOOTER_FIXED) ||
+    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)
-      ) {
-        if ($(Selector.FOOTER).css('position') === 'fixed') {
-          sidebarHeight = heights.window - heights.header - heights.footer
-        }
+    ) {
+      if ($(Selector.FOOTER).css('position') === 'fixed') {
+        sidebarHeight = heights.window - heights.header - heights.footer
       }
+    }
 
-      $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', sidebarHeight)
+    $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', sidebarHeight)
 
-      if (typeof $.fn.overlayScrollbars !== 'undefined') {
-        $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).overlayScrollbars({
-          className: this._config.scrollbarTheme,
-          sizeAutoCapable: true,
-          scrollbars: {
-            autoHide: this._config.scrollbarAutoHide,
-            clickScrolling: true
-          }
-        })
-      }
+    if (typeof $.fn.overlayScrollbars !== 'undefined') {
+      $(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).overlayScrollbars({
+        className: this._config.scrollbarTheme,
+        sizeAutoCapable: true,
+        scrollbars: {
+          autoHide: this._config.scrollbarAutoHide,
+          clickScrolling: true
+        }
+      })
     }
+  }
 
-    // Static
+  // Static
 
-    static _jQueryInterface(operation) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _options = $.extend({}, Default, $(this).data())
+  static _jQueryInterface(operation) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _options = $.extend({}, Default, $(this).data())
 
-        if (!data) {
-          data = new ControlSidebar(this, _options)
-          $(this).data(DATA_KEY, data)
-        }
+      if (!data) {
+        data = new ControlSidebar(this, _options)
+        $(this).data(DATA_KEY, data)
+      }
 
-        if (data[operation] === 'undefined') {
-          throw new Error(`${operation} is not a function`)
-        }
+      if (data[operation] === 'undefined') {
+        throw new Error(`${operation} is not a function`)
+      }
 
-        data[operation]()
-      })
-    }
+      data[operation]()
+    })
   }
+}
 
-  /**
-   *
-   * Data Api implementation
-   * ====================================================
-   */
-  $(document).on('click', Selector.DATA_TOGGLE, function (event) {
-    event.preventDefault()
-
-    ControlSidebar._jQueryInterface.call($(this), 'toggle')
-  })
-
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = ControlSidebar._jQueryInterface
-  $.fn[NAME].Constructor = ControlSidebar
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return ControlSidebar._jQueryInterface
-  }
+/**
+ *
+ * Data Api implementation
+ * ====================================================
+ */
+$(document).on('click', Selector.DATA_TOGGLE, function (event) {
+  event.preventDefault()
 
-  return ControlSidebar
-})(jQuery)
+  ControlSidebar._jQueryInterface.call($(this), 'toggle')
+})
 
-export default ControlSidebar
+/**
+ * jQuery API
+ * ====================================================
+ */
 
+$.fn[NAME] = ControlSidebar._jQueryInterface
+$.fn[NAME].Constructor = ControlSidebar
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return ControlSidebar._jQueryInterface
+}
+
+export default ControlSidebar

+ 67 - 69
build/js/DirectChat.js

@@ -5,87 +5,85 @@
  * --------------------------------------------
  */
 
-const DirectChat = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'DirectChat'
-  const DATA_KEY = 'lte.directchat'
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    TOGGLED: 'toggled{EVENT_KEY}'
-  }
+import $ from 'jquery'
 
-  const Selector = {
-    DATA_TOGGLE: '[data-widget="chat-pane-toggle"]',
-    DIRECT_CHAT: '.direct-chat'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const ClassName = {
-    DIRECT_CHAT_OPEN: 'direct-chat-contacts-open'
-  }
+const NAME = 'DirectChat'
+const DATA_KEY = 'lte.directchat'
+const JQUERY_NO_CONFLICT = $.fn[NAME]
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+const Event = {
+  TOGGLED: 'toggled{EVENT_KEY}'
+}
 
-  class DirectChat {
-    constructor(element) {
-      this._element = element
-    }
+const Selector = {
+  DATA_TOGGLE: '[data-widget="chat-pane-toggle"]',
+  DIRECT_CHAT: '.direct-chat'
+}
 
-    toggle() {
-      $(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN)
-      $(this._element).trigger($.Event(Event.TOGGLED))
-    }
+const ClassName = {
+  DIRECT_CHAT_OPEN: 'direct-chat-contacts-open'
+}
 
-    // Static
+/**
+ * Class Definition
+ * ====================================================
+ */
 
-    static _jQueryInterface(config) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
+class DirectChat {
+  constructor(element) {
+    this._element = element
+  }
+
+  toggle() {
+    $(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN)
+    $(this._element).trigger($.Event(Event.TOGGLED))
+  }
 
-        if (!data) {
-          data = new DirectChat($(this))
-          $(this).data(DATA_KEY, data)
-        }
+  // Static
 
-        data[config]()
-      })
-    }
+  static _jQueryInterface(config) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+
+      if (!data) {
+        data = new DirectChat($(this))
+        $(this).data(DATA_KEY, data)
+      }
+
+      data[config]()
+    })
   }
+}
+
+/**
+ *
+ * Data Api implementation
+ * ====================================================
+ */
 
-  /**
-   *
-   * Data Api implementation
-   * ====================================================
-   */
-
-  $(document).on('click', Selector.DATA_TOGGLE, function (event) {
-    if (event) {
-      event.preventDefault()
-    }
-
-    DirectChat._jQueryInterface.call($(this), 'toggle')
-  })
-
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = DirectChat._jQueryInterface
-  $.fn[NAME].Constructor = DirectChat
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return DirectChat._jQueryInterface
+$(document).on('click', Selector.DATA_TOGGLE, function (event) {
+  if (event) {
+    event.preventDefault()
   }
 
-  return DirectChat
-})(jQuery)
+  DirectChat._jQueryInterface.call($(this), 'toggle')
+})
+
+/**
+ * jQuery API
+ * ====================================================
+ */
+
+$.fn[NAME] = DirectChat._jQueryInterface
+$.fn[NAME].Constructor = DirectChat
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return DirectChat._jQueryInterface
+}
 
 export default DirectChat

+ 102 - 104
build/js/Dropdown.js

@@ -5,134 +5,132 @@
  * --------------------------------------------
  */
 
-const Dropdown = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'Dropdown'
-  const DATA_KEY = 'lte.dropdown'
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Selector = {
-    NAVBAR: '.navbar',
-    DROPDOWN_MENU: '.dropdown-menu',
-    DROPDOWN_MENU_ACTIVE: '.dropdown-menu.show',
-    DROPDOWN_TOGGLE: '[data-toggle="dropdown"]'
-  }
+import $ from 'jquery'
 
-  const ClassName = {
-    DROPDOWN_RIGHT: 'dropdown-menu-right'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
+
+const NAME = 'Dropdown'
+const DATA_KEY = 'lte.dropdown'
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Selector = {
+  NAVBAR: '.navbar',
+  DROPDOWN_MENU: '.dropdown-menu',
+  DROPDOWN_MENU_ACTIVE: '.dropdown-menu.show',
+  DROPDOWN_TOGGLE: '[data-toggle="dropdown"]'
+}
+
+const ClassName = {
+  DROPDOWN_RIGHT: 'dropdown-menu-right'
+}
 
-  const Default = {
+const Default = {
+}
+
+/**
+ * Class Definition
+ * ====================================================
+ */
+
+class Dropdown {
+  constructor(element, config) {
+    this._config = config
+    this._element = element
   }
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+  // Public
+
+  toggleSubmenu() {
+    this._element.siblings().show().toggleClass('show')
 
-  class Dropdown {
-    constructor(element, config) {
-      this._config = config
-      this._element = element
+    if (!this._element.next().hasClass('show')) {
+      this._element.parents(Selector.DROPDOWN_MENU).first().find('.show').removeClass('show').hide()
     }
 
-    // Public
+    this._element.parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', () => {
+      $('.dropdown-submenu .show').removeClass('show').hide()
+    })
+  }
 
-    toggleSubmenu() {
-      this._element.siblings().show().toggleClass('show')
+  fixPosition() {
+    const elm = $(Selector.DROPDOWN_MENU_ACTIVE)
 
-      if (!this._element.next().hasClass('show')) {
-        this._element.parents(Selector.DROPDOWN_MENU).first().find('.show').removeClass('show').hide()
+    if (elm.length !== 0) {
+      if (elm.hasClass(ClassName.DROPDOWN_RIGHT)) {
+        elm.css('left', 'inherit')
+        elm.css('right', 0)
+      } else {
+        elm.css('left', 0)
+        elm.css('right', 'inherit')
       }
 
-      this._element.parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', () => {
-        $('.dropdown-submenu .show').removeClass('show').hide()
-      })
-    }
-
-    fixPosition() {
-      const elm = $(Selector.DROPDOWN_MENU_ACTIVE)
-
-      if (elm.length !== 0) {
-        if (elm.hasClass(ClassName.DROPDOWN_RIGHT)) {
-          elm.css('left', 'inherit')
-          elm.css('right', 0)
-        } else {
-          elm.css('left', 0)
-          elm.css('right', 'inherit')
-        }
-
-        const offset = elm.offset()
-        const width = elm.width()
-        const windowWidth = $(window).width()
-        const visiblePart = windowWidth - offset.left
-
-        if (offset.left < 0) {
-          elm.css('left', 'inherit')
-          elm.css('right', (offset.left - 5))
-        } else if (visiblePart < width) {
-          elm.css('left', 'inherit')
-          elm.css('right', 0)
-        }
+      const offset = elm.offset()
+      const width = elm.width()
+      const windowWidth = $(window).width()
+      const visiblePart = windowWidth - offset.left
+
+      if (offset.left < 0) {
+        elm.css('left', 'inherit')
+        elm.css('right', (offset.left - 5))
+      } else if (visiblePart < width) {
+        elm.css('left', 'inherit')
+        elm.css('right', 0)
       }
     }
+  }
 
-    // Static
+  // Static
 
-    static _jQueryInterface(config) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _config = $.extend({}, Default, $(this).data())
+  static _jQueryInterface(config) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _config = $.extend({}, Default, $(this).data())
 
-        if (!data) {
-          data = new Dropdown($(this), _config)
-          $(this).data(DATA_KEY, data)
-        }
+      if (!data) {
+        data = new Dropdown($(this), _config)
+        $(this).data(DATA_KEY, data)
+      }
 
-        if (config === 'toggleSubmenu' || config === 'fixPosition') {
-          data[config]()
-        }
-      })
-    }
+      if (config === 'toggleSubmenu' || config === 'fixPosition') {
+        data[config]()
+      }
+    })
   }
+}
 
-  /**
-   * Data API
-   * ====================================================
-   */
-
-  $(Selector.DROPDOWN_MENU + ' ' + Selector.DROPDOWN_TOGGLE).on('click', function (event) {
-    event.preventDefault()
-    event.stopPropagation()
+/**
+ * Data API
+ * ====================================================
+ */
 
-    Dropdown._jQueryInterface.call($(this), 'toggleSubmenu')
-  })
+$(Selector.DROPDOWN_MENU + ' ' + Selector.DROPDOWN_TOGGLE).on('click', function (event) {
+  event.preventDefault()
+  event.stopPropagation()
 
-  $(Selector.NAVBAR + ' ' + Selector.DROPDOWN_TOGGLE).on('click', event => {
-    event.preventDefault()
+  Dropdown._jQueryInterface.call($(this), 'toggleSubmenu')
+})
 
-    setTimeout(function () {
-      Dropdown._jQueryInterface.call($(this), 'fixPosition')
-    }, 1)
-  })
+$(Selector.NAVBAR + ' ' + Selector.DROPDOWN_TOGGLE).on('click', event => {
+  event.preventDefault()
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
+  setTimeout(function () {
+    Dropdown._jQueryInterface.call($(this), 'fixPosition')
+  }, 1)
+})
 
-  $.fn[NAME] = Dropdown._jQueryInterface
-  $.fn[NAME].Constructor = Dropdown
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return Dropdown._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return Dropdown
-})(jQuery)
+$.fn[NAME] = Dropdown._jQueryInterface
+$.fn[NAME].Constructor = Dropdown
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return Dropdown._jQueryInterface
+}
 
 export default Dropdown

+ 184 - 186
build/js/Layout.js

@@ -5,233 +5,231 @@
  * --------------------------------------------
  */
 
-const Layout = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'Layout'
-  const DATA_KEY = 'lte.layout'
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Selector = {
-    HEADER: '.main-header',
-    MAIN_SIDEBAR: '.main-sidebar',
-    SIDEBAR: '.main-sidebar .sidebar',
-    CONTENT: '.content-wrapper',
-    CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
-    CONTROL_SIDEBAR_BTN: '[data-widget="control-sidebar"]',
-    FOOTER: '.main-footer',
-    PUSHMENU_BTN: '[data-widget="pushmenu"]',
-    LOGIN_BOX: '.login-box',
-    REGISTER_BOX: '.register-box'
-  }
+import $ from 'jquery'
 
-  const ClassName = {
-    SIDEBAR_FOCUSED: 'sidebar-focused',
-    LAYOUT_FIXED: 'layout-fixed',
-    CONTROL_SIDEBAR_SLIDE_OPEN: 'control-sidebar-slide-open',
-    CONTROL_SIDEBAR_OPEN: 'control-sidebar-open'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
+
+const NAME = 'Layout'
+const DATA_KEY = 'lte.layout'
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Selector = {
+  HEADER: '.main-header',
+  MAIN_SIDEBAR: '.main-sidebar',
+  SIDEBAR: '.main-sidebar .sidebar',
+  CONTENT: '.content-wrapper',
+  CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
+  CONTROL_SIDEBAR_BTN: '[data-widget="control-sidebar"]',
+  FOOTER: '.main-footer',
+  PUSHMENU_BTN: '[data-widget="pushmenu"]',
+  LOGIN_BOX: '.login-box',
+  REGISTER_BOX: '.register-box'
+}
+
+const ClassName = {
+  SIDEBAR_FOCUSED: 'sidebar-focused',
+  LAYOUT_FIXED: 'layout-fixed',
+  CONTROL_SIDEBAR_SLIDE_OPEN: 'control-sidebar-slide-open',
+  CONTROL_SIDEBAR_OPEN: 'control-sidebar-open'
+}
+
+const Default = {
+  scrollbarTheme: 'os-theme-light',
+  scrollbarAutoHide: 'l',
+  panelAutoHeight: true,
+  loginRegisterAutoHeight: true
+}
+
+/**
+ * Class Definition
+ * ====================================================
+ */
+
+class Layout {
+  constructor(element, config) {
+    this._config = config
+    this._element = element
 
-  const Default = {
-    scrollbarTheme: 'os-theme-light',
-    scrollbarAutoHide: 'l',
-    panelAutoHeight: true,
-    loginRegisterAutoHeight: true
+    this._init()
   }
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+  // Public
 
-  class Layout {
-    constructor(element, config) {
-      this._config = config
-      this._element = element
+  fixLayoutHeight(extra = null) {
+    let controlSidebar = 0
 
-      this._init()
+    if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || extra === 'control_sidebar') {
+      controlSidebar = $(Selector.CONTROL_SIDEBAR_CONTENT).height()
     }
 
-    // Public
+    const heights = {
+      window: $(window).height(),
+      header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
+      footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
+      sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
+      controlSidebar
+    }
+
+    const max = this._max(heights)
+    let offset = this._config.panelAutoHeight
 
-    fixLayoutHeight(extra = null) {
-      let controlSidebar = 0
+    if (offset === true) {
+      offset = 0
+    }
 
-      if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || extra === 'control_sidebar') {
-        controlSidebar = $(Selector.CONTROL_SIDEBAR_CONTENT).height()
+    if (offset !== false) {
+      if (max === heights.controlSidebar) {
+        $(Selector.CONTENT).css('min-height', (max + offset))
+      } else if (max === heights.window) {
+        $(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
+      } else {
+        $(Selector.CONTENT).css('min-height', (max + offset) - heights.header)
       }
 
-      const heights = {
-        window: $(window).height(),
-        header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
-        footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
-        sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
-        controlSidebar
+      if (this._isFooterFixed()) {
+        $(Selector.CONTENT).css('min-height', parseFloat($(Selector.CONTENT).css('min-height')) + heights.footer)
       }
+    }
 
-      const max = this._max(heights)
-      let offset = this._config.panelAutoHeight
+    if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
+      return
+    }
 
-      if (offset === true) {
-        offset = 0
-      }
+    if (offset !== false) {
+      $(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
+    }
 
-      if (offset !== false) {
-        if (max === heights.controlSidebar) {
-          $(Selector.CONTENT).css('min-height', (max + offset))
-        } else if (max === heights.window) {
-          $(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
-        } else {
-          $(Selector.CONTENT).css('min-height', (max + offset) - heights.header)
+    if (typeof $.fn.overlayScrollbars !== 'undefined') {
+      $(Selector.SIDEBAR).overlayScrollbars({
+        className: this._config.scrollbarTheme,
+        sizeAutoCapable: true,
+        scrollbars: {
+          autoHide: this._config.scrollbarAutoHide,
+          clickScrolling: true
         }
+      })
+    }
+  }
 
-        if (this._isFooterFixed()) {
-          $(Selector.CONTENT).css('min-height', parseFloat($(Selector.CONTENT).css('min-height')) + heights.footer)
-        }
-      }
+  fixLoginRegisterHeight() {
+    if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length === 0) {
+      $('body, html').css('height', 'auto')
+    } else {
+      const boxHeight = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height()
 
-      if (!$('body').hasClass(ClassName.LAYOUT_FIXED)) {
-        return
+      if ($('body').css('min-height') !== boxHeight) {
+        $('body').css('min-height', boxHeight)
       }
+    }
+  }
 
-      if (offset !== false) {
-        $(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
-      }
+  // Private
 
-      if (typeof $.fn.overlayScrollbars !== 'undefined') {
-        $(Selector.SIDEBAR).overlayScrollbars({
-          className: this._config.scrollbarTheme,
-          sizeAutoCapable: true,
-          scrollbars: {
-            autoHide: this._config.scrollbarAutoHide,
-            clickScrolling: true
-          }
-        })
-      }
+  _init() {
+    // Activate layout height watcher
+    this.fixLayoutHeight()
+
+    if (this._config.loginRegisterAutoHeight === true) {
+      this.fixLoginRegisterHeight()
+    } else if (this._config.loginRegisterAutoHeight === parseInt(this._config.loginRegisterAutoHeight, 10)) {
+      setInterval(this.fixLoginRegisterHeight, this._config.loginRegisterAutoHeight)
     }
 
-    fixLoginRegisterHeight() {
-      if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length === 0) {
-        $('body, html').css('height', 'auto')
-      } else {
-        const boxHeight = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height()
+    $(Selector.SIDEBAR)
+      .on('collapsed.lte.treeview expanded.lte.treeview', () => {
+        this.fixLayoutHeight()
+      })
 
-        if ($('body').css('min-height') !== boxHeight) {
-          $('body').css('min-height', boxHeight)
-        }
-      }
-    }
+    $(Selector.PUSHMENU_BTN)
+      .on('collapsed.lte.pushmenu shown.lte.pushmenu', () => {
+        this.fixLayoutHeight()
+      })
 
-    // Private
+    $(Selector.CONTROL_SIDEBAR_BTN)
+      .on('collapsed.lte.controlsidebar', () => {
+        this.fixLayoutHeight()
+      })
+      .on('expanded.lte.controlsidebar', () => {
+        this.fixLayoutHeight('control_sidebar')
+      })
 
-    _init() {
-      // Activate layout height watcher
+    $(window).resize(() => {
       this.fixLayoutHeight()
+    })
+
+    setTimeout(() => {
+      $('body.hold-transition').removeClass('hold-transition')
+    }, 50)
+  }
+
+  _max(numbers) {
+    // Calculate the maximum number in a list
+    let max = 0
 
-      if (this._config.loginRegisterAutoHeight === true) {
-        this.fixLoginRegisterHeight()
-      } else if (this._config.loginRegisterAutoHeight === parseInt(this._config.loginRegisterAutoHeight, 10)) {
-        setInterval(this.fixLoginRegisterHeight, this._config.loginRegisterAutoHeight)
+    Object.keys(numbers).forEach(key => {
+      if (numbers[key] > max) {
+        max = numbers[key]
       }
+    })
 
-      $(Selector.SIDEBAR)
-        .on('collapsed.lte.treeview expanded.lte.treeview', () => {
-          this.fixLayoutHeight()
-        })
-
-      $(Selector.PUSHMENU_BTN)
-        .on('collapsed.lte.pushmenu shown.lte.pushmenu', () => {
-          this.fixLayoutHeight()
-        })
-
-      $(Selector.CONTROL_SIDEBAR_BTN)
-        .on('collapsed.lte.controlsidebar', () => {
-          this.fixLayoutHeight()
-        })
-        .on('expanded.lte.controlsidebar', () => {
-          this.fixLayoutHeight('control_sidebar')
-        })
-
-      $(window).resize(() => {
-        this.fixLayoutHeight()
-      })
+    return max
+  }
 
-      setTimeout(() => {
-        $('body.hold-transition').removeClass('hold-transition')
-      }, 50)
-    }
+  _isFooterFixed() {
+    return $('.main-footer').css('position') === 'fixed'
+  }
 
-    _max(numbers) {
-      // Calculate the maximum number in a list
-      let max = 0
+  // Static
 
-      Object.keys(numbers).forEach(key => {
-        if (numbers[key] > max) {
-          max = numbers[key]
-        }
-      })
+  static _jQueryInterface(config = '') {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _options = $.extend({}, Default, $(this).data())
 
-      return max
-    }
+      if (!data) {
+        data = new Layout($(this), _options)
+        $(this).data(DATA_KEY, data)
+      }
 
-    _isFooterFixed() {
-      return $('.main-footer').css('position') === 'fixed'
-    }
+      if (config === 'init' || config === '') {
+        data._init()
+      } else if (config === 'fixLayoutHeight' || config === 'fixLoginRegisterHeight') {
+        data[config]()
+      }
+    })
+  }
+}
 
-    // Static
+/**
+ * Data API
+ * ====================================================
+ */
 
-    static _jQueryInterface(config = '') {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _options = $.extend({}, Default, $(this).data())
+$(window).on('load', () => {
+  Layout._jQueryInterface.call($('body'))
+})
 
-        if (!data) {
-          data = new Layout($(this), _options)
-          $(this).data(DATA_KEY, data)
-        }
+$(Selector.SIDEBAR + ' a').on('focusin', () => {
+  $(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED)
+})
 
-        if (config === 'init' || config === '') {
-          data._init()
-        } else if (config === 'fixLayoutHeight' || config === 'fixLoginRegisterHeight') {
-          data[config]()
-        }
-      })
-    }
-  }
+$(Selector.SIDEBAR + ' a').on('focusout', () => {
+  $(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED)
+})
 
-  /**
-   * Data API
-   * ====================================================
-   */
-
-  $(window).on('load', () => {
-    Layout._jQueryInterface.call($('body'))
-  })
-
-  $(Selector.SIDEBAR + ' a').on('focusin', () => {
-    $(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED)
-  })
-
-  $(Selector.SIDEBAR + ' a').on('focusout', () => {
-    $(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED)
-  })
-
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = Layout._jQueryInterface
-  $.fn[NAME].Constructor = Layout
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return Layout._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return Layout
-})(jQuery)
+$.fn[NAME] = Layout._jQueryInterface
+$.fn[NAME].Constructor = Layout
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return Layout._jQueryInterface
+}
 
 export default Layout

+ 160 - 162
build/js/PushMenu.js

@@ -5,219 +5,217 @@
  * --------------------------------------------
  */
 
-const PushMenu = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'PushMenu'
-  const DATA_KEY = 'lte.pushmenu'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    COLLAPSED: `collapsed${EVENT_KEY}`,
-    SHOWN: `shown${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const Default = {
-    autoCollapseSize: 992,
-    enableRemember: false,
-    noTransitionAfterReload: true
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const Selector = {
-    TOGGLE_BUTTON: '[data-widget="pushmenu"]',
-    BODY: 'body',
-    OVERLAY: '#sidebar-overlay',
-    WRAPPER: '.wrapper'
-  }
+const NAME = 'PushMenu'
+const DATA_KEY = 'lte.pushmenu'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  COLLAPSED: `collapsed${EVENT_KEY}`,
+  SHOWN: `shown${EVENT_KEY}`
+}
+
+const Default = {
+  autoCollapseSize: 992,
+  enableRemember: false,
+  noTransitionAfterReload: true
+}
+
+const Selector = {
+  TOGGLE_BUTTON: '[data-widget="pushmenu"]',
+  BODY: 'body',
+  OVERLAY: '#sidebar-overlay',
+  WRAPPER: '.wrapper'
+}
+
+const ClassName = {
+  COLLAPSED: 'sidebar-collapse',
+  OPEN: 'sidebar-open',
+  CLOSED: 'sidebar-closed'
+}
 
-  const ClassName = {
-    COLLAPSED: 'sidebar-collapse',
-    OPEN: 'sidebar-open',
-    CLOSED: 'sidebar-closed'
-  }
+/**
+ * Class Definition
+ * ====================================================
+ */
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+class PushMenu {
+  constructor(element, options) {
+    this._element = element
+    this._options = $.extend({}, Default, options)
 
-  class PushMenu {
-    constructor(element, options) {
-      this._element = element
-      this._options = $.extend({}, Default, options)
+    if ($(Selector.OVERLAY).length === 0) {
+      this._addOverlay()
+    }
 
-      if ($(Selector.OVERLAY).length === 0) {
-        this._addOverlay()
-      }
+    this._init()
+  }
+
+  // Public
 
-      this._init()
+  expand() {
+    if (this._options.autoCollapseSize) {
+      if ($(window).width() <= this._options.autoCollapseSize) {
+        $(Selector.BODY).addClass(ClassName.OPEN)
+      }
     }
 
-    // Public
+    $(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED)
 
-    expand() {
-      if (this._options.autoCollapseSize) {
-        if ($(window).width() <= this._options.autoCollapseSize) {
-          $(Selector.BODY).addClass(ClassName.OPEN)
-        }
-      }
+    if (this._options.enableRemember) {
+      localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
+    }
 
-      $(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED)
+    $(this._element).trigger($.Event(Event.SHOWN))
+  }
 
-      if (this._options.enableRemember) {
-        localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
+  collapse() {
+    if (this._options.autoCollapseSize) {
+      if ($(window).width() <= this._options.autoCollapseSize) {
+        $(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.CLOSED)
       }
-
-      $(this._element).trigger($.Event(Event.SHOWN))
     }
 
-    collapse() {
-      if (this._options.autoCollapseSize) {
-        if ($(window).width() <= this._options.autoCollapseSize) {
-          $(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.CLOSED)
-        }
-      }
+    $(Selector.BODY).addClass(ClassName.COLLAPSED)
 
-      $(Selector.BODY).addClass(ClassName.COLLAPSED)
+    if (this._options.enableRemember) {
+      localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
+    }
 
-      if (this._options.enableRemember) {
-        localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
-      }
+    $(this._element).trigger($.Event(Event.COLLAPSED))
+  }
 
-      $(this._element).trigger($.Event(Event.COLLAPSED))
+  toggle() {
+    if ($(Selector.BODY).hasClass(ClassName.COLLAPSED)) {
+      this.expand()
+    } else {
+      this.collapse()
     }
+  }
 
-    toggle() {
-      if ($(Selector.BODY).hasClass(ClassName.COLLAPSED)) {
-        this.expand()
-      } else {
-        this.collapse()
-      }
+  autoCollapse(resize = false) {
+    if (!this._options.autoCollapseSize) {
+      return
     }
 
-    autoCollapse(resize = false) {
-      if (!this._options.autoCollapseSize) {
-        return
+    if ($(window).width() <= this._options.autoCollapseSize) {
+      if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
+        this.collapse()
       }
-
-      if ($(window).width() <= this._options.autoCollapseSize) {
-        if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
-          this.collapse()
-        }
-      } else if (resize === true) {
-        if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
-          $(Selector.BODY).removeClass(ClassName.OPEN)
-        } else if ($(Selector.BODY).hasClass(ClassName.CLOSED)) {
-          this.expand()
-        }
+    } else if (resize === true) {
+      if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
+        $(Selector.BODY).removeClass(ClassName.OPEN)
+      } else if ($(Selector.BODY).hasClass(ClassName.CLOSED)) {
+        this.expand()
       }
     }
+  }
 
-    remember() {
-      if (!this._options.enableRemember) {
-        return
-      }
+  remember() {
+    if (!this._options.enableRemember) {
+      return
+    }
 
-      const toggleState = localStorage.getItem(`remember${EVENT_KEY}`)
-      if (toggleState === ClassName.COLLAPSED) {
-        if (this._options.noTransitionAfterReload) {
-          $('body').addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function () {
-            $(this).removeClass('hold-transition')
-            $(this).dequeue()
-          })
-        } else {
-          $('body').addClass(ClassName.COLLAPSED)
-        }
-      } else if (this._options.noTransitionAfterReload) {
-        $('body').addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function () {
+    const toggleState = localStorage.getItem(`remember${EVENT_KEY}`)
+    if (toggleState === ClassName.COLLAPSED) {
+      if (this._options.noTransitionAfterReload) {
+        $('body').addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function () {
           $(this).removeClass('hold-transition')
           $(this).dequeue()
         })
       } else {
-        $('body').removeClass(ClassName.COLLAPSED)
+        $('body').addClass(ClassName.COLLAPSED)
       }
+    } else if (this._options.noTransitionAfterReload) {
+      $('body').addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function () {
+        $(this).removeClass('hold-transition')
+        $(this).dequeue()
+      })
+    } else {
+      $('body').removeClass(ClassName.COLLAPSED)
     }
+  }
 
-    // Private
+  // Private
 
-    _init() {
-      this.remember()
-      this.autoCollapse()
+  _init() {
+    this.remember()
+    this.autoCollapse()
 
-      $(window).resize(() => {
-        this.autoCollapse(true)
-      })
-    }
+    $(window).resize(() => {
+      this.autoCollapse(true)
+    })
+  }
 
-    _addOverlay() {
-      const overlay = $('<div />', {
-        id: 'sidebar-overlay'
-      })
+  _addOverlay() {
+    const overlay = $('<div />', {
+      id: 'sidebar-overlay'
+    })
 
-      overlay.on('click', () => {
-        this.collapse()
-      })
+    overlay.on('click', () => {
+      this.collapse()
+    })
 
-      $(Selector.WRAPPER).append(overlay)
-    }
+    $(Selector.WRAPPER).append(overlay)
+  }
 
-    // Static
+  // Static
 
-    static _jQueryInterface(operation) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _options = $.extend({}, Default, $(this).data())
+  static _jQueryInterface(operation) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _options = $.extend({}, Default, $(this).data())
 
-        if (!data) {
-          data = new PushMenu(this, _options)
-          $(this).data(DATA_KEY, data)
-        }
+      if (!data) {
+        data = new PushMenu(this, _options)
+        $(this).data(DATA_KEY, data)
+      }
 
-        if (typeof operation === 'string' && operation.match(/collapse|expand|toggle/)) {
-          data[operation]()
-        }
-      })
-    }
+      if (typeof operation === 'string' && operation.match(/collapse|expand|toggle/)) {
+        data[operation]()
+      }
+    })
   }
+}
 
-  /**
-   * Data API
-   * ====================================================
-   */
-
-  $(document).on('click', Selector.TOGGLE_BUTTON, event => {
-    event.preventDefault()
+/**
+ * Data API
+ * ====================================================
+ */
 
-    let button = event.currentTarget
+$(document).on('click', Selector.TOGGLE_BUTTON, event => {
+  event.preventDefault()
 
-    if ($(button).data('widget') !== 'pushmenu') {
-      button = $(button).closest(Selector.TOGGLE_BUTTON)
-    }
+  let button = event.currentTarget
 
-    PushMenu._jQueryInterface.call($(button), 'toggle')
-  })
+  if ($(button).data('widget') !== 'pushmenu') {
+    button = $(button).closest(Selector.TOGGLE_BUTTON)
+  }
 
-  $(window).on('load', () => {
-    PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON))
-  })
+  PushMenu._jQueryInterface.call($(button), 'toggle')
+})
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
+$(window).on('load', () => {
+  PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON))
+})
 
-  $.fn[NAME] = PushMenu._jQueryInterface
-  $.fn[NAME].Constructor = PushMenu
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return PushMenu._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return PushMenu
-})(jQuery)
+$.fn[NAME] = PushMenu._jQueryInterface
+$.fn[NAME].Constructor = PushMenu
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return PushMenu._jQueryInterface
+}
 
 export default PushMenu

+ 90 - 92
build/js/SiteSearch.js

@@ -5,119 +5,117 @@
  * --------------------------------------------
  */
 
-const SiteSearch = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'SiteSearch'
-  const DATA_KEY = 'lte.site-search'
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Selector = {
-    TOGGLE_BUTTON: '[data-widget="site-search"]',
-    SEARCH_BLOCK: '.site-search-block',
-    SEARCH_BACKDROP: '.site-search-backdrop',
-    SEARCH_INPUT: '.site-search-block .form-control'
-  }
-
-  const ClassName = {
-    OPEN: 'site-search-open'
-  }
+import $ from 'jquery'
 
-  const Default = {
-    transitionSpeed: 300
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+const NAME = 'SiteSearch'
+const DATA_KEY = 'lte.site-search'
+const JQUERY_NO_CONFLICT = $.fn[NAME]
 
-  class SiteSearch {
-    constructor(_element, _options) {
-      this.element = _element
-      this.options = $.extend({}, Default, _options)
-    }
+const Selector = {
+  TOGGLE_BUTTON: '[data-widget="site-search"]',
+  SEARCH_BLOCK: '.site-search-block',
+  SEARCH_BACKDROP: '.site-search-backdrop',
+  SEARCH_INPUT: '.site-search-block .form-control'
+}
 
-    // Public
+const ClassName = {
+  OPEN: 'site-search-open'
+}
 
-    open() {
-      $(Selector.SEARCH_BLOCK).slideDown(this.options.transitionSpeed)
-      $(Selector.SEARCH_BACKDROP).show(0)
-      $(Selector.SEARCH_INPUT).focus()
-      $(Selector.SEARCH_BLOCK).addClass(ClassName.OPEN)
-    }
+const Default = {
+  transitionSpeed: 300
+}
 
-    close() {
-      $(Selector.SEARCH_BLOCK).slideUp(this.options.transitionSpeed)
-      $(Selector.SEARCH_BACKDROP).hide(0)
-      $(Selector.SEARCH_BLOCK).removeClass(ClassName.OPEN)
-    }
-
-    toggle() {
-      if ($(Selector.SEARCH_BLOCK).hasClass(ClassName.OPEN)) {
-        this.close()
-      } else {
-        this.open()
-      }
-    }
+/**
+ * Class Definition
+ * ====================================================
+ */
 
-    // Static
+class SiteSearch {
+  constructor(_element, _options) {
+    this.element = _element
+    this.options = $.extend({}, Default, _options)
+  }
 
-    static _jQueryInterface(options) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
+  // Public
 
-        if (!data) {
-          data = new SiteSearch(this, options)
-          $(this).data(DATA_KEY, data)
-        }
+  open() {
+    $(Selector.SEARCH_BLOCK).slideDown(this.options.transitionSpeed)
+    $(Selector.SEARCH_BACKDROP).show(0)
+    $(Selector.SEARCH_INPUT).focus()
+    $(Selector.SEARCH_BLOCK).addClass(ClassName.OPEN)
+  }
 
-        if (!/toggle|close/.test(options)) {
-          throw new Error(`Undefined method ${options}`)
-        }
+  close() {
+    $(Selector.SEARCH_BLOCK).slideUp(this.options.transitionSpeed)
+    $(Selector.SEARCH_BACKDROP).hide(0)
+    $(Selector.SEARCH_BLOCK).removeClass(ClassName.OPEN)
+  }
 
-        data[options]()
-      })
+  toggle() {
+    if ($(Selector.SEARCH_BLOCK).hasClass(ClassName.OPEN)) {
+      this.close()
+    } else {
+      this.open()
     }
   }
 
-  /**
-   * Data API
-   * ====================================================
-   */
-  $(document).on('click', Selector.TOGGLE_BUTTON, event => {
-    event.preventDefault()
+  // Static
 
-    let button = $(event.currentTarget)
+  static _jQueryInterface(options) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
 
-    if (button.data('widget') !== 'site-search') {
-      button = button.closest(Selector.TOGGLE_BUTTON)
-    }
+      if (!data) {
+        data = new SiteSearch(this, options)
+        $(this).data(DATA_KEY, data)
+      }
 
-    SiteSearch._jQueryInterface.call(button, 'toggle')
-  })
+      if (!/toggle|close/.test(options)) {
+        throw new Error(`Undefined method ${options}`)
+      }
+
+      data[options]()
+    })
+  }
+}
 
-  $(document).on('click', Selector.SEARCH_BACKDROP, event => {
-    const backdrop = $(event.currentTarget)
-    SiteSearch._jQueryInterface.call(backdrop, 'close')
-  })
+/**
+ * Data API
+ * ====================================================
+ */
+$(document).on('click', Selector.TOGGLE_BUTTON, event => {
+  event.preventDefault()
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
+  let button = $(event.currentTarget)
 
-  $.fn[NAME] = SiteSearch._jQueryInterface
-  $.fn[NAME].Constructor = SiteSearch
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return SiteSearch._jQueryInterface
+  if (button.data('widget') !== 'site-search') {
+    button = button.closest(Selector.TOGGLE_BUTTON)
   }
 
-  return SiteSearch
-})(jQuery)
+  SiteSearch._jQueryInterface.call(button, 'toggle')
+})
+
+$(document).on('click', Selector.SEARCH_BACKDROP, event => {
+  const backdrop = $(event.currentTarget)
+  SiteSearch._jQueryInterface.call(backdrop, 'close')
+})
+
+/**
+ * jQuery API
+ * ====================================================
+ */
+
+$.fn[NAME] = SiteSearch._jQueryInterface
+$.fn[NAME].Constructor = SiteSearch
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return SiteSearch._jQueryInterface
+}
 
 export default SiteSearch

+ 161 - 163
build/js/Toasts.js

@@ -5,214 +5,212 @@
  * --------------------------------------------
  */
 
-const Toasts = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'Toasts'
-  const DATA_KEY = 'lte.toasts'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    INIT: `init${EVENT_KEY}`,
-    CREATED: `created${EVENT_KEY}`,
-    REMOVED: `removed${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const Selector = {
-    CONTAINER_TOP_RIGHT: '#toastsContainerTopRight',
-    CONTAINER_TOP_LEFT: '#toastsContainerTopLeft',
-    CONTAINER_BOTTOM_RIGHT: '#toastsContainerBottomRight',
-    CONTAINER_BOTTOM_LEFT: '#toastsContainerBottomLeft'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const ClassName = {
-    TOP_RIGHT: 'toasts-top-right',
-    TOP_LEFT: 'toasts-top-left',
-    BOTTOM_RIGHT: 'toasts-bottom-right',
-    BOTTOM_LEFT: 'toasts-bottom-left'
-  }
+const NAME = 'Toasts'
+const DATA_KEY = 'lte.toasts'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  INIT: `init${EVENT_KEY}`,
+  CREATED: `created${EVENT_KEY}`,
+  REMOVED: `removed${EVENT_KEY}`
+}
+
+const Selector = {
+  CONTAINER_TOP_RIGHT: '#toastsContainerTopRight',
+  CONTAINER_TOP_LEFT: '#toastsContainerTopLeft',
+  CONTAINER_BOTTOM_RIGHT: '#toastsContainerBottomRight',
+  CONTAINER_BOTTOM_LEFT: '#toastsContainerBottomLeft'
+}
+
+const ClassName = {
+  TOP_RIGHT: 'toasts-top-right',
+  TOP_LEFT: 'toasts-top-left',
+  BOTTOM_RIGHT: 'toasts-bottom-right',
+  BOTTOM_LEFT: 'toasts-bottom-left'
+}
+
+const Position = {
+  TOP_RIGHT: 'topRight',
+  TOP_LEFT: 'topLeft',
+  BOTTOM_RIGHT: 'bottomRight',
+  BOTTOM_LEFT: 'bottomLeft'
+}
+
+const Default = {
+  position: Position.TOP_RIGHT,
+  fixed: true,
+  autohide: false,
+  autoremove: true,
+  delay: 1000,
+  fade: true,
+  icon: null,
+  image: null,
+  imageAlt: null,
+  imageHeight: '25px',
+  title: null,
+  subtitle: null,
+  close: true,
+  body: null,
+  class: null
+}
 
-  const Position = {
-    TOP_RIGHT: 'topRight',
-    TOP_LEFT: 'topLeft',
-    BOTTOM_RIGHT: 'bottomRight',
-    BOTTOM_LEFT: 'bottomLeft'
-  }
+/**
+ * Class Definition
+ * ====================================================
+ */
+class Toasts {
+  constructor(element, config) {
+    this._config = config
+    this._prepareContainer()
 
-  const Default = {
-    position: Position.TOP_RIGHT,
-    fixed: true,
-    autohide: false,
-    autoremove: true,
-    delay: 1000,
-    fade: true,
-    icon: null,
-    image: null,
-    imageAlt: null,
-    imageHeight: '25px',
-    title: null,
-    subtitle: null,
-    close: true,
-    body: null,
-    class: null
+    $('body').trigger($.Event(Event.INIT))
   }
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
-  class Toasts {
-    constructor(element, config) {
-      this._config = config
-      this._prepareContainer()
+  // Public
+
+  create() {
+    const toast = $('<div class="toast" role="alert" aria-live="assertive" aria-atomic="true"/>')
 
-      $('body').trigger($.Event(Event.INIT))
+    toast.data('autohide', this._config.autohide)
+    toast.data('animation', this._config.fade)
+
+    if (this._config.class) {
+      toast.addClass(this._config.class)
     }
 
-    // Public
+    if (this._config.delay && this._config.delay != 500) {
+      toast.data('delay', this._config.delay)
+    }
 
-    create() {
-      const toast = $('<div class="toast" role="alert" aria-live="assertive" aria-atomic="true"/>')
+    const toastHeader = $('<div class="toast-header">')
 
-      toast.data('autohide', this._config.autohide)
-      toast.data('animation', this._config.fade)
+    if (this._config.image != null) {
+      const toastImage = $('<img />').addClass('rounded mr-2').attr('src', this._config.image).attr('alt', this._config.imageAlt)
 
-      if (this._config.class) {
-        toast.addClass(this._config.class)
+      if (this._config.imageHeight != null) {
+        toastImage.height(this._config.imageHeight).width('auto')
       }
 
-      if (this._config.delay && this._config.delay != 500) {
-        toast.data('delay', this._config.delay)
-      }
+      toastHeader.append(toastImage)
+    }
 
-      const toastHeader = $('<div class="toast-header">')
+    if (this._config.icon != null) {
+      toastHeader.append($('<i />').addClass('mr-2').addClass(this._config.icon))
+    }
 
-      if (this._config.image != null) {
-        const toastImage = $('<img />').addClass('rounded mr-2').attr('src', this._config.image).attr('alt', this._config.imageAlt)
+    if (this._config.title != null) {
+      toastHeader.append($('<strong />').addClass('mr-auto').html(this._config.title))
+    }
 
-        if (this._config.imageHeight != null) {
-          toastImage.height(this._config.imageHeight).width('auto')
-        }
+    if (this._config.subtitle != null) {
+      toastHeader.append($('<small />').html(this._config.subtitle))
+    }
 
-        toastHeader.append(toastImage)
-      }
+    if (this._config.close == true) {
+      const toastClose = $('<button data-dismiss="toast" />').attr('type', 'button').addClass('ml-2 mb-1 close').attr('aria-label', 'Close').append('<span aria-hidden="true">&times;</span>')
 
-      if (this._config.icon != null) {
-        toastHeader.append($('<i />').addClass('mr-2').addClass(this._config.icon))
+      if (this._config.title == null) {
+        toastClose.toggleClass('ml-2 ml-auto')
       }
 
-      if (this._config.title != null) {
-        toastHeader.append($('<strong />').addClass('mr-auto').html(this._config.title))
-      }
+      toastHeader.append(toastClose)
+    }
 
-      if (this._config.subtitle != null) {
-        toastHeader.append($('<small />').html(this._config.subtitle))
-      }
+    toast.append(toastHeader)
 
-      if (this._config.close == true) {
-        const toastClose = $('<button data-dismiss="toast" />').attr('type', 'button').addClass('ml-2 mb-1 close').attr('aria-label', 'Close').append('<span aria-hidden="true">&times;</span>')
+    if (this._config.body != null) {
+      toast.append($('<div class="toast-body" />').html(this._config.body))
+    }
 
-        if (this._config.title == null) {
-          toastClose.toggleClass('ml-2 ml-auto')
-        }
+    $(this._getContainerId()).prepend(toast)
 
-        toastHeader.append(toastClose)
-      }
+    $('body').trigger($.Event(Event.CREATED))
 
-      toast.append(toastHeader)
+    toast.toast('show')
 
-      if (this._config.body != null) {
-        toast.append($('<div class="toast-body" />').html(this._config.body))
-      }
+    if (this._config.autoremove) {
+      toast.on('hidden.bs.toast', function () {
+        $(this).delay(200).remove()
+        $('body').trigger($.Event(Event.REMOVED))
+      })
+    }
+  }
 
-      $(this._getContainerId()).prepend(toast)
+  // Static
 
-      $('body').trigger($.Event(Event.CREATED))
+  _getContainerId() {
+    if (this._config.position == Position.TOP_RIGHT) {
+      return Selector.CONTAINER_TOP_RIGHT
+    }
 
-      toast.toast('show')
+    if (this._config.position == Position.TOP_LEFT) {
+      return Selector.CONTAINER_TOP_LEFT
+    }
 
-      if (this._config.autoremove) {
-        toast.on('hidden.bs.toast', function () {
-          $(this).delay(200).remove()
-          $('body').trigger($.Event(Event.REMOVED))
-        })
-      }
+    if (this._config.position == Position.BOTTOM_RIGHT) {
+      return Selector.CONTAINER_BOTTOM_RIGHT
     }
 
-    // Static
+    if (this._config.position == Position.BOTTOM_LEFT) {
+      return Selector.CONTAINER_BOTTOM_LEFT
+    }
+  }
 
-    _getContainerId() {
+  _prepareContainer() {
+    if ($(this._getContainerId()).length === 0) {
+      const container = $('<div />').attr('id', this._getContainerId().replace('#', ''))
       if (this._config.position == Position.TOP_RIGHT) {
-        return Selector.CONTAINER_TOP_RIGHT
-      }
-
-      if (this._config.position == Position.TOP_LEFT) {
-        return Selector.CONTAINER_TOP_LEFT
+        container.addClass(ClassName.TOP_RIGHT)
+      } else if (this._config.position == Position.TOP_LEFT) {
+        container.addClass(ClassName.TOP_LEFT)
+      } else if (this._config.position == Position.BOTTOM_RIGHT) {
+        container.addClass(ClassName.BOTTOM_RIGHT)
+      } else if (this._config.position == Position.BOTTOM_LEFT) {
+        container.addClass(ClassName.BOTTOM_LEFT)
       }
 
-      if (this._config.position == Position.BOTTOM_RIGHT) {
-        return Selector.CONTAINER_BOTTOM_RIGHT
-      }
-
-      if (this._config.position == Position.BOTTOM_LEFT) {
-        return Selector.CONTAINER_BOTTOM_LEFT
-      }
+      $('body').append(container)
     }
 
-    _prepareContainer() {
-      if ($(this._getContainerId()).length === 0) {
-        const container = $('<div />').attr('id', this._getContainerId().replace('#', ''))
-        if (this._config.position == Position.TOP_RIGHT) {
-          container.addClass(ClassName.TOP_RIGHT)
-        } else if (this._config.position == Position.TOP_LEFT) {
-          container.addClass(ClassName.TOP_LEFT)
-        } else if (this._config.position == Position.BOTTOM_RIGHT) {
-          container.addClass(ClassName.BOTTOM_RIGHT)
-        } else if (this._config.position == Position.BOTTOM_LEFT) {
-          container.addClass(ClassName.BOTTOM_LEFT)
-        }
-
-        $('body').append(container)
-      }
-
-      if (this._config.fixed) {
-        $(this._getContainerId()).addClass('fixed')
-      } else {
-        $(this._getContainerId()).removeClass('fixed')
-      }
+    if (this._config.fixed) {
+      $(this._getContainerId()).addClass('fixed')
+    } else {
+      $(this._getContainerId()).removeClass('fixed')
     }
+  }
 
-    // Static
+  // Static
 
-    static _jQueryInterface(option, config) {
-      return this.each(function () {
-        const _options = $.extend({}, Default, config)
-        const toast = new Toasts($(this), _options)
+  static _jQueryInterface(option, config) {
+    return this.each(function () {
+      const _options = $.extend({}, Default, config)
+      const toast = new Toasts($(this), _options)
 
-        if (option === 'create') {
-          toast[option]()
-        }
-      })
-    }
+      if (option === 'create') {
+        toast[option]()
+      }
+    })
   }
+}
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = Toasts._jQueryInterface
-  $.fn[NAME].Constructor = Toasts
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return Toasts._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return Toasts
-})(jQuery)
+$.fn[NAME] = Toasts._jQueryInterface
+$.fn[NAME].Constructor = Toasts
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return Toasts._jQueryInterface
+}
 
 export default Toasts

+ 89 - 91
build/js/TodoList.js

@@ -5,116 +5,114 @@
  * --------------------------------------------
  */
 
-const TodoList = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'TodoList'
-  const DATA_KEY = 'lte.todolist'
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Selector = {
-    DATA_TOGGLE: '[data-widget="todo-list"]'
-  }
+import $ from 'jquery'
 
-  const ClassName = {
-    TODO_LIST_DONE: 'done'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const Default = {
-    onCheck(item) {
-      return item
-    },
-    onUnCheck(item) {
-      return item
-    }
-  }
+const NAME = 'TodoList'
+const DATA_KEY = 'lte.todolist'
+const JQUERY_NO_CONFLICT = $.fn[NAME]
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
+const Selector = {
+  DATA_TOGGLE: '[data-widget="todo-list"]'
+}
 
-  class TodoList {
-    constructor(element, config) {
-      this._config = config
-      this._element = element
+const ClassName = {
+  TODO_LIST_DONE: 'done'
+}
 
-      this._init()
-    }
+const Default = {
+  onCheck(item) {
+    return item
+  },
+  onUnCheck(item) {
+    return item
+  }
+}
 
-    // Public
+/**
+ * Class Definition
+ * ====================================================
+ */
 
-    toggle(item) {
-      item.parents('li').toggleClass(ClassName.TODO_LIST_DONE)
-      if (!$(item).prop('checked')) {
-        this.unCheck($(item))
-        return
-      }
+class TodoList {
+  constructor(element, config) {
+    this._config = config
+    this._element = element
 
-      this.check(item)
-    }
+    this._init()
+  }
 
-    check(item) {
-      this._config.onCheck.call(item)
-    }
+  // Public
 
-    unCheck(item) {
-      this._config.onUnCheck.call(item)
+  toggle(item) {
+    item.parents('li').toggleClass(ClassName.TODO_LIST_DONE)
+    if (!$(item).prop('checked')) {
+      this.unCheck($(item))
+      return
     }
 
-    // Private
-
-    _init() {
-      $(Selector.DATA_TOGGLE).find('input:checkbox:checked').parents('li').toggleClass(ClassName.TODO_LIST_DONE)
-      $(Selector.DATA_TOGGLE).on('change', 'input:checkbox', event => {
-        this.toggle($(event.target))
-      })
-    }
+    this.check(item)
+  }
 
-    // Static
+  check(item) {
+    this._config.onCheck.call(item)
+  }
 
-    static _jQueryInterface(config) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _options = $.extend({}, Default, $(this).data())
+  unCheck(item) {
+    this._config.onUnCheck.call(item)
+  }
 
-        if (!data) {
-          data = new TodoList($(this), _options)
-          $(this).data(DATA_KEY, data)
-        }
+  // Private
 
-        if (config === 'init') {
-          data[config]()
-        }
-      })
-    }
+  _init() {
+    $(Selector.DATA_TOGGLE).find('input:checkbox:checked').parents('li').toggleClass(ClassName.TODO_LIST_DONE)
+    $(Selector.DATA_TOGGLE).on('change', 'input:checkbox', event => {
+      this.toggle($(event.target))
+    })
   }
 
-  /**
-   * Data API
-   * ====================================================
-   */
-
-  $(window).on('load', () => {
-    TodoList._jQueryInterface.call($(Selector.DATA_TOGGLE))
-  })
-
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = TodoList._jQueryInterface
-  $.fn[NAME].Constructor = TodoList
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return TodoList._jQueryInterface
+  // Static
+
+  static _jQueryInterface(config) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _options = $.extend({}, Default, $(this).data())
+
+      if (!data) {
+        data = new TodoList($(this), _options)
+        $(this).data(DATA_KEY, data)
+      }
+
+      if (config === 'init') {
+        data[config]()
+      }
+    })
   }
+}
+
+/**
+ * Data API
+ * ====================================================
+ */
+
+$(window).on('load', () => {
+  TodoList._jQueryInterface.call($(Selector.DATA_TOGGLE))
+})
+
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return TodoList
-})(jQuery)
+$.fn[NAME] = TodoList._jQueryInterface
+$.fn[NAME].Constructor = TodoList
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return TodoList._jQueryInterface
+}
 
 export default TodoList

+ 135 - 137
build/js/Treeview.js

@@ -5,178 +5,176 @@
  * --------------------------------------------
  */
 
-const Treeview = ($ => {
-  /**
-   * Constants
-   * ====================================================
-   */
-
-  const NAME = 'Treeview'
-  const DATA_KEY = 'lte.treeview'
-  const EVENT_KEY = `.${DATA_KEY}`
-  const JQUERY_NO_CONFLICT = $.fn[NAME]
-
-  const Event = {
-    EXPANDED: `expanded${EVENT_KEY}`,
-    COLLAPSED: `collapsed${EVENT_KEY}`,
-    LOAD_DATA_API: `load${EVENT_KEY}`
-  }
+import $ from 'jquery'
 
-  const Selector = {
-    LI: '.nav-item',
-    LINK: '.nav-link',
-    TREEVIEW_MENU: '.nav-treeview',
-    OPEN: '.menu-open',
-    DATA_WIDGET: '[data-widget="treeview"]'
-  }
+/**
+ * Constants
+ * ====================================================
+ */
 
-  const ClassName = {
-    OPEN: 'menu-open',
-    IS_OPENING: 'menu-is-opening',
-    SIDEBAR_COLLAPSED: 'sidebar-collapse'
-  }
+const NAME = 'Treeview'
+const DATA_KEY = 'lte.treeview'
+const EVENT_KEY = `.${DATA_KEY}`
+const JQUERY_NO_CONFLICT = $.fn[NAME]
+
+const Event = {
+  EXPANDED: `expanded${EVENT_KEY}`,
+  COLLAPSED: `collapsed${EVENT_KEY}`,
+  LOAD_DATA_API: `load${EVENT_KEY}`
+}
+
+const Selector = {
+  LI: '.nav-item',
+  LINK: '.nav-link',
+  TREEVIEW_MENU: '.nav-treeview',
+  OPEN: '.menu-open',
+  DATA_WIDGET: '[data-widget="treeview"]'
+}
+
+const ClassName = {
+  OPEN: 'menu-open',
+  IS_OPENING: 'menu-is-opening',
+  SIDEBAR_COLLAPSED: 'sidebar-collapse'
+}
+
+const Default = {
+  trigger: `${Selector.DATA_WIDGET} ${Selector.LINK}`,
+  animationSpeed: 300,
+  accordion: true,
+  expandSidebar: false,
+  sidebarButtonSelector: '[data-widget="pushmenu"]'
+}
 
-  const Default = {
-    trigger: `${Selector.DATA_WIDGET} ${Selector.LINK}`,
-    animationSpeed: 300,
-    accordion: true,
-    expandSidebar: false,
-    sidebarButtonSelector: '[data-widget="pushmenu"]'
+/**
+ * Class Definition
+ * ====================================================
+ */
+class Treeview {
+  constructor(element, config) {
+    this._config = config
+    this._element = element
   }
 
-  /**
-   * Class Definition
-   * ====================================================
-   */
-  class Treeview {
-    constructor(element, config) {
-      this._config = config
-      this._element = element
-    }
-
-    // Public
+  // Public
 
-    init() {
-      $(`${Selector.LI}${Selector.OPEN} ${Selector.TREEVIEW_MENU}`).css('display', 'block')
-      this._setupListeners()
-    }
+  init() {
+    $(`${Selector.LI}${Selector.OPEN} ${Selector.TREEVIEW_MENU}`).css('display', 'block')
+    this._setupListeners()
+  }
 
-    expand(treeviewMenu, parentLi) {
-      const expandedEvent = $.Event(Event.EXPANDED)
+  expand(treeviewMenu, parentLi) {
+    const expandedEvent = $.Event(Event.EXPANDED)
 
-      if (this._config.accordion) {
-        const openMenuLi = parentLi.siblings(Selector.OPEN).first()
-        const openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first()
-        this.collapse(openTreeview, openMenuLi)
-      }
+    if (this._config.accordion) {
+      const openMenuLi = parentLi.siblings(Selector.OPEN).first()
+      const openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first()
+      this.collapse(openTreeview, openMenuLi)
+    }
 
-      parentLi.addClass(ClassName.IS_OPENING)
-      treeviewMenu.stop().slideDown(this._config.animationSpeed, () => {
-        parentLi.addClass(ClassName.OPEN)
-        $(this._element).trigger(expandedEvent)
-      })
+    parentLi.addClass(ClassName.IS_OPENING)
+    treeviewMenu.stop().slideDown(this._config.animationSpeed, () => {
+      parentLi.addClass(ClassName.OPEN)
+      $(this._element).trigger(expandedEvent)
+    })
 
-      if (this._config.expandSidebar) {
-        this._expandSidebar()
-      }
+    if (this._config.expandSidebar) {
+      this._expandSidebar()
     }
+  }
 
-    collapse(treeviewMenu, parentLi) {
-      const collapsedEvent = $.Event(Event.COLLAPSED)
+  collapse(treeviewMenu, parentLi) {
+    const collapsedEvent = $.Event(Event.COLLAPSED)
 
-      parentLi.removeClass(`${ClassName.IS_OPENING} ${ClassName.OPEN}`)
-      treeviewMenu.stop().slideUp(this._config.animationSpeed, () => {
-        $(this._element).trigger(collapsedEvent)
-        treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()
-        treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN)
-      })
-    }
+    parentLi.removeClass(`${ClassName.IS_OPENING} ${ClassName.OPEN}`)
+    treeviewMenu.stop().slideUp(this._config.animationSpeed, () => {
+      $(this._element).trigger(collapsedEvent)
+      treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()
+      treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN)
+    })
+  }
 
-    toggle(event) {
-      const $relativeTarget = $(event.currentTarget)
-      const $parent = $relativeTarget.parent()
+  toggle(event) {
+    const $relativeTarget = $(event.currentTarget)
+    const $parent = $relativeTarget.parent()
 
-      let treeviewMenu = $parent.find('> ' + Selector.TREEVIEW_MENU)
+    let treeviewMenu = $parent.find('> ' + Selector.TREEVIEW_MENU)
 
-      if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
-        if (!$parent.is(Selector.LI)) {
-          treeviewMenu = $parent.parent().find('> ' + Selector.TREEVIEW_MENU)
-        }
+    if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
+      if (!$parent.is(Selector.LI)) {
+        treeviewMenu = $parent.parent().find('> ' + Selector.TREEVIEW_MENU)
+      }
 
-        if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
-          return
-        }
+      if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
+        return
       }
+    }
 
-      event.preventDefault()
+    event.preventDefault()
 
-      const parentLi = $relativeTarget.parents(Selector.LI).first()
-      const isOpen = parentLi.hasClass(ClassName.OPEN)
+    const parentLi = $relativeTarget.parents(Selector.LI).first()
+    const isOpen = parentLi.hasClass(ClassName.OPEN)
 
-      if (isOpen) {
-        this.collapse($(treeviewMenu), parentLi)
-      } else {
-        this.expand($(treeviewMenu), parentLi)
-      }
+    if (isOpen) {
+      this.collapse($(treeviewMenu), parentLi)
+    } else {
+      this.expand($(treeviewMenu), parentLi)
     }
+  }
 
-    // Private
+  // Private
 
-    _setupListeners() {
-      $(document).on('click', this._config.trigger, event => {
-        this.toggle(event)
-      })
-    }
+  _setupListeners() {
+    $(document).on('click', this._config.trigger, event => {
+      this.toggle(event)
+    })
+  }
 
-    _expandSidebar() {
-      if ($('body').hasClass(ClassName.SIDEBAR_COLLAPSED)) {
-        $(this._config.sidebarButtonSelector).PushMenu('expand')
-      }
+  _expandSidebar() {
+    if ($('body').hasClass(ClassName.SIDEBAR_COLLAPSED)) {
+      $(this._config.sidebarButtonSelector).PushMenu('expand')
     }
+  }
 
-    // Static
+  // Static
 
-    static _jQueryInterface(config) {
-      return this.each(function () {
-        let data = $(this).data(DATA_KEY)
-        const _options = $.extend({}, Default, $(this).data())
+  static _jQueryInterface(config) {
+    return this.each(function () {
+      let data = $(this).data(DATA_KEY)
+      const _options = $.extend({}, Default, $(this).data())
 
-        if (!data) {
-          data = new Treeview($(this), _options)
-          $(this).data(DATA_KEY, data)
-        }
+      if (!data) {
+        data = new Treeview($(this), _options)
+        $(this).data(DATA_KEY, data)
+      }
 
-        if (config === 'init') {
-          data[config]()
-        }
-      })
-    }
+      if (config === 'init') {
+        data[config]()
+      }
+    })
   }
+}
 
-  /**
-   * Data API
-   * ====================================================
-   */
+/**
+ * Data API
+ * ====================================================
+ */
 
-  $(window).on(Event.LOAD_DATA_API, () => {
-    $(Selector.DATA_WIDGET).each(function () {
-      Treeview._jQueryInterface.call($(this), 'init')
-    })
+$(window).on(Event.LOAD_DATA_API, () => {
+  $(Selector.DATA_WIDGET).each(function () {
+    Treeview._jQueryInterface.call($(this), 'init')
   })
+})
 
-  /**
-   * jQuery API
-   * ====================================================
-   */
-
-  $.fn[NAME] = Treeview._jQueryInterface
-  $.fn[NAME].Constructor = Treeview
-  $.fn[NAME].noConflict = function () {
-    $.fn[NAME] = JQUERY_NO_CONFLICT
-    return Treeview._jQueryInterface
-  }
+/**
+ * jQuery API
+ * ====================================================
+ */
 
-  return Treeview
-})(jQuery)
+$.fn[NAME] = Treeview._jQueryInterface
+$.fn[NAME].Constructor = Treeview
+$.fn[NAME].noConflict = function () {
+  $.fn[NAME] = JQUERY_NO_CONFLICT
+  return Treeview._jQueryInterface
+}
 
 export default Treeview