flatpickr 2.6.2.0 → 2.6.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a14d1bcc193c01712b87523b8235a7f324958c7f
4
- data.tar.gz: 85e34ff91dcd207372cbb0b266252fd3a4ff61da
3
+ metadata.gz: e2941560968ee8c67b075ffce9bd7243c05bbfbe
4
+ data.tar.gz: b9525cb5b677f9e276e1c63aeedb0ddd0824da06
5
5
  SHA512:
6
- metadata.gz: 5aa6774667ef95d19394c42adf1e935888f1b8a3dfdd895c23d5a39f08dae231aae66a91ee563a767142286a207813458ccfb794eccbb7385fd5c1a3e3331202
7
- data.tar.gz: 388a5f854122015e6102060f61f457553bd8d06ea17729f511024ad5594aebdf1ce508bfa9138d8cac6af556408c616fef1b08a0c762541a2fe61b8595702bf8
6
+ metadata.gz: 3ee4fb839a5979beccd7ff41f11cac31179393902df384fbb7076dc635401ca55a29edfa4bca28e7044977ab95243a2faab068de5dfcbfb1768d518389e78881
7
+ data.tar.gz: fe3ecad9f05c32e8a1d6a235d6023d40ec5587f5126a99d3b5b800f2c1b04496d8e0698ea5dddb55f059b1a877d5dd22d72c33e4a575aea9b0b4db980ffa0e8f
@@ -1,3 +1,3 @@
1
1
  module Flatpickr
2
- VERSION = '2.6.2.0'
2
+ VERSION = '2.6.3.0'
3
3
  end
@@ -2,7 +2,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
2
2
 
3
3
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4
4
 
5
- /*! flatpickr v2.6.2, @license MIT */
5
+ /*! flatpickr v2.6.3, @license MIT */
6
6
  function Flatpickr(element, config) {
7
7
  var self = this;
8
8
 
@@ -23,7 +23,7 @@ function Flatpickr(element, config) {
23
23
  self.toggle = toggle;
24
24
 
25
25
  function init() {
26
- self.element = element;
26
+ self.element = self.input = element;
27
27
  self.instanceConfig = config || {};
28
28
  self.parseDate = Flatpickr.prototype.parseDate.bind(self);
29
29
  self.formatDate = Flatpickr.prototype.formatDate.bind(self);
@@ -206,6 +206,7 @@ function Flatpickr(element, config) {
206
206
  */
207
207
  function bindEvents() {
208
208
  self._handlers = [];
209
+ self._animationLoop = [];
209
210
  if (self.config.wrap) {
210
211
  ["open", "close", "toggle", "clear"].forEach(function (evt) {
211
212
  Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
@@ -280,6 +281,13 @@ function Flatpickr(element, config) {
280
281
  }
281
282
  }
282
283
 
284
+ function processPostDayAnimation() {
285
+ for (var i = self._animationLoop.length; i--;) {
286
+ self._animationLoop[i]();
287
+ self._animationLoop.splice(i, 1);
288
+ }
289
+ }
290
+
283
291
  /**
284
292
  * Removes the day container that slided out of view
285
293
  * @param {Event} e the animation event
@@ -291,6 +299,7 @@ function Flatpickr(element, config) {
291
299
  self.daysContainer.lastChild.classList.remove("slideLeftNew");
292
300
  self.daysContainer.removeChild(self.daysContainer.firstChild);
293
301
  self.days = self.daysContainer.firstChild;
302
+ processPostDayAnimation();
294
303
 
295
304
  break;
296
305
 
@@ -298,6 +307,7 @@ function Flatpickr(element, config) {
298
307
  self.daysContainer.firstChild.classList.remove("slideRightNew");
299
308
  self.daysContainer.removeChild(self.daysContainer.lastChild);
300
309
  self.days = self.daysContainer.firstChild;
310
+ processPostDayAnimation();
301
311
 
302
312
  break;
303
313
 
@@ -515,7 +525,7 @@ function Flatpickr(element, config) {
515
525
  }
516
526
 
517
527
  function afterDayAnim(fn) {
518
- if (self.config.animate) return setTimeout(fn, self._.daysAnimDuration + 1);
528
+ if (self.config.animate === true) return self._animationLoop.push(fn);
519
529
  fn();
520
530
  }
521
531
 
@@ -792,12 +802,11 @@ function Flatpickr(element, config) {
792
802
 
793
803
  triggerEvent("MonthChange");
794
804
 
795
- if (self._.daysAnimDuration === undefined) {
796
- var compStyle = window.getComputedStyle(self.daysContainer.lastChild);
797
-
798
- var duration = compStyle.getPropertyValue("animation-duration") || compStyle.getPropertyValue("-webkit-animation-duration");
799
-
800
- self._.daysAnimDuration = parseInt(/(\d+)s/.exec(duration)[1]);
805
+ if (document.activeElement && document.activeElement.$i) {
806
+ var index = document.activeElement.$i;
807
+ afterDayAnim(function () {
808
+ focusOnDay(index, 0);
809
+ });
801
810
  }
802
811
  }
803
812
 
@@ -965,12 +974,7 @@ function Flatpickr(element, config) {
965
974
  if (self.daysContainer) {
966
975
  var _delta = e.key === "ArrowRight" ? 1 : -1;
967
976
 
968
- if (!e.ctrlKey) focusOnDay(e.target.$i, _delta);else {
969
- changeMonth(_delta, true);
970
- afterDayAnim(function () {
971
- focusOnDay(e.target.$i, 0);
972
- });
973
- }
977
+ if (!e.ctrlKey) focusOnDay(e.target.$i, _delta);else changeMonth(_delta, true);
974
978
  } else if (self.config.enableTime && !isTimeObj) self.hourElement.focus();
975
979
  }
976
980
 
@@ -1318,7 +1322,12 @@ function Flatpickr(element, config) {
1318
1322
  return self.hourElement.select();
1319
1323
  }, 451);
1320
1324
 
1321
- if (self.config.mode !== "multiple" && !self.config.enableTime && self.config.closeOnSelect) self.close();
1325
+ if (self.config.closeOnSelect) {
1326
+ var single = self.config.mode === "single" && !self.config.enableTime;
1327
+ var range = self.config.mode === "range" && self.selectedDates.length === 2 && !self.config.enableTime;
1328
+
1329
+ if (single || range) self.close();
1330
+ }
1322
1331
  }
1323
1332
 
1324
1333
  function set(option, value) {
@@ -1487,6 +1496,7 @@ function Flatpickr(element, config) {
1487
1496
  self.altInput = createElement(self.input.nodeName, self.input.className + " " + self.config.altInputClass);
1488
1497
  self._input = self.altInput;
1489
1498
  self.altInput.placeholder = self.input.placeholder;
1499
+ self.altInput.disabled = self.input.disabled;
1490
1500
  self.altInput.type = "text";
1491
1501
  self.input.type = "hidden";
1492
1502
 
@@ -1544,7 +1554,7 @@ function Flatpickr(element, config) {
1544
1554
 
1545
1555
  if (hooks !== undefined && hooks.length > 0) {
1546
1556
  for (var i = 0; hooks[i] && i < hooks.length; i++) {
1547
- hooks[i](self.selectedDates, self._input.value, self, data);
1557
+ hooks[i](self.selectedDates, self.input.value, self, data);
1548
1558
  }
1549
1559
  }
1550
1560
 
@@ -1964,6 +1974,11 @@ Flatpickr.prototype = {
1964
1974
  return this.utils.monthToStr(this.formats.n(date) - 1, false);
1965
1975
  },
1966
1976
 
1977
+ // padded hour 1-12
1978
+ G: function G(date) {
1979
+ return Flatpickr.prototype.pad(Flatpickr.prototype.formats.h(date));
1980
+ },
1981
+
1967
1982
  // hours with leading zero e.g. 03
1968
1983
  H: function H(date) {
1969
1984
  return Flatpickr.prototype.pad(date.getHours());
@@ -2076,6 +2091,9 @@ Flatpickr.prototype = {
2076
2091
  F: function F(dateObj, monthName) {
2077
2092
  dateObj.setMonth(this.l10n.months.longhand.indexOf(monthName));
2078
2093
  },
2094
+ G: function G(dateObj, hour) {
2095
+ dateObj.setHours(parseFloat(hour));
2096
+ },
2079
2097
  H: function H(dateObj, hour) {
2080
2098
  dateObj.setHours(parseFloat(hour));
2081
2099
  },
@@ -2139,6 +2157,7 @@ Flatpickr.prototype = {
2139
2157
  tokenRegex: {
2140
2158
  D: "(\\w+)",
2141
2159
  F: "(\\w+)",
2160
+ G: "(\\d\\d|\\d)",
2142
2161
  H: "(\\d\\d|\\d)",
2143
2162
  J: "(\\d\\d|\\d)\\w+",
2144
2163
  K: "(\\w+)",
@@ -13,6 +13,10 @@ Flatpickr.l10ns.no.months = {
13
13
  };
14
14
 
15
15
  Flatpickr.l10ns.no.firstDayOfWeek = 1;
16
+ Flatpickr.l10ns.no.rangeSeparator = " til ";
17
+ Flatpickr.l10ns.no.weekAbbreviation = "Uke";
18
+ Flatpickr.l10ns.no.scrollTitle = "Scroll for å endre";
19
+ Flatpickr.l10ns.no.toggleTitle = "Klikk for å veksle";
16
20
 
17
21
  Flatpickr.l10ns.no.ordinal = function () {
18
22
  return ".";
@@ -1,5 +1,5 @@
1
1
  /* Portuguese locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.pt = {};
4
4
 
5
5
  Flatpickr.l10ns.pt.weekdays = {
@@ -12,6 +12,8 @@ Flatpickr.l10ns.pt.months = {
12
12
  longhand: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]
13
13
  };
14
14
 
15
- Flatpickr.l10ns.pt.rangeSeparator = " até ";
15
+ Flatpickr.l10ns.pt.rangeSeparator = " até "
16
+
17
+ if (typeof module !== "undefined")
18
+ module.exports = Flatpickr.l10ns;
16
19
 
17
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
@@ -1,5 +1,5 @@
1
1
  /* Romanian locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.ro = {};
4
4
 
5
5
  Flatpickr.l10ns.ro.weekdays = {
@@ -14,8 +14,10 @@ Flatpickr.l10ns.ro.months = {
14
14
 
15
15
  Flatpickr.l10ns.ro.firstDayOfWeek = 1;
16
16
 
17
- Flatpickr.l10ns.ro.ordinal = function () {
17
+ Flatpickr.l10ns.ro.ordinal = () => {
18
18
  return "";
19
19
  };
20
20
 
21
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
21
+ if (typeof module !== "undefined")
22
+ module.exports = Flatpickr.l10ns;
23
+
@@ -1,5 +1,5 @@
1
1
  /* Russian locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.ru = {};
4
4
 
5
5
  Flatpickr.l10ns.ru.firstDayOfWeek = 1; // Monday
@@ -13,4 +13,6 @@ Flatpickr.l10ns.ru.months = {
13
13
  shorthand: ["Янв", "Фев", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сен", "Окт", "Ноя", "Дек"],
14
14
  longhand: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"]
15
15
  };
16
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
16
+ if (typeof module !== "undefined")
17
+ module.exports = Flatpickr.l10ns;
18
+
@@ -1,5 +1,5 @@
1
1
  /* Sinhala locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.si = {};
4
4
 
5
5
  Flatpickr.l10ns.si.weekdays = {
@@ -12,4 +12,6 @@ Flatpickr.l10ns.si.months = {
12
12
  longhand: ["ජනවාරි", "පෙබරවාරි", "මාර්තු", "අප්‍රේල්", "මැයි", "ජුනි", "ජූලි", "අගෝස්තු", "සැප්තැම්බර්", "ඔක්තෝබර්", "නොවැම්බර්", "දෙසැම්බර්"]
13
13
  };
14
14
 
15
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
15
+ if (typeof module !== "undefined")
16
+ module.exports = Flatpickr.l10ns;
17
+
@@ -18,4 +18,4 @@ Flatpickr.l10ns.sk.ordinal = function () {
18
18
  return ".";
19
19
  };
20
20
 
21
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
21
+ if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
@@ -18,4 +18,6 @@ Flatpickr.l10ns.sl.ordinal = function () {
18
18
  return ".";
19
19
  };
20
20
 
21
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
21
+ if (typeof module !== "undefined")
22
+ module.exports = Flatpickr.l10ns;
23
+
@@ -1,5 +1,5 @@
1
1
  /* Albanian locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.sq = {};
4
4
 
5
5
  Flatpickr.l10ns.sq.weekdays = {
@@ -11,4 +11,6 @@ Flatpickr.l10ns.sq.months = {
11
11
  shorthand: ["Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Kor", "Gus", "Sht", "Tet", "Nën", "Dhj"],
12
12
  longhand: ["Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"]
13
13
  };
14
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
14
+ if (typeof module !== "undefined")
15
+ module.exports = Flatpickr.l10ns;
16
+
@@ -1,10 +1,10 @@
1
1
  /* Serbian locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.sr = {};
4
4
 
5
5
  Flatpickr.l10ns.sr.weekdays = {
6
6
  shorthand: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],
7
- longhand: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"]
7
+ longhand: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"]
8
8
  };
9
9
 
10
10
  Flatpickr.l10ns.sr.months = {
@@ -16,4 +16,5 @@ Flatpickr.l10ns.sr.firstDayOfWeek = 1;
16
16
  Flatpickr.l10ns.sr.weekAbbreviation = "Ned.";
17
17
  Flatpickr.l10ns.sr.rangeSeparator = " do ";
18
18
 
19
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
19
+ if (typeof module !== "undefined")
20
+ module.exports = Flatpickr.l10ns;
@@ -1,5 +1,5 @@
1
1
  /* Swedish locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.sv = {};
4
4
 
5
5
  Flatpickr.l10ns.sv.firstDayOfWeek = 1;
@@ -15,7 +15,9 @@ Flatpickr.l10ns.sv.months = {
15
15
  longhand: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"]
16
16
  };
17
17
 
18
- Flatpickr.l10ns.sv.ordinal = function () {
18
+ Flatpickr.l10ns.sv.ordinal = () => {
19
19
  return ".";
20
20
  };
21
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
21
+ if (typeof module !== "undefined")
22
+ module.exports = Flatpickr.l10ns;
23
+
@@ -1,5 +1,5 @@
1
1
  /* Thai locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.th = {};
4
4
 
5
5
  Flatpickr.l10ns.th.weekdays = {
@@ -17,8 +17,9 @@ Flatpickr.l10ns.th.rangeSeparator = " ถึง ";
17
17
  Flatpickr.l10ns.th.scrollTitle = "เลื่อนเพื่อเพิ่มหรือลด";
18
18
  Flatpickr.l10ns.th.toggleTitle = "คลิกเพื่อเปลี่ยน";
19
19
 
20
- Flatpickr.l10ns.th.ordinal = function () {
20
+ Flatpickr.l10ns.th.ordinal = () => {
21
21
  return "";
22
22
  };
23
23
 
24
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
24
+ if (typeof module !== "undefined")
25
+ module.exports = Flatpickr.l10ns;
@@ -1,5 +1,5 @@
1
1
  /* Turkish locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.tr = {};
4
4
 
5
5
  Flatpickr.l10ns.tr.firstDayOfWeek = 1;
@@ -13,4 +13,6 @@ Flatpickr.l10ns.tr.months = {
13
13
  shorthand: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],
14
14
  longhand: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"]
15
15
  };
16
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
16
+ if (typeof module !== "undefined")
17
+ module.exports = Flatpickr.l10ns;
18
+
@@ -13,4 +13,5 @@ Flatpickr.l10ns.uk.months = {
13
13
  shorthand: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
14
14
  longhand: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"]
15
15
  };
16
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
16
+ if (typeof module !== "undefined")
17
+ module.exports = Flatpickr.l10ns;
@@ -14,4 +14,6 @@ Flatpickr.l10ns.vn.months = {
14
14
 
15
15
  Flatpickr.l10ns.vn.firstDayOfWeek = 1;
16
16
 
17
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
17
+ if (typeof module !== "undefined")
18
+ module.exports = Flatpickr.l10ns;
19
+
@@ -1,5 +1,5 @@
1
1
  /* Mandarin locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
2
+ var Flatpickr = Flatpickr || {l10ns: {}};
3
3
  Flatpickr.l10ns.zh = {};
4
4
 
5
5
  Flatpickr.l10ns.zh.weekdays = {
@@ -17,4 +17,6 @@ Flatpickr.l10ns.zh.weekAbbreviation = "周";
17
17
  Flatpickr.l10ns.zh.scrollTitle = "滚动切换";
18
18
  Flatpickr.l10ns.zh.toggleTitle = "点击切换 12/24 小时时制";
19
19
 
20
- if (typeof module !== "undefined") module.exports = Flatpickr.l10ns;
20
+ if (typeof module !== "undefined")
21
+ module.exports = Flatpickr.l10ns;
22
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatpickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2.0
4
+ version: 2.6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran