quasar 1.18.0 → 1.18.4

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.
Files changed (119) hide show
  1. package/dist/api/QKnob.json +18 -0
  2. package/dist/api/QRange.json +1 -1
  3. package/dist/api/QSlider.json +1 -1
  4. package/dist/icon-set/bootstrap-icons.umd.min.js +1 -1
  5. package/dist/icon-set/eva-icons.umd.min.js +1 -1
  6. package/dist/icon-set/fontawesome-v5-pro.umd.min.js +1 -1
  7. package/dist/icon-set/fontawesome-v5.umd.min.js +1 -1
  8. package/dist/icon-set/ionicons-v4.umd.min.js +1 -1
  9. package/dist/icon-set/line-awesome.umd.min.js +1 -1
  10. package/dist/icon-set/material-icons-outlined.umd.min.js +1 -1
  11. package/dist/icon-set/material-icons-round.umd.min.js +1 -1
  12. package/dist/icon-set/material-icons-sharp.umd.min.js +1 -1
  13. package/dist/icon-set/material-icons.umd.min.js +1 -1
  14. package/dist/icon-set/mdi-v3.umd.min.js +1 -1
  15. package/dist/icon-set/mdi-v4.umd.min.js +1 -1
  16. package/dist/icon-set/mdi-v5.umd.min.js +1 -1
  17. package/dist/icon-set/mdi-v6.umd.min.js +1 -1
  18. package/dist/icon-set/svg-bootstrap-icons.umd.min.js +1 -1
  19. package/dist/icon-set/svg-eva-icons.umd.min.js +1 -1
  20. package/dist/icon-set/svg-fontawesome-v5.umd.min.js +1 -1
  21. package/dist/icon-set/svg-ionicons-v4.umd.min.js +1 -1
  22. package/dist/icon-set/svg-ionicons-v5.umd.min.js +1 -1
  23. package/dist/icon-set/svg-ionicons-v6.umd.min.js +1 -1
  24. package/dist/icon-set/svg-line-awesome.umd.min.js +1 -1
  25. package/dist/icon-set/svg-material-icons-outlined.umd.min.js +1 -1
  26. package/dist/icon-set/svg-material-icons-round.umd.min.js +1 -1
  27. package/dist/icon-set/svg-material-icons-sharp.umd.min.js +1 -1
  28. package/dist/icon-set/svg-material-icons.umd.min.js +1 -1
  29. package/dist/icon-set/svg-mdi-v4.umd.min.js +1 -1
  30. package/dist/icon-set/svg-mdi-v5.umd.min.js +1 -1
  31. package/dist/icon-set/svg-mdi-v6.umd.min.js +1 -1
  32. package/dist/icon-set/svg-themify.umd.min.js +1 -1
  33. package/dist/icon-set/themify.umd.min.js +1 -1
  34. package/dist/lang/ar.umd.min.js +1 -1
  35. package/dist/lang/az-latn.umd.min.js +1 -1
  36. package/dist/lang/bg.umd.min.js +1 -1
  37. package/dist/lang/ca.umd.min.js +1 -1
  38. package/dist/lang/cs.umd.min.js +1 -1
  39. package/dist/lang/da.umd.min.js +1 -1
  40. package/dist/lang/de.umd.min.js +1 -1
  41. package/dist/lang/el.umd.min.js +1 -1
  42. package/dist/lang/en-gb.umd.min.js +1 -1
  43. package/dist/lang/en-us.umd.min.js +1 -1
  44. package/dist/lang/eo.umd.min.js +1 -1
  45. package/dist/lang/es.umd.min.js +1 -1
  46. package/dist/lang/et.umd.min.js +1 -1
  47. package/dist/lang/fa-ir.umd.min.js +1 -1
  48. package/dist/lang/fa.umd.min.js +1 -1
  49. package/dist/lang/fi.umd.min.js +1 -1
  50. package/dist/lang/fr.umd.min.js +1 -1
  51. package/dist/lang/gn.umd.min.js +1 -1
  52. package/dist/lang/he.umd.min.js +1 -1
  53. package/dist/lang/hr.umd.min.js +1 -1
  54. package/dist/lang/hu.umd.min.js +1 -1
  55. package/dist/lang/id.umd.min.js +1 -1
  56. package/dist/lang/is.umd.min.js +1 -1
  57. package/dist/lang/it.umd.min.js +1 -1
  58. package/dist/lang/ja.umd.min.js +1 -1
  59. package/dist/lang/km.umd.min.js +1 -1
  60. package/dist/lang/ko-kr.umd.min.js +1 -1
  61. package/dist/lang/kur-ckb.umd.min.js +1 -1
  62. package/dist/lang/lu.umd.min.js +1 -1
  63. package/dist/lang/lv.umd.min.js +1 -1
  64. package/dist/lang/ml.umd.min.js +1 -1
  65. package/dist/lang/ms.umd.min.js +1 -1
  66. package/dist/lang/my.umd.min.js +1 -1
  67. package/dist/lang/nb-no.umd.min.js +1 -1
  68. package/dist/lang/nl.umd.min.js +1 -1
  69. package/dist/lang/pl.umd.min.js +1 -1
  70. package/dist/lang/pt-br.umd.min.js +1 -1
  71. package/dist/lang/pt.umd.min.js +1 -1
  72. package/dist/lang/ro.umd.min.js +1 -1
  73. package/dist/lang/ru.umd.min.js +1 -1
  74. package/dist/lang/sk.umd.min.js +1 -1
  75. package/dist/lang/sl.umd.min.js +1 -1
  76. package/dist/lang/sr.umd.min.js +1 -1
  77. package/dist/lang/sv.umd.min.js +1 -1
  78. package/dist/lang/ta.umd.min.js +1 -1
  79. package/dist/lang/th.umd.min.js +1 -1
  80. package/dist/lang/tr.umd.min.js +1 -1
  81. package/dist/lang/ug.umd.min.js +1 -1
  82. package/dist/lang/uk.umd.min.js +1 -1
  83. package/dist/lang/vi.umd.min.js +1 -1
  84. package/dist/lang/zh-hans.umd.min.js +1 -1
  85. package/dist/lang/zh-hant.umd.min.js +1 -1
  86. package/dist/quasar.addon.css +1 -1
  87. package/dist/quasar.addon.rtl.css +1 -1
  88. package/dist/quasar.common.js +2 -2
  89. package/dist/quasar.css +5 -1
  90. package/dist/quasar.esm.js +2 -2
  91. package/dist/quasar.ie.polyfills.js +1 -1
  92. package/dist/quasar.ie.polyfills.umd.min.js +1 -1
  93. package/dist/quasar.min.css +1 -1
  94. package/dist/quasar.rtl.css +5 -1
  95. package/dist/quasar.rtl.min.css +1 -1
  96. package/dist/quasar.sass +3 -1
  97. package/dist/quasar.styl +3 -1
  98. package/dist/quasar.umd.js +239 -153
  99. package/dist/quasar.umd.min.js +2 -2
  100. package/dist/quasar.umd.modern.js +236 -151
  101. package/dist/quasar.umd.modern.min.js +2 -2
  102. package/dist/types/index.d.ts +8 -0
  103. package/dist/types/utils/date.d.ts +28 -13
  104. package/dist/vetur/quasar-attributes.json +8 -0
  105. package/dist/vetur/quasar-tags.json +2 -0
  106. package/dist/web-types/web-types.json +21 -3
  107. package/package.json +1 -1
  108. package/src/components/field/QField.sass +2 -0
  109. package/src/components/field/QField.styl +2 -0
  110. package/src/components/form/QForm.js +17 -14
  111. package/src/components/knob/QKnob.js +41 -23
  112. package/src/components/knob/QKnob.json +16 -0
  113. package/src/components/select/QSelect.js +1 -1
  114. package/src/components/slider/slider-utils.json +1 -1
  115. package/src/components/tree/QTree.js +6 -8
  116. package/src/mixins/mask.js +1 -1
  117. package/src/mixins/validate.js +12 -12
  118. package/src/plugins/Screen.js +10 -6
  119. package/src/utils/date.js +147 -85
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quasar Framework v1.18.0
2
+ * Quasar Framework v1.18.4
3
3
  * (c) 2015-present Razvan Stoenescu
4
4
  * Released under the MIT License.
5
5
  */
@@ -12,7 +12,7 @@
12
12
 
13
13
  Vue = Vue && Object.prototype.hasOwnProperty.call(Vue, 'default') ? Vue['default'] : Vue;
14
14
 
15
- var version = "1.18.0";
15
+ var version = "1.18.4";
16
16
 
17
17
  /* eslint-disable no-useless-escape */
18
18
 
@@ -632,14 +632,18 @@
632
632
  }
633
633
 
634
634
  const { visualViewport } = window;
635
- const getSize = visualViewport === void 0
636
- ? () => [ window.innerWidth, window.innerHeight ]
635
+ const target = visualViewport || window;
636
+ const scrollingElement = document.scrollingElement || document.documentElement;
637
+ const getSize = visualViewport === void 0 || client.is.mobile === true
638
+ ? () => [
639
+ Math.max(window.innerWidth, scrollingElement.clientWidth),
640
+ Math.max(window.innerHeight, scrollingElement.clientHeight)
641
+ ]
637
642
  : () => [
638
- visualViewport.width * visualViewport.scale + window.innerWidth - document.scrollingElement.clientWidth,
639
- visualViewport.height * visualViewport.scale + window.innerHeight - document.scrollingElement.clientHeight
643
+ visualViewport.width * visualViewport.scale + window.innerWidth - scrollingElement.clientWidth,
644
+ visualViewport.height * visualViewport.scale + window.innerHeight - scrollingElement.clientHeight
640
645
  ];
641
646
 
642
- const target = visualViewport || window;
643
647
  const classes = cfg.screen !== void 0 && cfg.screen.bodyClasses === true;
644
648
 
645
649
  const update = force => {
@@ -11617,8 +11621,8 @@
11617
11621
  days = '(' + dateLocale.days.join('|') + ')',
11618
11622
  key = mask + days;
11619
11623
 
11620
- if (regexStore[key] !== void 0) {
11621
- return regexStore[key]
11624
+ if (regexStore[ key ] !== void 0) {
11625
+ return regexStore[ key ]
11622
11626
  }
11623
11627
 
11624
11628
  const
@@ -11736,7 +11740,7 @@
11736
11740
 
11737
11741
  default:
11738
11742
  index--;
11739
- if (match[0] === '[') {
11743
+ if (match[ 0 ] === '[') {
11740
11744
  match = match.substring(1, match.length - 1);
11741
11745
  }
11742
11746
  return match.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -11744,7 +11748,7 @@
11744
11748
  });
11745
11749
 
11746
11750
  const res = { map, regex: new RegExp('^' + regexText) };
11747
- regexStore[key] = res;
11751
+ regexStore[ key ] = res;
11748
11752
 
11749
11753
  return res
11750
11754
  }
@@ -11776,12 +11780,14 @@
11776
11780
 
11777
11781
  const day = date.getDate();
11778
11782
 
11779
- if (mod.years !== void 0) {
11780
- year += sign * mod.years;
11783
+ if (mod.year !== void 0) {
11784
+ year += sign * mod.year;
11785
+ delete mod.year;
11781
11786
  }
11782
11787
 
11783
- if (mod.months !== void 0) {
11784
- month += sign * mod.months;
11788
+ if (mod.month !== void 0) {
11789
+ month += sign * mod.month;
11790
+ delete mod.month;
11785
11791
  }
11786
11792
 
11787
11793
  date.setDate(1);
@@ -11791,76 +11797,108 @@
11791
11797
  date.setMonth(month);
11792
11798
  date.setDate(Math.min(day, daysInMonth(date)));
11793
11799
 
11794
- if (mod.days !== void 0) {
11795
- date.setDate(date.getDate() + sign * mod.days);
11800
+ if (mod.date !== void 0) {
11801
+ date.setDate(date.getDate() + sign * mod.date);
11802
+ delete mod.date;
11796
11803
  }
11797
11804
 
11798
11805
  return date
11799
11806
  }
11800
11807
 
11801
- const yearMonDay = [ 'years', 'year', 'months', 'month', 'days' ];
11808
+ function applyYearMonthDay (date, mod, middle) {
11809
+ const
11810
+ year = mod.year !== void 0 ? mod.year : date[ `get${middle}FullYear` ](),
11811
+ month = mod.month !== void 0 ? mod.month - 1 : date[ `get${middle}Month` ](),
11812
+ maxDay = (new Date(year, month + 1, 0)).getDate(),
11813
+ day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[ `get${middle}Date` ]());
11814
+
11815
+ date[ `set${middle}Date` ](1);
11816
+ date[ `set${middle}Month` ](2);
11817
+
11818
+ date[ `set${middle}FullYear` ](year);
11819
+ date[ `set${middle}Month` ](month);
11820
+ date[ `set${middle}Date` ](day);
11821
+
11822
+ delete mod.year;
11823
+ delete mod.month;
11824
+ delete mod.date;
11802
11825
 
11803
- function getChange (date, mod, sign) {
11826
+ return date
11827
+ }
11828
+
11829
+ function getChange (date, rawMod, sign) {
11804
11830
  const
11831
+ mod = normalizeMod(rawMod),
11805
11832
  d = new Date(date),
11806
- t = (
11807
- mod.years !== void 0 || mod.year !== void 0 ||
11808
- mod.months !== void 0 || mod.month !== void 0 ||
11809
- mod.days !== void 0
11810
- )
11811
- ? applyYearMonthDayChange(d, mod, sign)
11833
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
11834
+ ? applyYearMonthDayChange(d, mod, sign) // removes year/month/day
11812
11835
  : d;
11813
11836
 
11814
11837
  for (const key in mod) {
11815
- if (yearMonDay.includes(key) === false) {
11816
- const op = capitalize(key);
11817
- t[`set${op}`](t[`get${op}`]() + sign * mod[key]);
11818
- }
11838
+ const op = capitalize(key);
11839
+ t[ `set${op}` ](t[ `get${op}` ]() + sign * mod[ key ]);
11819
11840
  }
11820
11841
 
11821
11842
  return t
11822
11843
  }
11823
11844
 
11824
- function applyYearMonthDay (date, mod, middle) {
11825
- const
11826
- year = mod.year !== void 0
11827
- ? mod.year
11828
- : (mod.years !== void 0 ? mod.years : date[`get${middle}FullYear`]()),
11829
- month = mod.month !== void 0
11830
- ? mod.month - 1
11831
- : (mod.months !== void 0 ? mod.months : date[`get${middle}Month`]()),
11832
- maxDay = (new Date(year, month + 1, 0)).getDate(),
11833
- day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[`get${middle}Date`]());
11845
+ function normalizeMod (mod) {
11846
+ const acc = { ...mod };
11834
11847
 
11835
- date[`set${middle}Date`](1);
11836
- date[`set${middle}Month`](2);
11848
+ if (mod.years !== void 0) {
11849
+ acc.year = mod.years;
11850
+ delete acc.years;
11851
+ }
11837
11852
 
11838
- date[`set${middle}FullYear`](year);
11839
- date[`set${middle}Month`](month);
11840
- date[`set${middle}Date`](day);
11853
+ if (mod.months !== void 0) {
11854
+ acc.month = mod.months;
11855
+ delete acc.months;
11856
+ }
11841
11857
 
11842
- return date
11843
- }
11858
+ if (mod.days !== void 0) {
11859
+ acc.date = mod.days;
11860
+ delete acc.days;
11861
+ }
11862
+ if (mod.day !== void 0) {
11863
+ acc.date = mod.day;
11864
+ delete acc.day;
11865
+ }
11866
+
11867
+ if (mod.hour !== void 0) {
11868
+ acc.hours = mod.hour;
11869
+ delete acc.hour;
11870
+ }
11871
+
11872
+ if (mod.minute !== void 0) {
11873
+ acc.minutes = mod.minute;
11874
+ delete acc.minute;
11875
+ }
11876
+
11877
+ if (mod.second !== void 0) {
11878
+ acc.seconds = mod.second;
11879
+ delete acc.second;
11880
+ }
11881
+
11882
+ if (mod.millisecond !== void 0) {
11883
+ acc.milliseconds = mod.millisecond;
11884
+ delete acc.millisecond;
11885
+ }
11844
11886
 
11845
- const yearMonDayAdj = [ 'years', 'year', 'months', 'month', 'days' ];
11887
+ return acc
11888
+ }
11846
11889
 
11847
- function adjustDate (date, mod, utc) {
11890
+ function adjustDate (date, rawMod, utc) {
11848
11891
  const
11892
+ mod = normalizeMod(rawMod),
11849
11893
  middle = utc === true ? 'UTC' : '',
11850
11894
  d = new Date(date),
11851
- t = (
11852
- mod.years !== void 0 || mod.year !== void 0 ||
11853
- mod.months !== void 0 || mod.month !== void 0 ||
11854
- mod.days !== void 0
11855
- )
11856
- ? applyYearMonthDay(d, mod, middle)
11895
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
11896
+ ? applyYearMonthDay(d, mod, middle) // removes year/month/day
11857
11897
  : d;
11858
11898
 
11859
11899
  for (const key in mod) {
11860
- if (yearMonDayAdj.includes(key) === false) {
11861
- const op = key.charAt(0).toUpperCase() + key.slice(1);
11862
- t[`set${middle}${op}`](mod[key]);
11863
- }
11900
+ const op = key.charAt(0).toUpperCase() + key.slice(1);
11901
+ t[ `set${middle}${op}` ](mod[ key ]);
11864
11902
  }
11865
11903
 
11866
11904
  return t
@@ -11931,7 +11969,7 @@
11931
11969
  let tzString = '';
11932
11970
 
11933
11971
  if (map.X !== void 0 || map.x !== void 0) {
11934
- const stamp = parseInt(match[map.X !== void 0 ? map.X : map.x], 10);
11972
+ const stamp = parseInt(match[ map.X !== void 0 ? map.X : map.x ], 10);
11935
11973
 
11936
11974
  if (isNaN(stamp) === true || stamp < 0) {
11937
11975
  return date
@@ -11949,28 +11987,28 @@
11949
11987
  }
11950
11988
  else {
11951
11989
  if (map.YYYY !== void 0) {
11952
- date.year = parseInt(match[map.YYYY], 10);
11990
+ date.year = parseInt(match[ map.YYYY ], 10);
11953
11991
  }
11954
11992
  else if (map.YY !== void 0) {
11955
- const y = parseInt(match[map.YY], 10);
11993
+ const y = parseInt(match[ map.YY ], 10);
11956
11994
  date.year = y < 0 ? y : 2000 + y;
11957
11995
  }
11958
11996
 
11959
11997
  if (map.M !== void 0) {
11960
- date.month = parseInt(match[map.M], 10);
11998
+ date.month = parseInt(match[ map.M ], 10);
11961
11999
  if (date.month < 1 || date.month > 12) {
11962
12000
  return date
11963
12001
  }
11964
12002
  }
11965
12003
  else if (map.MMM !== void 0) {
11966
- date.month = monthsShort.indexOf(match[map.MMM]) + 1;
12004
+ date.month = monthsShort.indexOf(match[ map.MMM ]) + 1;
11967
12005
  }
11968
12006
  else if (map.MMMM !== void 0) {
11969
- date.month = months.indexOf(match[map.MMMM]) + 1;
12007
+ date.month = months.indexOf(match[ map.MMMM ]) + 1;
11970
12008
  }
11971
12009
 
11972
12010
  if (map.D !== void 0) {
11973
- date.day = parseInt(match[map.D], 10);
12011
+ date.day = parseInt(match[ map.D ], 10);
11974
12012
 
11975
12013
  if (date.year === null || date.month === null || date.day < 1) {
11976
12014
  return date
@@ -11986,14 +12024,14 @@
11986
12024
  }
11987
12025
 
11988
12026
  if (map.H !== void 0) {
11989
- date.hour = parseInt(match[map.H], 10) % 24;
12027
+ date.hour = parseInt(match[ map.H ], 10) % 24;
11990
12028
  }
11991
12029
  else if (map.h !== void 0) {
11992
- date.hour = parseInt(match[map.h], 10) % 12;
12030
+ date.hour = parseInt(match[ map.h ], 10) % 12;
11993
12031
  if (
11994
- (map.A && match[map.A] === 'PM') ||
11995
- (map.a && match[map.a] === 'pm') ||
11996
- (map.aa && match[map.aa] === 'p.m.')
12032
+ (map.A && match[ map.A ] === 'PM') ||
12033
+ (map.a && match[ map.a ] === 'pm') ||
12034
+ (map.aa && match[ map.aa ] === 'p.m.')
11997
12035
  ) {
11998
12036
  date.hour += 12;
11999
12037
  }
@@ -12001,20 +12039,20 @@
12001
12039
  }
12002
12040
 
12003
12041
  if (map.m !== void 0) {
12004
- date.minute = parseInt(match[map.m], 10) % 60;
12042
+ date.minute = parseInt(match[ map.m ], 10) % 60;
12005
12043
  }
12006
12044
 
12007
12045
  if (map.s !== void 0) {
12008
- date.second = parseInt(match[map.s], 10) % 60;
12046
+ date.second = parseInt(match[ map.s ], 10) % 60;
12009
12047
  }
12010
12048
 
12011
12049
  if (map.S !== void 0) {
12012
- date.millisecond = parseInt(match[map.S], 10) * 10 ** (3 - match[map.S].length);
12050
+ date.millisecond = parseInt(match[ map.S ], 10) * 10 ** (3 - match[ map.S ].length);
12013
12051
  }
12014
12052
 
12015
12053
  if (map.Z !== void 0 || map.ZZ !== void 0) {
12016
- tzString = (map.Z !== void 0 ? match[map.Z].replace(':', '') : match[map.ZZ]);
12017
- date.timezoneOffset = (tzString[0] === '+' ? -1 : 1) * (60 * tzString.slice(1, 3) + 1 * tzString.slice(3, 5));
12054
+ tzString = (map.Z !== void 0 ? match[ map.Z ].replace(':', '') : match[ map.ZZ ]);
12055
+ date.timezoneOffset = (tzString[ 0 ] === '+' ? -1 : 1) * (60 * tzString.slice(1, 3) + 1 * tzString.slice(3, 5));
12018
12056
  }
12019
12057
  }
12020
12058
 
@@ -12094,17 +12132,24 @@
12094
12132
 
12095
12133
  switch (unit) {
12096
12134
  case 'year':
12097
- t[`${prefix}Month`](0);
12135
+ case 'years':
12136
+ t[ `${prefix}Month` ](0);
12098
12137
  case 'month':
12099
- t[`${prefix}Date`](1);
12138
+ case 'months':
12139
+ t[ `${prefix}Date` ](1);
12100
12140
  case 'day':
12101
- t[`${prefix}Hours`](0);
12141
+ case 'days':
12142
+ case 'date':
12143
+ t[ `${prefix}Hours` ](0);
12102
12144
  case 'hour':
12103
- t[`${prefix}Minutes`](0);
12145
+ case 'hours':
12146
+ t[ `${prefix}Minutes` ](0);
12104
12147
  case 'minute':
12105
- t[`${prefix}Seconds`](0);
12148
+ case 'minutes':
12149
+ t[ `${prefix}Seconds` ](0);
12106
12150
  case 'second':
12107
- t[`${prefix}Milliseconds`](0);
12151
+ case 'seconds':
12152
+ t[ `${prefix}Milliseconds` ](0);
12108
12153
  }
12109
12154
  return t
12110
12155
  }
@@ -12116,17 +12161,24 @@
12116
12161
 
12117
12162
  switch (unit) {
12118
12163
  case 'year':
12119
- t[`${prefix}Month`](11);
12164
+ case 'years':
12165
+ t[ `${prefix}Month` ](11);
12120
12166
  case 'month':
12121
- t[`${prefix}Date`](daysInMonth(t));
12167
+ case 'months':
12168
+ t[ `${prefix}Date` ](daysInMonth(t));
12122
12169
  case 'day':
12123
- t[`${prefix}Hours`](23);
12170
+ case 'days':
12171
+ case 'date':
12172
+ t[ `${prefix}Hours` ](23);
12124
12173
  case 'hour':
12125
- t[`${prefix}Minutes`](59);
12174
+ case 'hours':
12175
+ t[ `${prefix}Minutes` ](59);
12126
12176
  case 'minute':
12127
- t[`${prefix}Seconds`](59);
12177
+ case 'minutes':
12178
+ t[ `${prefix}Seconds` ](59);
12128
12179
  case 'second':
12129
- t[`${prefix}Milliseconds`](999);
12180
+ case 'seconds':
12181
+ t[ `${prefix}Milliseconds` ](999);
12130
12182
  }
12131
12183
  return t
12132
12184
  }
@@ -12161,21 +12213,28 @@
12161
12213
 
12162
12214
  switch (unit) {
12163
12215
  case 'years':
12216
+ case 'year':
12164
12217
  return (t.getFullYear() - sub.getFullYear())
12165
12218
 
12166
12219
  case 'months':
12220
+ case 'month':
12167
12221
  return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
12168
12222
 
12169
12223
  case 'days':
12224
+ case 'day':
12225
+ case 'date':
12170
12226
  return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
12171
12227
 
12172
12228
  case 'hours':
12229
+ case 'hour':
12173
12230
  return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
12174
12231
 
12175
12232
  case 'minutes':
12233
+ case 'minute':
12176
12234
  return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
12177
12235
 
12178
12236
  case 'seconds':
12237
+ case 'second':
12179
12238
  return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
12180
12239
  }
12181
12240
  }
@@ -12221,26 +12280,33 @@
12221
12280
 
12222
12281
  switch (unit) {
12223
12282
  case 'second':
12283
+ case 'seconds':
12224
12284
  if (t.getSeconds() !== d.getSeconds()) {
12225
12285
  return false
12226
12286
  }
12227
12287
  case 'minute': // intentional fall-through
12288
+ case 'minutes':
12228
12289
  if (t.getMinutes() !== d.getMinutes()) {
12229
12290
  return false
12230
12291
  }
12231
12292
  case 'hour': // intentional fall-through
12293
+ case 'hours':
12232
12294
  if (t.getHours() !== d.getHours()) {
12233
12295
  return false
12234
12296
  }
12235
12297
  case 'day': // intentional fall-through
12298
+ case 'days':
12299
+ case 'date':
12236
12300
  if (t.getDate() !== d.getDate()) {
12237
12301
  return false
12238
12302
  }
12239
12303
  case 'month': // intentional fall-through
12304
+ case 'months':
12240
12305
  if (t.getMonth() !== d.getMonth()) {
12241
12306
  return false
12242
12307
  }
12243
12308
  case 'year': // intentional fall-through
12309
+ case 'years':
12244
12310
  if (t.getFullYear() !== d.getFullYear()) {
12245
12311
  return false
12246
12312
  }
@@ -12298,12 +12364,12 @@
12298
12364
 
12299
12365
  // Month Short Name: Jan, Feb, ...
12300
12366
  MMM (date, dateLocale) {
12301
- return dateLocale.monthsShort[date.getMonth()]
12367
+ return dateLocale.monthsShort[ date.getMonth() ]
12302
12368
  },
12303
12369
 
12304
12370
  // Month Name: January, February, ...
12305
12371
  MMMM (date, dateLocale) {
12306
- return dateLocale.months[date.getMonth()]
12372
+ return dateLocale.months[ date.getMonth() ]
12307
12373
  },
12308
12374
 
12309
12375
  // Quarter: 1, 2, 3, 4
@@ -12353,12 +12419,12 @@
12353
12419
 
12354
12420
  // Day of week: Sun, Mon, ...
12355
12421
  ddd (date, dateLocale) {
12356
- return dateLocale.daysShort[date.getDay()]
12422
+ return dateLocale.daysShort[ date.getDay() ]
12357
12423
  },
12358
12424
 
12359
12425
  // Day of week: Sunday, Monday, ...
12360
12426
  dddd (date, dateLocale) {
12361
- return dateLocale.days[date.getDay()]
12427
+ return dateLocale.days[ date.getDay() ]
12362
12428
  },
12363
12429
 
12364
12430
  // Day of ISO week: 1, 2, ..., 7
@@ -12507,7 +12573,7 @@
12507
12573
  token,
12508
12574
  (match, text) => (
12509
12575
  match in formatter
12510
- ? formatter[match](date, locale, __forcedYear, __forcedTimezoneOffset)
12576
+ ? formatter[ match ](date, locale, __forcedYear, __forcedTimezoneOffset)
12511
12577
  : (text === void 0 ? match : text.split('\\]').join(']'))
12512
12578
  )
12513
12579
  )
@@ -17938,7 +18004,14 @@
17938
18004
  else if (this.isDirty === false) {
17939
18005
  this.isDirty = true;
17940
18006
 
17941
- if (this.hasActiveRules === true && this.lazyRules !== 'ondemand') {
18007
+ if (
18008
+ this.hasActiveRules === true &&
18009
+ this.lazyRules !== 'ondemand' &&
18010
+ // Don't re-trigger if it's already in progress;
18011
+ // It might mean that focus switched to submit btn and
18012
+ // QForm's submit() has been called already (ENTER key)
18013
+ this.innerLoading === false
18014
+ ) {
17942
18015
  this.debouncedValidate();
17943
18016
  }
17944
18017
  }
@@ -18002,7 +18075,7 @@
18002
18075
  return true
18003
18076
  }
18004
18077
 
18005
- this.validateIndex++;
18078
+ const index = ++this.validateIndex;
18006
18079
 
18007
18080
  if (this.innerLoading !== true && this.lazyRules !== true) {
18008
18081
  this.isDirty = true;
@@ -18055,31 +18128,24 @@
18055
18128
  this.innerLoading = true;
18056
18129
  }
18057
18130
 
18058
- const index = this.validateIndex;
18059
-
18060
18131
  return Promise.all(promises).then(
18061
18132
  res => {
18062
- if (index !== this.validateIndex) {
18063
- return true
18064
- }
18065
-
18066
18133
  if (res === void 0 || Array.isArray(res) === false || res.length === 0) {
18067
- update(false);
18134
+ index === this.validateIndex && update(false);
18068
18135
  return true
18069
18136
  }
18070
18137
 
18071
18138
  const msg = res.find(r => r === false || typeof r === 'string');
18072
- update(msg !== void 0, msg);
18139
+ index === this.validateIndex && update(msg !== void 0, msg);
18073
18140
  return msg === void 0
18074
18141
  },
18075
18142
  e => {
18076
18143
  if (index === this.validateIndex) {
18077
18144
  console.error(e);
18078
18145
  update(true);
18079
- return false
18080
18146
  }
18081
18147
 
18082
- return true
18148
+ return false
18083
18149
  }
18084
18150
  )
18085
18151
  },
@@ -19535,7 +19601,7 @@
19535
19601
  ? shouldFocus
19536
19602
  : this.noErrorFocus !== true;
19537
19603
 
19538
- this.validateIndex++;
19604
+ const index = ++this.validateIndex;
19539
19605
 
19540
19606
  const components = this.getValidationComponents().filter(c => c.disable !== true);
19541
19607
 
@@ -19551,7 +19617,7 @@
19551
19617
  promises.push(
19552
19618
  valid.then(
19553
19619
  valid => ({ valid, comp }),
19554
- error => ({ valid: false, comp, error })
19620
+ err => ({ valid: false, comp, err })
19555
19621
  )
19556
19622
  );
19557
19623
  }
@@ -19575,19 +19641,19 @@
19575
19641
  return Promise.resolve(true)
19576
19642
  }
19577
19643
 
19578
- const index = this.validateIndex;
19579
-
19580
19644
  return Promise.all(promises).then(
19581
19645
  res => {
19582
- if (index === this.validateIndex) {
19583
- const errors = res.filter(r => r.valid !== true);
19646
+ const errors = res.filter(r => r.valid !== true);
19584
19647
 
19585
- if (errors.length === 0) {
19586
- emit(true);
19587
- return true
19588
- }
19648
+ if (errors.length === 0) {
19649
+ index === this.validateIndex && emit(true);
19650
+ return true
19651
+ }
19589
19652
 
19590
- const { valid, comp } = errors[0];
19653
+ const { valid, comp, err } = errors[0];
19654
+
19655
+ if (index === this.validateIndex) {
19656
+ err !== void 0 && console.error(err);
19591
19657
 
19592
19658
  emit(false, comp);
19593
19659
 
@@ -19598,9 +19664,9 @@
19598
19664
  ) {
19599
19665
  comp.focus();
19600
19666
  }
19601
-
19602
- return false
19603
19667
  }
19668
+
19669
+ return false
19604
19670
  }
19605
19671
  )
19606
19672
  },
@@ -19616,8 +19682,11 @@
19616
19682
  submit (evt) {
19617
19683
  evt !== void 0 && stopAndPrevent(evt);
19618
19684
 
19685
+ const index = this.validateIndex + 1;
19686
+
19619
19687
  this.validate().then(val => {
19620
- if (val === true) {
19688
+ // if not outdated && validation succeeded
19689
+ if (index === this.validateIndex && val === true) {
19621
19690
  if (this.qListeners.submit !== void 0) {
19622
19691
  this.$emit('submit', evt);
19623
19692
  }
@@ -20790,7 +20859,7 @@
20790
20859
  ? this.__unmask(masked)
20791
20860
  : masked;
20792
20861
 
20793
- this.value !== val && this.__emitValue(val, true);
20862
+ String(this.value) !== val && this.__emitValue(val, true);
20794
20863
  },
20795
20864
 
20796
20865
  __moveCursorForPaste (inp, start, end) {
@@ -21615,6 +21684,9 @@
21615
21684
  },
21616
21685
 
21617
21686
  props: {
21687
+ innerMin: Number,
21688
+ innerMax: Number,
21689
+
21618
21690
  step: {
21619
21691
  type: Number,
21620
21692
  default: 1,
@@ -21631,31 +21703,22 @@
21631
21703
  },
21632
21704
 
21633
21705
  data () {
21706
+ const innerMin = this.__getInnerMin(this.innerMin);
21707
+ const innerMax = this.__getInnerMax(this.innerMax);
21708
+
21634
21709
  return {
21635
- model: this.value,
21710
+ model: this.value === null ? innerMin : between(this.value, innerMin, innerMax),
21636
21711
  dragging: false
21637
21712
  }
21638
21713
  },
21639
21714
 
21640
21715
  watch: {
21641
- value (value) {
21642
- if (value < this.min) {
21643
- this.model = this.min;
21644
- }
21645
- else if (value > this.max) {
21646
- this.model = this.max;
21647
- }
21648
- else {
21649
- if (value !== this.model) {
21650
- this.model = value;
21651
- }
21652
- return
21653
- }
21716
+ modelUpdate () {
21717
+ this.model = this.value === null
21718
+ ? this.computedInnerMin
21719
+ : between(this.value, this.computedInnerMin, this.computedInnerMax);
21654
21720
 
21655
- if (this.model !== this.value) {
21656
- this.$emit('input', this.model);
21657
- this.$emit('change', this.model);
21658
- }
21721
+ this.__updateValue(true);
21659
21722
  }
21660
21723
  },
21661
21724
 
@@ -21668,6 +21731,18 @@
21668
21731
  )
21669
21732
  },
21670
21733
 
21734
+ computedInnerMin () {
21735
+ return this.__getInnerMin(this.innerMin)
21736
+ },
21737
+
21738
+ computedInnerMax () {
21739
+ return this.__getInnerMax(this.innerMax)
21740
+ },
21741
+
21742
+ modelUpdate () {
21743
+ return `${this.value}|${this.computedInnerMin}|${this.computedInnerMax}`
21744
+ },
21745
+
21671
21746
  editable () {
21672
21747
  return this.disable === false && this.readonly === false
21673
21748
  },
@@ -21699,8 +21774,8 @@
21699
21774
  attrs () {
21700
21775
  const attrs = {
21701
21776
  role: 'slider',
21702
- 'aria-valuemin': this.min,
21703
- 'aria-valuemax': this.max,
21777
+ 'aria-valuemin': this.computedInnerMin,
21778
+ 'aria-valuemax': this.computedInnerMax,
21704
21779
  'aria-valuenow': this.value
21705
21780
  };
21706
21781
 
@@ -21716,6 +21791,18 @@
21716
21791
  },
21717
21792
 
21718
21793
  methods: {
21794
+ __getInnerMin (val) {
21795
+ return isNaN(val) === true || this.innerMin < this.min
21796
+ ? this.min
21797
+ : this.innerMin
21798
+ },
21799
+
21800
+ __getInnerMax (val) {
21801
+ return isNaN(val) === true || val > this.max
21802
+ ? this.max
21803
+ : this.innerMax
21804
+ },
21805
+
21719
21806
  __updateCenterPosition () {
21720
21807
  const { top, left, width, height } = this.$el.getBoundingClientRect();
21721
21808
  this.centerPosition = {
@@ -21757,8 +21844,8 @@
21757
21844
 
21758
21845
  this.model = between(
21759
21846
  parseFloat((this.model + offset).toFixed(this.decimals)),
21760
- this.min,
21761
- this.max
21847
+ this.computedInnerMin,
21848
+ this.computedInnerMax
21762
21849
  );
21763
21850
 
21764
21851
  this.__updateValue();
@@ -21815,7 +21902,7 @@
21815
21902
  model = parseFloat(model.toFixed(this.decimals));
21816
21903
  }
21817
21904
 
21818
- model = between(model, this.min, this.max);
21905
+ model = between(model, this.computedInnerMin, this.computedInnerMax);
21819
21906
 
21820
21907
  this.$emit('drag-value', model);
21821
21908
 
@@ -26643,7 +26730,7 @@
26643
26730
  };
26644
26731
 
26645
26732
  if (this.$q.platform.is.desktop === true) {
26646
- itemEvents.mousemove = () => { this.setOptionIndex(index); };
26733
+ itemEvents.mousemove = () => { this.menu === true && this.setOptionIndex(index); };
26647
26734
  }
26648
26735
 
26649
26736
  const option = {
@@ -34850,14 +34937,12 @@
34850
34937
  __onClick (node, meta, e, keyboard) {
34851
34938
  keyboard !== true && this.__blur(meta.key);
34852
34939
 
34853
- if (this.hasSelection) {
34854
- if (meta.selectable) {
34855
- if (this.noSelectionUnset === false) {
34856
- this.$emit('update:selected', meta.key !== this.selected ? meta.key : null);
34857
- }
34858
- else if (meta.key !== this.selected) {
34859
- this.$emit('update:selected', meta.key || null);
34860
- }
34940
+ if (this.hasSelection && meta.selectable) {
34941
+ if (this.noSelectionUnset === false) {
34942
+ this.$emit('update:selected', meta.key !== this.selected ? meta.key : null);
34943
+ }
34944
+ else if (meta.key !== this.selected) {
34945
+ this.$emit('update:selected', meta.key || null);
34861
34946
  }
34862
34947
  }
34863
34948
  else {