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
@@ -88,13 +88,13 @@ export default createComponent({
88
88
  const forceHex = computed(() => (
89
89
  props.formatModel === 'auto'
90
90
  ? null
91
- : props.formatModel.indexOf('hex') > -1
91
+ : props.formatModel.indexOf('hex') !== -1
92
92
  ))
93
93
 
94
94
  const forceAlpha = computed(() => (
95
95
  props.formatModel === 'auto'
96
96
  ? null
97
- : props.formatModel.indexOf('a') > -1
97
+ : props.formatModel.indexOf('a') !== -1
98
98
  ))
99
99
 
100
100
  const topView = ref(
@@ -230,7 +230,7 @@ export default createComponent({
230
230
  : (
231
231
  props.formatModel === 'auto'
232
232
  ? null
233
- : props.formatModel.indexOf('a') > -1
233
+ : props.formatModel.indexOf('a') !== -1
234
234
  )
235
235
 
236
236
  if (typeof v !== 'string' || v.length === 0 || testPattern.anyColor(v.replace(/ /g, '')) !== true) {
@@ -261,7 +261,7 @@ export default createComponent({
261
261
 
262
262
  function changeSpectrum (left, top, change) {
263
263
  const panel = spectrumRef.value
264
- if (panel === null) { return }
264
+ if (panel === null) return
265
265
 
266
266
  const
267
267
  width = panel.clientWidth,
@@ -1081,7 +1081,7 @@ export default createComponent({
1081
1081
  }
1082
1082
 
1083
1083
  function getHeader () {
1084
- if (props.minimal === true) { return }
1084
+ if (props.minimal === true) return
1085
1085
 
1086
1086
  return h('div', {
1087
1087
  class: 'q-date__header ' + headerClass.value
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <q-dialog ref="dialogRef" v-bind="$attrs">
3
+ <q-card>
4
+ <q-card-section>
5
+ <q-btn label="Dialog Button" data-cy="dialog-button"/>
6
+ </q-card-section>
7
+ </q-card>
8
+ </q-dialog>
9
+
10
+ <q-input data-cy="input-field"/>
11
+ </template>
12
+
13
+ <script>
14
+ import { defineComponent, ref } from 'vue'
15
+
16
+ export default defineComponent({
17
+ inheritAttrs: false,
18
+ setup () {
19
+ const dialogRef = ref(null)
20
+
21
+ function focus () {
22
+ dialogRef.value.focus()
23
+ }
24
+
25
+ function shake () {
26
+ dialogRef.value.shake()
27
+ }
28
+
29
+ return { dialogRef, focus, shake }
30
+ }
31
+ })
32
+
33
+ </script>
@@ -1,21 +1,127 @@
1
+ import DialogWrapper from './DialogWrapper.vue'
2
+ import { ref } from 'vue'
3
+ import { vModelAdapter } from '@quasar/quasar-app-extension-testing-e2e-cypress'
4
+
5
+ function mountQDialogWrapper (options) {
6
+ return cy.mount(DialogWrapper, options)
7
+ }
8
+
9
+ function closeDialogViaBackdrop () {
10
+ return cy.get('.q-dialog__backdrop').click({ force: true })
11
+ }
12
+
13
+ // TODO: this only works in `withinDialog` context,
14
+ // as when using it outside it `.root()` will yeld "html" tag
15
+ // and Cypress won't be able to find anything with `.closest('body')`
16
+ // since it only searches upwards
17
+ function closeDialogViaEscKey () {
18
+ // Official way to escape `within` context
19
+ // https://docs.cypress.io/api/commands/within#Temporarily-escape
20
+ return cy.root().closest('body').type('{esc}')
21
+ }
22
+
23
+ // TODO: we'll add this check to the AE helper to automatically test persistent dialogs
24
+ // TODO: take into consideration that seamless dialogs have always 'aria-modal' false
25
+ // TODO: take into consideration that dialogs without backdrop have always 'aria-modal' false
26
+ // Check if there's a more reliable way to check for persistent dialogs
27
+ function assertPersistentDialogExists () {
28
+ cy.get('.q-dialog__inner').should('not.have.attr', 'aria-modal', 'false')
29
+ }
30
+
1
31
  describe('Dialog API', () => {
2
32
  describe('Props', () => {
3
33
  describe('Category: behavior', () => {
4
34
  describe('(prop): persistent', () => {
5
- it.skip(' ', () => {
6
- //
35
+ it('should display a persistent dialog', () => {
36
+ const model = ref(true)
37
+ mountQDialogWrapper({
38
+ props: {
39
+ ...vModelAdapter(model),
40
+ persistent: true
41
+ }
42
+ })
43
+
44
+ cy.withinDialog({
45
+ persistent: true,
46
+ fn: () => {
47
+ closeDialogViaBackdrop()
48
+ }
49
+ })
50
+
51
+ assertPersistentDialogExists()
52
+
53
+ cy.withinDialog({
54
+ persistent: true,
55
+ fn: () => {
56
+ closeDialogViaEscKey()
57
+ }
58
+ })
59
+
60
+ assertPersistentDialogExists()
7
61
  })
8
62
  })
9
63
 
10
64
  describe('(prop): no-esc-dismiss', () => {
11
- it.skip(' ', () => {
12
- //
65
+ it('should not allow closing the dialog with the escape key', () => {
66
+ const model = ref(true)
67
+ mountQDialogWrapper({
68
+ props: {
69
+ ...vModelAdapter(model),
70
+ noEscDismiss: true
71
+ }
72
+ })
73
+
74
+ cy.withinDialog({
75
+ persistent: true,
76
+ fn: () => {
77
+ closeDialogViaEscKey()
78
+ }
79
+ })
80
+
81
+ assertPersistentDialogExists()
82
+
83
+ cy.wrap()
84
+ .then(async () => {
85
+ // Care as you need to wait setProps to complete its execution
86
+ // before moving on or the tests will fail due to the race condition
87
+ await Cypress.vueWrapper.setProps({ noEscDismiss: false })
88
+ })
89
+
90
+ cy.withinDialog(() => {
91
+ closeDialogViaEscKey()
92
+ })
13
93
  })
14
94
  })
15
95
 
16
96
  describe('(prop): no-backdrop-dismiss', () => {
17
- it.skip(' ', () => {
18
- //
97
+ it('should not close dialog with backdrop', () => {
98
+ const model = ref(true)
99
+ mountQDialogWrapper({
100
+ props: {
101
+ ...vModelAdapter(model),
102
+ noBackdropDismiss: true
103
+ }
104
+ })
105
+
106
+ cy.withinDialog({
107
+ persistent: true,
108
+ fn: () => {
109
+ closeDialogViaBackdrop()
110
+ }
111
+ })
112
+
113
+ assertPersistentDialogExists()
114
+
115
+ cy.wrap()
116
+ .then(async () => {
117
+ // Care as you need to wait setProps to complete its execution
118
+ // before moving on or the tests will fail due to the race condition
119
+ await Cypress.vueWrapper.setProps({ noBackdropDismiss: false })
120
+ })
121
+
122
+ cy.withinDialog(() => {
123
+ closeDialogViaBackdrop()
124
+ })
19
125
  })
20
126
  })
21
127
 
@@ -26,66 +132,294 @@ describe('Dialog API', () => {
26
132
  })
27
133
 
28
134
  describe('(prop): auto-close', () => {
29
- it.skip(' ', () => {
30
- //
135
+ it('should auto-close the dialog', () => {
136
+ const model = ref(true)
137
+ mountQDialogWrapper({
138
+ props: {
139
+ ...vModelAdapter(model),
140
+ autoClose: true
141
+ }
142
+ })
143
+
144
+ cy.withinDialog(() => {
145
+ cy.dataCy('dialog-button').click()
146
+ })
31
147
  })
32
148
  })
33
149
 
34
150
  describe('(prop): no-refocus', () => {
35
- it.skip(' ', () => {
36
- //
151
+ it('should not refocus on the DOM element that had focus', () => {
152
+ const model = ref(false)
153
+
154
+ mountQDialogWrapper({
155
+ props: {
156
+ ...vModelAdapter(model),
157
+ noRefocus: false
158
+ }
159
+ })
160
+
161
+ // Test the input field regaining focus
162
+ cy.dataCy('input-field')
163
+ .focus()
164
+ cy.dataCy('input-field')
165
+ .then(() => {
166
+ model.value = true
167
+ })
168
+ cy.withinDialog(() => {
169
+ closeDialogViaBackdrop()
170
+ })
171
+
172
+ cy.dataCy('input-field')
173
+ .should('have.focus')
174
+
175
+ // Test the input field not regaining focus
176
+ cy.dataCy('input-field')
177
+ .then(async () => {
178
+ await Cypress.vueWrapper.setProps({ noRefocus: true })
179
+ model.value = true
180
+ })
181
+
182
+ cy.withinDialog(() => {
183
+ closeDialogViaBackdrop()
184
+ })
185
+ cy.dataCy('input-field')
186
+ .should('not.have.focus')
37
187
  })
38
188
  })
39
189
 
40
190
  describe('(prop): no-focus', () => {
41
- it.skip(' ', () => {
42
- //
191
+ it('should not focus on dialog when switching to it', () => {
192
+ const model = ref(true)
193
+ mountQDialogWrapper({
194
+ props: {
195
+ ...vModelAdapter(model),
196
+ noFocus: false
197
+ }
198
+ })
199
+
200
+ cy.withinDialog(() => {
201
+ cy.focused()
202
+ .should('have.class', 'q-dialog__inner')
203
+ closeDialogViaBackdrop()
204
+ })
205
+
206
+ cy.wrap().then(async () => {
207
+ await Cypress.vueWrapper.setProps({ noFocus: true })
208
+ model.value = true
209
+ })
210
+
211
+ cy.withinDialog(() => {
212
+ cy.focused().should('not.exist')
213
+ closeDialogViaBackdrop()
214
+ })
43
215
  })
44
216
  })
45
217
 
46
218
  describe('(prop): no-shake', () => {
47
- it.skip(' ', () => {
48
- //
219
+ it('should not shake dialog', () => {
220
+ const model = ref(true)
221
+ mountQDialogWrapper({
222
+ props: {
223
+ ...vModelAdapter(model),
224
+ persistent: true
225
+ }
226
+ })
227
+
228
+ cy.withinDialog({
229
+ persistent: true,
230
+ fn: () => {
231
+ closeDialogViaBackdrop()
232
+ cy.get('.q-dialog__inner')
233
+ .should('have.class', 'q-animate--scale')
234
+ }
235
+ })
236
+
237
+ assertPersistentDialogExists()
238
+
239
+ cy.wrap().then(async () => {
240
+ await Cypress.vueWrapper.setProps({ noShake: true })
241
+ })
242
+
243
+ cy.withinDialog({
244
+ persistent: true, fn: () => {
245
+ closeDialogViaBackdrop()
246
+ cy.get('.q-dialog__inner')
247
+ .should('not.have.class', 'q-animate--scale')
248
+ }
249
+ })
250
+
251
+ assertPersistentDialogExists()
49
252
  })
50
253
  })
51
254
  })
52
255
 
53
256
  describe('Category: content', () => {
54
257
  describe('(prop): seamless', () => {
55
- it.skip(' ', () => {
56
- //
258
+ it('should put the dialog in a seamless state', () => {
259
+ const model = ref(true)
260
+ mountQDialogWrapper({
261
+ props: {
262
+ ...vModelAdapter(model),
263
+ seamless: true
264
+ }
265
+ })
266
+
267
+ cy.withinDialog(() => {
268
+ cy.root()
269
+ .should('have.class', 'q-dialog--seamless')
270
+
271
+ // When in seamless state, the dialog isn't modal
272
+ // We check this by checking out if the underlying input is visible
273
+ cy.root()
274
+ .closest('body')
275
+ .dataCy('input-field')
276
+ .should('be.visible')
277
+ .then(async () => {
278
+ await Cypress.vueWrapper.setProps({ seamless: false })
279
+ })
280
+
281
+ cy.root()
282
+ .should('not.have.class', 'q-dialog--seamless')
283
+
284
+ cy.root()
285
+ .closest('body')
286
+ .dataCy('input-field')
287
+ .should('not.be.visible')
288
+
289
+ closeDialogViaBackdrop()
290
+ })
57
291
  })
58
292
  })
59
293
 
60
294
  describe('(prop): maximized', () => {
61
- it.skip(' ', () => {
62
- //
295
+ it('should maximize the dialog', () => {
296
+ const model = ref(true)
297
+ mountQDialogWrapper({
298
+ props: {
299
+ ...vModelAdapter(model),
300
+ maximized: true
301
+ }
302
+ })
303
+
304
+ cy.withinDialog(() => {
305
+ cy.get('.q-dialog__inner')
306
+ .should('have.class', 'q-dialog__inner--maximized')
307
+ .then(async () => {
308
+ await Cypress.vueWrapper.setProps({ maximized: false })
309
+ })
310
+
311
+ cy.get('.q-dialog__inner')
312
+ .should('not.have.class', 'q-dialog__inner--maximized')
313
+
314
+ closeDialogViaBackdrop()
315
+ })
63
316
  })
64
317
  })
65
318
 
66
319
  describe('(prop): full-width', () => {
67
- it.skip(' ', () => {
68
- //
320
+ it('should use a full-width for the dialog', () => {
321
+ const model = ref(true)
322
+ mountQDialogWrapper({
323
+ props: {
324
+ ...vModelAdapter(model),
325
+ fullWidth: true
326
+ }
327
+ })
328
+
329
+ cy.withinDialog(() => {
330
+ cy.get('.q-dialog__inner')
331
+ .should('have.class', 'q-dialog__inner--fullwidth')
332
+ .then(async () => {
333
+ await Cypress.vueWrapper.setProps({ fullWidth: false })
334
+ })
335
+
336
+ cy.get('.q-dialog__inner')
337
+ .should('not.have.class', 'q-dialog__inner--fullwidth')
338
+
339
+ // We are closing the dialog here and in other places where it is not necessary because
340
+ // withinDialog expects the dialog to be closed when called like this
341
+ closeDialogViaBackdrop()
342
+ })
69
343
  })
70
344
  })
71
345
 
72
346
  describe('(prop): full-height', () => {
73
- it.skip(' ', () => {
74
- //
347
+ it('should set the dialog to full-height', () => {
348
+ const model = ref(true)
349
+ mountQDialogWrapper({
350
+ props: {
351
+ ...vModelAdapter(model),
352
+ fullHeight: true
353
+ }
354
+ })
355
+
356
+ cy.withinDialog(() => {
357
+ cy.get('.q-dialog__inner')
358
+ .should('have.class', 'q-dialog__inner--fullheight')
359
+ .then(async () => {
360
+ await Cypress.vueWrapper.setProps({ fullHeight: false })
361
+ })
362
+
363
+ cy.get('.q-dialog__inner')
364
+ .should('not.have.class', 'q-dialog__inner--fullheight')
365
+
366
+ closeDialogViaBackdrop()
367
+ })
75
368
  })
76
369
  })
77
370
 
78
371
  describe('(prop): position', () => {
79
- it.skip(' ', () => {
80
- //
372
+ it('should display the dialog at a specific position', () => {
373
+ const model = ref(true)
374
+ mountQDialogWrapper({
375
+ props: {
376
+ ...vModelAdapter(model)
377
+ }
378
+ })
379
+
380
+ const positions = [ 'top', 'right', 'bottom', 'left' ]
381
+
382
+ for (const position of positions) {
383
+ cy.wrap().then(async () => {
384
+ await Cypress.vueWrapper.setProps({ position })
385
+ })
386
+
387
+ cy.withinDialog({
388
+ persistent: true,
389
+ fn: () => {
390
+ cy.get('.q-dialog__inner')
391
+ .should('have.class', `q-dialog__inner--${ position }`)
392
+ .should('have.class', `fixed-${ position }`)
393
+ }
394
+ })
395
+ }
81
396
  })
82
397
  })
83
398
  })
84
399
 
85
400
  describe('Category: style', () => {
86
401
  describe('(prop): square', () => {
87
- it.skip(' ', () => {
88
- //
402
+ it('should use a square style for dialog', () => {
403
+ const model = ref(true)
404
+ mountQDialogWrapper({
405
+ props: {
406
+ ...vModelAdapter(model),
407
+ square: true
408
+ }
409
+ })
410
+
411
+ cy.withinDialog(() => {
412
+ cy.get('.q-dialog__inner')
413
+ .should('have.class', 'q-dialog__inner--square')
414
+ .then(async () => {
415
+ await Cypress.vueWrapper.setProps({ square: false })
416
+ })
417
+
418
+ cy.get('.q-dialog__inner')
419
+ .should('not.have.class', 'q-dialog__inner--square')
420
+
421
+ closeDialogViaBackdrop()
422
+ })
89
423
  })
90
424
  })
91
425
  })
@@ -93,36 +427,116 @@ describe('Dialog API', () => {
93
427
 
94
428
  describe('Slots', () => {
95
429
  describe('(slot): default', () => {
96
- it.skip(' ', () => {
97
- //
430
+ it('should display a default slot', () => {
431
+ const model = ref(true)
432
+ mountQDialogWrapper({
433
+ props: {
434
+ ...vModelAdapter(model)
435
+ }
436
+ })
437
+
438
+ // Host element is the default slot, so let's simply test that it exists
439
+ cy.dataCy('dialog-button').should('exist')
98
440
  })
99
441
  })
100
442
  })
101
443
 
102
444
  describe('Events', () => {
103
445
  describe('(event): shake', () => {
104
- it.skip(' ', () => {
105
- //
446
+ it('should emit shake event', () => {
447
+ const fn = cy.stub()
448
+ const model = ref(true)
449
+ mountQDialogWrapper({
450
+ props: {
451
+ ...vModelAdapter(model),
452
+ persistent: true,
453
+ onShake: fn
454
+ }
455
+ })
456
+
457
+ cy.withinDialog({
458
+ persistent: true,
459
+ fn: () => {
460
+ closeDialogViaBackdrop()
461
+
462
+ cy.get('.q-dialog__inner')
463
+ .should('have.class', 'q-animate--scale')
464
+ .then(() => {
465
+ expect(fn).to.be.calledWith()
466
+ })
467
+ }
468
+ })
106
469
  })
107
470
  })
108
471
 
109
472
  describe('(event): escape-key', () => {
110
- it.skip(' ', () => {
111
- //
473
+ it('should emit escape-key event', () => {
474
+ const fn = cy.stub()
475
+ const model = ref(true)
476
+ mountQDialogWrapper({
477
+ props: {
478
+ ...vModelAdapter(model),
479
+ onEscapeKey: fn
480
+ }
481
+ })
482
+
483
+ cy.withinDialog(() => {
484
+ closeDialogViaEscKey()
485
+ })
486
+
487
+ cy.wrap().then(() => {
488
+ expect(fn).to.be.calledWith()
489
+ })
112
490
  })
113
491
  })
114
492
  })
115
493
 
116
494
  describe('Methods', () => {
117
495
  describe('(method): focus', () => {
118
- it.skip(' ', () => {
119
- //
496
+ it('should use the focus method to focus on dialog', () => {
497
+ const model = ref(true)
498
+ mountQDialogWrapper({
499
+ props: {
500
+ ...vModelAdapter(model),
501
+ seamless: true
502
+ }
503
+ })
504
+
505
+ cy.focused().should('have.class', 'q-dialog__inner')
506
+ cy.dataCy('input-field').focus()
507
+ cy.focused().should('not.have.class', 'q-dialog__inner')
508
+
509
+ cy.wrap().then(async () => {
510
+ await Cypress.vueWrapper.vm.focus()
511
+ })
512
+ cy.focused().should('have.class', 'q-dialog__inner')
120
513
  })
121
514
  })
122
515
 
123
516
  describe('(method): shake', () => {
124
- it.skip(' ', () => {
125
- //
517
+ it('should use the shake method to shake dialog', () => {
518
+ const model = ref(true)
519
+ mountQDialogWrapper({
520
+ props: {
521
+ ...vModelAdapter(model),
522
+ persistent: true
523
+ }
524
+ })
525
+
526
+ cy.withinDialog({
527
+ persistent: true,
528
+ fn: () => {
529
+ cy.get('.q-dialog__inner')
530
+ .should('not.have.class', 'q-animate--scale')
531
+
532
+ cy.wrap().then(async () => {
533
+ await Cypress.vueWrapper.vm.shake()
534
+ })
535
+
536
+ cy.get('.q-dialog__inner')
537
+ .should('have.class', 'q-animate--scale')
538
+ }
539
+ })
126
540
  })
127
541
  })
128
542
  })
@@ -193,7 +193,7 @@ export default createComponent({
193
193
  const fixed = computed(() =>
194
194
  props.overlay === true
195
195
  || props.miniToOverlay === true
196
- || $layout.view.value.indexOf(rightSide.value ? 'R' : 'L') > -1
196
+ || $layout.view.value.indexOf(rightSide.value ? 'R' : 'L') !== -1
197
197
  || ($q.platform.is.ios === true && $layout.isContainer.value === true)
198
198
  )
199
199
 
@@ -89,7 +89,7 @@
89
89
 
90
90
  "persistent": {
91
91
  "type": "Boolean",
92
- "desc": "Prevents drawer from auto-closing when app's route changes",
92
+ "desc": "Prevents drawer from auto-closing when app's route changes; Also, an app route change won't hide it",
93
93
  "category": "behavior"
94
94
  },
95
95
 
@@ -121,7 +121,7 @@ export default createComponent({
121
121
 
122
122
  function removeFile (file) {
123
123
  const index = innerValue.value.indexOf(file)
124
- if (index > -1) {
124
+ if (index !== -1) {
125
125
  removeAtIndex(index)
126
126
  }
127
127
  }
@@ -155,7 +155,7 @@ export default createComponent({
155
155
  }
156
156
 
157
157
  // if nothing to do...
158
- if (files === void 0) { return }
158
+ if (files === void 0) return
159
159
 
160
160
  // protect against input @change being called in a loop
161
161
  // like it happens on Safari, so don't emit same thing: