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,453 @@
|
|
|
1
|
+
import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
|
|
4
|
+
import Screen from './Screen.js'
|
|
5
|
+
|
|
6
|
+
const mountPlugin = () => mount({ template: '<div />' })
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
vi.useFakeTimers()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
vi.clearAllTimers()
|
|
14
|
+
vi.restoreAllMocks()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
function setWidth (width) {
|
|
18
|
+
window.innerWidth = width
|
|
19
|
+
window.dispatchEvent(new Event('resize'))
|
|
20
|
+
vi.runAllTimers()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setHeight (height) {
|
|
24
|
+
window.innerHeight = height
|
|
25
|
+
window.dispatchEvent(new Event('resize'))
|
|
26
|
+
vi.runAllTimers()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe('[Screen API]', () => {
|
|
30
|
+
describe('[Injection]', () => {
|
|
31
|
+
test('is injected into $q', () => {
|
|
32
|
+
const wrapper = mountPlugin()
|
|
33
|
+
expect(Screen).toBe(wrapper.vm.$q.screen)
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
describe('[Props]', () => {
|
|
38
|
+
describe('[(prop)width]', () => {
|
|
39
|
+
test('is correct type', () => {
|
|
40
|
+
mountPlugin()
|
|
41
|
+
expect(Screen.width).toBeTypeOf('number')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('is reactive', () => {
|
|
45
|
+
mountPlugin()
|
|
46
|
+
expect(Screen.width).not.toBe(100)
|
|
47
|
+
setWidth(100)
|
|
48
|
+
vi.runAllTimers()
|
|
49
|
+
expect(Screen.width).toBe(100)
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
describe('[(prop)height]', () => {
|
|
54
|
+
test('is correct type', () => {
|
|
55
|
+
mountPlugin()
|
|
56
|
+
expect(Screen.height).toBeTypeOf('number')
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test('is reactive', () => {
|
|
60
|
+
mountPlugin()
|
|
61
|
+
expect(Screen.height).not.toBe(100)
|
|
62
|
+
setHeight(100)
|
|
63
|
+
expect(Screen.height).toBe(100)
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
describe('[(prop)name]', () => {
|
|
68
|
+
test('is correct type', () => {
|
|
69
|
+
mountPlugin()
|
|
70
|
+
expect([ 'xs', 'sm', 'md', 'lg', 'xl' ]).toContain(Screen.name)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
test('is reactive', () => {
|
|
74
|
+
mountPlugin()
|
|
75
|
+
|
|
76
|
+
setWidth(500)
|
|
77
|
+
expect(Screen.name).toBe('xs')
|
|
78
|
+
|
|
79
|
+
setWidth(800)
|
|
80
|
+
expect(Screen.name).toBe('sm')
|
|
81
|
+
|
|
82
|
+
setWidth(1200)
|
|
83
|
+
expect(Screen.name).toBe('md')
|
|
84
|
+
|
|
85
|
+
setWidth(1600)
|
|
86
|
+
expect(Screen.name).toBe('lg')
|
|
87
|
+
|
|
88
|
+
setWidth(2000)
|
|
89
|
+
expect(Screen.name).toBe('xl')
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
describe('[(prop)sizes]', () => {
|
|
94
|
+
test('is correct type', () => {
|
|
95
|
+
mountPlugin()
|
|
96
|
+
expect(Screen.sizes).toStrictEqual({
|
|
97
|
+
sm: expect.any(Number),
|
|
98
|
+
md: expect.any(Number),
|
|
99
|
+
lg: expect.any(Number),
|
|
100
|
+
xl: expect.any(Number)
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
describe('[(prop)lt]', () => {
|
|
106
|
+
test('is correct type', () => {
|
|
107
|
+
mountPlugin()
|
|
108
|
+
expect(Screen.lt).toStrictEqual({
|
|
109
|
+
sm: expect.any(Boolean),
|
|
110
|
+
md: expect.any(Boolean),
|
|
111
|
+
lg: expect.any(Boolean),
|
|
112
|
+
xl: expect.any(Boolean)
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
test('is reactive', () => {
|
|
117
|
+
mountPlugin()
|
|
118
|
+
|
|
119
|
+
setWidth(500) // xs
|
|
120
|
+
expect(Screen.lt).toStrictEqual({
|
|
121
|
+
sm: true,
|
|
122
|
+
md: true,
|
|
123
|
+
lg: true,
|
|
124
|
+
xl: true
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
setWidth(800) // sm
|
|
128
|
+
expect(Screen.lt).toStrictEqual({
|
|
129
|
+
sm: false,
|
|
130
|
+
md: true,
|
|
131
|
+
lg: true,
|
|
132
|
+
xl: true
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
setWidth(1200) // md
|
|
136
|
+
expect(Screen.lt).toStrictEqual({
|
|
137
|
+
sm: false,
|
|
138
|
+
md: false,
|
|
139
|
+
lg: true,
|
|
140
|
+
xl: true
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
setWidth(1600) // lg
|
|
144
|
+
expect(Screen.lt).toStrictEqual({
|
|
145
|
+
sm: false,
|
|
146
|
+
md: false,
|
|
147
|
+
lg: false,
|
|
148
|
+
xl: true
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
setWidth(2000) // xl
|
|
152
|
+
expect(Screen.lt).toStrictEqual({
|
|
153
|
+
sm: false,
|
|
154
|
+
md: false,
|
|
155
|
+
lg: false,
|
|
156
|
+
xl: false
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
describe('[(prop)gt]', () => {
|
|
162
|
+
test('is correct type', () => {
|
|
163
|
+
mountPlugin()
|
|
164
|
+
expect(Screen.gt).toStrictEqual({
|
|
165
|
+
xs: expect.any(Boolean),
|
|
166
|
+
sm: expect.any(Boolean),
|
|
167
|
+
md: expect.any(Boolean),
|
|
168
|
+
lg: expect.any(Boolean)
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
test('is reactive', () => {
|
|
173
|
+
mountPlugin()
|
|
174
|
+
|
|
175
|
+
setWidth(500) // xs
|
|
176
|
+
expect(Screen.gt).toStrictEqual({
|
|
177
|
+
xs: false,
|
|
178
|
+
sm: false,
|
|
179
|
+
md: false,
|
|
180
|
+
lg: false
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
setWidth(800) // sm
|
|
184
|
+
expect(Screen.gt).toStrictEqual({
|
|
185
|
+
xs: true,
|
|
186
|
+
sm: false,
|
|
187
|
+
md: false,
|
|
188
|
+
lg: false
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
setWidth(1200) // md
|
|
192
|
+
expect(Screen.gt).toStrictEqual({
|
|
193
|
+
xs: true,
|
|
194
|
+
sm: true,
|
|
195
|
+
md: false,
|
|
196
|
+
lg: false
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
setWidth(1600) // lg
|
|
200
|
+
expect(Screen.gt).toStrictEqual({
|
|
201
|
+
xs: true,
|
|
202
|
+
sm: true,
|
|
203
|
+
md: true,
|
|
204
|
+
lg: false
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
setWidth(2000) // xl
|
|
208
|
+
expect(Screen.gt).toStrictEqual({
|
|
209
|
+
xs: true,
|
|
210
|
+
sm: true,
|
|
211
|
+
md: true,
|
|
212
|
+
lg: true
|
|
213
|
+
})
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
describe('[(prop)xs]', () => {
|
|
218
|
+
test('is correct type', () => {
|
|
219
|
+
mountPlugin()
|
|
220
|
+
expect(Screen.xs).toBeTypeOf('boolean')
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
test('is reactive', () => {
|
|
224
|
+
mountPlugin()
|
|
225
|
+
|
|
226
|
+
setWidth(500) // xs
|
|
227
|
+
expect(Screen.xs).toBe(true)
|
|
228
|
+
|
|
229
|
+
setWidth(800) // sm
|
|
230
|
+
expect(Screen.xs).toBe(false)
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
describe('[(prop)sm]', () => {
|
|
235
|
+
test('is correct type', () => {
|
|
236
|
+
mountPlugin()
|
|
237
|
+
expect(Screen.sm).toBeTypeOf('boolean')
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
test('is reactive', () => {
|
|
241
|
+
mountPlugin()
|
|
242
|
+
|
|
243
|
+
setWidth(500) // xs
|
|
244
|
+
expect(Screen.sm).toBe(false)
|
|
245
|
+
|
|
246
|
+
setWidth(800) // sm
|
|
247
|
+
expect(Screen.sm).toBe(true)
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
describe('[(prop)md]', () => {
|
|
252
|
+
test('is correct type', () => {
|
|
253
|
+
mountPlugin()
|
|
254
|
+
expect(Screen.md).toBeTypeOf('boolean')
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
test('is reactive', () => {
|
|
258
|
+
mountPlugin()
|
|
259
|
+
|
|
260
|
+
setWidth(800) // sm
|
|
261
|
+
expect(Screen.md).toBe(false)
|
|
262
|
+
|
|
263
|
+
setWidth(1200) // md
|
|
264
|
+
expect(Screen.md).toBe(true)
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
describe('[(prop)lg]', () => {
|
|
269
|
+
test('is correct type', () => {
|
|
270
|
+
mountPlugin()
|
|
271
|
+
expect(Screen.lg).toBeTypeOf('boolean')
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
test('is reactive', () => {
|
|
275
|
+
mountPlugin()
|
|
276
|
+
|
|
277
|
+
setWidth(1200) // md
|
|
278
|
+
expect(Screen.lg).toBe(false)
|
|
279
|
+
|
|
280
|
+
setWidth(1600) // lg
|
|
281
|
+
expect(Screen.lg).toBe(true)
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
describe('[(prop)xl]', () => {
|
|
286
|
+
test('is correct type', () => {
|
|
287
|
+
mountPlugin()
|
|
288
|
+
expect(Screen.xl).toBeTypeOf('boolean')
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
test('is reactive', () => {
|
|
292
|
+
mountPlugin()
|
|
293
|
+
|
|
294
|
+
setWidth(1600) // lg
|
|
295
|
+
expect(Screen.xl).toBe(false)
|
|
296
|
+
|
|
297
|
+
setWidth(2000) // xl
|
|
298
|
+
expect(Screen.xl).toBe(true)
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
describe('[Methods]', () => {
|
|
304
|
+
describe('[(method)setSizes]', () => {
|
|
305
|
+
test('should be callable', () => {
|
|
306
|
+
mountPlugin()
|
|
307
|
+
|
|
308
|
+
const newSizes = {
|
|
309
|
+
sm: 10,
|
|
310
|
+
md: 15,
|
|
311
|
+
lg: 20,
|
|
312
|
+
xl: 25
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
expect(
|
|
316
|
+
Screen.setSizes(newSizes)
|
|
317
|
+
).toBeUndefined()
|
|
318
|
+
|
|
319
|
+
expect(
|
|
320
|
+
Screen.sizes
|
|
321
|
+
).toStrictEqual(newSizes)
|
|
322
|
+
|
|
323
|
+
setWidth(5)
|
|
324
|
+
expect(Screen).toMatchObject({
|
|
325
|
+
name: 'xs',
|
|
326
|
+
xs: true,
|
|
327
|
+
sm: false,
|
|
328
|
+
md: false,
|
|
329
|
+
lg: false,
|
|
330
|
+
xl: false,
|
|
331
|
+
lt: {
|
|
332
|
+
sm: true,
|
|
333
|
+
md: true,
|
|
334
|
+
lg: true,
|
|
335
|
+
xl: true
|
|
336
|
+
},
|
|
337
|
+
gt: {
|
|
338
|
+
xs: false,
|
|
339
|
+
sm: false,
|
|
340
|
+
md: false,
|
|
341
|
+
lg: false
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
setWidth(11)
|
|
346
|
+
expect(Screen).toMatchObject({
|
|
347
|
+
name: 'sm',
|
|
348
|
+
xs: false,
|
|
349
|
+
sm: true,
|
|
350
|
+
md: false,
|
|
351
|
+
lg: false,
|
|
352
|
+
xl: false,
|
|
353
|
+
lt: {
|
|
354
|
+
sm: false,
|
|
355
|
+
md: true,
|
|
356
|
+
lg: true,
|
|
357
|
+
xl: true
|
|
358
|
+
},
|
|
359
|
+
gt: {
|
|
360
|
+
xs: true,
|
|
361
|
+
sm: false,
|
|
362
|
+
md: false,
|
|
363
|
+
lg: false
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
setWidth(16)
|
|
368
|
+
expect(Screen).toMatchObject({
|
|
369
|
+
name: 'md',
|
|
370
|
+
xs: false,
|
|
371
|
+
sm: false,
|
|
372
|
+
md: true,
|
|
373
|
+
lg: false,
|
|
374
|
+
xl: false,
|
|
375
|
+
lt: {
|
|
376
|
+
sm: false,
|
|
377
|
+
md: false,
|
|
378
|
+
lg: true,
|
|
379
|
+
xl: true
|
|
380
|
+
},
|
|
381
|
+
gt: {
|
|
382
|
+
xs: true,
|
|
383
|
+
sm: true,
|
|
384
|
+
md: false,
|
|
385
|
+
lg: false
|
|
386
|
+
}
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
setWidth(21)
|
|
390
|
+
expect(Screen).toMatchObject({
|
|
391
|
+
name: 'lg',
|
|
392
|
+
xs: false,
|
|
393
|
+
sm: false,
|
|
394
|
+
md: false,
|
|
395
|
+
lg: true,
|
|
396
|
+
xl: false,
|
|
397
|
+
lt: {
|
|
398
|
+
sm: false,
|
|
399
|
+
md: false,
|
|
400
|
+
lg: false,
|
|
401
|
+
xl: true
|
|
402
|
+
},
|
|
403
|
+
gt: {
|
|
404
|
+
xs: true,
|
|
405
|
+
sm: true,
|
|
406
|
+
md: true,
|
|
407
|
+
lg: false
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
|
|
411
|
+
setWidth(26)
|
|
412
|
+
expect(Screen).toMatchObject({
|
|
413
|
+
name: 'xl',
|
|
414
|
+
xs: false,
|
|
415
|
+
sm: false,
|
|
416
|
+
md: false,
|
|
417
|
+
lg: false,
|
|
418
|
+
xl: true,
|
|
419
|
+
lt: {
|
|
420
|
+
sm: false,
|
|
421
|
+
md: false,
|
|
422
|
+
lg: false,
|
|
423
|
+
xl: false
|
|
424
|
+
},
|
|
425
|
+
gt: {
|
|
426
|
+
xs: true,
|
|
427
|
+
sm: true,
|
|
428
|
+
md: true,
|
|
429
|
+
lg: true
|
|
430
|
+
}
|
|
431
|
+
})
|
|
432
|
+
})
|
|
433
|
+
})
|
|
434
|
+
|
|
435
|
+
describe('[(method)setDebounce]', () => {
|
|
436
|
+
test('should be callable', () => {
|
|
437
|
+
mountPlugin()
|
|
438
|
+
expect(
|
|
439
|
+
Screen.setDebounce(1000)
|
|
440
|
+
).toBeUndefined()
|
|
441
|
+
|
|
442
|
+
window.innerWidth = 100
|
|
443
|
+
window.dispatchEvent(new Event('resize'))
|
|
444
|
+
|
|
445
|
+
expect(Screen.width).not.toBe(100)
|
|
446
|
+
vi.advanceTimersByTime(999)
|
|
447
|
+
expect(Screen.width).not.toBe(100)
|
|
448
|
+
vi.advanceTimersByTime(1)
|
|
449
|
+
expect(Screen.width).toBe(100)
|
|
450
|
+
})
|
|
451
|
+
})
|
|
452
|
+
})
|
|
453
|
+
})
|
|
@@ -27,6 +27,18 @@ describe('[getCssVar API]', () => {
|
|
|
27
27
|
|
|
28
28
|
el.remove()
|
|
29
29
|
})
|
|
30
|
+
|
|
31
|
+
test('should throw if propName is not a string', () => {
|
|
32
|
+
expect(() => {
|
|
33
|
+
getCssVar(5)
|
|
34
|
+
}).toThrow(TypeError)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('should throw if element is not a DOM element', () => {
|
|
38
|
+
expect(() => {
|
|
39
|
+
getCssVar('prop', {})
|
|
40
|
+
}).toThrow(TypeError)
|
|
41
|
+
})
|
|
30
42
|
})
|
|
31
43
|
})
|
|
32
44
|
})
|
|
@@ -31,6 +31,24 @@ describe('[setCssVar API]', () => {
|
|
|
31
31
|
|
|
32
32
|
el.remove()
|
|
33
33
|
})
|
|
34
|
+
|
|
35
|
+
test('should throw if propName is not a string', () => {
|
|
36
|
+
expect(() => {
|
|
37
|
+
setCssVar(5, 'awesome')
|
|
38
|
+
}).toThrow(TypeError)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
test('should throw if value is not a string', () => {
|
|
42
|
+
expect(() => {
|
|
43
|
+
setCssVar('prop', 5)
|
|
44
|
+
}).toThrow(TypeError)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('should throw if element is not a DOM element', () => {
|
|
48
|
+
expect(() => {
|
|
49
|
+
setCssVar('prop', 'awesome', {})
|
|
50
|
+
}).toThrow(TypeError)
|
|
51
|
+
})
|
|
34
52
|
})
|
|
35
53
|
})
|
|
36
54
|
})
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { describe, test, expect, vi, onTestFinished } from 'vitest'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import dom, { getElement, childHasFocus } from './dom.js'
|
|
5
|
+
|
|
6
|
+
function createEl ({ top, left } = {}) {
|
|
7
|
+
const el = document.createElement('div')
|
|
8
|
+
el.setAttribute('tabindex', '0')
|
|
9
|
+
el.classList = 'fixed'
|
|
10
|
+
|
|
11
|
+
if (top !== void 0) {
|
|
12
|
+
el.style.top = top
|
|
13
|
+
}
|
|
14
|
+
if (left !== void 0) {
|
|
15
|
+
el.style.left = left
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
document.body.appendChild(el)
|
|
19
|
+
onTestFinished(() => { el.remove() })
|
|
20
|
+
|
|
21
|
+
return el
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('[dom API]', () => {
|
|
25
|
+
describe('[Functions]', () => {
|
|
26
|
+
describe('[(function)offset]', () => {
|
|
27
|
+
test('has correct return value', () => {
|
|
28
|
+
const el = createEl()
|
|
29
|
+
|
|
30
|
+
expect(
|
|
31
|
+
dom.offset(el)
|
|
32
|
+
).toStrictEqual({
|
|
33
|
+
top: expect.any(Number),
|
|
34
|
+
left: expect.any(Number)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
describe('[(function)style]', () => {
|
|
40
|
+
test('has correct return value', () => {
|
|
41
|
+
const el = createEl({ top: '10px', left: '20px' })
|
|
42
|
+
|
|
43
|
+
expect(
|
|
44
|
+
dom.style(el, 'top')
|
|
45
|
+
).toBe('10px')
|
|
46
|
+
|
|
47
|
+
expect(
|
|
48
|
+
dom.style(el, 'left')
|
|
49
|
+
).toBe('20px')
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
describe('[(function)height]', () => {
|
|
54
|
+
test('height()', () => {
|
|
55
|
+
window.innerHeight = 100
|
|
56
|
+
expect(dom.height(window)).toBe(100)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test('height(el)', () => {
|
|
60
|
+
const el = createEl()
|
|
61
|
+
el.style.height = '100px'
|
|
62
|
+
|
|
63
|
+
expect(
|
|
64
|
+
dom.height(el)
|
|
65
|
+
).toBeTypeOf('number')
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('[(function)width]', () => {
|
|
70
|
+
test('width()', () => {
|
|
71
|
+
window.innerHeight = 100
|
|
72
|
+
expect(dom.height(window)).toBe(100)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
test('width(el)', () => {
|
|
76
|
+
const el = createEl()
|
|
77
|
+
el.style.width = '100px'
|
|
78
|
+
|
|
79
|
+
expect(
|
|
80
|
+
dom.width(el)
|
|
81
|
+
).toBeTypeOf('number')
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
describe('[(function)css]', () => {
|
|
86
|
+
test('has correct return value', () => {
|
|
87
|
+
const el = createEl()
|
|
88
|
+
|
|
89
|
+
const result = dom.css(el, {
|
|
90
|
+
width: '54px',
|
|
91
|
+
height: '154px'
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
expect(result).toBeUndefined()
|
|
95
|
+
expect(el.style.width).toBe('54px')
|
|
96
|
+
expect(el.style.height).toBe('154px')
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
describe('[(function)cssBatch]', () => {
|
|
101
|
+
test('has correct return value', () => {
|
|
102
|
+
const el1 = createEl()
|
|
103
|
+
const el2 = createEl()
|
|
104
|
+
|
|
105
|
+
const result = dom.cssBatch([ el1, el2 ], {
|
|
106
|
+
width: '54px',
|
|
107
|
+
height: '154px'
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
expect(result).toBeUndefined()
|
|
111
|
+
|
|
112
|
+
expect(el1.style.width).toBe('54px')
|
|
113
|
+
expect(el1.style.height).toBe('154px')
|
|
114
|
+
|
|
115
|
+
expect(el2.style.width).toBe('54px')
|
|
116
|
+
expect(el2.style.height).toBe('154px')
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
describe('[(function)ready]', () => {
|
|
121
|
+
test('ready()', () => {
|
|
122
|
+
expect(
|
|
123
|
+
dom.ready()
|
|
124
|
+
).toBeUndefined()
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
test('ready(5)', () => {
|
|
128
|
+
expect(
|
|
129
|
+
dom.ready(5)
|
|
130
|
+
).toBeUndefined()
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
test('ready(fn)', () => {
|
|
134
|
+
const fn = vi.fn(() => 5)
|
|
135
|
+
|
|
136
|
+
expect(
|
|
137
|
+
dom.ready(fn)
|
|
138
|
+
).toBe(5)
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
describe('[(function)getElement]', () => {
|
|
143
|
+
test('getElement()', () => {
|
|
144
|
+
expect(getElement()).toBeUndefined()
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
test('getElement(null)', () => {
|
|
148
|
+
expect(getElement(null)).toBeUndefined()
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
test('getElement(el)', () => {
|
|
152
|
+
const el = createEl()
|
|
153
|
+
el.setAttribute('id', 'test-el')
|
|
154
|
+
|
|
155
|
+
expect(getElement('#test-el')).toBe(el)
|
|
156
|
+
expect(getElement('#bogus')).toBeUndefined()
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
test('getElement(vnode)', () => {
|
|
160
|
+
const el = createEl()
|
|
161
|
+
const vnode = { $el: el }
|
|
162
|
+
|
|
163
|
+
expect(getElement(vnode)).toBe(el)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
test('getElement(ref)', () => {
|
|
167
|
+
const el = createEl()
|
|
168
|
+
const elRef = ref(el)
|
|
169
|
+
|
|
170
|
+
expect(getElement(elRef)).toBe(el)
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
describe('[(function)childHasFocus]', () => {
|
|
175
|
+
test('childHasFocus()', () => {
|
|
176
|
+
expect(childHasFocus()).toBe(true)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
test('childHasFocus(null)', () => {
|
|
180
|
+
expect(childHasFocus(null)).toBe(true)
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test('childHasFocus(el, elChild)', () => {
|
|
184
|
+
const el = createEl()
|
|
185
|
+
const elChild = document.createElement('div')
|
|
186
|
+
el.appendChild(elChild)
|
|
187
|
+
|
|
188
|
+
expect(
|
|
189
|
+
childHasFocus(el, elChild)
|
|
190
|
+
).toBe(true)
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
test('childHasFocus(el, parentEl)', () => {
|
|
194
|
+
const parentEl = createEl()
|
|
195
|
+
const el = document.createElement('div')
|
|
196
|
+
|
|
197
|
+
expect(
|
|
198
|
+
childHasFocus(el, parentEl)
|
|
199
|
+
).toBe(false)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
test('childHasFocus(el, nextSiblingEl)', () => {
|
|
203
|
+
const el = createEl()
|
|
204
|
+
/* intermediateEl */ createEl()
|
|
205
|
+
const nextSiblingEl = createEl()
|
|
206
|
+
|
|
207
|
+
expect(
|
|
208
|
+
childHasFocus(el, nextSiblingEl)
|
|
209
|
+
).toBe(true)
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
test('childHasFocus(el, prevSiblingEl)', () => {
|
|
213
|
+
const prevSiblingEl = createEl()
|
|
214
|
+
const el = createEl()
|
|
215
|
+
|
|
216
|
+
expect(
|
|
217
|
+
childHasFocus(el, prevSiblingEl)
|
|
218
|
+
).toBe(false)
|
|
219
|
+
})
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
})
|