quasar 1.17.8 → 1.18.3

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 (129) hide show
  1. package/dist/api/QCheckbox.json +27 -0
  2. package/dist/api/QRadio.json +18 -0
  3. package/dist/api/QToggle.json +24 -25
  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 +45 -11
  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 +58 -24
  95. package/dist/quasar.rtl.min.css +1 -1
  96. package/dist/quasar.sass +31 -11
  97. package/dist/quasar.styl +31 -11
  98. package/dist/quasar.umd.js +323 -190
  99. package/dist/quasar.umd.min.js +2 -2
  100. package/dist/quasar.umd.modern.js +313 -188
  101. package/dist/quasar.umd.modern.min.js +2 -2
  102. package/dist/types/index.d.ts +32 -12
  103. package/dist/types/utils/date.d.ts +28 -13
  104. package/dist/vetur/quasar-attributes.json +32 -12
  105. package/dist/vetur/quasar-tags.json +8 -3
  106. package/dist/web-types/web-types.json +73 -28
  107. package/package.json +1 -1
  108. package/src/components/checkbox/QCheckbox.js +48 -22
  109. package/src/components/checkbox/QCheckbox.json +17 -0
  110. package/src/components/checkbox/QCheckbox.sass +17 -5
  111. package/src/components/checkbox/QCheckbox.styl +17 -5
  112. package/src/components/field/QField.sass +2 -0
  113. package/src/components/field/QField.styl +2 -0
  114. package/src/components/form/QForm.js +17 -14
  115. package/src/components/input/QInput.js +9 -0
  116. package/src/components/radio/QRadio.js +43 -19
  117. package/src/components/radio/QRadio.json +16 -0
  118. package/src/components/radio/QRadio.sass +17 -5
  119. package/src/components/radio/QRadio.styl +17 -5
  120. package/src/components/select/QSelect.js +3 -2
  121. package/src/components/toggle/QToggle.js +0 -3
  122. package/src/components/toggle/QToggle.json +3 -13
  123. package/src/components/tree/QTree.js +6 -8
  124. package/src/mixins/checkbox.js +4 -0
  125. package/src/mixins/checkbox.json +18 -0
  126. package/src/mixins/validate.js +19 -16
  127. package/src/plugins/Meta.js +1 -1
  128. package/src/plugins/Screen.js +16 -9
  129. package/src/utils/date.js +151 -94
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quasar Framework v1.17.8
2
+ * Quasar Framework v1.18.3
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.17.8";
15
+ var version = "1.18.3";
16
16
 
17
17
  /* eslint-disable no-useless-escape */
18
18
 
@@ -631,12 +631,23 @@
631
631
  return
632
632
  }
633
633
 
634
+ const { visualViewport } = window;
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
+ ]
642
+ : () => [
643
+ visualViewport.width * visualViewport.scale + window.innerWidth - scrollingElement.clientWidth,
644
+ visualViewport.height * visualViewport.scale + window.innerHeight - scrollingElement.clientHeight
645
+ ];
646
+
634
647
  const classes = cfg.screen !== void 0 && cfg.screen.bodyClasses === true;
635
648
 
636
649
  const update = force => {
637
- const
638
- w = window.innerWidth,
639
- h = window.innerHeight;
650
+ const [ w, h ] = getSize();
640
651
 
641
652
  if (h !== this.height) {
642
653
  this.height = h;
@@ -694,11 +705,7 @@
694
705
  };
695
706
 
696
707
  const start = () => {
697
- const
698
- style = getComputedStyle(document.body),
699
- target = window.visualViewport !== void 0
700
- ? window.visualViewport
701
- : window;
708
+ const style = getComputedStyle(document.body);
702
709
 
703
710
  // if css props available
704
711
  if (style.getPropertyValue('--q-size-sm')) {
@@ -7365,6 +7372,10 @@
7365
7372
  falseValue: { default: false },
7366
7373
  indeterminateValue: { default: null },
7367
7374
 
7375
+ checkedIcon: String,
7376
+ uncheckedIcon: String,
7377
+ indeterminateIcon: String,
7378
+
7368
7379
  toggleOrder: {
7369
7380
  type: String,
7370
7381
  validator: v => v === 'tf' || v === 'ft'
@@ -7568,33 +7579,57 @@
7568
7579
 
7569
7580
  mixins: [ CheckboxMixin ],
7570
7581
 
7582
+ computed: {
7583
+ computedIcon () {
7584
+ return this.isTrue === true
7585
+ ? this.checkedIcon
7586
+ : (this.isIndeterminate === true
7587
+ ? this.indeterminateIcon
7588
+ : this.uncheckedIcon
7589
+ )
7590
+ }
7591
+ },
7592
+
7571
7593
  methods: {
7572
7594
  __getInner (h) {
7573
- return [
7574
- h('div', {
7575
- staticClass: 'q-checkbox__bg absolute'
7576
- }, [
7577
- h('svg', {
7578
- staticClass: 'q-checkbox__svg fit absolute-full',
7579
- attrs: { focusable: 'false' /* needed for IE11 */, viewBox: '0 0 24 24', 'aria-hidden': 'true' }
7595
+ return this.computedIcon !== void 0
7596
+ ? [
7597
+ h('div', {
7598
+ key: 'icon',
7599
+ staticClass: 'q-checkbox__icon-container absolute flex flex-center no-wrap'
7580
7600
  }, [
7581
- h('path', {
7582
- staticClass: 'q-checkbox__truthy',
7583
- attrs: {
7584
- fill: 'none',
7585
- d: 'M1.73,12.91 8.1,19.28 22.79,4.59'
7586
- }
7587
- }),
7588
-
7589
- h('path', {
7590
- staticClass: 'q-checkbox__indet',
7591
- attrs: {
7592
- d: 'M4,14H20V10H4'
7593
- }
7601
+ h(QIcon, {
7602
+ staticClass: 'q-checkbox__icon',
7603
+ props: { name: this.computedIcon }
7594
7604
  })
7595
7605
  ])
7596
- ])
7597
- ]
7606
+ ]
7607
+ : [
7608
+ h('div', {
7609
+ key: 'svg',
7610
+ staticClass: 'q-checkbox__bg absolute'
7611
+ }, [
7612
+ h('svg', {
7613
+ staticClass: 'q-checkbox__svg fit absolute-full',
7614
+ attrs: { focusable: 'false' /* needed for IE11 */, viewBox: '0 0 24 24', 'aria-hidden': 'true' }
7615
+ }, [
7616
+ h('path', {
7617
+ staticClass: 'q-checkbox__truthy',
7618
+ attrs: {
7619
+ fill: 'none',
7620
+ d: 'M1.73,12.91 8.1,19.28 22.79,4.59'
7621
+ }
7622
+ }),
7623
+
7624
+ h('path', {
7625
+ staticClass: 'q-checkbox__indet',
7626
+ attrs: {
7627
+ d: 'M4,14H20V10H4'
7628
+ }
7629
+ })
7630
+ ])
7631
+ ])
7632
+ ]
7598
7633
  }
7599
7634
  },
7600
7635
 
@@ -11586,8 +11621,8 @@
11586
11621
  days = '(' + dateLocale.days.join('|') + ')',
11587
11622
  key = mask + days;
11588
11623
 
11589
- if (regexStore[key] !== void 0) {
11590
- return regexStore[key]
11624
+ if (regexStore[ key ] !== void 0) {
11625
+ return regexStore[ key ]
11591
11626
  }
11592
11627
 
11593
11628
  const
@@ -11705,7 +11740,7 @@
11705
11740
 
11706
11741
  default:
11707
11742
  index--;
11708
- if (match[0] === '[') {
11743
+ if (match[ 0 ] === '[') {
11709
11744
  match = match.substring(1, match.length - 1);
11710
11745
  }
11711
11746
  return match.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -11713,7 +11748,7 @@
11713
11748
  });
11714
11749
 
11715
11750
  const res = { map, regex: new RegExp('^' + regexText) };
11716
- regexStore[key] = res;
11751
+ regexStore[ key ] = res;
11717
11752
 
11718
11753
  return res
11719
11754
  }
@@ -11741,25 +11776,18 @@
11741
11776
  function applyYearMonthDayChange (date, mod, sign) {
11742
11777
  let
11743
11778
  year = date.getFullYear(),
11744
- month = date.getMonth(),
11745
- day = date.getDate();
11779
+ month = date.getMonth();
11746
11780
 
11747
- if (mod.years !== void 0) {
11748
- year += sign * mod.years;
11749
- }
11750
- else if (mod.year !== void 0) {
11781
+ const day = date.getDate();
11782
+
11783
+ if (mod.year !== void 0) {
11751
11784
  year += sign * mod.year;
11785
+ delete mod.year;
11752
11786
  }
11753
11787
 
11754
- if (mod.months !== void 0) {
11755
- month += sign * mod.months;
11756
- }
11757
- else if (mod.month !== void 0) {
11788
+ if (mod.month !== void 0) {
11758
11789
  month += sign * mod.month;
11759
- }
11760
-
11761
- if (mod.days !== void 0) {
11762
- day += sign * mod.days;
11790
+ delete mod.month;
11763
11791
  }
11764
11792
 
11765
11793
  date.setDate(1);
@@ -11767,74 +11795,110 @@
11767
11795
 
11768
11796
  date.setFullYear(year);
11769
11797
  date.setMonth(month);
11770
- date.setDate(day);
11798
+ date.setDate(Math.min(day, daysInMonth(date)));
11799
+
11800
+ if (mod.date !== void 0) {
11801
+ date.setDate(date.getDate() + sign * mod.date);
11802
+ delete mod.date;
11803
+ }
11771
11804
 
11772
11805
  return date
11773
11806
  }
11774
11807
 
11775
- 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);
11776
11817
 
11777
- function getChange (date, mod, sign) {
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;
11825
+
11826
+ return date
11827
+ }
11828
+
11829
+ function getChange (date, rawMod, sign) {
11778
11830
  const
11831
+ mod = normalizeMod(rawMod),
11779
11832
  d = new Date(date),
11780
- t = (
11781
- mod.years !== void 0 || mod.year !== void 0 ||
11782
- mod.months !== void 0 || mod.month !== void 0 ||
11783
- mod.days !== void 0
11784
- )
11785
- ? 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
11786
11835
  : d;
11787
11836
 
11788
11837
  for (const key in mod) {
11789
- if (yearMonDay.includes(key) === false) {
11790
- const op = capitalize(key);
11791
- t[`set${op}`](t[`get${op}`]() + sign * mod[key]);
11792
- }
11838
+ const op = capitalize(key);
11839
+ t[ `set${op}` ](t[ `get${op}` ]() + sign * mod[ key ]);
11793
11840
  }
11794
11841
 
11795
11842
  return t
11796
11843
  }
11797
11844
 
11798
- function applyYearMonthDay (date, mod, middle) {
11799
- const
11800
- year = mod.year !== void 0
11801
- ? mod.year
11802
- : (mod.years !== void 0 ? mod.years : date[`get${middle}FullYear`]()),
11803
- month = mod.month !== void 0
11804
- ? mod.month - 1
11805
- : (mod.months !== void 0 ? mod.months : date[`get${middle}Month`]()),
11806
- maxDay = (new Date(year, month + 1, 0)).getDate(),
11807
- day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[`get${middle}Date`]());
11845
+ function normalizeMod (mod) {
11846
+ const acc = { ...mod };
11847
+
11848
+ if (mod.years !== void 0) {
11849
+ acc.year = mod.years;
11850
+ delete acc.years;
11851
+ }
11852
+
11853
+ if (mod.months !== void 0) {
11854
+ acc.month = mod.months;
11855
+ delete acc.months;
11856
+ }
11857
+
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
+ }
11808
11866
 
11809
- date[`set${middle}Date`](1);
11810
- date[`set${middle}Month`](2);
11867
+ if (mod.hour !== void 0) {
11868
+ acc.hours = mod.hour;
11869
+ delete acc.hour;
11870
+ }
11811
11871
 
11812
- date[`set${middle}FullYear`](year);
11813
- date[`set${middle}Month`](month);
11814
- date[`set${middle}Date`](day);
11872
+ if (mod.minute !== void 0) {
11873
+ acc.minutes = mod.minute;
11874
+ delete acc.minute;
11875
+ }
11815
11876
 
11816
- return date
11817
- }
11877
+ if (mod.second !== void 0) {
11878
+ acc.seconds = mod.second;
11879
+ delete acc.second;
11880
+ }
11818
11881
 
11819
- const yearMonDayAdj = [ 'years', 'year', 'months', 'month', 'days' ];
11882
+ if (mod.millisecond !== void 0) {
11883
+ acc.milliseconds = mod.millisecond;
11884
+ delete acc.millisecond;
11885
+ }
11820
11886
 
11821
- function adjustDate (date, mod, utc) {
11887
+ return acc
11888
+ }
11889
+
11890
+ function adjustDate (date, rawMod, utc) {
11822
11891
  const
11892
+ mod = normalizeMod(rawMod),
11823
11893
  middle = utc === true ? 'UTC' : '',
11824
11894
  d = new Date(date),
11825
- t = (
11826
- mod.years !== void 0 || mod.year !== void 0 ||
11827
- mod.months !== void 0 || mod.month !== void 0 ||
11828
- mod.days !== void 0
11829
- )
11830
- ? 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
11831
11897
  : d;
11832
11898
 
11833
11899
  for (const key in mod) {
11834
- if (yearMonDayAdj.includes(key) === false) {
11835
- const op = key.charAt(0).toUpperCase() + key.slice(1);
11836
- t[`set${middle}${op}`](mod[key]);
11837
- }
11900
+ const op = key.charAt(0).toUpperCase() + key.slice(1);
11901
+ t[ `set${middle}${op}` ](mod[ key ]);
11838
11902
  }
11839
11903
 
11840
11904
  return t
@@ -11905,7 +11969,7 @@
11905
11969
  let tzString = '';
11906
11970
 
11907
11971
  if (map.X !== void 0 || map.x !== void 0) {
11908
- 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);
11909
11973
 
11910
11974
  if (isNaN(stamp) === true || stamp < 0) {
11911
11975
  return date
@@ -11923,28 +11987,28 @@
11923
11987
  }
11924
11988
  else {
11925
11989
  if (map.YYYY !== void 0) {
11926
- date.year = parseInt(match[map.YYYY], 10);
11990
+ date.year = parseInt(match[ map.YYYY ], 10);
11927
11991
  }
11928
11992
  else if (map.YY !== void 0) {
11929
- const y = parseInt(match[map.YY], 10);
11993
+ const y = parseInt(match[ map.YY ], 10);
11930
11994
  date.year = y < 0 ? y : 2000 + y;
11931
11995
  }
11932
11996
 
11933
11997
  if (map.M !== void 0) {
11934
- date.month = parseInt(match[map.M], 10);
11998
+ date.month = parseInt(match[ map.M ], 10);
11935
11999
  if (date.month < 1 || date.month > 12) {
11936
12000
  return date
11937
12001
  }
11938
12002
  }
11939
12003
  else if (map.MMM !== void 0) {
11940
- date.month = monthsShort.indexOf(match[map.MMM]) + 1;
12004
+ date.month = monthsShort.indexOf(match[ map.MMM ]) + 1;
11941
12005
  }
11942
12006
  else if (map.MMMM !== void 0) {
11943
- date.month = months.indexOf(match[map.MMMM]) + 1;
12007
+ date.month = months.indexOf(match[ map.MMMM ]) + 1;
11944
12008
  }
11945
12009
 
11946
12010
  if (map.D !== void 0) {
11947
- date.day = parseInt(match[map.D], 10);
12011
+ date.day = parseInt(match[ map.D ], 10);
11948
12012
 
11949
12013
  if (date.year === null || date.month === null || date.day < 1) {
11950
12014
  return date
@@ -11960,14 +12024,14 @@
11960
12024
  }
11961
12025
 
11962
12026
  if (map.H !== void 0) {
11963
- date.hour = parseInt(match[map.H], 10) % 24;
12027
+ date.hour = parseInt(match[ map.H ], 10) % 24;
11964
12028
  }
11965
12029
  else if (map.h !== void 0) {
11966
- date.hour = parseInt(match[map.h], 10) % 12;
12030
+ date.hour = parseInt(match[ map.h ], 10) % 12;
11967
12031
  if (
11968
- (map.A && match[map.A] === 'PM') ||
11969
- (map.a && match[map.a] === 'pm') ||
11970
- (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.')
11971
12035
  ) {
11972
12036
  date.hour += 12;
11973
12037
  }
@@ -11975,20 +12039,20 @@
11975
12039
  }
11976
12040
 
11977
12041
  if (map.m !== void 0) {
11978
- date.minute = parseInt(match[map.m], 10) % 60;
12042
+ date.minute = parseInt(match[ map.m ], 10) % 60;
11979
12043
  }
11980
12044
 
11981
12045
  if (map.s !== void 0) {
11982
- date.second = parseInt(match[map.s], 10) % 60;
12046
+ date.second = parseInt(match[ map.s ], 10) % 60;
11983
12047
  }
11984
12048
 
11985
12049
  if (map.S !== void 0) {
11986
- 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);
11987
12051
  }
11988
12052
 
11989
12053
  if (map.Z !== void 0 || map.ZZ !== void 0) {
11990
- tzString = (map.Z !== void 0 ? match[map.Z].replace(':', '') : match[map.ZZ]);
11991
- 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));
11992
12056
  }
11993
12057
  }
11994
12058
 
@@ -12068,17 +12132,24 @@
12068
12132
 
12069
12133
  switch (unit) {
12070
12134
  case 'year':
12071
- t[`${prefix}Month`](0);
12135
+ case 'years':
12136
+ t[ `${prefix}Month` ](0);
12072
12137
  case 'month':
12073
- t[`${prefix}Date`](1);
12138
+ case 'months':
12139
+ t[ `${prefix}Date` ](1);
12074
12140
  case 'day':
12075
- t[`${prefix}Hours`](0);
12141
+ case 'days':
12142
+ case 'date':
12143
+ t[ `${prefix}Hours` ](0);
12076
12144
  case 'hour':
12077
- t[`${prefix}Minutes`](0);
12145
+ case 'hours':
12146
+ t[ `${prefix}Minutes` ](0);
12078
12147
  case 'minute':
12079
- t[`${prefix}Seconds`](0);
12148
+ case 'minutes':
12149
+ t[ `${prefix}Seconds` ](0);
12080
12150
  case 'second':
12081
- t[`${prefix}Milliseconds`](0);
12151
+ case 'seconds':
12152
+ t[ `${prefix}Milliseconds` ](0);
12082
12153
  }
12083
12154
  return t
12084
12155
  }
@@ -12090,17 +12161,24 @@
12090
12161
 
12091
12162
  switch (unit) {
12092
12163
  case 'year':
12093
- t[`${prefix}Month`](11);
12164
+ case 'years':
12165
+ t[ `${prefix}Month` ](11);
12094
12166
  case 'month':
12095
- t[`${prefix}Date`](daysInMonth(t));
12167
+ case 'months':
12168
+ t[ `${prefix}Date` ](daysInMonth(t));
12096
12169
  case 'day':
12097
- t[`${prefix}Hours`](23);
12170
+ case 'days':
12171
+ case 'date':
12172
+ t[ `${prefix}Hours` ](23);
12098
12173
  case 'hour':
12099
- t[`${prefix}Minutes`](59);
12174
+ case 'hours':
12175
+ t[ `${prefix}Minutes` ](59);
12100
12176
  case 'minute':
12101
- t[`${prefix}Seconds`](59);
12177
+ case 'minutes':
12178
+ t[ `${prefix}Seconds` ](59);
12102
12179
  case 'second':
12103
- t[`${prefix}Milliseconds`](999);
12180
+ case 'seconds':
12181
+ t[ `${prefix}Milliseconds` ](999);
12104
12182
  }
12105
12183
  return t
12106
12184
  }
@@ -12135,21 +12213,28 @@
12135
12213
 
12136
12214
  switch (unit) {
12137
12215
  case 'years':
12216
+ case 'year':
12138
12217
  return (t.getFullYear() - sub.getFullYear())
12139
12218
 
12140
12219
  case 'months':
12220
+ case 'month':
12141
12221
  return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
12142
12222
 
12143
12223
  case 'days':
12224
+ case 'day':
12225
+ case 'date':
12144
12226
  return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
12145
12227
 
12146
12228
  case 'hours':
12229
+ case 'hour':
12147
12230
  return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
12148
12231
 
12149
12232
  case 'minutes':
12233
+ case 'minute':
12150
12234
  return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
12151
12235
 
12152
12236
  case 'seconds':
12237
+ case 'second':
12153
12238
  return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
12154
12239
  }
12155
12240
  }
@@ -12195,26 +12280,33 @@
12195
12280
 
12196
12281
  switch (unit) {
12197
12282
  case 'second':
12283
+ case 'seconds':
12198
12284
  if (t.getSeconds() !== d.getSeconds()) {
12199
12285
  return false
12200
12286
  }
12201
12287
  case 'minute': // intentional fall-through
12288
+ case 'minutes':
12202
12289
  if (t.getMinutes() !== d.getMinutes()) {
12203
12290
  return false
12204
12291
  }
12205
12292
  case 'hour': // intentional fall-through
12293
+ case 'hours':
12206
12294
  if (t.getHours() !== d.getHours()) {
12207
12295
  return false
12208
12296
  }
12209
12297
  case 'day': // intentional fall-through
12298
+ case 'days':
12299
+ case 'date':
12210
12300
  if (t.getDate() !== d.getDate()) {
12211
12301
  return false
12212
12302
  }
12213
12303
  case 'month': // intentional fall-through
12304
+ case 'months':
12214
12305
  if (t.getMonth() !== d.getMonth()) {
12215
12306
  return false
12216
12307
  }
12217
12308
  case 'year': // intentional fall-through
12309
+ case 'years':
12218
12310
  if (t.getFullYear() !== d.getFullYear()) {
12219
12311
  return false
12220
12312
  }
@@ -12272,12 +12364,12 @@
12272
12364
 
12273
12365
  // Month Short Name: Jan, Feb, ...
12274
12366
  MMM (date, dateLocale) {
12275
- return dateLocale.monthsShort[date.getMonth()]
12367
+ return dateLocale.monthsShort[ date.getMonth() ]
12276
12368
  },
12277
12369
 
12278
12370
  // Month Name: January, February, ...
12279
12371
  MMMM (date, dateLocale) {
12280
- return dateLocale.months[date.getMonth()]
12372
+ return dateLocale.months[ date.getMonth() ]
12281
12373
  },
12282
12374
 
12283
12375
  // Quarter: 1, 2, 3, 4
@@ -12327,12 +12419,12 @@
12327
12419
 
12328
12420
  // Day of week: Sun, Mon, ...
12329
12421
  ddd (date, dateLocale) {
12330
- return dateLocale.daysShort[date.getDay()]
12422
+ return dateLocale.daysShort[ date.getDay() ]
12331
12423
  },
12332
12424
 
12333
12425
  // Day of week: Sunday, Monday, ...
12334
12426
  dddd (date, dateLocale) {
12335
- return dateLocale.days[date.getDay()]
12427
+ return dateLocale.days[ date.getDay() ]
12336
12428
  },
12337
12429
 
12338
12430
  // Day of ISO week: 1, 2, ..., 7
@@ -12481,7 +12573,7 @@
12481
12573
  token,
12482
12574
  (match, text) => (
12483
12575
  match in formatter
12484
- ? formatter[match](date, locale, __forcedYear, __forcedTimezoneOffset)
12576
+ ? formatter[ match ](date, locale, __forcedYear, __forcedTimezoneOffset)
12485
12577
  : (text === void 0 ? match : text.split('\\]').join(']'))
12486
12578
  )
12487
12579
  )
@@ -17912,7 +18004,14 @@
17912
18004
  else if (this.isDirty === false) {
17913
18005
  this.isDirty = true;
17914
18006
 
17915
- if (this.hasRules === 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
+ ) {
17916
18015
  this.debouncedValidate();
17917
18016
  }
17918
18017
  }
@@ -17926,12 +18025,15 @@
17926
18025
 
17927
18026
  computed: {
17928
18027
  hasRules () {
17929
- return this.disable !== true &&
17930
- this.rules !== void 0 &&
18028
+ return this.rules !== void 0 &&
17931
18029
  this.rules !== null &&
17932
18030
  this.rules.length > 0
17933
18031
  },
17934
18032
 
18033
+ hasActiveRules () {
18034
+ return this.disable !== true && this.hasRules === true
18035
+ },
18036
+
17935
18037
  hasError () {
17936
18038
  return this.error === true || this.innerError === true
17937
18039
  },
@@ -17969,11 +18071,11 @@
17969
18071
  * - Promise (pending async validation)
17970
18072
  */
17971
18073
  validate (val = this.value) {
17972
- if (this.hasRules !== true) {
18074
+ if (this.hasActiveRules !== true) {
17973
18075
  return true
17974
18076
  }
17975
18077
 
17976
- this.validateIndex++;
18078
+ const index = ++this.validateIndex;
17977
18079
 
17978
18080
  if (this.innerLoading !== true && this.lazyRules !== true) {
17979
18081
  this.isDirty = true;
@@ -18026,31 +18128,24 @@
18026
18128
  this.innerLoading = true;
18027
18129
  }
18028
18130
 
18029
- const index = this.validateIndex;
18030
-
18031
18131
  return Promise.all(promises).then(
18032
18132
  res => {
18033
- if (index !== this.validateIndex) {
18034
- return true
18035
- }
18036
-
18037
18133
  if (res === void 0 || Array.isArray(res) === false || res.length === 0) {
18038
- update(false);
18134
+ index === this.validateIndex && update(false);
18039
18135
  return true
18040
18136
  }
18041
18137
 
18042
18138
  const msg = res.find(r => r === false || typeof r === 'string');
18043
- update(msg !== void 0, msg);
18139
+ index === this.validateIndex && update(msg !== void 0, msg);
18044
18140
  return msg === void 0
18045
18141
  },
18046
18142
  e => {
18047
18143
  if (index === this.validateIndex) {
18048
18144
  console.error(e);
18049
18145
  update(true);
18050
- return false
18051
18146
  }
18052
18147
 
18053
- return true
18148
+ return false
18054
18149
  }
18055
18150
  )
18056
18151
  },
@@ -18065,7 +18160,7 @@
18065
18160
 
18066
18161
  __validateIfNeeded (changedRules) {
18067
18162
  if (
18068
- this.hasRules === true &&
18163
+ this.hasActiveRules === true &&
18069
18164
  this.lazyRules !== 'ondemand' &&
18070
18165
  (this.isDirty === true || (this.lazyRules !== true && changedRules !== true))
18071
18166
  ) {
@@ -19506,7 +19601,7 @@
19506
19601
  ? shouldFocus
19507
19602
  : this.noErrorFocus !== true;
19508
19603
 
19509
- this.validateIndex++;
19604
+ const index = ++this.validateIndex;
19510
19605
 
19511
19606
  const components = this.getValidationComponents().filter(c => c.disable !== true);
19512
19607
 
@@ -19522,7 +19617,7 @@
19522
19617
  promises.push(
19523
19618
  valid.then(
19524
19619
  valid => ({ valid, comp }),
19525
- error => ({ valid: false, comp, error })
19620
+ err => ({ valid: false, comp, err })
19526
19621
  )
19527
19622
  );
19528
19623
  }
@@ -19546,19 +19641,19 @@
19546
19641
  return Promise.resolve(true)
19547
19642
  }
19548
19643
 
19549
- const index = this.validateIndex;
19550
-
19551
19644
  return Promise.all(promises).then(
19552
19645
  res => {
19553
- if (index === this.validateIndex) {
19554
- const errors = res.filter(r => r.valid !== true);
19646
+ const errors = res.filter(r => r.valid !== true);
19555
19647
 
19556
- if (errors.length === 0) {
19557
- emit(true);
19558
- return true
19559
- }
19648
+ if (errors.length === 0) {
19649
+ index === this.validateIndex && emit(true);
19650
+ return true
19651
+ }
19652
+
19653
+ const { valid, comp, err } = errors[0];
19560
19654
 
19561
- const { valid, comp } = errors[0];
19655
+ if (index === this.validateIndex) {
19656
+ err !== void 0 && console.error(err);
19562
19657
 
19563
19658
  emit(false, comp);
19564
19659
 
@@ -19569,9 +19664,9 @@
19569
19664
  ) {
19570
19665
  comp.focus();
19571
19666
  }
19572
-
19573
- return false
19574
19667
  }
19668
+
19669
+ return false
19575
19670
  }
19576
19671
  )
19577
19672
  },
@@ -19587,8 +19682,11 @@
19587
19682
  submit (evt) {
19588
19683
  evt !== void 0 && stopAndPrevent(evt);
19589
19684
 
19685
+ const index = this.validateIndex + 1;
19686
+
19590
19687
  this.validate().then(val => {
19591
- if (val === true) {
19688
+ // if not outdated && validation succeeded
19689
+ if (index === this.validateIndex && val === true) {
19592
19690
  if (this.qListeners.submit !== void 0) {
19593
19691
  this.$emit('submit', evt);
19594
19692
  }
@@ -21088,6 +21186,15 @@
21088
21186
  this.autogrow === true && this.$nextTick(this.__adjustHeight);
21089
21187
  },
21090
21188
 
21189
+ // some browsers lose the native input value
21190
+ // so we need to reattach it dynamically
21191
+ // (like type="password" <-> type="text"; see #12078)
21192
+ type () {
21193
+ if (this.$refs.input) {
21194
+ this.$refs.input.value = this.value;
21195
+ }
21196
+ },
21197
+
21091
21198
  autogrow (autogrow) {
21092
21199
  // textarea only
21093
21200
  if (autogrow === true) {
@@ -22286,6 +22393,9 @@
22286
22393
  label: String,
22287
22394
  leftLabel: Boolean,
22288
22395
 
22396
+ checkedIcon: String,
22397
+ uncheckedIcon: String,
22398
+
22289
22399
  color: String,
22290
22400
  keepColor: Boolean,
22291
22401
  dense: Boolean,
@@ -22318,6 +22428,12 @@
22318
22428
  return `q-radio__inner--${this.isTrue === true ? 'truthy' : 'falsy'}${color}`
22319
22429
  },
22320
22430
 
22431
+ computedIcon () {
22432
+ return this.isTrue === true
22433
+ ? this.checkedIcon
22434
+ : this.uncheckedIcon
22435
+ },
22436
+
22321
22437
  computedTabindex () {
22322
22438
  return this.disable === true ? -1 : this.tabindex || 0
22323
22439
  },
@@ -22369,25 +22485,38 @@
22369
22485
  },
22370
22486
 
22371
22487
  render (h) {
22372
- const content = [
22373
- h('svg', {
22374
- staticClass: 'q-radio__bg absolute non-selectable',
22375
- attrs: { focusable: 'false' /* needed for IE11 */, viewBox: '0 0 24 24', 'aria-hidden': 'true' }
22376
- }, [
22377
- h('path', {
22378
- attrs: {
22379
- d: 'M12,22a10,10 0 0 1 -10,-10a10,10 0 0 1 10,-10a10,10 0 0 1 10,10a10,10 0 0 1 -10,10m0,-22a12,12 0 0 0 -12,12a12,12 0 0 0 12,12a12,12 0 0 0 12,-12a12,12 0 0 0 -12,-12'
22380
- }
22381
- }),
22488
+ const content = this.computedIcon !== void 0
22489
+ ? [
22490
+ h('div', {
22491
+ key: 'icon',
22492
+ staticClass: 'q-radio__icon-container absolute flex flex-center no-wrap'
22493
+ }, [
22494
+ h(QIcon, {
22495
+ staticClass: 'q-radio__icon',
22496
+ props: { name: this.computedIcon }
22497
+ })
22498
+ ])
22499
+ ]
22500
+ : [
22501
+ h('svg', {
22502
+ key: 'svg',
22503
+ staticClass: 'q-radio__bg absolute non-selectable',
22504
+ attrs: { focusable: 'false' /* needed for IE11 */, viewBox: '0 0 24 24', 'aria-hidden': 'true' }
22505
+ }, [
22506
+ h('path', {
22507
+ attrs: {
22508
+ d: 'M12,22a10,10 0 0 1 -10,-10a10,10 0 0 1 10,-10a10,10 0 0 1 10,10a10,10 0 0 1 -10,10m0,-22a12,12 0 0 0 -12,12a12,12 0 0 0 12,12a12,12 0 0 0 12,-12a12,12 0 0 0 -12,-12'
22509
+ }
22510
+ }),
22382
22511
 
22383
- h('path', {
22384
- staticClass: 'q-radio__check',
22385
- attrs: {
22386
- d: 'M12,6a6,6 0 0 0 -6,6a6,6 0 0 0 6,6a6,6 0 0 0 6,-6a6,6 0 0 0 -6,-6'
22387
- }
22388
- })
22389
- ])
22390
- ];
22512
+ h('path', {
22513
+ staticClass: 'q-radio__check',
22514
+ attrs: {
22515
+ d: 'M12,6a6,6 0 0 0 -6,6a6,6 0 0 0 6,6a6,6 0 0 0 6,-6a6,6 0 0 0 -6,-6'
22516
+ }
22517
+ })
22518
+ ])
22519
+ ];
22391
22520
 
22392
22521
  this.disable !== true && this.__injectFormInput(
22393
22522
  content,
@@ -22444,9 +22573,6 @@
22444
22573
 
22445
22574
  props: {
22446
22575
  icon: String,
22447
- checkedIcon: String,
22448
- uncheckedIcon: String,
22449
- indeterminateIcon: String,
22450
22576
 
22451
22577
  iconColor: String
22452
22578
  },
@@ -26554,7 +26680,7 @@
26554
26680
  const { options, optionEls } = this.__optionScopeCache;
26555
26681
 
26556
26682
  return this.options.slice(from, to).map((opt, i) => {
26557
- const disable = this.isOptionDisabled(opt) === true;
26683
+ const disable = this.isOptionDisabled(opt);
26558
26684
  const index = from + i;
26559
26685
 
26560
26686
  const itemProps = {
@@ -26652,7 +26778,8 @@
26652
26778
  // returns method to tell if an option is disabled;
26653
26779
  // takes into account 'option-disable' prop
26654
26780
  isOptionDisabled () {
26655
- return this.__getPropValueFn('optionDisable', 'disable')
26781
+ const fn = this.__getPropValueFn('optionDisable', 'disable');
26782
+ return (...args) => fn.apply(null, args) === true
26656
26783
  },
26657
26784
 
26658
26785
  inputControlEvents () {
@@ -34792,14 +34919,12 @@
34792
34919
  __onClick (node, meta, e, keyboard) {
34793
34920
  keyboard !== true && this.__blur(meta.key);
34794
34921
 
34795
- if (this.hasSelection) {
34796
- if (meta.selectable) {
34797
- if (this.noSelectionUnset === false) {
34798
- this.$emit('update:selected', meta.key !== this.selected ? meta.key : null);
34799
- }
34800
- else if (meta.key !== this.selected) {
34801
- this.$emit('update:selected', meta.key || null);
34802
- }
34922
+ if (this.hasSelection && meta.selectable) {
34923
+ if (this.noSelectionUnset === false) {
34924
+ this.$emit('update:selected', meta.key !== this.selected ? meta.key : null);
34925
+ }
34926
+ else if (meta.key !== this.selected) {
34927
+ this.$emit('update:selected', meta.key || null);
34803
34928
  }
34804
34929
  }
34805
34930
  else {
@@ -39152,7 +39277,7 @@
39152
39277
  function getAttr (seed) {
39153
39278
  return att => {
39154
39279
  const val = seed[att];
39155
- return att + (val !== void 0 ? `="${val}"` : '')
39280
+ return att + (val !== true && val !== void 0 ? `="${val}"` : '')
39156
39281
  }
39157
39282
  }
39158
39283