quasar 2.4.13 → 2.5.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 (167) hide show
  1. package/dist/api/QCheckbox.json +27 -0
  2. package/dist/api/QRadio.json +18 -0
  3. package/dist/api/QTime.json +8 -2
  4. package/dist/api/QToggle.json +24 -24
  5. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  6. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  9. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  10. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  15. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  16. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  17. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  19. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  20. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  21. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  22. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  23. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  24. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  34. package/dist/icon-set/themify.umd.prod.js +1 -1
  35. package/dist/lang/ar.umd.prod.js +1 -1
  36. package/dist/lang/az-Latn.umd.prod.js +1 -1
  37. package/dist/lang/bg.umd.prod.js +1 -1
  38. package/dist/lang/bn.umd.prod.js +1 -1
  39. package/dist/lang/ca.umd.prod.js +1 -1
  40. package/dist/lang/cs.umd.prod.js +1 -1
  41. package/dist/lang/da.umd.prod.js +1 -1
  42. package/dist/lang/de.umd.prod.js +1 -1
  43. package/dist/lang/el.umd.prod.js +1 -1
  44. package/dist/lang/en-GB.umd.prod.js +1 -1
  45. package/dist/lang/en-US.umd.prod.js +1 -1
  46. package/dist/lang/eo.umd.prod.js +1 -1
  47. package/dist/lang/es.umd.prod.js +1 -1
  48. package/dist/lang/et.umd.prod.js +1 -1
  49. package/dist/lang/fa-IR.umd.prod.js +1 -1
  50. package/dist/lang/fa.umd.prod.js +1 -1
  51. package/dist/lang/fi.umd.prod.js +1 -1
  52. package/dist/lang/fr.umd.prod.js +1 -1
  53. package/dist/lang/gn.umd.prod.js +1 -1
  54. package/dist/lang/he.umd.prod.js +1 -1
  55. package/dist/lang/hr.umd.prod.js +1 -1
  56. package/dist/lang/hu.umd.prod.js +1 -1
  57. package/dist/lang/id.umd.prod.js +1 -1
  58. package/dist/lang/is.umd.prod.js +1 -1
  59. package/dist/lang/it.umd.prod.js +1 -1
  60. package/dist/lang/ja.umd.prod.js +1 -1
  61. package/dist/lang/km.umd.prod.js +1 -1
  62. package/dist/lang/ko-KR.umd.prod.js +1 -1
  63. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  64. package/dist/lang/lt.umd.prod.js +1 -1
  65. package/dist/lang/lu.umd.prod.js +1 -1
  66. package/dist/lang/lv.umd.prod.js +1 -1
  67. package/dist/lang/ml.umd.prod.js +1 -1
  68. package/dist/lang/ms.umd.prod.js +1 -1
  69. package/dist/lang/my.umd.prod.js +1 -1
  70. package/dist/lang/nb-NO.umd.prod.js +1 -1
  71. package/dist/lang/nl.umd.prod.js +1 -1
  72. package/dist/lang/pl.umd.prod.js +1 -1
  73. package/dist/lang/pt-BR.umd.prod.js +1 -1
  74. package/dist/lang/pt.umd.prod.js +1 -1
  75. package/dist/lang/ro.umd.prod.js +1 -1
  76. package/dist/lang/ru.umd.prod.js +1 -1
  77. package/dist/lang/sk.umd.prod.js +1 -1
  78. package/dist/lang/sl.umd.prod.js +1 -1
  79. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  80. package/dist/lang/sr.umd.prod.js +1 -1
  81. package/dist/lang/sv.umd.prod.js +1 -1
  82. package/dist/lang/ta.umd.prod.js +1 -1
  83. package/dist/lang/th.umd.prod.js +1 -1
  84. package/dist/lang/tr.umd.prod.js +1 -1
  85. package/dist/lang/ug.umd.prod.js +1 -1
  86. package/dist/lang/uk.umd.prod.js +1 -1
  87. package/dist/lang/vi.umd.prod.js +1 -1
  88. package/dist/lang/zh-CN.umd.prod.js +1 -1
  89. package/dist/lang/zh-TW.umd.prod.js +1 -1
  90. package/dist/quasar.cjs.prod.js +2 -2
  91. package/dist/quasar.css +38 -10
  92. package/dist/quasar.esm.prod.js +2 -2
  93. package/dist/quasar.prod.css +1 -1
  94. package/dist/quasar.rtl.css +55 -23
  95. package/dist/quasar.rtl.prod.css +1 -1
  96. package/dist/quasar.sass +31 -11
  97. package/dist/quasar.umd.js +307 -158
  98. package/dist/quasar.umd.prod.js +2 -2
  99. package/dist/ssr-directives/Morph.js +1 -1
  100. package/dist/transforms/auto-import.json +39 -3
  101. package/dist/transforms/import-map.json +18 -0
  102. package/dist/types/index.d.ts +35 -13
  103. package/dist/types/utils/date.d.ts +25 -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 +13 -3
  108. package/src/components/avatar/__tests__/QAvatar.spec.js +121 -0
  109. package/src/components/badge/__tests__/QBadge.spec.js +74 -0
  110. package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
  111. package/src/components/btn/__tests__/QBtn.spec.js +55 -0
  112. package/src/components/btn/__tests__/use-btn.spec.js +189 -0
  113. package/src/components/checkbox/QCheckbox.js +34 -3
  114. package/src/components/checkbox/QCheckbox.json +17 -0
  115. package/src/components/checkbox/QCheckbox.sass +17 -5
  116. package/src/components/checkbox/use-checkbox.js +4 -0
  117. package/src/components/checkbox/use-checkbox.json +18 -0
  118. package/src/components/chip/__tests__/QChip.spec.js +155 -0
  119. package/src/components/date/__tests__/QDate.spec.js +189 -0
  120. package/src/components/date/__tests__/use-datetime.spec.js +83 -0
  121. package/src/components/dialog/__tests__/QDialog.spec.js +129 -0
  122. package/src/components/editor/__tests__/QEditor.spec.js +195 -0
  123. package/src/components/field/QField.sass +2 -0
  124. package/src/components/form/QForm.js +26 -24
  125. package/src/components/input/QInput.js +9 -0
  126. package/src/components/input/__tests__/QInput.spec.js +105 -0
  127. package/src/components/input/__tests__/use-mask.spec.js +29 -0
  128. package/src/components/menu/__tests__/QMenu.spec.js +610 -0
  129. package/src/components/menu/__tests__/WrapperOne.vue +51 -0
  130. package/src/components/menu/__tests__/WrapperTwo.vue +38 -0
  131. package/src/components/radio/QRadio.js +26 -1
  132. package/src/components/radio/QRadio.json +16 -0
  133. package/src/components/radio/QRadio.sass +17 -6
  134. package/src/components/select/QSelect.js +1 -1
  135. package/src/components/select/__tests__/QSelect.spec.js +2003 -0
  136. package/src/components/select/__tests__/WrapperOne.vue +28 -0
  137. package/src/components/table/__tests__/QTable.spec.js +635 -0
  138. package/src/components/table/__tests__/QTd.spec.js +35 -0
  139. package/src/components/table/__tests__/QTh.spec.js +27 -0
  140. package/src/components/table/__tests__/QTr.spec.js +27 -0
  141. package/src/components/tabs/__tests__/QRouteTab.spec.js +9 -0
  142. package/src/components/tabs/__tests__/QTab.spec.js +79 -0
  143. package/src/components/tabs/__tests__/QTabs.spec.js +147 -0
  144. package/src/components/time/QTime.json +2 -2
  145. package/src/components/toggle/QToggle.js +5 -13
  146. package/src/components/toggle/QToggle.json +3 -12
  147. package/src/components/tree/QTree.js +39 -41
  148. package/src/components/uploader/__tests__/QUploader.spec.js +161 -0
  149. package/src/composables/private/__tests__/FieldWrapper.vue +39 -0
  150. package/src/composables/private/__tests__/use-anchor.spec.js +99 -0
  151. package/src/composables/private/__tests__/use-field.spec.js +351 -0
  152. package/src/composables/private/__tests__/use-file.spec.js +69 -0
  153. package/src/composables/private/__tests__/use-form.spec.js +11 -0
  154. package/src/composables/private/__tests__/use-fullscreen.spec.js +37 -0
  155. package/src/composables/private/__tests__/use-model-toggle.spec.js +306 -0
  156. package/src/composables/private/__tests__/use-portal.spec.js +4 -0
  157. package/src/composables/private/__tests__/use-router-link.spec.js +55 -0
  158. package/src/composables/private/__tests__/use-size.spec.js +37 -0
  159. package/src/composables/private/__tests__/use-transition.spec.js +108 -0
  160. package/src/composables/private/__tests__/use-validate.spec.js +111 -0
  161. package/src/composables/private/use-fullscreen.js +1 -1
  162. package/src/composables/private/use-model-toggle.js +1 -1
  163. package/src/composables/private/use-validate.js +22 -22
  164. package/src/plugins/Meta.js +1 -1
  165. package/src/plugins/Screen.js +16 -9
  166. package/src/utils/date.js +111 -32
  167. package/src/utils/private/vm.js +14 -8
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quasar Framework v2.4.13
2
+ * Quasar Framework v2.5.3
3
3
  * (c) 2015-present Razvan Stoenescu
4
4
  * Released under the MIT License.
5
5
  */
@@ -633,12 +633,23 @@
633
633
  return
634
634
  }
635
635
 
636
+ const { visualViewport } = window;
637
+ const target = visualViewport || window;
638
+ const scrollingElement = document.scrollingElement || document.documentElement;
639
+ const getSize = visualViewport === void 0 || client.is.mobile === true
640
+ ? () => [
641
+ Math.max(window.innerWidth, scrollingElement.clientWidth),
642
+ Math.max(window.innerHeight, scrollingElement.clientHeight)
643
+ ]
644
+ : () => [
645
+ visualViewport.width * visualViewport.scale + window.innerWidth - scrollingElement.clientWidth,
646
+ visualViewport.height * visualViewport.scale + window.innerHeight - scrollingElement.clientHeight
647
+ ];
648
+
636
649
  const classes = $q.config.screen !== void 0 && $q.config.screen.bodyClasses === true;
637
650
 
638
651
  this.__update = force => {
639
- const
640
- w = window.innerWidth,
641
- h = window.innerHeight;
652
+ const [ w, h ] = getSize();
642
653
 
643
654
  if (h !== this.height) {
644
655
  this.height = h;
@@ -696,11 +707,7 @@
696
707
  };
697
708
 
698
709
  const start = () => {
699
- const
700
- style = getComputedStyle(document.body),
701
- target = window.visualViewport !== void 0
702
- ? window.visualViewport
703
- : window;
710
+ const style = getComputedStyle(document.body);
704
711
 
705
712
  // if css props available
706
713
  if (style.getPropertyValue('--q-size-sm')) {
@@ -1456,7 +1463,7 @@
1456
1463
  }
1457
1464
 
1458
1465
  var installQuasar = function (parentApp, opts = {}) {
1459
- const $q = { version: '2.4.13' };
1466
+ const $q = { version: '2.5.3' };
1460
1467
 
1461
1468
  if (globalConfigIsFrozen === false) {
1462
1469
  if (opts.config !== void 0) {
@@ -2335,19 +2342,25 @@
2335
2342
  }
2336
2343
  }
2337
2344
 
2345
+ function fillNormalizedVNodes (children, vnode) {
2346
+ if (typeof vnode.type === 'symbol') {
2347
+ if (Array.isArray(vnode.children) === true) {
2348
+ vnode.children.forEach(child => {
2349
+ fillNormalizedVNodes(children, child);
2350
+ });
2351
+ }
2352
+ }
2353
+ else {
2354
+ children.add(vnode);
2355
+ }
2356
+ }
2357
+
2338
2358
  // vnodes from rendered in advanced slots
2339
2359
  function getNormalizedVNodes (vnodes) {
2340
2360
  const children = new Set();
2341
2361
 
2342
2362
  vnodes.forEach(vnode => {
2343
- if (typeof vnode.type === 'symbol' && Array.isArray(vnode.children) === true) {
2344
- vnode.children.forEach(child => {
2345
- children.add(child);
2346
- });
2347
- }
2348
- else {
2349
- children.add(vnode);
2350
- }
2363
+ fillNormalizedVNodes(children, vnode);
2351
2364
  });
2352
2365
 
2353
2366
  return Array.from(children)
@@ -2398,7 +2411,7 @@
2398
2411
  hSlot(slots.default)
2399
2412
  );
2400
2413
 
2401
- if (vnodes === void 0) { return }
2414
+ if (vnodes.length === 0) { return }
2402
2415
 
2403
2416
  let els = 1;
2404
2417
 
@@ -4059,7 +4072,7 @@
4059
4072
  vue.watch(() => props.modelValue, processModelChange);
4060
4073
 
4061
4074
  if (hideOnRouteChange !== void 0 && vmHasRouter(vm) === true) {
4062
- vue.watch(() => proxy.$route, () => {
4075
+ vue.watch(() => proxy.$route.fullPath, () => {
4063
4076
  if (hideOnRouteChange.value === true && showing.value === true) {
4064
4077
  hide();
4065
4078
  }
@@ -6414,7 +6427,7 @@
6414
6427
  let historyEntry, fullscreenFillerNode, container;
6415
6428
  const inFullscreen = vue.ref(false);
6416
6429
 
6417
- vmHasRouter(vm) === true && vue.watch(() => proxy.$route, () => {
6430
+ vmHasRouter(vm) === true && vue.watch(() => proxy.$route.fullPath, () => {
6418
6431
  props.noRouteFullscreenExit !== true && exitFullscreen();
6419
6432
  });
6420
6433
 
@@ -7171,6 +7184,10 @@
7171
7184
  falseValue: { default: false },
7172
7185
  indeterminateValue: { default: null },
7173
7186
 
7187
+ checkedIcon: String,
7188
+ uncheckedIcon: String,
7189
+ indeterminateIcon: String,
7190
+
7174
7191
  toggleOrder: {
7175
7192
  type: String,
7176
7193
  validator: v => v === 'tf' || v === 'ft'
@@ -7383,6 +7400,7 @@
7383
7400
  }
7384
7401
 
7385
7402
  const bgNode = vue.h('div', {
7403
+ key: 'svg',
7386
7404
  class: 'q-checkbox__bg absolute'
7387
7405
  }, [
7388
7406
  vue.h('svg', {
@@ -7409,8 +7427,36 @@
7409
7427
  props: useCheckboxProps,
7410
7428
  emits: useCheckboxEmits,
7411
7429
 
7412
- setup () {
7413
- return useCheckbox('checkbox', () => () => [ bgNode ])
7430
+ setup (props) {
7431
+ function getInner (isTrue, isIndeterminate) {
7432
+ const icon = vue.computed(() =>
7433
+ (isTrue.value === true
7434
+ ? props.checkedIcon
7435
+ : (isIndeterminate.value === true
7436
+ ? props.indeterminateIcon
7437
+ : props.uncheckedIcon
7438
+ )
7439
+ ) || null
7440
+ );
7441
+
7442
+ return () => (
7443
+ icon.value !== null
7444
+ ? [
7445
+ vue.h('div', {
7446
+ key: 'icon',
7447
+ class: 'q-checkbox__icon-container absolute flex flex-center no-wrap'
7448
+ }, [
7449
+ vue.h(QIcon, {
7450
+ class: 'q-checkbox__icon',
7451
+ name: icon.value
7452
+ })
7453
+ ])
7454
+ ]
7455
+ : [ bgNode ]
7456
+ )
7457
+ }
7458
+
7459
+ return useCheckbox('checkbox', getInner)
7414
7460
  }
7415
7461
  });
7416
7462
 
@@ -11737,19 +11783,18 @@
11737
11783
  function applyYearMonthDayChange (date, mod, sign) {
11738
11784
  let
11739
11785
  year = date.getFullYear(),
11740
- month = date.getMonth(),
11741
- day = date.getDate();
11786
+ month = date.getMonth();
11742
11787
 
11743
- if (mod.years !== void 0) {
11744
- year += sign * mod.years;
11745
- }
11788
+ const day = date.getDate();
11746
11789
 
11747
- if (mod.months !== void 0) {
11748
- month += sign * mod.months;
11790
+ if (mod.year !== void 0) {
11791
+ year += sign * mod.year;
11792
+ delete mod.year;
11749
11793
  }
11750
11794
 
11751
- if (mod.days !== void 0) {
11752
- day += sign * mod.days;
11795
+ if (mod.month !== void 0) {
11796
+ month += sign * mod.month;
11797
+ delete mod.month;
11753
11798
  }
11754
11799
 
11755
11800
  date.setDate(1);
@@ -11757,26 +11802,14 @@
11757
11802
 
11758
11803
  date.setFullYear(year);
11759
11804
  date.setMonth(month);
11760
- date.setDate(day);
11761
-
11762
- return date
11763
- }
11764
-
11765
- function getChange (date, mod, sign) {
11766
- const
11767
- d = new Date(date),
11768
- t = mod.years !== void 0 || mod.months !== void 0 || mod.days !== void 0
11769
- ? applyYearMonthDayChange(d, mod, sign)
11770
- : d;
11805
+ date.setDate(Math.min(day, daysInMonth(date)));
11771
11806
 
11772
- for (const key in mod) {
11773
- if (key !== 'years' && key !== 'months' && key !== 'days') {
11774
- const op = capitalize(key);
11775
- t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ]);
11776
- }
11807
+ if (mod.date !== void 0) {
11808
+ date.setDate(date.getDate() + sign * mod.date);
11809
+ delete mod.date;
11777
11810
  }
11778
11811
 
11779
- return t
11812
+ return date
11780
11813
  }
11781
11814
 
11782
11815
  function applyYearMonthDay (date, mod, middle) {
@@ -11793,22 +11826,86 @@
11793
11826
  date[ `set${ middle }Month` ](month);
11794
11827
  date[ `set${ middle }Date` ](day);
11795
11828
 
11829
+ delete mod.year;
11830
+ delete mod.month;
11831
+ delete mod.date;
11832
+
11796
11833
  return date
11797
11834
  }
11798
11835
 
11799
- function adjustDate (date, mod, utc) {
11836
+ function getChange (date, rawMod, sign) {
11800
11837
  const
11838
+ mod = normalizeMod(rawMod),
11839
+ d = new Date(date),
11840
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
11841
+ ? applyYearMonthDayChange(d, mod, sign) // removes year/month/day
11842
+ : d;
11843
+
11844
+ for (const key in mod) {
11845
+ const op = capitalize(key);
11846
+ t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ]);
11847
+ }
11848
+
11849
+ return t
11850
+ }
11851
+
11852
+ function normalizeMod (mod) {
11853
+ const acc = { ...mod };
11854
+
11855
+ if (mod.years !== void 0) {
11856
+ acc.year = mod.years;
11857
+ delete acc.years;
11858
+ }
11859
+
11860
+ if (mod.months !== void 0) {
11861
+ acc.month = mod.months;
11862
+ delete acc.months;
11863
+ }
11864
+
11865
+ if (mod.days !== void 0) {
11866
+ acc.date = mod.days;
11867
+ delete acc.days;
11868
+ }
11869
+ if (mod.day !== void 0) {
11870
+ acc.date = mod.day;
11871
+ delete acc.day;
11872
+ }
11873
+
11874
+ if (mod.hour !== void 0) {
11875
+ acc.hours = mod.hour;
11876
+ delete acc.hour;
11877
+ }
11878
+
11879
+ if (mod.minute !== void 0) {
11880
+ acc.minutes = mod.minute;
11881
+ delete acc.minute;
11882
+ }
11883
+
11884
+ if (mod.second !== void 0) {
11885
+ acc.seconds = mod.second;
11886
+ delete acc.second;
11887
+ }
11888
+
11889
+ if (mod.millisecond !== void 0) {
11890
+ acc.milliseconds = mod.millisecond;
11891
+ delete acc.millisecond;
11892
+ }
11893
+
11894
+ return acc
11895
+ }
11896
+
11897
+ function adjustDate (date, rawMod, utc) {
11898
+ const
11899
+ mod = normalizeMod(rawMod),
11801
11900
  middle = utc === true ? 'UTC' : '',
11802
11901
  d = new Date(date),
11803
11902
  t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
11804
- ? applyYearMonthDay(d, mod, middle)
11903
+ ? applyYearMonthDay(d, mod, middle) // removes year/month/day
11805
11904
  : d;
11806
11905
 
11807
11906
  for (const key in mod) {
11808
- if (key !== 'year' && key !== 'month' && key !== 'date') {
11809
- const op = key.charAt(0).toUpperCase() + key.slice(1);
11810
- t[ `set${ middle }${ op }` ](mod[ key ]);
11811
- }
11907
+ const op = key.charAt(0).toUpperCase() + key.slice(1);
11908
+ t[ `set${ middle }${ op }` ](mod[ key ]);
11812
11909
  }
11813
11910
 
11814
11911
  return t
@@ -12042,16 +12139,23 @@
12042
12139
 
12043
12140
  switch (unit) {
12044
12141
  case 'year':
12142
+ case 'years':
12045
12143
  t[ `${ prefix }Month` ](0);
12046
12144
  case 'month':
12145
+ case 'months':
12047
12146
  t[ `${ prefix }Date` ](1);
12048
12147
  case 'day':
12148
+ case 'days':
12149
+ case 'date':
12049
12150
  t[ `${ prefix }Hours` ](0);
12050
12151
  case 'hour':
12152
+ case 'hours':
12051
12153
  t[ `${ prefix }Minutes` ](0);
12052
12154
  case 'minute':
12155
+ case 'minutes':
12053
12156
  t[ `${ prefix }Seconds` ](0);
12054
12157
  case 'second':
12158
+ case 'seconds':
12055
12159
  t[ `${ prefix }Milliseconds` ](0);
12056
12160
  }
12057
12161
  return t
@@ -12064,16 +12168,23 @@
12064
12168
 
12065
12169
  switch (unit) {
12066
12170
  case 'year':
12171
+ case 'years':
12067
12172
  t[ `${ prefix }Month` ](11);
12068
12173
  case 'month':
12174
+ case 'months':
12069
12175
  t[ `${ prefix }Date` ](daysInMonth(t));
12070
12176
  case 'day':
12177
+ case 'days':
12178
+ case 'date':
12071
12179
  t[ `${ prefix }Hours` ](23);
12072
12180
  case 'hour':
12181
+ case 'hours':
12073
12182
  t[ `${ prefix }Minutes` ](59);
12074
12183
  case 'minute':
12184
+ case 'minutes':
12075
12185
  t[ `${ prefix }Seconds` ](59);
12076
12186
  case 'second':
12187
+ case 'seconds':
12077
12188
  t[ `${ prefix }Milliseconds` ](999);
12078
12189
  }
12079
12190
  return t
@@ -12109,21 +12220,28 @@
12109
12220
 
12110
12221
  switch (unit) {
12111
12222
  case 'years':
12223
+ case 'year':
12112
12224
  return (t.getFullYear() - sub.getFullYear())
12113
12225
 
12114
12226
  case 'months':
12227
+ case 'month':
12115
12228
  return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
12116
12229
 
12117
12230
  case 'days':
12231
+ case 'day':
12232
+ case 'date':
12118
12233
  return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
12119
12234
 
12120
12235
  case 'hours':
12236
+ case 'hour':
12121
12237
  return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
12122
12238
 
12123
12239
  case 'minutes':
12240
+ case 'minute':
12124
12241
  return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
12125
12242
 
12126
12243
  case 'seconds':
12244
+ case 'second':
12127
12245
  return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
12128
12246
  }
12129
12247
  }
@@ -12169,26 +12287,33 @@
12169
12287
 
12170
12288
  switch (unit) {
12171
12289
  case 'second':
12290
+ case 'seconds':
12172
12291
  if (t.getSeconds() !== d.getSeconds()) {
12173
12292
  return false
12174
12293
  }
12175
12294
  case 'minute': // intentional fall-through
12295
+ case 'minutes':
12176
12296
  if (t.getMinutes() !== d.getMinutes()) {
12177
12297
  return false
12178
12298
  }
12179
12299
  case 'hour': // intentional fall-through
12300
+ case 'hours':
12180
12301
  if (t.getHours() !== d.getHours()) {
12181
12302
  return false
12182
12303
  }
12183
12304
  case 'day': // intentional fall-through
12305
+ case 'days':
12306
+ case 'date':
12184
12307
  if (t.getDate() !== d.getDate()) {
12185
12308
  return false
12186
12309
  }
12187
12310
  case 'month': // intentional fall-through
12311
+ case 'months':
12188
12312
  if (t.getMonth() !== d.getMonth()) {
12189
12313
  return false
12190
12314
  }
12191
12315
  case 'year': // intentional fall-through
12316
+ case 'years':
12192
12317
  if (t.getFullYear() !== d.getFullYear()) {
12193
12318
  return false
12194
12319
  }
@@ -20218,12 +20343,16 @@
20218
20343
  let validateIndex = 0, unwatchRules;
20219
20344
 
20220
20345
  const hasRules = vue.computed(() =>
20221
- props.disable !== true
20222
- && props.rules !== void 0
20346
+ props.rules !== void 0
20223
20347
  && props.rules !== null
20224
20348
  && props.rules.length > 0
20225
20349
  );
20226
20350
 
20351
+ const hasActiveRules = vue.computed(() =>
20352
+ props.disable !== true
20353
+ && hasRules.value === true
20354
+ );
20355
+
20227
20356
  const hasError = vue.computed(() =>
20228
20357
  props.error === true || innerError.value === true
20229
20358
  );
@@ -20261,7 +20390,14 @@
20261
20390
  else if (isDirtyModel.value === false) {
20262
20391
  isDirtyModel.value = true;
20263
20392
 
20264
- if (hasRules.value === true && props.lazyRules !== 'ondemand') {
20393
+ if (
20394
+ hasActiveRules.value === true
20395
+ && props.lazyRules !== 'ondemand'
20396
+ // Don't re-trigger if it's already in progress;
20397
+ // It might mean that focus switched to submit btn and
20398
+ // QForm's submit() has been called already (ENTER key)
20399
+ && innerLoading.value === false
20400
+ ) {
20265
20401
  debouncedValidate();
20266
20402
  }
20267
20403
  }
@@ -20283,11 +20419,11 @@
20283
20419
  * - Promise (pending async validation)
20284
20420
  */
20285
20421
  function validate (val = props.modelValue) {
20286
- if (hasRules.value !== true) {
20422
+ if (hasActiveRules.value !== true) {
20287
20423
  return true
20288
20424
  }
20289
20425
 
20290
- validateIndex++;
20426
+ const index = ++validateIndex;
20291
20427
 
20292
20428
  if (innerLoading.value !== true && props.lazyRules !== true) {
20293
20429
  isDirtyModel.value = true;
@@ -20304,9 +20440,7 @@
20304
20440
  innerErrorMessage.value = m;
20305
20441
  }
20306
20442
 
20307
- if (innerLoading.value !== false) {
20308
- innerLoading.value = false;
20309
- }
20443
+ innerLoading.value = false;
20310
20444
  };
20311
20445
 
20312
20446
  const promises = [];
@@ -20336,42 +20470,33 @@
20336
20470
  return true
20337
20471
  }
20338
20472
 
20339
- if (innerLoading.value !== true) {
20340
- innerLoading.value = true;
20341
- }
20342
-
20343
- const index = validateIndex;
20473
+ innerLoading.value = true;
20344
20474
 
20345
20475
  return Promise.all(promises).then(
20346
20476
  res => {
20347
- if (index !== validateIndex) {
20348
- return true
20349
- }
20350
-
20351
20477
  if (res === void 0 || Array.isArray(res) === false || res.length === 0) {
20352
- update(false);
20478
+ index === validateIndex && update(false);
20353
20479
  return true
20354
20480
  }
20355
20481
 
20356
20482
  const msg = res.find(r => r === false || typeof r === 'string');
20357
- update(msg !== void 0, msg);
20483
+ index === validateIndex && update(msg !== void 0, msg);
20358
20484
  return msg === void 0
20359
20485
  },
20360
20486
  e => {
20361
20487
  if (index === validateIndex) {
20362
20488
  console.error(e);
20363
20489
  update(true);
20364
- return false
20365
20490
  }
20366
20491
 
20367
- return true
20492
+ return false
20368
20493
  }
20369
20494
  )
20370
20495
  }
20371
20496
 
20372
20497
  function validateIfNeeded (changedRules) {
20373
20498
  if (
20374
- hasRules.value === true
20499
+ hasActiveRules.value === true
20375
20500
  && props.lazyRules !== 'ondemand'
20376
20501
  && (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
20377
20502
  ) {
@@ -21524,7 +21649,7 @@
21524
21649
  ? shouldFocus
21525
21650
  : props.noErrorFocus !== true;
21526
21651
 
21527
- validateIndex++;
21652
+ const index = ++validateIndex;
21528
21653
 
21529
21654
  const emitEvent = (res, ref) => {
21530
21655
  emit('validation-' + (res === true ? 'success' : 'error'), ref);
@@ -21538,7 +21663,7 @@
21538
21663
  promises.push(
21539
21664
  valid.then(
21540
21665
  valid => ({ valid, comp }),
21541
- error => ({ valid: false, comp, error })
21666
+ err => ({ valid: false, comp, err })
21542
21667
  )
21543
21668
  );
21544
21669
  }
@@ -21562,34 +21687,33 @@
21562
21687
  return Promise.resolve(true)
21563
21688
  }
21564
21689
 
21565
- const index = validateIndex;
21690
+ return Promise.all(promises).then(res => {
21691
+ const errors = res.filter(r => r.valid !== true);
21566
21692
 
21567
- return Promise.all(promises).then(
21568
- res => {
21569
- if (index === validateIndex) {
21570
- const errors = res.filter(r => r.valid !== true);
21571
-
21572
- if (errors.length === 0) {
21573
- emitEvent(true);
21574
- return true
21575
- }
21693
+ if (errors.length === 0) {
21694
+ index === validateIndex && emitEvent(true);
21695
+ return true
21696
+ }
21576
21697
 
21577
- const { valid, comp } = errors[ 0 ];
21698
+ const { valid, comp, err } = errors[ 0 ];
21578
21699
 
21579
- emitEvent(false, comp);
21700
+ // if not outdated already
21701
+ if (index === validateIndex) {
21702
+ err !== void 0 && console.error(err);
21580
21703
 
21581
- if (
21582
- focus === true
21583
- && valid !== true
21584
- && typeof comp.focus === 'function'
21585
- ) {
21586
- comp.focus();
21587
- }
21704
+ emitEvent(false, comp);
21588
21705
 
21589
- return false
21706
+ if (
21707
+ focus === true
21708
+ && valid !== true
21709
+ && typeof comp.focus === 'function'
21710
+ ) {
21711
+ comp.focus();
21590
21712
  }
21591
21713
  }
21592
- )
21714
+
21715
+ return false
21716
+ })
21593
21717
  }
21594
21718
 
21595
21719
  function resetValidation () {
@@ -21603,8 +21727,11 @@
21603
21727
  function submit (evt) {
21604
21728
  evt !== void 0 && stopAndPrevent(evt);
21605
21729
 
21730
+ const index = validateIndex + 1;
21731
+
21606
21732
  validate().then(val => {
21607
- if (val === true) {
21733
+ // if not outdated && validation succeeded
21734
+ if (index === validateIndex && val === true) {
21608
21735
  if (props.onSubmit !== void 0) {
21609
21736
  emit('submit', evt);
21610
21737
  }
@@ -23167,6 +23294,15 @@
23167
23294
  return attrs
23168
23295
  });
23169
23296
 
23297
+ // some browsers lose the native input value
23298
+ // so we need to reattach it dynamically
23299
+ // (like type="password" <-> type="text"; see #12078)
23300
+ vue.watch(() => props.type, () => {
23301
+ if (inputRef.value) {
23302
+ inputRef.value.value = props.modelValue;
23303
+ }
23304
+ });
23305
+
23170
23306
  vue.watch(() => props.modelValue, v => {
23171
23307
  if (hasMask.value === true) {
23172
23308
  if (stopValueWatcher === true) {
@@ -24386,6 +24522,7 @@
24386
24522
  });
24387
24523
 
24388
24524
  const svg$m = vue.h('svg', {
24525
+ key: 'svg',
24389
24526
  class: 'q-radio__bg absolute non-selectable',
24390
24527
  viewBox: '0 0 24 24',
24391
24528
  'aria-hidden': 'true'
@@ -24414,6 +24551,9 @@
24414
24551
  label: String,
24415
24552
  leftLabel: Boolean,
24416
24553
 
24554
+ checkedIcon: String,
24555
+ uncheckedIcon: String,
24556
+
24417
24557
  color: String,
24418
24558
  keepColor: Boolean,
24419
24559
  dense: Boolean,
@@ -24455,6 +24595,13 @@
24455
24595
  + `q-radio__inner--${ isTrue.value === true ? 'truthy' : 'falsy' }${ color }`
24456
24596
  });
24457
24597
 
24598
+ const icon = vue.computed(() =>
24599
+ (isTrue.value === true
24600
+ ? props.checkedIcon
24601
+ : props.uncheckedIcon
24602
+ ) || null
24603
+ );
24604
+
24458
24605
  const tabindex = vue.computed(() => (
24459
24606
  props.disable === true ? -1 : props.tabindex || 0
24460
24607
  ));
@@ -24500,7 +24647,19 @@
24500
24647
  Object.assign(proxy, { set: onClick });
24501
24648
 
24502
24649
  return () => {
24503
- const content = [ svg$m ];
24650
+ const content = icon.value !== null
24651
+ ? [
24652
+ vue.h('div', {
24653
+ key: 'icon',
24654
+ class: 'q-radio__icon-container absolute flex flex-center no-wrap'
24655
+ }, [
24656
+ vue.h(QIcon, {
24657
+ class: 'q-radio__icon',
24658
+ name: icon.value
24659
+ })
24660
+ ])
24661
+ ]
24662
+ : [ svg$m ];
24504
24663
 
24505
24664
  props.disable !== true && injectFormInput(
24506
24665
  content,
@@ -24552,10 +24711,6 @@
24552
24711
  ...useCheckboxProps,
24553
24712
 
24554
24713
  icon: String,
24555
- checkedIcon: String,
24556
- uncheckedIcon: String,
24557
- indeterminateIcon: String,
24558
-
24559
24714
  iconColor: String
24560
24715
  },
24561
24716
 
@@ -24563,29 +24718,25 @@
24563
24718
 
24564
24719
  setup (props) {
24565
24720
  function getInner (isTrue, isIndeterminate) {
24566
- const computedIcon = vue.computed(() =>
24721
+ const icon = vue.computed(() =>
24567
24722
  (isTrue.value === true
24568
24723
  ? props.checkedIcon
24569
24724
  : (isIndeterminate.value === true ? props.indeterminateIcon : props.uncheckedIcon)
24570
24725
  ) || props.icon
24571
24726
  );
24572
24727
 
24573
- const computedIconColor = vue.computed(() => {
24574
- if (isTrue.value === true) {
24575
- return props.iconColor
24576
- }
24577
- });
24728
+ const color = vue.computed(() => (isTrue.value === true ? props.iconColor : null));
24578
24729
 
24579
24730
  return () => [
24580
24731
  vue.h('div', { class: 'q-toggle__track' }),
24581
24732
 
24582
24733
  vue.h('div', {
24583
24734
  class: 'q-toggle__thumb absolute flex flex-center no-wrap'
24584
- }, computedIcon.value !== void 0
24735
+ }, icon.value !== void 0
24585
24736
  ? [
24586
24737
  vue.h(QIcon, {
24587
- name: computedIcon.value,
24588
- color: computedIconColor.value
24738
+ name: icon.value,
24739
+ color: color.value
24589
24740
  })
24590
24741
  ]
24591
24742
  : void 0
@@ -29352,7 +29503,7 @@
29352
29503
  filter, updateMenuPosition, updateInputValue,
29353
29504
  isOptionSelected,
29354
29505
  getEmittingOptionValue,
29355
- isOptionDisabled: (...args) => isOptionDisabled.value.apply(null, args),
29506
+ isOptionDisabled: (...args) => isOptionDisabled.value.apply(null, args) === true,
29356
29507
  getOptionValue: (...args) => getOptionValue.value.apply(null, args),
29357
29508
  getOptionLabel: (...args) => getOptionLabel.value.apply(null, args)
29358
29509
  });
@@ -35906,34 +36057,34 @@
35906
36057
 
35907
36058
  m.lazy === 'loading'
35908
36059
  ? vue.h(QSpinner, {
35909
- class: 'q-tree__spinner',
35910
- color: computedControlColor.value
35911
- })
36060
+ class: 'q-tree__spinner',
36061
+ color: computedControlColor.value
36062
+ })
35912
36063
  : (
35913
36064
  isParent === true
35914
36065
  ? vue.h(QIcon, {
35915
- class: 'q-tree__arrow'
36066
+ class: 'q-tree__arrow'
35916
36067
  + (m.expanded === true ? ' q-tree__arrow--rotate' : ''),
35917
- name: computedIcon.value,
35918
- onClick (e) { onExpandClick(node, m, e); }
35919
- })
36068
+ name: computedIcon.value,
36069
+ onClick (e) { onExpandClick(node, m, e); }
36070
+ })
35920
36071
  : null
35921
36072
  ),
35922
36073
 
35923
36074
  m.hasTicking === true && m.noTick !== true
35924
36075
  ? vue.h(QCheckbox, {
35925
- class: 'q-tree__tickbox',
35926
- modelValue: m.indeterminate === true ? null : m.ticked,
35927
- color: computedControlColor.value,
35928
- dark: isDark.value,
35929
- dense: true,
35930
- keepColor: true,
35931
- disable: m.tickable !== true,
35932
- onKeydown: stopAndPrevent,
35933
- 'onUpdate:modelValue': v => {
35934
- onTickedClick(m, v);
35935
- }
35936
- })
36076
+ class: 'q-tree__tickbox',
36077
+ modelValue: m.indeterminate === true ? null : m.ticked,
36078
+ color: computedControlColor.value,
36079
+ dark: isDark.value,
36080
+ dense: true,
36081
+ keepColor: true,
36082
+ disable: m.tickable !== true,
36083
+ onKeydown: stopAndPrevent,
36084
+ 'onUpdate:modelValue': v => {
36085
+ onTickedClick(m, v);
36086
+ }
36087
+ })
35937
36088
  : null,
35938
36089
 
35939
36090
  vue.h('div', {
@@ -35951,22 +36102,22 @@
35951
36102
 
35952
36103
  isParent === true
35953
36104
  ? vue.h(QSlideTransition, {
35954
- duration: props.duration,
35955
- onShow,
35956
- onHide
35957
- }, () => vue.withDirectives(
36105
+ duration: props.duration,
36106
+ onShow,
36107
+ onHide
36108
+ }, () => vue.withDirectives(
36109
+ vue.h('div', {
36110
+ class: 'q-tree__node-collapsible' + textColorClass.value,
36111
+ key: `${ key }__q`
36112
+ }, [
36113
+ body,
35958
36114
  vue.h('div', {
35959
- class: 'q-tree__node-collapsible' + textColorClass.value,
35960
- key: `${ key }__q`
35961
- }, [
35962
- body,
35963
- vue.h('div', {
35964
- class: 'q-tree__children'
36115
+ class: 'q-tree__children'
35965
36116
  + (m.disabled === true ? ' q-tree__node--disabled' : '')
35966
- }, children)
35967
- ]),
35968
- [ [ vue.vShow, m.expanded ] ]
35969
- ))
36117
+ }, children)
36118
+ ]),
36119
+ [ [ vue.vShow, m.expanded ] ]
36120
+ ))
35970
36121
  : body
35971
36122
  ])
35972
36123
  }
@@ -35979,14 +36130,12 @@
35979
36130
  function onClick (node, meta, e, keyboard) {
35980
36131
  keyboard !== true && blur(meta.key);
35981
36132
 
35982
- if (hasSelection.value) {
35983
- if (meta.selectable) {
35984
- if (props.noSelectionUnset === false) {
35985
- emit('update:selected', meta.key !== props.selected ? meta.key : null);
35986
- }
35987
- else if (meta.key !== props.selected) {
35988
- emit('update:selected', meta.key || null);
35989
- }
36133
+ if (hasSelection.value && meta.selectable) {
36134
+ if (props.noSelectionUnset === false) {
36135
+ emit('update:selected', meta.key !== props.selected ? meta.key : null);
36136
+ }
36137
+ else if (meta.key !== props.selected) {
36138
+ emit('update:selected', meta.key || null);
35990
36139
  }
35991
36140
  }
35992
36141
  else {
@@ -39369,7 +39518,7 @@
39369
39518
  });
39370
39519
 
39371
39520
  var index_umd = {
39372
- version: '2.4.13',
39521
+ version: '2.5.3',
39373
39522
  install (app, opts) {
39374
39523
  installQuasar(app, {
39375
39524
  components,