quasar 2.15.3 → 2.16.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.
- package/dist/api/AppFullscreen.json +1 -1
- package/dist/api/Brand.json +1 -1
- package/dist/api/QBreadcrumbs.json +1 -1
- package/dist/api/QBreadcrumbsEl.json +1 -1
- package/dist/api/QBtnDropdown.json +1 -1
- package/dist/api/QCarousel.json +1 -1
- package/dist/api/QCheckbox.json +1 -1
- package/dist/api/QCircularProgress.json +1 -1
- package/dist/api/QDialog.json +1 -1
- package/dist/api/QDrawer.json +1 -1
- package/dist/api/QEditor.json +1 -1
- package/dist/api/QExpansionItem.json +1 -1
- package/dist/api/QFab.json +1 -1
- package/dist/api/QFabAction.json +1 -1
- package/dist/api/QField.json +1 -1
- package/dist/api/QFile.json +1 -1
- package/dist/api/QImg.json +1 -1
- package/dist/api/QInnerLoading.json +1 -1
- package/dist/api/QInput.json +1 -1
- package/dist/api/QIntersection.json +1 -1
- package/dist/api/QItem.json +1 -1
- package/dist/api/QKnob.json +1 -1
- package/dist/api/QMenu.json +1 -1
- package/dist/api/QPage.json +1 -1
- package/dist/api/QPagination.json +1 -1
- package/dist/api/QParallax.json +1 -1
- package/dist/api/QPopupEdit.json +1 -1
- package/dist/api/QRadio.json +1 -1
- package/dist/api/QRange.json +1 -1
- package/dist/api/QRouteTab.json +1 -1
- package/dist/api/QSelect.json +1 -1
- package/dist/api/QSeparator.json +1 -1
- package/dist/api/QSkeleton.json +1 -1
- package/dist/api/QSlider.json +1 -1
- package/dist/api/QSpinner.json +1 -1
- package/dist/api/QSpinnerAudio.json +1 -1
- package/dist/api/QSpinnerBall.json +1 -1
- package/dist/api/QSpinnerBars.json +1 -1
- package/dist/api/QSpinnerBox.json +1 -1
- package/dist/api/QSpinnerClock.json +1 -1
- package/dist/api/QSpinnerComment.json +1 -1
- package/dist/api/QSpinnerCube.json +1 -1
- package/dist/api/QSpinnerDots.json +1 -1
- package/dist/api/QSpinnerFacebook.json +1 -1
- package/dist/api/QSpinnerGears.json +1 -1
- package/dist/api/QSpinnerGrid.json +1 -1
- package/dist/api/QSpinnerHearts.json +1 -1
- package/dist/api/QSpinnerHourglass.json +1 -1
- package/dist/api/QSpinnerInfinity.json +1 -1
- package/dist/api/QSpinnerIos.json +1 -1
- package/dist/api/QSpinnerOrbit.json +1 -1
- package/dist/api/QSpinnerOval.json +1 -1
- package/dist/api/QSpinnerPie.json +1 -1
- package/dist/api/QSpinnerPuff.json +1 -1
- package/dist/api/QSpinnerRadio.json +1 -1
- package/dist/api/QSpinnerRings.json +1 -1
- package/dist/api/QSpinnerTail.json +1 -1
- package/dist/api/QSplitter.json +1 -1
- package/dist/api/QStepper.json +1 -1
- package/dist/api/QTabPanels.json +1 -1
- package/dist/api/QTable.json +1 -1
- package/dist/api/QTimeline.json +1 -1
- package/dist/api/QToggle.json +1 -1
- package/dist/api/QTooltip.json +1 -1
- package/dist/api/QTree.json +1 -1
- package/dist/api/QVirtualScroll.json +1 -1
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +1 -1
- package/dist/lang/ar.umd.prod.js +1 -1
- package/dist/lang/az-Latn.umd.prod.js +1 -1
- package/dist/lang/bg.umd.prod.js +1 -1
- package/dist/lang/bn.umd.prod.js +1 -1
- package/dist/lang/ca.umd.prod.js +1 -1
- package/dist/lang/cs.umd.prod.js +1 -1
- package/dist/lang/da.umd.prod.js +1 -1
- package/dist/lang/de-CH.umd.prod.js +1 -1
- package/dist/lang/de-DE.umd.prod.js +1 -1
- package/dist/lang/de.umd.prod.js +1 -1
- package/dist/lang/el.umd.prod.js +1 -1
- package/dist/lang/en-GB.umd.prod.js +1 -1
- package/dist/lang/en-US.umd.prod.js +1 -1
- package/dist/lang/eo.umd.prod.js +1 -1
- package/dist/lang/es.umd.prod.js +1 -1
- package/dist/lang/et.umd.prod.js +1 -1
- package/dist/lang/eu.umd.prod.js +1 -1
- package/dist/lang/fa-IR.umd.prod.js +1 -1
- package/dist/lang/fa.umd.prod.js +1 -1
- package/dist/lang/fi.umd.prod.js +1 -1
- package/dist/lang/fr.umd.prod.js +1 -1
- package/dist/lang/gn.umd.prod.js +1 -1
- package/dist/lang/he.umd.prod.js +1 -1
- package/dist/lang/hi.umd.prod.js +1 -1
- package/dist/lang/hr.umd.prod.js +1 -1
- package/dist/lang/hu.umd.prod.js +1 -1
- package/dist/lang/id.umd.prod.js +1 -1
- package/dist/lang/is.umd.prod.js +1 -1
- package/dist/lang/it.umd.prod.js +1 -1
- package/dist/lang/ja.umd.prod.js +1 -1
- package/dist/lang/kk.umd.prod.js +1 -1
- package/dist/lang/km.umd.prod.js +1 -1
- package/dist/lang/ko-KR.umd.prod.js +1 -1
- package/dist/lang/kur-CKB.umd.prod.js +1 -1
- package/dist/lang/lt.umd.prod.js +1 -1
- package/dist/lang/lu.umd.prod.js +1 -1
- package/dist/lang/lv.umd.prod.js +1 -1
- package/dist/lang/mk.umd.prod.js +1 -1
- package/dist/lang/ml.umd.prod.js +1 -1
- package/dist/lang/mm.umd.prod.js +1 -1
- package/dist/lang/ms-MY.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +1 -1
- package/dist/lang/nb-NO.umd.prod.js +1 -1
- package/dist/lang/nl.umd.prod.js +1 -1
- package/dist/lang/pl.umd.prod.js +1 -1
- package/dist/lang/pt-BR.umd.prod.js +1 -1
- package/dist/lang/pt.umd.prod.js +1 -1
- package/dist/lang/ro.umd.prod.js +1 -1
- package/dist/lang/ru.umd.prod.js +1 -1
- package/dist/lang/sk.umd.prod.js +1 -1
- package/dist/lang/sl.umd.prod.js +1 -1
- package/dist/lang/sm.umd.prod.js +1 -1
- package/dist/lang/sr-CYR.umd.prod.js +1 -1
- package/dist/lang/sr.umd.prod.js +1 -1
- package/dist/lang/sv.umd.prod.js +1 -1
- package/dist/lang/ta.umd.prod.js +1 -1
- package/dist/lang/th.umd.prod.js +1 -1
- package/dist/lang/tl.umd.prod.js +1 -1
- package/dist/lang/tr.umd.prod.js +1 -1
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +1 -1
- package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
- package/dist/lang/uz-Latn.umd.prod.js +1 -1
- package/dist/lang/vi.umd.prod.js +1 -1
- package/dist/lang/zh-CN.umd.prod.js +1 -1
- package/dist/lang/zh-TW.umd.prod.js +1 -1
- package/dist/{quasar.esm.js → quasar.client.js} +337 -364
- package/dist/quasar.sass +1 -1
- package/dist/quasar.server.prod.cjs +127 -0
- package/dist/quasar.server.prod.js +127 -0
- package/dist/quasar.umd.js +337 -363
- package/dist/quasar.umd.prod.js +8 -8
- package/dist/transforms/api-list.json +1 -1
- package/dist/types/index.d.ts +191 -93
- package/dist/vetur/quasar-attributes.json +1 -1
- package/dist/vetur/quasar-tags.json +1 -1
- package/dist/web-types/web-types.json +1 -1
- package/icon-set/bootstrap-icons.js +3 -8
- package/icon-set/eva-icons.js +3 -8
- package/icon-set/fontawesome-v5-pro.js +1 -6
- package/icon-set/fontawesome-v5.js +1 -6
- package/icon-set/fontawesome-v6-pro.js +1 -6
- package/icon-set/fontawesome-v6.js +1 -6
- package/icon-set/ionicons-v4.js +3 -8
- package/icon-set/line-awesome.js +1 -6
- package/icon-set/material-icons-outlined.js +1 -6
- package/icon-set/material-icons-round.js +1 -6
- package/icon-set/material-icons-sharp.js +1 -6
- package/icon-set/material-icons.js +1 -6
- package/icon-set/material-symbols-outlined.js +1 -6
- package/icon-set/material-symbols-rounded.js +1 -6
- package/icon-set/material-symbols-sharp.js +1 -6
- package/icon-set/mdi-v3.js +1 -6
- package/icon-set/mdi-v4.js +1 -6
- package/icon-set/mdi-v5.js +1 -6
- package/icon-set/mdi-v6.js +1 -6
- package/icon-set/mdi-v7.js +1 -6
- package/icon-set/svg-bootstrap-icons.js +6 -6
- package/icon-set/svg-eva-icons.js +6 -6
- package/icon-set/svg-fontawesome-v5.js +3 -3
- package/icon-set/svg-fontawesome-v6.js +4 -5
- package/icon-set/svg-ionicons-v4.js +6 -6
- package/icon-set/svg-ionicons-v5.js +5 -5
- package/icon-set/svg-ionicons-v6.js +5 -5
- package/icon-set/svg-line-awesome.js +4 -5
- package/icon-set/svg-material-icons-outlined.js +4 -5
- package/icon-set/svg-material-icons-round.js +4 -5
- package/icon-set/svg-material-icons-sharp.js +4 -5
- package/icon-set/svg-material-icons.js +4 -5
- package/icon-set/svg-material-symbols-outlined.js +4 -4
- package/icon-set/svg-material-symbols-rounded.js +4 -4
- package/icon-set/svg-material-symbols-sharp.js +4 -4
- package/icon-set/svg-mdi-v6.js +4 -5
- package/icon-set/svg-mdi-v7.js +4 -4
- package/icon-set/svg-themify.js +6 -6
- package/icon-set/themify.js +3 -8
- package/lang/ar-TN.js +1 -6
- package/lang/ar.js +1 -6
- package/lang/az-Latn.js +1 -6
- package/lang/bg.js +1 -6
- package/lang/bn.js +1 -6
- package/lang/ca.js +1 -6
- package/lang/cs.js +1 -6
- package/lang/da.js +1 -6
- package/lang/de-CH.js +1 -6
- package/lang/de-DE.js +1 -6
- package/lang/de.js +1 -6
- package/lang/el.js +1 -6
- package/lang/en-GB.js +1 -6
- package/lang/en-US.js +1 -6
- package/lang/eo.js +1 -6
- package/lang/es.js +1 -6
- package/lang/et.js +1 -6
- package/lang/eu.js +1 -6
- package/lang/fa-IR.js +1 -6
- package/lang/fa.js +1 -6
- package/lang/fi.js +1 -6
- package/lang/fr.js +1 -6
- package/lang/gn.js +1 -6
- package/lang/he.js +1 -6
- package/lang/hi.js +1 -6
- package/lang/hr.js +1 -6
- package/lang/hu.js +1 -6
- package/lang/id.js +1 -6
- package/lang/is.js +1 -6
- package/lang/it.js +1 -6
- package/lang/ja.js +1 -6
- package/lang/kk.js +1 -6
- package/lang/km.js +1 -6
- package/lang/ko-KR.js +1 -6
- package/lang/kur-CKB.js +1 -6
- package/lang/lt.js +1 -6
- package/lang/lu.js +1 -6
- package/lang/lv.js +1 -6
- package/lang/mk.js +1 -6
- package/lang/ml.js +1 -6
- package/lang/mm.js +1 -6
- package/lang/ms-MY.js +1 -6
- package/lang/ms.js +1 -6
- package/lang/my.js +1 -6
- package/lang/nb-NO.js +1 -6
- package/lang/nl.js +1 -6
- package/lang/pl.js +1 -6
- package/lang/pt-BR.js +1 -6
- package/lang/pt.js +1 -6
- package/lang/ro.js +1 -6
- package/lang/ru.js +1 -6
- package/lang/sk.js +1 -6
- package/lang/sl.js +1 -6
- package/lang/sm.js +1 -6
- package/lang/sr-CYR.js +1 -6
- package/lang/sr.js +1 -6
- package/lang/sv.js +1 -6
- package/lang/ta.js +1 -6
- package/lang/th.js +1 -6
- package/lang/tl.js +1 -6
- package/lang/tr.js +1 -6
- package/lang/ug.js +1 -6
- package/lang/uk.js +1 -6
- package/lang/uz-Cyrl.js +1 -6
- package/lang/uz-Latn.js +1 -6
- package/lang/vi.js +1 -6
- package/lang/zh-CN.js +1 -6
- package/lang/zh-TW.js +1 -6
- package/package.json +20 -9
- package/src/components/avatar/QAvatar.test.js +0 -28
- package/src/components/badge/QBadge.test.js +0 -36
- package/src/components/banner/QBanner.test.js +0 -16
- package/src/components/bar/QBar.test.js +0 -8
- package/src/components/breadcrumbs/QBreadcrumbs.json +2 -1
- package/src/components/breadcrumbs/QBreadcrumbs.test.js +1 -21
- package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +0 -51
- package/src/components/btn/QBtn.json +6 -1
- package/src/components/btn/QBtn.test.js +0 -143
- package/src/components/btn/use-btn.js +8 -4
- package/src/components/btn/use-btn.test.js +9 -1
- package/src/components/btn-dropdown/QBtnDropdown.js +3 -3
- package/src/components/btn-dropdown/QBtnDropdown.json +1 -4
- package/src/components/btn-toggle/QBtnToggle.json +3 -1
- package/src/components/card/QCardActions.json +1 -0
- package/src/components/carousel/QCarousel.js +4 -3
- package/src/components/carousel/QCarousel.json +6 -3
- package/src/components/checkbox/use-checkbox.json +1 -1
- package/src/components/chip/QChip.test.js +0 -108
- package/src/components/circular-progress/QCircularProgress.json +0 -1
- package/src/components/color/QColor.json +1 -0
- package/src/components/date/QDate.js +8 -2
- package/src/components/date/QDate.json +1 -0
- package/src/components/date/use-datetime.js +1 -3
- package/src/components/dialog/QDialog.js +1 -2
- package/src/components/dialog/QDialog.json +11 -1
- package/src/components/dialog/QDialog.test.js +38 -160
- package/src/components/drawer/QDrawer.json +2 -2
- package/src/components/editor/QEditor.js +3 -8
- package/src/components/editor/QEditor.json +9 -2
- package/src/components/expansion-item/QExpansionItem.js +1 -1
- package/src/components/expansion-item/QExpansionItem.json +5 -6
- package/src/components/fab/QFab.js +1 -0
- package/src/components/fab/QFab.json +5 -4
- package/src/components/fab/QFabAction.json +2 -1
- package/src/components/fab/use-fab.json +2 -1
- package/src/components/field/QField.json +0 -39
- package/src/components/file/QFile.js +2 -2
- package/src/components/file/QFile.json +2 -7
- package/src/components/footer/QFooter.json +3 -1
- package/src/components/form/QForm.js +1 -1
- package/src/components/header/QHeader.json +3 -1
- package/src/components/img/QImg.json +1 -1
- package/src/components/infinite-scroll/QInfiniteScroll.js +7 -6
- package/src/components/inner-loading/QInnerLoading.js +1 -1
- package/src/components/inner-loading/QInnerLoading.json +1 -0
- package/src/components/input/QInput.js +2 -1
- package/src/components/input/QInput.json +7 -24
- package/src/components/intersection/QIntersection.json +1 -1
- package/src/components/item/QItem.json +3 -1
- package/src/components/knob/QKnob.json +11 -2
- package/src/components/menu/QMenu.js +2 -4
- package/src/components/menu/QMenu.json +3 -1
- package/src/components/option-group/QOptionGroup.js +1 -0
- package/src/components/page/QPage.json +1 -2
- package/src/components/page-scroller/QPageScroller.js +1 -0
- package/src/components/page-scroller/QPageScroller.json +4 -0
- package/src/components/page-sticky/QPageSticky.js +1 -1
- package/src/components/pagination/QPagination.json +7 -2
- package/src/components/parallax/QParallax.js +2 -4
- package/src/components/parallax/QParallax.json +1 -0
- package/src/components/popup-edit/QPopupEdit.json +2 -1
- package/src/components/pull-to-refresh/QPullToRefresh.js +2 -4
- package/src/components/radio/QRadio.json +2 -2
- package/src/components/range/QRange.json +1 -0
- package/src/components/scroll-observer/QScrollObserver.js +2 -4
- package/src/components/select/QSelect.js +7 -7
- package/src/components/select/QSelect.json +27 -16
- package/src/components/separator/QSeparator.json +0 -1
- package/src/components/skeleton/QSkeleton.json +1 -1
- package/src/components/slider/QSlider.json +1 -0
- package/src/components/slider/use-slider.js +0 -2
- package/src/components/spinner/QSpinner.json +1 -5
- package/src/components/spinner/QSpinner.test.js +79 -0
- package/src/components/spinner/QSpinnerAudio.test.js +59 -0
- package/src/components/spinner/QSpinnerBall.test.js +59 -0
- package/src/components/spinner/QSpinnerBars.test.js +59 -0
- package/src/components/spinner/QSpinnerBox.test.js +59 -0
- package/src/components/spinner/QSpinnerClock.test.js +59 -0
- package/src/components/spinner/QSpinnerComment.test.js +59 -0
- package/src/components/spinner/QSpinnerCube.test.js +59 -0
- package/src/components/spinner/QSpinnerDots.test.js +59 -0
- package/src/components/spinner/QSpinnerFacebook.test.js +59 -0
- package/src/components/spinner/QSpinnerGears.test.js +59 -0
- package/src/components/spinner/QSpinnerGrid.test.js +59 -0
- package/src/components/spinner/QSpinnerHearts.test.js +59 -0
- package/src/components/spinner/QSpinnerHourglass.test.js +59 -0
- package/src/components/spinner/QSpinnerInfinity.test.js +59 -0
- package/src/components/spinner/QSpinnerIos.test.js +59 -0
- package/src/components/spinner/QSpinnerOrbit.test.js +59 -0
- package/src/components/spinner/QSpinnerOval.test.js +59 -0
- package/src/components/spinner/QSpinnerPie.test.js +59 -0
- package/src/components/spinner/QSpinnerPuff.test.js +59 -0
- package/src/components/spinner/QSpinnerRadio.test.js +59 -0
- package/src/components/spinner/QSpinnerRings.test.js +59 -0
- package/src/components/spinner/QSpinnerTail.test.js +59 -0
- package/src/components/spinner/spinner.json +5 -0
- package/src/components/spinner/use-spinner.js +1 -1
- package/src/components/spinner/use-spinner.test.js +59 -0
- package/src/components/splitter/QSplitter.json +3 -3
- package/src/components/stepper/QStep.json +6 -0
- package/src/components/tab-panels/QTabPanels.json +6 -0
- package/src/components/table/QTable.js +6 -8
- package/src/components/table/QTable.json +13 -8
- package/src/components/table/QTh.json +4 -0
- package/src/components/tabs/QRouteTab.json +3 -2
- package/src/components/tabs/QTab.json +1 -65
- package/src/components/tabs/use-tab.json +72 -0
- package/src/components/time/QTime.js +6 -0
- package/src/components/time/QTime.json +2 -0
- package/src/components/timeline/QTimeline.json +2 -1
- package/src/components/toolbar/QToolbar.test.js +41 -0
- package/src/components/toolbar/QToolbarTitle.test.js +41 -0
- package/src/components/tooltip/QTooltip.js +6 -6
- package/src/components/tooltip/QTooltip.json +6 -15
- package/src/components/tree/QTree.js +1 -1
- package/src/components/tree/QTree.json +2 -1
- package/src/components/uploader/xhr-uploader-plugin.js +1 -3
- package/src/components/video/QVideo.test.js +0 -24
- package/src/components/virtual-scroll/QVirtualScroll.js +2 -4
- package/src/components/virtual-scroll/QVirtualScroll.json +0 -1
- package/src/components/virtual-scroll/use-virtual-scroll.js +2 -2
- package/src/components/virtual-scroll/use-virtual-scroll.json +1 -1
- package/src/composables/private.use-anchor/use-anchor-static.json +22 -0
- package/src/composables/private.use-anchor/use-anchor.js +13 -4
- package/src/composables/private.use-anchor/use-anchor.json +2 -19
- package/src/composables/private.use-field/use-field.js +6 -3
- package/src/composables/private.use-field/use-field.json +22 -0
- package/src/composables/private.use-fullscreen/use-fullscreen.json +10 -0
- package/src/composables/private.use-model-toggle/use-model-toggle.json +4 -2
- package/src/composables/private.use-panel/use-panel.json +3 -0
- package/src/composables/private.use-portal/use-portal.js +1 -1
- package/src/composables/private.use-router-link/use-router-link.js +15 -9
- package/src/composables/private.use-router-link/use-router-link.json +2 -0
- package/src/composables/private.use-validate/use-validate.json +1 -0
- package/src/composables/use-id/use-id.test.js +0 -1
- package/src/composables/use-interval/use-interval.test.js +173 -0
- package/src/composables/use-render-cache/use-render-cache.js +2 -2
- package/src/composables/use-render-cache/use-render-cache.test.js +73 -0
- package/src/composables/use-split-attrs/use-split-attrs.test.js +55 -0
- package/src/composables/use-tick/use-tick.test.js +118 -0
- package/src/composables/use-timeout/use-timeout.test.js +169 -0
- package/src/install-quasar.js +1 -1
- package/src/plugins/addressbar/AddressbarColor.test.js +53 -0
- package/src/plugins/app-fullscreen/AppFullscreen.js +1 -1
- package/src/plugins/app-fullscreen/AppFullscreen.json +3 -1
- package/src/plugins/app-fullscreen/AppFullscreen.test.js +206 -0
- package/src/plugins/app-fullscreen/test/mock-fullscreen.js +43 -0
- package/src/plugins/app-visibility/AppVisibility.test.js +45 -0
- package/src/plugins/bottom-sheet/BottomSheet.js +1 -1
- package/src/plugins/bottom-sheet/BottomSheet.json +1 -1
- package/src/plugins/dark/Dark.test.js +158 -0
- package/src/plugins/dialog/Dialog.js +1 -1
- package/src/plugins/dialog/Dialog.json +1 -1
- package/src/plugins/icon-set/IconSet.js +1 -2
- package/src/plugins/icon-set/IconSet.test.js +2 -2
- package/src/plugins/lang/Lang.js +1 -2
- package/src/plugins/lang/Lang.test.js +2 -2
- package/src/plugins/loading/Loading.js +1 -1
- package/src/plugins/loading-bar/LoadingBar.js +1 -1
- package/src/plugins/notify/Notify.js +1 -1
- package/src/plugins/platform/Platform.js +2 -1
- package/src/plugins/private.body/Body.test.js +28 -0
- package/src/plugins/private.history/History.test.js +38 -0
- package/src/plugins/screen/Screen.test.js +453 -0
- package/src/utils/css-var/get-css-var.test.js +12 -0
- package/src/utils/css-var/set-css-var.test.js +18 -0
- package/src/utils/dom/dom.test.js +222 -0
- package/src/utils/{private.global/global-config.test.js → private.config/instance-config.test.js} +2 -2
- package/src/utils/{private.global/global-nodes.js → private.config/nodes.js} +1 -1
- package/src/utils/{private.global/global-nodes.test.js → private.config/nodes.test.js} +3 -3
- package/src/utils/{private.global/global-dialog.js → private.dialog/create-dialog.js} +1 -1
- package/src/utils/private.render/render.test.js +187 -0
- package/src/utils/private.selection/selection.test.js +40 -0
- package/src/utils/private.vm/vm.test.js +175 -0
- package/src/utils/scroll/scroll.js +4 -0
- package/wrappers/{index.mjs → index.cjs} +15 -15
- package/wrappers/index.js +15 -15
- package/dist/quasar.cjs.prod.js +0 -127
- package/dist/quasar.esm.prod.js +0 -127
- package/dist/transforms/import-transformation.js +0 -9
- package/icon-set/bootstrap-icons.mjs +0 -136
- package/icon-set/eva-icons.mjs +0 -186
- package/icon-set/fontawesome-v5-pro.mjs +0 -128
- package/icon-set/fontawesome-v5.mjs +0 -128
- package/icon-set/fontawesome-v6-pro.mjs +0 -128
- package/icon-set/fontawesome-v6.mjs +0 -128
- package/icon-set/ionicons-v4.mjs +0 -180
- package/icon-set/line-awesome.mjs +0 -128
- package/icon-set/material-icons-outlined.mjs +0 -128
- package/icon-set/material-icons-round.mjs +0 -128
- package/icon-set/material-icons-sharp.mjs +0 -128
- package/icon-set/material-icons.mjs +0 -128
- package/icon-set/material-symbols-outlined.mjs +0 -128
- package/icon-set/material-symbols-rounded.mjs +0 -128
- package/icon-set/material-symbols-sharp.mjs +0 -128
- package/icon-set/mdi-v3.mjs +0 -141
- package/icon-set/mdi-v4.mjs +0 -141
- package/icon-set/mdi-v5.mjs +0 -141
- package/icon-set/mdi-v6.mjs +0 -141
- package/icon-set/mdi-v7.mjs +0 -141
- package/icon-set/svg-bootstrap-icons.mjs +0 -210
- package/icon-set/svg-eva-icons.mjs +0 -233
- package/icon-set/svg-fontawesome-v5.mjs +0 -197
- package/icon-set/svg-fontawesome-v6.mjs +0 -198
- package/icon-set/svg-ionicons-v4.mjs +0 -234
- package/icon-set/svg-ionicons-v5.mjs +0 -225
- package/icon-set/svg-ionicons-v6.mjs +0 -224
- package/icon-set/svg-line-awesome.mjs +0 -198
- package/icon-set/svg-material-icons-outlined.mjs +0 -203
- package/icon-set/svg-material-icons-round.mjs +0 -203
- package/icon-set/svg-material-icons-sharp.mjs +0 -203
- package/icon-set/svg-material-icons.mjs +0 -203
- package/icon-set/svg-material-symbols-outlined.mjs +0 -201
- package/icon-set/svg-material-symbols-rounded.mjs +0 -201
- package/icon-set/svg-material-symbols-sharp.mjs +0 -201
- package/icon-set/svg-mdi-v6.mjs +0 -225
- package/icon-set/svg-mdi-v7.mjs +0 -224
- package/icon-set/svg-themify.mjs +0 -231
- package/icon-set/themify.mjs +0 -169
- package/lang/ar-TN.mjs +0 -98
- package/lang/ar.mjs +0 -98
- package/lang/az-Latn.mjs +0 -93
- package/lang/bg.mjs +0 -93
- package/lang/bn.mjs +0 -93
- package/lang/ca.mjs +0 -93
- package/lang/cs.mjs +0 -104
- package/lang/da.mjs +0 -93
- package/lang/de-CH.mjs +0 -93
- package/lang/de-DE.mjs +0 -93
- package/lang/de.mjs +0 -93
- package/lang/el.mjs +0 -93
- package/lang/en-GB.mjs +0 -93
- package/lang/en-US.mjs +0 -93
- package/lang/eo.mjs +0 -93
- package/lang/es.mjs +0 -93
- package/lang/et.mjs +0 -93
- package/lang/eu.mjs +0 -93
- package/lang/fa-IR.mjs +0 -94
- package/lang/fa.mjs +0 -94
- package/lang/fi.mjs +0 -94
- package/lang/fr.mjs +0 -96
- package/lang/gn.mjs +0 -93
- package/lang/he.mjs +0 -94
- package/lang/hi.mjs +0 -93
- package/lang/hr.mjs +0 -93
- package/lang/hu.mjs +0 -93
- package/lang/id.mjs +0 -93
- package/lang/is.mjs +0 -93
- package/lang/it.mjs +0 -93
- package/lang/ja.mjs +0 -92
- package/lang/kk.mjs +0 -97
- package/lang/km.mjs +0 -93
- package/lang/ko-KR.mjs +0 -93
- package/lang/kur-CKB.mjs +0 -103
- package/lang/lt.mjs +0 -105
- package/lang/lu.mjs +0 -93
- package/lang/lv.mjs +0 -93
- package/lang/mk.mjs +0 -93
- package/lang/ml.mjs +0 -97
- package/lang/mm.mjs +0 -94
- package/lang/ms-MY.mjs +0 -96
- package/lang/ms.mjs +0 -93
- package/lang/my.mjs +0 -92
- package/lang/nb-NO.mjs +0 -94
- package/lang/nl.mjs +0 -93
- package/lang/pl.mjs +0 -93
- package/lang/pt-BR.mjs +0 -93
- package/lang/pt.mjs +0 -93
- package/lang/ro.mjs +0 -93
- package/lang/ru.mjs +0 -97
- package/lang/sk.mjs +0 -93
- package/lang/sl.mjs +0 -93
- package/lang/sm.mjs +0 -93
- package/lang/sr-CYR.mjs +0 -93
- package/lang/sr.mjs +0 -93
- package/lang/sv.mjs +0 -93
- package/lang/ta.mjs +0 -93
- package/lang/th.mjs +0 -93
- package/lang/tl.mjs +0 -93
- package/lang/tr.mjs +0 -89
- package/lang/ug.mjs +0 -93
- package/lang/uk.mjs +0 -97
- package/lang/uz-Cyrl.mjs +0 -95
- package/lang/uz-Latn.mjs +0 -99
- package/lang/vi.mjs +0 -93
- package/lang/zh-CN.mjs +0 -92
- package/lang/zh-TW.mjs +0 -92
- /package/src/utils/{private.global/global-config.js → private.config/instance-config.js} +0 -0
- /package/src/utils/{private.global/global-dialog.json → private.dialog/create-dialog.json} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { defineComponent } from 'vue'
|
|
4
|
+
|
|
5
|
+
import useInterval from './use-interval.js'
|
|
6
|
+
|
|
7
|
+
let wrapper
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
vi.useFakeTimers()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
vi.clearAllTimers()
|
|
15
|
+
vi.restoreAllMocks()
|
|
16
|
+
|
|
17
|
+
if (wrapper !== null) {
|
|
18
|
+
wrapper.unmount()
|
|
19
|
+
wrapper = null
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
describe('[useInterval API]', () => {
|
|
24
|
+
describe('[Functions]', () => {
|
|
25
|
+
describe('[(function)default]', () => {
|
|
26
|
+
test('correctly registers an interval (int)', () => {
|
|
27
|
+
const fn = vi.fn()
|
|
28
|
+
|
|
29
|
+
wrapper = mount(
|
|
30
|
+
defineComponent({
|
|
31
|
+
template: '<div />',
|
|
32
|
+
setup () {
|
|
33
|
+
const { registerInterval } = useInterval()
|
|
34
|
+
|
|
35
|
+
registerInterval(fn, 100)
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
expect(fn).not.toHaveBeenCalled()
|
|
42
|
+
vi.advanceTimersByTime(99)
|
|
43
|
+
expect(fn).not.toHaveBeenCalled()
|
|
44
|
+
vi.advanceTimersByTime(1)
|
|
45
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
46
|
+
|
|
47
|
+
vi.advanceTimersByTime(100)
|
|
48
|
+
|
|
49
|
+
expect(fn).toHaveBeenCalledTimes(2)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
test('correctly registers an interval (str)', () => {
|
|
53
|
+
const fn = vi.fn()
|
|
54
|
+
|
|
55
|
+
wrapper = mount(
|
|
56
|
+
defineComponent({
|
|
57
|
+
template: '<div />',
|
|
58
|
+
setup () {
|
|
59
|
+
const { registerInterval } = useInterval()
|
|
60
|
+
|
|
61
|
+
registerInterval(fn, '100')
|
|
62
|
+
return {}
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
expect(fn).not.toHaveBeenCalled()
|
|
68
|
+
vi.advanceTimersByTime(99)
|
|
69
|
+
expect(fn).not.toHaveBeenCalled()
|
|
70
|
+
vi.advanceTimersByTime(1)
|
|
71
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
72
|
+
|
|
73
|
+
vi.advanceTimersByTime(100)
|
|
74
|
+
|
|
75
|
+
expect(fn).toHaveBeenCalledTimes(2)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('removeInterval works correctly', () => {
|
|
79
|
+
const fn = vi.fn()
|
|
80
|
+
|
|
81
|
+
wrapper = mount(
|
|
82
|
+
defineComponent({
|
|
83
|
+
template: '<div />',
|
|
84
|
+
setup () {
|
|
85
|
+
const {
|
|
86
|
+
registerInterval,
|
|
87
|
+
removeInterval
|
|
88
|
+
} = useInterval()
|
|
89
|
+
|
|
90
|
+
registerInterval(fn, 100)
|
|
91
|
+
return { registerInterval, removeInterval }
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
expect(fn).not.toHaveBeenCalled()
|
|
97
|
+
vi.advanceTimersByTime(200)
|
|
98
|
+
expect(fn).toHaveBeenCalledTimes(2)
|
|
99
|
+
|
|
100
|
+
wrapper.vm.removeInterval()
|
|
101
|
+
vi.advanceTimersToNextTimer()
|
|
102
|
+
|
|
103
|
+
expect(fn).toHaveBeenCalledTimes(2)
|
|
104
|
+
|
|
105
|
+
wrapper.vm.registerInterval(fn, 100)
|
|
106
|
+
wrapper.unmount()
|
|
107
|
+
|
|
108
|
+
vi.advanceTimersToNextTimer()
|
|
109
|
+
vi.runAllTimers()
|
|
110
|
+
|
|
111
|
+
expect(fn).toHaveBeenCalledTimes(2)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
test('unmount stops timeout', () => {
|
|
115
|
+
const fn = vi.fn()
|
|
116
|
+
|
|
117
|
+
wrapper = mount(
|
|
118
|
+
defineComponent({
|
|
119
|
+
template: '<div />',
|
|
120
|
+
setup () {
|
|
121
|
+
const { registerInterval } = useInterval()
|
|
122
|
+
|
|
123
|
+
registerInterval(fn, 100)
|
|
124
|
+
return {}
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
expect(fn).not.toHaveBeenCalled()
|
|
130
|
+
|
|
131
|
+
wrapper.unmount()
|
|
132
|
+
wrapper = null
|
|
133
|
+
|
|
134
|
+
vi.advanceTimersToNextTimer()
|
|
135
|
+
vi.runAllTimers()
|
|
136
|
+
|
|
137
|
+
expect(fn).not.toHaveBeenCalled()
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
test('can override timeout', () => {
|
|
141
|
+
const fn1 = vi.fn()
|
|
142
|
+
const fn2 = vi.fn()
|
|
143
|
+
|
|
144
|
+
wrapper = mount(
|
|
145
|
+
defineComponent({
|
|
146
|
+
template: '<div />',
|
|
147
|
+
setup () {
|
|
148
|
+
const { registerInterval } = useInterval()
|
|
149
|
+
return { registerInterval }
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
wrapper.vm.registerInterval(fn1, 100)
|
|
155
|
+
vi.advanceTimersByTime(99)
|
|
156
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
157
|
+
|
|
158
|
+
wrapper.vm.registerInterval(fn2, 200)
|
|
159
|
+
vi.advanceTimersByTime(199)
|
|
160
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
161
|
+
expect(fn2).not.toHaveBeenCalled()
|
|
162
|
+
|
|
163
|
+
vi.advanceTimersByTime(1)
|
|
164
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
165
|
+
expect(fn2).toHaveBeenCalledTimes(1)
|
|
166
|
+
|
|
167
|
+
vi.advanceTimersToNextTimer()
|
|
168
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
169
|
+
expect(fn2).toHaveBeenCalledTimes(2)
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
})
|
|
@@ -25,7 +25,7 @@ export default function () {
|
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
hasCache (key) {
|
|
28
|
-
return
|
|
28
|
+
return Object.hasOwnProperty.call(cache, key)
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
clearCache (key) {
|
|
@@ -33,7 +33,7 @@ export default function () {
|
|
|
33
33
|
delete cache[ key ]
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
cache =
|
|
36
|
+
cache = Object.create(null)
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import useRenderCache from './use-render-cache.js'
|
|
4
|
+
|
|
5
|
+
describe('[useRenderCache API]', () => {
|
|
6
|
+
describe('[Functions]', () => {
|
|
7
|
+
describe('[(function)default]', () => {
|
|
8
|
+
test('has correct return value', () => {
|
|
9
|
+
const result = useRenderCache()
|
|
10
|
+
expect(result).toStrictEqual({
|
|
11
|
+
getCache: expect.any(Function),
|
|
12
|
+
setCache: expect.any(Function),
|
|
13
|
+
hasCache: expect.any(Function),
|
|
14
|
+
clearCache: expect.any(Function)
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
test('getCache() returns undefined', () => {
|
|
19
|
+
const { getCache } = useRenderCache()
|
|
20
|
+
expect(getCache('key')).toBeUndefined()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('setCache() sets cache', () => {
|
|
24
|
+
const { setCache, getCache } = useRenderCache()
|
|
25
|
+
setCache('key', 'value')
|
|
26
|
+
expect(getCache('key')).toBe('value')
|
|
27
|
+
|
|
28
|
+
setCache('key', 'second-value')
|
|
29
|
+
expect(getCache('key')).toBe('second-value')
|
|
30
|
+
|
|
31
|
+
setCache('another-key', 'another-value')
|
|
32
|
+
expect(getCache('another-key')).toBe('another-value')
|
|
33
|
+
expect(getCache('key')).toBe('second-value')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('hasCache() returns true', () => {
|
|
37
|
+
const { hasCache, setCache } = useRenderCache()
|
|
38
|
+
setCache('key', 0)
|
|
39
|
+
setCache('key2', 10)
|
|
40
|
+
expect(hasCache('key')).toBe(true)
|
|
41
|
+
expect(hasCache('key2')).toBe(true)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('clearCache() clears cache', () => {
|
|
45
|
+
const { clearCache, setCache, getCache, hasCache } = useRenderCache()
|
|
46
|
+
setCache('key', 0)
|
|
47
|
+
setCache('key2', 0)
|
|
48
|
+
|
|
49
|
+
clearCache()
|
|
50
|
+
|
|
51
|
+
expect(hasCache('key')).toBe(false)
|
|
52
|
+
expect(getCache('key')).toBeUndefined()
|
|
53
|
+
|
|
54
|
+
expect(hasCache('key2')).toBe(false)
|
|
55
|
+
expect(getCache('key2')).toBeUndefined()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('clearCache(key) clears only the key', () => {
|
|
59
|
+
const { clearCache, setCache, getCache, hasCache } = useRenderCache()
|
|
60
|
+
setCache('key', 0)
|
|
61
|
+
setCache('key2', 0)
|
|
62
|
+
|
|
63
|
+
clearCache('key')
|
|
64
|
+
|
|
65
|
+
expect(hasCache('key')).toBe(false)
|
|
66
|
+
expect(getCache('key')).toBeUndefined()
|
|
67
|
+
|
|
68
|
+
expect(hasCache('key2')).toBe(true)
|
|
69
|
+
expect(getCache('key2')).toBe(0)
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { defineComponent } from 'vue'
|
|
4
|
+
|
|
5
|
+
import useSplitAttrs from './use-split-attrs.js'
|
|
6
|
+
|
|
7
|
+
describe('[useSplitAttrs API]', () => {
|
|
8
|
+
describe('[Functions]', () => {
|
|
9
|
+
describe('[(function)default]', () => {
|
|
10
|
+
test.each([
|
|
11
|
+
[ 'no attrs', {}, [] ],
|
|
12
|
+
[ 'attrs', { a: '1' }, [] ],
|
|
13
|
+
[ 'listeners', {}, [ 'b' ] ],
|
|
14
|
+
[ 'attrs and listeners', { a: '1' }, [ 'b' ] ],
|
|
15
|
+
[ 'multiple attrs and listeners', { a: '1', b: '2' }, [ 'f1', 'f2' ] ]
|
|
16
|
+
])('correctly splits: %s', (_, attrs, listeners) => {
|
|
17
|
+
const attrHtml = Object.keys(attrs).map(
|
|
18
|
+
key => `${ key }="${ attrs[ key ] }"`
|
|
19
|
+
).join(' ')
|
|
20
|
+
|
|
21
|
+
const fn = () => {}
|
|
22
|
+
const fnList = {}
|
|
23
|
+
const listenerHtml = listeners.map(key => {
|
|
24
|
+
fnList[ 'on' + key.toUpperCase() ] = fn
|
|
25
|
+
return `@${ key }="fn"`
|
|
26
|
+
}).join(' ')
|
|
27
|
+
|
|
28
|
+
const ChildComponent = {
|
|
29
|
+
name: 'ChildComponent',
|
|
30
|
+
template: '<div />',
|
|
31
|
+
setup () {
|
|
32
|
+
const result = useSplitAttrs()
|
|
33
|
+
return { result }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const wrapper = mount(
|
|
38
|
+
defineComponent({
|
|
39
|
+
template: `<ChildComponent ${ attrHtml } ${ listenerHtml } />`,
|
|
40
|
+
components: { ChildComponent },
|
|
41
|
+
setup () {
|
|
42
|
+
return { fn }
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const target = wrapper.findComponent({ name: 'ChildComponent' })
|
|
48
|
+
expect(target.vm.result).toStrictEqual({
|
|
49
|
+
attributes: expect.$ref(attrs),
|
|
50
|
+
listeners: expect.$ref(fnList)
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { describe, test, expect, vi, afterEach } from 'vitest'
|
|
2
|
+
import { mount, flushPromises } from '@vue/test-utils'
|
|
3
|
+
import { defineComponent } from 'vue'
|
|
4
|
+
|
|
5
|
+
import useTick from './use-tick.js'
|
|
6
|
+
|
|
7
|
+
let wrapper
|
|
8
|
+
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
if (wrapper !== null) {
|
|
11
|
+
wrapper.unmount()
|
|
12
|
+
wrapper = null
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
describe('[useTick API]', () => {
|
|
17
|
+
describe('[Functions]', () => {
|
|
18
|
+
describe('[(function)default]', () => {
|
|
19
|
+
test('correctly registers a tick', async () => {
|
|
20
|
+
const fn = vi.fn()
|
|
21
|
+
|
|
22
|
+
wrapper = mount(
|
|
23
|
+
defineComponent({
|
|
24
|
+
template: '<div />',
|
|
25
|
+
setup () {
|
|
26
|
+
const { registerTick } = useTick()
|
|
27
|
+
|
|
28
|
+
registerTick(fn)
|
|
29
|
+
return {}
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
expect(fn).not.toHaveBeenCalled()
|
|
35
|
+
await flushPromises()
|
|
36
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test('removeTick works correctly', async () => {
|
|
40
|
+
const fn = vi.fn()
|
|
41
|
+
|
|
42
|
+
wrapper = mount(
|
|
43
|
+
defineComponent({
|
|
44
|
+
template: '<div />',
|
|
45
|
+
setup () {
|
|
46
|
+
const {
|
|
47
|
+
registerTick,
|
|
48
|
+
removeTick
|
|
49
|
+
} = useTick()
|
|
50
|
+
|
|
51
|
+
registerTick(fn)
|
|
52
|
+
return { registerTick, removeTick }
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
expect(fn).not.toHaveBeenCalled()
|
|
58
|
+
wrapper.vm.removeTick()
|
|
59
|
+
|
|
60
|
+
await flushPromises()
|
|
61
|
+
expect(fn).not.toHaveBeenCalled()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test('unmount stops tick', async () => {
|
|
65
|
+
const fn = vi.fn()
|
|
66
|
+
|
|
67
|
+
wrapper = mount(
|
|
68
|
+
defineComponent({
|
|
69
|
+
template: '<div />',
|
|
70
|
+
setup () {
|
|
71
|
+
const { registerTick } = useTick()
|
|
72
|
+
|
|
73
|
+
registerTick(fn)
|
|
74
|
+
return {}
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
expect(fn).not.toHaveBeenCalled()
|
|
80
|
+
|
|
81
|
+
wrapper.unmount()
|
|
82
|
+
wrapper = null
|
|
83
|
+
|
|
84
|
+
await flushPromises()
|
|
85
|
+
|
|
86
|
+
expect(fn).not.toHaveBeenCalled()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
test('can override tick', async () => {
|
|
90
|
+
const fn1 = vi.fn()
|
|
91
|
+
const fn2 = vi.fn()
|
|
92
|
+
|
|
93
|
+
wrapper = mount(
|
|
94
|
+
defineComponent({
|
|
95
|
+
template: '<div />',
|
|
96
|
+
setup () {
|
|
97
|
+
const { registerTick } = useTick()
|
|
98
|
+
return { registerTick }
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
104
|
+
wrapper.vm.registerTick(fn1)
|
|
105
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
106
|
+
|
|
107
|
+
wrapper.vm.registerTick(fn2)
|
|
108
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
109
|
+
expect(fn2).not.toHaveBeenCalled()
|
|
110
|
+
|
|
111
|
+
await flushPromises()
|
|
112
|
+
|
|
113
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
114
|
+
expect(fn2).toHaveBeenCalledTimes(1)
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
})
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { defineComponent } from 'vue'
|
|
4
|
+
|
|
5
|
+
import useTimeout from './use-timeout.js'
|
|
6
|
+
|
|
7
|
+
let wrapper
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
vi.useFakeTimers()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
vi.clearAllTimers()
|
|
15
|
+
vi.restoreAllMocks()
|
|
16
|
+
|
|
17
|
+
if (wrapper !== null) {
|
|
18
|
+
wrapper.unmount()
|
|
19
|
+
wrapper = null
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
describe('[useTimeout API]', () => {
|
|
24
|
+
describe('[Functions]', () => {
|
|
25
|
+
describe('[(function)default]', () => {
|
|
26
|
+
test('correctly registers a timeout (int)', () => {
|
|
27
|
+
const fn = vi.fn()
|
|
28
|
+
|
|
29
|
+
wrapper = mount(
|
|
30
|
+
defineComponent({
|
|
31
|
+
template: '<div />',
|
|
32
|
+
setup () {
|
|
33
|
+
const { registerTimeout } = useTimeout()
|
|
34
|
+
|
|
35
|
+
registerTimeout(fn, 100)
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
expect(fn).not.toHaveBeenCalled()
|
|
42
|
+
vi.advanceTimersByTime(99)
|
|
43
|
+
expect(fn).not.toHaveBeenCalled()
|
|
44
|
+
vi.advanceTimersByTime(1)
|
|
45
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
46
|
+
|
|
47
|
+
vi.runAllTimers()
|
|
48
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
test('correctly registers a timeout (str)', () => {
|
|
52
|
+
const fn = vi.fn()
|
|
53
|
+
|
|
54
|
+
wrapper = mount(
|
|
55
|
+
defineComponent({
|
|
56
|
+
template: '<div />',
|
|
57
|
+
setup () {
|
|
58
|
+
const { registerTimeout } = useTimeout()
|
|
59
|
+
|
|
60
|
+
registerTimeout(fn, '100')
|
|
61
|
+
return {}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
expect(fn).not.toHaveBeenCalled()
|
|
67
|
+
vi.advanceTimersByTime(99)
|
|
68
|
+
expect(fn).not.toHaveBeenCalled()
|
|
69
|
+
vi.advanceTimersByTime(1)
|
|
70
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
71
|
+
|
|
72
|
+
vi.runAllTimers()
|
|
73
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
test('removeTimeout works correctly', () => {
|
|
77
|
+
const fn = vi.fn()
|
|
78
|
+
|
|
79
|
+
wrapper = mount(
|
|
80
|
+
defineComponent({
|
|
81
|
+
template: '<div />',
|
|
82
|
+
setup () {
|
|
83
|
+
const {
|
|
84
|
+
registerTimeout,
|
|
85
|
+
removeTimeout
|
|
86
|
+
} = useTimeout()
|
|
87
|
+
|
|
88
|
+
registerTimeout(fn, 100)
|
|
89
|
+
return { registerTimeout, removeTimeout }
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
expect(fn).not.toHaveBeenCalled()
|
|
95
|
+
vi.advanceTimersByTime(200)
|
|
96
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
97
|
+
|
|
98
|
+
wrapper.vm.removeTimeout()
|
|
99
|
+
vi.runAllTimers()
|
|
100
|
+
|
|
101
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
102
|
+
|
|
103
|
+
wrapper.vm.registerTimeout(fn, 100)
|
|
104
|
+
wrapper.unmount()
|
|
105
|
+
|
|
106
|
+
vi.runAllTimers()
|
|
107
|
+
|
|
108
|
+
expect(fn).toHaveBeenCalledTimes(1)
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
test('unmount stops timeout', () => {
|
|
112
|
+
const fn = vi.fn()
|
|
113
|
+
|
|
114
|
+
wrapper = mount(
|
|
115
|
+
defineComponent({
|
|
116
|
+
template: '<div />',
|
|
117
|
+
setup () {
|
|
118
|
+
const { registerTimeout } = useTimeout()
|
|
119
|
+
|
|
120
|
+
registerTimeout(fn, 100)
|
|
121
|
+
return {}
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
expect(fn).not.toHaveBeenCalled()
|
|
127
|
+
|
|
128
|
+
wrapper.unmount()
|
|
129
|
+
wrapper = null
|
|
130
|
+
|
|
131
|
+
vi.runAllTimers()
|
|
132
|
+
|
|
133
|
+
expect(fn).not.toHaveBeenCalled()
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
test('can override timeout', () => {
|
|
137
|
+
const fn1 = vi.fn()
|
|
138
|
+
const fn2 = vi.fn()
|
|
139
|
+
|
|
140
|
+
wrapper = mount(
|
|
141
|
+
defineComponent({
|
|
142
|
+
template: '<div />',
|
|
143
|
+
setup () {
|
|
144
|
+
const { registerTimeout } = useTimeout()
|
|
145
|
+
return { registerTimeout }
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
wrapper.vm.registerTimeout(fn1, 100)
|
|
151
|
+
vi.advanceTimersByTime(99)
|
|
152
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
153
|
+
|
|
154
|
+
wrapper.vm.registerTimeout(fn2, 200)
|
|
155
|
+
vi.advanceTimersByTime(199)
|
|
156
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
157
|
+
expect(fn2).not.toHaveBeenCalled()
|
|
158
|
+
|
|
159
|
+
vi.advanceTimersByTime(1)
|
|
160
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
161
|
+
expect(fn2).toHaveBeenCalledTimes(1)
|
|
162
|
+
|
|
163
|
+
vi.runAllTimers()
|
|
164
|
+
expect(fn1).not.toHaveBeenCalled()
|
|
165
|
+
expect(fn2).toHaveBeenCalledTimes(1)
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
})
|
package/src/install-quasar.js
CHANGED
|
@@ -9,7 +9,7 @@ import Lang from './plugins/lang/Lang.js'
|
|
|
9
9
|
import IconSet from './plugins/icon-set/IconSet.js'
|
|
10
10
|
|
|
11
11
|
import { quasarKey } from './utils/private.symbols/symbols.js'
|
|
12
|
-
import { globalConfig, globalConfigIsFrozen, freezeGlobalConfig } from './utils/private.
|
|
12
|
+
import { globalConfig, globalConfigIsFrozen, freezeGlobalConfig } from './utils/private.config/instance-config.js'
|
|
13
13
|
import { isObject } from './utils/is/is.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, test, expect, vi } from 'vitest'
|
|
2
|
+
import { mount, config } from '@vue/test-utils'
|
|
3
|
+
|
|
4
|
+
import AddressbarColor from './AddressbarColor.js'
|
|
5
|
+
|
|
6
|
+
// We override Quasar install so it installs this plugin
|
|
7
|
+
const quasarVuePlugin = config.global.plugins.find(entry => entry.name === 'Quasar')
|
|
8
|
+
const { install } = quasarVuePlugin
|
|
9
|
+
|
|
10
|
+
function mountPlugin (addressbarColor) {
|
|
11
|
+
quasarVuePlugin.install = app => install(app, {
|
|
12
|
+
config: { addressbarColor },
|
|
13
|
+
plugins: { AddressbarColor }
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
return mount({ template: '<div />' })
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('[AddressbarColor API]', () => {
|
|
20
|
+
describe('[Injection]', () => {
|
|
21
|
+
test('is injected into $q', () => {
|
|
22
|
+
const wrapper = mountPlugin()
|
|
23
|
+
expect(AddressbarColor).toBe(wrapper.vm.$q.addressbarColor)
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe('[Methods]', () => {
|
|
28
|
+
describe('[(method)set]', () => {
|
|
29
|
+
test('should be callable', () => {
|
|
30
|
+
mountPlugin()
|
|
31
|
+
|
|
32
|
+
expect(
|
|
33
|
+
AddressbarColor.set('#ff0000')
|
|
34
|
+
).toBeUndefined()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('should be called automatically when $q.config.addressbarColor is set', () => {
|
|
38
|
+
const original = AddressbarColor.set
|
|
39
|
+
|
|
40
|
+
// override original since the real test would be on a
|
|
41
|
+
// mobile platform (and we can't test that here, yet)
|
|
42
|
+
AddressbarColor.set = vi.fn()
|
|
43
|
+
mountPlugin('#aabbcc')
|
|
44
|
+
|
|
45
|
+
expect.soft(AddressbarColor.set).toHaveBeenCalledTimes(1)
|
|
46
|
+
expect.soft(AddressbarColor.set).toHaveBeenCalledWith('#aabbcc')
|
|
47
|
+
|
|
48
|
+
// restore original
|
|
49
|
+
AddressbarColor.set = original
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
})
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
|
|
14
14
|
"isActive": {
|
|
15
15
|
"type": "Boolean",
|
|
16
|
-
"desc": "Is Fullscreen active?"
|
|
16
|
+
"desc": "Is Fullscreen active?",
|
|
17
|
+
"reactive": true
|
|
17
18
|
},
|
|
18
19
|
|
|
19
20
|
"activeEl": {
|
|
20
21
|
"type": [ "Element", "null" ],
|
|
21
22
|
"desc": "The DOM element used as root for fullscreen, otherwise 'null'",
|
|
23
|
+
"reactive": true,
|
|
22
24
|
"examples": [ "document.fullscreenElement", "null" ]
|
|
23
25
|
}
|
|
24
26
|
},
|