@finqu/cool 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/cool.js CHANGED
@@ -67,10 +67,10 @@
67
67
  var cls = {
68
68
  main: 'ps',
69
69
  element: {
70
- thumb: function (x) {
70
+ thumb: function thumb(x) {
71
71
  return "ps__thumb-" + x;
72
72
  },
73
- rail: function (x) {
73
+ rail: function rail(x) {
74
74
  return "ps__rail-" + x;
75
75
  },
76
76
  consuming: 'ps__child--consume'
@@ -78,10 +78,10 @@
78
78
  state: {
79
79
  focus: 'ps--focus',
80
80
  clicking: 'ps--clicking',
81
- active: function (x) {
81
+ active: function active(x) {
82
82
  return "ps--active-" + x;
83
83
  },
84
- scrolling: function (x) {
84
+ scrolling: function scrolling(x) {
85
85
  return "ps--scrolling-" + x;
86
86
  }
87
87
  }
@@ -207,7 +207,7 @@
207
207
  EventManager.prototype.once = function once(element, eventName, handler) {
208
208
  var ee = this.eventElement(element);
209
209
 
210
- var onceHandler = function (evt) {
210
+ var onceHandler = function onceHandler(evt) {
211
211
  ee.unbind(eventName, onceHandler);
212
212
  handler(evt);
213
213
  };
@@ -225,7 +225,7 @@
225
225
  }
226
226
  }
227
227
 
228
- var processScrollDiff = function (i, axis, diff, useScrollingClass, forceFireReachEvent) {
228
+ var processScrollDiff = function processScrollDiff(i, axis, diff, useScrollingClass, forceFireReachEvent) {
229
229
  if (useScrollingClass === void 0) useScrollingClass = true;
230
230
  if (forceFireReachEvent === void 0) forceFireReachEvent = false;
231
231
  var fields;
@@ -302,7 +302,7 @@
302
302
  isChrome: typeof navigator !== 'undefined' && /Chrome/i.test(navigator && navigator.userAgent)
303
303
  };
304
304
 
305
- var updateGeometry = function (i) {
305
+ var updateGeometry = function updateGeometry(i) {
306
306
  var element = i.element;
307
307
  var roundedScrollTop = Math.floor(element.scrollTop);
308
308
  i.containerWidth = element.clientWidth;
@@ -436,7 +436,7 @@
436
436
  });
437
437
  }
438
438
 
439
- var clickRail = function (i) {
439
+ var clickRail = function clickRail(i) {
440
440
  i.event.bind(i.scrollbarY, 'mousedown', function (e) {
441
441
  return e.stopPropagation();
442
442
  });
@@ -459,7 +459,7 @@
459
459
  });
460
460
  };
461
461
 
462
- var dragThumb = function (i) {
462
+ var dragThumb = function dragThumb(i) {
463
463
  bindMouseScrollHandler(i, ['containerWidth', 'contentWidth', 'pageX', 'railXWidth', 'scrollbarX', 'scrollbarXWidth', 'scrollLeft', 'x', 'scrollbarXRail']);
464
464
  bindMouseScrollHandler(i, ['containerHeight', 'contentHeight', 'pageY', 'railYHeight', 'scrollbarY', 'scrollbarYHeight', 'scrollTop', 'y', 'scrollbarYRail']);
465
465
  };
@@ -505,14 +505,14 @@
505
505
  });
506
506
  }
507
507
 
508
- var keyboard = function (i) {
508
+ var keyboard = function keyboard(i) {
509
509
  var element = i.element;
510
510
 
511
- var elementHovered = function () {
511
+ var elementHovered = function elementHovered() {
512
512
  return matches(element, ':hover');
513
513
  };
514
514
 
515
- var scrollbarFocused = function () {
515
+ var scrollbarFocused = function scrollbarFocused() {
516
516
  return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus');
517
517
  };
518
518
 
@@ -674,7 +674,7 @@
674
674
  });
675
675
  };
676
676
 
677
- var wheel = function (i) {
677
+ var wheel = function wheel(i) {
678
678
  var element = i.element;
679
679
 
680
680
  function shouldPreventDefault(deltaX, deltaY) {
@@ -824,7 +824,7 @@
824
824
  }
825
825
  };
826
826
 
827
- var touch = function (i) {
827
+ var touch = function touch(i) {
828
828
  if (!env.supportsTouch && !env.supportsIePointer) {
829
829
  return;
830
830
  }
@@ -1017,7 +1017,7 @@
1017
1017
  }
1018
1018
  };
1019
1019
 
1020
- var defaultSettings = function () {
1020
+ var defaultSettings = function defaultSettings() {
1021
1021
  return {
1022
1022
  handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
1023
1023
  maxScrollbarLength: null,
@@ -1067,11 +1067,11 @@
1067
1067
  this.contentWidth = null;
1068
1068
  this.contentHeight = null;
1069
1069
 
1070
- var focus = function () {
1070
+ var focus = function focus() {
1071
1071
  return element.classList.add(cls.state.focus);
1072
1072
  };
1073
1073
 
1074
- var blur = function () {
1074
+ var blur = function blur() {
1075
1075
  return element.classList.remove(cls.state.focus);
1076
1076
  };
1077
1077
 
@@ -1242,7 +1242,7 @@
1242
1242
  };
1243
1243
 
1244
1244
  $.fn.extend({
1245
- animateCss: function (animationName, callback) {
1245
+ animateCss: function animateCss(animationName, callback) {
1246
1246
  var el = this;
1247
1247
  var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
1248
1248
  el.addClass('animated ' + animationName).one(animationEnd, function (e) {
@@ -1260,8 +1260,12 @@
1260
1260
  window.Cool = window.Cool || {};
1261
1261
  window.Cool.settings = window.Cool.settings || {};
1262
1262
 
1263
- class Common {
1264
- static initialize(opts) {
1263
+ var Common =
1264
+ /*#__PURE__*/
1265
+ function () {
1266
+ function Common() {}
1267
+
1268
+ Common.initialize = function initialize(opts) {
1265
1269
  // There's an error if opts is not defined
1266
1270
  opts = opts || {}; // Save settings for later use
1267
1271
 
@@ -1280,7 +1284,7 @@
1280
1284
 
1281
1285
  $(document).on('focus', '.form-control', function () {
1282
1286
  if (!$(this).hasClass('disabled') && $(this).not(':disabled') && !$(this).attr('readonly')) {
1283
- let $inputGroup = $(this).closest('.input-group');
1287
+ var $inputGroup = $(this).closest('.input-group');
1284
1288
 
1285
1289
  if (!$inputGroup.hasClass('input-group-focus')) {
1286
1290
  $inputGroup.addClass('input-group-focus');
@@ -1290,7 +1294,7 @@
1290
1294
 
1291
1295
  $(document).on('blur', '.form-control', function () {
1292
1296
  if (!$(this).hasClass('disabled') && $(this).not(':disabled') && !$(this).attr('readonly')) {
1293
- let $inputGroup = $(this).closest('.input-group');
1297
+ var $inputGroup = $(this).closest('.input-group');
1294
1298
 
1295
1299
  if ($inputGroup.hasClass('input-group-focus')) {
1296
1300
  $inputGroup.removeClass('input-group-focus');
@@ -1299,9 +1303,9 @@
1299
1303
  }); // Custom Form group
1300
1304
 
1301
1305
  $('.form-label-group').each(function (i, formLabelGroup) {
1302
- let $formLabelGroup = $(formLabelGroup);
1306
+ var $formLabelGroup = $(formLabelGroup);
1303
1307
  $formLabelGroup.find('input').on('blur input change', function () {
1304
- let val = $(this).val();
1308
+ var val = $(this).val();
1305
1309
 
1306
1310
  if (val) {
1307
1311
  $(formLabelGroup).addClass('label-on-top');
@@ -1317,11 +1321,11 @@
1317
1321
  }
1318
1322
  });
1319
1323
  $(document).on('click', '[data-table-link]', function (e) {
1320
- let $container = $(this).parents('table, .table');
1321
- let href = $(this).data('tableLink');
1322
- let target = $(e.target);
1323
- let exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
1324
- let linkDisabled = false;
1324
+ var $container = $(this).parents('table, .table');
1325
+ var href = $(this).data('tableLink');
1326
+ var target = $(e.target);
1327
+ var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
1328
+ var linkDisabled = false;
1325
1329
  $.each(exceptions, function (item) {
1326
1330
  if (target.is(item) || item == 'a' && target.parent().is(item)) {
1327
1331
  linkDisabled = true;
@@ -1343,12 +1347,12 @@
1343
1347
  }
1344
1348
  });
1345
1349
  $(document).on('click', '[data-table-btn]', function (e) {
1346
- let $container = $(this).parents('table, .table');
1347
- let $self = $(this);
1348
- let btn = $(this).data('tableButton');
1349
- let target = $(e.target);
1350
- let exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
1351
- let btnDisabled = false;
1350
+ var $container = $(this).parents('table, .table');
1351
+ var $self = $(this);
1352
+ var btn = $(this).data('tableButton');
1353
+ var target = $(e.target);
1354
+ var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
1355
+ var btnDisabled = false;
1352
1356
 
1353
1357
  if (!btn) {
1354
1358
  btn = $self.find('button')[0];
@@ -1407,11 +1411,11 @@
1407
1411
  }
1408
1412
  }); // Sidebar left scroll
1409
1413
 
1410
- let $sidebarLeft = $('.sidebar-left');
1411
- let $sidebarLeftContent = $sidebarLeft.find('.sidebar-content');
1414
+ var $sidebarLeft = $('.sidebar-left');
1415
+ var $sidebarLeftContent = $sidebarLeft.find('.sidebar-content');
1412
1416
 
1413
1417
  if ($sidebarLeftContent.length) {
1414
- let sidebarLeftScroll = new PerfectScrollbar($sidebarLeftContent[0], {
1418
+ var sidebarLeftScroll = new PerfectScrollbar($sidebarLeftContent[0], {
1415
1419
  wheelSpeed: 2,
1416
1420
  wheelPropagation: true,
1417
1421
  minScrollbarLength: 20,
@@ -1420,12 +1424,12 @@
1420
1424
  } // Sidebar tabs
1421
1425
 
1422
1426
 
1423
- let $sidebarTabs = $(document).find('.sidebar-tab');
1427
+ var $sidebarTabs = $(document).find('.sidebar-tab');
1424
1428
 
1425
1429
  if ($sidebarTabs.length) {
1426
1430
  $.each($sidebarTabs, function (i, el) {
1427
- let scrollContainer = $(el).find('.tab-content');
1428
- const sidebarTabsScroll = new PerfectScrollbar(scrollContainer[0], {
1431
+ var scrollContainer = $(el).find('.tab-content');
1432
+ var sidebarTabsScroll = new PerfectScrollbar(scrollContainer[0], {
1429
1433
  wheelSpeed: 2,
1430
1434
  wheelPropagation: true,
1431
1435
  minScrollbarLength: 20,
@@ -1433,8 +1437,8 @@
1433
1437
  });
1434
1438
  });
1435
1439
  $('[name="sidebar-tab-select"]').on('click', function () {
1436
- let val = $(this).val();
1437
- let $tab = $('#sidebar-tab-' + val);
1440
+ var val = $(this).val();
1441
+ var $tab = $('#sidebar-tab-' + val);
1438
1442
  $sidebarTabs.not($tab).removeClass('active');
1439
1443
  $tab.addClass('active');
1440
1444
  $('[name="sidebar-tab-select"]').not($(this)).removeClass('active');
@@ -1462,19 +1466,26 @@
1462
1466
  });
1463
1467
  });
1464
1468
  }
1465
- }
1469
+ };
1466
1470
 
1467
- }
1471
+ return Common;
1472
+ }();
1468
1473
 
1469
1474
  window.Cool.initialize = Common.initialize;
1470
1475
 
1471
- const debounce = function (func, wait, immediate) {
1472
- let timeout;
1476
+ function _inheritsLoose(subClass, superClass) {
1477
+ subClass.prototype = Object.create(superClass.prototype);
1478
+ subClass.prototype.constructor = subClass;
1479
+ subClass.__proto__ = superClass;
1480
+ }
1481
+
1482
+ var debounce = function debounce(func, wait, immediate) {
1483
+ var timeout;
1473
1484
  return function () {
1474
- let context = this;
1475
- let args = arguments;
1485
+ var context = this;
1486
+ var args = arguments;
1476
1487
 
1477
- let later = function () {
1488
+ var later = function later() {
1478
1489
  timeout = null;
1479
1490
 
1480
1491
  if (!immediate) {
@@ -1482,7 +1493,7 @@
1482
1493
  }
1483
1494
  };
1484
1495
 
1485
- let callNow = immediate && !timeout;
1496
+ var callNow = immediate && !timeout;
1486
1497
  clearTimeout(timeout);
1487
1498
  timeout = setTimeout(later, wait);
1488
1499
 
@@ -1492,8 +1503,8 @@
1492
1503
  };
1493
1504
  };
1494
1505
 
1495
- const touchEvents = function () {
1496
- let result = false;
1506
+ var touchEvents = function touchEvents() {
1507
+ var result = false;
1497
1508
 
1498
1509
  if ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch) {
1499
1510
  result = true;
@@ -1502,106 +1513,126 @@
1502
1513
  return result;
1503
1514
  };
1504
1515
 
1505
- class AbstractUIComponent {
1516
+ var AbstractUIComponent =
1517
+ /*#__PURE__*/
1518
+ function () {
1519
+ function AbstractUIComponent() {}
1520
+
1521
+ var _proto = AbstractUIComponent.prototype;
1522
+
1506
1523
  // Init callback
1507
- onInit() {
1508
- let onInit = this.opts.onInit;
1524
+ _proto.onInit = function onInit() {
1525
+ var onInit = this.opts.onInit;
1509
1526
 
1510
1527
  if (typeof onInit === 'function') {
1511
1528
  onInit.call(this.el);
1512
1529
  }
1513
1530
  } // Update callback
1531
+ ;
1514
1532
 
1515
-
1516
- onUpdate() {
1517
- let onUpdate = this.opts.onUpdate;
1533
+ _proto.onUpdate = function onUpdate() {
1534
+ var onUpdate = this.opts.onUpdate;
1518
1535
 
1519
1536
  if (typeof onUpdate === 'function') {
1520
1537
  onUpdate.call(this.el);
1521
1538
  }
1522
1539
  } // Destroy callback
1540
+ ;
1523
1541
 
1524
-
1525
- onDestroy() {
1526
- let onDestroy = this.opts.onDestroy;
1542
+ _proto.onDestroy = function onDestroy() {
1543
+ var onDestroy = this.opts.onDestroy;
1527
1544
 
1528
1545
  if (typeof onDestroy === 'function') {
1529
1546
  onDestroy.call(this.el);
1530
1547
  }
1531
1548
  } // Show callback
1549
+ ;
1532
1550
 
1533
-
1534
- onShow() {
1535
- let onShow = this.opts.onShow;
1551
+ _proto.onShow = function onShow() {
1552
+ var onShow = this.opts.onShow;
1536
1553
 
1537
1554
  if (typeof onShow === 'function') {
1538
1555
  onShow.call(this.el);
1539
1556
  }
1540
1557
  } // Close callback
1558
+ ;
1541
1559
 
1542
-
1543
- onClose() {
1544
- let onClose = this.opts.onClose;
1560
+ _proto.onClose = function onClose() {
1561
+ var onClose = this.opts.onClose;
1545
1562
 
1546
1563
  if (typeof onClose === 'function') {
1547
1564
  onClose.call(this.el);
1548
1565
  }
1549
1566
  } // Debug log
1567
+ ;
1550
1568
 
1551
-
1552
- log(...args) {
1569
+ _proto.log = function log() {
1553
1570
  if (this.debug) {
1554
1571
  if (typeof this.debug === 'function') {
1555
- this.debug(...args);
1572
+ this.debug.apply(this, arguments);
1556
1573
  } else {
1557
- console.log(...args);
1574
+ var _console;
1575
+
1576
+ (_console = console).log.apply(_console, arguments);
1558
1577
  }
1559
1578
  }
1560
- }
1579
+ };
1561
1580
 
1562
- }
1581
+ return AbstractUIComponent;
1582
+ }();
1583
+
1584
+ var NAME = 'coolPopover';
1585
+ var DATA_KEY = 'plugin_coolPopover';
1563
1586
 
1564
- const NAME = 'coolPopover';
1565
- const DATA_KEY = 'plugin_coolPopover';
1587
+ var Popover =
1588
+ /*#__PURE__*/
1589
+ function (_AbstractUIComponent) {
1590
+ _inheritsLoose(Popover, _AbstractUIComponent);
1566
1591
 
1567
- class Popover extends AbstractUIComponent {
1568
- constructor(el, opts) {
1569
- super();
1570
- this.opts = {};
1592
+ function Popover(el, opts) {
1593
+ var _this;
1594
+
1595
+ _this = _AbstractUIComponent.call(this) || this;
1596
+ _this.opts = {};
1571
1597
 
1572
1598
  if (window.Cool.settings.popover) {
1573
- $.extend(true, this.opts, $.fn[NAME].defaults, window.Cool.settings.popover, opts);
1599
+ $.extend(true, _this.opts, $.fn[NAME].defaults, window.Cool.settings.popover, opts);
1574
1600
  } else {
1575
- $.extend(true, this.opts, $.fn[NAME].defaults, opts);
1601
+ $.extend(true, _this.opts, $.fn[NAME].defaults, opts);
1576
1602
  }
1577
1603
 
1578
- this.el = el;
1579
- this.debug = this.opts.debug;
1580
- this.init();
1604
+ _this.el = el;
1605
+ _this.debug = _this.opts.debug;
1606
+
1607
+ _this.init();
1608
+
1609
+ return _this;
1581
1610
  } // Init plugin
1582
1611
 
1583
1612
 
1584
- init() {
1613
+ var _proto = Popover.prototype;
1614
+
1615
+ _proto.init = function init() {
1585
1616
  this.buildCache();
1586
1617
  this.bindEvents();
1587
1618
  this.onInit();
1588
1619
  } // Remove plugin instance completely
1620
+ ;
1589
1621
 
1590
-
1591
- destroy() {
1622
+ _proto.destroy = function destroy() {
1592
1623
  this.unbindEvents();
1593
1624
  this.$el.removeData(DATA_KEY);
1594
1625
  this.onDestroy();
1595
1626
  } // Update plugin data
1627
+ ;
1596
1628
 
1597
-
1598
- update() {
1629
+ _proto.update = function update() {
1599
1630
  this.buildCache();
1600
1631
  this.onUpdate();
1601
1632
  } // Cache DOM nodes for performance
1633
+ ;
1602
1634
 
1603
-
1604
- buildCache() {
1635
+ _proto.buildCache = function buildCache() {
1605
1636
  this.$el = $(this.el);
1606
1637
  this.$container = this.$el.data('container') ? $(this.$el.data('container')) : $(this.opts.container);
1607
1638
  this.id = 'popover-' + this.generateUUID();
@@ -1615,58 +1646,61 @@
1615
1646
  this.title = this.$el.data('title') ? this.$el.data('title') : this.opts.title;
1616
1647
  this.content = this.$el.data('content') ? this.$el.data('content') : this.opts.content;
1617
1648
  } // Bind events that trigger methods
1649
+ ;
1618
1650
 
1651
+ _proto.bindEvents = function bindEvents() {
1652
+ var _this2 = this;
1619
1653
 
1620
- bindEvents() {
1621
1654
  if (this.trigger === 'click') {
1622
- this.$el.on('click' + '.' + NAME, () => {
1623
- if (this.$popover) {
1624
- this.close();
1655
+ this.$el.on('click' + '.' + NAME, function () {
1656
+ if (_this2.$popover) {
1657
+ _this2.close();
1625
1658
  } else {
1626
- this.show();
1659
+ _this2.show();
1627
1660
  }
1628
1661
  });
1629
1662
  } else if (this.trigger === 'hover') {
1630
- this.$el.on('mouseenter' + '.' + NAME, () => {
1631
- this.show();
1663
+ this.$el.on('mouseenter' + '.' + NAME, function () {
1664
+ _this2.show();
1632
1665
  });
1633
- this.$el.on('mouseleave' + '.' + NAME, () => {
1634
- this.close();
1666
+ this.$el.on('mouseleave' + '.' + NAME, function () {
1667
+ _this2.close();
1635
1668
  });
1636
1669
  } else if (this.trigger === 'focus') {
1637
- this.$el.on('focusin' + '.' + NAME, () => {
1638
- this.show();
1670
+ this.$el.on('focusin' + '.' + NAME, function () {
1671
+ _this2.show();
1639
1672
  });
1640
- this.$el.on('focusout' + '.' + NAME, () => {
1641
- this.close();
1673
+ this.$el.on('focusout' + '.' + NAME, function () {
1674
+ _this2.close();
1642
1675
  });
1643
1676
  }
1644
1677
 
1645
- $(window).on('resize', debounce(() => {
1646
- if (this.$popover) {
1647
- this.setPosition();
1648
- this.onUpdate();
1678
+ $(window).on('resize', debounce(function () {
1679
+ if (_this2.$popover) {
1680
+ _this2.setPosition();
1681
+
1682
+ _this2.onUpdate();
1649
1683
  }
1650
1684
  }, 250));
1651
1685
  } // Unbind events that trigger methods
1686
+ ;
1652
1687
 
1653
-
1654
- unbindEvents() {
1688
+ _proto.unbindEvents = function unbindEvents() {
1655
1689
  this.$el.off('.' + NAME);
1656
1690
  } // Generate UUID
1691
+ ;
1657
1692
 
1658
-
1659
- generateUUID() {
1693
+ _proto.generateUUID = function generateUUID() {
1660
1694
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
1661
- let r = Math.random() * 16 | 0,
1695
+ var r = Math.random() * 16 | 0,
1662
1696
  v = c == 'x' ? r : r & 0x3 | 0x8;
1663
1697
  return v.toString(16);
1664
1698
  });
1665
1699
  } // Build popover
1700
+ ;
1666
1701
 
1667
-
1668
- buildPopover() {
1669
- let content;
1702
+ _proto.buildPopover = function buildPopover() {
1703
+ var content;
1670
1704
 
1671
1705
  if (typeof this.content === 'function') {
1672
1706
  content = this.content();
@@ -1674,17 +1708,7 @@
1674
1708
  content = this.content;
1675
1709
  }
1676
1710
 
1677
- this.$popover = $(`
1678
- <div class="popover" role="tooltip" id="${this.id}">
1679
-
1680
- <div class="arrow"></div>
1681
-
1682
- <h3 class="popover-header">${this.title}</h3>
1683
-
1684
- <div class="popover-body">${content}</div>
1685
-
1686
- </div>
1687
- `);
1711
+ this.$popover = $("\n \t\t<div class=\"popover\" role=\"tooltip\" id=\"" + this.id + "\">\n\n\t\t\t <div class=\"arrow\"></div>\n\n\t\t\t <h3 class=\"popover-header\">" + this.title + "</h3>\n\n\t\t\t <div class=\"popover-body\">" + content + "</div>\n\n\t\t\t</div>\n \t");
1688
1712
  this.$container.append(this.$popover);
1689
1713
  this.$arrow = this.$popover.find('.arrow') ? this.$popover.find('.arrow') : false;
1690
1714
  this.log(this.$el);
@@ -1701,27 +1725,27 @@
1701
1725
  this.log('Title: ' + this.title);
1702
1726
  this.log('Content: ' + this.content);
1703
1727
  } // Set positions
1728
+ ;
1704
1729
 
1705
-
1706
- setPosition(placement) {
1730
+ _proto.setPosition = function setPosition(placement) {
1707
1731
  if (typeof placement === 'undefined' || placement === null) {
1708
1732
  placement = this.placement;
1709
1733
  }
1710
1734
 
1711
1735
  this.$popover.addClass('popover-' + placement);
1712
- let containerInnerWidth = this.$container.innerWidth();
1713
- let containerInnerHeight = this.$container.innerHeight();
1714
- let popoverWidth = this.$popover.outerWidth(true);
1715
- let popoverHeight = this.$popover.outerHeight(true);
1716
- let popoverTriggerWidth = this.$el.outerWidth();
1717
- let popoverTriggerHeight = this.$el.outerHeight();
1718
- let popoverTriggerPosX = this.$el.position().left;
1719
- let popoverTriggerPosY = this.$el.position().top;
1720
- let arrowWidth = this.$arrow.outerWidth(true);
1721
- let arrowHeight = this.$arrow.outerHeight(true);
1722
- let arrowPos;
1723
- let popoverPosX;
1724
- let popoverPosY;
1736
+ var containerInnerWidth = this.$container.innerWidth();
1737
+ var containerInnerHeight = this.$container.innerHeight();
1738
+ var popoverWidth = this.$popover.outerWidth(true);
1739
+ var popoverHeight = this.$popover.outerHeight(true);
1740
+ var popoverTriggerWidth = this.$el.outerWidth();
1741
+ var popoverTriggerHeight = this.$el.outerHeight();
1742
+ var popoverTriggerPosX = this.$el.position().left;
1743
+ var popoverTriggerPosY = this.$el.position().top;
1744
+ var arrowWidth = this.$arrow.outerWidth(true);
1745
+ var arrowHeight = this.$arrow.outerHeight(true);
1746
+ var arrowPos;
1747
+ var popoverPosX;
1748
+ var popoverPosY;
1725
1749
 
1726
1750
  if (placement === 'top') {
1727
1751
  popoverPosX = Math.round(popoverTriggerPosX - (popoverWidth - popoverTriggerWidth) / 2);
@@ -1761,14 +1785,14 @@
1761
1785
  'will-change': 'transform'
1762
1786
  }); // Correct placement if popover goes outside of container
1763
1787
 
1764
- let popoverOverflowCount = 0;
1765
- let popoverPosition = {
1788
+ var popoverOverflowCount = 0;
1789
+ var popoverPosition = {
1766
1790
  left: this.$popover.position().left,
1767
1791
  top: this.$popover.position().top,
1768
1792
  right: containerInnerWidth - (this.$popover.position().left + popoverWidth),
1769
1793
  bottom: containerInnerHeight - (this.$popover.position().top + popoverHeight)
1770
1794
  };
1771
- let popoverOverflow = {
1795
+ var popoverOverflow = {
1772
1796
  left: false,
1773
1797
  top: false,
1774
1798
  right: false,
@@ -1847,8 +1871,8 @@
1847
1871
 
1848
1872
  if (popoverOverflow.left) {
1849
1873
  this.log('Popover overflowing from left');
1850
- let overflowAmount = Math.abs(popoverPosition.left);
1851
- let excludePlacements = ['top', 'bottom'];
1874
+ var overflowAmount = Math.abs(popoverPosition.left);
1875
+ var excludePlacements = ['top', 'bottom'];
1852
1876
 
1853
1877
  if (popoverTriggerPosX >= popoverPosX + overflowAmount && excludePlacements.indexOf(placement) < 0) {
1854
1878
  this.log('Popover adjusting width');
@@ -1863,33 +1887,39 @@
1863
1887
 
1864
1888
  if (popoverOverflow.top) {
1865
1889
  this.log('Popover overflowing from top');
1866
- let overflowAmount = Math.abs(popoverPosition.top);
1890
+
1891
+ var _overflowAmount = Math.abs(popoverPosition.top);
1892
+
1867
1893
  this.log('Popover adjusting position y');
1868
- popoverPosY += overflowAmount;
1869
- arrowPos -= overflowAmount;
1894
+ popoverPosY += _overflowAmount;
1895
+ arrowPos -= _overflowAmount;
1870
1896
  }
1871
1897
 
1872
1898
  if (popoverOverflow.right) {
1873
1899
  this.log('Popover overflowing from right');
1874
- let overflowAmount = Math.abs(popoverPosition.right);
1875
- let excludePlacements = ['top', 'bottom'];
1876
1900
 
1877
- if (popoverTriggerPosX <= popoverPosX - overflowAmount && excludePlacements.indexOf(placement) < 0) {
1901
+ var _overflowAmount2 = Math.abs(popoverPosition.right);
1902
+
1903
+ var _excludePlacements = ['top', 'bottom'];
1904
+
1905
+ if (popoverTriggerPosX <= popoverPosX - _overflowAmount2 && _excludePlacements.indexOf(placement) < 0) {
1878
1906
  this.log('Popover adjusting width');
1879
- popoverWidth -= overflowAmount;
1907
+ popoverWidth -= _overflowAmount2;
1880
1908
  } else {
1881
1909
  this.log('Popover adjusting position x');
1882
- popoverPosX -= overflowAmount;
1883
- arrowPos += overflowAmount;
1910
+ popoverPosX -= _overflowAmount2;
1911
+ arrowPos += _overflowAmount2;
1884
1912
  }
1885
1913
  }
1886
1914
 
1887
1915
  if (popoverOverflow.bottom) {
1888
1916
  this.log('Popover overflowing from bottom');
1889
- let overflowAmount = Math.abs(popoverPosition.bottom);
1917
+
1918
+ var _overflowAmount3 = Math.abs(popoverPosition.bottom);
1919
+
1890
1920
  this.log('Popover adjusting position y');
1891
- popoverPosY -= overflowAmount;
1892
- arrowPos += overflowAmount;
1921
+ popoverPosY -= _overflowAmount3;
1922
+ arrowPos += _overflowAmount3;
1893
1923
  }
1894
1924
 
1895
1925
  if (placement === 'top') {
@@ -1949,9 +1979,9 @@
1949
1979
  this.log('Popover position bottom: ' + popoverPosition.bottom + 'px');
1950
1980
  }
1951
1981
  } // Show
1982
+ ;
1952
1983
 
1953
-
1954
- show() {
1984
+ _proto.show = function show() {
1955
1985
  if (this.$popover) {
1956
1986
  return;
1957
1987
  }
@@ -1973,20 +2003,25 @@
1973
2003
 
1974
2004
  this.onShow();
1975
2005
  } // Close
2006
+ ;
1976
2007
 
2008
+ _proto.close = function close() {
2009
+ var _this3 = this;
1977
2010
 
1978
- close() {
1979
2011
  if (!this.$popover) {
1980
2012
  return;
1981
2013
  }
1982
2014
 
1983
2015
  if (this.animation && !this.$popover.hasClass('animated')) {
1984
- this.$popover.animateCss(this.animationOut, () => {
1985
- this.$popover.remove();
1986
- this.$el.removeAttr('data-popover');
1987
- this.$popover = null;
1988
- this.placementChanged = false;
1989
- this.onClose();
2016
+ this.$popover.animateCss(this.animationOut, function () {
2017
+ _this3.$popover.remove();
2018
+
2019
+ _this3.$el.removeAttr('data-popover');
2020
+
2021
+ _this3.$popover = null;
2022
+ _this3.placementChanged = false;
2023
+
2024
+ _this3.onClose();
1990
2025
  });
1991
2026
  } else {
1992
2027
  this.$popover.remove();
@@ -1995,13 +2030,13 @@
1995
2030
  this.placementChanged = false;
1996
2031
  this.onClose();
1997
2032
  }
1998
- }
2033
+ };
1999
2034
 
2000
- static _jQueryInterface(config) {
2035
+ Popover._jQueryInterface = function _jQueryInterface(config) {
2001
2036
  return this.each(function () {
2002
- let data = $(this).data(DATA_KEY);
2037
+ var data = $(this).data(DATA_KEY);
2003
2038
 
2004
- const _config = typeof config === 'object' && config;
2039
+ var _config = typeof config === 'object' && config;
2005
2040
 
2006
2041
  if (!data) {
2007
2042
  data = new Popover(this, _config);
@@ -2010,23 +2045,24 @@
2010
2045
 
2011
2046
  if (typeof config === 'string') {
2012
2047
  if (typeof data[config] === 'undefined') {
2013
- throw new TypeError(`No method named "${config}"`);
2048
+ throw new TypeError("No method named \"" + config + "\"");
2014
2049
  }
2015
2050
 
2016
2051
  data[config]();
2017
2052
  }
2018
2053
  });
2019
- }
2054
+ };
2020
2055
 
2021
- }
2056
+ return Popover;
2057
+ }(AbstractUIComponent);
2022
2058
 
2023
2059
  if (typeof $ !== 'undefined') {
2024
2060
  // jQuery
2025
- const JQUERY_NO_CONFLICT = $.fn[NAME];
2061
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
2026
2062
  $.fn[NAME] = Popover._jQueryInterface;
2027
2063
  $.fn[NAME].Constructor = Popover;
2028
2064
 
2029
- $.fn[NAME].noConflict = () => {
2065
+ $.fn[NAME].noConflict = function () {
2030
2066
  $.fn[NAME] = JQUERY_NO_CONFLICT;
2031
2067
  return Popover._jQueryInterface;
2032
2068
  };
@@ -2050,55 +2086,71 @@
2050
2086
  };
2051
2087
  }
2052
2088
 
2053
- const NAME$1 = 'coolSelect';
2054
- const DATA_KEY$1 = 'plugin_coolSelect';
2089
+ var NAME$1 = 'coolSelect';
2090
+ var DATA_KEY$1 = 'plugin_coolSelect';
2091
+
2092
+ var Select =
2093
+ /*#__PURE__*/
2094
+ function (_AbstractUIComponent) {
2095
+ _inheritsLoose(Select, _AbstractUIComponent);
2096
+
2097
+ function Select(el, opts) {
2098
+ var _this;
2055
2099
 
2056
- class Select extends AbstractUIComponent {
2057
- constructor(el, opts) {
2058
- super();
2059
- this.opts = {};
2100
+ _this = _AbstractUIComponent.call(this) || this;
2101
+ _this.opts = {};
2060
2102
 
2061
2103
  if (window.Cool.settings.select) {
2062
- $.extend(true, this.opts, $.fn[NAME$1].defaults, window.Cool.settings.select, opts);
2104
+ $.extend(true, _this.opts, $.fn[NAME$1].defaults, window.Cool.settings.select, opts);
2063
2105
  } else {
2064
- $.extend(true, this.opts, $.fn[NAME$1].defaults, opts);
2106
+ $.extend(true, _this.opts, $.fn[NAME$1].defaults, opts);
2065
2107
  }
2066
2108
 
2067
- this.el = el;
2068
- this.debug = this.opts.debug;
2069
- this.init();
2109
+ _this.el = el;
2110
+ _this.debug = _this.opts.debug;
2111
+
2112
+ _this.init();
2113
+
2114
+ return _this;
2070
2115
  } // Init plugin
2071
2116
 
2072
2117
 
2073
- init() {
2074
- $.when(this.buildCache()).then(() => {
2075
- this.buildScroll();
2076
- this.bindEvents();
2118
+ var _proto = Select.prototype;
2077
2119
 
2078
- if (this.data[this.name].length > 0) {
2079
- this.setData();
2120
+ _proto.init = function init() {
2121
+ var _this2 = this;
2122
+
2123
+ $.when(this.buildCache()).then(function () {
2124
+ _this2.buildScroll();
2125
+
2126
+ _this2.bindEvents();
2127
+
2128
+ if (_this2.data[_this2.name].length > 0) {
2129
+ _this2.setData();
2080
2130
  }
2081
2131
 
2082
- this.onInit();
2132
+ _this2.onInit();
2083
2133
  });
2084
2134
  } // Remove plugin instance completely
2135
+ ;
2085
2136
 
2086
-
2087
- destroy() {
2137
+ _proto.destroy = function destroy() {
2088
2138
  this.unbindEvents();
2089
2139
  this.$el.removeData(DATA_KEY$1);
2090
2140
  this.onDestroy();
2091
2141
  } // Update plugin data
2142
+ ;
2092
2143
 
2093
-
2094
- update() {
2144
+ _proto.update = function update() {
2095
2145
  this.buildCache();
2096
2146
  this.bindEvents();
2097
2147
  this.onUpdate();
2098
2148
  } // Cache DOM nodes for performance
2149
+ ;
2099
2150
 
2151
+ _proto.buildCache = function buildCache() {
2152
+ var _this3 = this;
2100
2153
 
2101
- buildCache() {
2102
2154
  this.$el = $(this.el);
2103
2155
  this.$selectHeader = this.$el.find('.select-header');
2104
2156
  this.$selectIconContainer = this.$selectHeader.find('.select-icon');
@@ -2129,19 +2181,9 @@
2129
2181
  }
2130
2182
 
2131
2183
  if (this.items.length) {
2132
- let items = this._renderItemList(this.items);
2133
-
2134
- this.$select = $(`
2135
- <div class="select-content">
2136
-
2137
- ${this._renderSearch()}
2138
-
2139
- <div class="select-scrollable-content">${items}</div>
2140
-
2141
- ${this._renderFooter()}
2184
+ var items = this._renderItemList(this.items);
2142
2185
 
2143
- </div>
2144
- `);
2186
+ this.$select = $("\n <div class=\"select-content\">\n\n " + this._renderSearch() + "\n\n <div class=\"select-scrollable-content\">" + items + "</div>\n\n " + this._renderFooter() + "\n\n </div>\n ");
2145
2187
  this.$el.append(this.$select);
2146
2188
  this.$scrollableContent = this.$select.find('.select-scrollable-content') ? this.$select.find('.select-scrollable-content') : false;
2147
2189
  this.$selectItems = this.$select.find('.select-item');
@@ -2192,8 +2234,8 @@
2192
2234
  this.$closeButton = this.$select.find('[data-select-close]');
2193
2235
  }
2194
2236
 
2195
- $.each(this.$selectLabels, (i, el) => {
2196
- this.searchData.push({
2237
+ $.each(this.$selectLabels, function (i, el) {
2238
+ _this3.searchData.push({
2197
2239
  id: i,
2198
2240
  val: $(el).text().trim()
2199
2241
  });
@@ -2210,11 +2252,11 @@
2210
2252
  return true;
2211
2253
  }
2212
2254
  } // Build scroll
2255
+ ;
2213
2256
 
2214
-
2215
- buildScroll() {
2257
+ _proto.buildScroll = function buildScroll() {
2216
2258
  if (this.$scrollableContent.length > 0) {
2217
- let scrollContentHeight = this.scrollContentHeight;
2259
+ var scrollContentHeight = this.scrollContentHeight;
2218
2260
 
2219
2261
  if (this.showSearch) {
2220
2262
  scrollContentHeight = scrollContentHeight - (this.$searchContainer.outerHeight(true) || 0);
@@ -2250,30 +2292,34 @@
2250
2292
  }
2251
2293
  }
2252
2294
  } // Bind events that trigger methods
2295
+ ;
2253
2296
 
2297
+ _proto.bindEvents = function bindEvents() {
2298
+ var _this4 = this;
2254
2299
 
2255
- bindEvents() {
2256
- let self = this;
2257
- this.$selectHeader.on('click' + '.' + NAME$1, () => {
2258
- if (this.contentOpen) {
2259
- this.close();
2300
+ var self = this;
2301
+ this.$selectHeader.on('click' + '.' + NAME$1, function () {
2302
+ if (_this4.contentOpen) {
2303
+ _this4.close();
2260
2304
  } else {
2261
- this.show();
2305
+ _this4.show();
2262
2306
  }
2263
2307
  });
2264
2308
  this.$el.on('change' + '.' + NAME$1, 'input[type="checkbox"]', function () {
2265
- let val = $(this).val();
2309
+ var val = $(this).val();
2266
2310
 
2267
2311
  if (this.checked) {
2268
2312
  self.data[self.name].indexOf(val) === -1 ? self.data[self.name].push(val) : false;
2269
2313
  } else {
2270
- self.data[self.name] = self.data[self.name].filter(n => n != val);
2314
+ self.data[self.name] = self.data[self.name].filter(function (n) {
2315
+ return n != val;
2316
+ });
2271
2317
  }
2272
2318
 
2273
2319
  self.onSelect(this);
2274
2320
  });
2275
2321
  this.$el.on('change' + '.' + NAME$1, 'input[type="radio"]', function () {
2276
- let val = $(this).val();
2322
+ var val = $(this).val();
2277
2323
 
2278
2324
  if (this.checked) {
2279
2325
  self.data[self.name] = val;
@@ -2329,8 +2375,8 @@
2329
2375
  }
2330
2376
 
2331
2377
  if (this.showFooter) {
2332
- this.$closeButton.on('click' + '.' + NAME$1, () => {
2333
- this.close();
2378
+ this.$closeButton.on('click' + '.' + NAME$1, function () {
2379
+ _this4.close();
2334
2380
  });
2335
2381
  }
2336
2382
 
@@ -2340,32 +2386,32 @@
2340
2386
  }
2341
2387
  });
2342
2388
  } // Unbind events that trigger methods
2389
+ ;
2343
2390
 
2344
-
2345
- unbindEvents() {
2391
+ _proto.unbindEvents = function unbindEvents() {
2346
2392
  this.$el.off('.' + NAME$1);
2347
2393
  } // Get data
2394
+ ;
2348
2395
 
2349
-
2350
- getData(data) {
2396
+ _proto.getData = function getData(data) {
2351
2397
  if (data) {
2352
2398
  return this.data[data];
2353
2399
  } else {
2354
2400
  return this.data;
2355
2401
  }
2356
2402
  } // Set data
2403
+ ;
2357
2404
 
2358
-
2359
- setData() {
2360
- let self = this;
2361
- let type = null;
2362
- let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2363
- this.$selectIconContainer.html(`<i class="${faNameSpace} fa-check text-green icon"></i>`);
2405
+ _proto.setData = function setData() {
2406
+ var self = this;
2407
+ var type = null;
2408
+ var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2409
+ this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-green icon\"></i>");
2364
2410
 
2365
2411
  if (this.searchApi.length) {
2366
- let searchUrl = this.searchApi;
2367
- let itemCount = this.data[this.name].length;
2368
- let currentCount = 0;
2412
+ var searchUrl = this.searchApi;
2413
+ var itemCount = this.data[this.name].length;
2414
+ var currentCount = 0;
2369
2415
  this.data[this.name].forEach(function (value) {
2370
2416
  searchUrl += encodeURIComponent('#' + value);
2371
2417
  currentCount++;
@@ -2378,8 +2424,8 @@
2378
2424
  method: 'GET',
2379
2425
  url: searchUrl
2380
2426
  }).done(function (data) {
2381
- let items = data.map(function (item) {
2382
- let label = '';
2427
+ var items = data.map(function (item) {
2428
+ var label = '';
2383
2429
 
2384
2430
  if (item.name) {
2385
2431
  label = item.name;
@@ -2397,7 +2443,7 @@
2397
2443
  items = items.filter(function (item) {
2398
2444
  return self.data[self.name].indexOf(item.id) > -1;
2399
2445
  });
2400
- let result = $(self._renderItemList(items));
2446
+ var result = $(self._renderItemList(items));
2401
2447
  $.when(self.$scrollableContent.append(result)).then(function () {
2402
2448
  if (self.$scrollableContent[0].offsetHeight < self.$scrollableContent[0].scrollHeight) {
2403
2449
  self.scroll.update();
@@ -2417,14 +2463,14 @@
2417
2463
 
2418
2464
  if (type == 'checkbox') {
2419
2465
  self.data[self.name].forEach(function (value) {
2420
- let $input = self.$select.find(':input').filter(function () {
2466
+ var $input = self.$select.find(':input').filter(function () {
2421
2467
  return this.value == value;
2422
2468
  });
2423
2469
  $input.prop('checked', true);
2424
2470
  self.onSelect($input[0]);
2425
2471
  });
2426
2472
  } else if (type == 'radio') {
2427
- let $input = self.$select.find(':input').filter(function () {
2473
+ var $input = self.$select.find(':input').filter(function () {
2428
2474
  return this.value == self.data[self.name];
2429
2475
  });
2430
2476
  $input.prop('checked', true);
@@ -2442,14 +2488,14 @@
2442
2488
 
2443
2489
  if (type == 'checkbox') {
2444
2490
  this.data[this.name].forEach(function (value) {
2445
- let $input = self.$select.find(':input').filter(function () {
2491
+ var $input = self.$select.find(':input').filter(function () {
2446
2492
  return this.value == value;
2447
2493
  });
2448
2494
  $input.prop('checked', true);
2449
2495
  self.onSelect($input[0]);
2450
2496
  });
2451
2497
  } else if (type == 'radio') {
2452
- let $input = this.$select.find(':input').filter(function () {
2498
+ var $input = this.$select.find(':input').filter(function () {
2453
2499
  return this.value == self.data[self.name];
2454
2500
  });
2455
2501
  $input.prop('checked', true);
@@ -2458,11 +2504,11 @@
2458
2504
  }
2459
2505
  }
2460
2506
  } // Search
2507
+ ;
2461
2508
 
2462
-
2463
- search() {
2464
- let self = this;
2465
- let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2509
+ _proto.search = function search() {
2510
+ var self = this;
2511
+ var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2466
2512
 
2467
2513
  if (this.searchString.length) {
2468
2514
  if (this.searchApi.length) {
@@ -2471,7 +2517,7 @@
2471
2517
  method: 'GET',
2472
2518
  url: this.searchApi + this.searchString
2473
2519
  }).done(function (data) {
2474
- let items = data.map(function (item) {
2520
+ var items = data.map(function (item) {
2475
2521
  return {
2476
2522
  id: item.id.toString(),
2477
2523
  label: item.name || item.label || item.value || null
@@ -2484,10 +2530,10 @@
2484
2530
  items = items.filter(function (item) {
2485
2531
  return item.id > 0;
2486
2532
  });
2487
- let result = $(self._renderItemList(items));
2533
+ var result = $(self._renderItemList(items));
2488
2534
  $.when(self.$scrollableContent.append(result)).then(function () {
2489
- let faNameSpace = self.opts.faPro ? 'fal' : 'fas';
2490
- self.$searchIconContainer.html(`<i class="${faNameSpace} fa-times icon"></i>`);
2535
+ var faNameSpace = self.opts.faPro ? 'fal' : 'fas';
2536
+ self.$searchIconContainer.html("<i class=\"" + faNameSpace + " fa-times icon\"></i>");
2491
2537
  self.$searchIconContainer.attr('data-clear-search', 'true');
2492
2538
 
2493
2539
  if (self.$scrollableContent[0].offsetHeight < self.$scrollableContent[0].scrollHeight) {
@@ -2502,7 +2548,7 @@
2502
2548
  });
2503
2549
  });
2504
2550
  } else {
2505
- let results = this.searchData.filter(function (item) {
2551
+ var results = this.searchData.filter(function (item) {
2506
2552
  return item.val.toLocaleLowerCase().indexOf(self.searchString.toLocaleLowerCase()) > -1;
2507
2553
  });
2508
2554
  this.$selectItems.removeClass('d-none');
@@ -2511,18 +2557,18 @@
2511
2557
  $(self.$selectItems[item.id]).addClass('visible');
2512
2558
  });
2513
2559
  this.$selectItems.not('.visible').addClass('d-none');
2514
- this.$searchIconContainer.html(`<i class="${faNameSpace} fa-times icon"></i>`);
2560
+ this.$searchIconContainer.html("<i class=\"" + faNameSpace + " fa-times icon\"></i>");
2515
2561
  this.$searchIconContainer.attr('data-clear-search', 'true');
2516
2562
  }
2517
2563
  } else {
2518
2564
  if (this.searchApi.length) {
2519
2565
  this.$scrollableContent.find('input:not(:checked)').parents('.select-item').not('.static-item').remove();
2520
- this.$searchIconContainer.html(`<i class="${faNameSpace} fa-search icon"></i>`);
2566
+ this.$searchIconContainer.html("<i class=\"" + faNameSpace + " fa-search icon\"></i>");
2521
2567
  this.$searchIconContainer.attr('data-clear-search', '');
2522
2568
  } else {
2523
2569
  this.$selectItems.removeClass('d-none');
2524
2570
  this.$selectItems.removeClass('visible');
2525
- this.$searchIconContainer.html(`<i class="${faNameSpace} fa-search icon"></i>`);
2571
+ this.$searchIconContainer.html("<i class=\"" + faNameSpace + " fa-search icon\"></i>");
2526
2572
  this.$searchIconContainer.attr('data-clear-search', '');
2527
2573
  }
2528
2574
  }
@@ -2533,16 +2579,16 @@
2533
2579
 
2534
2580
  this.onUpdate();
2535
2581
  } // Show
2582
+ ;
2536
2583
 
2537
-
2538
- show() {
2584
+ _proto.show = function show() {
2539
2585
  if (this.$el.hasClass('show')) {
2540
2586
  return;
2541
2587
  }
2542
2588
 
2543
- let $otherSelects = $('.select.show');
2544
- let zindex = 1;
2545
- let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2589
+ var $otherSelects = $('.select.show');
2590
+ var zindex = 1;
2591
+ var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2546
2592
 
2547
2593
  if ($otherSelects.length) {
2548
2594
  zindex = parseInt($otherSelects.first().css('z-index'), 10) + 2;
@@ -2568,129 +2614,71 @@
2568
2614
  }
2569
2615
  }
2570
2616
 
2571
- this.$selectIconContainer.html(`<i class="${faNameSpace} fa-angle-up icon"></i>`);
2617
+ this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-angle-up icon\"></i>");
2572
2618
  this.contentOpen = true;
2573
2619
  this.onShow();
2574
2620
  } // Close
2621
+ ;
2575
2622
 
2576
-
2577
- close() {
2578
- let self = this;
2579
- let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2623
+ _proto.close = function close() {
2624
+ var self = this;
2625
+ var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2580
2626
  this.$el.css('max-height', '');
2581
2627
  this.$el.removeClass('show');
2582
- setTimeout(() => {
2628
+ setTimeout(function () {
2583
2629
  self.$el.removeAttr('style');
2584
2630
  }, 300);
2585
2631
 
2586
2632
  if (this.data[this.name].length > 0) {
2587
- this.$selectIconContainer.html(`<i class="${faNameSpace} fa-check text-green icon"></i>`);
2633
+ this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-green icon\"></i>");
2588
2634
  } else {
2589
- this.$selectIconContainer.html(`<i class="${faNameSpace} fa-angle-down icon"></i>`);
2635
+ this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-angle-down icon\"></i>");
2590
2636
  }
2591
2637
 
2592
2638
  this.contentOpen = false;
2593
2639
  this.onClose();
2594
- }
2640
+ };
2595
2641
 
2596
- onSelect(el) {
2597
- let onSelect = this.opts.onSelect;
2642
+ _proto.onSelect = function onSelect(el) {
2643
+ var onSelect = this.opts.onSelect;
2598
2644
 
2599
2645
  if (typeof onSelect === 'function') {
2600
2646
  onSelect.call(el);
2601
2647
  }
2602
- }
2603
-
2604
- _renderItemList(items) {
2605
- let result = '';
2606
-
2607
- for (let i = 0; i < items.length; ++i) {
2608
- result += `
2609
-
2610
- <div class="select-item">
2611
-
2612
- <div class="select-item-${this.type}">
2613
-
2614
- <div class="styled-${this.type}">
2615
-
2616
- <input type="${this.type}" id="select-${this.name}-${items[i].id}" value="${items[i].id}">
2617
-
2618
- <label for="select-${this.name}-${items[i].id}">
2619
-
2620
- <span class="radio-inner">
2621
- <svg viewBox="0 0 18 18">
2622
- <polyline points="1.5 6 4.5 9 10.5 1"></polyline>
2623
- </svg>
2624
- </span>
2625
-
2626
- <span class="${this.type}-label" data-label>
2627
- ${items[i].label}
2628
- </span>
2629
-
2630
- </label>
2631
-
2632
- </div>
2633
-
2634
- </div>
2648
+ };
2635
2649
 
2636
- </div>
2650
+ _proto._renderItemList = function _renderItemList(items) {
2651
+ var result = '';
2637
2652
 
2638
- `;
2653
+ for (var i = 0; i < items.length; ++i) {
2654
+ result += "\n\n <div class=\"select-item\">\n\n <div class=\"select-item-" + this.type + "\">\n\n <div class=\"styled-" + this.type + "\">\n\n <input type=\"" + this.type + "\" id=\"select-" + this.name + "-" + items[i].id + "\" value=\"" + items[i].id + "\">\n\n <label for=\"select-" + this.name + "-" + items[i].id + "\">\n\n <span class=\"radio-inner\">\n <svg viewBox=\"0 0 18 18\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n </span>\n\n <span class=\"" + this.type + "-label\" data-label>\n " + items[i].label + "\n </span>\n\n </label>\n\n </div>\n\n </div>\n\n </div>\n\n ";
2639
2655
  }
2640
2656
 
2641
2657
  return result;
2642
- }
2658
+ };
2643
2659
 
2644
- _renderSearch() {
2660
+ _proto._renderSearch = function _renderSearch() {
2645
2661
  if (!this.showSearch) {
2646
2662
  return '';
2647
2663
  }
2648
2664
 
2649
- let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2650
- return `
2651
-
2652
- <div class="select-search">
2653
-
2654
- <div class="select-search-input">
2655
-
2656
- <input type="text" name="select-search" value="" placeholder="${this.opts.searchPlaceholder}">
2657
-
2658
- </div>
2659
-
2660
- <div class="select-search-icon">
2661
-
2662
- <i class="${faNameSpace} fa-search icon"></i>
2663
-
2664
- </div>
2665
-
2666
- </div>
2667
-
2668
- `;
2669
- }
2665
+ var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
2666
+ return "\n\n <div class=\"select-search\">\n\n <div class=\"select-search-input\">\n\n <input type=\"text\" name=\"select-search\" value=\"\" placeholder=\"" + this.opts.searchPlaceholder + "\">\n\n </div>\n\n <div class=\"select-search-icon\">\n\n <i class=\"" + faNameSpace + " fa-search icon\"></i>\n\n </div>\n\n </div>\n\n ";
2667
+ };
2670
2668
 
2671
- _renderFooter() {
2669
+ _proto._renderFooter = function _renderFooter() {
2672
2670
  if (!this.showFooter) {
2673
2671
  return '';
2674
2672
  }
2675
2673
 
2676
- return `
2677
-
2678
- <div class="select-footer">
2679
-
2680
- <button class="btn btn-primary" type="button" data-select-close>
2681
- ${this.opts.btnCloseText}
2682
- </button>
2683
-
2684
- </div>
2685
-
2686
- `;
2687
- }
2674
+ return "\n\n <div class=\"select-footer\">\n\n <button class=\"btn btn-primary\" type=\"button\" data-select-close>\n " + this.opts.btnCloseText + "\n </button>\n\n </div>\n\n ";
2675
+ };
2688
2676
 
2689
- static _jQueryInterface(config) {
2677
+ Select._jQueryInterface = function _jQueryInterface(config) {
2690
2678
  return this.each(function () {
2691
- let data = $(this).data(DATA_KEY$1);
2679
+ var data = $(this).data(DATA_KEY$1);
2692
2680
 
2693
- const _config = typeof config === 'object' && config;
2681
+ var _config = typeof config === 'object' && config;
2694
2682
 
2695
2683
  if (!data) {
2696
2684
  data = new Select(this, _config);
@@ -2699,24 +2687,25 @@
2699
2687
 
2700
2688
  if (typeof config === 'string') {
2701
2689
  if (typeof data[config] === 'undefined') {
2702
- throw new TypeError(`No method named "${config}"`);
2690
+ throw new TypeError("No method named \"" + config + "\"");
2703
2691
  }
2704
2692
 
2705
2693
  data[config]();
2706
2694
  }
2707
2695
  });
2708
- }
2696
+ };
2709
2697
 
2710
- }
2698
+ return Select;
2699
+ }(AbstractUIComponent);
2711
2700
 
2712
2701
  if (typeof $ !== 'undefined') {
2713
2702
  // jQuery
2714
- const JQUERY_NO_CONFLICT = $.fn[NAME$1];
2703
+ var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
2715
2704
  $.fn[NAME$1] = Select._jQueryInterface;
2716
2705
  $.fn[NAME$1].Constructor = Select;
2717
2706
 
2718
- $.fn[NAME$1].noConflict = () => {
2719
- $.fn[NAME$1] = JQUERY_NO_CONFLICT;
2707
+ $.fn[NAME$1].noConflict = function () {
2708
+ $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
2720
2709
  return Select._jQueryInterface;
2721
2710
  };
2722
2711
 
@@ -2743,49 +2732,66 @@
2743
2732
  };
2744
2733
  }
2745
2734
 
2746
- const NAME$2 = 'coolDropdown';
2747
- const DATA_KEY$2 = 'plugin_coolDropdown';
2735
+ var NAME$2 = 'coolDropdown';
2736
+ var DATA_KEY$2 = 'plugin_coolDropdown';
2737
+
2738
+ var Dropdown =
2739
+ /*#__PURE__*/
2740
+ function (_AbstractUIComponent) {
2741
+ _inheritsLoose(Dropdown, _AbstractUIComponent);
2748
2742
 
2749
- class Dropdown extends AbstractUIComponent {
2750
- constructor(el, opts) {
2751
- super();
2752
- this.opts = {};
2743
+ function Dropdown(el, opts) {
2744
+ var _this;
2745
+
2746
+ _this = _AbstractUIComponent.call(this) || this;
2747
+ _this.opts = {};
2753
2748
 
2754
2749
  if (window.Cool.settings.dropdown) {
2755
- $.extend(true, this.opts, $.fn[NAME$2].defaults, window.Cool.settings.dropdown, opts);
2750
+ $.extend(true, _this.opts, $.fn[NAME$2].defaults, window.Cool.settings.dropdown, opts);
2756
2751
  } else {
2757
- $.extend(true, this.opts, $.fn[NAME$2].defaults, opts);
2752
+ $.extend(true, _this.opts, $.fn[NAME$2].defaults, opts);
2758
2753
  }
2759
2754
 
2760
- this.el = el;
2761
- this.debug = this.opts.debug;
2762
- this.init();
2755
+ _this.el = el;
2756
+ _this.debug = _this.opts.debug;
2757
+
2758
+ _this.init();
2759
+
2760
+ return _this;
2763
2761
  } // Init plugin
2764
2762
 
2765
2763
 
2766
- init() {
2767
- $.when(this.buildCache()).then(() => {
2768
- this.buildScroll();
2769
- this.bindEvents();
2770
- this.onInit();
2764
+ var _proto = Dropdown.prototype;
2765
+
2766
+ _proto.init = function init() {
2767
+ var _this2 = this;
2768
+
2769
+ $.when(this.buildCache()).then(function () {
2770
+ _this2.buildScroll();
2771
+
2772
+ _this2.bindEvents();
2773
+
2774
+ _this2.onInit();
2771
2775
  });
2772
2776
  } // Remove plugin instance completely
2777
+ ;
2773
2778
 
2774
-
2775
- destroy() {
2779
+ _proto.destroy = function destroy() {
2776
2780
  this.unbindEvents();
2777
2781
  this.$el.removeData(DATA_KEY$2);
2778
2782
  this.onDestroy();
2779
2783
  } // Update plugin data
2784
+ ;
2780
2785
 
2781
-
2782
- update() {
2786
+ _proto.update = function update() {
2783
2787
  this.buildCache();
2784
2788
  this.onUpdate();
2785
2789
  } // Cache DOM nodes for performance
2790
+ ;
2786
2791
 
2792
+ _proto.buildCache = function buildCache() {
2793
+ var _this3 = this;
2787
2794
 
2788
- buildCache() {
2789
2795
  this.$el = $(this.el);
2790
2796
  this.$el.addClass('dropdown-trigger');
2791
2797
  this.$container = this.$el.parent('.dropdown');
@@ -2813,35 +2819,45 @@
2813
2819
  }
2814
2820
 
2815
2821
  if (typeof this.content === 'function') {
2816
- let menuRight = this.opts.align === 'end' ? ' dropdown-menu-right' : '';
2817
- this.$dropdown = $(`
2818
- <div class="dropdown-menu${menuRight}" id="${this.id}">
2819
- ${this.content}
2820
- </div>
2821
- `);
2822
- $.when(this.$el.after(this.$dropdown)).then(() => {
2823
- this.$scrollableContent = this.$dropdown.find('.dropdown-scrollable-content') ? this.$dropdown.find('.dropdown-scrollable-content') : false;
2824
- this.$dropdown.hasClass('dropdown-menu-right') ? this.align = 'end' : this.align = 'start';
2825
- this.$dropdownItem = this.$dropdown.find('.dropdown-item');
2826
-
2827
- if (this.minWidth) {
2828
- this.$dropdown.css('min-width', this.minWidth + 'px');
2822
+ var menuRight = this.opts.align === 'end' ? ' dropdown-menu-right' : '';
2823
+ this.$dropdown = $("\n <div class=\"dropdown-menu" + menuRight + "\" id=\"" + this.id + "\">\n " + this.content + "\n </div>\n ");
2824
+ $.when(this.$el.after(this.$dropdown)).then(function () {
2825
+ _this3.$scrollableContent = _this3.$dropdown.find('.dropdown-scrollable-content') ? _this3.$dropdown.find('.dropdown-scrollable-content') : false;
2826
+ _this3.$dropdown.hasClass('dropdown-menu-right') ? _this3.align = 'end' : _this3.align = 'start';
2827
+ _this3.$dropdownItem = _this3.$dropdown.find('.dropdown-item');
2828
+
2829
+ if (_this3.minWidth) {
2830
+ _this3.$dropdown.css('min-width', _this3.minWidth + 'px');
2829
2831
  }
2830
2832
 
2831
- this.log(this.$el);
2832
- this.log(this.$container);
2833
- this.log(this.$dropdown);
2834
- this.log(this.$scrollableContent);
2835
- this.log('Id: ' + this.id);
2836
- this.log('Animation: ' + this.animation);
2837
- this.log('Animation in: ' + this.animationIn);
2838
- this.log('Animation out: ' + this.animationOut);
2839
- this.log('Animation speed: ' + this.animationSpeed);
2840
- this.log('Offset: ' + this.offset);
2841
- this.log('Min width: ' + this.minWidth);
2842
- this.log('Content: ' + this.content);
2843
- this.log('Scroll: ' + this.scroll);
2844
- this.log('Scroll content height: ' + this.scrollContentHeight + 'px');
2833
+ _this3.log(_this3.$el);
2834
+
2835
+ _this3.log(_this3.$container);
2836
+
2837
+ _this3.log(_this3.$dropdown);
2838
+
2839
+ _this3.log(_this3.$scrollableContent);
2840
+
2841
+ _this3.log('Id: ' + _this3.id);
2842
+
2843
+ _this3.log('Animation: ' + _this3.animation);
2844
+
2845
+ _this3.log('Animation in: ' + _this3.animationIn);
2846
+
2847
+ _this3.log('Animation out: ' + _this3.animationOut);
2848
+
2849
+ _this3.log('Animation speed: ' + _this3.animationSpeed);
2850
+
2851
+ _this3.log('Offset: ' + _this3.offset);
2852
+
2853
+ _this3.log('Min width: ' + _this3.minWidth);
2854
+
2855
+ _this3.log('Content: ' + _this3.content);
2856
+
2857
+ _this3.log('Scroll: ' + _this3.scroll);
2858
+
2859
+ _this3.log('Scroll content height: ' + _this3.scrollContentHeight + 'px');
2860
+
2845
2861
  return true;
2846
2862
  });
2847
2863
  } else {
@@ -2871,9 +2887,9 @@
2871
2887
  return true;
2872
2888
  }
2873
2889
  } // Build scroll
2890
+ ;
2874
2891
 
2875
-
2876
- buildScroll() {
2892
+ _proto.buildScroll = function buildScroll() {
2877
2893
  if (this.opts.scroll && this.$scrollableContent.length) {
2878
2894
  this.$scrollableContent.css({
2879
2895
  'max-height': this.scrollContentHeight + 'px'
@@ -2896,15 +2912,17 @@
2896
2912
  }
2897
2913
  }
2898
2914
  } // Bind events that trigger methods
2915
+ ;
2899
2916
 
2917
+ _proto.bindEvents = function bindEvents() {
2918
+ var _this4 = this;
2900
2919
 
2901
- bindEvents() {
2902
- let self = this;
2903
- this.$el.on('click' + '.' + NAME$2, () => {
2904
- if (this.contentOpen) {
2905
- this.close();
2920
+ var self = this;
2921
+ this.$el.on('click' + '.' + NAME$2, function () {
2922
+ if (_this4.contentOpen) {
2923
+ _this4.close();
2906
2924
  } else {
2907
- this.show();
2925
+ _this4.show();
2908
2926
  }
2909
2927
  });
2910
2928
  this.$dropdownItem.on('click' + '.' + NAME$2, function () {
@@ -2914,45 +2932,46 @@
2914
2932
 
2915
2933
  self.onItemClick(this);
2916
2934
  });
2917
- $(document).on('touchstart click', e => {
2918
- if (!this.$el.is(e.target) && !this.$dropdown.is(e.target) && this.$dropdown.has(e.target).length === 0 && this.contentOpen) {
2919
- this.close();
2935
+ $(document).on('touchstart click', function (e) {
2936
+ if (!_this4.$el.is(e.target) && !_this4.$dropdown.is(e.target) && _this4.$dropdown.has(e.target).length === 0 && _this4.contentOpen) {
2937
+ _this4.close();
2920
2938
  }
2921
2939
  });
2922
- $(window).on('resize', debounce(() => {
2923
- this.setPosition();
2924
- this.onUpdate();
2940
+ $(window).on('resize', debounce(function () {
2941
+ _this4.setPosition();
2942
+
2943
+ _this4.onUpdate();
2925
2944
  }, 250));
2926
2945
  } // Unbind events that trigger methods
2946
+ ;
2927
2947
 
2928
-
2929
- unbindEvents() {
2948
+ _proto.unbindEvents = function unbindEvents() {
2930
2949
  this.$el.off('.' + NAME$2);
2931
2950
  } // Generate UUID
2951
+ ;
2932
2952
 
2933
-
2934
- generateUUID() {
2953
+ _proto.generateUUID = function generateUUID() {
2935
2954
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2936
- let r = Math.random() * 16 | 0,
2955
+ var r = Math.random() * 16 | 0,
2937
2956
  v = c == 'x' ? r : r & 0x3 | 0x8;
2938
2957
  return v.toString(16);
2939
2958
  });
2940
2959
  } // Set positions
2960
+ ;
2941
2961
 
2942
-
2943
- setPosition(placement) {
2962
+ _proto.setPosition = function setPosition(placement) {
2944
2963
  if (typeof str === 'undefined' || str === null) {
2945
2964
  placement = this.placement;
2946
2965
  }
2947
2966
 
2948
- let dropdownWidth = this.$dropdown.outerWidth(true);
2949
- let dropdownHeight = this.$dropdown.outerHeight(true);
2950
- let dropdownTriggerWidth = this.$el.outerWidth(true);
2951
- let dropdownTriggerHeight = this.$el.outerHeight(true);
2952
- let dropdownTriggerPosX = this.$el.position().left;
2953
- let dropdownTriggerPosY = this.$el.position().top;
2954
- let dropdownPosX;
2955
- let dropdownPosY;
2967
+ var dropdownWidth = this.$dropdown.outerWidth(true);
2968
+ var dropdownHeight = this.$dropdown.outerHeight(true);
2969
+ var dropdownTriggerWidth = this.$el.outerWidth(true);
2970
+ var dropdownTriggerHeight = this.$el.outerHeight(true);
2971
+ var dropdownTriggerPosX = this.$el.position().left;
2972
+ var dropdownTriggerPosY = this.$el.position().top;
2973
+ var dropdownPosX;
2974
+ var dropdownPosY;
2956
2975
 
2957
2976
  if (placement === 'top') {
2958
2977
  if (this.align === 'end') {
@@ -2979,9 +2998,9 @@
2979
2998
  }
2980
2999
 
2981
3000
  if (this.offset) {
2982
- let offsets = this.offset.split(',');
2983
- let offsetX = offsets[0];
2984
- let offsetY = offsets[1];
3001
+ var offsets = this.offset.split(',');
3002
+ var offsetX = offsets[0];
3003
+ var offsetY = offsets[1];
2985
3004
  dropdownPosX += parseInt(offsetX, 10);
2986
3005
  dropdownPosY += parseInt(offsetY, 10);
2987
3006
  }
@@ -3002,9 +3021,9 @@
3002
3021
  this.log('Dropdown position x: ' + dropdownPosX + 'px');
3003
3022
  this.log('Dropdown position y: ' + dropdownPosY + 'px');
3004
3023
  } // Show
3024
+ ;
3005
3025
 
3006
-
3007
- show() {
3026
+ _proto.show = function show() {
3008
3027
  if (!this.$dropdown || this.$dropdown.hasClass('show')) {
3009
3028
  return;
3010
3029
  }
@@ -3033,17 +3052,20 @@
3033
3052
  this.contentOpen = true;
3034
3053
  this.onShow();
3035
3054
  } // Close
3055
+ ;
3036
3056
 
3057
+ _proto.close = function close() {
3058
+ var _this5 = this;
3037
3059
 
3038
- close() {
3039
3060
  if (!this.$dropdown) {
3040
3061
  return;
3041
3062
  }
3042
3063
 
3043
3064
  if (this.animation && !this.$dropdown.hasClass('animated')) {
3044
- this.$dropdown.animateCss(this.animationOut, () => {
3045
- this.$dropdown.removeClass('show');
3046
- this.$el.removeAttr('data-dropdown');
3065
+ this.$dropdown.animateCss(this.animationOut, function () {
3066
+ _this5.$dropdown.removeClass('show');
3067
+
3068
+ _this5.$el.removeAttr('data-dropdown');
3047
3069
  });
3048
3070
  } else {
3049
3071
  this.$dropdown.removeClass('show');
@@ -3053,21 +3075,21 @@
3053
3075
  this.contentOpen = false;
3054
3076
  this.onClose();
3055
3077
  } // Item callback
3078
+ ;
3056
3079
 
3057
-
3058
- onItemClick(el) {
3059
- let onItemClick = this.opts.onItemClick;
3080
+ _proto.onItemClick = function onItemClick(el) {
3081
+ var onItemClick = this.opts.onItemClick;
3060
3082
 
3061
3083
  if (typeof onItemClick === 'function') {
3062
3084
  onItemClick.call(el);
3063
3085
  }
3064
- }
3086
+ };
3065
3087
 
3066
- static _jQueryInterface(config) {
3088
+ Dropdown._jQueryInterface = function _jQueryInterface(config) {
3067
3089
  return this.each(function () {
3068
- let data = $(this).data(DATA_KEY$2);
3090
+ var data = $(this).data(DATA_KEY$2);
3069
3091
 
3070
- const _config = typeof config === 'object' && config;
3092
+ var _config = typeof config === 'object' && config;
3071
3093
 
3072
3094
  if (!data) {
3073
3095
  data = new Dropdown(this, _config);
@@ -3076,24 +3098,25 @@
3076
3098
 
3077
3099
  if (typeof config === 'string') {
3078
3100
  if (typeof data[config] === 'undefined') {
3079
- throw new TypeError(`No method named "${config}"`);
3101
+ throw new TypeError("No method named \"" + config + "\"");
3080
3102
  }
3081
3103
 
3082
3104
  data[config]();
3083
3105
  }
3084
3106
  });
3085
- }
3107
+ };
3086
3108
 
3087
- }
3109
+ return Dropdown;
3110
+ }(AbstractUIComponent);
3088
3111
 
3089
3112
  if (typeof $ !== 'undefined') {
3090
3113
  // jQuery
3091
- const JQUERY_NO_CONFLICT = $.fn[NAME$2];
3114
+ var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
3092
3115
  $.fn[NAME$2] = Dropdown._jQueryInterface;
3093
3116
  $.fn[NAME$2].Constructor = Dropdown;
3094
3117
 
3095
- $.fn[NAME$2].noConflict = () => {
3096
- $.fn[NAME$2] = JQUERY_NO_CONFLICT;
3118
+ $.fn[NAME$2].noConflict = function () {
3119
+ $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
3097
3120
  return Dropdown._jQueryInterface;
3098
3121
  };
3099
3122
 
@@ -3119,47 +3142,58 @@
3119
3142
  };
3120
3143
  }
3121
3144
 
3122
- const NAME$3 = 'coolTooltip';
3123
- const DATA_KEY$3 = 'plugin_coolTooltip';
3145
+ var NAME$3 = 'coolTooltip';
3146
+ var DATA_KEY$3 = 'plugin_coolTooltip';
3147
+
3148
+ var Tooltip =
3149
+ /*#__PURE__*/
3150
+ function (_AbstractUIComponent) {
3151
+ _inheritsLoose(Tooltip, _AbstractUIComponent);
3124
3152
 
3125
- class Tooltip extends AbstractUIComponent {
3126
- constructor(el, opts) {
3127
- super();
3128
- this.opts = {};
3153
+ function Tooltip(el, opts) {
3154
+ var _this;
3155
+
3156
+ _this = _AbstractUIComponent.call(this) || this;
3157
+ _this.opts = {};
3129
3158
 
3130
3159
  if (window.Cool.settings.tooltip) {
3131
- $.extend(true, this.opts, $.fn[NAME$3].defaults, window.Cool.settings.tooltip, opts);
3160
+ $.extend(true, _this.opts, $.fn[NAME$3].defaults, window.Cool.settings.tooltip, opts);
3132
3161
  } else {
3133
- $.extend(true, this.opts, $.fn[NAME$3].defaults, opts);
3162
+ $.extend(true, _this.opts, $.fn[NAME$3].defaults, opts);
3134
3163
  }
3135
3164
 
3136
- this.el = el;
3137
- this.debug = this.opts.debug;
3138
- this.init();
3165
+ _this.el = el;
3166
+ _this.debug = _this.opts.debug;
3167
+
3168
+ _this.init();
3169
+
3170
+ return _this;
3139
3171
  } // Init plugin
3140
3172
 
3141
3173
 
3142
- init() {
3174
+ var _proto = Tooltip.prototype;
3175
+
3176
+ _proto.init = function init() {
3143
3177
  this.buildCache();
3144
3178
  this.bindEvents();
3145
3179
  this.onInit();
3146
3180
  } // Remove plugin instance completely
3181
+ ;
3147
3182
 
3148
-
3149
- destroy() {
3183
+ _proto.destroy = function destroy() {
3150
3184
  this.unbindEvents();
3151
3185
  this.$el.removeData(DATA_KEY$3);
3152
3186
  this.onDestroy();
3153
3187
  } // Update plugin data
3188
+ ;
3154
3189
 
3155
-
3156
- update() {
3190
+ _proto.update = function update() {
3157
3191
  this.buildCache();
3158
3192
  this.onUpdate();
3159
3193
  } // Cache DOM nodes for performance
3194
+ ;
3160
3195
 
3161
-
3162
- buildCache() {
3196
+ _proto.buildCache = function buildCache() {
3163
3197
  this.$el = $(this.el);
3164
3198
  this.$container = this.$el.data('container') ? $(this.$el.data('container')) : $(this.opts.container);
3165
3199
  this.id = 'tooltip-' + this.generateUUID();
@@ -3171,50 +3205,43 @@
3171
3205
  this.placementChanged = false;
3172
3206
  this.content = this.$el.data('content') ? this.$el.data('content') : this.opts.content;
3173
3207
  } // Bind events that trigger methods
3208
+ ;
3174
3209
 
3210
+ _proto.bindEvents = function bindEvents() {
3211
+ var _this2 = this;
3175
3212
 
3176
- bindEvents() {
3177
- this.$el.on('mouseenter' + '.' + NAME$3, () => {
3178
- this.show();
3213
+ this.$el.on('mouseenter' + '.' + NAME$3, function () {
3214
+ _this2.show();
3179
3215
  });
3180
- this.$el.on('mouseleave' + '.' + NAME$3, () => {
3181
- this.close();
3216
+ this.$el.on('mouseleave' + '.' + NAME$3, function () {
3217
+ _this2.close();
3182
3218
  });
3183
- $(window).on('resize', debounce(() => {
3184
- if (this.$tooltip) {
3185
- this.setPosition();
3186
- this.onUpdate();
3219
+ $(window).on('resize', debounce(function () {
3220
+ if (_this2.$tooltip) {
3221
+ _this2.setPosition();
3222
+
3223
+ _this2.onUpdate();
3187
3224
  }
3188
3225
  }, 250));
3189
3226
  } // Unbind events that trigger methods
3227
+ ;
3190
3228
 
3191
-
3192
- unbindEvents() {
3229
+ _proto.unbindEvents = function unbindEvents() {
3193
3230
  this.$el.off('.' + NAME$3);
3194
3231
  } // Generate UUID
3232
+ ;
3195
3233
 
3196
-
3197
- generateUUID() {
3234
+ _proto.generateUUID = function generateUUID() {
3198
3235
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3199
- let r = Math.random() * 16 | 0,
3236
+ var r = Math.random() * 16 | 0,
3200
3237
  v = c == 'x' ? r : r & 0x3 | 0x8;
3201
3238
  return v.toString(16);
3202
3239
  });
3203
3240
  } // Build tooltip
3241
+ ;
3204
3242
 
3205
-
3206
- buildTooltip() {
3207
- this.$tooltip = $(`
3208
-
3209
- <div class="tooltip" role="tooltip" id="${this.id}">
3210
-
3211
- <div class="arrow"></div>
3212
-
3213
- <div class="tooltip-inner">${this.content}</div>
3214
-
3215
- </div>
3216
-
3217
- `);
3243
+ _proto.buildTooltip = function buildTooltip() {
3244
+ this.$tooltip = $("\n\n <div class=\"tooltip\" role=\"tooltip\" id=\"" + this.id + "\">\n\n <div class=\"arrow\"></div>\n\n <div class=\"tooltip-inner\">" + this.content + "</div>\n\n </div>\n\n ");
3218
3245
  this.$container.append(this.$tooltip);
3219
3246
  this.$arrow = this.$tooltip.find('.arrow');
3220
3247
  this.log(this.$el);
@@ -3229,27 +3256,27 @@
3229
3256
  this.log('Placement: ' + this.placement);
3230
3257
  this.log('Content: ' + this.content);
3231
3258
  } // Set positions
3259
+ ;
3232
3260
 
3233
-
3234
- setPosition(placement) {
3261
+ _proto.setPosition = function setPosition(placement) {
3235
3262
  if (typeof placement === 'undefined' || placement === null) {
3236
3263
  placement = this.placement;
3237
3264
  }
3238
3265
 
3239
3266
  this.$tooltip.addClass('tooltip-' + placement);
3240
- let containerInnerWidth = this.$container.innerWidth();
3241
- let containerInnerHeight = this.$container.innerHeight();
3242
- let tooltipWidth = this.$tooltip.outerWidth(true);
3243
- let tooltipHeight = this.$tooltip.outerHeight(true);
3244
- let tooltipTriggerWidth = this.$el.outerWidth();
3245
- let tooltipTriggerHeight = this.$el.outerHeight();
3246
- let tooltipTriggerPosX = this.$el.offset().left;
3247
- let tooltipTriggerPosY = this.$el.offset().top;
3248
- let arrowWidth = this.$arrow.outerWidth(true);
3249
- let arrowHeight = this.$arrow.outerHeight(true);
3250
- let arrowPos;
3251
- let tooltipPosX;
3252
- let tooltipPosY;
3267
+ var containerInnerWidth = this.$container.innerWidth();
3268
+ var containerInnerHeight = this.$container.innerHeight();
3269
+ var tooltipWidth = this.$tooltip.outerWidth(true);
3270
+ var tooltipHeight = this.$tooltip.outerHeight(true);
3271
+ var tooltipTriggerWidth = this.$el.outerWidth();
3272
+ var tooltipTriggerHeight = this.$el.outerHeight();
3273
+ var tooltipTriggerPosX = this.$el.offset().left;
3274
+ var tooltipTriggerPosY = this.$el.offset().top;
3275
+ var arrowWidth = this.$arrow.outerWidth(true);
3276
+ var arrowHeight = this.$arrow.outerHeight(true);
3277
+ var arrowPos;
3278
+ var tooltipPosX;
3279
+ var tooltipPosY;
3253
3280
 
3254
3281
  if (placement === 'top') {
3255
3282
  tooltipPosX = Math.round(tooltipTriggerPosX - (tooltipWidth - tooltipTriggerWidth) / 2);
@@ -3289,14 +3316,14 @@
3289
3316
  'will-change': 'transform'
3290
3317
  }); // Correct placement if tooltip goes outside of container
3291
3318
 
3292
- let tooltipOverflowCount = 0;
3293
- let tooltipPosition = {
3319
+ var tooltipOverflowCount = 0;
3320
+ var tooltipPosition = {
3294
3321
  left: this.$tooltip.position().left,
3295
3322
  top: this.$tooltip.position().top,
3296
3323
  right: containerInnerWidth - (this.$tooltip.position().left + tooltipWidth),
3297
3324
  bottom: containerInnerHeight - (this.$tooltip.position().top + tooltipHeight)
3298
3325
  };
3299
- let tooltipOverflow = {
3326
+ var tooltipOverflow = {
3300
3327
  left: false,
3301
3328
  top: false,
3302
3329
  right: false,
@@ -3375,8 +3402,8 @@
3375
3402
 
3376
3403
  if (tooltipOverflow.left) {
3377
3404
  this.log('Tooltip overflowing from left');
3378
- let overflowAmount = Math.abs(tooltipPosition.left);
3379
- let excludePlacements = ['top', 'bottom'];
3405
+ var overflowAmount = Math.abs(tooltipPosition.left);
3406
+ var excludePlacements = ['top', 'bottom'];
3380
3407
 
3381
3408
  if (tooltipTriggerPosX >= tooltipPosX + overflowAmount && excludePlacements.indexOf(placement) < 0) {
3382
3409
  this.log('Tooltip adjusting width');
@@ -3391,33 +3418,39 @@
3391
3418
 
3392
3419
  if (tooltipOverflow.top) {
3393
3420
  this.log('Tooltip overflowing from top');
3394
- let overflowAmount = Math.abs(tooltipPosition.top);
3421
+
3422
+ var _overflowAmount = Math.abs(tooltipPosition.top);
3423
+
3395
3424
  this.log('Tooltip adjusting position y');
3396
- tooltipPosY += overflowAmount;
3397
- arrowPos -= overflowAmount;
3425
+ tooltipPosY += _overflowAmount;
3426
+ arrowPos -= _overflowAmount;
3398
3427
  }
3399
3428
 
3400
3429
  if (tooltipOverflow.right) {
3401
3430
  this.log('Tooltip overflowing from right');
3402
- let overflowAmount = Math.abs(tooltipPosition.right);
3403
- let excludePlacements = ['top', 'bottom'];
3404
3431
 
3405
- if (tooltipTriggerPosX <= tooltipPosX - overflowAmount && excludePlacements.indexOf(placement) < 0) {
3432
+ var _overflowAmount2 = Math.abs(tooltipPosition.right);
3433
+
3434
+ var _excludePlacements = ['top', 'bottom'];
3435
+
3436
+ if (tooltipTriggerPosX <= tooltipPosX - _overflowAmount2 && _excludePlacements.indexOf(placement) < 0) {
3406
3437
  this.log('Tooltip adjusting width');
3407
- tooltipWidth -= overflowAmount;
3438
+ tooltipWidth -= _overflowAmount2;
3408
3439
  } else {
3409
3440
  this.log('Tooltip adjusting position x');
3410
- tooltipPosX -= overflowAmount;
3411
- arrowPos += overflowAmount;
3441
+ tooltipPosX -= _overflowAmount2;
3442
+ arrowPos += _overflowAmount2;
3412
3443
  }
3413
3444
  }
3414
3445
 
3415
3446
  if (tooltipOverflow.bottom) {
3416
3447
  this.log('Tooltip overflowing from bottom');
3417
- let overflowAmount = Math.abs(tooltipPosition.bottom);
3448
+
3449
+ var _overflowAmount3 = Math.abs(tooltipPosition.bottom);
3450
+
3418
3451
  this.log('Tooltip adjusting position y');
3419
- tooltipPosY -= overflowAmount;
3420
- arrowPos += overflowAmount;
3452
+ tooltipPosY -= _overflowAmount3;
3453
+ arrowPos += _overflowAmount3;
3421
3454
  }
3422
3455
 
3423
3456
  if (placement === 'top') {
@@ -3477,9 +3510,9 @@
3477
3510
  this.log('Tooltip position bottom: ' + tooltipPosition.bottom + 'px');
3478
3511
  }
3479
3512
  } // Show
3513
+ ;
3480
3514
 
3481
-
3482
- show() {
3515
+ _proto.show = function show() {
3483
3516
  if (this.$tooltip) {
3484
3517
  return;
3485
3518
  }
@@ -3501,20 +3534,25 @@
3501
3534
 
3502
3535
  this.onShow();
3503
3536
  } // Close
3537
+ ;
3504
3538
 
3539
+ _proto.close = function close() {
3540
+ var _this3 = this;
3505
3541
 
3506
- close() {
3507
3542
  if (!this.$tooltip) {
3508
3543
  return;
3509
3544
  }
3510
3545
 
3511
3546
  if (this.animation && !this.$tooltip.hasClass('animated')) {
3512
- this.$tooltip.animateCss(this.animationOut, () => {
3513
- this.$tooltip.remove();
3514
- this.$el.removeAttr('data-tooltip');
3515
- this.$tooltip = null;
3516
- this.placementChanged = false;
3517
- this.onClose();
3547
+ this.$tooltip.animateCss(this.animationOut, function () {
3548
+ _this3.$tooltip.remove();
3549
+
3550
+ _this3.$el.removeAttr('data-tooltip');
3551
+
3552
+ _this3.$tooltip = null;
3553
+ _this3.placementChanged = false;
3554
+
3555
+ _this3.onClose();
3518
3556
  });
3519
3557
  } else {
3520
3558
  this.$tooltip.remove();
@@ -3523,13 +3561,13 @@
3523
3561
  this.placementChanged = false;
3524
3562
  this.onClose();
3525
3563
  }
3526
- }
3564
+ };
3527
3565
 
3528
- static _jQueryInterface(config) {
3566
+ Tooltip._jQueryInterface = function _jQueryInterface(config) {
3529
3567
  return this.each(function () {
3530
- let data = $(this).data(DATA_KEY$3);
3568
+ var data = $(this).data(DATA_KEY$3);
3531
3569
 
3532
- const _config = typeof config === 'object' && config;
3570
+ var _config = typeof config === 'object' && config;
3533
3571
 
3534
3572
  if (!data) {
3535
3573
  data = new Tooltip(this, _config);
@@ -3538,24 +3576,25 @@
3538
3576
 
3539
3577
  if (typeof config === 'string') {
3540
3578
  if (typeof data[config] === 'undefined') {
3541
- throw new TypeError(`No method named "${config}"`);
3579
+ throw new TypeError("No method named \"" + config + "\"");
3542
3580
  }
3543
3581
 
3544
3582
  data[config]();
3545
3583
  }
3546
3584
  });
3547
- }
3585
+ };
3548
3586
 
3549
- }
3587
+ return Tooltip;
3588
+ }(AbstractUIComponent);
3550
3589
 
3551
3590
  if (typeof $ !== 'undefined') {
3552
3591
  // jQuery
3553
- const JQUERY_NO_CONFLICT = $.fn[NAME$3];
3592
+ var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
3554
3593
  $.fn[NAME$3] = Tooltip._jQueryInterface;
3555
3594
  $.fn[NAME$3].Constructor = Tooltip;
3556
3595
 
3557
- $.fn[NAME$3].noConflict = () => {
3558
- $.fn[NAME$3] = JQUERY_NO_CONFLICT;
3596
+ $.fn[NAME$3].noConflict = function () {
3597
+ $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
3559
3598
  return Tooltip._jQueryInterface;
3560
3599
  };
3561
3600
 
@@ -3576,48 +3615,59 @@
3576
3615
  };
3577
3616
  }
3578
3617
 
3579
- const NAME$4 = 'coolSectionTabs';
3580
- const DATA_KEY$4 = 'plugin_coolSectionTabs';
3618
+ var NAME$4 = 'coolSectionTabs';
3619
+ var DATA_KEY$4 = 'plugin_coolSectionTabs';
3620
+
3621
+ var SectionTabs =
3622
+ /*#__PURE__*/
3623
+ function (_AbstractUIComponent) {
3624
+ _inheritsLoose(SectionTabs, _AbstractUIComponent);
3581
3625
 
3582
- class SectionTabs extends AbstractUIComponent {
3583
- constructor(el, opts) {
3584
- super();
3585
- this.opts = {};
3626
+ function SectionTabs(el, opts) {
3627
+ var _this;
3628
+
3629
+ _this = _AbstractUIComponent.call(this) || this;
3630
+ _this.opts = {};
3586
3631
 
3587
3632
  if (window.Cool.settings.sectionTabs) {
3588
- $.extend(true, this.opts, $.fn[NAME$4].defaults, window.Cool.settings.sectionTabs, opts);
3633
+ $.extend(true, _this.opts, $.fn[NAME$4].defaults, window.Cool.settings.sectionTabs, opts);
3589
3634
  } else {
3590
- $.extend(true, this.opts, $.fn[NAME$4].defaults, opts);
3635
+ $.extend(true, _this.opts, $.fn[NAME$4].defaults, opts);
3591
3636
  }
3592
3637
 
3593
- this.el = el;
3594
- this.debug = this.opts.debug;
3595
- this.init();
3638
+ _this.el = el;
3639
+ _this.debug = _this.opts.debug;
3640
+
3641
+ _this.init();
3642
+
3643
+ return _this;
3596
3644
  } // Init plugin
3597
3645
 
3598
3646
 
3599
- init() {
3647
+ var _proto = SectionTabs.prototype;
3648
+
3649
+ _proto.init = function init() {
3600
3650
  this.buildCache();
3601
3651
  this.bindEvents();
3602
3652
  this.checkForChanges();
3603
3653
  this.onInit();
3604
3654
  } // Remove plugin instance completely
3655
+ ;
3605
3656
 
3606
-
3607
- destroy() {
3657
+ _proto.destroy = function destroy() {
3608
3658
  this.unbindEvents();
3609
3659
  this.$el.removeData(DATA_KEY$4);
3610
3660
  this.onDestroy();
3611
3661
  } // Update plugin data
3662
+ ;
3612
3663
 
3613
-
3614
- update() {
3664
+ _proto.update = function update() {
3615
3665
  this.buildCache();
3616
3666
  this.onUpdate();
3617
3667
  } // Cache DOM nodes for performance
3668
+ ;
3618
3669
 
3619
-
3620
- buildCache() {
3670
+ _proto.buildCache = function buildCache() {
3621
3671
  this.$el = $(this.el);
3622
3672
  this.$dropdownContainer = this.$el.find('.dropdown-container');
3623
3673
  this.$dropdownList = this.$el.find('.dropdown-list');
@@ -3631,50 +3681,52 @@
3631
3681
  this.log(this.$dropdownList);
3632
3682
  this.log(this.tabsCount);
3633
3683
  } // Bind events that trigger methods
3684
+ ;
3634
3685
 
3686
+ _proto.bindEvents = function bindEvents() {
3687
+ var _this2 = this;
3635
3688
 
3636
- bindEvents() {
3637
- $(window).on('resize', debounce(() => {
3638
- this.checkForChanges();
3689
+ $(window).on('resize', debounce(function () {
3690
+ _this2.checkForChanges();
3639
3691
  }, 250));
3640
3692
  } // Unbind events that trigger methods
3693
+ ;
3641
3694
 
3642
-
3643
- unbindEvents() {
3695
+ _proto.unbindEvents = function unbindEvents() {
3644
3696
  this.$el.off('.' + this._name);
3645
3697
  } // Move to list
3698
+ ;
3646
3699
 
3647
-
3648
- moveToList(el) {
3700
+ _proto.moveToList = function moveToList(el) {
3649
3701
  $(el).insertBefore(this.$dropdownContainer);
3650
3702
  this.checkForChanges();
3651
3703
  } // Move to dropdown
3704
+ ;
3652
3705
 
3653
-
3654
- moveToDropdown(el) {
3706
+ _proto.moveToDropdown = function moveToDropdown(el) {
3655
3707
  $(el).appendTo(this.$dropdownList);
3656
3708
  this.checkForChanges();
3657
3709
  } // Overflow status
3710
+ ;
3658
3711
 
3659
-
3660
- overflowStatus() {
3712
+ _proto.overflowStatus = function overflowStatus() {
3661
3713
  if (this.$el[0].offsetWidth < this.$el[0].scrollWidth) {
3662
3714
  return true;
3663
3715
  } else {
3664
3716
  return false;
3665
3717
  }
3666
3718
  } // CheckForChanges
3719
+ ;
3667
3720
 
3668
-
3669
- checkForChanges() {
3670
- let dropdownItems = this.$dropdownList.children();
3671
- let moveableTabs = this.$el.find('> .tab-item').not(this.$dropdownContainer);
3672
- let tabs = this.$el.find('> .tab-item:visible');
3673
- let usedSpace = 0;
3721
+ _proto.checkForChanges = function checkForChanges() {
3722
+ var dropdownItems = this.$dropdownList.children();
3723
+ var moveableTabs = this.$el.find('> .tab-item').not(this.$dropdownContainer);
3724
+ var tabs = this.$el.find('> .tab-item:visible');
3725
+ var usedSpace = 0;
3674
3726
  $.each(tabs, function (i, el) {
3675
3727
  usedSpace += $(el).outerWidth(true);
3676
3728
  });
3677
- let freeSpace = this.$el[0].offsetWidth - usedSpace;
3729
+ var freeSpace = this.$el[0].offsetWidth - usedSpace;
3678
3730
 
3679
3731
  if (dropdownItems.length > 0) {
3680
3732
  if (!this.$dropdownContainer.hasClass('visible')) {
@@ -3697,13 +3749,13 @@
3697
3749
  }
3698
3750
  }
3699
3751
  }
3700
- }
3752
+ };
3701
3753
 
3702
- static _jQueryInterface(config) {
3754
+ SectionTabs._jQueryInterface = function _jQueryInterface(config) {
3703
3755
  return this.each(function () {
3704
- let data = $(this).data(DATA_KEY$4);
3756
+ var data = $(this).data(DATA_KEY$4);
3705
3757
 
3706
- const _config = typeof config === 'object' && config;
3758
+ var _config = typeof config === 'object' && config;
3707
3759
 
3708
3760
  if (!data) {
3709
3761
  data = new SectionTabs(this, _config);
@@ -3712,24 +3764,25 @@
3712
3764
 
3713
3765
  if (typeof config === 'string') {
3714
3766
  if (typeof data[config] === 'undefined') {
3715
- throw new TypeError(`No method named "${config}"`);
3767
+ throw new TypeError("No method named \"" + config + "\"");
3716
3768
  }
3717
3769
 
3718
3770
  data[config]();
3719
3771
  }
3720
3772
  });
3721
- }
3773
+ };
3722
3774
 
3723
- }
3775
+ return SectionTabs;
3776
+ }(AbstractUIComponent);
3724
3777
 
3725
3778
  if (typeof $ !== 'undefined') {
3726
3779
  // jQuery
3727
- const JQUERY_NO_CONFLICT = $.fn[NAME$4];
3780
+ var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
3728
3781
  $.fn[NAME$4] = SectionTabs._jQueryInterface;
3729
3782
  $.fn[NAME$4].Constructor = SectionTabs;
3730
3783
 
3731
- $.fn[NAME$4].noConflict = () => {
3732
- $.fn[NAME$4] = JQUERY_NO_CONFLICT;
3784
+ $.fn[NAME$4].noConflict = function () {
3785
+ $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
3733
3786
  return SectionTabs._jQueryInterface;
3734
3787
  };
3735
3788
 
@@ -3741,47 +3794,58 @@
3741
3794
  };
3742
3795
  }
3743
3796
 
3744
- const NAME$5 = 'coolCollapse';
3745
- const DATA_KEY$5 = 'plugin_coolCollapse';
3797
+ var NAME$5 = 'coolCollapse';
3798
+ var DATA_KEY$5 = 'plugin_coolCollapse';
3799
+
3800
+ var Collapse =
3801
+ /*#__PURE__*/
3802
+ function (_AbstractUIComponent) {
3803
+ _inheritsLoose(Collapse, _AbstractUIComponent);
3804
+
3805
+ function Collapse(el, opts) {
3806
+ var _this;
3746
3807
 
3747
- class Collapse extends AbstractUIComponent {
3748
- constructor(el, opts) {
3749
- super();
3750
- this.opts = {};
3808
+ _this = _AbstractUIComponent.call(this) || this;
3809
+ _this.opts = {};
3751
3810
 
3752
3811
  if (window.Cool.settings.collapse) {
3753
- $.extend(true, this.opts, $.fn[NAME$5].defaults, window.Cool.settings.dialog, opts);
3812
+ $.extend(true, _this.opts, $.fn[NAME$5].defaults, window.Cool.settings.dialog, opts);
3754
3813
  } else {
3755
- $.extend(true, this.opts, $.fn[NAME$5].defaults, opts);
3814
+ $.extend(true, _this.opts, $.fn[NAME$5].defaults, opts);
3756
3815
  }
3757
3816
 
3758
- this.el = el;
3759
- this.debug = this.opts.debug;
3760
- this.init();
3817
+ _this.el = el;
3818
+ _this.debug = _this.opts.debug;
3819
+
3820
+ _this.init();
3821
+
3822
+ return _this;
3761
3823
  } // Init plugin
3762
3824
 
3763
3825
 
3764
- init() {
3826
+ var _proto = Collapse.prototype;
3827
+
3828
+ _proto.init = function init() {
3765
3829
  this.buildCache();
3766
3830
  this.bindEvents();
3767
3831
  this.onInit();
3768
3832
  } // Remove plugin instance completely
3833
+ ;
3769
3834
 
3770
-
3771
- destroy() {
3835
+ _proto.destroy = function destroy() {
3772
3836
  this.unbindEvents();
3773
3837
  this.$el.removeData(DATA_KEY$5);
3774
3838
  this.onDestroy();
3775
3839
  } // Update plugin data
3840
+ ;
3776
3841
 
3777
-
3778
- update() {
3842
+ _proto.update = function update() {
3779
3843
  this.buildCache();
3780
3844
  this.onUpdate();
3781
3845
  } // Cache DOM nodes for performance
3846
+ ;
3782
3847
 
3783
-
3784
- buildCache() {
3848
+ _proto.buildCache = function buildCache() {
3785
3849
  this.$el = $(this.el);
3786
3850
  this.$target = this.$el.data('target') ? $(document).find(this.$el.data('target')) : $(document).find(this.opts.target);
3787
3851
  this.expanded = this.$el.attr('aria-expanded') == 'true' ? true : false;
@@ -3804,33 +3868,36 @@
3804
3868
  this.log('Expanded: ' + this.expanded);
3805
3869
  this.log('Target height: ' + this.targetHeight + 'px');
3806
3870
  } // Bind events that trigger methods
3871
+ ;
3807
3872
 
3873
+ _proto.bindEvents = function bindEvents() {
3874
+ var _this2 = this;
3808
3875
 
3809
- bindEvents() {
3810
- this.$el.on('click' + '.' + this.name, e => {
3811
- if (this.expanded) {
3812
- this.close();
3876
+ this.$el.on('click' + '.' + this.name, function (e) {
3877
+ if (_this2.expanded) {
3878
+ _this2.close();
3813
3879
  } else {
3814
- this.show();
3880
+ _this2.show();
3815
3881
  }
3816
3882
  });
3817
- $(window).on('resize', debounce(() => {
3818
- if (this.$target.length) {
3819
- this.targetHeight = this.$target.height();
3820
- this.log('Target height: ' + this.targetHeight + 'px');
3883
+ $(window).on('resize', debounce(function () {
3884
+ if (_this2.$target.length) {
3885
+ _this2.targetHeight = _this2.$target.height();
3886
+
3887
+ _this2.log('Target height: ' + _this2.targetHeight + 'px');
3821
3888
  }
3822
3889
  }, 250));
3823
3890
  } // Unbind events that trigger methods
3891
+ ;
3824
3892
 
3825
-
3826
- unbindEvents() {
3893
+ _proto.unbindEvents = function unbindEvents() {
3827
3894
  this.$el.off('.' + this.name);
3828
3895
  } // Which transition
3896
+ ;
3829
3897
 
3830
-
3831
- whichTransitionEvent() {
3832
- let el = document.createElement('text-transition');
3833
- let transEndEventNames = {
3898
+ _proto.whichTransitionEvent = function whichTransitionEvent() {
3899
+ var el = document.createElement('text-transition');
3900
+ var transEndEventNames = {
3834
3901
  'WebkitTransition': 'webkitTransitionEnd',
3835
3902
  // Saf 6, Android Browser
3836
3903
  'MozTransition': 'transitionend',
@@ -3839,15 +3906,17 @@
3839
3906
 
3840
3907
  };
3841
3908
 
3842
- for (let t in transEndEventNames) {
3909
+ for (var t in transEndEventNames) {
3843
3910
  if (el.style[t] !== undefined) {
3844
3911
  return transEndEventNames[t];
3845
3912
  }
3846
3913
  }
3847
3914
  } // Show
3915
+ ;
3848
3916
 
3917
+ _proto.show = function show() {
3918
+ var _this3 = this;
3849
3919
 
3850
- show() {
3851
3920
  this.$target.removeClass('collapse visible');
3852
3921
  this.$target.addClass('collapsing');
3853
3922
 
@@ -3866,24 +3935,30 @@
3866
3935
  this.$indicator.addClass('visible');
3867
3936
  }
3868
3937
 
3869
- this.$target.one(this.whichTransitionEvent(), () => {
3870
- this.$target.removeClass('collapsing');
3938
+ this.$target.one(this.whichTransitionEvent(), function () {
3939
+ _this3.$target.removeClass('collapsing');
3871
3940
 
3872
- if (this.$el.is('button')) {
3873
- this.$el.attr('disabled', false);
3941
+ if (_this3.$el.is('button')) {
3942
+ _this3.$el.attr('disabled', false);
3874
3943
  }
3875
3944
 
3876
- this.$target.removeAttr('style');
3877
- this.$target.addClass('collapse visible');
3878
- this.$el.attr('aria-expanded', true);
3879
- this.$target.css('height', 'auto');
3880
- this.expanded = true;
3945
+ _this3.$target.removeAttr('style');
3946
+
3947
+ _this3.$target.addClass('collapse visible');
3948
+
3949
+ _this3.$el.attr('aria-expanded', true);
3950
+
3951
+ _this3.$target.css('height', 'auto');
3952
+
3953
+ _this3.expanded = true;
3881
3954
  });
3882
3955
  this.onShow();
3883
3956
  } // Close
3957
+ ;
3884
3958
 
3959
+ _proto.close = function close() {
3960
+ var _this4 = this;
3885
3961
 
3886
- close() {
3887
3962
  this.$target.removeClass('collapse visible');
3888
3963
  this.$target.addClass('collapsing');
3889
3964
 
@@ -3896,34 +3971,37 @@
3896
3971
  }
3897
3972
 
3898
3973
  this.$target.css('height', this.$target.height());
3899
- setTimeout(() => {
3900
- this.$target.css('height', 0);
3974
+ setTimeout(function () {
3975
+ _this4.$target.css('height', 0);
3901
3976
  }, 10);
3902
3977
 
3903
3978
  if (this.$indicator.length && this.$indicator.hasClass('visible')) {
3904
3979
  this.$indicator.removeClass('visible');
3905
3980
  }
3906
3981
 
3907
- this.$target.one(this.whichTransitionEvent(), () => {
3908
- this.$target.removeClass('collapsing');
3982
+ this.$target.one(this.whichTransitionEvent(), function () {
3983
+ _this4.$target.removeClass('collapsing');
3909
3984
 
3910
- if (this.$el.is('button')) {
3911
- this.$el.attr('disabled', false);
3985
+ if (_this4.$el.is('button')) {
3986
+ _this4.$el.attr('disabled', false);
3912
3987
  }
3913
3988
 
3914
- this.$target.removeAttr('style');
3915
- this.$target.addClass('collapse');
3916
- this.$el.attr('aria-expanded', false);
3917
- this.expanded = false;
3989
+ _this4.$target.removeAttr('style');
3990
+
3991
+ _this4.$target.addClass('collapse');
3992
+
3993
+ _this4.$el.attr('aria-expanded', false);
3994
+
3995
+ _this4.expanded = false;
3918
3996
  });
3919
3997
  this.onClose();
3920
- }
3998
+ };
3921
3999
 
3922
- static _jQueryInterface(config) {
4000
+ Collapse._jQueryInterface = function _jQueryInterface(config) {
3923
4001
  return this.each(function () {
3924
- let data = $(this).data(DATA_KEY$5);
4002
+ var data = $(this).data(DATA_KEY$5);
3925
4003
 
3926
- const _config = typeof config === 'object' && config;
4004
+ var _config = typeof config === 'object' && config;
3927
4005
 
3928
4006
  if (!data) {
3929
4007
  data = new Collapse(this, _config);
@@ -3932,24 +4010,25 @@
3932
4010
 
3933
4011
  if (typeof config === 'string') {
3934
4012
  if (typeof data[config] === 'undefined') {
3935
- throw new TypeError(`No method named "${config}"`);
4013
+ throw new TypeError("No method named \"" + config + "\"");
3936
4014
  }
3937
4015
 
3938
4016
  data[config]();
3939
4017
  }
3940
4018
  });
3941
- }
4019
+ };
3942
4020
 
3943
- }
4021
+ return Collapse;
4022
+ }(AbstractUIComponent);
3944
4023
 
3945
4024
  if (typeof $ !== 'undefined') {
3946
4025
  // jQuery
3947
- const JQUERY_NO_CONFLICT = $.fn[NAME$5];
4026
+ var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
3948
4027
  $.fn[NAME$5] = Collapse._jQueryInterface;
3949
4028
  $.fn[NAME$5].Constructor = Collapse;
3950
4029
 
3951
- $.fn[NAME$5].noConflict = () => {
3952
- $.fn[NAME$5] = JQUERY_NO_CONFLICT;
4030
+ $.fn[NAME$5].noConflict = function () {
4031
+ $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
3953
4032
  return Collapse._jQueryInterface;
3954
4033
  };
3955
4034
 
@@ -3964,11 +4043,13 @@
3964
4043
  };
3965
4044
  }
3966
4045
 
3967
- const NAME$6 = 'coolToast';
3968
- const DATA_KEY$6 = 'plugin_coolToast';
4046
+ var NAME$6 = 'coolToast';
4047
+ var DATA_KEY$6 = 'plugin_coolToast';
3969
4048
 
3970
- class Toast {
3971
- constructor(container, opts) {
4049
+ var Toast =
4050
+ /*#__PURE__*/
4051
+ function () {
4052
+ function Toast(container, opts) {
3972
4053
  this.settings = {};
3973
4054
 
3974
4055
  if (window.Cool.settings.toast) {
@@ -3989,7 +4070,9 @@
3989
4070
  } // Add item to queue
3990
4071
 
3991
4072
 
3992
- addQueue(toast) {
4073
+ var _proto = Toast.prototype;
4074
+
4075
+ _proto.addQueue = function addQueue(toast) {
3993
4076
  this.queue.push(toast);
3994
4077
 
3995
4078
  if (this.processingQueue) {
@@ -3998,9 +4081,9 @@
3998
4081
 
3999
4082
  return this.processQueue();
4000
4083
  } // Process queue
4084
+ ;
4001
4085
 
4002
-
4003
- processQueue() {
4086
+ _proto.processQueue = function processQueue() {
4004
4087
  if (this.processingQueue) {
4005
4088
  this.queue.shift();
4006
4089
  }
@@ -4013,26 +4096,26 @@
4013
4096
  this.processingQueue = true;
4014
4097
  return this.show(this.queue[0]);
4015
4098
  } // Init toast
4099
+ ;
4016
4100
 
4017
-
4018
- init(opts) {
4019
- let settings = {};
4101
+ _proto.init = function init(opts) {
4102
+ var settings = {};
4020
4103
  $.extend(true, settings, this.settings, opts);
4021
- let toast = this.buildToast(settings);
4104
+ var toast = this.buildToast(settings);
4022
4105
  this.addQueue(toast);
4023
4106
  this.onInit(toast);
4024
4107
  return toast;
4025
4108
  } // Remove plugin instance completely
4109
+ ;
4026
4110
 
4027
-
4028
- destroy() {
4111
+ _proto.destroy = function destroy() {
4029
4112
  this.$container.removeData(DATA_KEY$6);
4030
4113
  this.onDestroy();
4031
4114
  } // Build toast
4115
+ ;
4032
4116
 
4033
-
4034
- buildToast(settings) {
4035
- let toast = {
4117
+ _proto.buildToast = function buildToast(settings) {
4118
+ var toast = {
4036
4119
  uuid: 'toast-' + this.generateUUID(),
4037
4120
  placement: settings.placement,
4038
4121
  placementX: settings.placementX,
@@ -4067,33 +4150,35 @@
4067
4150
  this.toasts.push(toast);
4068
4151
  return toast;
4069
4152
  } // Bind events that trigger methods
4153
+ ;
4070
4154
 
4155
+ _proto.bindEvents = function bindEvents(toast) {
4156
+ var _this = this;
4071
4157
 
4072
- bindEvents(toast) {
4073
- let self = this;
4074
- toast.$el.on('click', '[data-toast-close]', () => {
4158
+ var self = this;
4159
+ toast.$el.on('click', '[data-toast-close]', function () {
4075
4160
  if (toast.$el) {
4076
4161
  self.close(toast);
4077
4162
  }
4078
4163
  });
4079
- $(window).on('resize', debounce(() => {
4164
+ $(window).on('resize', debounce(function () {
4080
4165
  if (toast.$el) {
4081
- this.setPosition(toast);
4166
+ _this.setPosition(toast);
4082
4167
  }
4083
4168
  }, 250));
4084
4169
  } // Generate UUID
4170
+ ;
4085
4171
 
4086
-
4087
- generateUUID() {
4172
+ _proto.generateUUID = function generateUUID() {
4088
4173
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
4089
- let r = Math.random() * 16 | 0,
4174
+ var r = Math.random() * 16 | 0,
4090
4175
  v = c == 'x' ? r : r & 0x3 | 0x8;
4091
4176
  return v.toString(16);
4092
4177
  });
4093
4178
  } // Set positions
4179
+ ;
4094
4180
 
4095
-
4096
- setPosition(toast, placement, placementY, placementX) {
4181
+ _proto.setPosition = function setPosition(toast, placement, placementY, placementX) {
4097
4182
  if (typeof placementY === 'undefined' || placementY === null) {
4098
4183
  placementY = toast.placementY;
4099
4184
  }
@@ -4107,15 +4192,17 @@
4107
4192
  }
4108
4193
 
4109
4194
  if (toast.offset) {
4110
- let offsets = toast.offset.split(',');
4111
- let offsetX = parseInt(offsets[0], 10);
4112
- let offsetY = parseInt(offsets[1], 10);
4195
+ var offsets = toast.offset.split(',');
4196
+
4197
+ var _offsetX = parseInt(offsets[0], 10);
4198
+
4199
+ var _offsetY = parseInt(offsets[1], 10);
4113
4200
  }
4114
4201
 
4115
- let toastWidth = toast.$el.outerWidth(true);
4116
- let toastHeight = toast.$el.outerHeight(true);
4117
- let toastPosX;
4118
- let toastPosY;
4202
+ var toastWidth = toast.$el.outerWidth(true);
4203
+ var toastHeight = toast.$el.outerHeight(true);
4204
+ var toastPosX;
4205
+ var toastPosY;
4119
4206
 
4120
4207
  if (placement) {
4121
4208
  if (placement === 'top-left') {
@@ -4229,9 +4316,11 @@
4229
4316
  this.log('Toast position Y: ' + toastPosX + 'px');
4230
4317
  this.log('Toast position x: ' + toastPosY + 'px');
4231
4318
  } // Show
4319
+ ;
4232
4320
 
4321
+ _proto.show = function show(toast) {
4322
+ var _this2 = this;
4233
4323
 
4234
- show(toast) {
4235
4324
  this.$container.append(toast.$el);
4236
4325
  this.bindEvents(toast);
4237
4326
  this.setPosition(toast);
@@ -4245,25 +4334,29 @@
4245
4334
  }
4246
4335
 
4247
4336
  if (toast.dismiss) {
4248
- setTimeout(() => {
4249
- this.close(toast);
4337
+ setTimeout(function () {
4338
+ _this2.close(toast);
4250
4339
  }, toast.dismiss * 1000);
4251
4340
  }
4252
4341
 
4253
4342
  this.onShow(toast);
4254
4343
  } // Close
4344
+ ;
4255
4345
 
4346
+ _proto.close = function close(toast) {
4347
+ var _this3 = this;
4256
4348
 
4257
- close(toast) {
4258
4349
  if (toast.animation && !toast.$inner.hasClass('animated')) {
4259
4350
  toast.$el.removeClass('show');
4260
- toast.$inner.animateCss(toast.animationOut, () => {
4351
+ toast.$inner.animateCss(toast.animationOut, function () {
4261
4352
  toast.$el.remove();
4262
- this.toasts = $.grep(this.toasts, function (item) {
4353
+ _this3.toasts = $.grep(_this3.toasts, function (item) {
4263
4354
  return item.uuid != toast.uuid;
4264
4355
  });
4265
- this.processQueue();
4266
- this.onClose(toast);
4356
+
4357
+ _this3.processQueue();
4358
+
4359
+ _this3.onClose(toast);
4267
4360
  });
4268
4361
  } else {
4269
4362
  toast.$el.remove();
@@ -4274,70 +4367,72 @@
4274
4367
  this.onClose(toast);
4275
4368
  }
4276
4369
  } // Initialize callback
4370
+ ;
4277
4371
 
4278
-
4279
- onInitialize() {
4280
- let onInitialize = this.onInitialize;
4372
+ _proto.onInitialize = function onInitialize() {
4373
+ var onInitialize = this.onInitialize;
4281
4374
 
4282
4375
  if (typeof onInitialize === 'function') {
4283
4376
  onInitialize.call(this.container);
4284
4377
  }
4285
4378
  } // Destroy callback
4379
+ ;
4286
4380
 
4287
-
4288
- onDestroy() {
4289
- let onDestroy = this.onDestroy;
4381
+ _proto.onDestroy = function onDestroy() {
4382
+ var onDestroy = this.onDestroy;
4290
4383
 
4291
4384
  if (typeof onDestroy === 'function') {
4292
4385
  onDestroy.call(this.container);
4293
4386
  }
4294
4387
  } // Init callback
4388
+ ;
4295
4389
 
4296
-
4297
- onInit(toast) {
4298
- let onInit = toast.onInit;
4390
+ _proto.onInit = function onInit(toast) {
4391
+ var onInit = toast.onInit;
4299
4392
 
4300
4393
  if (typeof onInit === 'function') {
4301
4394
  onInit.call(toast);
4302
4395
  }
4303
4396
  } // Show callback
4397
+ ;
4304
4398
 
4305
-
4306
- onShow(toast) {
4307
- let onShow = toast.onShow;
4399
+ _proto.onShow = function onShow(toast) {
4400
+ var onShow = toast.onShow;
4308
4401
 
4309
4402
  if (typeof onShow === 'function') {
4310
4403
  onShow.call(toast);
4311
4404
  }
4312
4405
  } // Close callback
4406
+ ;
4313
4407
 
4314
-
4315
- onClose(toast) {
4316
- let onClose = toast.onClose;
4408
+ _proto.onClose = function onClose(toast) {
4409
+ var onClose = toast.onClose;
4317
4410
 
4318
4411
  if (typeof onClose === 'function') {
4319
4412
  onClose.call(toast);
4320
4413
  }
4321
4414
  } // Debug log
4415
+ ;
4322
4416
 
4323
-
4324
- log(...args) {
4417
+ _proto.log = function log() {
4325
4418
  if (this.debug) {
4326
4419
  if (typeof this.debug === 'function') {
4327
- this.debug(...args);
4420
+ this.debug.apply(this, arguments);
4328
4421
  } else {
4329
- console.log(...args);
4422
+ var _console;
4423
+
4424
+ (_console = console).log.apply(_console, arguments);
4330
4425
  }
4331
4426
  }
4332
4427
  } // Render template
4428
+ ;
4333
4429
 
4334
-
4335
- _renderTemplate(toast) {
4336
- let faNameSpace = this.faPro ? 'far' : 'fas';
4337
- let content = '';
4338
- let header = '';
4339
- let body = '';
4340
- let bodyCloseBtn = '';
4430
+ _proto._renderTemplate = function _renderTemplate(toast) {
4431
+ var faNameSpace = this.faPro ? 'far' : 'fas';
4432
+ var content = '';
4433
+ var header = '';
4434
+ var body = '';
4435
+ var bodyCloseBtn = '';
4341
4436
 
4342
4437
  if (typeof toast.content === 'function') {
4343
4438
  content = toast.content();
@@ -4346,54 +4441,20 @@
4346
4441
  }
4347
4442
 
4348
4443
  if (toast.header) {
4349
- header = `
4350
- <div class="toast-header">
4351
-
4352
- <span>${toast.title}</span>
4353
-
4354
- <button type="button" data-toast-close>
4355
- <i class="${faNameSpace} fa-times icon"></i>
4356
- </button>
4357
-
4358
- </div>
4359
- `;
4444
+ header = "\n <div class=\"toast-header\">\n\n <span>" + toast.title + "</span>\n\n <button type=\"button\" data-toast-close>\n <i class=\"" + faNameSpace + " fa-times icon\"></i>\n </button>\n\n </div>\n ";
4360
4445
  } else {
4361
- bodyCloseBtn = `
4362
- <button type="button" data-toast-close>
4363
-
4364
- <i class="${faNameSpace} fa-times icon"></i>
4365
-
4366
- </button>
4367
- `;
4446
+ bodyCloseBtn = "\n <button type=\"button\" data-toast-close>\n\n <i class=\"" + faNameSpace + " fa-times icon\"></i>\n\n </button>\n ";
4368
4447
  }
4369
4448
 
4370
- body = `
4371
- <div class="toast-body">
4372
-
4373
- <span>${content}</span>
4374
- ${bodyCloseBtn}
4375
-
4376
- </div>
4377
- `;
4378
- return `
4379
- <div class="toast toast-${toast.size} toast-${toast.theme}" role="alert" id="${toast.uuid}">
4380
-
4381
- <div class="toast-inner">
4382
-
4383
- ${header}
4384
- ${body}
4385
-
4386
- </div>
4387
-
4388
- </div>
4389
- `;
4390
- }
4449
+ body = "\n <div class=\"toast-body\">\n\n <span>" + content + "</span>\n " + bodyCloseBtn + "\n\n </div>\n ";
4450
+ return "\n <div class=\"toast toast-" + toast.size + " toast-" + toast.theme + "\" role=\"alert\" id=\"" + toast.uuid + "\">\n\n <div class=\"toast-inner\">\n\n " + header + "\n " + body + "\n\n </div>\n\n </div>\n ";
4451
+ };
4391
4452
 
4392
- static _jQueryInterface(config) {
4453
+ Toast._jQueryInterface = function _jQueryInterface(config) {
4393
4454
  return this.each(function () {
4394
- let data = $(this).data(DATA_KEY$6);
4455
+ var data = $(this).data(DATA_KEY$6);
4395
4456
 
4396
- const _config = typeof config === 'object' && config;
4457
+ var _config = typeof config === 'object' && config;
4397
4458
 
4398
4459
  if (!data) {
4399
4460
  data = new Toast(this, _config);
@@ -4402,28 +4463,31 @@
4402
4463
 
4403
4464
  if (typeof config === 'string') {
4404
4465
  if (typeof data[config] === 'undefined') {
4405
- throw new TypeError(`No method named "${config}"`);
4466
+ throw new TypeError("No method named \"" + config + "\"");
4406
4467
  }
4407
4468
 
4408
4469
  data[config]();
4409
4470
  }
4410
4471
  });
4411
- }
4472
+ };
4412
4473
 
4413
- }
4474
+ return Toast;
4475
+ }();
4414
4476
 
4415
4477
  if (typeof $ !== 'undefined') {
4478
+ var _$$fn$NAME$defaults;
4479
+
4416
4480
  // jQuery
4417
- const JQUERY_NO_CONFLICT = $.fn[NAME$6];
4481
+ var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
4418
4482
  $.fn[NAME$6] = Toast._jQueryInterface;
4419
4483
  $.fn[NAME$6].Constructor = Toast;
4420
4484
 
4421
- $.fn[NAME$6].noConflict = () => {
4422
- $.fn[NAME$6] = JQUERY_NO_CONFLICT;
4485
+ $.fn[NAME$6].noConflict = function () {
4486
+ $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
4423
4487
  return Toast._jQueryInterface;
4424
4488
  };
4425
4489
 
4426
- $.fn[NAME$6].defaults = {
4490
+ $.fn[NAME$6].defaults = (_$$fn$NAME$defaults = {
4427
4491
  title: '',
4428
4492
  content: '',
4429
4493
  template: '',
@@ -4443,18 +4507,17 @@
4443
4507
  debug: false,
4444
4508
  onInitialize: null,
4445
4509
  onDestroy: null,
4446
- onInit: null,
4447
- onDestroy: null,
4448
- onShow: null,
4449
- onClose: null
4450
- };
4510
+ onInit: null
4511
+ }, _$$fn$NAME$defaults["onDestroy"] = null, _$$fn$NAME$defaults.onShow = null, _$$fn$NAME$defaults.onClose = null, _$$fn$NAME$defaults);
4451
4512
  }
4452
4513
 
4453
- const NAME$7 = 'coolDialog';
4454
- const DATA_KEY$7 = 'plugin_coolDialog';
4514
+ var NAME$7 = 'coolDialog';
4515
+ var DATA_KEY$7 = 'plugin_coolDialog';
4455
4516
 
4456
- class Dialog {
4457
- constructor(container, opts) {
4517
+ var Dialog =
4518
+ /*#__PURE__*/
4519
+ function () {
4520
+ function Dialog(container, opts) {
4458
4521
  this.settings = {};
4459
4522
 
4460
4523
  if (window.Cool.settings.dialog) {
@@ -4473,26 +4536,28 @@
4473
4536
  } // Init dialog
4474
4537
 
4475
4538
 
4476
- init(opts) {
4477
- let settings = {};
4539
+ var _proto = Dialog.prototype;
4540
+
4541
+ _proto.init = function init(opts) {
4542
+ var settings = {};
4478
4543
  $.extend(true, settings, this.settings, opts);
4479
- let dialog = this.buildDialog(settings);
4544
+ var dialog = this.buildDialog(settings);
4480
4545
  this.show(dialog);
4481
4546
  this.bindEvents(dialog);
4482
4547
  this.onInit(dialog);
4483
4548
  return dialog;
4484
4549
  } // Remove plugin instance completely
4550
+ ;
4485
4551
 
4486
-
4487
- destroy() {
4552
+ _proto.destroy = function destroy() {
4488
4553
  this.$container.removeData(DATA_KEY$7);
4489
4554
  this.onDestroy();
4490
4555
  } // Build dialog
4556
+ ;
4491
4557
 
4492
-
4493
- buildDialog(settings) {
4494
- let self = this;
4495
- let dialog = {
4558
+ _proto.buildDialog = function buildDialog(settings) {
4559
+ var self = this;
4560
+ var dialog = {
4496
4561
  uuid: 'dialog-' + this.generateUUID(),
4497
4562
  title: settings.title,
4498
4563
  template: settings.template,
@@ -4534,10 +4599,10 @@
4534
4599
  this.dialogs.push(dialog);
4535
4600
  return dialog;
4536
4601
  } // Bind events that trigger methods
4602
+ ;
4537
4603
 
4538
-
4539
- bindEvents(dialog) {
4540
- let self = this;
4604
+ _proto.bindEvents = function bindEvents(dialog) {
4605
+ var self = this;
4541
4606
  dialog.$el.on('click', '[data-dialog-close]', function (e) {
4542
4607
  dialog.$el.trigger('dialog.close');
4543
4608
 
@@ -4570,18 +4635,20 @@
4570
4635
  }
4571
4636
  }));
4572
4637
  } // Generate UUID
4638
+ ;
4573
4639
 
4574
-
4575
- generateUUID() {
4640
+ _proto.generateUUID = function generateUUID() {
4576
4641
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
4577
- let r = Math.random() * 16 | 0,
4642
+ var r = Math.random() * 16 | 0,
4578
4643
  v = c == 'x' ? r : r & 0x3 | 0x8;
4579
4644
  return v.toString(16);
4580
4645
  });
4581
4646
  } // Show
4647
+ ;
4582
4648
 
4649
+ _proto.show = function show(dialog) {
4650
+ var _this = this;
4583
4651
 
4584
- show(dialog) {
4585
4652
  if (!this.$container.hasClass('has-dialogs')) {
4586
4653
  this.$container.addClass('has-dialogs');
4587
4654
  }
@@ -4591,8 +4658,8 @@
4591
4658
  }
4592
4659
 
4593
4660
  if (this.dialogs.length > 1) {
4594
- let $prevDialog = $(this.dialogs).eq(-2)[0].$el;
4595
- let zIndex = parseInt($prevDialog.css('z-index'), 10) + 1;
4661
+ var $prevDialog = $(this.dialogs).eq(-2)[0].$el;
4662
+ var zIndex = parseInt($prevDialog.css('z-index'), 10) + 1;
4596
4663
  dialog.$el.css('z-index', zIndex);
4597
4664
  $prevDialog.css({
4598
4665
  'transition': 'opacity 0.3s',
@@ -4603,8 +4670,8 @@
4603
4670
 
4604
4671
  if (dialog.backdrop && $('.dialog-backdrop').length < 1) {
4605
4672
  this.$container.append('<div class="dialog-backdrop"></div>');
4606
- let checkForBackdrop = setInterval(() => {
4607
- if (this.dialogs.length == 0 && $('.dialog-backdrop').length) {
4673
+ var checkForBackdrop = setInterval(function () {
4674
+ if (_this.dialogs.length == 0 && $('.dialog-backdrop').length) {
4608
4675
  $('.dialog-backdrop').remove();
4609
4676
  clearInterval(checkForBackdrop);
4610
4677
  }
@@ -4629,10 +4696,12 @@
4629
4696
 
4630
4697
  this.onShow(dialog);
4631
4698
  } // Close
4699
+ ;
4632
4700
 
4701
+ _proto.close = function close(dialog) {
4702
+ var _this2 = this;
4633
4703
 
4634
- close(dialog) {
4635
- let $prevDialog = null;
4704
+ var $prevDialog = null;
4636
4705
 
4637
4706
  if (this.dialogs.length > 1) {
4638
4707
  $prevDialog = $(this.dialogs).eq(-2)[0].$el;
@@ -4643,17 +4712,17 @@
4643
4712
  }
4644
4713
 
4645
4714
  if (dialog.animation) {
4646
- dialog.$el.find('.dialog-content').animateCss(dialog.animationOut, () => {
4715
+ dialog.$el.find('.dialog-content').animateCss(dialog.animationOut, function () {
4647
4716
  dialog.$el.remove();
4648
- this.dialogs = $.grep(this.dialogs, function (item) {
4717
+ _this2.dialogs = $.grep(_this2.dialogs, function (item) {
4649
4718
  return item.uuid != dialog.uuid;
4650
4719
  });
4651
4720
 
4652
- if (this.dialogs.length == 0) {
4653
- this.$container.removeClass('has-dialogs');
4721
+ if (_this2.dialogs.length == 0) {
4722
+ _this2.$container.removeClass('has-dialogs');
4654
4723
 
4655
- if (this.$container.hasClass('dialog-prevent-scroll')) {
4656
- this.$container.removeClass('dialog-prevent-scroll');
4724
+ if (_this2.$container.hasClass('dialog-prevent-scroll')) {
4725
+ _this2.$container.removeClass('dialog-prevent-scroll');
4657
4726
  }
4658
4727
  } else {
4659
4728
  if ($prevDialog) {
@@ -4682,144 +4751,126 @@
4682
4751
 
4683
4752
  this.onClose(dialog);
4684
4753
  } // Initialize callback
4754
+ ;
4685
4755
 
4686
-
4687
- onInitialize() {
4688
- let onInitialize = this.onInitialize;
4756
+ _proto.onInitialize = function onInitialize() {
4757
+ var onInitialize = this.onInitialize;
4689
4758
 
4690
4759
  if (typeof onInitialize === 'function') {
4691
4760
  onInitialize.call(this.container);
4692
4761
  }
4693
4762
  } // Destroy callback
4763
+ ;
4694
4764
 
4695
-
4696
- onDestroy() {
4697
- let onDestroy = this.onDestroy;
4765
+ _proto.onDestroy = function onDestroy() {
4766
+ var onDestroy = this.onDestroy;
4698
4767
 
4699
4768
  if (typeof onDestroy === 'function') {
4700
4769
  onDestroy.call(this.container);
4701
4770
  }
4702
4771
  } // Init callback
4772
+ ;
4703
4773
 
4704
-
4705
- onInit(dialog) {
4706
- let onInit = dialog.onInit;
4774
+ _proto.onInit = function onInit(dialog) {
4775
+ var onInit = dialog.onInit;
4707
4776
 
4708
4777
  if (typeof onInit === 'function') {
4709
4778
  onInit.call(dialog);
4710
4779
  }
4711
4780
  } // Show callback
4781
+ ;
4712
4782
 
4713
-
4714
- onShow(dialog) {
4715
- let onShow = dialog.onShow;
4783
+ _proto.onShow = function onShow(dialog) {
4784
+ var onShow = dialog.onShow;
4716
4785
 
4717
4786
  if (typeof onShow === 'function') {
4718
4787
  onShow.call(dialog);
4719
4788
  }
4720
4789
  } // Close callback
4790
+ ;
4721
4791
 
4722
-
4723
- onClose(dialog) {
4724
- let onClose = dialog.onClose;
4792
+ _proto.onClose = function onClose(dialog) {
4793
+ var onClose = dialog.onClose;
4725
4794
 
4726
4795
  if (typeof onClose === 'function') {
4727
4796
  onClose.call(dialog);
4728
4797
  }
4729
4798
  } // Debug log
4799
+ ;
4730
4800
 
4731
-
4732
- log(...args) {
4801
+ _proto.log = function log() {
4733
4802
  if (this.debug) {
4734
4803
  if (typeof this.debug === 'function') {
4735
- this.debug(...args);
4804
+ this.debug.apply(this, arguments);
4736
4805
  } else {
4737
- console.log(...args);
4806
+ var _console;
4807
+
4808
+ (_console = console).log.apply(_console, arguments);
4738
4809
  }
4739
4810
  }
4740
4811
  } // Render footer
4812
+ ;
4741
4813
 
4742
-
4743
- _renderFooter(dialog) {
4744
- let footer = '';
4814
+ _proto._renderFooter = function _renderFooter(dialog) {
4815
+ var footer = '';
4745
4816
 
4746
4817
  if (typeof dialog.footer === 'function') {
4747
4818
  footer = dialog.footer();
4748
4819
  } else if (dialog.footer !== '' && dialog.footer !== false && dialog.footer !== true) {
4749
4820
  footer = dialog.footer;
4750
4821
  } else if (dialog.footer === true) {
4751
- let btnCancel = '';
4752
- let btnRemove = '';
4753
- let btnConfirm = '';
4754
- let btnStyle = '';
4755
- let btnClasses = '';
4756
- let btnAttrs = '';
4822
+ var btnCancel = '';
4823
+ var btnRemove = '';
4824
+ var btnConfirm = '';
4825
+ var btnStyle = '';
4826
+ var btnClasses = '';
4827
+ var btnAttrs = '';
4757
4828
 
4758
4829
  if (dialog.actions.close.visible) {
4759
4830
  btnStyle = dialog.actions.close.primary ? 'btn-primary' : 'btn-secondary';
4760
4831
  btnClasses = dialog.actions.close.classes ? ' ' + dialog.actions.close.classes : '';
4761
4832
  btnAttrs = dialog.actions.close.attrs ? ' ' + dialog.actions.close.attrs : '';
4762
- btnCancel = `
4763
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-close>
4764
- ${dialog.actions.close.content}
4765
- </button>
4766
- `;
4833
+ btnCancel = "\n <button type=\"button\" class=\"btn " + btnStyle + btnClasses + "\"" + btnAttrs + " data-dialog-close>\n " + dialog.actions.close.content + "\n </button>\n ";
4767
4834
  }
4768
4835
 
4769
4836
  if (dialog.actions.remove.visible) {
4770
4837
  btnStyle = dialog.actions.remove.primary ? 'btn-primary' : 'btn-secondary';
4771
4838
  btnClasses = dialog.actions.remove.classes ? ' ' + dialog.actions.remove.classes : '';
4772
4839
  btnAttrs = dialog.actions.remove.attrs ? ' ' + dialog.actions.remove.attrs : '';
4773
- btnRemove = `
4774
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-remove>
4775
- ${dialog.actions.remove.content}
4776
- </button>
4777
- `;
4840
+ btnRemove = "\n <button type=\"button\" class=\"btn " + btnStyle + btnClasses + "\"" + btnAttrs + " data-dialog-remove>\n " + dialog.actions.remove.content + "\n </button>\n ";
4778
4841
  }
4779
4842
 
4780
4843
  if (dialog.actions.confirm.visible) {
4781
4844
  btnStyle = dialog.actions.confirm.primary ? 'btn-primary' : 'btn-secondary';
4782
4845
  btnClasses = dialog.actions.confirm.classes ? ' ' + dialog.actions.confirm.classes : '';
4783
4846
  btnAttrs = dialog.actions.confirm.attrs ? ' ' + dialog.actions.confirm.attrs : '';
4784
- btnConfirm = `
4785
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-confirm>
4786
- ${dialog.actions.confirm.content}
4787
- </button>
4788
- `;
4847
+ btnConfirm = "\n <button type=\"button\" class=\"btn " + btnStyle + btnClasses + "\"" + btnAttrs + " data-dialog-confirm>\n " + dialog.actions.confirm.content + "\n </button>\n ";
4789
4848
  }
4790
4849
 
4791
- footer = `
4792
- ${btnCancel}
4793
- ${btnRemove}
4794
- ${btnConfirm}
4795
- `;
4850
+ footer = "\n " + btnCancel + "\n " + btnRemove + "\n " + btnConfirm + "\n ";
4796
4851
  } else {
4797
4852
  return footer;
4798
4853
  }
4799
4854
 
4800
4855
  if (footer) {
4801
- return `
4802
- <div class="dialog-footer">
4803
- ${footer}
4804
- </div>
4805
- `;
4856
+ return "\n <div class=\"dialog-footer\">\n " + footer + "\n </div>\n ";
4806
4857
  }
4807
4858
  } // Render template
4808
-
4809
-
4810
- _renderTemplate(dialog) {
4811
- let faNameSpace = this.faPro ? 'far' : 'fas';
4812
- let classes = dialog.classes ? ' ' + dialog.classes : '';
4813
- let centered = dialog.centered ? ' dialog-centered' : '';
4814
- let size = dialog.size ? ' dialog-' + dialog.size : '';
4815
- let uuid = ' data-dialog-uuid="' + dialog.uuid + '"';
4816
- let backdrop = dialog.backdrop ? ' data-dialog-backdrop="true"' : ' data-dialog-backdrop="false"';
4817
- let title = dialog.title;
4818
- let closeBtn = dialog.closeBtn ? `<button type="button" data-dialog-close><i class="${faNameSpace} fa-times icon"></i></button>` : '';
4819
- let maxBodyHeight = dialog.maxBodyHeight ? ' style="max-height: ' + dialog.maxBodyHeight + 'px"' : '';
4820
- let body = '';
4821
-
4822
- let footer = this._renderFooter(dialog);
4859
+ ;
4860
+
4861
+ _proto._renderTemplate = function _renderTemplate(dialog) {
4862
+ var faNameSpace = this.faPro ? 'far' : 'fas';
4863
+ var classes = dialog.classes ? ' ' + dialog.classes : '';
4864
+ var centered = dialog.centered ? ' dialog-centered' : '';
4865
+ var size = dialog.size ? ' dialog-' + dialog.size : '';
4866
+ var uuid = ' data-dialog-uuid="' + dialog.uuid + '"';
4867
+ var backdrop = dialog.backdrop ? ' data-dialog-backdrop="true"' : ' data-dialog-backdrop="false"';
4868
+ var title = dialog.title;
4869
+ var closeBtn = dialog.closeBtn ? "<button type=\"button\" data-dialog-close><i class=\"" + faNameSpace + " fa-times icon\"></i></button>" : '';
4870
+ var maxBodyHeight = dialog.maxBodyHeight ? ' style="max-height: ' + dialog.maxBodyHeight + 'px"' : '';
4871
+ var body = '';
4872
+
4873
+ var footer = this._renderFooter(dialog);
4823
4874
 
4824
4875
  if (typeof dialog.body === 'function') {
4825
4876
  body = dialog.body();
@@ -4827,43 +4878,13 @@
4827
4878
  body = dialog.body;
4828
4879
  }
4829
4880
 
4830
- return `
4831
- <div class="dialog${classes}${centered}${size}"${uuid}${backdrop}>
4832
-
4833
- <div class="dialog-container">
4834
-
4835
- <div class="dialog-content">
4836
-
4837
- <div class="dialog-header">
4838
-
4839
- <span class="dialog-title">
4840
- ${title}
4841
- </span>
4842
-
4843
- ${closeBtn}
4844
-
4845
- </div>
4846
-
4847
- <div class="dialog-body"${maxBodyHeight}>
4848
-
4849
- ${body}
4850
-
4851
- </div>
4852
-
4853
- ${footer}
4854
-
4855
- </div>
4856
-
4857
- </div>
4858
-
4859
- </div>
4860
- `;
4861
- }
4881
+ return "\n <div class=\"dialog" + classes + centered + size + "\"" + uuid + backdrop + ">\n\n <div class=\"dialog-container\">\n\n <div class=\"dialog-content\">\n\n <div class=\"dialog-header\">\n\n <span class=\"dialog-title\">\n " + title + "\n </span>\n\n " + closeBtn + "\n\n </div>\n\n <div class=\"dialog-body\"" + maxBodyHeight + ">\n\n " + body + "\n\n </div>\n\n " + footer + "\n\n </div>\n\n </div>\n\n </div>\n ";
4882
+ };
4862
4883
 
4863
- static _jQueryInterface(config) {
4864
- let data = $(this).data(DATA_KEY$7);
4884
+ Dialog._jQueryInterface = function _jQueryInterface(config) {
4885
+ var data = $(this).data(DATA_KEY$7);
4865
4886
 
4866
- const _config = typeof config === 'object' && config;
4887
+ var _config = typeof config === 'object' && config;
4867
4888
 
4868
4889
  if (!data) {
4869
4890
  data = new Dialog(this, _config);
@@ -4872,27 +4893,30 @@
4872
4893
 
4873
4894
  if (typeof config === 'string') {
4874
4895
  if (typeof data[config] === 'undefined') {
4875
- throw new TypeError(`No method named "${config}"`);
4896
+ throw new TypeError("No method named \"" + config + "\"");
4876
4897
  }
4877
4898
 
4878
4899
  data[config]();
4879
4900
  }
4880
- }
4901
+ };
4881
4902
 
4882
- }
4903
+ return Dialog;
4904
+ }();
4883
4905
 
4884
4906
  if (typeof $ !== 'undefined') {
4907
+ var _$$fn$NAME$defaults$1;
4908
+
4885
4909
  // jQuery
4886
- const JQUERY_NO_CONFLICT = $.fn[NAME$7];
4910
+ var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
4887
4911
  $.fn[NAME$7] = Dialog._jQueryInterface;
4888
4912
  $.fn[NAME$7].Constructor = Dialog;
4889
4913
 
4890
- $.fn[NAME$7].noConflict = () => {
4891
- $.fn[NAME$7] = JQUERY_NO_CONFLICT;
4914
+ $.fn[NAME$7].noConflict = function () {
4915
+ $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
4892
4916
  return Dialog._jQueryInterface;
4893
4917
  };
4894
4918
 
4895
- $.fn[NAME$7].defaults = {
4919
+ $.fn[NAME$7].defaults = (_$$fn$NAME$defaults$1 = {
4896
4920
  title: '',
4897
4921
  template: '',
4898
4922
  body: '',
@@ -4914,46 +4938,42 @@
4914
4938
  debug: true,
4915
4939
  onInitialize: null,
4916
4940
  onDestroy: null,
4917
- onInit: null,
4918
- onDestroy: null,
4919
- onShow: null,
4920
- onClose: null,
4921
- actions: {
4922
- close: {
4923
- primary: false,
4924
- visible: true,
4925
- content: 'Close',
4926
- classes: '',
4927
- attrs: ''
4928
- },
4929
- remove: {
4930
- primary: false,
4931
- visible: true,
4932
- content: 'Remove',
4933
- classes: '',
4934
- attrs: ''
4935
- },
4936
- confirm: {
4937
- primary: true,
4938
- visible: true,
4939
- content: 'Confirm',
4940
- classes: '',
4941
- attrs: ''
4942
- }
4943
- }
4944
- };
4941
+ onInit: null
4942
+ }, _$$fn$NAME$defaults$1["onDestroy"] = null, _$$fn$NAME$defaults$1.onShow = null, _$$fn$NAME$defaults$1.onClose = null, _$$fn$NAME$defaults$1.actions = {
4943
+ close: {
4944
+ primary: false,
4945
+ visible: true,
4946
+ content: 'Close',
4947
+ classes: '',
4948
+ attrs: ''
4949
+ },
4950
+ remove: {
4951
+ primary: false,
4952
+ visible: true,
4953
+ content: 'Remove',
4954
+ classes: '',
4955
+ attrs: ''
4956
+ },
4957
+ confirm: {
4958
+ primary: true,
4959
+ visible: true,
4960
+ content: 'Confirm',
4961
+ classes: '',
4962
+ attrs: ''
4963
+ }
4964
+ }, _$$fn$NAME$defaults$1);
4945
4965
  }
4946
4966
 
4947
4967
  var index_umd = {
4948
- Common,
4949
- Popover,
4950
- Select,
4951
- Dropdown,
4952
- Tooltip,
4953
- SectionTabs,
4954
- Collapse,
4955
- Toast,
4956
- Dialog
4968
+ Common: Common,
4969
+ Popover: Popover,
4970
+ Select: Select,
4971
+ Dropdown: Dropdown,
4972
+ Tooltip: Tooltip,
4973
+ SectionTabs: SectionTabs,
4974
+ Collapse: Collapse,
4975
+ Toast: Toast,
4976
+ Dialog: Dialog
4957
4977
  };
4958
4978
 
4959
4979
  return index_umd;