quasar 2.14.5 → 2.14.6

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 (356) hide show
  1. package/dist/api/AddressbarColor.json +1 -22
  2. package/dist/api/AppFullscreen.json +1 -78
  3. package/dist/api/AppVisibility.json +1 -15
  4. package/dist/api/BottomSheet.json +1 -264
  5. package/dist/api/Brand.json +1 -49
  6. package/dist/api/ClosePopup.json +1 -21
  7. package/dist/api/Cookies.json +1 -190
  8. package/dist/api/Dark.json +1 -63
  9. package/dist/api/Dialog.json +1 -479
  10. package/dist/api/Intersection.json +1 -204
  11. package/dist/api/Lang.json +1 -18
  12. package/dist/api/Loading.json +1 -317
  13. package/dist/api/LoadingBar.json +1 -62
  14. package/dist/api/LocalStorage.json +1 -187
  15. package/dist/api/Meta.json +1 -6
  16. package/dist/api/Morph.json +1 -188
  17. package/dist/api/Mutation.json +1 -122
  18. package/dist/api/Notify.json +1 -697
  19. package/dist/api/Platform.json +1 -238
  20. package/dist/api/QAjaxBar.json +1 -117
  21. package/dist/api/QAvatar.json +1 -76
  22. package/dist/api/QBadge.json +1 -82
  23. package/dist/api/QBanner.json +1 -44
  24. package/dist/api/QBar.json +1 -28
  25. package/dist/api/QBreadcrumbs.json +1 -82
  26. package/dist/api/QBreadcrumbsEl.json +1 -162
  27. package/dist/api/QBtn.json +1 -354
  28. package/dist/api/QBtnDropdown.json +1 -560
  29. package/dist/api/QBtnGroup.json +1 -59
  30. package/dist/api/QBtnToggle.json +1 -263
  31. package/dist/api/QCard.json +1 -51
  32. package/dist/api/QCardActions.json +1 -34
  33. package/dist/api/QCardSection.json +1 -31
  34. package/dist/api/QCarousel.json +1 -421
  35. package/dist/api/QCarouselControl.json +1 -41
  36. package/dist/api/QCarouselSlide.json +1 -44
  37. package/dist/api/QChatMessage.json +1 -128
  38. package/dist/api/QCheckbox.json +1 -211
  39. package/dist/api/QChip.json +1 -232
  40. package/dist/api/QCircularProgress.json +1 -145
  41. package/dist/api/QColor.json +1 -150
  42. package/dist/api/QDate.json +1 -637
  43. package/dist/api/QDialog.json +1 -259
  44. package/dist/api/QDrawer.json +1 -272
  45. package/dist/api/QEditor.json +1 -485
  46. package/dist/api/QExpansionItem.json +1 -434
  47. package/dist/api/QFab.json +1 -352
  48. package/dist/api/QFabAction.json +1 -241
  49. package/dist/api/QField.json +1 -448
  50. package/dist/api/QFile.json +1 -643
  51. package/dist/api/QFooter.json +1 -60
  52. package/dist/api/QForm.json +1 -112
  53. package/dist/api/QFormChildMixin.json +1 -24
  54. package/dist/api/QHeader.json +1 -67
  55. package/dist/api/QIcon.json +1 -69
  56. package/dist/api/QImg.json +1 -279
  57. package/dist/api/QInfiniteScroll.json +1 -116
  58. package/dist/api/QInnerLoading.json +1 -117
  59. package/dist/api/QInput.json +1 -521
  60. package/dist/api/QIntersection.json +1 -112
  61. package/dist/api/QItem.json +1 -203
  62. package/dist/api/QItemLabel.json +1 -36
  63. package/dist/api/QItemSection.json +1 -38
  64. package/dist/api/QKnob.json +1 -197
  65. package/dist/api/QLayout.json +1 -100
  66. package/dist/api/QLinearProgress.json +1 -113
  67. package/dist/api/QList.json +1 -58
  68. package/dist/api/QMarkupTable.json +1 -64
  69. package/dist/api/QMenu.json +1 -337
  70. package/dist/api/QNoSsr.json +1 -38
  71. package/dist/api/QOptionGroup.json +1 -242
  72. package/dist/api/QPage.json +1 -42
  73. package/dist/api/QPageContainer.json +1 -11
  74. package/dist/api/QPageScroller.json +1 -68
  75. package/dist/api/QPageSticky.json +1 -44
  76. package/dist/api/QPagination.json +1 -376
  77. package/dist/api/QParallax.json +1 -74
  78. package/dist/api/QPopupEdit.json +1 -335
  79. package/dist/api/QPopupProxy.json +1 -168
  80. package/dist/api/QPullToRefresh.json +1 -91
  81. package/dist/api/QRadio.json +1 -163
  82. package/dist/api/QRange.json +1 -789
  83. package/dist/api/QRating.json +1 -186
  84. package/dist/api/QResizeObserver.json +1 -56
  85. package/dist/api/QResponsive.json +1 -26
  86. package/dist/api/QRouteTab.json +1 -225
  87. package/dist/api/QScrollArea.json +1 -354
  88. package/dist/api/QScrollObserver.json +1 -140
  89. package/dist/api/QSelect.json +1 -1387
  90. package/dist/api/QSeparator.json +1 -72
  91. package/dist/api/QSkeleton.json +1 -127
  92. package/dist/api/QSlideItem.json +1 -219
  93. package/dist/api/QSlideTransition.json +1 -33
  94. package/dist/api/QSlider.json +1 -687
  95. package/dist/api/QSpace.json +1 -6
  96. package/dist/api/QSpinner.json +1 -37
  97. package/dist/api/QSpinnerAudio.json +1 -30
  98. package/dist/api/QSpinnerBall.json +1 -30
  99. package/dist/api/QSpinnerBars.json +1 -30
  100. package/dist/api/QSpinnerBox.json +1 -30
  101. package/dist/api/QSpinnerClock.json +1 -30
  102. package/dist/api/QSpinnerComment.json +1 -30
  103. package/dist/api/QSpinnerCube.json +1 -30
  104. package/dist/api/QSpinnerDots.json +1 -30
  105. package/dist/api/QSpinnerFacebook.json +1 -30
  106. package/dist/api/QSpinnerGears.json +1 -30
  107. package/dist/api/QSpinnerGrid.json +1 -30
  108. package/dist/api/QSpinnerHearts.json +1 -30
  109. package/dist/api/QSpinnerHourglass.json +1 -30
  110. package/dist/api/QSpinnerInfinity.json +1 -30
  111. package/dist/api/QSpinnerIos.json +1 -30
  112. package/dist/api/QSpinnerOrbit.json +1 -30
  113. package/dist/api/QSpinnerOval.json +1 -30
  114. package/dist/api/QSpinnerPie.json +1 -30
  115. package/dist/api/QSpinnerPuff.json +1 -30
  116. package/dist/api/QSpinnerRadio.json +1 -30
  117. package/dist/api/QSpinnerRings.json +1 -30
  118. package/dist/api/QSpinnerTail.json +1 -30
  119. package/dist/api/QSplitter.json +1 -146
  120. package/dist/api/QStep.json +1 -167
  121. package/dist/api/QStepper.json +1 -340
  122. package/dist/api/QStepperNavigation.json +1 -11
  123. package/dist/api/QTab.json +1 -113
  124. package/dist/api/QTabPanel.json +1 -39
  125. package/dist/api/QTabPanels.json +1 -203
  126. package/dist/api/QTable.json +1 -2799
  127. package/dist/api/QTabs.json +1 -179
  128. package/dist/api/QTd.json +1 -31
  129. package/dist/api/QTh.json +1 -26
  130. package/dist/api/QTime.json +1 -317
  131. package/dist/api/QTimeline.json +1 -57
  132. package/dist/api/QTimelineEntry.json +1 -105
  133. package/dist/api/QToggle.json +1 -230
  134. package/dist/api/QToolbar.json +1 -18
  135. package/dist/api/QToolbarTitle.json +1 -18
  136. package/dist/api/QTooltip.json +1 -282
  137. package/dist/api/QTr.json +1 -26
  138. package/dist/api/QTree.json +1 -599
  139. package/dist/api/QUploader.json +1 -665
  140. package/dist/api/QUploaderAddTrigger.json +1 -6
  141. package/dist/api/QVideo.json +1 -83
  142. package/dist/api/QVirtualScroll.json +1 -260
  143. package/dist/api/Ripple.json +1 -115
  144. package/dist/api/Screen.json +1 -190
  145. package/dist/api/Scroll.json +1 -28
  146. package/dist/api/ScrollFire.json +1 -24
  147. package/dist/api/SessionStorage.json +1 -187
  148. package/dist/api/TouchHold.json +1 -81
  149. package/dist/api/TouchPan.json +1 -178
  150. package/dist/api/TouchRepeat.json +1 -142
  151. package/dist/api/TouchSwipe.json +1 -113
  152. package/dist/icon-set/bootstrap-icons.umd.prod.js +3 -2
  153. package/dist/icon-set/eva-icons.umd.prod.js +3 -2
  154. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +3 -2
  155. package/dist/icon-set/fontawesome-v5.umd.prod.js +3 -2
  156. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +3 -2
  157. package/dist/icon-set/fontawesome-v6.umd.prod.js +3 -2
  158. package/dist/icon-set/ionicons-v4.umd.prod.js +3 -2
  159. package/dist/icon-set/line-awesome.umd.prod.js +3 -2
  160. package/dist/icon-set/material-icons-outlined.umd.prod.js +3 -2
  161. package/dist/icon-set/material-icons-round.umd.prod.js +3 -2
  162. package/dist/icon-set/material-icons-sharp.umd.prod.js +3 -2
  163. package/dist/icon-set/material-icons.umd.prod.js +3 -2
  164. package/dist/icon-set/material-symbols-outlined.umd.prod.js +3 -2
  165. package/dist/icon-set/material-symbols-rounded.umd.prod.js +3 -2
  166. package/dist/icon-set/material-symbols-sharp.umd.prod.js +3 -2
  167. package/dist/icon-set/mdi-v3.umd.prod.js +3 -2
  168. package/dist/icon-set/mdi-v4.umd.prod.js +3 -2
  169. package/dist/icon-set/mdi-v5.umd.prod.js +3 -2
  170. package/dist/icon-set/mdi-v6.umd.prod.js +3 -2
  171. package/dist/icon-set/mdi-v7.umd.prod.js +3 -2
  172. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +3 -2
  173. package/dist/icon-set/svg-eva-icons.umd.prod.js +3 -2
  174. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +3 -2
  175. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +3 -2
  176. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +3 -2
  177. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +3 -2
  178. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +3 -2
  179. package/dist/icon-set/svg-line-awesome.umd.prod.js +3 -2
  180. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +3 -2
  181. package/dist/icon-set/svg-material-icons-round.umd.prod.js +3 -2
  182. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +3 -2
  183. package/dist/icon-set/svg-material-icons.umd.prod.js +3 -2
  184. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +3 -2
  185. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +3 -2
  186. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +3 -2
  187. package/dist/icon-set/svg-mdi-v6.umd.prod.js +3 -2
  188. package/dist/icon-set/svg-mdi-v7.umd.prod.js +3 -2
  189. package/dist/icon-set/svg-themify.umd.prod.js +3 -2
  190. package/dist/icon-set/themify.umd.prod.js +3 -2
  191. package/dist/lang/ar-TN.umd.prod.js +3 -2
  192. package/dist/lang/ar.umd.prod.js +3 -2
  193. package/dist/lang/az-Latn.umd.prod.js +3 -2
  194. package/dist/lang/bg.umd.prod.js +3 -2
  195. package/dist/lang/bn.umd.prod.js +3 -2
  196. package/dist/lang/ca.umd.prod.js +3 -2
  197. package/dist/lang/cs.umd.prod.js +3 -2
  198. package/dist/lang/da.umd.prod.js +3 -2
  199. package/dist/lang/de-CH.umd.prod.js +3 -2
  200. package/dist/lang/de-DE.umd.prod.js +3 -2
  201. package/dist/lang/de.umd.prod.js +3 -2
  202. package/dist/lang/el.umd.prod.js +3 -2
  203. package/dist/lang/en-GB.umd.prod.js +3 -2
  204. package/dist/lang/en-US.umd.prod.js +3 -2
  205. package/dist/lang/eo.umd.prod.js +3 -2
  206. package/dist/lang/es.umd.prod.js +3 -2
  207. package/dist/lang/et.umd.prod.js +3 -2
  208. package/dist/lang/eu.umd.prod.js +3 -2
  209. package/dist/lang/fa-IR.umd.prod.js +3 -2
  210. package/dist/lang/fa.umd.prod.js +3 -2
  211. package/dist/lang/fi.umd.prod.js +3 -2
  212. package/dist/lang/fr.umd.prod.js +3 -2
  213. package/dist/lang/gn.umd.prod.js +3 -2
  214. package/dist/lang/he.umd.prod.js +3 -2
  215. package/dist/lang/hi.umd.prod.js +3 -2
  216. package/dist/lang/hr.umd.prod.js +3 -2
  217. package/dist/lang/hu.umd.prod.js +3 -2
  218. package/dist/lang/id.umd.prod.js +3 -2
  219. package/dist/lang/is.umd.prod.js +3 -2
  220. package/dist/lang/it.umd.prod.js +3 -2
  221. package/dist/lang/ja.umd.prod.js +3 -2
  222. package/dist/lang/kk.umd.prod.js +3 -2
  223. package/dist/lang/km.umd.prod.js +3 -2
  224. package/dist/lang/ko-KR.umd.prod.js +3 -2
  225. package/dist/lang/kur-CKB.umd.prod.js +3 -2
  226. package/dist/lang/lt.umd.prod.js +3 -2
  227. package/dist/lang/lu.umd.prod.js +3 -2
  228. package/dist/lang/lv.umd.prod.js +3 -2
  229. package/dist/lang/mk.umd.prod.js +3 -2
  230. package/dist/lang/ml.umd.prod.js +3 -2
  231. package/dist/lang/mm.umd.prod.js +3 -2
  232. package/dist/lang/ms.umd.prod.js +3 -2
  233. package/dist/lang/my.umd.prod.js +3 -2
  234. package/dist/lang/nb-NO.umd.prod.js +3 -2
  235. package/dist/lang/nl.umd.prod.js +3 -2
  236. package/dist/lang/pl.umd.prod.js +3 -2
  237. package/dist/lang/pt-BR.umd.prod.js +3 -2
  238. package/dist/lang/pt.umd.prod.js +3 -2
  239. package/dist/lang/ro.umd.prod.js +3 -2
  240. package/dist/lang/ru.umd.prod.js +3 -2
  241. package/dist/lang/sk.umd.prod.js +3 -2
  242. package/dist/lang/sl.umd.prod.js +3 -2
  243. package/dist/lang/sm.umd.prod.js +3 -2
  244. package/dist/lang/sr-CYR.umd.prod.js +3 -2
  245. package/dist/lang/sr.umd.prod.js +3 -2
  246. package/dist/lang/sv.umd.prod.js +3 -2
  247. package/dist/lang/ta.umd.prod.js +3 -2
  248. package/dist/lang/th.umd.prod.js +3 -2
  249. package/dist/lang/tl.umd.prod.js +7 -0
  250. package/dist/lang/tr.umd.prod.js +3 -2
  251. package/dist/lang/ug.umd.prod.js +3 -2
  252. package/dist/lang/uk.umd.prod.js +3 -2
  253. package/dist/lang/uz-Cyrl.umd.prod.js +3 -2
  254. package/dist/lang/uz-Latn.umd.prod.js +3 -2
  255. package/dist/lang/vi.umd.prod.js +3 -2
  256. package/dist/lang/zh-CN.umd.prod.js +3 -2
  257. package/dist/lang/zh-TW.umd.prod.js +3 -2
  258. package/dist/quasar.addon.prod.css +1 -1
  259. package/dist/quasar.addon.rtl.prod.css +1 -1
  260. package/dist/quasar.cjs.prod.js +123 -2
  261. package/dist/quasar.esm.js +16928 -26277
  262. package/dist/quasar.esm.prod.js +123 -2
  263. package/dist/quasar.prod.css +1 -1
  264. package/dist/quasar.rtl.prod.css +1 -1
  265. package/dist/quasar.sass +1 -1
  266. package/dist/quasar.umd.js +16732 -26521
  267. package/dist/quasar.umd.prod.js +123 -2
  268. package/dist/transforms/api-list.json +1 -153
  269. package/dist/transforms/auto-import.json +1 -267
  270. package/dist/transforms/import-map.json +1 -181
  271. package/dist/transforms/loader-asset-urls.json +1 -60
  272. package/dist/types/api/dialog.d.ts +1 -1
  273. package/dist/types/api/qinput.d.ts +1 -1
  274. package/dist/types/api/qtable.d.ts +1 -1
  275. package/dist/types/api/qtree.d.ts +1 -1
  276. package/dist/types/api/quploader.d.ts +1 -1
  277. package/dist/types/api/validation.d.ts +1 -1
  278. package/dist/types/api/web-storage.d.ts +6 -6
  279. package/dist/types/feature-flag.d.ts +1 -1
  280. package/dist/types/globals.d.ts +22 -15
  281. package/dist/types/index.d.ts +45 -36
  282. package/dist/types/lang.d.ts +3 -3
  283. package/dist/types/plugin.d.ts +3 -1
  284. package/dist/types/ts-helpers.d.ts +3 -3
  285. package/dist/types/utils/colors.d.ts +1 -1
  286. package/dist/types/utils/date.d.ts +10 -10
  287. package/dist/types/utils/dom.d.ts +1 -1
  288. package/dist/types/utils/run-sequential-promises.d.ts +12 -12
  289. package/dist/types/utils/scroll.d.ts +5 -5
  290. package/dist/types/utils.d.ts +15 -13
  291. package/dist/vetur/quasar-attributes.json +1 -5890
  292. package/dist/vetur/quasar-tags.json +1 -2084
  293. package/dist/web-types/web-types.json +1 -19595
  294. package/lang/index.json +1 -266
  295. package/lang/tl.js +98 -0
  296. package/lang/tl.mjs +93 -0
  297. package/package.json +14 -18
  298. package/src/body.js +6 -14
  299. package/src/components/ajax-bar/QAjaxBar.js +1 -1
  300. package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
  301. package/src/components/btn/QBtn.js +6 -6
  302. package/src/components/btn-dropdown/QBtnDropdown.json +1 -1
  303. package/src/components/checkbox/use-checkbox.js +1 -1
  304. package/src/components/chip/QChip.js +1 -1
  305. package/src/components/color/QColor.js +4 -4
  306. package/src/components/date/QDate.js +1 -1
  307. package/src/components/dialog/__tests__/DialogWrapper.vue +33 -0
  308. package/src/components/dialog/__tests__/QDialog.cy.js +450 -36
  309. package/src/components/drawer/QDrawer.js +1 -1
  310. package/src/components/drawer/QDrawer.json +1 -1
  311. package/src/components/file/QFile.js +2 -2
  312. package/src/components/footer/QFooter.js +2 -2
  313. package/src/components/form/QForm.js +3 -3
  314. package/src/components/header/QHeader.js +1 -1
  315. package/src/components/img/QImg.js +47 -39
  316. package/src/components/img/QImg.json +9 -0
  317. package/src/components/input/use-mask.js +3 -3
  318. package/src/components/menu/QMenu.json +1 -1
  319. package/src/components/page-sticky/use-page-sticky.js +4 -4
  320. package/src/components/popup-edit/QPopupEdit.js +1 -1
  321. package/src/components/scroll-area/QScrollArea.js +1 -1
  322. package/src/components/select/QSelect.js +9 -9
  323. package/src/components/table/QTd.js +1 -1
  324. package/src/components/table/QTh.js +1 -1
  325. package/src/components/tabs/QTabs.js +3 -3
  326. package/src/components/time/QTime.js +3 -3
  327. package/src/components/tooltip/QTooltip.js +4 -2
  328. package/src/components/tooltip/QTooltip.json +6 -0
  329. package/src/components/tree/QTree.js +1 -1
  330. package/src/components/uploader/uploader-core.js +2 -2
  331. package/src/components/uploader/xhr-uploader-plugin.js +1 -1
  332. package/src/components/virtual-scroll/use-virtual-scroll.js +3 -3
  333. package/src/composables/private/__tests__/use-model-toggle.cy.js +43 -3
  334. package/src/composables/private/use-anchor.js +1 -1
  335. package/src/composables/private/use-key-composition.js +1 -1
  336. package/src/composables/private/use-panel.js +1 -1
  337. package/src/composables/private/use-portal.js +1 -1
  338. package/src/composables/private/use-router-link.js +1 -1
  339. package/src/directives/TouchPan.js +1 -1
  340. package/src/history.js +1 -1
  341. package/src/index.umd.js +5 -1
  342. package/src/lang.js +1 -1
  343. package/src/plugins/BottomSheet.json +1 -1
  344. package/src/plugins/Cookies.js +1 -1
  345. package/src/plugins/Dark.js +1 -1
  346. package/src/plugins/Loading.js +1 -1
  347. package/src/plugins/LoadingBar.js +1 -1
  348. package/src/plugins/Notify.js +4 -4
  349. package/src/plugins/Platform.js +111 -93
  350. package/src/plugins/Screen.js +1 -1
  351. package/src/utils/event.js +1 -1
  352. package/src/utils/frame-debounce.js +1 -1
  353. package/src/utils/morph.js +1 -1
  354. package/src/utils/private/click-outside.js +1 -1
  355. package/src/utils/private/escape-key.js +1 -1
  356. package/src/utils/private/focusout.js +1 -1
@@ -47,7 +47,7 @@ export default createComponent({
47
47
 
48
48
  const fixed = computed(() =>
49
49
  props.reveal === true
50
- || $layout.view.value.indexOf('F') > -1
50
+ || $layout.view.value.indexOf('F') !== -1
51
51
  || ($q.platform.is.ios && $layout.isContainer.value === true)
52
52
  )
53
53
 
@@ -119,7 +119,7 @@ export default createComponent({
119
119
  }
120
120
 
121
121
  function updateRevealed () {
122
- if (props.reveal !== true) { return }
122
+ if (props.reveal !== true) return
123
123
 
124
124
  const { direction, position, inflectionPoint } = $layout.scroll.value
125
125
 
@@ -136,12 +136,12 @@ export default createComponent({
136
136
 
137
137
  function focus () {
138
138
  addFocusFn(() => {
139
- if (rootRef.value === null) { return }
139
+ if (rootRef.value === null) return
140
140
 
141
141
  const target = rootRef.value.querySelector('[autofocus][tabindex], [data-autofocus][tabindex]')
142
142
  || rootRef.value.querySelector('[autofocus] [tabindex], [data-autofocus] [tabindex]')
143
143
  || rootRef.value.querySelector('[autofocus], [data-autofocus]')
144
- || Array.prototype.find.call(rootRef.value.querySelectorAll('[tabindex]'), el => el.tabIndex > -1)
144
+ || Array.prototype.find.call(rootRef.value.querySelectorAll('[tabindex]'), el => el.tabIndex !== -1)
145
145
 
146
146
  target !== null && target !== void 0 && target.focus({ preventScroll: true })
147
147
  })
@@ -154,7 +154,7 @@ export default createComponent({
154
154
 
155
155
  unbindComponent (vmProxy) {
156
156
  const index = registeredComponents.indexOf(vmProxy)
157
- if (index > -1) {
157
+ if (index !== -1) {
158
158
  registeredComponents.splice(index, 1)
159
159
  }
160
160
  }
@@ -44,7 +44,7 @@ export default createComponent({
44
44
 
45
45
  const fixed = computed(() =>
46
46
  props.reveal === true
47
- || $layout.view.value.indexOf('H') > -1
47
+ || $layout.view.value.indexOf('H') !== -1
48
48
  || ($q.platform.is.ios && $layout.isContainer.value === true)
49
49
  )
50
50
 
@@ -1,4 +1,4 @@
1
- import { h, ref, computed, watch, onMounted, onBeforeUnmount, Transition } from 'vue'
1
+ import { h, ref, computed, watch, onMounted, Transition, getCurrentInstance } from 'vue'
2
2
 
3
3
  import QSpinner from '../spinner/QSpinner.js'
4
4
 
@@ -6,6 +6,8 @@ import useRatio, { useRatioProps } from '../../composables/private/use-ratio.js'
6
6
 
7
7
  import { createComponent } from '../../utils/private/create.js'
8
8
  import { hSlot } from '../../utils/private/render.js'
9
+ import { vmIsDestroyed } from '../../utils/private/vm.js'
10
+ import useTimeout from '../../composables/private/use-timeout.js'
9
11
 
10
12
  const defaultRatio = 16 / 9
11
13
 
@@ -30,6 +32,11 @@ export default createComponent({
30
32
  type: String,
31
33
  default: 'lazy'
32
34
  },
35
+ loadingShowDelay: {
36
+ type: [ Number, String ],
37
+ default: 0
38
+ },
39
+
33
40
  fetchpriority: {
34
41
  type: String,
35
42
  default: 'auto'
@@ -68,8 +75,10 @@ export default createComponent({
68
75
  setup (props, { slots, emit }) {
69
76
  const naturalRatio = ref(props.initialRatio)
70
77
  const ratioStyle = useRatio(props, naturalRatio)
78
+ const vm = getCurrentInstance()
71
79
 
72
- let loadTimer = null, isDestroyed = false
80
+ const { registerTimeout: registerLoadTimeout, removeTimeout: removeLoadTimeout } = useTimeout()
81
+ const { registerTimeout: registerLoadShowTimeout, removeTimeout: removeLoadShowTimeout } = useTimeout()
73
82
 
74
83
  const images = [
75
84
  ref(null),
@@ -103,6 +112,24 @@ export default createComponent({
103
112
 
104
113
  watch(() => getCurrentSrc(), addImage)
105
114
 
115
+ function setLoading () {
116
+ removeLoadShowTimeout()
117
+
118
+ if (props.loadingShowDelay === 0) {
119
+ isLoading.value = true
120
+ return
121
+ }
122
+
123
+ registerLoadShowTimeout(() => {
124
+ isLoading.value = true
125
+ }, props.loadingShowDelay)
126
+ }
127
+
128
+ function clearLoading () {
129
+ removeLoadShowTimeout()
130
+ isLoading.value = false
131
+ }
132
+
106
133
  function getCurrentSrc () {
107
134
  return props.src || props.srcset || props.sizes
108
135
  ? {
@@ -120,74 +147,64 @@ export default createComponent({
120
147
  }
121
148
 
122
149
  function addImage (imgProps) {
123
- if (loadTimer !== null) {
124
- clearTimeout(loadTimer)
125
- loadTimer = null
126
- }
127
-
150
+ removeLoadTimeout()
128
151
  hasError.value = false
129
152
 
130
153
  if (imgProps === null) {
131
- isLoading.value = false
154
+ clearLoading()
132
155
  images[ position.value ^ 1 ].value = getPlaceholderSrc()
133
156
  }
134
157
  else {
135
- isLoading.value = true
158
+ setLoading()
136
159
  }
137
160
 
138
161
  images[ position.value ].value = imgProps
139
162
  }
140
163
 
141
164
  function onLoad ({ target }) {
142
- if (isDestroyed === true) { return }
165
+ if (vmIsDestroyed(vm) === false) {
166
+ removeLoadTimeout()
143
167
 
144
- if (loadTimer !== null) {
145
- clearTimeout(loadTimer)
146
- loadTimer = null
147
- }
168
+ naturalRatio.value = target.naturalHeight === 0
169
+ ? 0.5
170
+ : target.naturalWidth / target.naturalHeight
148
171
 
149
- naturalRatio.value = target.naturalHeight === 0
150
- ? 0.5
151
- : target.naturalWidth / target.naturalHeight
152
-
153
- waitForCompleteness(target, 1)
172
+ waitForCompleteness(target, 1)
173
+ }
154
174
  }
155
175
 
156
176
  function waitForCompleteness (target, count) {
157
177
  // protect against running forever
158
- if (isDestroyed === true || count === 1000) { return }
178
+ if (count === 1000 || vmIsDestroyed(vm) === true) return
159
179
 
160
180
  if (target.complete === true) {
161
181
  onReady(target)
162
182
  }
163
183
  else {
164
- loadTimer = setTimeout(() => {
165
- loadTimer = null
184
+ registerLoadTimeout(() => {
166
185
  waitForCompleteness(target, count + 1)
167
186
  }, 50)
168
187
  }
169
188
  }
170
189
 
171
190
  function onReady (img) {
172
- if (isDestroyed === true) { return }
191
+ if (vmIsDestroyed(vm) === true) return
173
192
 
174
193
  position.value = position.value ^ 1
175
194
  images[ position.value ].value = null
176
- isLoading.value = false
195
+ clearLoading()
177
196
  hasError.value = false
178
197
  emit('load', img.currentSrc || img.src)
179
198
  }
180
199
 
181
200
  function onError (err) {
182
- if (loadTimer !== null) {
183
- clearTimeout(loadTimer)
184
- loadTimer = null
185
- }
201
+ removeLoadTimeout()
202
+ clearLoading()
186
203
 
187
- isLoading.value = false
188
204
  hasError.value = true
189
205
  images[ position.value ].value = null
190
206
  images[ position.value ^ 1 ].value = getPlaceholderSrc()
207
+
191
208
  emit('error', err)
192
209
  }
193
210
 
@@ -227,7 +244,7 @@ export default createComponent({
227
244
  }
228
245
 
229
246
  function getContent () {
230
- if (isLoading.value !== true) {
247
+ if (isLoading.value === false) {
231
248
  return h('div', {
232
249
  key: 'content',
233
250
  class: 'q-img__content absolute-full q-anchor--skip'
@@ -262,15 +279,6 @@ export default createComponent({
262
279
  else {
263
280
  addImage(getCurrentSrc())
264
281
  }
265
-
266
- onBeforeUnmount(() => {
267
- isDestroyed = true
268
-
269
- if (loadTimer !== null) {
270
- clearTimeout(loadTimer)
271
- loadTimer = null
272
- }
273
- })
274
282
  }
275
283
 
276
284
  return () => {
@@ -99,6 +99,15 @@
99
99
  "category": "behavior"
100
100
  },
101
101
 
102
+ "loading-show-delay": {
103
+ "type": [ "Number", "String" ],
104
+ "desc": "Delay showing the spinner when image changes; Gives time for the browser to load the image from cache to prevent flashing the spinner unnecessarily; Value should represent milliseconds",
105
+ "default": 0,
106
+ "examples": [ "500", "caption-lines=\"1000\"" ],
107
+ "category": "behavior",
108
+ "addedIn": "v2.14.6"
109
+ },
110
+
102
111
  "crossorigin": {
103
112
  "type": "String",
104
113
  "desc": "Same syntax as <img> crossorigin attribute",
@@ -97,7 +97,7 @@ export default function (props, emit, emitValue, inputRef) {
97
97
  let pad = '', localMaskMarked = maskMarked
98
98
  const padPos = localMaskMarked.indexOf(MARKER)
99
99
 
100
- if (padPos > -1) {
100
+ if (padPos !== -1) {
101
101
  for (let i = size - localMaskMarked.length; i > 0; i--) {
102
102
  pad += MARKER
103
103
  }
@@ -259,7 +259,7 @@ export default function (props, emit, emitValue, inputRef) {
259
259
  return
260
260
  }
261
261
 
262
- if ([ 'deleteContentBackward', 'deleteContentForward' ].indexOf(inputType) > -1) {
262
+ if ([ 'deleteContentBackward', 'deleteContentForward' ].indexOf(inputType) !== -1) {
263
263
  const cursor = props.reverseFillMask === true
264
264
  ? (
265
265
  end === 0
@@ -525,7 +525,7 @@ export default function (props, emit, emitValue, inputRef) {
525
525
 
526
526
  let valIndex = val.length - 1, output = ''
527
527
 
528
- for (let maskIndex = mask.length - 1; maskIndex >= 0 && valIndex > -1; maskIndex--) {
528
+ for (let maskIndex = mask.length - 1; maskIndex >= 0 && valIndex !== -1; maskIndex--) {
529
529
  const maskDef = mask[ maskIndex ]
530
530
 
531
531
  let valChar = val[ valIndex ]
@@ -63,7 +63,7 @@
63
63
 
64
64
  "persistent": {
65
65
  "type": "Boolean",
66
- "desc": "Allows the menu to not be dismissed by a click/tap outside of the menu or by hitting the ESC key",
66
+ "desc": "Allows the menu to not be dismissed by a click/tap outside of the menu or by hitting the ESC key; Also, an app route change won't dismiss it",
67
67
  "category": "behavior"
68
68
  },
69
69
 
@@ -33,10 +33,10 @@ export default function () {
33
33
  const pos = props.position
34
34
 
35
35
  return {
36
- top: pos.indexOf('top') > -1,
37
- right: pos.indexOf('right') > -1,
38
- bottom: pos.indexOf('bottom') > -1,
39
- left: pos.indexOf('left') > -1,
36
+ top: pos.indexOf('top') !== -1,
37
+ right: pos.indexOf('right') !== -1,
38
+ bottom: pos.indexOf('bottom') !== -1,
39
+ left: pos.indexOf('left') !== -1,
40
40
  vertical: pos === 'top' || pos === 'bottom',
41
41
  horizontal: pos === 'left' || pos === 'right'
42
42
  }
@@ -171,7 +171,7 @@ export default createComponent({
171
171
  })
172
172
 
173
173
  return () => {
174
- if (props.disable === true) { return }
174
+ if (props.disable === true) return
175
175
 
176
176
  return h(QMenu, {
177
177
  ref: menuRef,
@@ -394,7 +394,7 @@ export default createComponent({
394
394
  })
395
395
 
396
396
  onActivated(() => {
397
- if (scrollPosition === null) { return }
397
+ if (scrollPosition === null) return
398
398
 
399
399
  const scrollTarget = targetRef.value
400
400
 
@@ -446,7 +446,7 @@ export default createComponent({
446
446
  }
447
447
 
448
448
  function removeAtIndex (index) {
449
- if (index > -1 && index < innerValue.value.length) {
449
+ if (index !== -1 && index < innerValue.value.length) {
450
450
  if (props.multiple === true) {
451
451
  const model = props.modelValue.slice()
452
452
  emit('remove', { index, value: model.splice(index, 1)[ 0 ] })
@@ -542,7 +542,7 @@ export default createComponent({
542
542
  model = props.modelValue.slice(),
543
543
  index = innerOptionsValue.value.findIndex(v => isDeepEqual(v, optValue))
544
544
 
545
- if (index > -1) {
545
+ if (index !== -1) {
546
546
  emit('remove', { index, value: model.splice(index, 1)[ 0 ] })
547
547
  }
548
548
  else {
@@ -560,9 +560,9 @@ export default createComponent({
560
560
  }
561
561
 
562
562
  function setOptionIndex (index) {
563
- if ($q.platform.is.desktop !== true) { return }
563
+ if ($q.platform.is.desktop !== true) return
564
564
 
565
- const val = index > -1 && index < virtualScrollLength.value
565
+ const val = index !== -1 && index < virtualScrollLength.value
566
566
  ? index
567
567
  : -1
568
568
 
@@ -716,7 +716,7 @@ export default createComponent({
716
716
 
717
717
  const tabShouldSelect = e.shiftKey !== true
718
718
  && props.multiple !== true
719
- && (optionIndex.value > -1 || newValueModeValid === true)
719
+ && (optionIndex.value !== -1 || newValueModeValid === true)
720
720
 
721
721
  // escape
722
722
  if (e.keyCode === 27) {
@@ -734,7 +734,7 @@ export default createComponent({
734
734
  e.target === void 0
735
735
  || e.target.id !== state.targetUid.value
736
736
  || state.editable.value !== true
737
- ) { return }
737
+ ) return
738
738
 
739
739
  // down
740
740
  if (
@@ -828,7 +828,7 @@ export default createComponent({
828
828
  searchBuffer += char
829
829
  }
830
830
 
831
- const searchRe = new RegExp('^' + searchBuffer.split('').map(l => (reEscapeList.indexOf(l) > -1 ? '\\' + l : l)).join('.*'), 'i')
831
+ const searchRe = new RegExp('^' + searchBuffer.split('').map(l => (reEscapeList.indexOf(l) !== -1 ? '\\' + l : l)).join('.*'), 'i')
832
832
 
833
833
  let index = optionIndex.value
834
834
 
@@ -862,11 +862,11 @@ export default createComponent({
862
862
  e.keyCode !== 13
863
863
  && (e.keyCode !== 32 || props.useInput === true || searchBuffer !== '')
864
864
  && (e.keyCode !== 9 || tabShouldSelect === false)
865
- ) { return }
865
+ ) return
866
866
 
867
867
  e.keyCode !== 9 && stopAndPrevent(e)
868
868
 
869
- if (optionIndex.value > -1 && optionIndex.value < optionsLength) {
869
+ if (optionIndex.value !== -1 && optionIndex.value < optionsLength) {
870
870
  toggleOption(props.options[ optionIndex.value ])
871
871
  return
872
872
  }
@@ -31,7 +31,7 @@ export default createComponent({
31
31
  || props.props.col
32
32
  )
33
33
 
34
- if (col === void 0) { return }
34
+ if (col === void 0) return
35
35
 
36
36
  const { row } = props.props
37
37
 
@@ -34,7 +34,7 @@ export default createComponent({
34
34
 
35
35
  if (name) {
36
36
  col = props.props.colsMap[ name ]
37
- if (col === void 0) { return }
37
+ if (col === void 0) return
38
38
  }
39
39
  else {
40
40
  col = props.props.col
@@ -188,7 +188,7 @@ export default createComponent({
188
188
  // it can be called faster than component being initialized
189
189
  // so we need to protect against that case
190
190
  // (one example of such case is the docs release notes page)
191
- if (domProps.value === void 0 || contentRef.value === null) { return }
191
+ if (domProps.value === void 0 || contentRef.value === null) return
192
192
 
193
193
  const
194
194
  size = domSize[ domProps.value.container ],
@@ -279,7 +279,7 @@ export default createComponent({
279
279
 
280
280
  function updateArrows () {
281
281
  const content = contentRef.value
282
- if (content === null) { return }
282
+ if (content === null) return
283
283
 
284
284
  const
285
285
  rect = content.getBoundingClientRect(),
@@ -328,7 +328,7 @@ export default createComponent({
328
328
  )
329
329
 
330
330
  const len = tabs.length
331
- if (len === 0) { return }
331
+ if (len === 0) return
332
332
 
333
333
  if (keyCode === 36) { // Home
334
334
  scrollToTabEl(tabs[ 0 ])
@@ -567,7 +567,7 @@ export default createComponent({
567
567
  ? validHours.value.values
568
568
  : validHours.value[ isAM.value === true ? 'am' : 'pm' ].values
569
569
 
570
- if (values.length === 0) { return }
570
+ if (values.length === 0) return
571
571
 
572
572
  if (innerModel.value.hour === null) {
573
573
  setHour(values[ 0 ])
@@ -603,7 +603,7 @@ export default createComponent({
603
603
  if (validMinutes.value !== null) {
604
604
  const values = validMinutes.value.values
605
605
 
606
- if (values.length === 0) { return }
606
+ if (values.length === 0) return
607
607
 
608
608
  if (innerModel.value.minute === null) {
609
609
  setMinute(values[ 0 ])
@@ -635,7 +635,7 @@ export default createComponent({
635
635
  if (validSeconds.value !== null) {
636
636
  const values = validSeconds.value.values
637
637
 
638
- if (values.length === 0) { return }
638
+ if (values.length === 0) return
639
639
 
640
640
  if (innerModel.value.seconds === null) {
641
641
  setSecond(values[ 0 ])
@@ -72,7 +72,9 @@ export default createComponent({
72
72
  hideDelay: {
73
73
  type: Number,
74
74
  default: 0
75
- }
75
+ },
76
+
77
+ persistent: Boolean
76
78
  },
77
79
 
78
80
  emits: [
@@ -241,7 +243,7 @@ export default createComponent({
241
243
  }
242
244
 
243
245
  function configureAnchorEl () {
244
- if (props.noParentEvent === true || anchorEl.value === null) { return }
246
+ if (props.noParentEvent === true || anchorEl.value === null) return
245
247
 
246
248
  const evts = $q.platform.is.mobile === true
247
249
  ? [
@@ -96,6 +96,12 @@
96
96
  "desc": "Configure Tooltip to disappear with delay",
97
97
  "default": 0,
98
98
  "category": "behavior"
99
+ },
100
+
101
+ "persistent": {
102
+ "type": "Boolean",
103
+ "desc": "Prevents Tooltip from auto-closing when app's route changes",
104
+ "category": "behavior"
99
105
  }
100
106
  },
101
107
 
@@ -129,7 +129,7 @@ export default createComponent({
129
129
  : (node, filter) => {
130
130
  const filt = filter.toLowerCase()
131
131
  return node[ props.labelKey ]
132
- && node[ props.labelKey ].toLowerCase().indexOf(filt) > -1
132
+ && node[ props.labelKey ].toLowerCase().indexOf(filt) !== -1
133
133
  }
134
134
  ))
135
135
 
@@ -229,7 +229,7 @@ export function getRenderer (getPlugin, expose) {
229
229
  }
230
230
 
231
231
  function removeFile (file) {
232
- if (props.disable) { return }
232
+ if (props.disable) return
233
233
 
234
234
  if (file.__status === 'uploaded') {
235
235
  state.uploadedFiles.value = state.uploadedFiles.value.filter(f => f.__key !== file.__key)
@@ -274,7 +274,7 @@ export function getRenderer (getPlugin, expose) {
274
274
  fileInput.value = ''
275
275
  }
276
276
 
277
- if (localFiles === void 0) { return }
277
+ if (localFiles === void 0) return
278
278
 
279
279
  localFiles.forEach(file => {
280
280
  state.updateFileStatus(file, 'idle')
@@ -156,7 +156,7 @@ function injectPlugin ({ props, emit, helpers }) {
156
156
  aborted
157
157
 
158
158
  xhr.upload.addEventListener('progress', e => {
159
- if (aborted === true) { return }
159
+ if (aborted === true) return
160
160
 
161
161
  const loaded = Math.min(maxUploadSize, e.loaded)
162
162
 
@@ -301,7 +301,7 @@ export function useVirtualScroll ({
301
301
  scrollDetails,
302
302
  Math.min(virtualScrollLength.value - 1, Math.max(0, parseInt(toIndex, 10) || 0)),
303
303
  0,
304
- scrollToEdges.indexOf(edge) > -1 ? edge : (prevToIndex > -1 && toIndex > prevToIndex ? 'end' : 'start')
304
+ scrollToEdges.indexOf(edge) !== -1 ? edge : (prevToIndex !== -1 && toIndex > prevToIndex ? 'end' : 'start')
305
305
  )
306
306
  }
307
307
 
@@ -391,7 +391,7 @@ export function useVirtualScroll ({
391
391
  }
392
392
 
393
393
  function setVirtualScrollSliceRange (scrollEl, scrollDetails, toIndex, offset, align) {
394
- const alignForce = typeof align === 'string' && align.indexOf('-force') > -1
394
+ const alignForce = typeof align === 'string' && align.indexOf('-force') !== -1
395
395
  const alignEnd = alignForce === true ? align.replace('-force', '') : align
396
396
  const alignRange = alignEnd !== void 0 ? alignEnd : 'start'
397
397
 
@@ -710,7 +710,7 @@ export function useVirtualScroll ({
710
710
  })
711
711
 
712
712
  onActivated(() => {
713
- if (shouldActivate !== true) { return }
713
+ if (shouldActivate !== true) return
714
714
 
715
715
  const scrollEl = getVirtualScrollTarget()
716
716
 
@@ -153,7 +153,11 @@ describe('use-model-toggle API', () => {
153
153
  const fn = cy.stub()
154
154
  cy.mount(WrapperOne, {
155
155
  props: {
156
- onHide: fn
156
+ onHide: fn,
157
+ // After the dialog has been closed, the hide event is fired only after transitionDuration.
158
+ // The default value for transitionDuration is 300ms. Hence, we cannot depend on the dialog closing
159
+ // to conclude that the event has been fired. So let's set it to 0 so that it fires immediately.
160
+ transitionDuration: 0
157
161
  }
158
162
  })
159
163
 
@@ -165,6 +169,9 @@ describe('use-model-toggle API', () => {
165
169
  .then(() => {
166
170
  expect(fn).not.to.be.called
167
171
  })
172
+
173
+ // We are clicking x distance from the left to ensure it always clicks on the body
174
+ // For some reason it some times does not work without it
168
175
  cy.get('body')
169
176
  .click(499, 0)
170
177
  cy.dataCy('menu')
@@ -174,11 +181,15 @@ describe('use-model-toggle API', () => {
174
181
  })
175
182
  })
176
183
 
177
- it('should emit @hide event when component is triggered with the show() method', () => {
184
+ it('should emit @hide event when component is triggered with the hide() method', () => {
178
185
  const fn = cy.stub()
179
186
  cy.mount(WrapperOne, {
180
187
  props: {
181
- onHide: fn
188
+ onHide: fn,
189
+ // After the dialog has been closed, the hide event is fired only after transitionDuration.
190
+ // The default value for transitionDuration is 300ms. Hence, we cannot depend on the dialog closing
191
+ // to conclude that the event has been fired. So let's set it to 0 so that it fires immediately.
192
+ transitionDuration: 0
182
193
  }
183
194
  })
184
195
 
@@ -199,6 +210,35 @@ describe('use-model-toggle API', () => {
199
210
  expect(fn).to.be.called
200
211
  })
201
212
  })
213
+
214
+ it('should emit @hide event after transition duration', () => {
215
+ const fn = cy.stub()
216
+ cy.mount(WrapperOne, {
217
+ props: {
218
+ onHide: fn,
219
+ transitionDuration: 500
220
+ }
221
+ })
222
+
223
+ expect(fn).not.to.be.called
224
+ cy.dataCy('method-show')
225
+ .click({ force: true })
226
+
227
+ cy.dataCy('wrapper')
228
+ cy.dataCy('method-hide')
229
+ .click({ force: true })
230
+
231
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
232
+ cy.dataCy('menu')
233
+ .wait(300)
234
+ .then(() => {
235
+ expect(fn).not.to.be.called
236
+ })
237
+ .wait(500)
238
+ .then(() => {
239
+ expect(fn).to.be.called
240
+ })
241
+ })
202
242
  })
203
243
 
204
244
  describe('(event): before-hide', () => {
@@ -101,7 +101,7 @@ export default function ({
101
101
  })
102
102
 
103
103
  configureAnchorEl = function (context = props.contextMenu) {
104
- if (props.noParentEvent === true || anchorEl.value === null) { return }
104
+ if (props.noParentEvent === true || anchorEl.value === null) return
105
105
 
106
106
  let evts
107
107
 
@@ -8,7 +8,7 @@ const isPlainText = /[a-z0-9_ -]$/i
8
8
  export default function (onInput) {
9
9
  return function onComposition (e) {
10
10
  if (e.type === 'compositionend' || e.type === 'change') {
11
- if (e.target.qComposing !== true) { return }
11
+ if (e.target.qComposing !== true) return
12
12
  e.target.qComposing = false
13
13
  onInput(e)
14
14
  }