quasar 1.17.7 → 1.18.2

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