@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/.babelrc.js +20 -0
- package/.browserslistrc +13 -0
- package/build/rollup.config.js +14 -46
- package/dist/js/cool.bundle.js +4971 -15307
- package/dist/js/cool.bundle.js.map +1 -1
- package/dist/js/cool.bundle.min.js +6 -39
- package/dist/js/cool.bundle.min.js.map +1 -1
- package/dist/js/cool.esm.js +931 -735
- package/dist/js/cool.esm.js.map +1 -1
- package/dist/js/cool.esm.min.js +7 -2
- package/dist/js/cool.esm.min.js.map +1 -1
- package/dist/js/cool.js +983 -963
- package/dist/js/cool.js.map +1 -1
- package/dist/js/cool.min.js +7 -2
- package/dist/js/cool.min.js.map +1 -1
- package/js/dist/collapse.js +4859 -295
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/common.js +20673 -449
- package/js/dist/common.js.map +1 -1
- package/js/dist/dropdown.js +25324 -1279
- package/js/dist/dropdown.js.map +1 -1
- package/js/dist/popover.js +8957 -565
- package/js/dist/popover.js.map +1 -1
- package/js/dist/sectiontabs.js +4116 -229
- package/js/dist/sectiontabs.js.map +1 -1
- package/js/dist/select.js +28817 -1512
- package/js/dist/select.js.map +1 -1
- package/js/dist/tooltip.js +8327 -524
- package/js/dist/tooltip.js.map +1 -1
- package/package.json +1 -1
package/dist/js/cool.esm.js
CHANGED
|
@@ -1256,8 +1256,12 @@ $.fn.extend({
|
|
|
1256
1256
|
window.Cool = window.Cool || {};
|
|
1257
1257
|
window.Cool.settings = window.Cool.settings || {};
|
|
1258
1258
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1259
|
+
var Common =
|
|
1260
|
+
/*#__PURE__*/
|
|
1261
|
+
function () {
|
|
1262
|
+
function Common() {}
|
|
1263
|
+
|
|
1264
|
+
Common.initialize = function initialize(opts) {
|
|
1261
1265
|
// There's an error if opts is not defined
|
|
1262
1266
|
opts = opts || {}; // Save settings for later use
|
|
1263
1267
|
|
|
@@ -1276,7 +1280,7 @@ class Common {
|
|
|
1276
1280
|
|
|
1277
1281
|
$(document).on('focus', '.form-control', function () {
|
|
1278
1282
|
if (!$(this).hasClass('disabled') && $(this).not(':disabled') && !$(this).attr('readonly')) {
|
|
1279
|
-
|
|
1283
|
+
var $inputGroup = $(this).closest('.input-group');
|
|
1280
1284
|
|
|
1281
1285
|
if (!$inputGroup.hasClass('input-group-focus')) {
|
|
1282
1286
|
$inputGroup.addClass('input-group-focus');
|
|
@@ -1286,7 +1290,7 @@ class Common {
|
|
|
1286
1290
|
|
|
1287
1291
|
$(document).on('blur', '.form-control', function () {
|
|
1288
1292
|
if (!$(this).hasClass('disabled') && $(this).not(':disabled') && !$(this).attr('readonly')) {
|
|
1289
|
-
|
|
1293
|
+
var $inputGroup = $(this).closest('.input-group');
|
|
1290
1294
|
|
|
1291
1295
|
if ($inputGroup.hasClass('input-group-focus')) {
|
|
1292
1296
|
$inputGroup.removeClass('input-group-focus');
|
|
@@ -1295,9 +1299,9 @@ class Common {
|
|
|
1295
1299
|
}); // Custom Form group
|
|
1296
1300
|
|
|
1297
1301
|
$('.form-label-group').each(function (i, formLabelGroup) {
|
|
1298
|
-
|
|
1302
|
+
var $formLabelGroup = $(formLabelGroup);
|
|
1299
1303
|
$formLabelGroup.find('input').on('blur input change', function () {
|
|
1300
|
-
|
|
1304
|
+
var val = $(this).val();
|
|
1301
1305
|
|
|
1302
1306
|
if (val) {
|
|
1303
1307
|
$(formLabelGroup).addClass('label-on-top');
|
|
@@ -1313,11 +1317,11 @@ class Common {
|
|
|
1313
1317
|
}
|
|
1314
1318
|
});
|
|
1315
1319
|
$(document).on('click', '[data-table-link]', function (e) {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1320
|
+
var $container = $(this).parents('table, .table');
|
|
1321
|
+
var href = $(this).data('tableLink');
|
|
1322
|
+
var target = $(e.target);
|
|
1323
|
+
var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
|
|
1324
|
+
var linkDisabled = false;
|
|
1321
1325
|
$.each(exceptions, function (item) {
|
|
1322
1326
|
if (target.is(item) || item == 'a' && target.parent().is(item)) {
|
|
1323
1327
|
linkDisabled = true;
|
|
@@ -1339,12 +1343,12 @@ class Common {
|
|
|
1339
1343
|
}
|
|
1340
1344
|
});
|
|
1341
1345
|
$(document).on('click', '[data-table-btn]', function (e) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
var $container = $(this).parents('table, .table');
|
|
1347
|
+
var $self = $(this);
|
|
1348
|
+
var btn = $(this).data('tableButton');
|
|
1349
|
+
var target = $(e.target);
|
|
1350
|
+
var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
|
|
1351
|
+
var btnDisabled = false;
|
|
1348
1352
|
|
|
1349
1353
|
if (!btn) {
|
|
1350
1354
|
btn = $self.find('button')[0];
|
|
@@ -1403,11 +1407,11 @@ class Common {
|
|
|
1403
1407
|
}
|
|
1404
1408
|
}); // Sidebar left scroll
|
|
1405
1409
|
|
|
1406
|
-
|
|
1407
|
-
|
|
1410
|
+
var $sidebarLeft = $('.sidebar-left');
|
|
1411
|
+
var $sidebarLeftContent = $sidebarLeft.find('.sidebar-content');
|
|
1408
1412
|
|
|
1409
1413
|
if ($sidebarLeftContent.length) {
|
|
1410
|
-
|
|
1414
|
+
var sidebarLeftScroll = new PerfectScrollbar($sidebarLeftContent[0], {
|
|
1411
1415
|
wheelSpeed: 2,
|
|
1412
1416
|
wheelPropagation: true,
|
|
1413
1417
|
minScrollbarLength: 20,
|
|
@@ -1416,12 +1420,12 @@ class Common {
|
|
|
1416
1420
|
} // Sidebar tabs
|
|
1417
1421
|
|
|
1418
1422
|
|
|
1419
|
-
|
|
1423
|
+
var $sidebarTabs = $(document).find('.sidebar-tab');
|
|
1420
1424
|
|
|
1421
1425
|
if ($sidebarTabs.length) {
|
|
1422
1426
|
$.each($sidebarTabs, function (i, el) {
|
|
1423
|
-
|
|
1424
|
-
|
|
1427
|
+
var scrollContainer = $(el).find('.tab-content');
|
|
1428
|
+
var sidebarTabsScroll = new PerfectScrollbar(scrollContainer[0], {
|
|
1425
1429
|
wheelSpeed: 2,
|
|
1426
1430
|
wheelPropagation: true,
|
|
1427
1431
|
minScrollbarLength: 20,
|
|
@@ -1429,8 +1433,8 @@ class Common {
|
|
|
1429
1433
|
});
|
|
1430
1434
|
});
|
|
1431
1435
|
$('[name="sidebar-tab-select"]').on('click', function () {
|
|
1432
|
-
|
|
1433
|
-
|
|
1436
|
+
var val = $(this).val();
|
|
1437
|
+
var $tab = $('#sidebar-tab-' + val);
|
|
1434
1438
|
$sidebarTabs.not($tab).removeClass('active');
|
|
1435
1439
|
$tab.addClass('active');
|
|
1436
1440
|
$('[name="sidebar-tab-select"]').not($(this)).removeClass('active');
|
|
@@ -1458,19 +1462,26 @@ class Common {
|
|
|
1458
1462
|
});
|
|
1459
1463
|
});
|
|
1460
1464
|
}
|
|
1461
|
-
}
|
|
1465
|
+
};
|
|
1462
1466
|
|
|
1463
|
-
|
|
1467
|
+
return Common;
|
|
1468
|
+
}();
|
|
1464
1469
|
|
|
1465
1470
|
window.Cool.initialize = Common.initialize;
|
|
1466
1471
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1472
|
+
function _inheritsLoose(subClass, superClass) {
|
|
1473
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
1474
|
+
subClass.prototype.constructor = subClass;
|
|
1475
|
+
subClass.__proto__ = superClass;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
var debounce = function debounce(func, wait, immediate) {
|
|
1479
|
+
var timeout;
|
|
1469
1480
|
return function () {
|
|
1470
|
-
|
|
1471
|
-
|
|
1481
|
+
var context = this;
|
|
1482
|
+
var args = arguments;
|
|
1472
1483
|
|
|
1473
|
-
|
|
1484
|
+
var later = function later() {
|
|
1474
1485
|
timeout = null;
|
|
1475
1486
|
|
|
1476
1487
|
if (!immediate) {
|
|
@@ -1478,7 +1489,7 @@ const debounce = function debounce(func, wait, immediate) {
|
|
|
1478
1489
|
}
|
|
1479
1490
|
};
|
|
1480
1491
|
|
|
1481
|
-
|
|
1492
|
+
var callNow = immediate && !timeout;
|
|
1482
1493
|
clearTimeout(timeout);
|
|
1483
1494
|
timeout = setTimeout(later, wait);
|
|
1484
1495
|
|
|
@@ -1488,8 +1499,8 @@ const debounce = function debounce(func, wait, immediate) {
|
|
|
1488
1499
|
};
|
|
1489
1500
|
};
|
|
1490
1501
|
|
|
1491
|
-
|
|
1492
|
-
|
|
1502
|
+
var touchEvents = function touchEvents() {
|
|
1503
|
+
var result = false;
|
|
1493
1504
|
|
|
1494
1505
|
if ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch) {
|
|
1495
1506
|
result = true;
|
|
@@ -1498,106 +1509,126 @@ const touchEvents = function touchEvents() {
|
|
|
1498
1509
|
return result;
|
|
1499
1510
|
};
|
|
1500
1511
|
|
|
1501
|
-
|
|
1512
|
+
var AbstractUIComponent =
|
|
1513
|
+
/*#__PURE__*/
|
|
1514
|
+
function () {
|
|
1515
|
+
function AbstractUIComponent() {}
|
|
1516
|
+
|
|
1517
|
+
var _proto = AbstractUIComponent.prototype;
|
|
1518
|
+
|
|
1502
1519
|
// Init callback
|
|
1503
|
-
onInit() {
|
|
1504
|
-
|
|
1520
|
+
_proto.onInit = function onInit() {
|
|
1521
|
+
var onInit = this.opts.onInit;
|
|
1505
1522
|
|
|
1506
1523
|
if (typeof onInit === 'function') {
|
|
1507
1524
|
onInit.call(this.el);
|
|
1508
1525
|
}
|
|
1509
1526
|
} // Update callback
|
|
1527
|
+
;
|
|
1510
1528
|
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
let onUpdate = this.opts.onUpdate;
|
|
1529
|
+
_proto.onUpdate = function onUpdate() {
|
|
1530
|
+
var onUpdate = this.opts.onUpdate;
|
|
1514
1531
|
|
|
1515
1532
|
if (typeof onUpdate === 'function') {
|
|
1516
1533
|
onUpdate.call(this.el);
|
|
1517
1534
|
}
|
|
1518
1535
|
} // Destroy callback
|
|
1536
|
+
;
|
|
1519
1537
|
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
let onDestroy = this.opts.onDestroy;
|
|
1538
|
+
_proto.onDestroy = function onDestroy() {
|
|
1539
|
+
var onDestroy = this.opts.onDestroy;
|
|
1523
1540
|
|
|
1524
1541
|
if (typeof onDestroy === 'function') {
|
|
1525
1542
|
onDestroy.call(this.el);
|
|
1526
1543
|
}
|
|
1527
1544
|
} // Show callback
|
|
1545
|
+
;
|
|
1528
1546
|
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
let onShow = this.opts.onShow;
|
|
1547
|
+
_proto.onShow = function onShow() {
|
|
1548
|
+
var onShow = this.opts.onShow;
|
|
1532
1549
|
|
|
1533
1550
|
if (typeof onShow === 'function') {
|
|
1534
1551
|
onShow.call(this.el);
|
|
1535
1552
|
}
|
|
1536
1553
|
} // Close callback
|
|
1554
|
+
;
|
|
1537
1555
|
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
let onClose = this.opts.onClose;
|
|
1556
|
+
_proto.onClose = function onClose() {
|
|
1557
|
+
var onClose = this.opts.onClose;
|
|
1541
1558
|
|
|
1542
1559
|
if (typeof onClose === 'function') {
|
|
1543
1560
|
onClose.call(this.el);
|
|
1544
1561
|
}
|
|
1545
1562
|
} // Debug log
|
|
1563
|
+
;
|
|
1546
1564
|
|
|
1547
|
-
|
|
1548
|
-
log() {
|
|
1565
|
+
_proto.log = function log() {
|
|
1549
1566
|
if (this.debug) {
|
|
1550
1567
|
if (typeof this.debug === 'function') {
|
|
1551
|
-
this.debug(
|
|
1568
|
+
this.debug.apply(this, arguments);
|
|
1552
1569
|
} else {
|
|
1553
|
-
|
|
1570
|
+
var _console;
|
|
1571
|
+
|
|
1572
|
+
(_console = console).log.apply(_console, arguments);
|
|
1554
1573
|
}
|
|
1555
1574
|
}
|
|
1556
|
-
}
|
|
1575
|
+
};
|
|
1557
1576
|
|
|
1558
|
-
|
|
1577
|
+
return AbstractUIComponent;
|
|
1578
|
+
}();
|
|
1579
|
+
|
|
1580
|
+
var NAME = 'coolPopover';
|
|
1581
|
+
var DATA_KEY = 'plugin_coolPopover';
|
|
1559
1582
|
|
|
1560
|
-
|
|
1561
|
-
|
|
1583
|
+
var Popover =
|
|
1584
|
+
/*#__PURE__*/
|
|
1585
|
+
function (_AbstractUIComponent) {
|
|
1586
|
+
_inheritsLoose(Popover, _AbstractUIComponent);
|
|
1562
1587
|
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1588
|
+
function Popover(el, opts) {
|
|
1589
|
+
var _this;
|
|
1590
|
+
|
|
1591
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
1592
|
+
_this.opts = {};
|
|
1567
1593
|
|
|
1568
1594
|
if (window.Cool.settings.popover) {
|
|
1569
|
-
$.extend(true,
|
|
1595
|
+
$.extend(true, _this.opts, $.fn[NAME].defaults, window.Cool.settings.popover, opts);
|
|
1570
1596
|
} else {
|
|
1571
|
-
$.extend(true,
|
|
1597
|
+
$.extend(true, _this.opts, $.fn[NAME].defaults, opts);
|
|
1572
1598
|
}
|
|
1573
1599
|
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1600
|
+
_this.el = el;
|
|
1601
|
+
_this.debug = _this.opts.debug;
|
|
1602
|
+
|
|
1603
|
+
_this.init();
|
|
1604
|
+
|
|
1605
|
+
return _this;
|
|
1577
1606
|
} // Init plugin
|
|
1578
1607
|
|
|
1579
1608
|
|
|
1580
|
-
|
|
1609
|
+
var _proto = Popover.prototype;
|
|
1610
|
+
|
|
1611
|
+
_proto.init = function init() {
|
|
1581
1612
|
this.buildCache();
|
|
1582
1613
|
this.bindEvents();
|
|
1583
1614
|
this.onInit();
|
|
1584
1615
|
} // Remove plugin instance completely
|
|
1616
|
+
;
|
|
1585
1617
|
|
|
1586
|
-
|
|
1587
|
-
destroy() {
|
|
1618
|
+
_proto.destroy = function destroy() {
|
|
1588
1619
|
this.unbindEvents();
|
|
1589
1620
|
this.$el.removeData(DATA_KEY);
|
|
1590
1621
|
this.onDestroy();
|
|
1591
1622
|
} // Update plugin data
|
|
1623
|
+
;
|
|
1592
1624
|
|
|
1593
|
-
|
|
1594
|
-
update() {
|
|
1625
|
+
_proto.update = function update() {
|
|
1595
1626
|
this.buildCache();
|
|
1596
1627
|
this.onUpdate();
|
|
1597
1628
|
} // Cache DOM nodes for performance
|
|
1629
|
+
;
|
|
1598
1630
|
|
|
1599
|
-
|
|
1600
|
-
buildCache() {
|
|
1631
|
+
_proto.buildCache = function buildCache() {
|
|
1601
1632
|
this.$el = $(this.el);
|
|
1602
1633
|
this.$container = this.$el.data('container') ? $(this.$el.data('container')) : $(this.opts.container);
|
|
1603
1634
|
this.id = 'popover-' + this.generateUUID();
|
|
@@ -1611,58 +1642,61 @@ class Popover extends AbstractUIComponent {
|
|
|
1611
1642
|
this.title = this.$el.data('title') ? this.$el.data('title') : this.opts.title;
|
|
1612
1643
|
this.content = this.$el.data('content') ? this.$el.data('content') : this.opts.content;
|
|
1613
1644
|
} // Bind events that trigger methods
|
|
1645
|
+
;
|
|
1614
1646
|
|
|
1647
|
+
_proto.bindEvents = function bindEvents() {
|
|
1648
|
+
var _this2 = this;
|
|
1615
1649
|
|
|
1616
|
-
bindEvents() {
|
|
1617
1650
|
if (this.trigger === 'click') {
|
|
1618
|
-
this.$el.on('click' + '.' + NAME, ()
|
|
1619
|
-
if (
|
|
1620
|
-
|
|
1651
|
+
this.$el.on('click' + '.' + NAME, function () {
|
|
1652
|
+
if (_this2.$popover) {
|
|
1653
|
+
_this2.close();
|
|
1621
1654
|
} else {
|
|
1622
|
-
|
|
1655
|
+
_this2.show();
|
|
1623
1656
|
}
|
|
1624
1657
|
});
|
|
1625
1658
|
} else if (this.trigger === 'hover') {
|
|
1626
|
-
this.$el.on('mouseenter' + '.' + NAME, ()
|
|
1627
|
-
|
|
1659
|
+
this.$el.on('mouseenter' + '.' + NAME, function () {
|
|
1660
|
+
_this2.show();
|
|
1628
1661
|
});
|
|
1629
|
-
this.$el.on('mouseleave' + '.' + NAME, ()
|
|
1630
|
-
|
|
1662
|
+
this.$el.on('mouseleave' + '.' + NAME, function () {
|
|
1663
|
+
_this2.close();
|
|
1631
1664
|
});
|
|
1632
1665
|
} else if (this.trigger === 'focus') {
|
|
1633
|
-
this.$el.on('focusin' + '.' + NAME, ()
|
|
1634
|
-
|
|
1666
|
+
this.$el.on('focusin' + '.' + NAME, function () {
|
|
1667
|
+
_this2.show();
|
|
1635
1668
|
});
|
|
1636
|
-
this.$el.on('focusout' + '.' + NAME, ()
|
|
1637
|
-
|
|
1669
|
+
this.$el.on('focusout' + '.' + NAME, function () {
|
|
1670
|
+
_this2.close();
|
|
1638
1671
|
});
|
|
1639
1672
|
}
|
|
1640
1673
|
|
|
1641
|
-
$(window).on('resize', debounce(()
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1644
|
-
|
|
1674
|
+
$(window).on('resize', debounce(function () {
|
|
1675
|
+
if (_this2.$popover) {
|
|
1676
|
+
_this2.setPosition();
|
|
1677
|
+
|
|
1678
|
+
_this2.onUpdate();
|
|
1645
1679
|
}
|
|
1646
1680
|
}, 250));
|
|
1647
1681
|
} // Unbind events that trigger methods
|
|
1682
|
+
;
|
|
1648
1683
|
|
|
1649
|
-
|
|
1650
|
-
unbindEvents() {
|
|
1684
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
1651
1685
|
this.$el.off('.' + NAME);
|
|
1652
1686
|
} // Generate UUID
|
|
1687
|
+
;
|
|
1653
1688
|
|
|
1654
|
-
|
|
1655
|
-
generateUUID() {
|
|
1689
|
+
_proto.generateUUID = function generateUUID() {
|
|
1656
1690
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
1657
|
-
|
|
1691
|
+
var r = Math.random() * 16 | 0,
|
|
1658
1692
|
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
1659
1693
|
return v.toString(16);
|
|
1660
1694
|
});
|
|
1661
1695
|
} // Build popover
|
|
1696
|
+
;
|
|
1662
1697
|
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
let content;
|
|
1698
|
+
_proto.buildPopover = function buildPopover() {
|
|
1699
|
+
var content;
|
|
1666
1700
|
|
|
1667
1701
|
if (typeof this.content === 'function') {
|
|
1668
1702
|
content = this.content();
|
|
@@ -1687,27 +1721,27 @@ class Popover extends AbstractUIComponent {
|
|
|
1687
1721
|
this.log('Title: ' + this.title);
|
|
1688
1722
|
this.log('Content: ' + this.content);
|
|
1689
1723
|
} // Set positions
|
|
1724
|
+
;
|
|
1690
1725
|
|
|
1691
|
-
|
|
1692
|
-
setPosition(placement) {
|
|
1726
|
+
_proto.setPosition = function setPosition(placement) {
|
|
1693
1727
|
if (typeof placement === 'undefined' || placement === null) {
|
|
1694
1728
|
placement = this.placement;
|
|
1695
1729
|
}
|
|
1696
1730
|
|
|
1697
1731
|
this.$popover.addClass('popover-' + placement);
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1732
|
+
var containerInnerWidth = this.$container.innerWidth();
|
|
1733
|
+
var containerInnerHeight = this.$container.innerHeight();
|
|
1734
|
+
var popoverWidth = this.$popover.outerWidth(true);
|
|
1735
|
+
var popoverHeight = this.$popover.outerHeight(true);
|
|
1736
|
+
var popoverTriggerWidth = this.$el.outerWidth();
|
|
1737
|
+
var popoverTriggerHeight = this.$el.outerHeight();
|
|
1738
|
+
var popoverTriggerPosX = this.$el.position().left;
|
|
1739
|
+
var popoverTriggerPosY = this.$el.position().top;
|
|
1740
|
+
var arrowWidth = this.$arrow.outerWidth(true);
|
|
1741
|
+
var arrowHeight = this.$arrow.outerHeight(true);
|
|
1742
|
+
var arrowPos;
|
|
1743
|
+
var popoverPosX;
|
|
1744
|
+
var popoverPosY;
|
|
1711
1745
|
|
|
1712
1746
|
if (placement === 'top') {
|
|
1713
1747
|
popoverPosX = Math.round(popoverTriggerPosX - (popoverWidth - popoverTriggerWidth) / 2);
|
|
@@ -1747,14 +1781,14 @@ class Popover extends AbstractUIComponent {
|
|
|
1747
1781
|
'will-change': 'transform'
|
|
1748
1782
|
}); // Correct placement if popover goes outside of container
|
|
1749
1783
|
|
|
1750
|
-
|
|
1751
|
-
|
|
1784
|
+
var popoverOverflowCount = 0;
|
|
1785
|
+
var popoverPosition = {
|
|
1752
1786
|
left: this.$popover.position().left,
|
|
1753
1787
|
top: this.$popover.position().top,
|
|
1754
1788
|
right: containerInnerWidth - (this.$popover.position().left + popoverWidth),
|
|
1755
1789
|
bottom: containerInnerHeight - (this.$popover.position().top + popoverHeight)
|
|
1756
1790
|
};
|
|
1757
|
-
|
|
1791
|
+
var popoverOverflow = {
|
|
1758
1792
|
left: false,
|
|
1759
1793
|
top: false,
|
|
1760
1794
|
right: false,
|
|
@@ -1833,8 +1867,8 @@ class Popover extends AbstractUIComponent {
|
|
|
1833
1867
|
|
|
1834
1868
|
if (popoverOverflow.left) {
|
|
1835
1869
|
this.log('Popover overflowing from left');
|
|
1836
|
-
|
|
1837
|
-
|
|
1870
|
+
var overflowAmount = Math.abs(popoverPosition.left);
|
|
1871
|
+
var excludePlacements = ['top', 'bottom'];
|
|
1838
1872
|
|
|
1839
1873
|
if (popoverTriggerPosX >= popoverPosX + overflowAmount && excludePlacements.indexOf(placement) < 0) {
|
|
1840
1874
|
this.log('Popover adjusting width');
|
|
@@ -1849,33 +1883,39 @@ class Popover extends AbstractUIComponent {
|
|
|
1849
1883
|
|
|
1850
1884
|
if (popoverOverflow.top) {
|
|
1851
1885
|
this.log('Popover overflowing from top');
|
|
1852
|
-
|
|
1886
|
+
|
|
1887
|
+
var _overflowAmount = Math.abs(popoverPosition.top);
|
|
1888
|
+
|
|
1853
1889
|
this.log('Popover adjusting position y');
|
|
1854
|
-
popoverPosY +=
|
|
1855
|
-
arrowPos -=
|
|
1890
|
+
popoverPosY += _overflowAmount;
|
|
1891
|
+
arrowPos -= _overflowAmount;
|
|
1856
1892
|
}
|
|
1857
1893
|
|
|
1858
1894
|
if (popoverOverflow.right) {
|
|
1859
1895
|
this.log('Popover overflowing from right');
|
|
1860
|
-
let overflowAmount = Math.abs(popoverPosition.right);
|
|
1861
|
-
let excludePlacements = ['top', 'bottom'];
|
|
1862
1896
|
|
|
1863
|
-
|
|
1897
|
+
var _overflowAmount2 = Math.abs(popoverPosition.right);
|
|
1898
|
+
|
|
1899
|
+
var _excludePlacements = ['top', 'bottom'];
|
|
1900
|
+
|
|
1901
|
+
if (popoverTriggerPosX <= popoverPosX - _overflowAmount2 && _excludePlacements.indexOf(placement) < 0) {
|
|
1864
1902
|
this.log('Popover adjusting width');
|
|
1865
|
-
popoverWidth -=
|
|
1903
|
+
popoverWidth -= _overflowAmount2;
|
|
1866
1904
|
} else {
|
|
1867
1905
|
this.log('Popover adjusting position x');
|
|
1868
|
-
popoverPosX -=
|
|
1869
|
-
arrowPos +=
|
|
1906
|
+
popoverPosX -= _overflowAmount2;
|
|
1907
|
+
arrowPos += _overflowAmount2;
|
|
1870
1908
|
}
|
|
1871
1909
|
}
|
|
1872
1910
|
|
|
1873
1911
|
if (popoverOverflow.bottom) {
|
|
1874
1912
|
this.log('Popover overflowing from bottom');
|
|
1875
|
-
|
|
1913
|
+
|
|
1914
|
+
var _overflowAmount3 = Math.abs(popoverPosition.bottom);
|
|
1915
|
+
|
|
1876
1916
|
this.log('Popover adjusting position y');
|
|
1877
|
-
popoverPosY -=
|
|
1878
|
-
arrowPos +=
|
|
1917
|
+
popoverPosY -= _overflowAmount3;
|
|
1918
|
+
arrowPos += _overflowAmount3;
|
|
1879
1919
|
}
|
|
1880
1920
|
|
|
1881
1921
|
if (placement === 'top') {
|
|
@@ -1935,9 +1975,9 @@ class Popover extends AbstractUIComponent {
|
|
|
1935
1975
|
this.log('Popover position bottom: ' + popoverPosition.bottom + 'px');
|
|
1936
1976
|
}
|
|
1937
1977
|
} // Show
|
|
1978
|
+
;
|
|
1938
1979
|
|
|
1939
|
-
|
|
1940
|
-
show() {
|
|
1980
|
+
_proto.show = function show() {
|
|
1941
1981
|
if (this.$popover) {
|
|
1942
1982
|
return;
|
|
1943
1983
|
}
|
|
@@ -1959,20 +1999,25 @@ class Popover extends AbstractUIComponent {
|
|
|
1959
1999
|
|
|
1960
2000
|
this.onShow();
|
|
1961
2001
|
} // Close
|
|
2002
|
+
;
|
|
1962
2003
|
|
|
2004
|
+
_proto.close = function close() {
|
|
2005
|
+
var _this3 = this;
|
|
1963
2006
|
|
|
1964
|
-
close() {
|
|
1965
2007
|
if (!this.$popover) {
|
|
1966
2008
|
return;
|
|
1967
2009
|
}
|
|
1968
2010
|
|
|
1969
2011
|
if (this.animation && !this.$popover.hasClass('animated')) {
|
|
1970
|
-
this.$popover.animateCss(this.animationOut, ()
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
2012
|
+
this.$popover.animateCss(this.animationOut, function () {
|
|
2013
|
+
_this3.$popover.remove();
|
|
2014
|
+
|
|
2015
|
+
_this3.$el.removeAttr('data-popover');
|
|
2016
|
+
|
|
2017
|
+
_this3.$popover = null;
|
|
2018
|
+
_this3.placementChanged = false;
|
|
2019
|
+
|
|
2020
|
+
_this3.onClose();
|
|
1976
2021
|
});
|
|
1977
2022
|
} else {
|
|
1978
2023
|
this.$popover.remove();
|
|
@@ -1981,13 +2026,13 @@ class Popover extends AbstractUIComponent {
|
|
|
1981
2026
|
this.placementChanged = false;
|
|
1982
2027
|
this.onClose();
|
|
1983
2028
|
}
|
|
1984
|
-
}
|
|
2029
|
+
};
|
|
1985
2030
|
|
|
1986
|
-
|
|
2031
|
+
Popover._jQueryInterface = function _jQueryInterface(config) {
|
|
1987
2032
|
return this.each(function () {
|
|
1988
|
-
|
|
2033
|
+
var data = $(this).data(DATA_KEY);
|
|
1989
2034
|
|
|
1990
|
-
|
|
2035
|
+
var _config = typeof config === 'object' && config;
|
|
1991
2036
|
|
|
1992
2037
|
if (!data) {
|
|
1993
2038
|
data = new Popover(this, _config);
|
|
@@ -2002,17 +2047,18 @@ class Popover extends AbstractUIComponent {
|
|
|
2002
2047
|
data[config]();
|
|
2003
2048
|
}
|
|
2004
2049
|
});
|
|
2005
|
-
}
|
|
2050
|
+
};
|
|
2006
2051
|
|
|
2007
|
-
|
|
2052
|
+
return Popover;
|
|
2053
|
+
}(AbstractUIComponent);
|
|
2008
2054
|
|
|
2009
2055
|
if (typeof $ !== 'undefined') {
|
|
2010
2056
|
// jQuery
|
|
2011
|
-
|
|
2057
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
|
2012
2058
|
$.fn[NAME] = Popover._jQueryInterface;
|
|
2013
2059
|
$.fn[NAME].Constructor = Popover;
|
|
2014
2060
|
|
|
2015
|
-
$.fn[NAME].noConflict = ()
|
|
2061
|
+
$.fn[NAME].noConflict = function () {
|
|
2016
2062
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
|
2017
2063
|
return Popover._jQueryInterface;
|
|
2018
2064
|
};
|
|
@@ -2036,55 +2082,71 @@ if (typeof $ !== 'undefined') {
|
|
|
2036
2082
|
};
|
|
2037
2083
|
}
|
|
2038
2084
|
|
|
2039
|
-
|
|
2040
|
-
|
|
2085
|
+
var NAME$1 = 'coolSelect';
|
|
2086
|
+
var DATA_KEY$1 = 'plugin_coolSelect';
|
|
2087
|
+
|
|
2088
|
+
var Select =
|
|
2089
|
+
/*#__PURE__*/
|
|
2090
|
+
function (_AbstractUIComponent) {
|
|
2091
|
+
_inheritsLoose(Select, _AbstractUIComponent);
|
|
2041
2092
|
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2093
|
+
function Select(el, opts) {
|
|
2094
|
+
var _this;
|
|
2095
|
+
|
|
2096
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
2097
|
+
_this.opts = {};
|
|
2046
2098
|
|
|
2047
2099
|
if (window.Cool.settings.select) {
|
|
2048
|
-
$.extend(true,
|
|
2100
|
+
$.extend(true, _this.opts, $.fn[NAME$1].defaults, window.Cool.settings.select, opts);
|
|
2049
2101
|
} else {
|
|
2050
|
-
$.extend(true,
|
|
2102
|
+
$.extend(true, _this.opts, $.fn[NAME$1].defaults, opts);
|
|
2051
2103
|
}
|
|
2052
2104
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2105
|
+
_this.el = el;
|
|
2106
|
+
_this.debug = _this.opts.debug;
|
|
2107
|
+
|
|
2108
|
+
_this.init();
|
|
2109
|
+
|
|
2110
|
+
return _this;
|
|
2056
2111
|
} // Init plugin
|
|
2057
2112
|
|
|
2058
2113
|
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2114
|
+
var _proto = Select.prototype;
|
|
2115
|
+
|
|
2116
|
+
_proto.init = function init() {
|
|
2117
|
+
var _this2 = this;
|
|
2063
2118
|
|
|
2064
|
-
|
|
2065
|
-
|
|
2119
|
+
$.when(this.buildCache()).then(function () {
|
|
2120
|
+
_this2.buildScroll();
|
|
2121
|
+
|
|
2122
|
+
_this2.bindEvents();
|
|
2123
|
+
|
|
2124
|
+
if (_this2.data[_this2.name].length > 0) {
|
|
2125
|
+
_this2.setData();
|
|
2066
2126
|
}
|
|
2067
2127
|
|
|
2068
|
-
|
|
2128
|
+
_this2.onInit();
|
|
2069
2129
|
});
|
|
2070
2130
|
} // Remove plugin instance completely
|
|
2131
|
+
;
|
|
2071
2132
|
|
|
2072
|
-
|
|
2073
|
-
destroy() {
|
|
2133
|
+
_proto.destroy = function destroy() {
|
|
2074
2134
|
this.unbindEvents();
|
|
2075
2135
|
this.$el.removeData(DATA_KEY$1);
|
|
2076
2136
|
this.onDestroy();
|
|
2077
2137
|
} // Update plugin data
|
|
2138
|
+
;
|
|
2078
2139
|
|
|
2079
|
-
|
|
2080
|
-
update() {
|
|
2140
|
+
_proto.update = function update() {
|
|
2081
2141
|
this.buildCache();
|
|
2082
2142
|
this.bindEvents();
|
|
2083
2143
|
this.onUpdate();
|
|
2084
2144
|
} // Cache DOM nodes for performance
|
|
2145
|
+
;
|
|
2085
2146
|
|
|
2147
|
+
_proto.buildCache = function buildCache() {
|
|
2148
|
+
var _this3 = this;
|
|
2086
2149
|
|
|
2087
|
-
buildCache() {
|
|
2088
2150
|
this.$el = $(this.el);
|
|
2089
2151
|
this.$selectHeader = this.$el.find('.select-header');
|
|
2090
2152
|
this.$selectIconContainer = this.$selectHeader.find('.select-icon');
|
|
@@ -2115,7 +2177,7 @@ class Select extends AbstractUIComponent {
|
|
|
2115
2177
|
}
|
|
2116
2178
|
|
|
2117
2179
|
if (this.items.length) {
|
|
2118
|
-
|
|
2180
|
+
var items = this._renderItemList(this.items);
|
|
2119
2181
|
|
|
2120
2182
|
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 ");
|
|
2121
2183
|
this.$el.append(this.$select);
|
|
@@ -2168,8 +2230,8 @@ class Select extends AbstractUIComponent {
|
|
|
2168
2230
|
this.$closeButton = this.$select.find('[data-select-close]');
|
|
2169
2231
|
}
|
|
2170
2232
|
|
|
2171
|
-
$.each(this.$selectLabels, (i, el)
|
|
2172
|
-
|
|
2233
|
+
$.each(this.$selectLabels, function (i, el) {
|
|
2234
|
+
_this3.searchData.push({
|
|
2173
2235
|
id: i,
|
|
2174
2236
|
val: $(el).text().trim()
|
|
2175
2237
|
});
|
|
@@ -2186,11 +2248,11 @@ class Select extends AbstractUIComponent {
|
|
|
2186
2248
|
return true;
|
|
2187
2249
|
}
|
|
2188
2250
|
} // Build scroll
|
|
2251
|
+
;
|
|
2189
2252
|
|
|
2190
|
-
|
|
2191
|
-
buildScroll() {
|
|
2253
|
+
_proto.buildScroll = function buildScroll() {
|
|
2192
2254
|
if (this.$scrollableContent.length > 0) {
|
|
2193
|
-
|
|
2255
|
+
var scrollContentHeight = this.scrollContentHeight;
|
|
2194
2256
|
|
|
2195
2257
|
if (this.showSearch) {
|
|
2196
2258
|
scrollContentHeight = scrollContentHeight - (this.$searchContainer.outerHeight(true) || 0);
|
|
@@ -2226,30 +2288,34 @@ class Select extends AbstractUIComponent {
|
|
|
2226
2288
|
}
|
|
2227
2289
|
}
|
|
2228
2290
|
} // Bind events that trigger methods
|
|
2291
|
+
;
|
|
2229
2292
|
|
|
2293
|
+
_proto.bindEvents = function bindEvents() {
|
|
2294
|
+
var _this4 = this;
|
|
2230
2295
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
this.close();
|
|
2296
|
+
var self = this;
|
|
2297
|
+
this.$selectHeader.on('click' + '.' + NAME$1, function () {
|
|
2298
|
+
if (_this4.contentOpen) {
|
|
2299
|
+
_this4.close();
|
|
2236
2300
|
} else {
|
|
2237
|
-
|
|
2301
|
+
_this4.show();
|
|
2238
2302
|
}
|
|
2239
2303
|
});
|
|
2240
2304
|
this.$el.on('change' + '.' + NAME$1, 'input[type="checkbox"]', function () {
|
|
2241
|
-
|
|
2305
|
+
var val = $(this).val();
|
|
2242
2306
|
|
|
2243
2307
|
if (this.checked) {
|
|
2244
2308
|
self.data[self.name].indexOf(val) === -1 ? self.data[self.name].push(val) : false;
|
|
2245
2309
|
} else {
|
|
2246
|
-
self.data[self.name] = self.data[self.name].filter(
|
|
2310
|
+
self.data[self.name] = self.data[self.name].filter(function (n) {
|
|
2311
|
+
return n != val;
|
|
2312
|
+
});
|
|
2247
2313
|
}
|
|
2248
2314
|
|
|
2249
2315
|
self.onSelect(this);
|
|
2250
2316
|
});
|
|
2251
2317
|
this.$el.on('change' + '.' + NAME$1, 'input[type="radio"]', function () {
|
|
2252
|
-
|
|
2318
|
+
var val = $(this).val();
|
|
2253
2319
|
|
|
2254
2320
|
if (this.checked) {
|
|
2255
2321
|
self.data[self.name] = val;
|
|
@@ -2305,8 +2371,8 @@ class Select extends AbstractUIComponent {
|
|
|
2305
2371
|
}
|
|
2306
2372
|
|
|
2307
2373
|
if (this.showFooter) {
|
|
2308
|
-
this.$closeButton.on('click' + '.' + NAME$1, ()
|
|
2309
|
-
|
|
2374
|
+
this.$closeButton.on('click' + '.' + NAME$1, function () {
|
|
2375
|
+
_this4.close();
|
|
2310
2376
|
});
|
|
2311
2377
|
}
|
|
2312
2378
|
|
|
@@ -2316,32 +2382,32 @@ class Select extends AbstractUIComponent {
|
|
|
2316
2382
|
}
|
|
2317
2383
|
});
|
|
2318
2384
|
} // Unbind events that trigger methods
|
|
2385
|
+
;
|
|
2319
2386
|
|
|
2320
|
-
|
|
2321
|
-
unbindEvents() {
|
|
2387
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
2322
2388
|
this.$el.off('.' + NAME$1);
|
|
2323
2389
|
} // Get data
|
|
2390
|
+
;
|
|
2324
2391
|
|
|
2325
|
-
|
|
2326
|
-
getData(data) {
|
|
2392
|
+
_proto.getData = function getData(data) {
|
|
2327
2393
|
if (data) {
|
|
2328
2394
|
return this.data[data];
|
|
2329
2395
|
} else {
|
|
2330
2396
|
return this.data;
|
|
2331
2397
|
}
|
|
2332
2398
|
} // Set data
|
|
2399
|
+
;
|
|
2333
2400
|
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2401
|
+
_proto.setData = function setData() {
|
|
2402
|
+
var self = this;
|
|
2403
|
+
var type = null;
|
|
2404
|
+
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2339
2405
|
this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-green icon\"></i>");
|
|
2340
2406
|
|
|
2341
2407
|
if (this.searchApi.length) {
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2408
|
+
var searchUrl = this.searchApi;
|
|
2409
|
+
var itemCount = this.data[this.name].length;
|
|
2410
|
+
var currentCount = 0;
|
|
2345
2411
|
this.data[this.name].forEach(function (value) {
|
|
2346
2412
|
searchUrl += encodeURIComponent('#' + value);
|
|
2347
2413
|
currentCount++;
|
|
@@ -2354,8 +2420,8 @@ class Select extends AbstractUIComponent {
|
|
|
2354
2420
|
method: 'GET',
|
|
2355
2421
|
url: searchUrl
|
|
2356
2422
|
}).done(function (data) {
|
|
2357
|
-
|
|
2358
|
-
|
|
2423
|
+
var items = data.map(function (item) {
|
|
2424
|
+
var label = '';
|
|
2359
2425
|
|
|
2360
2426
|
if (item.name) {
|
|
2361
2427
|
label = item.name;
|
|
@@ -2373,7 +2439,7 @@ class Select extends AbstractUIComponent {
|
|
|
2373
2439
|
items = items.filter(function (item) {
|
|
2374
2440
|
return self.data[self.name].indexOf(item.id) > -1;
|
|
2375
2441
|
});
|
|
2376
|
-
|
|
2442
|
+
var result = $(self._renderItemList(items));
|
|
2377
2443
|
$.when(self.$scrollableContent.append(result)).then(function () {
|
|
2378
2444
|
if (self.$scrollableContent[0].offsetHeight < self.$scrollableContent[0].scrollHeight) {
|
|
2379
2445
|
self.scroll.update();
|
|
@@ -2393,14 +2459,14 @@ class Select extends AbstractUIComponent {
|
|
|
2393
2459
|
|
|
2394
2460
|
if (type == 'checkbox') {
|
|
2395
2461
|
self.data[self.name].forEach(function (value) {
|
|
2396
|
-
|
|
2462
|
+
var $input = self.$select.find(':input').filter(function () {
|
|
2397
2463
|
return this.value == value;
|
|
2398
2464
|
});
|
|
2399
2465
|
$input.prop('checked', true);
|
|
2400
2466
|
self.onSelect($input[0]);
|
|
2401
2467
|
});
|
|
2402
2468
|
} else if (type == 'radio') {
|
|
2403
|
-
|
|
2469
|
+
var $input = self.$select.find(':input').filter(function () {
|
|
2404
2470
|
return this.value == self.data[self.name];
|
|
2405
2471
|
});
|
|
2406
2472
|
$input.prop('checked', true);
|
|
@@ -2418,14 +2484,14 @@ class Select extends AbstractUIComponent {
|
|
|
2418
2484
|
|
|
2419
2485
|
if (type == 'checkbox') {
|
|
2420
2486
|
this.data[this.name].forEach(function (value) {
|
|
2421
|
-
|
|
2487
|
+
var $input = self.$select.find(':input').filter(function () {
|
|
2422
2488
|
return this.value == value;
|
|
2423
2489
|
});
|
|
2424
2490
|
$input.prop('checked', true);
|
|
2425
2491
|
self.onSelect($input[0]);
|
|
2426
2492
|
});
|
|
2427
2493
|
} else if (type == 'radio') {
|
|
2428
|
-
|
|
2494
|
+
var $input = this.$select.find(':input').filter(function () {
|
|
2429
2495
|
return this.value == self.data[self.name];
|
|
2430
2496
|
});
|
|
2431
2497
|
$input.prop('checked', true);
|
|
@@ -2434,11 +2500,11 @@ class Select extends AbstractUIComponent {
|
|
|
2434
2500
|
}
|
|
2435
2501
|
}
|
|
2436
2502
|
} // Search
|
|
2503
|
+
;
|
|
2437
2504
|
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2505
|
+
_proto.search = function search() {
|
|
2506
|
+
var self = this;
|
|
2507
|
+
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2442
2508
|
|
|
2443
2509
|
if (this.searchString.length) {
|
|
2444
2510
|
if (this.searchApi.length) {
|
|
@@ -2447,7 +2513,7 @@ class Select extends AbstractUIComponent {
|
|
|
2447
2513
|
method: 'GET',
|
|
2448
2514
|
url: this.searchApi + this.searchString
|
|
2449
2515
|
}).done(function (data) {
|
|
2450
|
-
|
|
2516
|
+
var items = data.map(function (item) {
|
|
2451
2517
|
return {
|
|
2452
2518
|
id: item.id.toString(),
|
|
2453
2519
|
label: item.name || item.label || item.value || null
|
|
@@ -2460,9 +2526,9 @@ class Select extends AbstractUIComponent {
|
|
|
2460
2526
|
items = items.filter(function (item) {
|
|
2461
2527
|
return item.id > 0;
|
|
2462
2528
|
});
|
|
2463
|
-
|
|
2529
|
+
var result = $(self._renderItemList(items));
|
|
2464
2530
|
$.when(self.$scrollableContent.append(result)).then(function () {
|
|
2465
|
-
|
|
2531
|
+
var faNameSpace = self.opts.faPro ? 'fal' : 'fas';
|
|
2466
2532
|
self.$searchIconContainer.html("<i class=\"" + faNameSpace + " fa-times icon\"></i>");
|
|
2467
2533
|
self.$searchIconContainer.attr('data-clear-search', 'true');
|
|
2468
2534
|
|
|
@@ -2478,7 +2544,7 @@ class Select extends AbstractUIComponent {
|
|
|
2478
2544
|
});
|
|
2479
2545
|
});
|
|
2480
2546
|
} else {
|
|
2481
|
-
|
|
2547
|
+
var results = this.searchData.filter(function (item) {
|
|
2482
2548
|
return item.val.toLocaleLowerCase().indexOf(self.searchString.toLocaleLowerCase()) > -1;
|
|
2483
2549
|
});
|
|
2484
2550
|
this.$selectItems.removeClass('d-none');
|
|
@@ -2509,16 +2575,16 @@ class Select extends AbstractUIComponent {
|
|
|
2509
2575
|
|
|
2510
2576
|
this.onUpdate();
|
|
2511
2577
|
} // Show
|
|
2578
|
+
;
|
|
2512
2579
|
|
|
2513
|
-
|
|
2514
|
-
show() {
|
|
2580
|
+
_proto.show = function show() {
|
|
2515
2581
|
if (this.$el.hasClass('show')) {
|
|
2516
2582
|
return;
|
|
2517
2583
|
}
|
|
2518
2584
|
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2585
|
+
var $otherSelects = $('.select.show');
|
|
2586
|
+
var zindex = 1;
|
|
2587
|
+
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2522
2588
|
|
|
2523
2589
|
if ($otherSelects.length) {
|
|
2524
2590
|
zindex = parseInt($otherSelects.first().css('z-index'), 10) + 2;
|
|
@@ -2548,14 +2614,14 @@ class Select extends AbstractUIComponent {
|
|
|
2548
2614
|
this.contentOpen = true;
|
|
2549
2615
|
this.onShow();
|
|
2550
2616
|
} // Close
|
|
2617
|
+
;
|
|
2551
2618
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
let faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2619
|
+
_proto.close = function close() {
|
|
2620
|
+
var self = this;
|
|
2621
|
+
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2556
2622
|
this.$el.css('max-height', '');
|
|
2557
2623
|
this.$el.removeClass('show');
|
|
2558
|
-
setTimeout(()
|
|
2624
|
+
setTimeout(function () {
|
|
2559
2625
|
self.$el.removeAttr('style');
|
|
2560
2626
|
}, 300);
|
|
2561
2627
|
|
|
@@ -2567,48 +2633,48 @@ class Select extends AbstractUIComponent {
|
|
|
2567
2633
|
|
|
2568
2634
|
this.contentOpen = false;
|
|
2569
2635
|
this.onClose();
|
|
2570
|
-
}
|
|
2636
|
+
};
|
|
2571
2637
|
|
|
2572
|
-
onSelect(el) {
|
|
2573
|
-
|
|
2638
|
+
_proto.onSelect = function onSelect(el) {
|
|
2639
|
+
var onSelect = this.opts.onSelect;
|
|
2574
2640
|
|
|
2575
2641
|
if (typeof onSelect === 'function') {
|
|
2576
2642
|
onSelect.call(el);
|
|
2577
2643
|
}
|
|
2578
|
-
}
|
|
2644
|
+
};
|
|
2579
2645
|
|
|
2580
|
-
_renderItemList(items) {
|
|
2581
|
-
|
|
2646
|
+
_proto._renderItemList = function _renderItemList(items) {
|
|
2647
|
+
var result = '';
|
|
2582
2648
|
|
|
2583
|
-
for (
|
|
2649
|
+
for (var i = 0; i < items.length; ++i) {
|
|
2584
2650
|
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 ";
|
|
2585
2651
|
}
|
|
2586
2652
|
|
|
2587
2653
|
return result;
|
|
2588
|
-
}
|
|
2654
|
+
};
|
|
2589
2655
|
|
|
2590
|
-
_renderSearch() {
|
|
2656
|
+
_proto._renderSearch = function _renderSearch() {
|
|
2591
2657
|
if (!this.showSearch) {
|
|
2592
2658
|
return '';
|
|
2593
2659
|
}
|
|
2594
2660
|
|
|
2595
|
-
|
|
2661
|
+
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2596
2662
|
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 ";
|
|
2597
|
-
}
|
|
2663
|
+
};
|
|
2598
2664
|
|
|
2599
|
-
_renderFooter() {
|
|
2665
|
+
_proto._renderFooter = function _renderFooter() {
|
|
2600
2666
|
if (!this.showFooter) {
|
|
2601
2667
|
return '';
|
|
2602
2668
|
}
|
|
2603
2669
|
|
|
2604
2670
|
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 ";
|
|
2605
|
-
}
|
|
2671
|
+
};
|
|
2606
2672
|
|
|
2607
|
-
|
|
2673
|
+
Select._jQueryInterface = function _jQueryInterface(config) {
|
|
2608
2674
|
return this.each(function () {
|
|
2609
|
-
|
|
2675
|
+
var data = $(this).data(DATA_KEY$1);
|
|
2610
2676
|
|
|
2611
|
-
|
|
2677
|
+
var _config = typeof config === 'object' && config;
|
|
2612
2678
|
|
|
2613
2679
|
if (!data) {
|
|
2614
2680
|
data = new Select(this, _config);
|
|
@@ -2623,18 +2689,19 @@ class Select extends AbstractUIComponent {
|
|
|
2623
2689
|
data[config]();
|
|
2624
2690
|
}
|
|
2625
2691
|
});
|
|
2626
|
-
}
|
|
2692
|
+
};
|
|
2627
2693
|
|
|
2628
|
-
|
|
2694
|
+
return Select;
|
|
2695
|
+
}(AbstractUIComponent);
|
|
2629
2696
|
|
|
2630
2697
|
if (typeof $ !== 'undefined') {
|
|
2631
2698
|
// jQuery
|
|
2632
|
-
|
|
2699
|
+
var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
|
|
2633
2700
|
$.fn[NAME$1] = Select._jQueryInterface;
|
|
2634
2701
|
$.fn[NAME$1].Constructor = Select;
|
|
2635
2702
|
|
|
2636
|
-
$.fn[NAME$1].noConflict = ()
|
|
2637
|
-
$.fn[NAME$1] = JQUERY_NO_CONFLICT;
|
|
2703
|
+
$.fn[NAME$1].noConflict = function () {
|
|
2704
|
+
$.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
|
|
2638
2705
|
return Select._jQueryInterface;
|
|
2639
2706
|
};
|
|
2640
2707
|
|
|
@@ -2661,49 +2728,66 @@ if (typeof $ !== 'undefined') {
|
|
|
2661
2728
|
};
|
|
2662
2729
|
}
|
|
2663
2730
|
|
|
2664
|
-
|
|
2665
|
-
|
|
2731
|
+
var NAME$2 = 'coolDropdown';
|
|
2732
|
+
var DATA_KEY$2 = 'plugin_coolDropdown';
|
|
2666
2733
|
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2734
|
+
var Dropdown =
|
|
2735
|
+
/*#__PURE__*/
|
|
2736
|
+
function (_AbstractUIComponent) {
|
|
2737
|
+
_inheritsLoose(Dropdown, _AbstractUIComponent);
|
|
2738
|
+
|
|
2739
|
+
function Dropdown(el, opts) {
|
|
2740
|
+
var _this;
|
|
2741
|
+
|
|
2742
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
2743
|
+
_this.opts = {};
|
|
2671
2744
|
|
|
2672
2745
|
if (window.Cool.settings.dropdown) {
|
|
2673
|
-
$.extend(true,
|
|
2746
|
+
$.extend(true, _this.opts, $.fn[NAME$2].defaults, window.Cool.settings.dropdown, opts);
|
|
2674
2747
|
} else {
|
|
2675
|
-
$.extend(true,
|
|
2748
|
+
$.extend(true, _this.opts, $.fn[NAME$2].defaults, opts);
|
|
2676
2749
|
}
|
|
2677
2750
|
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2751
|
+
_this.el = el;
|
|
2752
|
+
_this.debug = _this.opts.debug;
|
|
2753
|
+
|
|
2754
|
+
_this.init();
|
|
2755
|
+
|
|
2756
|
+
return _this;
|
|
2681
2757
|
} // Init plugin
|
|
2682
2758
|
|
|
2683
2759
|
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2760
|
+
var _proto = Dropdown.prototype;
|
|
2761
|
+
|
|
2762
|
+
_proto.init = function init() {
|
|
2763
|
+
var _this2 = this;
|
|
2764
|
+
|
|
2765
|
+
$.when(this.buildCache()).then(function () {
|
|
2766
|
+
_this2.buildScroll();
|
|
2767
|
+
|
|
2768
|
+
_this2.bindEvents();
|
|
2769
|
+
|
|
2770
|
+
_this2.onInit();
|
|
2689
2771
|
});
|
|
2690
2772
|
} // Remove plugin instance completely
|
|
2773
|
+
;
|
|
2691
2774
|
|
|
2692
|
-
|
|
2693
|
-
destroy() {
|
|
2775
|
+
_proto.destroy = function destroy() {
|
|
2694
2776
|
this.unbindEvents();
|
|
2695
2777
|
this.$el.removeData(DATA_KEY$2);
|
|
2696
2778
|
this.onDestroy();
|
|
2697
2779
|
} // Update plugin data
|
|
2780
|
+
;
|
|
2698
2781
|
|
|
2699
|
-
|
|
2700
|
-
update() {
|
|
2782
|
+
_proto.update = function update() {
|
|
2701
2783
|
this.buildCache();
|
|
2702
2784
|
this.onUpdate();
|
|
2703
2785
|
} // Cache DOM nodes for performance
|
|
2786
|
+
;
|
|
2704
2787
|
|
|
2788
|
+
_proto.buildCache = function buildCache() {
|
|
2789
|
+
var _this3 = this;
|
|
2705
2790
|
|
|
2706
|
-
buildCache() {
|
|
2707
2791
|
this.$el = $(this.el);
|
|
2708
2792
|
this.$el.addClass('dropdown-trigger');
|
|
2709
2793
|
this.$container = this.$el.parent('.dropdown');
|
|
@@ -2731,31 +2815,45 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2731
2815
|
}
|
|
2732
2816
|
|
|
2733
2817
|
if (typeof this.content === 'function') {
|
|
2734
|
-
|
|
2818
|
+
var menuRight = this.opts.align === 'end' ? ' dropdown-menu-right' : '';
|
|
2735
2819
|
this.$dropdown = $("\n <div class=\"dropdown-menu" + menuRight + "\" id=\"" + this.id + "\">\n " + this.content + "\n </div>\n ");
|
|
2736
|
-
$.when(this.$el.after(this.$dropdown)).then(()
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2820
|
+
$.when(this.$el.after(this.$dropdown)).then(function () {
|
|
2821
|
+
_this3.$scrollableContent = _this3.$dropdown.find('.dropdown-scrollable-content') ? _this3.$dropdown.find('.dropdown-scrollable-content') : false;
|
|
2822
|
+
_this3.$dropdown.hasClass('dropdown-menu-right') ? _this3.align = 'end' : _this3.align = 'start';
|
|
2823
|
+
_this3.$dropdownItem = _this3.$dropdown.find('.dropdown-item');
|
|
2740
2824
|
|
|
2741
|
-
if (
|
|
2742
|
-
|
|
2825
|
+
if (_this3.minWidth) {
|
|
2826
|
+
_this3.$dropdown.css('min-width', _this3.minWidth + 'px');
|
|
2743
2827
|
}
|
|
2744
2828
|
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2829
|
+
_this3.log(_this3.$el);
|
|
2830
|
+
|
|
2831
|
+
_this3.log(_this3.$container);
|
|
2832
|
+
|
|
2833
|
+
_this3.log(_this3.$dropdown);
|
|
2834
|
+
|
|
2835
|
+
_this3.log(_this3.$scrollableContent);
|
|
2836
|
+
|
|
2837
|
+
_this3.log('Id: ' + _this3.id);
|
|
2838
|
+
|
|
2839
|
+
_this3.log('Animation: ' + _this3.animation);
|
|
2840
|
+
|
|
2841
|
+
_this3.log('Animation in: ' + _this3.animationIn);
|
|
2842
|
+
|
|
2843
|
+
_this3.log('Animation out: ' + _this3.animationOut);
|
|
2844
|
+
|
|
2845
|
+
_this3.log('Animation speed: ' + _this3.animationSpeed);
|
|
2846
|
+
|
|
2847
|
+
_this3.log('Offset: ' + _this3.offset);
|
|
2848
|
+
|
|
2849
|
+
_this3.log('Min width: ' + _this3.minWidth);
|
|
2850
|
+
|
|
2851
|
+
_this3.log('Content: ' + _this3.content);
|
|
2852
|
+
|
|
2853
|
+
_this3.log('Scroll: ' + _this3.scroll);
|
|
2854
|
+
|
|
2855
|
+
_this3.log('Scroll content height: ' + _this3.scrollContentHeight + 'px');
|
|
2856
|
+
|
|
2759
2857
|
return true;
|
|
2760
2858
|
});
|
|
2761
2859
|
} else {
|
|
@@ -2785,9 +2883,9 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2785
2883
|
return true;
|
|
2786
2884
|
}
|
|
2787
2885
|
} // Build scroll
|
|
2886
|
+
;
|
|
2788
2887
|
|
|
2789
|
-
|
|
2790
|
-
buildScroll() {
|
|
2888
|
+
_proto.buildScroll = function buildScroll() {
|
|
2791
2889
|
if (this.opts.scroll && this.$scrollableContent.length) {
|
|
2792
2890
|
this.$scrollableContent.css({
|
|
2793
2891
|
'max-height': this.scrollContentHeight + 'px'
|
|
@@ -2810,15 +2908,17 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2810
2908
|
}
|
|
2811
2909
|
}
|
|
2812
2910
|
} // Bind events that trigger methods
|
|
2911
|
+
;
|
|
2813
2912
|
|
|
2913
|
+
_proto.bindEvents = function bindEvents() {
|
|
2914
|
+
var _this4 = this;
|
|
2814
2915
|
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
this.close();
|
|
2916
|
+
var self = this;
|
|
2917
|
+
this.$el.on('click' + '.' + NAME$2, function () {
|
|
2918
|
+
if (_this4.contentOpen) {
|
|
2919
|
+
_this4.close();
|
|
2820
2920
|
} else {
|
|
2821
|
-
|
|
2921
|
+
_this4.show();
|
|
2822
2922
|
}
|
|
2823
2923
|
});
|
|
2824
2924
|
this.$dropdownItem.on('click' + '.' + NAME$2, function () {
|
|
@@ -2828,45 +2928,46 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2828
2928
|
|
|
2829
2929
|
self.onItemClick(this);
|
|
2830
2930
|
});
|
|
2831
|
-
$(document).on('touchstart click', e
|
|
2832
|
-
if (!
|
|
2833
|
-
|
|
2931
|
+
$(document).on('touchstart click', function (e) {
|
|
2932
|
+
if (!_this4.$el.is(e.target) && !_this4.$dropdown.is(e.target) && _this4.$dropdown.has(e.target).length === 0 && _this4.contentOpen) {
|
|
2933
|
+
_this4.close();
|
|
2834
2934
|
}
|
|
2835
2935
|
});
|
|
2836
|
-
$(window).on('resize', debounce(()
|
|
2837
|
-
|
|
2838
|
-
|
|
2936
|
+
$(window).on('resize', debounce(function () {
|
|
2937
|
+
_this4.setPosition();
|
|
2938
|
+
|
|
2939
|
+
_this4.onUpdate();
|
|
2839
2940
|
}, 250));
|
|
2840
2941
|
} // Unbind events that trigger methods
|
|
2942
|
+
;
|
|
2841
2943
|
|
|
2842
|
-
|
|
2843
|
-
unbindEvents() {
|
|
2944
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
2844
2945
|
this.$el.off('.' + NAME$2);
|
|
2845
2946
|
} // Generate UUID
|
|
2947
|
+
;
|
|
2846
2948
|
|
|
2847
|
-
|
|
2848
|
-
generateUUID() {
|
|
2949
|
+
_proto.generateUUID = function generateUUID() {
|
|
2849
2950
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
2850
|
-
|
|
2951
|
+
var r = Math.random() * 16 | 0,
|
|
2851
2952
|
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
2852
2953
|
return v.toString(16);
|
|
2853
2954
|
});
|
|
2854
2955
|
} // Set positions
|
|
2956
|
+
;
|
|
2855
2957
|
|
|
2856
|
-
|
|
2857
|
-
setPosition(placement) {
|
|
2958
|
+
_proto.setPosition = function setPosition(placement) {
|
|
2858
2959
|
if (typeof str === 'undefined' || str === null) {
|
|
2859
2960
|
placement = this.placement;
|
|
2860
2961
|
}
|
|
2861
2962
|
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2963
|
+
var dropdownWidth = this.$dropdown.outerWidth(true);
|
|
2964
|
+
var dropdownHeight = this.$dropdown.outerHeight(true);
|
|
2965
|
+
var dropdownTriggerWidth = this.$el.outerWidth(true);
|
|
2966
|
+
var dropdownTriggerHeight = this.$el.outerHeight(true);
|
|
2967
|
+
var dropdownTriggerPosX = this.$el.position().left;
|
|
2968
|
+
var dropdownTriggerPosY = this.$el.position().top;
|
|
2969
|
+
var dropdownPosX;
|
|
2970
|
+
var dropdownPosY;
|
|
2870
2971
|
|
|
2871
2972
|
if (placement === 'top') {
|
|
2872
2973
|
if (this.align === 'end') {
|
|
@@ -2893,9 +2994,9 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2893
2994
|
}
|
|
2894
2995
|
|
|
2895
2996
|
if (this.offset) {
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2997
|
+
var offsets = this.offset.split(',');
|
|
2998
|
+
var offsetX = offsets[0];
|
|
2999
|
+
var offsetY = offsets[1];
|
|
2899
3000
|
dropdownPosX += parseInt(offsetX, 10);
|
|
2900
3001
|
dropdownPosY += parseInt(offsetY, 10);
|
|
2901
3002
|
}
|
|
@@ -2916,9 +3017,9 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2916
3017
|
this.log('Dropdown position x: ' + dropdownPosX + 'px');
|
|
2917
3018
|
this.log('Dropdown position y: ' + dropdownPosY + 'px');
|
|
2918
3019
|
} // Show
|
|
3020
|
+
;
|
|
2919
3021
|
|
|
2920
|
-
|
|
2921
|
-
show() {
|
|
3022
|
+
_proto.show = function show() {
|
|
2922
3023
|
if (!this.$dropdown || this.$dropdown.hasClass('show')) {
|
|
2923
3024
|
return;
|
|
2924
3025
|
}
|
|
@@ -2947,17 +3048,20 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2947
3048
|
this.contentOpen = true;
|
|
2948
3049
|
this.onShow();
|
|
2949
3050
|
} // Close
|
|
3051
|
+
;
|
|
2950
3052
|
|
|
3053
|
+
_proto.close = function close() {
|
|
3054
|
+
var _this5 = this;
|
|
2951
3055
|
|
|
2952
|
-
close() {
|
|
2953
3056
|
if (!this.$dropdown) {
|
|
2954
3057
|
return;
|
|
2955
3058
|
}
|
|
2956
3059
|
|
|
2957
3060
|
if (this.animation && !this.$dropdown.hasClass('animated')) {
|
|
2958
|
-
this.$dropdown.animateCss(this.animationOut, ()
|
|
2959
|
-
|
|
2960
|
-
|
|
3061
|
+
this.$dropdown.animateCss(this.animationOut, function () {
|
|
3062
|
+
_this5.$dropdown.removeClass('show');
|
|
3063
|
+
|
|
3064
|
+
_this5.$el.removeAttr('data-dropdown');
|
|
2961
3065
|
});
|
|
2962
3066
|
} else {
|
|
2963
3067
|
this.$dropdown.removeClass('show');
|
|
@@ -2967,21 +3071,21 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2967
3071
|
this.contentOpen = false;
|
|
2968
3072
|
this.onClose();
|
|
2969
3073
|
} // Item callback
|
|
3074
|
+
;
|
|
2970
3075
|
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
let onItemClick = this.opts.onItemClick;
|
|
3076
|
+
_proto.onItemClick = function onItemClick(el) {
|
|
3077
|
+
var onItemClick = this.opts.onItemClick;
|
|
2974
3078
|
|
|
2975
3079
|
if (typeof onItemClick === 'function') {
|
|
2976
3080
|
onItemClick.call(el);
|
|
2977
3081
|
}
|
|
2978
|
-
}
|
|
3082
|
+
};
|
|
2979
3083
|
|
|
2980
|
-
|
|
3084
|
+
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
|
2981
3085
|
return this.each(function () {
|
|
2982
|
-
|
|
3086
|
+
var data = $(this).data(DATA_KEY$2);
|
|
2983
3087
|
|
|
2984
|
-
|
|
3088
|
+
var _config = typeof config === 'object' && config;
|
|
2985
3089
|
|
|
2986
3090
|
if (!data) {
|
|
2987
3091
|
data = new Dropdown(this, _config);
|
|
@@ -2996,18 +3100,19 @@ class Dropdown extends AbstractUIComponent {
|
|
|
2996
3100
|
data[config]();
|
|
2997
3101
|
}
|
|
2998
3102
|
});
|
|
2999
|
-
}
|
|
3103
|
+
};
|
|
3000
3104
|
|
|
3001
|
-
|
|
3105
|
+
return Dropdown;
|
|
3106
|
+
}(AbstractUIComponent);
|
|
3002
3107
|
|
|
3003
3108
|
if (typeof $ !== 'undefined') {
|
|
3004
3109
|
// jQuery
|
|
3005
|
-
|
|
3110
|
+
var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
|
|
3006
3111
|
$.fn[NAME$2] = Dropdown._jQueryInterface;
|
|
3007
3112
|
$.fn[NAME$2].Constructor = Dropdown;
|
|
3008
3113
|
|
|
3009
|
-
$.fn[NAME$2].noConflict = ()
|
|
3010
|
-
$.fn[NAME$2] = JQUERY_NO_CONFLICT;
|
|
3114
|
+
$.fn[NAME$2].noConflict = function () {
|
|
3115
|
+
$.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
|
|
3011
3116
|
return Dropdown._jQueryInterface;
|
|
3012
3117
|
};
|
|
3013
3118
|
|
|
@@ -3033,47 +3138,58 @@ if (typeof $ !== 'undefined') {
|
|
|
3033
3138
|
};
|
|
3034
3139
|
}
|
|
3035
3140
|
|
|
3036
|
-
|
|
3037
|
-
|
|
3141
|
+
var NAME$3 = 'coolTooltip';
|
|
3142
|
+
var DATA_KEY$3 = 'plugin_coolTooltip';
|
|
3038
3143
|
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3144
|
+
var Tooltip =
|
|
3145
|
+
/*#__PURE__*/
|
|
3146
|
+
function (_AbstractUIComponent) {
|
|
3147
|
+
_inheritsLoose(Tooltip, _AbstractUIComponent);
|
|
3148
|
+
|
|
3149
|
+
function Tooltip(el, opts) {
|
|
3150
|
+
var _this;
|
|
3151
|
+
|
|
3152
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
3153
|
+
_this.opts = {};
|
|
3043
3154
|
|
|
3044
3155
|
if (window.Cool.settings.tooltip) {
|
|
3045
|
-
$.extend(true,
|
|
3156
|
+
$.extend(true, _this.opts, $.fn[NAME$3].defaults, window.Cool.settings.tooltip, opts);
|
|
3046
3157
|
} else {
|
|
3047
|
-
$.extend(true,
|
|
3158
|
+
$.extend(true, _this.opts, $.fn[NAME$3].defaults, opts);
|
|
3048
3159
|
}
|
|
3049
3160
|
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3161
|
+
_this.el = el;
|
|
3162
|
+
_this.debug = _this.opts.debug;
|
|
3163
|
+
|
|
3164
|
+
_this.init();
|
|
3165
|
+
|
|
3166
|
+
return _this;
|
|
3053
3167
|
} // Init plugin
|
|
3054
3168
|
|
|
3055
3169
|
|
|
3056
|
-
|
|
3170
|
+
var _proto = Tooltip.prototype;
|
|
3171
|
+
|
|
3172
|
+
_proto.init = function init() {
|
|
3057
3173
|
this.buildCache();
|
|
3058
3174
|
this.bindEvents();
|
|
3059
3175
|
this.onInit();
|
|
3060
3176
|
} // Remove plugin instance completely
|
|
3177
|
+
;
|
|
3061
3178
|
|
|
3062
|
-
|
|
3063
|
-
destroy() {
|
|
3179
|
+
_proto.destroy = function destroy() {
|
|
3064
3180
|
this.unbindEvents();
|
|
3065
3181
|
this.$el.removeData(DATA_KEY$3);
|
|
3066
3182
|
this.onDestroy();
|
|
3067
3183
|
} // Update plugin data
|
|
3184
|
+
;
|
|
3068
3185
|
|
|
3069
|
-
|
|
3070
|
-
update() {
|
|
3186
|
+
_proto.update = function update() {
|
|
3071
3187
|
this.buildCache();
|
|
3072
3188
|
this.onUpdate();
|
|
3073
3189
|
} // Cache DOM nodes for performance
|
|
3190
|
+
;
|
|
3074
3191
|
|
|
3075
|
-
|
|
3076
|
-
buildCache() {
|
|
3192
|
+
_proto.buildCache = function buildCache() {
|
|
3077
3193
|
this.$el = $(this.el);
|
|
3078
3194
|
this.$container = this.$el.data('container') ? $(this.$el.data('container')) : $(this.opts.container);
|
|
3079
3195
|
this.id = 'tooltip-' + this.generateUUID();
|
|
@@ -3085,39 +3201,42 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3085
3201
|
this.placementChanged = false;
|
|
3086
3202
|
this.content = this.$el.data('content') ? this.$el.data('content') : this.opts.content;
|
|
3087
3203
|
} // Bind events that trigger methods
|
|
3204
|
+
;
|
|
3088
3205
|
|
|
3206
|
+
_proto.bindEvents = function bindEvents() {
|
|
3207
|
+
var _this2 = this;
|
|
3089
3208
|
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
this.show();
|
|
3209
|
+
this.$el.on('mouseenter' + '.' + NAME$3, function () {
|
|
3210
|
+
_this2.show();
|
|
3093
3211
|
});
|
|
3094
|
-
this.$el.on('mouseleave' + '.' + NAME$3, ()
|
|
3095
|
-
|
|
3212
|
+
this.$el.on('mouseleave' + '.' + NAME$3, function () {
|
|
3213
|
+
_this2.close();
|
|
3096
3214
|
});
|
|
3097
|
-
$(window).on('resize', debounce(()
|
|
3098
|
-
if (
|
|
3099
|
-
|
|
3100
|
-
|
|
3215
|
+
$(window).on('resize', debounce(function () {
|
|
3216
|
+
if (_this2.$tooltip) {
|
|
3217
|
+
_this2.setPosition();
|
|
3218
|
+
|
|
3219
|
+
_this2.onUpdate();
|
|
3101
3220
|
}
|
|
3102
3221
|
}, 250));
|
|
3103
3222
|
} // Unbind events that trigger methods
|
|
3223
|
+
;
|
|
3104
3224
|
|
|
3105
|
-
|
|
3106
|
-
unbindEvents() {
|
|
3225
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
3107
3226
|
this.$el.off('.' + NAME$3);
|
|
3108
3227
|
} // Generate UUID
|
|
3228
|
+
;
|
|
3109
3229
|
|
|
3110
|
-
|
|
3111
|
-
generateUUID() {
|
|
3230
|
+
_proto.generateUUID = function generateUUID() {
|
|
3112
3231
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
3113
|
-
|
|
3232
|
+
var r = Math.random() * 16 | 0,
|
|
3114
3233
|
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
3115
3234
|
return v.toString(16);
|
|
3116
3235
|
});
|
|
3117
3236
|
} // Build tooltip
|
|
3237
|
+
;
|
|
3118
3238
|
|
|
3119
|
-
|
|
3120
|
-
buildTooltip() {
|
|
3239
|
+
_proto.buildTooltip = function buildTooltip() {
|
|
3121
3240
|
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 ");
|
|
3122
3241
|
this.$container.append(this.$tooltip);
|
|
3123
3242
|
this.$arrow = this.$tooltip.find('.arrow');
|
|
@@ -3133,27 +3252,27 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3133
3252
|
this.log('Placement: ' + this.placement);
|
|
3134
3253
|
this.log('Content: ' + this.content);
|
|
3135
3254
|
} // Set positions
|
|
3255
|
+
;
|
|
3136
3256
|
|
|
3137
|
-
|
|
3138
|
-
setPosition(placement) {
|
|
3257
|
+
_proto.setPosition = function setPosition(placement) {
|
|
3139
3258
|
if (typeof placement === 'undefined' || placement === null) {
|
|
3140
3259
|
placement = this.placement;
|
|
3141
3260
|
}
|
|
3142
3261
|
|
|
3143
3262
|
this.$tooltip.addClass('tooltip-' + placement);
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3263
|
+
var containerInnerWidth = this.$container.innerWidth();
|
|
3264
|
+
var containerInnerHeight = this.$container.innerHeight();
|
|
3265
|
+
var tooltipWidth = this.$tooltip.outerWidth(true);
|
|
3266
|
+
var tooltipHeight = this.$tooltip.outerHeight(true);
|
|
3267
|
+
var tooltipTriggerWidth = this.$el.outerWidth();
|
|
3268
|
+
var tooltipTriggerHeight = this.$el.outerHeight();
|
|
3269
|
+
var tooltipTriggerPosX = this.$el.offset().left;
|
|
3270
|
+
var tooltipTriggerPosY = this.$el.offset().top;
|
|
3271
|
+
var arrowWidth = this.$arrow.outerWidth(true);
|
|
3272
|
+
var arrowHeight = this.$arrow.outerHeight(true);
|
|
3273
|
+
var arrowPos;
|
|
3274
|
+
var tooltipPosX;
|
|
3275
|
+
var tooltipPosY;
|
|
3157
3276
|
|
|
3158
3277
|
if (placement === 'top') {
|
|
3159
3278
|
tooltipPosX = Math.round(tooltipTriggerPosX - (tooltipWidth - tooltipTriggerWidth) / 2);
|
|
@@ -3193,14 +3312,14 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3193
3312
|
'will-change': 'transform'
|
|
3194
3313
|
}); // Correct placement if tooltip goes outside of container
|
|
3195
3314
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3315
|
+
var tooltipOverflowCount = 0;
|
|
3316
|
+
var tooltipPosition = {
|
|
3198
3317
|
left: this.$tooltip.position().left,
|
|
3199
3318
|
top: this.$tooltip.position().top,
|
|
3200
3319
|
right: containerInnerWidth - (this.$tooltip.position().left + tooltipWidth),
|
|
3201
3320
|
bottom: containerInnerHeight - (this.$tooltip.position().top + tooltipHeight)
|
|
3202
3321
|
};
|
|
3203
|
-
|
|
3322
|
+
var tooltipOverflow = {
|
|
3204
3323
|
left: false,
|
|
3205
3324
|
top: false,
|
|
3206
3325
|
right: false,
|
|
@@ -3279,8 +3398,8 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3279
3398
|
|
|
3280
3399
|
if (tooltipOverflow.left) {
|
|
3281
3400
|
this.log('Tooltip overflowing from left');
|
|
3282
|
-
|
|
3283
|
-
|
|
3401
|
+
var overflowAmount = Math.abs(tooltipPosition.left);
|
|
3402
|
+
var excludePlacements = ['top', 'bottom'];
|
|
3284
3403
|
|
|
3285
3404
|
if (tooltipTriggerPosX >= tooltipPosX + overflowAmount && excludePlacements.indexOf(placement) < 0) {
|
|
3286
3405
|
this.log('Tooltip adjusting width');
|
|
@@ -3295,33 +3414,39 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3295
3414
|
|
|
3296
3415
|
if (tooltipOverflow.top) {
|
|
3297
3416
|
this.log('Tooltip overflowing from top');
|
|
3298
|
-
|
|
3417
|
+
|
|
3418
|
+
var _overflowAmount = Math.abs(tooltipPosition.top);
|
|
3419
|
+
|
|
3299
3420
|
this.log('Tooltip adjusting position y');
|
|
3300
|
-
tooltipPosY +=
|
|
3301
|
-
arrowPos -=
|
|
3421
|
+
tooltipPosY += _overflowAmount;
|
|
3422
|
+
arrowPos -= _overflowAmount;
|
|
3302
3423
|
}
|
|
3303
3424
|
|
|
3304
3425
|
if (tooltipOverflow.right) {
|
|
3305
3426
|
this.log('Tooltip overflowing from right');
|
|
3306
|
-
let overflowAmount = Math.abs(tooltipPosition.right);
|
|
3307
|
-
let excludePlacements = ['top', 'bottom'];
|
|
3308
3427
|
|
|
3309
|
-
|
|
3428
|
+
var _overflowAmount2 = Math.abs(tooltipPosition.right);
|
|
3429
|
+
|
|
3430
|
+
var _excludePlacements = ['top', 'bottom'];
|
|
3431
|
+
|
|
3432
|
+
if (tooltipTriggerPosX <= tooltipPosX - _overflowAmount2 && _excludePlacements.indexOf(placement) < 0) {
|
|
3310
3433
|
this.log('Tooltip adjusting width');
|
|
3311
|
-
tooltipWidth -=
|
|
3434
|
+
tooltipWidth -= _overflowAmount2;
|
|
3312
3435
|
} else {
|
|
3313
3436
|
this.log('Tooltip adjusting position x');
|
|
3314
|
-
tooltipPosX -=
|
|
3315
|
-
arrowPos +=
|
|
3437
|
+
tooltipPosX -= _overflowAmount2;
|
|
3438
|
+
arrowPos += _overflowAmount2;
|
|
3316
3439
|
}
|
|
3317
3440
|
}
|
|
3318
3441
|
|
|
3319
3442
|
if (tooltipOverflow.bottom) {
|
|
3320
3443
|
this.log('Tooltip overflowing from bottom');
|
|
3321
|
-
|
|
3444
|
+
|
|
3445
|
+
var _overflowAmount3 = Math.abs(tooltipPosition.bottom);
|
|
3446
|
+
|
|
3322
3447
|
this.log('Tooltip adjusting position y');
|
|
3323
|
-
tooltipPosY -=
|
|
3324
|
-
arrowPos +=
|
|
3448
|
+
tooltipPosY -= _overflowAmount3;
|
|
3449
|
+
arrowPos += _overflowAmount3;
|
|
3325
3450
|
}
|
|
3326
3451
|
|
|
3327
3452
|
if (placement === 'top') {
|
|
@@ -3381,9 +3506,9 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3381
3506
|
this.log('Tooltip position bottom: ' + tooltipPosition.bottom + 'px');
|
|
3382
3507
|
}
|
|
3383
3508
|
} // Show
|
|
3509
|
+
;
|
|
3384
3510
|
|
|
3385
|
-
|
|
3386
|
-
show() {
|
|
3511
|
+
_proto.show = function show() {
|
|
3387
3512
|
if (this.$tooltip) {
|
|
3388
3513
|
return;
|
|
3389
3514
|
}
|
|
@@ -3405,20 +3530,25 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3405
3530
|
|
|
3406
3531
|
this.onShow();
|
|
3407
3532
|
} // Close
|
|
3533
|
+
;
|
|
3408
3534
|
|
|
3535
|
+
_proto.close = function close() {
|
|
3536
|
+
var _this3 = this;
|
|
3409
3537
|
|
|
3410
|
-
close() {
|
|
3411
3538
|
if (!this.$tooltip) {
|
|
3412
3539
|
return;
|
|
3413
3540
|
}
|
|
3414
3541
|
|
|
3415
3542
|
if (this.animation && !this.$tooltip.hasClass('animated')) {
|
|
3416
|
-
this.$tooltip.animateCss(this.animationOut, ()
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3543
|
+
this.$tooltip.animateCss(this.animationOut, function () {
|
|
3544
|
+
_this3.$tooltip.remove();
|
|
3545
|
+
|
|
3546
|
+
_this3.$el.removeAttr('data-tooltip');
|
|
3547
|
+
|
|
3548
|
+
_this3.$tooltip = null;
|
|
3549
|
+
_this3.placementChanged = false;
|
|
3550
|
+
|
|
3551
|
+
_this3.onClose();
|
|
3422
3552
|
});
|
|
3423
3553
|
} else {
|
|
3424
3554
|
this.$tooltip.remove();
|
|
@@ -3427,13 +3557,13 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3427
3557
|
this.placementChanged = false;
|
|
3428
3558
|
this.onClose();
|
|
3429
3559
|
}
|
|
3430
|
-
}
|
|
3560
|
+
};
|
|
3431
3561
|
|
|
3432
|
-
|
|
3562
|
+
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
|
3433
3563
|
return this.each(function () {
|
|
3434
|
-
|
|
3564
|
+
var data = $(this).data(DATA_KEY$3);
|
|
3435
3565
|
|
|
3436
|
-
|
|
3566
|
+
var _config = typeof config === 'object' && config;
|
|
3437
3567
|
|
|
3438
3568
|
if (!data) {
|
|
3439
3569
|
data = new Tooltip(this, _config);
|
|
@@ -3448,18 +3578,19 @@ class Tooltip extends AbstractUIComponent {
|
|
|
3448
3578
|
data[config]();
|
|
3449
3579
|
}
|
|
3450
3580
|
});
|
|
3451
|
-
}
|
|
3581
|
+
};
|
|
3452
3582
|
|
|
3453
|
-
|
|
3583
|
+
return Tooltip;
|
|
3584
|
+
}(AbstractUIComponent);
|
|
3454
3585
|
|
|
3455
3586
|
if (typeof $ !== 'undefined') {
|
|
3456
3587
|
// jQuery
|
|
3457
|
-
|
|
3588
|
+
var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
|
|
3458
3589
|
$.fn[NAME$3] = Tooltip._jQueryInterface;
|
|
3459
3590
|
$.fn[NAME$3].Constructor = Tooltip;
|
|
3460
3591
|
|
|
3461
|
-
$.fn[NAME$3].noConflict = ()
|
|
3462
|
-
$.fn[NAME$3] = JQUERY_NO_CONFLICT;
|
|
3592
|
+
$.fn[NAME$3].noConflict = function () {
|
|
3593
|
+
$.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
|
|
3463
3594
|
return Tooltip._jQueryInterface;
|
|
3464
3595
|
};
|
|
3465
3596
|
|
|
@@ -3480,48 +3611,59 @@ if (typeof $ !== 'undefined') {
|
|
|
3480
3611
|
};
|
|
3481
3612
|
}
|
|
3482
3613
|
|
|
3483
|
-
|
|
3484
|
-
|
|
3614
|
+
var NAME$4 = 'coolSectionTabs';
|
|
3615
|
+
var DATA_KEY$4 = 'plugin_coolSectionTabs';
|
|
3616
|
+
|
|
3617
|
+
var SectionTabs =
|
|
3618
|
+
/*#__PURE__*/
|
|
3619
|
+
function (_AbstractUIComponent) {
|
|
3620
|
+
_inheritsLoose(SectionTabs, _AbstractUIComponent);
|
|
3621
|
+
|
|
3622
|
+
function SectionTabs(el, opts) {
|
|
3623
|
+
var _this;
|
|
3485
3624
|
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
super();
|
|
3489
|
-
this.opts = {};
|
|
3625
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
3626
|
+
_this.opts = {};
|
|
3490
3627
|
|
|
3491
3628
|
if (window.Cool.settings.sectionTabs) {
|
|
3492
|
-
$.extend(true,
|
|
3629
|
+
$.extend(true, _this.opts, $.fn[NAME$4].defaults, window.Cool.settings.sectionTabs, opts);
|
|
3493
3630
|
} else {
|
|
3494
|
-
$.extend(true,
|
|
3631
|
+
$.extend(true, _this.opts, $.fn[NAME$4].defaults, opts);
|
|
3495
3632
|
}
|
|
3496
3633
|
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3634
|
+
_this.el = el;
|
|
3635
|
+
_this.debug = _this.opts.debug;
|
|
3636
|
+
|
|
3637
|
+
_this.init();
|
|
3638
|
+
|
|
3639
|
+
return _this;
|
|
3500
3640
|
} // Init plugin
|
|
3501
3641
|
|
|
3502
3642
|
|
|
3503
|
-
|
|
3643
|
+
var _proto = SectionTabs.prototype;
|
|
3644
|
+
|
|
3645
|
+
_proto.init = function init() {
|
|
3504
3646
|
this.buildCache();
|
|
3505
3647
|
this.bindEvents();
|
|
3506
3648
|
this.checkForChanges();
|
|
3507
3649
|
this.onInit();
|
|
3508
3650
|
} // Remove plugin instance completely
|
|
3651
|
+
;
|
|
3509
3652
|
|
|
3510
|
-
|
|
3511
|
-
destroy() {
|
|
3653
|
+
_proto.destroy = function destroy() {
|
|
3512
3654
|
this.unbindEvents();
|
|
3513
3655
|
this.$el.removeData(DATA_KEY$4);
|
|
3514
3656
|
this.onDestroy();
|
|
3515
3657
|
} // Update plugin data
|
|
3658
|
+
;
|
|
3516
3659
|
|
|
3517
|
-
|
|
3518
|
-
update() {
|
|
3660
|
+
_proto.update = function update() {
|
|
3519
3661
|
this.buildCache();
|
|
3520
3662
|
this.onUpdate();
|
|
3521
3663
|
} // Cache DOM nodes for performance
|
|
3664
|
+
;
|
|
3522
3665
|
|
|
3523
|
-
|
|
3524
|
-
buildCache() {
|
|
3666
|
+
_proto.buildCache = function buildCache() {
|
|
3525
3667
|
this.$el = $(this.el);
|
|
3526
3668
|
this.$dropdownContainer = this.$el.find('.dropdown-container');
|
|
3527
3669
|
this.$dropdownList = this.$el.find('.dropdown-list');
|
|
@@ -3535,50 +3677,52 @@ class SectionTabs extends AbstractUIComponent {
|
|
|
3535
3677
|
this.log(this.$dropdownList);
|
|
3536
3678
|
this.log(this.tabsCount);
|
|
3537
3679
|
} // Bind events that trigger methods
|
|
3680
|
+
;
|
|
3538
3681
|
|
|
3682
|
+
_proto.bindEvents = function bindEvents() {
|
|
3683
|
+
var _this2 = this;
|
|
3539
3684
|
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
this.checkForChanges();
|
|
3685
|
+
$(window).on('resize', debounce(function () {
|
|
3686
|
+
_this2.checkForChanges();
|
|
3543
3687
|
}, 250));
|
|
3544
3688
|
} // Unbind events that trigger methods
|
|
3689
|
+
;
|
|
3545
3690
|
|
|
3546
|
-
|
|
3547
|
-
unbindEvents() {
|
|
3691
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
3548
3692
|
this.$el.off('.' + this._name);
|
|
3549
3693
|
} // Move to list
|
|
3694
|
+
;
|
|
3550
3695
|
|
|
3551
|
-
|
|
3552
|
-
moveToList(el) {
|
|
3696
|
+
_proto.moveToList = function moveToList(el) {
|
|
3553
3697
|
$(el).insertBefore(this.$dropdownContainer);
|
|
3554
3698
|
this.checkForChanges();
|
|
3555
3699
|
} // Move to dropdown
|
|
3700
|
+
;
|
|
3556
3701
|
|
|
3557
|
-
|
|
3558
|
-
moveToDropdown(el) {
|
|
3702
|
+
_proto.moveToDropdown = function moveToDropdown(el) {
|
|
3559
3703
|
$(el).appendTo(this.$dropdownList);
|
|
3560
3704
|
this.checkForChanges();
|
|
3561
3705
|
} // Overflow status
|
|
3706
|
+
;
|
|
3562
3707
|
|
|
3563
|
-
|
|
3564
|
-
overflowStatus() {
|
|
3708
|
+
_proto.overflowStatus = function overflowStatus() {
|
|
3565
3709
|
if (this.$el[0].offsetWidth < this.$el[0].scrollWidth) {
|
|
3566
3710
|
return true;
|
|
3567
3711
|
} else {
|
|
3568
3712
|
return false;
|
|
3569
3713
|
}
|
|
3570
3714
|
} // CheckForChanges
|
|
3715
|
+
;
|
|
3571
3716
|
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
let usedSpace = 0;
|
|
3717
|
+
_proto.checkForChanges = function checkForChanges() {
|
|
3718
|
+
var dropdownItems = this.$dropdownList.children();
|
|
3719
|
+
var moveableTabs = this.$el.find('> .tab-item').not(this.$dropdownContainer);
|
|
3720
|
+
var tabs = this.$el.find('> .tab-item:visible');
|
|
3721
|
+
var usedSpace = 0;
|
|
3578
3722
|
$.each(tabs, function (i, el) {
|
|
3579
3723
|
usedSpace += $(el).outerWidth(true);
|
|
3580
3724
|
});
|
|
3581
|
-
|
|
3725
|
+
var freeSpace = this.$el[0].offsetWidth - usedSpace;
|
|
3582
3726
|
|
|
3583
3727
|
if (dropdownItems.length > 0) {
|
|
3584
3728
|
if (!this.$dropdownContainer.hasClass('visible')) {
|
|
@@ -3601,13 +3745,13 @@ class SectionTabs extends AbstractUIComponent {
|
|
|
3601
3745
|
}
|
|
3602
3746
|
}
|
|
3603
3747
|
}
|
|
3604
|
-
}
|
|
3748
|
+
};
|
|
3605
3749
|
|
|
3606
|
-
|
|
3750
|
+
SectionTabs._jQueryInterface = function _jQueryInterface(config) {
|
|
3607
3751
|
return this.each(function () {
|
|
3608
|
-
|
|
3752
|
+
var data = $(this).data(DATA_KEY$4);
|
|
3609
3753
|
|
|
3610
|
-
|
|
3754
|
+
var _config = typeof config === 'object' && config;
|
|
3611
3755
|
|
|
3612
3756
|
if (!data) {
|
|
3613
3757
|
data = new SectionTabs(this, _config);
|
|
@@ -3622,18 +3766,19 @@ class SectionTabs extends AbstractUIComponent {
|
|
|
3622
3766
|
data[config]();
|
|
3623
3767
|
}
|
|
3624
3768
|
});
|
|
3625
|
-
}
|
|
3769
|
+
};
|
|
3626
3770
|
|
|
3627
|
-
|
|
3771
|
+
return SectionTabs;
|
|
3772
|
+
}(AbstractUIComponent);
|
|
3628
3773
|
|
|
3629
3774
|
if (typeof $ !== 'undefined') {
|
|
3630
3775
|
// jQuery
|
|
3631
|
-
|
|
3776
|
+
var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
|
|
3632
3777
|
$.fn[NAME$4] = SectionTabs._jQueryInterface;
|
|
3633
3778
|
$.fn[NAME$4].Constructor = SectionTabs;
|
|
3634
3779
|
|
|
3635
|
-
$.fn[NAME$4].noConflict = ()
|
|
3636
|
-
$.fn[NAME$4] = JQUERY_NO_CONFLICT;
|
|
3780
|
+
$.fn[NAME$4].noConflict = function () {
|
|
3781
|
+
$.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
|
|
3637
3782
|
return SectionTabs._jQueryInterface;
|
|
3638
3783
|
};
|
|
3639
3784
|
|
|
@@ -3645,47 +3790,58 @@ if (typeof $ !== 'undefined') {
|
|
|
3645
3790
|
};
|
|
3646
3791
|
}
|
|
3647
3792
|
|
|
3648
|
-
|
|
3649
|
-
|
|
3793
|
+
var NAME$5 = 'coolCollapse';
|
|
3794
|
+
var DATA_KEY$5 = 'plugin_coolCollapse';
|
|
3795
|
+
|
|
3796
|
+
var Collapse =
|
|
3797
|
+
/*#__PURE__*/
|
|
3798
|
+
function (_AbstractUIComponent) {
|
|
3799
|
+
_inheritsLoose(Collapse, _AbstractUIComponent);
|
|
3650
3800
|
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3801
|
+
function Collapse(el, opts) {
|
|
3802
|
+
var _this;
|
|
3803
|
+
|
|
3804
|
+
_this = _AbstractUIComponent.call(this) || this;
|
|
3805
|
+
_this.opts = {};
|
|
3655
3806
|
|
|
3656
3807
|
if (window.Cool.settings.collapse) {
|
|
3657
|
-
$.extend(true,
|
|
3808
|
+
$.extend(true, _this.opts, $.fn[NAME$5].defaults, window.Cool.settings.dialog, opts);
|
|
3658
3809
|
} else {
|
|
3659
|
-
$.extend(true,
|
|
3810
|
+
$.extend(true, _this.opts, $.fn[NAME$5].defaults, opts);
|
|
3660
3811
|
}
|
|
3661
3812
|
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3813
|
+
_this.el = el;
|
|
3814
|
+
_this.debug = _this.opts.debug;
|
|
3815
|
+
|
|
3816
|
+
_this.init();
|
|
3817
|
+
|
|
3818
|
+
return _this;
|
|
3665
3819
|
} // Init plugin
|
|
3666
3820
|
|
|
3667
3821
|
|
|
3668
|
-
|
|
3822
|
+
var _proto = Collapse.prototype;
|
|
3823
|
+
|
|
3824
|
+
_proto.init = function init() {
|
|
3669
3825
|
this.buildCache();
|
|
3670
3826
|
this.bindEvents();
|
|
3671
3827
|
this.onInit();
|
|
3672
3828
|
} // Remove plugin instance completely
|
|
3829
|
+
;
|
|
3673
3830
|
|
|
3674
|
-
|
|
3675
|
-
destroy() {
|
|
3831
|
+
_proto.destroy = function destroy() {
|
|
3676
3832
|
this.unbindEvents();
|
|
3677
3833
|
this.$el.removeData(DATA_KEY$5);
|
|
3678
3834
|
this.onDestroy();
|
|
3679
3835
|
} // Update plugin data
|
|
3836
|
+
;
|
|
3680
3837
|
|
|
3681
|
-
|
|
3682
|
-
update() {
|
|
3838
|
+
_proto.update = function update() {
|
|
3683
3839
|
this.buildCache();
|
|
3684
3840
|
this.onUpdate();
|
|
3685
3841
|
} // Cache DOM nodes for performance
|
|
3842
|
+
;
|
|
3686
3843
|
|
|
3687
|
-
|
|
3688
|
-
buildCache() {
|
|
3844
|
+
_proto.buildCache = function buildCache() {
|
|
3689
3845
|
this.$el = $(this.el);
|
|
3690
3846
|
this.$target = this.$el.data('target') ? $(document).find(this.$el.data('target')) : $(document).find(this.opts.target);
|
|
3691
3847
|
this.expanded = this.$el.attr('aria-expanded') == 'true' ? true : false;
|
|
@@ -3708,33 +3864,36 @@ class Collapse extends AbstractUIComponent {
|
|
|
3708
3864
|
this.log('Expanded: ' + this.expanded);
|
|
3709
3865
|
this.log('Target height: ' + this.targetHeight + 'px');
|
|
3710
3866
|
} // Bind events that trigger methods
|
|
3867
|
+
;
|
|
3711
3868
|
|
|
3869
|
+
_proto.bindEvents = function bindEvents() {
|
|
3870
|
+
var _this2 = this;
|
|
3712
3871
|
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
this.close();
|
|
3872
|
+
this.$el.on('click' + '.' + this.name, function (e) {
|
|
3873
|
+
if (_this2.expanded) {
|
|
3874
|
+
_this2.close();
|
|
3717
3875
|
} else {
|
|
3718
|
-
|
|
3876
|
+
_this2.show();
|
|
3719
3877
|
}
|
|
3720
3878
|
});
|
|
3721
|
-
$(window).on('resize', debounce(()
|
|
3722
|
-
if (
|
|
3723
|
-
|
|
3724
|
-
|
|
3879
|
+
$(window).on('resize', debounce(function () {
|
|
3880
|
+
if (_this2.$target.length) {
|
|
3881
|
+
_this2.targetHeight = _this2.$target.height();
|
|
3882
|
+
|
|
3883
|
+
_this2.log('Target height: ' + _this2.targetHeight + 'px');
|
|
3725
3884
|
}
|
|
3726
3885
|
}, 250));
|
|
3727
3886
|
} // Unbind events that trigger methods
|
|
3887
|
+
;
|
|
3728
3888
|
|
|
3729
|
-
|
|
3730
|
-
unbindEvents() {
|
|
3889
|
+
_proto.unbindEvents = function unbindEvents() {
|
|
3731
3890
|
this.$el.off('.' + this.name);
|
|
3732
3891
|
} // Which transition
|
|
3892
|
+
;
|
|
3733
3893
|
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
let transEndEventNames = {
|
|
3894
|
+
_proto.whichTransitionEvent = function whichTransitionEvent() {
|
|
3895
|
+
var el = document.createElement('text-transition');
|
|
3896
|
+
var transEndEventNames = {
|
|
3738
3897
|
'WebkitTransition': 'webkitTransitionEnd',
|
|
3739
3898
|
// Saf 6, Android Browser
|
|
3740
3899
|
'MozTransition': 'transitionend',
|
|
@@ -3743,15 +3902,17 @@ class Collapse extends AbstractUIComponent {
|
|
|
3743
3902
|
|
|
3744
3903
|
};
|
|
3745
3904
|
|
|
3746
|
-
for (
|
|
3905
|
+
for (var t in transEndEventNames) {
|
|
3747
3906
|
if (el.style[t] !== undefined) {
|
|
3748
3907
|
return transEndEventNames[t];
|
|
3749
3908
|
}
|
|
3750
3909
|
}
|
|
3751
3910
|
} // Show
|
|
3911
|
+
;
|
|
3752
3912
|
|
|
3913
|
+
_proto.show = function show() {
|
|
3914
|
+
var _this3 = this;
|
|
3753
3915
|
|
|
3754
|
-
show() {
|
|
3755
3916
|
this.$target.removeClass('collapse visible');
|
|
3756
3917
|
this.$target.addClass('collapsing');
|
|
3757
3918
|
|
|
@@ -3770,24 +3931,30 @@ class Collapse extends AbstractUIComponent {
|
|
|
3770
3931
|
this.$indicator.addClass('visible');
|
|
3771
3932
|
}
|
|
3772
3933
|
|
|
3773
|
-
this.$target.one(this.whichTransitionEvent(), ()
|
|
3774
|
-
|
|
3934
|
+
this.$target.one(this.whichTransitionEvent(), function () {
|
|
3935
|
+
_this3.$target.removeClass('collapsing');
|
|
3775
3936
|
|
|
3776
|
-
if (
|
|
3777
|
-
|
|
3937
|
+
if (_this3.$el.is('button')) {
|
|
3938
|
+
_this3.$el.attr('disabled', false);
|
|
3778
3939
|
}
|
|
3779
3940
|
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3941
|
+
_this3.$target.removeAttr('style');
|
|
3942
|
+
|
|
3943
|
+
_this3.$target.addClass('collapse visible');
|
|
3944
|
+
|
|
3945
|
+
_this3.$el.attr('aria-expanded', true);
|
|
3946
|
+
|
|
3947
|
+
_this3.$target.css('height', 'auto');
|
|
3948
|
+
|
|
3949
|
+
_this3.expanded = true;
|
|
3785
3950
|
});
|
|
3786
3951
|
this.onShow();
|
|
3787
3952
|
} // Close
|
|
3953
|
+
;
|
|
3788
3954
|
|
|
3955
|
+
_proto.close = function close() {
|
|
3956
|
+
var _this4 = this;
|
|
3789
3957
|
|
|
3790
|
-
close() {
|
|
3791
3958
|
this.$target.removeClass('collapse visible');
|
|
3792
3959
|
this.$target.addClass('collapsing');
|
|
3793
3960
|
|
|
@@ -3800,34 +3967,37 @@ class Collapse extends AbstractUIComponent {
|
|
|
3800
3967
|
}
|
|
3801
3968
|
|
|
3802
3969
|
this.$target.css('height', this.$target.height());
|
|
3803
|
-
setTimeout(()
|
|
3804
|
-
|
|
3970
|
+
setTimeout(function () {
|
|
3971
|
+
_this4.$target.css('height', 0);
|
|
3805
3972
|
}, 10);
|
|
3806
3973
|
|
|
3807
3974
|
if (this.$indicator.length && this.$indicator.hasClass('visible')) {
|
|
3808
3975
|
this.$indicator.removeClass('visible');
|
|
3809
3976
|
}
|
|
3810
3977
|
|
|
3811
|
-
this.$target.one(this.whichTransitionEvent(), ()
|
|
3812
|
-
|
|
3978
|
+
this.$target.one(this.whichTransitionEvent(), function () {
|
|
3979
|
+
_this4.$target.removeClass('collapsing');
|
|
3813
3980
|
|
|
3814
|
-
if (
|
|
3815
|
-
|
|
3981
|
+
if (_this4.$el.is('button')) {
|
|
3982
|
+
_this4.$el.attr('disabled', false);
|
|
3816
3983
|
}
|
|
3817
3984
|
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3985
|
+
_this4.$target.removeAttr('style');
|
|
3986
|
+
|
|
3987
|
+
_this4.$target.addClass('collapse');
|
|
3988
|
+
|
|
3989
|
+
_this4.$el.attr('aria-expanded', false);
|
|
3990
|
+
|
|
3991
|
+
_this4.expanded = false;
|
|
3822
3992
|
});
|
|
3823
3993
|
this.onClose();
|
|
3824
|
-
}
|
|
3994
|
+
};
|
|
3825
3995
|
|
|
3826
|
-
|
|
3996
|
+
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
|
3827
3997
|
return this.each(function () {
|
|
3828
|
-
|
|
3998
|
+
var data = $(this).data(DATA_KEY$5);
|
|
3829
3999
|
|
|
3830
|
-
|
|
4000
|
+
var _config = typeof config === 'object' && config;
|
|
3831
4001
|
|
|
3832
4002
|
if (!data) {
|
|
3833
4003
|
data = new Collapse(this, _config);
|
|
@@ -3842,18 +4012,19 @@ class Collapse extends AbstractUIComponent {
|
|
|
3842
4012
|
data[config]();
|
|
3843
4013
|
}
|
|
3844
4014
|
});
|
|
3845
|
-
}
|
|
4015
|
+
};
|
|
3846
4016
|
|
|
3847
|
-
|
|
4017
|
+
return Collapse;
|
|
4018
|
+
}(AbstractUIComponent);
|
|
3848
4019
|
|
|
3849
4020
|
if (typeof $ !== 'undefined') {
|
|
3850
4021
|
// jQuery
|
|
3851
|
-
|
|
4022
|
+
var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
|
|
3852
4023
|
$.fn[NAME$5] = Collapse._jQueryInterface;
|
|
3853
4024
|
$.fn[NAME$5].Constructor = Collapse;
|
|
3854
4025
|
|
|
3855
|
-
$.fn[NAME$5].noConflict = ()
|
|
3856
|
-
$.fn[NAME$5] = JQUERY_NO_CONFLICT;
|
|
4026
|
+
$.fn[NAME$5].noConflict = function () {
|
|
4027
|
+
$.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
|
|
3857
4028
|
return Collapse._jQueryInterface;
|
|
3858
4029
|
};
|
|
3859
4030
|
|
|
@@ -3868,11 +4039,13 @@ if (typeof $ !== 'undefined') {
|
|
|
3868
4039
|
};
|
|
3869
4040
|
}
|
|
3870
4041
|
|
|
3871
|
-
|
|
3872
|
-
|
|
4042
|
+
var NAME$6 = 'coolToast';
|
|
4043
|
+
var DATA_KEY$6 = 'plugin_coolToast';
|
|
3873
4044
|
|
|
3874
|
-
|
|
3875
|
-
|
|
4045
|
+
var Toast =
|
|
4046
|
+
/*#__PURE__*/
|
|
4047
|
+
function () {
|
|
4048
|
+
function Toast(container, opts) {
|
|
3876
4049
|
this.settings = {};
|
|
3877
4050
|
|
|
3878
4051
|
if (window.Cool.settings.toast) {
|
|
@@ -3893,7 +4066,9 @@ class Toast {
|
|
|
3893
4066
|
} // Add item to queue
|
|
3894
4067
|
|
|
3895
4068
|
|
|
3896
|
-
|
|
4069
|
+
var _proto = Toast.prototype;
|
|
4070
|
+
|
|
4071
|
+
_proto.addQueue = function addQueue(toast) {
|
|
3897
4072
|
this.queue.push(toast);
|
|
3898
4073
|
|
|
3899
4074
|
if (this.processingQueue) {
|
|
@@ -3902,9 +4077,9 @@ class Toast {
|
|
|
3902
4077
|
|
|
3903
4078
|
return this.processQueue();
|
|
3904
4079
|
} // Process queue
|
|
4080
|
+
;
|
|
3905
4081
|
|
|
3906
|
-
|
|
3907
|
-
processQueue() {
|
|
4082
|
+
_proto.processQueue = function processQueue() {
|
|
3908
4083
|
if (this.processingQueue) {
|
|
3909
4084
|
this.queue.shift();
|
|
3910
4085
|
}
|
|
@@ -3917,26 +4092,26 @@ class Toast {
|
|
|
3917
4092
|
this.processingQueue = true;
|
|
3918
4093
|
return this.show(this.queue[0]);
|
|
3919
4094
|
} // Init toast
|
|
4095
|
+
;
|
|
3920
4096
|
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
let settings = {};
|
|
4097
|
+
_proto.init = function init(opts) {
|
|
4098
|
+
var settings = {};
|
|
3924
4099
|
$.extend(true, settings, this.settings, opts);
|
|
3925
|
-
|
|
4100
|
+
var toast = this.buildToast(settings);
|
|
3926
4101
|
this.addQueue(toast);
|
|
3927
4102
|
this.onInit(toast);
|
|
3928
4103
|
return toast;
|
|
3929
4104
|
} // Remove plugin instance completely
|
|
4105
|
+
;
|
|
3930
4106
|
|
|
3931
|
-
|
|
3932
|
-
destroy() {
|
|
4107
|
+
_proto.destroy = function destroy() {
|
|
3933
4108
|
this.$container.removeData(DATA_KEY$6);
|
|
3934
4109
|
this.onDestroy();
|
|
3935
4110
|
} // Build toast
|
|
4111
|
+
;
|
|
3936
4112
|
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
let toast = {
|
|
4113
|
+
_proto.buildToast = function buildToast(settings) {
|
|
4114
|
+
var toast = {
|
|
3940
4115
|
uuid: 'toast-' + this.generateUUID(),
|
|
3941
4116
|
placement: settings.placement,
|
|
3942
4117
|
placementX: settings.placementX,
|
|
@@ -3971,33 +4146,35 @@ class Toast {
|
|
|
3971
4146
|
this.toasts.push(toast);
|
|
3972
4147
|
return toast;
|
|
3973
4148
|
} // Bind events that trigger methods
|
|
4149
|
+
;
|
|
3974
4150
|
|
|
4151
|
+
_proto.bindEvents = function bindEvents(toast) {
|
|
4152
|
+
var _this = this;
|
|
3975
4153
|
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
toast.$el.on('click', '[data-toast-close]', () => {
|
|
4154
|
+
var self = this;
|
|
4155
|
+
toast.$el.on('click', '[data-toast-close]', function () {
|
|
3979
4156
|
if (toast.$el) {
|
|
3980
4157
|
self.close(toast);
|
|
3981
4158
|
}
|
|
3982
4159
|
});
|
|
3983
|
-
$(window).on('resize', debounce(()
|
|
4160
|
+
$(window).on('resize', debounce(function () {
|
|
3984
4161
|
if (toast.$el) {
|
|
3985
|
-
|
|
4162
|
+
_this.setPosition(toast);
|
|
3986
4163
|
}
|
|
3987
4164
|
}, 250));
|
|
3988
4165
|
} // Generate UUID
|
|
4166
|
+
;
|
|
3989
4167
|
|
|
3990
|
-
|
|
3991
|
-
generateUUID() {
|
|
4168
|
+
_proto.generateUUID = function generateUUID() {
|
|
3992
4169
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
3993
|
-
|
|
4170
|
+
var r = Math.random() * 16 | 0,
|
|
3994
4171
|
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
3995
4172
|
return v.toString(16);
|
|
3996
4173
|
});
|
|
3997
4174
|
} // Set positions
|
|
4175
|
+
;
|
|
3998
4176
|
|
|
3999
|
-
|
|
4000
|
-
setPosition(toast, placement, placementY, placementX) {
|
|
4177
|
+
_proto.setPosition = function setPosition(toast, placement, placementY, placementX) {
|
|
4001
4178
|
if (typeof placementY === 'undefined' || placementY === null) {
|
|
4002
4179
|
placementY = toast.placementY;
|
|
4003
4180
|
}
|
|
@@ -4011,15 +4188,17 @@ class Toast {
|
|
|
4011
4188
|
}
|
|
4012
4189
|
|
|
4013
4190
|
if (toast.offset) {
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4191
|
+
var offsets = toast.offset.split(',');
|
|
4192
|
+
|
|
4193
|
+
var _offsetX = parseInt(offsets[0], 10);
|
|
4194
|
+
|
|
4195
|
+
var _offsetY = parseInt(offsets[1], 10);
|
|
4017
4196
|
}
|
|
4018
4197
|
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4198
|
+
var toastWidth = toast.$el.outerWidth(true);
|
|
4199
|
+
var toastHeight = toast.$el.outerHeight(true);
|
|
4200
|
+
var toastPosX;
|
|
4201
|
+
var toastPosY;
|
|
4023
4202
|
|
|
4024
4203
|
if (placement) {
|
|
4025
4204
|
if (placement === 'top-left') {
|
|
@@ -4133,9 +4312,11 @@ class Toast {
|
|
|
4133
4312
|
this.log('Toast position Y: ' + toastPosX + 'px');
|
|
4134
4313
|
this.log('Toast position x: ' + toastPosY + 'px');
|
|
4135
4314
|
} // Show
|
|
4315
|
+
;
|
|
4136
4316
|
|
|
4317
|
+
_proto.show = function show(toast) {
|
|
4318
|
+
var _this2 = this;
|
|
4137
4319
|
|
|
4138
|
-
show(toast) {
|
|
4139
4320
|
this.$container.append(toast.$el);
|
|
4140
4321
|
this.bindEvents(toast);
|
|
4141
4322
|
this.setPosition(toast);
|
|
@@ -4149,25 +4330,29 @@ class Toast {
|
|
|
4149
4330
|
}
|
|
4150
4331
|
|
|
4151
4332
|
if (toast.dismiss) {
|
|
4152
|
-
setTimeout(()
|
|
4153
|
-
|
|
4333
|
+
setTimeout(function () {
|
|
4334
|
+
_this2.close(toast);
|
|
4154
4335
|
}, toast.dismiss * 1000);
|
|
4155
4336
|
}
|
|
4156
4337
|
|
|
4157
4338
|
this.onShow(toast);
|
|
4158
4339
|
} // Close
|
|
4340
|
+
;
|
|
4159
4341
|
|
|
4342
|
+
_proto.close = function close(toast) {
|
|
4343
|
+
var _this3 = this;
|
|
4160
4344
|
|
|
4161
|
-
close(toast) {
|
|
4162
4345
|
if (toast.animation && !toast.$inner.hasClass('animated')) {
|
|
4163
4346
|
toast.$el.removeClass('show');
|
|
4164
|
-
toast.$inner.animateCss(toast.animationOut, ()
|
|
4347
|
+
toast.$inner.animateCss(toast.animationOut, function () {
|
|
4165
4348
|
toast.$el.remove();
|
|
4166
|
-
|
|
4349
|
+
_this3.toasts = $.grep(_this3.toasts, function (item) {
|
|
4167
4350
|
return item.uuid != toast.uuid;
|
|
4168
4351
|
});
|
|
4169
|
-
|
|
4170
|
-
|
|
4352
|
+
|
|
4353
|
+
_this3.processQueue();
|
|
4354
|
+
|
|
4355
|
+
_this3.onClose(toast);
|
|
4171
4356
|
});
|
|
4172
4357
|
} else {
|
|
4173
4358
|
toast.$el.remove();
|
|
@@ -4178,70 +4363,72 @@ class Toast {
|
|
|
4178
4363
|
this.onClose(toast);
|
|
4179
4364
|
}
|
|
4180
4365
|
} // Initialize callback
|
|
4366
|
+
;
|
|
4181
4367
|
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
let onInitialize = this.onInitialize;
|
|
4368
|
+
_proto.onInitialize = function onInitialize() {
|
|
4369
|
+
var onInitialize = this.onInitialize;
|
|
4185
4370
|
|
|
4186
4371
|
if (typeof onInitialize === 'function') {
|
|
4187
4372
|
onInitialize.call(this.container);
|
|
4188
4373
|
}
|
|
4189
4374
|
} // Destroy callback
|
|
4375
|
+
;
|
|
4190
4376
|
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
let onDestroy = this.onDestroy;
|
|
4377
|
+
_proto.onDestroy = function onDestroy() {
|
|
4378
|
+
var onDestroy = this.onDestroy;
|
|
4194
4379
|
|
|
4195
4380
|
if (typeof onDestroy === 'function') {
|
|
4196
4381
|
onDestroy.call(this.container);
|
|
4197
4382
|
}
|
|
4198
4383
|
} // Init callback
|
|
4384
|
+
;
|
|
4199
4385
|
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
let onInit = toast.onInit;
|
|
4386
|
+
_proto.onInit = function onInit(toast) {
|
|
4387
|
+
var onInit = toast.onInit;
|
|
4203
4388
|
|
|
4204
4389
|
if (typeof onInit === 'function') {
|
|
4205
4390
|
onInit.call(toast);
|
|
4206
4391
|
}
|
|
4207
4392
|
} // Show callback
|
|
4393
|
+
;
|
|
4208
4394
|
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
let onShow = toast.onShow;
|
|
4395
|
+
_proto.onShow = function onShow(toast) {
|
|
4396
|
+
var onShow = toast.onShow;
|
|
4212
4397
|
|
|
4213
4398
|
if (typeof onShow === 'function') {
|
|
4214
4399
|
onShow.call(toast);
|
|
4215
4400
|
}
|
|
4216
4401
|
} // Close callback
|
|
4402
|
+
;
|
|
4217
4403
|
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
let onClose = toast.onClose;
|
|
4404
|
+
_proto.onClose = function onClose(toast) {
|
|
4405
|
+
var onClose = toast.onClose;
|
|
4221
4406
|
|
|
4222
4407
|
if (typeof onClose === 'function') {
|
|
4223
4408
|
onClose.call(toast);
|
|
4224
4409
|
}
|
|
4225
4410
|
} // Debug log
|
|
4411
|
+
;
|
|
4226
4412
|
|
|
4227
|
-
|
|
4228
|
-
log() {
|
|
4413
|
+
_proto.log = function log() {
|
|
4229
4414
|
if (this.debug) {
|
|
4230
4415
|
if (typeof this.debug === 'function') {
|
|
4231
|
-
this.debug(
|
|
4416
|
+
this.debug.apply(this, arguments);
|
|
4232
4417
|
} else {
|
|
4233
|
-
|
|
4418
|
+
var _console;
|
|
4419
|
+
|
|
4420
|
+
(_console = console).log.apply(_console, arguments);
|
|
4234
4421
|
}
|
|
4235
4422
|
}
|
|
4236
4423
|
} // Render template
|
|
4424
|
+
;
|
|
4237
4425
|
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
let bodyCloseBtn = '';
|
|
4426
|
+
_proto._renderTemplate = function _renderTemplate(toast) {
|
|
4427
|
+
var faNameSpace = this.faPro ? 'far' : 'fas';
|
|
4428
|
+
var content = '';
|
|
4429
|
+
var header = '';
|
|
4430
|
+
var body = '';
|
|
4431
|
+
var bodyCloseBtn = '';
|
|
4245
4432
|
|
|
4246
4433
|
if (typeof toast.content === 'function') {
|
|
4247
4434
|
content = toast.content();
|
|
@@ -4257,13 +4444,13 @@ class Toast {
|
|
|
4257
4444
|
|
|
4258
4445
|
body = "\n <div class=\"toast-body\">\n\n <span>" + content + "</span>\n " + bodyCloseBtn + "\n\n </div>\n ";
|
|
4259
4446
|
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 ";
|
|
4260
|
-
}
|
|
4447
|
+
};
|
|
4261
4448
|
|
|
4262
|
-
|
|
4449
|
+
Toast._jQueryInterface = function _jQueryInterface(config) {
|
|
4263
4450
|
return this.each(function () {
|
|
4264
|
-
|
|
4451
|
+
var data = $(this).data(DATA_KEY$6);
|
|
4265
4452
|
|
|
4266
|
-
|
|
4453
|
+
var _config = typeof config === 'object' && config;
|
|
4267
4454
|
|
|
4268
4455
|
if (!data) {
|
|
4269
4456
|
data = new Toast(this, _config);
|
|
@@ -4278,22 +4465,25 @@ class Toast {
|
|
|
4278
4465
|
data[config]();
|
|
4279
4466
|
}
|
|
4280
4467
|
});
|
|
4281
|
-
}
|
|
4468
|
+
};
|
|
4282
4469
|
|
|
4283
|
-
|
|
4470
|
+
return Toast;
|
|
4471
|
+
}();
|
|
4284
4472
|
|
|
4285
4473
|
if (typeof $ !== 'undefined') {
|
|
4474
|
+
var _$$fn$NAME$defaults;
|
|
4475
|
+
|
|
4286
4476
|
// jQuery
|
|
4287
|
-
|
|
4477
|
+
var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
|
|
4288
4478
|
$.fn[NAME$6] = Toast._jQueryInterface;
|
|
4289
4479
|
$.fn[NAME$6].Constructor = Toast;
|
|
4290
4480
|
|
|
4291
|
-
$.fn[NAME$6].noConflict = ()
|
|
4292
|
-
$.fn[NAME$6] = JQUERY_NO_CONFLICT;
|
|
4481
|
+
$.fn[NAME$6].noConflict = function () {
|
|
4482
|
+
$.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
|
|
4293
4483
|
return Toast._jQueryInterface;
|
|
4294
4484
|
};
|
|
4295
4485
|
|
|
4296
|
-
$.fn[NAME$6].defaults = {
|
|
4486
|
+
$.fn[NAME$6].defaults = (_$$fn$NAME$defaults = {
|
|
4297
4487
|
title: '',
|
|
4298
4488
|
content: '',
|
|
4299
4489
|
template: '',
|
|
@@ -4313,18 +4503,17 @@ if (typeof $ !== 'undefined') {
|
|
|
4313
4503
|
debug: false,
|
|
4314
4504
|
onInitialize: null,
|
|
4315
4505
|
onDestroy: null,
|
|
4316
|
-
onInit: null
|
|
4317
|
-
|
|
4318
|
-
onShow: null,
|
|
4319
|
-
onClose: null
|
|
4320
|
-
};
|
|
4506
|
+
onInit: null
|
|
4507
|
+
}, _$$fn$NAME$defaults["onDestroy"] = null, _$$fn$NAME$defaults.onShow = null, _$$fn$NAME$defaults.onClose = null, _$$fn$NAME$defaults);
|
|
4321
4508
|
}
|
|
4322
4509
|
|
|
4323
|
-
|
|
4324
|
-
|
|
4510
|
+
var NAME$7 = 'coolDialog';
|
|
4511
|
+
var DATA_KEY$7 = 'plugin_coolDialog';
|
|
4325
4512
|
|
|
4326
|
-
|
|
4327
|
-
|
|
4513
|
+
var Dialog =
|
|
4514
|
+
/*#__PURE__*/
|
|
4515
|
+
function () {
|
|
4516
|
+
function Dialog(container, opts) {
|
|
4328
4517
|
this.settings = {};
|
|
4329
4518
|
|
|
4330
4519
|
if (window.Cool.settings.dialog) {
|
|
@@ -4343,26 +4532,28 @@ class Dialog {
|
|
|
4343
4532
|
} // Init dialog
|
|
4344
4533
|
|
|
4345
4534
|
|
|
4346
|
-
|
|
4347
|
-
|
|
4535
|
+
var _proto = Dialog.prototype;
|
|
4536
|
+
|
|
4537
|
+
_proto.init = function init(opts) {
|
|
4538
|
+
var settings = {};
|
|
4348
4539
|
$.extend(true, settings, this.settings, opts);
|
|
4349
|
-
|
|
4540
|
+
var dialog = this.buildDialog(settings);
|
|
4350
4541
|
this.show(dialog);
|
|
4351
4542
|
this.bindEvents(dialog);
|
|
4352
4543
|
this.onInit(dialog);
|
|
4353
4544
|
return dialog;
|
|
4354
4545
|
} // Remove plugin instance completely
|
|
4546
|
+
;
|
|
4355
4547
|
|
|
4356
|
-
|
|
4357
|
-
destroy() {
|
|
4548
|
+
_proto.destroy = function destroy() {
|
|
4358
4549
|
this.$container.removeData(DATA_KEY$7);
|
|
4359
4550
|
this.onDestroy();
|
|
4360
4551
|
} // Build dialog
|
|
4552
|
+
;
|
|
4361
4553
|
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
let dialog = {
|
|
4554
|
+
_proto.buildDialog = function buildDialog(settings) {
|
|
4555
|
+
var self = this;
|
|
4556
|
+
var dialog = {
|
|
4366
4557
|
uuid: 'dialog-' + this.generateUUID(),
|
|
4367
4558
|
title: settings.title,
|
|
4368
4559
|
template: settings.template,
|
|
@@ -4404,10 +4595,10 @@ class Dialog {
|
|
|
4404
4595
|
this.dialogs.push(dialog);
|
|
4405
4596
|
return dialog;
|
|
4406
4597
|
} // Bind events that trigger methods
|
|
4598
|
+
;
|
|
4407
4599
|
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
let self = this;
|
|
4600
|
+
_proto.bindEvents = function bindEvents(dialog) {
|
|
4601
|
+
var self = this;
|
|
4411
4602
|
dialog.$el.on('click', '[data-dialog-close]', function (e) {
|
|
4412
4603
|
dialog.$el.trigger('dialog.close');
|
|
4413
4604
|
|
|
@@ -4440,18 +4631,20 @@ class Dialog {
|
|
|
4440
4631
|
}
|
|
4441
4632
|
}));
|
|
4442
4633
|
} // Generate UUID
|
|
4634
|
+
;
|
|
4443
4635
|
|
|
4444
|
-
|
|
4445
|
-
generateUUID() {
|
|
4636
|
+
_proto.generateUUID = function generateUUID() {
|
|
4446
4637
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
4447
|
-
|
|
4638
|
+
var r = Math.random() * 16 | 0,
|
|
4448
4639
|
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
4449
4640
|
return v.toString(16);
|
|
4450
4641
|
});
|
|
4451
4642
|
} // Show
|
|
4643
|
+
;
|
|
4452
4644
|
|
|
4645
|
+
_proto.show = function show(dialog) {
|
|
4646
|
+
var _this = this;
|
|
4453
4647
|
|
|
4454
|
-
show(dialog) {
|
|
4455
4648
|
if (!this.$container.hasClass('has-dialogs')) {
|
|
4456
4649
|
this.$container.addClass('has-dialogs');
|
|
4457
4650
|
}
|
|
@@ -4461,8 +4654,8 @@ class Dialog {
|
|
|
4461
4654
|
}
|
|
4462
4655
|
|
|
4463
4656
|
if (this.dialogs.length > 1) {
|
|
4464
|
-
|
|
4465
|
-
|
|
4657
|
+
var $prevDialog = $(this.dialogs).eq(-2)[0].$el;
|
|
4658
|
+
var zIndex = parseInt($prevDialog.css('z-index'), 10) + 1;
|
|
4466
4659
|
dialog.$el.css('z-index', zIndex);
|
|
4467
4660
|
$prevDialog.css({
|
|
4468
4661
|
'transition': 'opacity 0.3s',
|
|
@@ -4473,8 +4666,8 @@ class Dialog {
|
|
|
4473
4666
|
|
|
4474
4667
|
if (dialog.backdrop && $('.dialog-backdrop').length < 1) {
|
|
4475
4668
|
this.$container.append('<div class="dialog-backdrop"></div>');
|
|
4476
|
-
|
|
4477
|
-
if (
|
|
4669
|
+
var checkForBackdrop = setInterval(function () {
|
|
4670
|
+
if (_this.dialogs.length == 0 && $('.dialog-backdrop').length) {
|
|
4478
4671
|
$('.dialog-backdrop').remove();
|
|
4479
4672
|
clearInterval(checkForBackdrop);
|
|
4480
4673
|
}
|
|
@@ -4499,10 +4692,12 @@ class Dialog {
|
|
|
4499
4692
|
|
|
4500
4693
|
this.onShow(dialog);
|
|
4501
4694
|
} // Close
|
|
4695
|
+
;
|
|
4502
4696
|
|
|
4697
|
+
_proto.close = function close(dialog) {
|
|
4698
|
+
var _this2 = this;
|
|
4503
4699
|
|
|
4504
|
-
|
|
4505
|
-
let $prevDialog = null;
|
|
4700
|
+
var $prevDialog = null;
|
|
4506
4701
|
|
|
4507
4702
|
if (this.dialogs.length > 1) {
|
|
4508
4703
|
$prevDialog = $(this.dialogs).eq(-2)[0].$el;
|
|
@@ -4513,17 +4708,17 @@ class Dialog {
|
|
|
4513
4708
|
}
|
|
4514
4709
|
|
|
4515
4710
|
if (dialog.animation) {
|
|
4516
|
-
dialog.$el.find('.dialog-content').animateCss(dialog.animationOut, ()
|
|
4711
|
+
dialog.$el.find('.dialog-content').animateCss(dialog.animationOut, function () {
|
|
4517
4712
|
dialog.$el.remove();
|
|
4518
|
-
|
|
4713
|
+
_this2.dialogs = $.grep(_this2.dialogs, function (item) {
|
|
4519
4714
|
return item.uuid != dialog.uuid;
|
|
4520
4715
|
});
|
|
4521
4716
|
|
|
4522
|
-
if (
|
|
4523
|
-
|
|
4717
|
+
if (_this2.dialogs.length == 0) {
|
|
4718
|
+
_this2.$container.removeClass('has-dialogs');
|
|
4524
4719
|
|
|
4525
|
-
if (
|
|
4526
|
-
|
|
4720
|
+
if (_this2.$container.hasClass('dialog-prevent-scroll')) {
|
|
4721
|
+
_this2.$container.removeClass('dialog-prevent-scroll');
|
|
4527
4722
|
}
|
|
4528
4723
|
} else {
|
|
4529
4724
|
if ($prevDialog) {
|
|
@@ -4552,78 +4747,80 @@ class Dialog {
|
|
|
4552
4747
|
|
|
4553
4748
|
this.onClose(dialog);
|
|
4554
4749
|
} // Initialize callback
|
|
4750
|
+
;
|
|
4555
4751
|
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
let onInitialize = this.onInitialize;
|
|
4752
|
+
_proto.onInitialize = function onInitialize() {
|
|
4753
|
+
var onInitialize = this.onInitialize;
|
|
4559
4754
|
|
|
4560
4755
|
if (typeof onInitialize === 'function') {
|
|
4561
4756
|
onInitialize.call(this.container);
|
|
4562
4757
|
}
|
|
4563
4758
|
} // Destroy callback
|
|
4759
|
+
;
|
|
4564
4760
|
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
let onDestroy = this.onDestroy;
|
|
4761
|
+
_proto.onDestroy = function onDestroy() {
|
|
4762
|
+
var onDestroy = this.onDestroy;
|
|
4568
4763
|
|
|
4569
4764
|
if (typeof onDestroy === 'function') {
|
|
4570
4765
|
onDestroy.call(this.container);
|
|
4571
4766
|
}
|
|
4572
4767
|
} // Init callback
|
|
4768
|
+
;
|
|
4573
4769
|
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
let onInit = dialog.onInit;
|
|
4770
|
+
_proto.onInit = function onInit(dialog) {
|
|
4771
|
+
var onInit = dialog.onInit;
|
|
4577
4772
|
|
|
4578
4773
|
if (typeof onInit === 'function') {
|
|
4579
4774
|
onInit.call(dialog);
|
|
4580
4775
|
}
|
|
4581
4776
|
} // Show callback
|
|
4777
|
+
;
|
|
4582
4778
|
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
let onShow = dialog.onShow;
|
|
4779
|
+
_proto.onShow = function onShow(dialog) {
|
|
4780
|
+
var onShow = dialog.onShow;
|
|
4586
4781
|
|
|
4587
4782
|
if (typeof onShow === 'function') {
|
|
4588
4783
|
onShow.call(dialog);
|
|
4589
4784
|
}
|
|
4590
4785
|
} // Close callback
|
|
4786
|
+
;
|
|
4591
4787
|
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
let onClose = dialog.onClose;
|
|
4788
|
+
_proto.onClose = function onClose(dialog) {
|
|
4789
|
+
var onClose = dialog.onClose;
|
|
4595
4790
|
|
|
4596
4791
|
if (typeof onClose === 'function') {
|
|
4597
4792
|
onClose.call(dialog);
|
|
4598
4793
|
}
|
|
4599
4794
|
} // Debug log
|
|
4795
|
+
;
|
|
4600
4796
|
|
|
4601
|
-
|
|
4602
|
-
log() {
|
|
4797
|
+
_proto.log = function log() {
|
|
4603
4798
|
if (this.debug) {
|
|
4604
4799
|
if (typeof this.debug === 'function') {
|
|
4605
|
-
this.debug(
|
|
4800
|
+
this.debug.apply(this, arguments);
|
|
4606
4801
|
} else {
|
|
4607
|
-
|
|
4802
|
+
var _console;
|
|
4803
|
+
|
|
4804
|
+
(_console = console).log.apply(_console, arguments);
|
|
4608
4805
|
}
|
|
4609
4806
|
}
|
|
4610
4807
|
} // Render footer
|
|
4808
|
+
;
|
|
4611
4809
|
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
let footer = '';
|
|
4810
|
+
_proto._renderFooter = function _renderFooter(dialog) {
|
|
4811
|
+
var footer = '';
|
|
4615
4812
|
|
|
4616
4813
|
if (typeof dialog.footer === 'function') {
|
|
4617
4814
|
footer = dialog.footer();
|
|
4618
4815
|
} else if (dialog.footer !== '' && dialog.footer !== false && dialog.footer !== true) {
|
|
4619
4816
|
footer = dialog.footer;
|
|
4620
4817
|
} else if (dialog.footer === true) {
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4818
|
+
var btnCancel = '';
|
|
4819
|
+
var btnRemove = '';
|
|
4820
|
+
var btnConfirm = '';
|
|
4821
|
+
var btnStyle = '';
|
|
4822
|
+
var btnClasses = '';
|
|
4823
|
+
var btnAttrs = '';
|
|
4627
4824
|
|
|
4628
4825
|
if (dialog.actions.close.visible) {
|
|
4629
4826
|
btnStyle = dialog.actions.close.primary ? 'btn-primary' : 'btn-secondary';
|
|
@@ -4655,21 +4852,21 @@ class Dialog {
|
|
|
4655
4852
|
return "\n <div class=\"dialog-footer\">\n " + footer + "\n </div>\n ";
|
|
4656
4853
|
}
|
|
4657
4854
|
} // Render template
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
_renderTemplate(dialog) {
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4855
|
+
;
|
|
4856
|
+
|
|
4857
|
+
_proto._renderTemplate = function _renderTemplate(dialog) {
|
|
4858
|
+
var faNameSpace = this.faPro ? 'far' : 'fas';
|
|
4859
|
+
var classes = dialog.classes ? ' ' + dialog.classes : '';
|
|
4860
|
+
var centered = dialog.centered ? ' dialog-centered' : '';
|
|
4861
|
+
var size = dialog.size ? ' dialog-' + dialog.size : '';
|
|
4862
|
+
var uuid = ' data-dialog-uuid="' + dialog.uuid + '"';
|
|
4863
|
+
var backdrop = dialog.backdrop ? ' data-dialog-backdrop="true"' : ' data-dialog-backdrop="false"';
|
|
4864
|
+
var title = dialog.title;
|
|
4865
|
+
var closeBtn = dialog.closeBtn ? "<button type=\"button\" data-dialog-close><i class=\"" + faNameSpace + " fa-times icon\"></i></button>" : '';
|
|
4866
|
+
var maxBodyHeight = dialog.maxBodyHeight ? ' style="max-height: ' + dialog.maxBodyHeight + 'px"' : '';
|
|
4867
|
+
var body = '';
|
|
4868
|
+
|
|
4869
|
+
var footer = this._renderFooter(dialog);
|
|
4673
4870
|
|
|
4674
4871
|
if (typeof dialog.body === 'function') {
|
|
4675
4872
|
body = dialog.body();
|
|
@@ -4678,12 +4875,12 @@ class Dialog {
|
|
|
4678
4875
|
}
|
|
4679
4876
|
|
|
4680
4877
|
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 ";
|
|
4681
|
-
}
|
|
4878
|
+
};
|
|
4682
4879
|
|
|
4683
|
-
|
|
4684
|
-
|
|
4880
|
+
Dialog._jQueryInterface = function _jQueryInterface(config) {
|
|
4881
|
+
var data = $(this).data(DATA_KEY$7);
|
|
4685
4882
|
|
|
4686
|
-
|
|
4883
|
+
var _config = typeof config === 'object' && config;
|
|
4687
4884
|
|
|
4688
4885
|
if (!data) {
|
|
4689
4886
|
data = new Dialog(this, _config);
|
|
@@ -4697,22 +4894,25 @@ class Dialog {
|
|
|
4697
4894
|
|
|
4698
4895
|
data[config]();
|
|
4699
4896
|
}
|
|
4700
|
-
}
|
|
4897
|
+
};
|
|
4701
4898
|
|
|
4702
|
-
|
|
4899
|
+
return Dialog;
|
|
4900
|
+
}();
|
|
4703
4901
|
|
|
4704
4902
|
if (typeof $ !== 'undefined') {
|
|
4903
|
+
var _$$fn$NAME$defaults$1;
|
|
4904
|
+
|
|
4705
4905
|
// jQuery
|
|
4706
|
-
|
|
4906
|
+
var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
|
|
4707
4907
|
$.fn[NAME$7] = Dialog._jQueryInterface;
|
|
4708
4908
|
$.fn[NAME$7].Constructor = Dialog;
|
|
4709
4909
|
|
|
4710
|
-
$.fn[NAME$7].noConflict = ()
|
|
4711
|
-
$.fn[NAME$7] = JQUERY_NO_CONFLICT;
|
|
4910
|
+
$.fn[NAME$7].noConflict = function () {
|
|
4911
|
+
$.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
|
|
4712
4912
|
return Dialog._jQueryInterface;
|
|
4713
4913
|
};
|
|
4714
4914
|
|
|
4715
|
-
$.fn[NAME$7].defaults = {
|
|
4915
|
+
$.fn[NAME$7].defaults = (_$$fn$NAME$defaults$1 = {
|
|
4716
4916
|
title: '',
|
|
4717
4917
|
template: '',
|
|
4718
4918
|
body: '',
|
|
@@ -4734,46 +4934,42 @@ if (typeof $ !== 'undefined') {
|
|
|
4734
4934
|
debug: true,
|
|
4735
4935
|
onInitialize: null,
|
|
4736
4936
|
onDestroy: null,
|
|
4737
|
-
onInit: null
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
attrs: ''
|
|
4762
|
-
}
|
|
4763
|
-
}
|
|
4764
|
-
};
|
|
4937
|
+
onInit: null
|
|
4938
|
+
}, _$$fn$NAME$defaults$1["onDestroy"] = null, _$$fn$NAME$defaults$1.onShow = null, _$$fn$NAME$defaults$1.onClose = null, _$$fn$NAME$defaults$1.actions = {
|
|
4939
|
+
close: {
|
|
4940
|
+
primary: false,
|
|
4941
|
+
visible: true,
|
|
4942
|
+
content: 'Close',
|
|
4943
|
+
classes: '',
|
|
4944
|
+
attrs: ''
|
|
4945
|
+
},
|
|
4946
|
+
remove: {
|
|
4947
|
+
primary: false,
|
|
4948
|
+
visible: true,
|
|
4949
|
+
content: 'Remove',
|
|
4950
|
+
classes: '',
|
|
4951
|
+
attrs: ''
|
|
4952
|
+
},
|
|
4953
|
+
confirm: {
|
|
4954
|
+
primary: true,
|
|
4955
|
+
visible: true,
|
|
4956
|
+
content: 'Confirm',
|
|
4957
|
+
classes: '',
|
|
4958
|
+
attrs: ''
|
|
4959
|
+
}
|
|
4960
|
+
}, _$$fn$NAME$defaults$1);
|
|
4765
4961
|
}
|
|
4766
4962
|
|
|
4767
4963
|
var index_esm = {
|
|
4768
|
-
Common,
|
|
4769
|
-
Popover,
|
|
4770
|
-
Select,
|
|
4771
|
-
Dropdown,
|
|
4772
|
-
Tooltip,
|
|
4773
|
-
SectionTabs,
|
|
4774
|
-
Collapse,
|
|
4775
|
-
Toast,
|
|
4776
|
-
Dialog
|
|
4964
|
+
Common: Common,
|
|
4965
|
+
Popover: Popover,
|
|
4966
|
+
Select: Select,
|
|
4967
|
+
Dropdown: Dropdown,
|
|
4968
|
+
Tooltip: Tooltip,
|
|
4969
|
+
SectionTabs: SectionTabs,
|
|
4970
|
+
Collapse: Collapse,
|
|
4971
|
+
Toast: Toast,
|
|
4972
|
+
Dialog: Dialog
|
|
4777
4973
|
};
|
|
4778
4974
|
|
|
4779
4975
|
export default index_esm;
|