update JS libs

This commit is contained in:
2021-03-25 18:56:29 +01:00
parent d667f71401
commit a026314915
7 changed files with 38 additions and 4625 deletions

View File

@@ -1,5 +1,5 @@
/** /**
* @version: 3.0.5 * @version: 3.1
* @author: Dan Grossman http://www.dangrossman.info/ * @author: Dan Grossman http://www.dangrossman.info/
* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved. * @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
@@ -11,7 +11,7 @@
// AMD. Make globaly available as well // AMD. Make globaly available as well
define(['moment', 'jquery'], function (moment, jquery) { define(['moment', 'jquery'], function (moment, jquery) {
if (!jquery.fn) jquery.fn = {}; // webpack server rendering if (!jquery.fn) jquery.fn = {}; // webpack server rendering
if (typeof moment !== 'function' && moment.default) moment = moment.default if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default']
return factory(moment, jquery); return factory(moment, jquery);
}); });
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
@@ -28,7 +28,7 @@
// Browser globals // Browser globals
root.daterangepicker = factory(root.moment, root.jQuery); root.daterangepicker = factory(root.moment, root.jQuery);
} }
}(this, function(moment, $) { }(typeof window !== 'undefined' ? window : this, function(moment, $) {
var DateRangePicker = function(element, options, cb) { var DateRangePicker = function(element, options, cb) {
//default settings for options //default settings for options
@@ -386,7 +386,7 @@
this.container.find('.drp-calendar.left').addClass('single'); this.container.find('.drp-calendar.left').addClass('single');
this.container.find('.drp-calendar.left').show(); this.container.find('.drp-calendar.left').show();
this.container.find('.drp-calendar.right').hide(); this.container.find('.drp-calendar.right').hide();
if (!this.timePicker) { if (!this.timePicker && this.autoApply) {
this.container.addClass('auto-apply'); this.container.addClass('auto-apply');
} }
} }
@@ -417,14 +417,14 @@
.on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)) .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
.on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)) .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this))
.on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)) .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this))
.on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this)) .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this));
this.container.find('.ranges') this.container.find('.ranges')
.on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)) .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this));
this.container.find('.drp-buttons') this.container.find('.drp-buttons')
.on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
.on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)) .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this));
if (this.element.is('input') || this.element.is('button')) { if (this.element.is('input') || this.element.is('button')) {
this.element.on({ this.element.on({
@@ -526,9 +526,9 @@
this.renderTimePicker('left'); this.renderTimePicker('left');
this.renderTimePicker('right'); this.renderTimePicker('right');
if (!this.endDate) { if (!this.endDate) {
this.container.find('.right .calendar-time select').attr('disabled', 'disabled').addClass('disabled'); this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled');
} else { } else {
this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled'); this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled');
} }
} }
if (this.endDate) if (this.endDate)
@@ -1014,16 +1014,18 @@
updateFormInputs: function() { updateFormInputs: function() {
if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) { if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
this.container.find('button.applyBtn').removeAttr('disabled'); this.container.find('button.applyBtn').prop('disabled', false);
} else { } else {
this.container.find('button.applyBtn').attr('disabled', 'disabled'); this.container.find('button.applyBtn').prop('disabled', true);
} }
}, },
move: function() { move: function() {
var parentOffset = { top: 0, left: 0 }, var parentOffset = { top: 0, left: 0 },
containerTop; containerTop,
drops = this.drops;
var parentRightEdge = $(window).width(); var parentRightEdge = $(window).width();
if (!this.parentEl.is('body')) { if (!this.parentEl.is('body')) {
parentOffset = { parentOffset = {
@@ -1033,10 +1035,21 @@
parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
} }
if (this.drops == 'up') switch (drops) {
containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; case 'auto':
else
containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) {
containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
drops = 'up';
}
break;
case 'up':
containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
break;
default:
containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
break;
}
// Force the container to it's actual width // Force the container to it's actual width
this.container.css({ this.container.css({
@@ -1046,7 +1059,7 @@
}); });
var containerWidth = this.container.outerWidth(); var containerWidth = this.container.outerWidth();
this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('drop-up'); this.container.toggleClass('drop-up', drops == 'up');
if (this.opens == 'left') { if (this.opens == 'left') {
var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth(); var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth();
@@ -1341,7 +1354,7 @@
if (this.singleDatePicker) { if (this.singleDatePicker) {
this.setEndDate(this.startDate); this.setEndDate(this.startDate);
if (!this.timePicker) if (!this.timePicker && this.autoApply)
this.clickApply(); this.clickApply();
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -7,11 +7,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/assets/img/favicon.png"> <link rel="icon" type="image/x-icon" href="/assets/img/favicon.png">
<script type="text/javascript" src="/assets/js/jquery-3.4.1.min.js"></script> <script type="text/javascript" src="/assets/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="/assets/js/moment-2.24.0.min.js"></script> <script type="text/javascript" src="/assets/js/moment-2.29.1.min.js"></script>
<script type="text/javascript" src="/assets/js/daterangepicker-3.0.5.js"></script> <script type="text/javascript" src="/assets/js/daterangepicker-3.1.js"></script>
<script type="text/javascript" src="/assets/js/invaders.js"></script> <script type="text/javascript" src="/assets/js/invaders.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/css/daterangepicker-3.0.5.css" /> <link rel="stylesheet" type="text/css" href="/assets/css/daterangepicker-3.1.css" />
<link rel="stylesheet" type="text/css" href="/assets/css/invaders.css" /> <link rel="stylesheet" type="text/css" href="/assets/css/invaders.css" />
</head> </head>
<body> <body>