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