flatpickr 4.6.9.0 → 4.6.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flatpickr/version.rb +1 -1
- data/package.json +1 -1
- data/vendor/assets/javascripts/flatpickr/l10n/ar-dz.js +61 -0
- data/vendor/assets/javascripts/flatpickr/l10n/ar.js +11 -1
- data/vendor/assets/javascripts/flatpickr/l10n/at.js +1 -0
- data/vendor/assets/javascripts/flatpickr/l10n/cat.js +1 -0
- data/vendor/assets/javascripts/flatpickr/l10n/ckb.js +68 -0
- data/vendor/assets/javascripts/flatpickr/l10n/fi.js +32 -32
- data/vendor/assets/javascripts/flatpickr/l10n/gr.js +6 -2
- data/vendor/assets/javascripts/flatpickr/l10n/hy.js +86 -0
- data/vendor/assets/javascripts/flatpickr/l10n/index.js +434 -222
- data/vendor/assets/javascripts/flatpickr/l10n/ko.js +1 -0
- data/vendor/assets/javascripts/flatpickr/l10n/ms.js +2 -2
- data/vendor/assets/javascripts/flatpickr/l10n/nn.js +73 -0
- data/vendor/assets/javascripts/flatpickr/l10n/sv.js +33 -32
- data/vendor/assets/javascripts/flatpickr/plugins/confirmDate/confirmDate.js +5 -1
- data/vendor/assets/javascripts/flatpickr/plugins/minMaxTimePlugin.js +23 -4
- data/vendor/assets/javascripts/flatpickr/plugins/monthSelect/index.js +103 -42
- data/vendor/assets/javascripts/flatpickr/plugins/rangePlugin.js +8 -0
- data/vendor/assets/javascripts/flatpickr/plugins/scrollPlugin.js +22 -14
- data/vendor/assets/javascripts/flatpickr.js +143 -92
- data/vendor/assets/stylesheets/flatpickr/plugins/monthSelect/style.css +45 -7
- data/vendor/assets/stylesheets/flatpickr/themes/airbnb.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/confetti.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/dark.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/light.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/material_blue.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/material_green.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/material_orange.css +4 -0
- data/vendor/assets/stylesheets/flatpickr/themes/material_red.css +4 -0
- data/vendor/assets/stylesheets/flatpickr.css +4 -0
- metadata +5 -1
@@ -0,0 +1,73 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.nn = {}));
|
5
|
+
}(this, (function (exports) { 'use strict';
|
6
|
+
|
7
|
+
var fp = typeof window !== 'undefined' && window.flatpickr !== undefined
|
8
|
+
? window.flatpickr
|
9
|
+
: {
|
10
|
+
l10ns: {},
|
11
|
+
};
|
12
|
+
var NorwegianNynorsk = {
|
13
|
+
weekdays: {
|
14
|
+
shorthand: ['Sø.', 'Må.', 'Ty.', 'On.', 'To.', 'Fr.', 'La.'],
|
15
|
+
longhand: [
|
16
|
+
'Søndag',
|
17
|
+
'Måndag',
|
18
|
+
'Tysdag',
|
19
|
+
'Onsdag',
|
20
|
+
'Torsdag',
|
21
|
+
'Fredag',
|
22
|
+
'Laurdag',
|
23
|
+
],
|
24
|
+
},
|
25
|
+
months: {
|
26
|
+
shorthand: [
|
27
|
+
'Jan',
|
28
|
+
'Feb',
|
29
|
+
'Mars',
|
30
|
+
'Apr',
|
31
|
+
'Mai',
|
32
|
+
'Juni',
|
33
|
+
'Juli',
|
34
|
+
'Aug',
|
35
|
+
'Sep',
|
36
|
+
'Okt',
|
37
|
+
'Nov',
|
38
|
+
'Des',
|
39
|
+
],
|
40
|
+
longhand: [
|
41
|
+
'Januar',
|
42
|
+
'Februar',
|
43
|
+
'Mars',
|
44
|
+
'April',
|
45
|
+
'Mai',
|
46
|
+
'Juni',
|
47
|
+
'Juli',
|
48
|
+
'August',
|
49
|
+
'September',
|
50
|
+
'Oktober',
|
51
|
+
'November',
|
52
|
+
'Desember',
|
53
|
+
],
|
54
|
+
},
|
55
|
+
firstDayOfWeek: 1,
|
56
|
+
rangeSeparator: ' til ',
|
57
|
+
weekAbbreviation: 'Veke',
|
58
|
+
scrollTitle: 'Scroll for å endre',
|
59
|
+
toggleTitle: 'Klikk for å veksle',
|
60
|
+
time_24hr: true,
|
61
|
+
ordinal: function () {
|
62
|
+
return '.';
|
63
|
+
},
|
64
|
+
};
|
65
|
+
fp.l10ns.nn = NorwegianNynorsk;
|
66
|
+
var nn = fp.l10ns;
|
67
|
+
|
68
|
+
exports.NorwegianNynorsk = NorwegianNynorsk;
|
69
|
+
exports.default = nn;
|
70
|
+
|
71
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
72
|
+
|
73
|
+
})));
|
@@ -13,47 +13,48 @@
|
|
13
13
|
firstDayOfWeek: 1,
|
14
14
|
weekAbbreviation: "v",
|
15
15
|
weekdays: {
|
16
|
-
shorthand: ["
|
16
|
+
shorthand: ["sön", "mån", "tis", "ons", "tor", "fre", "lör"],
|
17
17
|
longhand: [
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
18
|
+
"söndag",
|
19
|
+
"måndag",
|
20
|
+
"tisdag",
|
21
|
+
"onsdag",
|
22
|
+
"torsdag",
|
23
|
+
"fredag",
|
24
|
+
"lördag",
|
25
25
|
],
|
26
26
|
},
|
27
27
|
months: {
|
28
28
|
shorthand: [
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
29
|
+
"jan",
|
30
|
+
"feb",
|
31
|
+
"mar",
|
32
|
+
"apr",
|
33
|
+
"maj",
|
34
|
+
"jun",
|
35
|
+
"jul",
|
36
|
+
"aug",
|
37
|
+
"sep",
|
38
|
+
"okt",
|
39
|
+
"nov",
|
40
|
+
"dec",
|
41
41
|
],
|
42
42
|
longhand: [
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
43
|
+
"januari",
|
44
|
+
"februari",
|
45
|
+
"mars",
|
46
|
+
"april",
|
47
|
+
"maj",
|
48
|
+
"juni",
|
49
|
+
"juli",
|
50
|
+
"augusti",
|
51
|
+
"september",
|
52
|
+
"oktober",
|
53
|
+
"november",
|
54
|
+
"december",
|
55
55
|
],
|
56
56
|
},
|
57
|
+
rangeSeparator: ' till ',
|
57
58
|
time_24hr: true,
|
58
59
|
ordinal: function () {
|
59
60
|
return ".";
|
@@ -58,9 +58,13 @@
|
|
58
58
|
return {};
|
59
59
|
return __assign({ onKeyDown: function (_, __, ___, e) {
|
60
60
|
var eventTarget = getEventTarget(e);
|
61
|
+
var isTargetLastFocusableElement = (!fp.config.time_24hr && eventTarget === fp.amPM) ||
|
62
|
+
(fp.config.time_24hr &&
|
63
|
+
((fp.config.enableSeconds && eventTarget === fp.secondElement) ||
|
64
|
+
(!fp.config.enableSeconds && eventTarget === fp.minuteElement)));
|
61
65
|
if (fp.config.enableTime &&
|
62
66
|
e.key === "Tab" &&
|
63
|
-
|
67
|
+
isTargetLastFocusableElement) {
|
64
68
|
e.preventDefault();
|
65
69
|
confirmContainer.focus();
|
66
70
|
}
|
@@ -259,6 +259,13 @@
|
|
259
259
|
date1.getSeconds() -
|
260
260
|
date2.getSeconds());
|
261
261
|
}
|
262
|
+
var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {
|
263
|
+
return hours * 3600 + minutes * 60 + seconds;
|
264
|
+
};
|
265
|
+
var parseSeconds = function (secondsSinceMidnight) {
|
266
|
+
var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;
|
267
|
+
return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];
|
268
|
+
};
|
262
269
|
|
263
270
|
function minMaxTimePlugin(config) {
|
264
271
|
if (config === void 0) { config = {}; }
|
@@ -297,11 +304,23 @@
|
|
297
304
|
fp.config.maxTime.setMonth(latest.getMonth());
|
298
305
|
fp.config.minTime.setDate(latest.getDate());
|
299
306
|
fp.config.maxTime.setDate(latest.getDate());
|
300
|
-
if (
|
301
|
-
|
307
|
+
if (fp.config.minTime > fp.config.maxTime) {
|
308
|
+
var minBound = calculateSecondsSinceMidnight(fp.config.minTime.getHours(), fp.config.minTime.getMinutes(), fp.config.minTime.getSeconds());
|
309
|
+
var maxBound = calculateSecondsSinceMidnight(fp.config.maxTime.getHours(), fp.config.maxTime.getMinutes(), fp.config.maxTime.getSeconds());
|
310
|
+
var currentTime = calculateSecondsSinceMidnight(latest.getHours(), latest.getMinutes(), latest.getSeconds());
|
311
|
+
if (currentTime > maxBound && currentTime < minBound) {
|
312
|
+
var result = parseSeconds(minBound);
|
313
|
+
fp.setDate(new Date(latest.getTime()).setHours(result[0], result[1], result[2]), false);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
if (compareDates(latest, fp.config.maxTime, false) > 0) {
|
318
|
+
fp.setDate(new Date(latest.getTime()).setHours(fp.config.maxTime.getHours(), fp.config.maxTime.getMinutes(), fp.config.maxTime.getSeconds(), fp.config.maxTime.getMilliseconds()), false);
|
319
|
+
}
|
320
|
+
else if (compareDates(latest, fp.config.minTime, false) < 0) {
|
321
|
+
fp.setDate(new Date(latest.getTime()).setHours(fp.config.minTime.getHours(), fp.config.minTime.getMinutes(), fp.config.minTime.getSeconds(), fp.config.minTime.getMilliseconds()), false);
|
322
|
+
}
|
302
323
|
}
|
303
|
-
else if (compareDates(latest, fp.config.minTime, false) < 0)
|
304
|
-
fp.setDate(new Date(latest.getTime()).setHours(fp.config.minTime.getHours(), fp.config.minTime.getMinutes(), fp.config.minTime.getSeconds(), fp.config.minTime.getMilliseconds()), false);
|
305
324
|
}
|
306
325
|
else {
|
307
326
|
var newMinMax = state.defaults || {
|
@@ -32,6 +32,10 @@
|
|
32
32
|
|
33
33
|
var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
|
34
34
|
|
35
|
+
function clearNode(node) {
|
36
|
+
while (node.firstChild)
|
37
|
+
node.removeChild(node.firstChild);
|
38
|
+
}
|
35
39
|
function getEventTarget(event) {
|
36
40
|
try {
|
37
41
|
if (typeof event.composedPath === "function") {
|
@@ -58,10 +62,9 @@
|
|
58
62
|
fp.config.altFormat = config.altFormat;
|
59
63
|
var self = { monthsContainer: null };
|
60
64
|
function clearUnnecessaryDOMElements() {
|
61
|
-
if (!fp.rContainer
|
65
|
+
if (!fp.rContainer)
|
62
66
|
return;
|
63
|
-
fp.rContainer
|
64
|
-
fp.rContainer.removeChild(fp.weekdayContainer);
|
67
|
+
clearNode(fp.rContainer);
|
65
68
|
for (var index = 0; index < fp.monthElements.length; index++) {
|
66
69
|
var element = fp.monthElements[index];
|
67
70
|
if (!element.parentNode)
|
@@ -69,49 +72,61 @@
|
|
69
72
|
element.parentNode.removeChild(element);
|
70
73
|
}
|
71
74
|
}
|
72
|
-
function
|
75
|
+
function build() {
|
76
|
+
if (!fp.rContainer)
|
77
|
+
return;
|
78
|
+
self.monthsContainer = fp._createElement("div", "flatpickr-monthSelect-months");
|
79
|
+
self.monthsContainer.tabIndex = -1;
|
80
|
+
buildMonths();
|
81
|
+
fp.rContainer.appendChild(self.monthsContainer);
|
82
|
+
fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-" + config.theme);
|
83
|
+
}
|
84
|
+
function buildMonths() {
|
85
|
+
if (!self.monthsContainer)
|
86
|
+
return;
|
87
|
+
clearNode(self.monthsContainer);
|
88
|
+
var frag = document.createDocumentFragment();
|
89
|
+
for (var i = 0; i < 12; i++) {
|
90
|
+
var month = fp.createDay("flatpickr-monthSelect-month", new Date(fp.currentYear, i), 0, i);
|
91
|
+
if (month.dateObj.getMonth() === new Date().getMonth() &&
|
92
|
+
month.dateObj.getFullYear() === new Date().getFullYear())
|
93
|
+
month.classList.add("today");
|
94
|
+
month.textContent = monthToStr(i, config.shorthand, fp.l10n);
|
95
|
+
month.addEventListener("click", selectMonth);
|
96
|
+
frag.appendChild(month);
|
97
|
+
}
|
98
|
+
self.monthsContainer.appendChild(frag);
|
99
|
+
}
|
100
|
+
function bindEvents() {
|
73
101
|
fp._bind(fp.prevMonthNav, "click", function (e) {
|
74
102
|
e.preventDefault();
|
75
103
|
e.stopPropagation();
|
76
104
|
fp.changeYear(fp.currentYear - 1);
|
77
105
|
selectYear();
|
106
|
+
buildMonths();
|
78
107
|
});
|
79
108
|
fp._bind(fp.nextMonthNav, "click", function (e) {
|
80
109
|
e.preventDefault();
|
81
110
|
e.stopPropagation();
|
82
111
|
fp.changeYear(fp.currentYear + 1);
|
83
112
|
selectYear();
|
113
|
+
buildMonths();
|
114
|
+
});
|
115
|
+
fp._bind(self.monthsContainer, "mouseover", function (e) {
|
116
|
+
if (fp.config.mode === "range")
|
117
|
+
fp.onMouseOver(getEventTarget(e), "flatpickr-monthSelect-month");
|
84
118
|
});
|
85
|
-
}
|
86
|
-
function addMonths() {
|
87
|
-
if (!fp.rContainer)
|
88
|
-
return;
|
89
|
-
self.monthsContainer = fp._createElement("div", "flatpickr-monthSelect-months");
|
90
|
-
self.monthsContainer.tabIndex = -1;
|
91
|
-
fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-" + config.theme);
|
92
|
-
for (var i = 0; i < 12; i++) {
|
93
|
-
var month = fp._createElement("span", "flatpickr-monthSelect-month");
|
94
|
-
month.dateObj = new Date(fp.currentYear, i);
|
95
|
-
month.$i = i;
|
96
|
-
month.textContent = monthToStr(i, config.shorthand, fp.l10n);
|
97
|
-
month.tabIndex = -1;
|
98
|
-
month.addEventListener("click", selectMonth);
|
99
|
-
self.monthsContainer.appendChild(month);
|
100
|
-
if ((fp.config.minDate && month.dateObj < fp.config.minDate) ||
|
101
|
-
(fp.config.maxDate && month.dateObj > fp.config.maxDate)) {
|
102
|
-
month.classList.add("disabled");
|
103
|
-
}
|
104
|
-
}
|
105
|
-
fp.rContainer.appendChild(self.monthsContainer);
|
106
119
|
}
|
107
120
|
function setCurrentlySelected() {
|
108
121
|
if (!fp.rContainer)
|
109
122
|
return;
|
123
|
+
if (!fp.selectedDates.length)
|
124
|
+
return;
|
110
125
|
var currentlySelected = fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected");
|
111
126
|
for (var index = 0; index < currentlySelected.length; index++) {
|
112
127
|
currentlySelected[index].classList.remove("selected");
|
113
128
|
}
|
114
|
-
var targetMonth =
|
129
|
+
var targetMonth = fp.selectedDates[0].getMonth();
|
115
130
|
var month = fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child(" + (targetMonth + 1) + ")");
|
116
131
|
if (month) {
|
117
132
|
month.classList.add("selected");
|
@@ -137,10 +152,10 @@
|
|
137
152
|
month.dateObj.setFullYear(fp.currentYear);
|
138
153
|
if ((fp.config.minDate && month.dateObj < fp.config.minDate) ||
|
139
154
|
(fp.config.maxDate && month.dateObj > fp.config.maxDate)) {
|
140
|
-
month.classList.add("disabled");
|
155
|
+
month.classList.add("flatpickr-disabled");
|
141
156
|
}
|
142
157
|
else {
|
143
|
-
month.classList.remove("disabled");
|
158
|
+
month.classList.remove("flatpickr-disabled");
|
144
159
|
}
|
145
160
|
});
|
146
161
|
}
|
@@ -150,16 +165,37 @@
|
|
150
165
|
e.preventDefault();
|
151
166
|
e.stopPropagation();
|
152
167
|
var eventTarget = getEventTarget(e);
|
153
|
-
if (eventTarget instanceof Element
|
154
|
-
|
155
|
-
|
156
|
-
|
168
|
+
if (!(eventTarget instanceof Element))
|
169
|
+
return;
|
170
|
+
if (eventTarget.classList.contains("flatpickr-disabled"))
|
171
|
+
return;
|
172
|
+
if (eventTarget.classList.contains("notAllowed"))
|
173
|
+
return; // necessary??
|
174
|
+
setMonth(eventTarget.dateObj);
|
175
|
+
if (fp.config.closeOnSelect) {
|
176
|
+
var single = fp.config.mode === "single";
|
177
|
+
var range = fp.config.mode === "range" && fp.selectedDates.length === 2;
|
178
|
+
if (single || range)
|
179
|
+
fp.close();
|
157
180
|
}
|
158
181
|
}
|
159
182
|
function setMonth(date) {
|
160
|
-
var selectedDate = new Date(date);
|
161
|
-
|
162
|
-
|
183
|
+
var selectedDate = new Date(fp.currentYear, date.getMonth(), date.getDate());
|
184
|
+
switch (fp.config.mode) {
|
185
|
+
case "single":
|
186
|
+
fp.selectedDates = [selectedDate];
|
187
|
+
break;
|
188
|
+
case "range":
|
189
|
+
if (fp.selectedDates.length === 2) {
|
190
|
+
fp.clear(false, false);
|
191
|
+
buildMonths();
|
192
|
+
}
|
193
|
+
fp.selectedDates.push(selectedDate);
|
194
|
+
fp.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
fp.latestSelectedDateObj = selectedDate;
|
198
|
+
fp.updateValue();
|
163
199
|
setCurrentlySelected();
|
164
200
|
}
|
165
201
|
var shifts = {
|
@@ -190,6 +226,27 @@
|
|
190
226
|
setMonth(document.activeElement.dateObj);
|
191
227
|
}
|
192
228
|
}
|
229
|
+
function closeHook() {
|
230
|
+
var _a;
|
231
|
+
if (((_a = fp.config) === null || _a === void 0 ? void 0 : _a.mode) === "range" &&
|
232
|
+
fp.selectedDates.length === 1)
|
233
|
+
fp.clear(false);
|
234
|
+
if (!fp.selectedDates.length)
|
235
|
+
buildMonths();
|
236
|
+
}
|
237
|
+
// Help the prev/next year nav honor config.minDate (see 3fa5a69)
|
238
|
+
function stubCurrentMonth() {
|
239
|
+
config._stubbedCurrentMonth = fp._initialDate.getMonth();
|
240
|
+
fp._initialDate.setMonth(0);
|
241
|
+
fp.currentMonth = 0;
|
242
|
+
}
|
243
|
+
function unstubCurrentMonth() {
|
244
|
+
if (!config._stubbedCurrentMonth)
|
245
|
+
return;
|
246
|
+
fp._initialDate.setMonth(config._stubbedCurrentMonth);
|
247
|
+
fp.currentMonth = config._stubbedCurrentMonth;
|
248
|
+
delete config._stubbedCurrentMonth;
|
249
|
+
}
|
193
250
|
function destroyPluginInstance() {
|
194
251
|
if (self.monthsContainer !== null) {
|
195
252
|
var months = self.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month");
|
@@ -200,24 +257,28 @@
|
|
200
257
|
}
|
201
258
|
return {
|
202
259
|
onParseConfig: function () {
|
203
|
-
fp.config.mode = "single";
|
204
260
|
fp.config.enableTime = false;
|
205
261
|
},
|
206
262
|
onValueUpdate: setCurrentlySelected,
|
207
263
|
onKeyDown: onKeyDown,
|
208
264
|
onReady: [
|
209
|
-
|
210
|
-
fp.currentMonth = 0;
|
211
|
-
},
|
265
|
+
stubCurrentMonth,
|
212
266
|
clearUnnecessaryDOMElements,
|
213
|
-
|
214
|
-
|
267
|
+
build,
|
268
|
+
bindEvents,
|
215
269
|
setCurrentlySelected,
|
216
270
|
function () {
|
271
|
+
fp.config.onClose.push(closeHook);
|
217
272
|
fp.loadedPlugins.push("monthSelect");
|
218
273
|
},
|
219
274
|
],
|
220
|
-
onDestroy:
|
275
|
+
onDestroy: [
|
276
|
+
unstubCurrentMonth,
|
277
|
+
destroyPluginInstance,
|
278
|
+
function () {
|
279
|
+
fp.config.onClose = fp.config.onClose.filter(function (hook) { return hook !== closeHook; });
|
280
|
+
},
|
281
|
+
],
|
221
282
|
};
|
222
283
|
};
|
223
284
|
}
|
@@ -156,6 +156,14 @@
|
|
156
156
|
var newDates = _secondInputFocused
|
157
157
|
? [_prevDates[0], newSelectedDate]
|
158
158
|
: [newSelectedDate, _prevDates[1]];
|
159
|
+
if (newDates[0].getTime() > newDates[1].getTime()) {
|
160
|
+
if (_secondInputFocused) {
|
161
|
+
newDates[0] = newDates[1];
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
newDates[1] = newDates[0];
|
165
|
+
}
|
166
|
+
}
|
159
167
|
fp.setDate(newDates, false);
|
160
168
|
_prevDates = __spreadArrays(newDates);
|
161
169
|
}
|
@@ -18,7 +18,7 @@
|
|
18
18
|
}
|
19
19
|
|
20
20
|
if (typeof window.CustomEvent !== "function") {
|
21
|
-
function
|
21
|
+
var CustomEvent = function (typeArg, eventInitDict) {
|
22
22
|
eventInitDict = eventInitDict || {
|
23
23
|
bubbles: false,
|
24
24
|
cancelable: false,
|
@@ -27,7 +27,7 @@
|
|
27
27
|
var evt = document.createEvent("CustomEvent");
|
28
28
|
evt.initCustomEvent(typeArg, eventInitDict.bubbles, eventInitDict.cancelable, eventInitDict.detail);
|
29
29
|
return evt;
|
30
|
-
}
|
30
|
+
};
|
31
31
|
CustomEvent.prototype = window.Event.prototype;
|
32
32
|
window.CustomEvent = CustomEvent;
|
33
33
|
}
|
@@ -57,24 +57,32 @@
|
|
57
57
|
if (fp.timeContainer) {
|
58
58
|
fp.timeContainer.addEventListener("wheel", scroll);
|
59
59
|
}
|
60
|
-
fp.yearElements
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
if (fp.yearElements) {
|
61
|
+
fp.yearElements.forEach(function (yearElem) {
|
62
|
+
return yearElem.addEventListener("wheel", scroll);
|
63
|
+
});
|
64
|
+
}
|
65
|
+
if (fp.monthElements) {
|
66
|
+
fp.monthElements.forEach(function (monthElem) {
|
67
|
+
return monthElem.addEventListener("wheel", monthScroller);
|
68
|
+
});
|
69
|
+
}
|
66
70
|
fp.loadedPlugins.push("scroll");
|
67
71
|
},
|
68
72
|
onDestroy: function () {
|
69
73
|
if (fp.timeContainer) {
|
70
74
|
fp.timeContainer.removeEventListener("wheel", scroll);
|
71
75
|
}
|
72
|
-
fp.yearElements
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
if (fp.yearElements) {
|
77
|
+
fp.yearElements.forEach(function (yearElem) {
|
78
|
+
return yearElem.removeEventListener("wheel", scroll);
|
79
|
+
});
|
80
|
+
}
|
81
|
+
if (fp.monthElements) {
|
82
|
+
fp.monthElements.forEach(function (monthElem) {
|
83
|
+
return monthElem.removeEventListener("wheel", monthScroller);
|
84
|
+
});
|
85
|
+
}
|
78
86
|
},
|
79
87
|
};
|
80
88
|
};
|