quasar 2.4.10 → 2.5.0

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 (228) hide show
  1. package/dist/api/BottomSheet.json +4 -0
  2. package/dist/api/Dialog.json +5 -1
  3. package/dist/api/LoadingBar.json +7 -0
  4. package/dist/api/Notify.json +20 -10
  5. package/dist/api/Platform.json +171 -0
  6. package/dist/api/QAjaxBar.json +13 -1
  7. package/dist/api/QBtnDropdown.json +4 -2
  8. package/dist/api/QCheckbox.json +27 -0
  9. package/dist/api/QEditor.json +4 -2
  10. package/dist/api/QExpansionItem.json +6 -3
  11. package/dist/api/QFab.json +4 -2
  12. package/dist/api/QFabAction.json +4 -2
  13. package/dist/api/QFile.json +4 -2
  14. package/dist/api/QImg.json +1 -2
  15. package/dist/api/QInnerLoading.json +2 -1
  16. package/dist/api/QInput.json +4 -2
  17. package/dist/api/QPagination.json +4 -2
  18. package/dist/api/QRadio.json +18 -0
  19. package/dist/api/QRange.json +9 -0
  20. package/dist/api/QScrollArea.json +13 -5
  21. package/dist/api/QSelect.json +6 -3
  22. package/dist/api/QSlider.json +9 -0
  23. package/dist/api/QSplitter.json +8 -4
  24. package/dist/api/QTable.json +9 -0
  25. package/dist/api/QTime.json +8 -2
  26. package/dist/api/QToggle.json +24 -24
  27. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  28. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  29. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  30. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  31. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  32. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  33. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  34. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  35. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  36. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  37. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  38. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  39. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  40. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  44. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  45. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  46. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  47. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  48. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  49. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  50. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  51. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  52. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  53. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  54. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  55. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  56. package/dist/icon-set/themify.umd.prod.js +1 -1
  57. package/dist/lang/ar.umd.prod.js +1 -1
  58. package/dist/lang/az-Latn.umd.prod.js +1 -1
  59. package/dist/lang/bg.umd.prod.js +1 -1
  60. package/dist/lang/bn.umd.prod.js +1 -1
  61. package/dist/lang/ca.umd.prod.js +1 -1
  62. package/dist/lang/cs.umd.prod.js +1 -1
  63. package/dist/lang/da.umd.prod.js +1 -1
  64. package/dist/lang/de.umd.prod.js +1 -1
  65. package/dist/lang/el.umd.prod.js +1 -1
  66. package/dist/lang/en-GB.umd.prod.js +1 -1
  67. package/dist/lang/en-US.umd.prod.js +1 -1
  68. package/dist/lang/eo.umd.prod.js +1 -1
  69. package/dist/lang/es.umd.prod.js +1 -1
  70. package/dist/lang/et.umd.prod.js +1 -1
  71. package/dist/lang/fa-IR.umd.prod.js +1 -1
  72. package/dist/lang/fa.umd.prod.js +1 -1
  73. package/dist/lang/fi.umd.prod.js +1 -1
  74. package/dist/lang/fr.umd.prod.js +1 -1
  75. package/dist/lang/gn.umd.prod.js +1 -1
  76. package/dist/lang/he.umd.prod.js +1 -1
  77. package/dist/lang/hr.umd.prod.js +1 -1
  78. package/dist/lang/hu.umd.prod.js +1 -1
  79. package/dist/lang/id.umd.prod.js +1 -1
  80. package/dist/lang/is.umd.prod.js +1 -1
  81. package/dist/lang/it.umd.prod.js +1 -1
  82. package/dist/lang/ja.umd.prod.js +1 -1
  83. package/dist/lang/km.umd.prod.js +1 -1
  84. package/dist/lang/ko-KR.umd.prod.js +1 -1
  85. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  86. package/dist/lang/lt.umd.prod.js +1 -1
  87. package/dist/lang/lu.umd.prod.js +1 -1
  88. package/dist/lang/lv.umd.prod.js +1 -1
  89. package/dist/lang/ml.umd.prod.js +1 -1
  90. package/dist/lang/ms.umd.prod.js +1 -1
  91. package/dist/lang/my.umd.prod.js +1 -1
  92. package/dist/lang/nb-NO.umd.prod.js +1 -1
  93. package/dist/lang/nl.umd.prod.js +1 -1
  94. package/dist/lang/pl.umd.prod.js +1 -1
  95. package/dist/lang/pt-BR.umd.prod.js +1 -1
  96. package/dist/lang/pt.umd.prod.js +1 -1
  97. package/dist/lang/ro.umd.prod.js +1 -1
  98. package/dist/lang/ru.umd.prod.js +1 -1
  99. package/dist/lang/sk.umd.prod.js +1 -1
  100. package/dist/lang/sl.umd.prod.js +1 -1
  101. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  102. package/dist/lang/sr.umd.prod.js +1 -1
  103. package/dist/lang/sv.umd.prod.js +1 -1
  104. package/dist/lang/ta.umd.prod.js +1 -1
  105. package/dist/lang/th.umd.prod.js +1 -1
  106. package/dist/lang/tr.umd.prod.js +1 -1
  107. package/dist/lang/ug.umd.prod.js +1 -1
  108. package/dist/lang/uk.umd.prod.js +1 -1
  109. package/dist/lang/vi.umd.prod.js +1 -1
  110. package/dist/lang/zh-CN.umd.prod.js +1 -1
  111. package/dist/lang/zh-TW.umd.prod.js +1 -1
  112. package/dist/quasar.cjs.prod.js +2 -2
  113. package/dist/quasar.css +39 -10
  114. package/dist/quasar.esm.prod.js +2 -2
  115. package/dist/quasar.prod.css +1 -1
  116. package/dist/quasar.rtl.css +56 -23
  117. package/dist/quasar.rtl.prod.css +1 -1
  118. package/dist/quasar.sass +32 -11
  119. package/dist/quasar.umd.js +276 -118
  120. package/dist/quasar.umd.prod.js +2 -2
  121. package/dist/ssr-directives/Morph.js +1 -1
  122. package/dist/transforms/auto-import.json +39 -3
  123. package/dist/transforms/import-map.json +18 -0
  124. package/dist/types/api/slider.d.ts +6 -7
  125. package/dist/types/api/validation.d.ts +1 -1
  126. package/dist/types/api/vue-prop-types.ts +15 -0
  127. package/dist/types/api.d.ts +1 -0
  128. package/dist/types/index.d.ts +246 -188
  129. package/dist/types/utils/dom.d.ts +4 -2
  130. package/dist/types/utils.d.ts +3 -1
  131. package/dist/vetur/quasar-attributes.json +62 -42
  132. package/dist/vetur/quasar-tags.json +8 -3
  133. package/dist/web-types/web-types.json +103 -58
  134. package/package.json +13 -3
  135. package/src/components/ajax-bar/QAjaxBar.js +22 -12
  136. package/src/components/ajax-bar/QAjaxBar.json +16 -1
  137. package/src/components/avatar/__tests__/QAvatar.spec.js +121 -0
  138. package/src/components/badge/__tests__/QBadge.spec.js +74 -0
  139. package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
  140. package/src/components/btn/__tests__/QBtn.spec.js +55 -0
  141. package/src/components/btn/__tests__/use-btn.spec.js +189 -0
  142. package/src/components/btn-dropdown/QBtnDropdown.json +4 -2
  143. package/src/components/checkbox/QCheckbox.js +34 -3
  144. package/src/components/checkbox/QCheckbox.json +17 -0
  145. package/src/components/checkbox/QCheckbox.sass +17 -5
  146. package/src/components/checkbox/use-checkbox.js +4 -0
  147. package/src/components/checkbox/use-checkbox.json +18 -0
  148. package/src/components/chip/__tests__/QChip.spec.js +155 -0
  149. package/src/components/date/__tests__/QDate.spec.js +189 -0
  150. package/src/components/date/__tests__/use-datetime.spec.js +83 -0
  151. package/src/components/dialog/QDialog.js +1 -1
  152. package/src/components/dialog/__tests__/QDialog.spec.js +129 -0
  153. package/src/components/editor/QEditor.js +1 -1
  154. package/src/components/editor/QEditor.json +3 -1
  155. package/src/components/editor/__tests__/QEditor.spec.js +195 -0
  156. package/src/components/expansion-item/QExpansionItem.json +6 -3
  157. package/src/components/fab/use-fab.json +4 -2
  158. package/src/components/file/QFile.json +4 -2
  159. package/src/components/form/QForm.js +12 -2
  160. package/src/components/img/QImg.json +2 -3
  161. package/src/components/infinite-scroll/QInfiniteScroll.js +3 -2
  162. package/src/components/inner-loading/QInnerLoading.json +2 -1
  163. package/src/components/input/QInput.js +10 -1
  164. package/src/components/input/QInput.json +4 -2
  165. package/src/components/input/__tests__/QInput.spec.js +105 -0
  166. package/src/components/input/__tests__/use-mask.spec.js +29 -0
  167. package/src/components/menu/QMenu.js +2 -1
  168. package/src/components/menu/__tests__/QMenu.spec.js +610 -0
  169. package/src/components/menu/__tests__/WrapperOne.vue +51 -0
  170. package/src/components/menu/__tests__/WrapperTwo.vue +38 -0
  171. package/src/components/pagination/QPagination.json +4 -2
  172. package/src/components/radio/QRadio.js +26 -1
  173. package/src/components/radio/QRadio.json +16 -0
  174. package/src/components/radio/QRadio.sass +17 -6
  175. package/src/components/scroll-area/QScrollArea.js +21 -1
  176. package/src/components/scroll-area/QScrollArea.json +13 -5
  177. package/src/components/select/QSelect.js +13 -9
  178. package/src/components/select/QSelect.json +6 -3
  179. package/src/components/select/QSelect.sass +1 -0
  180. package/src/components/select/__tests__/QSelect.spec.js +2003 -0
  181. package/src/components/select/__tests__/WrapperOne.vue +28 -0
  182. package/src/components/slider/use-slider.json +9 -0
  183. package/src/components/splitter/QSplitter.json +8 -4
  184. package/src/components/stepper/QStep.js +19 -14
  185. package/src/components/stepper/QStepper.sass +3 -0
  186. package/src/components/table/QTable.json +9 -0
  187. package/src/components/table/__tests__/QTable.spec.js +635 -0
  188. package/src/components/table/__tests__/QTd.spec.js +35 -0
  189. package/src/components/table/__tests__/QTh.spec.js +27 -0
  190. package/src/components/table/__tests__/QTr.spec.js +27 -0
  191. package/src/components/tabs/QTabs.js +10 -2
  192. package/src/components/tabs/__tests__/QRouteTab.spec.js +9 -0
  193. package/src/components/tabs/__tests__/QTab.spec.js +79 -0
  194. package/src/components/tabs/__tests__/QTabs.spec.js +147 -0
  195. package/src/components/time/QTime.json +2 -2
  196. package/src/components/toggle/QToggle.js +5 -13
  197. package/src/components/toggle/QToggle.json +3 -12
  198. package/src/components/tree/QTree.js +5 -3
  199. package/src/components/uploader/__tests__/QUploader.spec.js +161 -0
  200. package/src/components/virtual-scroll/use-virtual-scroll.js +20 -9
  201. package/src/composables/private/__tests__/FieldWrapper.vue +39 -0
  202. package/src/composables/private/__tests__/use-anchor.spec.js +99 -0
  203. package/src/composables/private/__tests__/use-field.spec.js +351 -0
  204. package/src/composables/private/__tests__/use-file.spec.js +69 -0
  205. package/src/composables/private/__tests__/use-form.spec.js +11 -0
  206. package/src/composables/private/__tests__/use-fullscreen.spec.js +37 -0
  207. package/src/composables/private/__tests__/use-model-toggle.spec.js +306 -0
  208. package/src/composables/private/__tests__/use-portal.spec.js +4 -0
  209. package/src/composables/private/__tests__/use-router-link.spec.js +55 -0
  210. package/src/composables/private/__tests__/use-size.spec.js +37 -0
  211. package/src/composables/private/__tests__/use-transition.spec.js +108 -0
  212. package/src/composables/private/__tests__/use-validate.spec.js +111 -0
  213. package/src/composables/private/use-field.js +16 -9
  214. package/src/composables/private/use-fullscreen.js +1 -1
  215. package/src/composables/private/use-model-toggle.js +1 -1
  216. package/src/composables/private/use-validate.js +9 -5
  217. package/src/plugins/BottomSheet.json +1 -0
  218. package/src/plugins/Dialog.json +1 -0
  219. package/src/plugins/LoadingBar.js +3 -3
  220. package/src/plugins/LoadingBar.json +8 -0
  221. package/src/plugins/Meta.js +1 -1
  222. package/src/plugins/Notify.json +20 -10
  223. package/src/plugins/Platform.js +15 -8
  224. package/src/plugins/Platform.json +166 -0
  225. package/src/plugins/Screen.js +11 -8
  226. package/src/utils/date.js +5 -5
  227. package/src/utils/private/global-dialog.json +3 -0
  228. package/src/utils/private/vm.js +14 -8
@@ -37,12 +37,16 @@ export default function (focused, innerLoading) {
37
37
  let validateIndex = 0, unwatchRules
38
38
 
39
39
  const hasRules = computed(() =>
40
- props.disable !== true
41
- && props.rules !== void 0
40
+ props.rules !== void 0
42
41
  && props.rules !== null
43
42
  && props.rules.length > 0
44
43
  )
45
44
 
45
+ const hasActiveRules = computed(() =>
46
+ props.disable !== true
47
+ && hasRules.value === true
48
+ )
49
+
46
50
  const hasError = computed(() =>
47
51
  props.error === true || innerError.value === true
48
52
  )
@@ -80,7 +84,7 @@ export default function (focused, innerLoading) {
80
84
  else if (isDirtyModel.value === false) {
81
85
  isDirtyModel.value = true
82
86
 
83
- if (hasRules.value === true && props.lazyRules !== 'ondemand') {
87
+ if (hasActiveRules.value === true && props.lazyRules !== 'ondemand') {
84
88
  debouncedValidate()
85
89
  }
86
90
  }
@@ -102,7 +106,7 @@ export default function (focused, innerLoading) {
102
106
  * - Promise (pending async validation)
103
107
  */
104
108
  function validate (val = props.modelValue) {
105
- if (hasRules.value !== true) {
109
+ if (hasActiveRules.value !== true) {
106
110
  return true
107
111
  }
108
112
 
@@ -190,7 +194,7 @@ export default function (focused, innerLoading) {
190
194
 
191
195
  function validateIfNeeded (changedRules) {
192
196
  if (
193
- hasRules.value === true
197
+ hasActiveRules.value === true
194
198
  && props.lazyRules !== 'ondemand'
195
199
  && (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
196
200
  ) {
@@ -33,6 +33,7 @@
33
33
  "definition": {
34
34
  "classes": {
35
35
  "type": [ "String", "Array", "Object" ],
36
+ "tsType": "VueClassProp",
36
37
  "desc": "CSS classes for this action",
37
38
  "examples": [ "my-class" ]
38
39
  },
@@ -14,6 +14,7 @@
14
14
  "opts": {
15
15
  "desc": "Dialog options",
16
16
  "tsType": "QDialogOptions",
17
+ "autoDefineTsType": true,
17
18
  "definition": {
18
19
  "title": {
19
20
  "type": "String",
@@ -49,11 +49,11 @@ const Plugin = defineReactivePlugin({
49
49
  Object.assign(this, {
50
50
  start (speed) {
51
51
  barRef.value.start(speed)
52
- Plugin.isActive = barRef.value.calls > 0
52
+ Plugin.isActive = true
53
53
  },
54
54
  stop () {
55
- barRef.value.stop()
56
- Plugin.isActive = barRef.value.calls > 0
55
+ const sessions = barRef.value.stop()
56
+ Plugin.isActive = sessions > 0
57
57
  },
58
58
  increment () {
59
59
  barRef.value.increment.apply(null, arguments)
@@ -16,6 +16,14 @@
16
16
  }
17
17
  },
18
18
 
19
+ "props": {
20
+ "isActive": {
21
+ "type": "Boolean",
22
+ "desc": "Is LoadingBar active?",
23
+ "reactive": true
24
+ }
25
+ },
26
+
19
27
  "methods": {
20
28
  "start": {
21
29
  "desc": "Notify bar you've started a background activity",
@@ -140,7 +140,7 @@ function apply ({ add, remove }) {
140
140
  function getAttr (seed) {
141
141
  return att => {
142
142
  const val = seed[ att ]
143
- return att + (val !== void 0 ? `="${ val }"` : '')
143
+ return att + (val !== true && val !== void 0 ? `="${ val }"` : '')
144
144
  }
145
145
  }
146
146
 
@@ -254,7 +254,8 @@
254
254
  ]
255
255
  },
256
256
  "badgeStyle": {
257
- "type": [ "Array", "String", "Object" ],
257
+ "type": [ "String", "Array", "Object" ],
258
+ "tsType": "VueStyleProp",
258
259
  "desc": "Style definitions to be attributed to the badge",
259
260
  "examples": [
260
261
  "background-color: #ff0000",
@@ -262,7 +263,8 @@
262
263
  ]
263
264
  },
264
265
  "badgeClass": {
265
- "type": [ "Array", "String", "Object" ],
266
+ "type": [ "String", "Array", "Object" ],
267
+ "tsType": "VueClassProp",
266
268
  "desc": "Class definitions to be attributed to the badge",
267
269
  "examples": [
268
270
  "my-special-class",
@@ -275,7 +277,8 @@
275
277
  "desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
276
278
  },
277
279
  "progressClass": {
278
- "type": [ "Array", "String", "Object" ],
280
+ "type": [ "String", "Array", "Object" ],
281
+ "tsType": "VueClassProp",
279
282
  "desc": "Class definitions to be attributed to the progress bar",
280
283
  "examples": [
281
284
  "my-special-class",
@@ -406,7 +409,8 @@
406
409
  "desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
407
410
  },
408
411
  "progressClass": {
409
- "type": [ "Array", "String", "Object" ],
412
+ "type": [ "String", "Array", "Object" ],
413
+ "tsType": "VueClassProp",
410
414
  "desc": "Class definitions to be attributed to the progress bar",
411
415
  "examples": [
412
416
  "my-special-class",
@@ -566,7 +570,8 @@
566
570
  "examples": [ "bottom-right" ]
567
571
  },
568
572
  "badgeStyle": {
569
- "type": [ "Array", "String", "Object" ],
573
+ "type": [ "String", "Array", "Object" ],
574
+ "tsType": "VueStyleProp",
570
575
  "desc": "Style definitions to be attributed to the badge",
571
576
  "examples": [
572
577
  "background-color: #ff0000",
@@ -574,7 +579,8 @@
574
579
  ]
575
580
  },
576
581
  "badgeClass": {
577
- "type": [ "Array", "String", "Object" ],
582
+ "type": [ "String", "Array", "Object" ],
583
+ "tsType": "VueClassProp",
578
584
  "desc": "Class definitions to be attributed to the badge",
579
585
  "examples": [
580
586
  "my-special-class",
@@ -587,7 +593,8 @@
587
593
  "desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
588
594
  },
589
595
  "progressClass": {
590
- "type": [ "Array", "String", "Object" ],
596
+ "type": [ "String", "Array", "Object" ],
597
+ "tsType": "VueClassProp",
591
598
  "desc": "Class definitions to be attributed to the progress bar",
592
599
  "examples": [
593
600
  "my-special-class",
@@ -746,7 +753,8 @@
746
753
  "examples": [ "bottom-right" ]
747
754
  },
748
755
  "badgeStyle": {
749
- "type": [ "Array", "String", "Object" ],
756
+ "type": [ "String", "Array", "Object" ],
757
+ "tsType": "VueStyleProp",
750
758
  "desc": "Style definitions to be attributed to the badge",
751
759
  "examples": [
752
760
  "background-color: #ff0000",
@@ -754,7 +762,8 @@
754
762
  ]
755
763
  },
756
764
  "badgeClass": {
757
- "type": [ "Array", "String", "Object" ],
765
+ "type": [ "String", "Array", "Object" ],
766
+ "tsType": "VueClassProp",
758
767
  "desc": "Class definitions to be attributed to the badge",
759
768
  "examples": [
760
769
  "my-special-class",
@@ -767,7 +776,8 @@
767
776
  "desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
768
777
  },
769
778
  "progressClass": {
770
- "type": [ "Array", "String", "Object" ],
779
+ "type": [ "String", "Array", "Object" ],
780
+ "tsType": "VueClassProp",
771
781
  "desc": "Class definitions to be attributed to the progress bar",
772
782
  "examples": [
773
783
  "my-special-class",
@@ -1,6 +1,4 @@
1
1
  /* eslint-disable no-useless-escape */
2
- /* eslint-disable no-unused-expressions */
3
- /* eslint-disable no-mixed-operators */
4
2
 
5
3
  import { ref, reactive } from 'vue'
6
4
  import { injectProp } from '../utils/private/inject-obj-prop'
@@ -25,19 +23,15 @@ export let iosEmulated = false
25
23
  export let iosCorrection
26
24
 
27
25
  function getMatch (userAgent, platformMatch) {
28
- const match = /(edge|edga|edgios)\/([\w.]+)/.exec(userAgent)
26
+ const match = /(edg|edge|edga|edgios)\/([\w.]+)/.exec(userAgent)
29
27
  || /(opr)[\/]([\w.]+)/.exec(userAgent)
30
28
  || /(vivaldi)[\/]([\w.]+)/.exec(userAgent)
31
29
  || /(chrome|crios)[\/]([\w.]+)/.exec(userAgent)
32
- || /(iemobile)[\/]([\w.]+)/.exec(userAgent)
33
30
  || /(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(userAgent)
34
31
  || /(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(userAgent)
35
32
  || /(firefox|fxios)[\/]([\w.]+)/.exec(userAgent)
36
33
  || /(webkit)[\/]([\w.]+)/.exec(userAgent)
37
34
  || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(userAgent)
38
- || /(msie) ([\w.]+)/.exec(userAgent)
39
- || (userAgent.indexOf('trident') >= 0 && /(rv)(?::| )([\w.]+)/.exec(userAgent))
40
- || (userAgent.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(userAgent))
41
35
  || []
42
36
 
43
37
  return {
@@ -60,6 +54,8 @@ function getPlatformMatch (userAgent) {
60
54
  || /(mac)/.exec(userAgent)
61
55
  || /(linux)/.exec(userAgent)
62
56
  || /(cros)/.exec(userAgent)
57
+ // TODO: Remove BlackBerry detection. BlackBerry OS, BlackBerry 10, and BlackBerry PlayBook OS
58
+ // is officially dead as of January 4, 2022 (https://www.blackberry.com/us/en/support/devices/end-of-life)
63
59
  || /(playbook)/.exec(userAgent)
64
60
  || /(bb)/.exec(userAgent)
65
61
  || /(blackberry)/.exec(userAgent)
@@ -151,6 +147,10 @@ function getPlatform (UA) {
151
147
  delete browser[ 'windows phone' ]
152
148
  }
153
149
 
150
+ // TODO: The assumption about WebKit based browsers below is not completely accurate.
151
+ // Google released Blink(a fork of WebKit) engine on April 3, 2013, which is really different than WebKit today.
152
+ // Today, one might want to check for WebKit to deal with its bugs, which is used on all browsers on iOS, and Safari browser on all platforms.
153
+
154
154
  // Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
155
155
  if (
156
156
  browser.chrome
@@ -167,8 +167,15 @@ function getPlatform (UA) {
167
167
  browser.webkit = true
168
168
  }
169
169
 
170
+ // TODO: (Qv3) rename the terms 'edge' to 'edge legacy'(or remove it) then 'edge chromium' to 'edge' to match with the known up-to-date terms
171
+ // Microsoft Edge is the new Chromium-based browser. Microsoft Edge Legacy is the old EdgeHTML-based browser (EOL: March 9, 2021).
172
+ if (browser.edg) {
173
+ matched.browser = 'edgechromium'
174
+ browser.edgeChromium = true
175
+ }
176
+
170
177
  // Blackberry browsers are marked as Safari on BlackBerry
171
- if (browser.safari && browser.blackberry || browser.bb) {
178
+ if ((browser.safari && browser.blackberry) || browser.bb) {
172
179
  matched.browser = 'blackberry'
173
180
  browser.blackberry = true
174
181
  }
@@ -17,6 +17,172 @@
17
17
  "is": {
18
18
  "type": "Object",
19
19
  "desc": "Client browser details (property names depend on browser)",
20
+ "definition": {
21
+ "name": {
22
+ "type": "String",
23
+ "desc": "Browser name",
24
+ "examples": [ "chrome" ]
25
+ },
26
+ "platform": {
27
+ "type": "String",
28
+ "desc": "Platform name",
29
+ "examples": [ "mac" ]
30
+ },
31
+ "version": {
32
+ "type": "String",
33
+ "required": false,
34
+ "desc": "Detailed browser version",
35
+ "examples": [ "71.0.3578.98" ]
36
+ },
37
+ "versionNumber": {
38
+ "type": "Number",
39
+ "required": false,
40
+ "desc": "Major browser version as a number",
41
+ "examples": [ 71 ]
42
+ },
43
+
44
+ "desktop": {
45
+ "type": "Boolean",
46
+ "required": false,
47
+ "desc": "Whether the platform is desktop"
48
+ },
49
+ "mobile": {
50
+ "type": "Boolean",
51
+ "required": false,
52
+ "desc": "Whether the platform is mobile"
53
+ },
54
+ "electron": {
55
+ "type": "Boolean",
56
+ "required": false,
57
+ "desc": "Whether the platform is Electron"
58
+ },
59
+ "bex": {
60
+ "type": "Boolean",
61
+ "required": false,
62
+ "desc": "Whether the platform is BEX(Browser Extension)"
63
+ },
64
+ "capacitor": {
65
+ "type": "Boolean",
66
+ "required": false,
67
+ "desc": "Whether the platform is Capacitor"
68
+ },
69
+ "cordova": {
70
+ "type": "Boolean",
71
+ "required": false,
72
+ "desc": "Whether the platform is Cordova"
73
+ },
74
+ "nativeMobile": {
75
+ "type": "Boolean",
76
+ "required": false,
77
+ "desc": "Whether the platform is a native mobile wrapper"
78
+ },
79
+ "nativeMobileWrapper": {
80
+ "type": "String",
81
+ "required": false,
82
+ "values": ["cordova", "capacitor"],
83
+ "desc": "Type of the native mobile wrapper"
84
+ },
85
+
86
+ "chrome": {
87
+ "type": "Boolean",
88
+ "required": false,
89
+ "desc": "Whether the browser is Google Chrome"
90
+ },
91
+ "firefox": {
92
+ "type": "Boolean",
93
+ "required": false,
94
+ "desc": "Whether the browser is Firefox"
95
+ },
96
+ "safari": {
97
+ "type": "Boolean",
98
+ "required": false,
99
+ "desc": "Whether the browser is Safari"
100
+ },
101
+ "edgeChromium": {
102
+ "type": "Boolean",
103
+ "required": false,
104
+ "desc": "Whether the browser is Microsoft Edge (Chromium)"
105
+ },
106
+ "edge": {
107
+ "type": "Boolean",
108
+ "required": false,
109
+ "desc": "Whether the browser is Microsoft Edge Legacy"
110
+ },
111
+ "opera": {
112
+ "type": "Boolean",
113
+ "required": false,
114
+ "desc": "Whether the browser is Opera"
115
+ },
116
+ "vivaldi": {
117
+ "type": "Boolean",
118
+ "required": false,
119
+ "desc": "Whether the browser is Vivaldi"
120
+ },
121
+
122
+ "win": {
123
+ "type": "Boolean",
124
+ "required": false,
125
+ "desc": "Whether the operating system is Windows"
126
+ },
127
+ "linux": {
128
+ "type": "Boolean",
129
+ "required": false,
130
+ "desc": "Whether the operating system is Linux"
131
+ },
132
+ "mac": {
133
+ "type": "Boolean",
134
+ "required": false,
135
+ "desc": "Whether the operating system is Mac OS"
136
+ },
137
+ "cros": {
138
+ "type": "Boolean",
139
+ "required": false,
140
+ "desc": "Whether the operating system is Chrome OS"
141
+ },
142
+
143
+ "android": {
144
+ "type": "Boolean",
145
+ "required": false,
146
+ "desc": "Whether the operating system is Android"
147
+ },
148
+ "ios": {
149
+ "type": "Boolean",
150
+ "required": false,
151
+ "desc": "Whether the operating system is iOS"
152
+ },
153
+ "winphone": {
154
+ "type": "Boolean",
155
+ "required": false,
156
+ "desc": "Whether the operating system is Windows Phone"
157
+ },
158
+
159
+ "iphone": {
160
+ "type": "Boolean",
161
+ "required": false,
162
+ "desc": "Whether the device is an iPhone"
163
+ },
164
+ "ipad": {
165
+ "type": "Boolean",
166
+ "required": false,
167
+ "desc": "Whether the device is an iPad"
168
+ },
169
+ "ipod": {
170
+ "type": "Boolean",
171
+ "required": false,
172
+ "desc": "Whether the device is an iPod"
173
+ },
174
+
175
+ "kindle": {
176
+ "type": "Boolean",
177
+ "required": false,
178
+ "desc": "Whether the device is a Kindle"
179
+ },
180
+ "silk": {
181
+ "type": "Boolean",
182
+ "required": false,
183
+ "desc": "Whether the browser is Amazon Silk"
184
+ }
185
+ },
20
186
  "examples": [
21
187
  "{ chrome: true, version: '71.0.3578.98', versionNumber: 71, mac: true, desktop: true, webkit: true, name: 'chrome', platform: 'mac' }"
22
188
  ]
@@ -58,12 +58,19 @@ export default defineReactivePlugin({
58
58
  return
59
59
  }
60
60
 
61
+ const { visualViewport } = window
62
+ const target = visualViewport || window
63
+ const getSize = visualViewport === void 0
64
+ ? () => [ window.innerWidth, window.innerHeight ]
65
+ : () => [
66
+ visualViewport.width * visualViewport.scale + window.innerWidth - document.scrollingElement.clientWidth,
67
+ visualViewport.height * visualViewport.scale + window.innerHeight - document.scrollingElement.clientHeight
68
+ ]
69
+
61
70
  const classes = $q.config.screen !== void 0 && $q.config.screen.bodyClasses === true
62
71
 
63
72
  this.__update = force => {
64
- const
65
- w = window.innerWidth,
66
- h = window.innerHeight
73
+ const [ w, h ] = getSize()
67
74
 
68
75
  if (h !== this.height) {
69
76
  this.height = h
@@ -121,11 +128,7 @@ export default defineReactivePlugin({
121
128
  }
122
129
 
123
130
  const start = () => {
124
- const
125
- style = getComputedStyle(document.body),
126
- target = window.visualViewport !== void 0
127
- ? window.visualViewport
128
- : window
131
+ const style = getComputedStyle(document.body)
129
132
 
130
133
  // if css props available
131
134
  if (style.getPropertyValue('--q-size-sm')) {
package/src/utils/date.js CHANGED
@@ -185,16 +185,16 @@ function applyYearMonthDayChange (date, mod, sign) {
185
185
  month += sign * mod.months
186
186
  }
187
187
 
188
- if (mod.days !== void 0) {
189
- day += sign * mod.days
190
- }
191
-
192
188
  date.setDate(1)
193
189
  date.setMonth(2)
194
190
 
195
191
  date.setFullYear(year)
196
192
  date.setMonth(month)
197
- date.setDate(day)
193
+ date.setDate(Math.min(day, daysInMonth(date)))
194
+
195
+ if (mod.days !== void 0) {
196
+ date.setDate(date.getDate() + sign * mod.days)
197
+ }
198
198
 
199
199
  return date
200
200
  }
@@ -9,12 +9,14 @@
9
9
  "definition": {
10
10
  "class": {
11
11
  "type": [ "String", "Array", "Object" ],
12
+ "tsType": "VueClassProp",
12
13
  "desc": "CSS Class name to apply to the Dialog's QCard",
13
14
  "examples": [ "my-class" ]
14
15
  },
15
16
 
16
17
  "style": {
17
18
  "type": [ "String", "Array", "Object" ],
19
+ "tsType": "VueStyleProp",
18
20
  "desc": "CSS style to apply to the Dialog's QCard",
19
21
  "examples": [ "border: 2px solid black" ]
20
22
  }
@@ -26,6 +28,7 @@
26
28
  "type": "Object",
27
29
  "desc": "Chainable Object",
28
30
  "tsType": "DialogChainObject",
31
+ "autoDefineTsType": true,
29
32
  "definition": {
30
33
  "onOk": {
31
34
  "type": "Function",
@@ -15,19 +15,25 @@ export function getParentVm (vm) {
15
15
  }
16
16
  }
17
17
 
18
+ function fillNormalizedVNodes (children, vnode) {
19
+ if (typeof vnode.type === 'symbol') {
20
+ if (Array.isArray(vnode.children) === true) {
21
+ vnode.children.forEach(child => {
22
+ fillNormalizedVNodes(children, child)
23
+ })
24
+ }
25
+ }
26
+ else {
27
+ children.add(vnode)
28
+ }
29
+ }
30
+
18
31
  // vnodes from rendered in advanced slots
19
32
  export function getNormalizedVNodes (vnodes) {
20
33
  const children = new Set()
21
34
 
22
35
  vnodes.forEach(vnode => {
23
- if (typeof vnode.type === 'symbol' && Array.isArray(vnode.children) === true) {
24
- vnode.children.forEach(child => {
25
- children.add(child)
26
- })
27
- }
28
- else {
29
- children.add(vnode)
30
- }
36
+ fillNormalizedVNodes(children, vnode)
31
37
  })
32
38
 
33
39
  return Array.from(children)