quasar 2.15.2 → 2.15.3
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/AddressbarColor.json +1 -1
- package/dist/api/AppFullscreen.json +1 -1
- package/dist/api/BottomSheet.json +1 -1
- package/dist/api/Cookies.json +1 -1
- package/dist/api/Dark.json +1 -1
- package/dist/api/Dialog.json +1 -1
- package/dist/api/IconSet.json +1 -0
- package/dist/api/Lang.json +1 -1
- package/dist/api/Loading.json +1 -1
- package/dist/api/LoadingBar.json +1 -1
- package/dist/api/LocalStorage.json +1 -1
- package/dist/api/Morph.json +1 -1
- package/dist/api/Notify.json +1 -1
- package/dist/api/Platform.json +1 -1
- package/dist/api/QAjaxBar.json +1 -1
- package/dist/api/QBreadcrumbsEl.json +1 -1
- package/dist/api/QBtn.json +1 -1
- package/dist/api/QBtnDropdown.json +1 -1
- package/dist/api/QBtnToggle.json +1 -1
- package/dist/api/QCard.json +1 -1
- package/dist/api/QCardSection.json +1 -1
- package/dist/api/QCarousel.json +1 -1
- package/dist/api/QCarouselControl.json +1 -1
- package/dist/api/QCheckbox.json +1 -1
- package/dist/api/QChip.json +1 -1
- package/dist/api/QDate.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/QForm.json +1 -1
- package/dist/api/QFormChildMixin.json +1 -1
- package/dist/api/QIcon.json +1 -1
- package/dist/api/QInfiniteScroll.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/QList.json +1 -1
- package/dist/api/QMenu.json +1 -1
- package/dist/api/QNoSsr.json +1 -1
- package/dist/api/QOptionGroup.json +1 -1
- package/dist/api/QPageScroller.json +1 -1
- package/dist/api/QPageSticky.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/QPopupProxy.json +1 -1
- package/dist/api/QPullToRefresh.json +1 -1
- package/dist/api/QRadio.json +1 -1
- package/dist/api/QRating.json +1 -1
- package/dist/api/QResizeObserver.json +1 -1
- package/dist/api/QScrollArea.json +1 -1
- package/dist/api/QScrollObserver.json +1 -1
- package/dist/api/QSelect.json +1 -1
- package/dist/api/QSkeleton.json +1 -1
- package/dist/api/QSlideItem.json +1 -1
- package/dist/api/QSplitter.json +1 -1
- package/dist/api/QStepper.json +1 -1
- package/dist/api/QTabPanel.json +1 -1
- package/dist/api/QTabPanels.json +1 -1
- package/dist/api/QTable.json +1 -1
- package/dist/api/QTime.json +1 -1
- package/dist/api/QTimelineEntry.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/QUploader.json +1 -1
- package/dist/api/QVirtualScroll.json +1 -1
- package/dist/api/Ripple.json +1 -1
- package/dist/api/Screen.json +1 -1
- package/dist/api/ScrollFire.json +1 -1
- package/dist/api/SessionStorage.json +1 -1
- package/dist/icon-set/bootstrap-icons.umd.prod.js +2 -2
- package/dist/icon-set/eva-icons.umd.prod.js +2 -2
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +2 -2
- package/dist/icon-set/fontawesome-v5.umd.prod.js +2 -2
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +2 -2
- package/dist/icon-set/fontawesome-v6.umd.prod.js +2 -2
- package/dist/icon-set/ionicons-v4.umd.prod.js +2 -2
- package/dist/icon-set/line-awesome.umd.prod.js +2 -2
- package/dist/icon-set/material-icons-outlined.umd.prod.js +2 -2
- package/dist/icon-set/material-icons-round.umd.prod.js +2 -2
- package/dist/icon-set/material-icons-sharp.umd.prod.js +2 -2
- package/dist/icon-set/material-icons.umd.prod.js +2 -2
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +2 -2
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +2 -2
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +2 -2
- package/dist/icon-set/mdi-v3.umd.prod.js +2 -2
- package/dist/icon-set/mdi-v4.umd.prod.js +2 -2
- package/dist/icon-set/mdi-v5.umd.prod.js +2 -2
- package/dist/icon-set/mdi-v6.umd.prod.js +2 -2
- package/dist/icon-set/mdi-v7.umd.prod.js +2 -2
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +2 -2
- package/dist/icon-set/svg-eva-icons.umd.prod.js +2 -2
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +2 -2
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +2 -2
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +2 -2
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +2 -2
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +2 -2
- package/dist/icon-set/svg-line-awesome.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-icons.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +2 -2
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +2 -2
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +2 -2
- package/dist/icon-set/svg-themify.umd.prod.js +2 -2
- package/dist/icon-set/themify.umd.prod.js +2 -2
- package/dist/lang/ar-TN.umd.prod.js +2 -2
- package/dist/lang/ar.umd.prod.js +2 -2
- package/dist/lang/az-Latn.umd.prod.js +2 -2
- package/dist/lang/bg.umd.prod.js +2 -2
- package/dist/lang/bn.umd.prod.js +2 -2
- package/dist/lang/ca.umd.prod.js +2 -2
- package/dist/lang/cs.umd.prod.js +2 -2
- package/dist/lang/da.umd.prod.js +2 -2
- package/dist/lang/de-CH.umd.prod.js +2 -2
- package/dist/lang/de-DE.umd.prod.js +2 -2
- package/dist/lang/de.umd.prod.js +2 -2
- package/dist/lang/el.umd.prod.js +2 -2
- package/dist/lang/en-GB.umd.prod.js +2 -2
- package/dist/lang/en-US.umd.prod.js +2 -2
- package/dist/lang/eo.umd.prod.js +2 -2
- package/dist/lang/es.umd.prod.js +2 -2
- package/dist/lang/et.umd.prod.js +2 -2
- package/dist/lang/eu.umd.prod.js +2 -2
- package/dist/lang/fa-IR.umd.prod.js +2 -2
- package/dist/lang/fa.umd.prod.js +2 -2
- package/dist/lang/fi.umd.prod.js +2 -2
- package/dist/lang/fr.umd.prod.js +2 -2
- package/dist/lang/gn.umd.prod.js +2 -2
- package/dist/lang/he.umd.prod.js +2 -2
- package/dist/lang/hi.umd.prod.js +2 -2
- package/dist/lang/hr.umd.prod.js +2 -2
- package/dist/lang/hu.umd.prod.js +2 -2
- package/dist/lang/id.umd.prod.js +2 -2
- package/dist/lang/is.umd.prod.js +2 -2
- package/dist/lang/it.umd.prod.js +2 -2
- package/dist/lang/ja.umd.prod.js +2 -2
- package/dist/lang/kk.umd.prod.js +2 -2
- package/dist/lang/km.umd.prod.js +2 -2
- package/dist/lang/ko-KR.umd.prod.js +2 -2
- package/dist/lang/kur-CKB.umd.prod.js +2 -2
- package/dist/lang/lt.umd.prod.js +2 -2
- package/dist/lang/lu.umd.prod.js +2 -2
- package/dist/lang/lv.umd.prod.js +2 -2
- package/dist/lang/mk.umd.prod.js +2 -2
- package/dist/lang/ml.umd.prod.js +2 -2
- package/dist/lang/mm.umd.prod.js +2 -2
- package/dist/lang/ms-MY.umd.prod.js +2 -2
- package/dist/lang/ms.umd.prod.js +2 -2
- package/dist/lang/my.umd.prod.js +2 -2
- package/dist/lang/nb-NO.umd.prod.js +2 -2
- package/dist/lang/nl.umd.prod.js +2 -2
- package/dist/lang/pl.umd.prod.js +2 -2
- package/dist/lang/pt-BR.umd.prod.js +2 -2
- package/dist/lang/pt.umd.prod.js +2 -2
- package/dist/lang/ro.umd.prod.js +2 -2
- package/dist/lang/ru.umd.prod.js +2 -2
- package/dist/lang/sk.umd.prod.js +2 -2
- package/dist/lang/sl.umd.prod.js +2 -2
- package/dist/lang/sm.umd.prod.js +2 -2
- package/dist/lang/sr-CYR.umd.prod.js +2 -2
- package/dist/lang/sr.umd.prod.js +2 -2
- package/dist/lang/sv.umd.prod.js +2 -2
- package/dist/lang/ta.umd.prod.js +2 -2
- package/dist/lang/th.umd.prod.js +2 -2
- package/dist/lang/tl.umd.prod.js +2 -2
- package/dist/lang/tr.umd.prod.js +2 -2
- package/dist/lang/ug.umd.prod.js +2 -2
- package/dist/lang/uk.umd.prod.js +2 -2
- package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
- package/dist/lang/uz-Latn.umd.prod.js +2 -2
- package/dist/lang/vi.umd.prod.js +2 -2
- package/dist/lang/zh-CN.umd.prod.js +2 -2
- package/dist/lang/zh-TW.umd.prod.js +2 -2
- package/dist/quasar.addon.prod.css +1 -1
- package/dist/quasar.addon.rtl.prod.css +1 -1
- package/dist/quasar.cjs.prod.js +12 -12
- package/dist/quasar.esm.js +567 -520
- package/dist/quasar.esm.prod.js +17 -17
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +1 -1
- package/dist/quasar.umd.js +554 -506
- package/dist/quasar.umd.prod.js +22 -22
- package/dist/transforms/api-list.json +1 -1
- package/dist/transforms/import-map.json +1 -1
- package/dist/types/config.d.ts +3 -3
- package/dist/types/globals.d.ts +1 -1
- package/dist/types/index.d.ts +1921 -102
- 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/lang/uk.js +1 -1
- package/lang/uk.mjs +1 -1
- package/package.json +18 -17
- package/src/api.extends.json +7 -5
- package/src/components/ajax-bar/QAjaxBar.js +2 -2
- package/src/components/ajax-bar/QAjaxBar.json +1 -0
- package/src/components/avatar/QAvatar.js +3 -3
- package/src/components/avatar/QAvatar.json +1 -1
- package/src/components/avatar/QAvatar.test.js +169 -83
- package/src/components/badge/QBadge.js +2 -2
- package/src/components/badge/QBadge.test.js +200 -100
- package/src/components/banner/QBanner.js +3 -3
- package/src/components/banner/QBanner.test.js +88 -50
- package/src/components/bar/QBar.js +3 -3
- package/src/components/bar/QBar.test.js +44 -19
- package/src/components/breadcrumbs/QBreadcrumbs.js +6 -4
- package/src/components/breadcrumbs/QBreadcrumbs.test.js +134 -59
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +3 -3
- package/src/components/breadcrumbs/QBreadcrumbsEl.json +1 -1
- package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +491 -61
- package/src/components/btn/QBtn.js +11 -5
- package/src/components/btn/QBtn.json +2 -1
- package/src/components/btn/QBtn.test.js +1391 -212
- package/src/components/btn/use-btn.js +8 -6
- package/src/components/btn/use-btn.json +1 -1
- package/src/components/btn/use-btn.test.js +86 -542
- package/src/components/btn-dropdown/QBtnDropdown.js +9 -10
- package/src/components/btn-dropdown/QBtnDropdown.json +3 -3
- package/src/components/btn-group/QBtnGroup.js +2 -2
- package/src/components/btn-toggle/QBtnToggle.js +3 -3
- package/src/components/btn-toggle/QBtnToggle.json +2 -2
- package/src/components/card/QCard.js +3 -3
- package/src/components/card/QCardActions.js +3 -3
- package/src/components/card/QCardSection.js +2 -2
- package/src/components/carousel/QCarousel.js +6 -6
- package/src/components/carousel/QCarousel.json +1 -1
- package/src/components/carousel/QCarouselControl.js +2 -2
- package/src/components/carousel/QCarouselControl.json +1 -1
- package/src/components/carousel/QCarouselSlide.js +3 -3
- package/src/components/carousel/QCarouselSlide.json +1 -1
- package/src/components/chat/QChatMessage.js +2 -2
- package/src/components/checkbox/QCheckbox.js +1 -1
- package/src/components/checkbox/use-checkbox.js +8 -8
- package/src/components/checkbox/use-checkbox.json +5 -3
- package/src/components/chip/QChip.js +6 -5
- package/src/components/chip/QChip.json +4 -0
- package/src/components/chip/QChip.test.js +685 -317
- package/src/components/circular-progress/QCircularProgress.js +5 -5
- package/src/components/circular-progress/QCircularProgress.json +1 -1
- package/src/components/circular-progress/{use-circular-progress.js → circular-progress.js} +1 -1
- package/src/components/circular-progress/circular-progress.test.js +14 -0
- package/src/components/color/QColor.js +10 -10
- package/src/components/color/QColor.json +1 -1
- package/src/components/date/QDate.js +9 -9
- package/src/components/date/QDate.json +17 -11
- package/src/components/date/use-datetime.js +2 -2
- package/src/components/date/use-datetime.json +6 -6
- package/src/components/dialog/QDialog.js +33 -22
- package/src/components/dialog/QDialog.json +5 -3
- package/src/components/dialog/QDialog.test.js +1094 -220
- package/src/components/drawer/QDrawer.js +9 -9
- package/src/components/drawer/QDrawer.json +7 -4
- package/src/components/editor/QEditor.js +9 -9
- package/src/components/editor/QEditor.json +11 -5
- package/src/components/editor/editor-caret.js +1 -1
- package/src/components/editor/editor-utils.js +3 -3
- package/src/components/expansion-item/QExpansionItem.js +9 -9
- package/src/components/expansion-item/QExpansionItem.json +2 -2
- package/src/components/fab/QFab.js +5 -5
- package/src/components/fab/QFab.json +1 -1
- package/src/components/fab/QFabAction.js +4 -4
- package/src/components/fab/QFabAction.json +2 -1
- package/src/components/fab/use-fab.json +1 -1
- package/src/components/field/QField.js +2 -2
- package/src/components/field/QField.json +7 -3
- package/src/components/file/QFile.js +9 -9
- package/src/components/file/QFile.json +11 -4
- package/src/components/footer/QFooter.js +3 -3
- package/src/components/form/QForm.js +6 -6
- package/src/components/form/QForm.json +11 -4
- package/src/components/form/QFormChildMixin.js +2 -2
- package/src/components/form/QFormChildMixin.json +4 -1
- package/src/components/header/QHeader.js +3 -3
- package/src/components/icon/QIcon.js +3 -3
- package/src/components/icon/QIcon.json +1 -1
- package/src/components/img/QImg.js +5 -5
- package/src/components/img/QImg.json +1 -1
- package/src/components/infinite-scroll/QInfiniteScroll.js +6 -6
- package/src/components/infinite-scroll/QInfiniteScroll.json +20 -7
- package/src/components/inner-loading/QInnerLoading.js +3 -3
- package/src/components/inner-loading/QInnerLoading.json +1 -1
- package/src/components/input/QInput.js +9 -9
- package/src/components/input/QInput.json +16 -5
- package/src/components/input/use-mask.js +1 -1
- package/src/components/intersection/QIntersection.js +2 -2
- package/src/components/item/QItem.js +6 -6
- package/src/components/item/QItem.json +1 -1
- package/src/components/item/QItemLabel.js +2 -2
- package/src/components/item/QItemSection.js +2 -2
- package/src/components/item/QList.js +3 -3
- package/src/components/knob/QKnob.js +6 -6
- package/src/components/knob/QKnob.json +1 -1
- package/src/components/layout/QLayout.js +4 -4
- package/src/components/linear-progress/QLinearProgress.js +4 -4
- package/src/components/linear-progress/QLinearProgress.json +1 -1
- package/src/components/markup-table/QMarkupTable.js +3 -3
- package/src/components/menu/QMenu.js +20 -20
- package/src/components/menu/QMenu.json +8 -4
- package/src/components/no-ssr/QNoSsr.js +3 -3
- package/src/components/option-group/QOptionGroup.js +2 -2
- package/src/components/option-group/QOptionGroup.json +4 -4
- package/src/components/page/QPage.js +3 -3
- package/src/components/page/QPageContainer.js +3 -3
- package/src/components/page-scroller/QPageScroller.js +2 -2
- package/src/components/page-sticky/QPageSticky.js +1 -1
- package/src/components/page-sticky/QPageSticky.json +1 -1
- package/src/components/page-sticky/use-page-sticky.js +2 -2
- package/src/components/pagination/QPagination.js +4 -4
- package/src/components/pagination/QPagination.json +5 -3
- package/src/components/parallax/QParallax.js +6 -6
- package/src/components/popup-edit/QPopupEdit.js +4 -4
- package/src/components/popup-edit/QPopupEdit.json +30 -14
- package/src/components/popup-proxy/QPopupProxy.js +3 -3
- package/src/components/popup-proxy/QPopupProxy.json +9 -5
- package/src/components/pull-to-refresh/QPullToRefresh.js +5 -5
- package/src/components/pull-to-refresh/QPullToRefresh.json +6 -2
- package/src/components/radio/QRadio.js +9 -9
- package/src/components/radio/QRadio.json +4 -2
- package/src/components/range/QRange.js +3 -3
- package/src/components/rating/QRating.js +6 -6
- package/src/components/rating/QRating.json +2 -2
- package/src/components/resize-observer/QResizeObserver.js +3 -3
- package/src/components/resize-observer/QResizeObserver.json +2 -1
- package/src/components/responsive/QResponsive.js +3 -3
- package/src/components/responsive/QResponsive.json +1 -1
- package/src/components/scroll-area/QScrollArea.js +6 -6
- package/src/components/scroll-area/QScrollArea.json +8 -2
- package/src/components/scroll-observer/QScrollObserver.js +3 -3
- package/src/components/scroll-observer/QScrollObserver.json +5 -2
- package/src/components/select/QSelect.js +10 -10
- package/src/components/select/QSelect.json +38 -17
- package/src/components/separator/QSeparator.js +2 -2
- package/src/components/skeleton/QSkeleton.js +3 -3
- package/src/components/slide-item/QSlideItem.js +4 -4
- package/src/components/slide-item/QSlideItem.json +3 -1
- package/src/components/slide-transition/QSlideTransition.js +1 -1
- package/src/components/slider/QSlider.js +4 -4
- package/src/components/slider/use-slider.js +6 -6
- package/src/components/slider/use-slider.json +1 -1
- package/src/components/space/QSpace.js +1 -1
- package/src/components/space/QSpace.test.js +17 -0
- package/src/components/spinner/QSpinner.js +1 -1
- package/src/components/spinner/QSpinner.json +1 -1
- package/src/components/spinner/QSpinnerAudio.js +1 -1
- package/src/components/spinner/QSpinnerBall.js +1 -1
- package/src/components/spinner/QSpinnerBars.js +1 -1
- package/src/components/spinner/QSpinnerBox.js +1 -1
- package/src/components/spinner/QSpinnerClock.js +1 -1
- package/src/components/spinner/QSpinnerComment.js +1 -1
- package/src/components/spinner/QSpinnerCube.js +1 -1
- package/src/components/spinner/QSpinnerDots.js +1 -1
- package/src/components/spinner/QSpinnerFacebook.js +1 -1
- package/src/components/spinner/QSpinnerGears.js +1 -1
- package/src/components/spinner/QSpinnerGrid.js +1 -1
- package/src/components/spinner/QSpinnerHearts.js +1 -1
- package/src/components/spinner/QSpinnerHourglass.js +1 -1
- package/src/components/spinner/QSpinnerInfinity.js +1 -1
- package/src/components/spinner/QSpinnerIos.js +1 -1
- package/src/components/spinner/QSpinnerOrbit.js +1 -1
- package/src/components/spinner/QSpinnerOval.js +1 -1
- package/src/components/spinner/QSpinnerPie.js +1 -1
- package/src/components/spinner/QSpinnerPuff.js +1 -1
- package/src/components/spinner/QSpinnerRadio.js +1 -1
- package/src/components/spinner/QSpinnerRings.js +1 -1
- package/src/components/spinner/QSpinnerTail.js +1 -1
- package/src/components/spinner/spinner.json +1 -1
- package/src/components/spinner/use-spinner.js +1 -1
- package/src/components/splitter/QSplitter.js +3 -3
- package/src/components/splitter/QSplitter.json +4 -4
- package/src/components/stepper/QStep.js +5 -5
- package/src/components/stepper/QStep.json +1 -1
- package/src/components/stepper/QStepper.js +5 -5
- package/src/components/stepper/QStepper.json +1 -1
- package/src/components/stepper/QStepperNavigation.js +2 -2
- package/src/components/stepper/StepHeader.js +1 -1
- package/src/components/tab-panels/QTabPanel.js +3 -3
- package/src/components/tab-panels/QTabPanel.json +1 -7
- package/src/components/tab-panels/QTabPanels.js +4 -4
- package/src/components/tab-panels/QTabPanels.json +1 -1
- package/src/components/table/QTable.js +7 -7
- package/src/components/table/QTable.json +41 -22
- package/src/components/table/QTd.js +2 -2
- package/src/components/table/QTh.js +2 -2
- package/src/components/table/QTr.js +2 -2
- package/src/components/table/table-column-selection.js +1 -1
- package/src/components/table/table-sort.js +2 -2
- package/src/components/tabs/QRouteTab.js +2 -2
- package/src/components/tabs/QRouteTab.json +1 -1
- package/src/components/tabs/QTab.js +1 -1
- package/src/components/tabs/QTabs.js +6 -6
- package/src/components/tabs/use-tab.js +6 -6
- package/src/components/time/QTime.js +8 -8
- package/src/components/time/QTime.json +5 -3
- package/src/components/timeline/QTimeline.js +4 -4
- package/src/components/timeline/QTimelineEntry.js +3 -3
- package/src/components/toggle/QToggle.js +1 -1
- package/src/components/toolbar/QToolbar.js +2 -2
- package/src/components/toolbar/QToolbarTitle.js +2 -2
- package/src/components/tooltip/QTooltip.js +15 -15
- package/src/components/tooltip/QTooltip.json +6 -5
- package/src/components/tree/QTree.js +5 -5
- package/src/components/tree/QTree.json +12 -4
- package/src/components/uploader/QUploader.js +1 -1
- package/src/components/uploader/QUploader.json +25 -10
- package/src/components/uploader/QUploaderAddTrigger.js +2 -2
- package/src/components/uploader/uploader-core.js +8 -8
- package/src/components/uploader/xhr-uploader-plugin.js +3 -1
- package/src/components/uploader/xhr-uploader-plugin.json +9 -9
- package/src/components/video/QVideo.js +2 -2
- package/src/components/video/QVideo.json +1 -1
- package/src/components/video/QVideo.test.js +183 -0
- package/src/components/virtual-scroll/QVirtualScroll.js +4 -4
- package/src/components/virtual-scroll/QVirtualScroll.json +1 -0
- package/src/components/virtual-scroll/use-virtual-scroll.js +3 -3
- package/src/components/virtual-scroll/use-virtual-scroll.json +7 -3
- package/src/composables/private.use-align/use-align.test.js +62 -0
- package/src/composables/{private → private.use-anchor}/use-anchor.js +3 -3
- package/src/composables/{private → private.use-anchor}/use-anchor.json +0 -1
- package/src/composables/private.use-dark/use-dark.test.js +68 -0
- package/src/composables/{private → private.use-field}/use-field.js +8 -8
- package/src/composables/{private → private.use-field}/use-field.json +7 -10
- package/src/composables/{private → private.use-file}/use-file.js +1 -1
- package/src/composables/{private → private.use-file}/use-file.json +4 -2
- package/src/composables/{private → private.use-fullscreen}/use-fullscreen.js +2 -2
- package/src/composables/{private → private.use-fullscreen}/use-fullscreen.json +9 -3
- package/src/composables/{private → private.use-history}/use-history.js +1 -1
- package/src/composables/private.use-history/use-history.test.js +116 -0
- package/src/composables/{private → private.use-model-toggle}/use-model-toggle.js +1 -1
- package/src/composables/{private → private.use-panel}/use-panel.js +3 -3
- package/src/composables/{private → private.use-panel}/use-panel.json +10 -5
- package/src/composables/{private → private.use-portal}/use-portal.js +6 -6
- package/src/composables/{private → private.use-prevent-scroll}/use-prevent-scroll.js +1 -1
- package/src/composables/private.use-ratio/use-ratio.test.js +40 -0
- package/src/composables/{private → private.use-router-link}/use-router-link.js +1 -1
- package/src/composables/{private → private.use-scroll-target}/use-scroll-target.js +2 -5
- package/src/composables/private.use-size/use-size.test.js +40 -0
- package/src/composables/private.use-transition/use-transition.test.js +118 -0
- package/src/composables/{private → private.use-validate}/use-validate.js +4 -4
- package/src/composables/{private → private.use-validate}/use-validate.json +3 -1
- package/src/composables/{use-dialog-plugin-component.js → use-dialog-plugin-component/use-dialog-plugin-component.js} +2 -4
- package/src/composables/use-form/private.use-form.test.js +107 -0
- package/src/composables/{use-form-child.js → use-form/use-form-child.js} +1 -1
- package/src/composables/{use-hydration.js → use-hydration/use-hydration.js} +1 -1
- package/src/composables/use-hydration/use-hydration.test.js +27 -0
- package/src/composables/{use-id.js → use-id/use-id.js} +2 -2
- package/src/composables/use-id/use-id.test.js +72 -0
- package/src/composables/{use-interval.js → use-interval/use-interval.js} +1 -1
- package/src/composables/{use-meta.js → use-meta/use-meta.js} +1 -1
- package/src/composables/{use-quasar.js → use-quasar/use-quasar.js} +2 -1
- package/src/composables/use-quasar/use-quasar.test.js +35 -0
- package/src/composables/{use-tick.js → use-tick/use-tick.js} +1 -1
- package/src/composables/{use-timeout.js → use-timeout/use-timeout.js} +1 -1
- package/src/composables.js +11 -11
- package/src/css/index.sass +1 -1
- package/src/directives/close-popup/ClosePopup.js +4 -4
- package/src/directives/intersection/Intersection.js +3 -3
- package/src/directives/morph/Morph.js +2 -2
- package/src/directives/morph/Morph.json +1 -1
- package/src/directives/mutation/Mutation.js +2 -2
- package/src/directives/ripple/Ripple.js +6 -6
- package/src/directives/ripple/Ripple.json +2 -2
- package/src/directives/ripple/Ripple.test.js +340 -0
- package/src/directives/scroll/Scroll.js +4 -4
- package/src/directives/scroll-fire/ScrollFire.js +6 -6
- package/src/directives/scroll-fire/ScrollFire.json +1 -1
- package/src/directives/touch-hold/TouchHold.js +4 -4
- package/src/directives/touch-pan/TouchPan.js +5 -5
- package/src/directives/touch-repeat/TouchRepeat.js +5 -5
- package/src/directives/touch-swipe/TouchSwipe.js +5 -5
- package/src/index.dev.js +10 -4
- package/src/index.prod.js +11 -4
- package/src/index.ssr.js +11 -4
- package/src/index.umd.js +12 -4
- package/src/install-quasar.js +14 -9
- package/src/plugins/addressbar/AddressbarColor.js +2 -2
- package/src/plugins/addressbar/AddressbarColor.json +2 -1
- package/src/plugins/app-fullscreen/AppFullscreen.js +3 -3
- package/src/plugins/app-fullscreen/AppFullscreen.json +1 -0
- package/src/plugins/app-visibility/AppVisibility.js +3 -3
- package/src/plugins/bottom-sheet/BottomSheet.js +2 -5
- package/src/plugins/bottom-sheet/BottomSheet.json +1 -1
- package/src/plugins/bottom-sheet/component/BottomSheetComponent.js +2 -2
- package/src/plugins/cookies/Cookies.json +5 -2
- package/src/plugins/dark/Dark.js +2 -2
- package/src/plugins/dark/Dark.json +5 -2
- package/src/plugins/dialog/Dialog.js +2 -5
- package/src/plugins/dialog/Dialog.json +3 -3
- package/src/plugins/dialog/component/DialogPluginComponent.js +4 -4
- package/src/{icon-set.js → plugins/icon-set/IconSet.js} +29 -10
- package/src/plugins/icon-set/IconSet.json +1417 -0
- package/src/plugins/icon-set/IconSet.test.js +346 -0
- package/src/{lang.js → plugins/lang/Lang.js} +25 -15
- package/src/plugins/lang/Lang.json +1100 -0
- package/src/plugins/lang/Lang.test.js +267 -0
- package/src/plugins/loading/Loading.js +5 -5
- package/src/plugins/loading/Loading.json +4 -2
- package/src/plugins/loading-bar/LoadingBar.js +5 -5
- package/src/plugins/loading-bar/LoadingBar.json +9 -4
- package/src/plugins/meta/Meta.js +1 -1
- package/src/plugins/notify/Notify.js +4 -4
- package/src/plugins/notify/Notify.json +8 -6
- package/src/plugins/platform/Platform.js +3 -4
- package/src/plugins/platform/Platform.json +6 -0
- package/src/plugins/platform/Platform.test.js +104 -0
- package/src/{body.js → plugins/private.body/Body.js} +5 -4
- package/src/{history.js → plugins/private.history/History.js} +2 -2
- package/src/plugins/screen/Screen.js +4 -4
- package/src/plugins/screen/Screen.json +4 -2
- package/src/plugins/{local-storage → storage}/LocalStorage.js +1 -1
- package/src/plugins/storage/LocalStorage.json +5 -0
- package/src/plugins/storage/LocalStorage.test.js +323 -0
- package/src/plugins/{session-storage → storage}/SessionStorage.js +1 -1
- package/src/plugins/storage/SessionStorage.json +5 -0
- package/src/plugins/storage/SessionStorage.test.js +323 -0
- package/src/{utils/private → plugins/storage/engine}/web-storage.js +21 -10
- package/src/{utils/private → plugins/storage/engine}/web-storage.json +22 -11
- package/src/plugins/storage/engine/web-storage.test.js +43 -0
- package/src/plugins.js +8 -4
- package/src/utils/EventBus/EventBus.test.js +108 -0
- package/src/utils/clone/clone.test.js +111 -0
- package/src/utils/colors/colors.test.js +459 -0
- package/src/utils/{copy-to-clipboard.js → copy-to-clipboard/copy-to-clipboard.js} +1 -1
- package/src/utils/{create-meta-mixin.js → create-meta-mixin/create-meta-mixin.js} +1 -1
- package/src/utils/{create-uploader-component.js → create-uploader-component/create-uploader-component.js} +4 -4
- package/src/utils/css-var/get-css-var.test.js +32 -0
- package/src/utils/css-var/set-css-var.test.js +36 -0
- package/src/utils/{date.js → date/date.js} +6 -6
- package/src/utils/debounce/debounce.test.js +188 -0
- package/src/utils/extend/extend.test.js +93 -0
- package/src/utils/{format.js → format/format.js} +2 -2
- package/src/utils/format/format.test.js +107 -0
- package/src/utils/{frame-debounce.js → frame-debounce/frame-debounce.js} +1 -1
- package/src/utils/frame-debounce/frame-debounce.test.js +127 -0
- package/src/utils/is/is.test.js +125 -0
- package/src/utils/{morph.js → morph/morph.js} +1 -1
- package/src/utils/{open-url.js → open-url/open-url.js} +3 -3
- package/src/utils/patterns/patterns.test.js +403 -0
- package/src/utils/{private → private.click-outside}/click-outside.js +2 -2
- package/src/utils/{private/define-reactive-plugin.js → private.create/create.js} +6 -3
- package/src/utils/private.create/create.test.js +58 -0
- package/src/utils/private.focus/focus-manager.test.js +190 -0
- package/src/utils/private.focus/focusout.test.js +114 -0
- package/src/utils/private.get-emits-object/get-emits-object.test.js +29 -0
- package/src/utils/private.global/global-config.test.js +54 -0
- package/src/utils/{private → private.global}/global-dialog.js +1 -1
- package/src/utils/{private → private.global}/global-dialog.json +1 -1
- package/src/utils/{private → private.global}/global-nodes.js +1 -1
- package/src/utils/private.global/global-nodes.test.js +110 -0
- package/src/utils/private.inject-obj-prop/inject-obj-prop.test.js +104 -0
- package/src/utils/{private → private.keyboard}/escape-key.js +1 -1
- package/src/utils/private.keyboard/escape-key.test.js +117 -0
- package/src/utils/private.noop-ssr-directive-transform/noop-ssr-directive-transform.test.js +14 -0
- package/src/utils/{private → private.portal}/portal.js +1 -1
- package/src/utils/{private → private.position-engine}/position-engine.js +1 -1
- package/src/utils/private.rtl/rtl.test.js +13 -0
- package/src/utils/private.sort/sort.test.js +25 -0
- package/src/utils/{private → private.symbols}/symbols.js +1 -1
- package/src/utils/private.touch/touch.test.js +102 -0
- package/src/utils/{prevent-scroll.js → scroll/prevent-scroll.js} +3 -3
- package/src/utils/{scroll.js → scroll/scroll.js} +1 -1
- package/src/utils/throttle/throttle.test.js +146 -0
- package/src/utils/uid/uid.test.js +17 -0
- package/src/utils.js +24 -24
- package/src/vue-plugin.js +12 -4
- package/src/Lang.json +0 -19
- package/src/api-file-example.json +0 -94
- package/src/composables/private/__tests__/use-form.cy.js +0 -11
- package/src/composables/private/__tests__/use-size.cy.js +0 -36
- package/src/composables/private/__tests__/use-transition.cy.js +0 -111
- package/src/composables/private/use-form.test.js +0 -93
- package/src/composables/private/use-ratio.test.js +0 -27
- package/src/composables/private/use-size.test.js +0 -22
- package/src/composables/use-id.test.js +0 -55
- package/src/plugins/local-storage/LocalStorage.json +0 -5
- package/src/plugins/session-storage/SessionStorage.json +0 -5
- package/src/utils/private/create.js +0 -4
- /package/src/composables/{private/__tests__ → __tests__}/FieldWrapper.vue +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-anchor.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-field.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-file.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-fullscreen.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-model-toggle.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-portal.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-router-link.cy.js +0 -0
- /package/src/composables/{private/__tests__ → __tests__}/use-validate.cy.js +0 -0
- /package/src/composables/{private → private.use-align}/use-align.js +0 -0
- /package/src/composables/{private → private.use-dark}/use-dark.js +0 -0
- /package/src/composables/{private → private.use-file}/use-file-dom-props.js +0 -0
- /package/src/composables/{private → private.use-key-composition}/use-key-composition.js +0 -0
- /package/src/composables/{private → private.use-model-toggle}/use-model-toggle.json +0 -0
- /package/src/composables/{private → private.use-panel}/use-panel.child.json +0 -0
- /package/src/composables/{private → private.use-panel}/use-panel.sass +0 -0
- /package/src/composables/{private → private.use-portal}/use-portal.json +0 -0
- /package/src/composables/{private → private.use-ratio}/use-ratio.js +0 -0
- /package/src/composables/{private → private.use-ratio}/use-ratio.json +0 -0
- /package/src/composables/{private → private.use-refocus-target}/use-refocus-target.js +0 -0
- /package/src/composables/{private → private.use-router-link}/use-router-link.json +0 -0
- /package/src/composables/{private → private.use-size}/use-size.js +0 -0
- /package/src/composables/{private → private.use-size}/use-size.json +0 -0
- /package/src/composables/{private → private.use-transition}/use-transition.js +0 -0
- /package/src/composables/{private → private.use-transition}/use-transition.json +0 -0
- /package/src/composables/{private/use-form.js → use-form/private.use-form.js} +0 -0
- /package/src/composables/{private/use-form.json → use-form/private.use-form.json} +0 -0
- /package/src/composables/{use-render-cache.js → use-render-cache/use-render-cache.js} +0 -0
- /package/src/composables/{use-split-attrs.js → use-split-attrs/use-split-attrs.js} +0 -0
- /package/src/utils/{EventBus.js → EventBus/EventBus.js} +0 -0
- /package/src/utils/{clone.js → clone/clone.js} +0 -0
- /package/src/utils/{colors.js → colors/colors.js} +0 -0
- /package/src/utils/{get-css-var.js → css-var/get-css-var.js} +0 -0
- /package/src/utils/{set-css-var.js → css-var/set-css-var.js} +0 -0
- /package/src/utils/{private/date-persian.js → date/private.persian.js} +0 -0
- /package/src/utils/{debounce.js → debounce/debounce.js} +0 -0
- /package/src/utils/{dom.js → dom/dom.js} +0 -0
- /package/src/utils/{event.js → event/event.js} +0 -0
- /package/src/utils/{export-file.js → export-file/export-file.js} +0 -0
- /package/src/utils/{extend.js → extend/extend.js} +0 -0
- /package/src/utils/{is.js → is/is.js} +0 -0
- /package/src/utils/{patterns.js → patterns/patterns.js} +0 -0
- /package/src/utils/{private → private.focus}/focus-manager.js +0 -0
- /package/src/utils/{private → private.focus}/focusout.js +0 -0
- /package/src/utils/{private → private.get-emits-object}/get-emits-object.js +0 -0
- /package/src/utils/{private → private.global}/global-config.js +0 -0
- /package/src/utils/{private → private.inject-obj-prop}/inject-obj-prop.js +0 -0
- /package/src/utils/{private → private.keyboard}/key-composition.js +0 -0
- /package/src/utils/{private → private.noop-ssr-directive-transform}/noop-ssr-directive-transform.js +0 -0
- /package/src/utils/{private → private.option-sizes}/option-sizes.js +0 -0
- /package/src/utils/{private → private.render}/render.js +0 -0
- /package/src/utils/{private → private.rtl}/rtl.js +0 -0
- /package/src/utils/{private → private.selection}/selection.js +0 -0
- /package/src/utils/{private → private.sort}/sort.js +0 -0
- /package/src/utils/{private → private.touch}/touch.js +0 -0
- /package/src/utils/{private → private.vm}/vm.js +0 -0
- /package/src/utils/{run-sequential-promises.js → run-sequential-promises/run-sequential-promises.js} +0 -0
- /package/src/utils/{throttle.js → throttle/throttle.js} +0 -0
- /package/src/utils/{uid.js → uid/uid.js} +0 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import colors, { rgbToString } from './colors.js'
|
|
4
|
+
|
|
5
|
+
describe('[colors API]', () => {
|
|
6
|
+
describe('[Functions]', () => {
|
|
7
|
+
describe('[(function)rgbToHex]', () => {
|
|
8
|
+
test.each([
|
|
9
|
+
[ 'black', { r: 0, g: 0, b: 0 }, '#000000' ],
|
|
10
|
+
[ 'white', { r: 255, g: 255, b: 255 }, '#ffffff' ],
|
|
11
|
+
[ 'red', { r: 255, g: 0, b: 0 }, '#ff0000' ],
|
|
12
|
+
[ 'green', { r: 0, g: 255, b: 0 }, '#00ff00' ],
|
|
13
|
+
[ 'blue', { r: 0, g: 0, b: 255 }, '#0000ff' ],
|
|
14
|
+
[ 'yellow', { r: 255, g: 255, b: 0 }, '#ffff00' ],
|
|
15
|
+
[ 'cyan', { r: 0, g: 255, b: 255 }, '#00ffff' ],
|
|
16
|
+
[ 'magenta', { r: 255, g: 0, b: 255 }, '#ff00ff' ],
|
|
17
|
+
[ 'gray', { r: 128, g: 128, b: 128 }, '#808080' ]
|
|
18
|
+
])('rgbToHex(%s) with/without alpha', (_, value, expected) => {
|
|
19
|
+
expect(
|
|
20
|
+
colors.rgbToHex(value)
|
|
21
|
+
).toBe(expected)
|
|
22
|
+
|
|
23
|
+
expect(
|
|
24
|
+
colors.rgbToHex({ ...value, a: 100 })
|
|
25
|
+
).toBe(expected + 'ff')
|
|
26
|
+
|
|
27
|
+
expect(
|
|
28
|
+
colors.rgbToHex({ ...value, a: 58 })
|
|
29
|
+
).toBe(expected + '94')
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
test.each([
|
|
33
|
+
[ 'r > 255', { r: 256, g: 0, b: 0 } ],
|
|
34
|
+
[ 'g > 255', { r: 0, g: 256, b: 0 } ],
|
|
35
|
+
[ 'b > 255', { r: 0, g: 0, b: 256 } ],
|
|
36
|
+
[ 'a > 100', { r: 0, g: 0, b: 0, a: 101 } ]
|
|
37
|
+
])('rgbToHex(%s) throws', (_, value) => {
|
|
38
|
+
expect(() => {
|
|
39
|
+
colors.rgbToHex(value)
|
|
40
|
+
}).toThrow(/Expected 3 numbers below 256/)
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
describe('[(function)hexToRgb]', () => {
|
|
45
|
+
test.each([
|
|
46
|
+
[ 'black', '#000000', { r: 0, g: 0, b: 0 } ],
|
|
47
|
+
[ 'white', '#ffffff', { r: 255, g: 255, b: 255 } ],
|
|
48
|
+
[ 'red', '#ff0000', { r: 255, g: 0, b: 0 } ],
|
|
49
|
+
[ 'green', '#00ff00', { r: 0, g: 255, b: 0 } ],
|
|
50
|
+
[ 'blue', '#0000ff', { r: 0, g: 0, b: 255 } ],
|
|
51
|
+
[ 'yellow', '#ffff00', { r: 255, g: 255, b: 0 } ],
|
|
52
|
+
[ 'cyan', '#00ffff', { r: 0, g: 255, b: 255 } ],
|
|
53
|
+
[ 'magenta', '#ff00ff', { r: 255, g: 0, b: 255 } ],
|
|
54
|
+
[ 'gray', '#808080', { r: 128, g: 128, b: 128 } ]
|
|
55
|
+
])('hexToRgb(%s)', (_, value, expected) => {
|
|
56
|
+
expect(
|
|
57
|
+
colors.hexToRgb(value)
|
|
58
|
+
).toStrictEqual(expected)
|
|
59
|
+
|
|
60
|
+
expect(
|
|
61
|
+
colors.hexToRgb(value + 'ff')
|
|
62
|
+
).toStrictEqual({ ...expected, a: 100 })
|
|
63
|
+
|
|
64
|
+
expect(
|
|
65
|
+
colors.hexToRgb(value + '94')
|
|
66
|
+
).toStrictEqual({ ...expected, a: 58 })
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
test('hexToRgb(<invalid>) throws', () => {
|
|
70
|
+
expect(() => {
|
|
71
|
+
colors.hexToRgb()
|
|
72
|
+
}).toThrow(/Expected a string/)
|
|
73
|
+
|
|
74
|
+
expect(() => {
|
|
75
|
+
colors.hexToRgb(100)
|
|
76
|
+
}).toThrow(/Expected a string/)
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
describe('[(function)hsvToRgb]', () => {
|
|
81
|
+
test.each([
|
|
82
|
+
[ 'black', { h: 0, s: 0, v: 0 }, { r: 0, g: 0, b: 0 } ],
|
|
83
|
+
[ 'white', { h: 0, s: 0, v: 100 }, { r: 255, g: 255, b: 255 } ],
|
|
84
|
+
[ 'red', { h: 0, s: 100, v: 100 }, { r: 255, g: 0, b: 0 } ],
|
|
85
|
+
[ 'green', { h: 120, s: 100, v: 100 }, { r: 0, g: 255, b: 0 } ],
|
|
86
|
+
[ 'blue', { h: 240, s: 100, v: 100 }, { r: 0, g: 0, b: 255 } ],
|
|
87
|
+
[ 'yellow', { h: 60, s: 100, v: 100 }, { r: 255, g: 255, b: 0 } ],
|
|
88
|
+
[ 'cyan', { h: 180, s: 100, v: 100 }, { r: 0, g: 255, b: 255 } ],
|
|
89
|
+
[ 'magenta', { h: 300, s: 100, v: 100 }, { r: 255, g: 0, b: 255 } ],
|
|
90
|
+
[ 'gray', { h: 0, s: 0, v: 50 }, { r: 128, g: 128, b: 128 } ]
|
|
91
|
+
])('hsvToRgb(%s)', (_, value, expected) => {
|
|
92
|
+
expect(
|
|
93
|
+
colors.hsvToRgb(value)
|
|
94
|
+
).toStrictEqual({ ...expected, a: undefined })
|
|
95
|
+
|
|
96
|
+
expect(
|
|
97
|
+
colors.hsvToRgb({ ...value, a: 100 })
|
|
98
|
+
).toStrictEqual({ ...expected, a: 100 })
|
|
99
|
+
|
|
100
|
+
expect(
|
|
101
|
+
colors.hsvToRgb({ ...value, a: 58 })
|
|
102
|
+
).toStrictEqual({ ...expected, a: 58 })
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
describe('[(function)rgbToHsv]', () => {
|
|
107
|
+
test.each([
|
|
108
|
+
[ 'black', { r: 0, g: 0, b: 0 }, { h: 0, s: 0, v: 0 } ],
|
|
109
|
+
[ 'white', { r: 255, g: 255, b: 255 }, { h: 0, s: 0, v: 100 } ],
|
|
110
|
+
[ 'red', { r: 255, g: 0, b: 0 }, { h: 0, s: 100, v: 100 } ],
|
|
111
|
+
[ 'green', { r: 0, g: 255, b: 0 }, { h: 120, s: 100, v: 100 } ],
|
|
112
|
+
[ 'blue', { r: 0, g: 0, b: 255 }, { h: 240, s: 100, v: 100 } ],
|
|
113
|
+
[ 'yellow', { r: 255, g: 255, b: 0 }, { h: 60, s: 100, v: 100 } ],
|
|
114
|
+
[ 'cyan', { r: 0, g: 255, b: 255 }, { h: 180, s: 100, v: 100 } ],
|
|
115
|
+
[ 'magenta', { r: 255, g: 0, b: 255 }, { h: 300, s: 100, v: 100 } ],
|
|
116
|
+
[ 'gray', { r: 128, g: 128, b: 128 }, { h: 0, s: 0, v: 50 } ]
|
|
117
|
+
])('rgbToHsv(%s)', (_, value, expected) => {
|
|
118
|
+
expect(
|
|
119
|
+
colors.rgbToHsv(value)
|
|
120
|
+
).toStrictEqual({ ...expected, a: undefined })
|
|
121
|
+
|
|
122
|
+
expect(
|
|
123
|
+
colors.rgbToHsv({ ...value, a: 100 })
|
|
124
|
+
).toStrictEqual({ ...expected, a: 100 })
|
|
125
|
+
|
|
126
|
+
expect(
|
|
127
|
+
colors.rgbToHsv({ ...value, a: 58 })
|
|
128
|
+
).toStrictEqual({ ...expected, a: 58 })
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
describe('[(function)textToRgb]', () => {
|
|
133
|
+
test.each([
|
|
134
|
+
[ 'black', '#000000', { r: 0, g: 0, b: 0 } ],
|
|
135
|
+
[ 'white', '#ffffff', { r: 255, g: 255, b: 255 } ],
|
|
136
|
+
[ 'red', '#ff0000', { r: 255, g: 0, b: 0 } ],
|
|
137
|
+
[ 'green', '#00ff00', { r: 0, g: 255, b: 0 } ],
|
|
138
|
+
[ 'blue', '#0000ff', { r: 0, g: 0, b: 255 } ],
|
|
139
|
+
[ 'yellow', '#ffff00', { r: 255, g: 255, b: 0 } ],
|
|
140
|
+
[ 'cyan', '#00ffff', { r: 0, g: 255, b: 255 } ],
|
|
141
|
+
[ 'magenta', '#ff00ff', { r: 255, g: 0, b: 255 } ],
|
|
142
|
+
[ 'gray', '#808080', { r: 128, g: 128, b: 128 } ]
|
|
143
|
+
])('textToRgb(%s)', (_, value, expected) => {
|
|
144
|
+
expect(
|
|
145
|
+
colors.textToRgb(value)
|
|
146
|
+
).toStrictEqual(expected)
|
|
147
|
+
|
|
148
|
+
expect(
|
|
149
|
+
colors.textToRgb(value + 'ff')
|
|
150
|
+
).toStrictEqual({ ...expected, a: 100 })
|
|
151
|
+
|
|
152
|
+
expect(
|
|
153
|
+
colors.textToRgb(value + '94')
|
|
154
|
+
).toStrictEqual({ ...expected, a: 58 })
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
test.each([
|
|
158
|
+
[ 'black', 'rgb(0, 0, 0)', { r: 0, g: 0, b: 0 } ],
|
|
159
|
+
[ 'white', 'rgb(255, 255, 255)', { r: 255, g: 255, b: 255 } ],
|
|
160
|
+
[ 'red', 'rgb(255, 0, 0)', { r: 255, g: 0, b: 0 } ],
|
|
161
|
+
[ 'green', 'rgb(0, 255, 0)', { r: 0, g: 255, b: 0 } ],
|
|
162
|
+
[ 'blue', 'rgb(0, 0, 255)', { r: 0, g: 0, b: 255 } ],
|
|
163
|
+
[ 'yellow', 'rgb(255, 255, 0)', { r: 255, g: 255, b: 0 } ],
|
|
164
|
+
[ 'cyan', 'rgb(0, 255, 255)', { r: 0, g: 255, b: 255 } ],
|
|
165
|
+
[ 'magenta', 'rgb(255, 0, 255)', { r: 255, g: 0, b: 255 } ],
|
|
166
|
+
[ 'gray', 'rgb(128, 128, 128)', { r: 128, g: 128, b: 128 } ]
|
|
167
|
+
])('textToRgb(%s)', (_, value, expected) => {
|
|
168
|
+
expect(
|
|
169
|
+
colors.textToRgb(value)
|
|
170
|
+
).toStrictEqual(expected)
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
test.each([
|
|
174
|
+
[ 'black', 'rgba(0, 0, 0, .1)', { r: 0, g: 0, b: 0, a: 10 } ],
|
|
175
|
+
[ 'white', 'rgba(255, 255, 255, 0.1)', { r: 255, g: 255, b: 255, a: 10 } ],
|
|
176
|
+
[ 'red', 'rgba(255, 0, 0, .1)', { r: 255, g: 0, b: 0, a: 10 } ],
|
|
177
|
+
[ 'green', 'rgba(0, 255, 0, .1)', { r: 0, g: 255, b: 0, a: 10 } ],
|
|
178
|
+
[ 'blue', 'rgba(0, 0, 255, .1)', { r: 0, g: 0, b: 255, a: 10 } ],
|
|
179
|
+
[ 'yellow', 'rgba(255, 255, 0, .1)', { r: 255, g: 255, b: 0, a: 10 } ],
|
|
180
|
+
[ 'cyan', 'rgba(0, 255, 255, .1)', { r: 0, g: 255, b: 255, a: 10 } ],
|
|
181
|
+
[ 'magenta', 'rgba(255, 0, 255, .1)', { r: 255, g: 0, b: 255, a: 10 } ],
|
|
182
|
+
[ 'gray', 'rgba(128, 128, 128, .1)', { r: 128, g: 128, b: 128, a: 10 } ]
|
|
183
|
+
])('textToRgb(%s)', (_, value, expected) => {
|
|
184
|
+
expect(
|
|
185
|
+
colors.textToRgb(value)
|
|
186
|
+
).toStrictEqual(expected)
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
test.each([
|
|
190
|
+
[ 'rgba(0, 255 , 0, .1)' ],
|
|
191
|
+
[ ' rgba ( 0, 255 , 0, .1)' ],
|
|
192
|
+
[ 'rgba( 0 , 255 , 0 , .1 )' ],
|
|
193
|
+
[ ' rgba ( 0 , 255 , 0 , .1 ) ' ]
|
|
194
|
+
])('textToRgb(%s)', (value) => {
|
|
195
|
+
expect(
|
|
196
|
+
colors.textToRgb(value)
|
|
197
|
+
).toStrictEqual({ r: 0, g: 255, b: 0, a: 10 })
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
test('textToRgb(<invalid>) throws', () => {
|
|
201
|
+
expect(() => {
|
|
202
|
+
colors.textToRgb()
|
|
203
|
+
}).toThrow(/Expected a string/)
|
|
204
|
+
|
|
205
|
+
expect(() => {
|
|
206
|
+
colors.textToRgb(100)
|
|
207
|
+
}).toThrow(/Expected a string/)
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
describe('[(function)lighten]', () => {
|
|
212
|
+
test.each([
|
|
213
|
+
[ 'black', '#000', 10, '#1a1a1a' ],
|
|
214
|
+
[ 'white', '#fff', 10, '#ffffff' ],
|
|
215
|
+
[ 'red', '#f00', 10, '#ff1a1a' ],
|
|
216
|
+
[ 'green', '#0f0', 10, '#1aff1a' ],
|
|
217
|
+
[ 'blue', '#00f', 10, '#1a1aff' ],
|
|
218
|
+
[ 'yellow', '#ff0', 10, '#ffff1a' ],
|
|
219
|
+
[ 'cyan', '#0ff', 10, '#1affff' ],
|
|
220
|
+
[ 'magenta', '#f0f', 10, '#ff1aff' ],
|
|
221
|
+
[ 'gray', '#888', 10, '#949494' ]
|
|
222
|
+
])('lighten(%s)', (_, value, amount, expected) => {
|
|
223
|
+
expect(
|
|
224
|
+
colors.lighten(value, amount)
|
|
225
|
+
).toBe(expected)
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
test('lighten(<invalid>) throws', () => {
|
|
229
|
+
expect(() => {
|
|
230
|
+
colors.lighten()
|
|
231
|
+
}).toThrow(/Expected a string as color/)
|
|
232
|
+
|
|
233
|
+
expect(() => {
|
|
234
|
+
colors.lighten('#f0f', 'a')
|
|
235
|
+
}).toThrow(/Expected a numeric percent/)
|
|
236
|
+
})
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
describe('[(function)luminosity]', () => {
|
|
240
|
+
test.each([
|
|
241
|
+
[ 'black', { r: 0, g: 0, b: 0 }, 0 ],
|
|
242
|
+
[ 'white', { r: 255, g: 255, b: 255 }, 1 ],
|
|
243
|
+
[ 'red', { r: 255, g: 0, b: 0 }, 0.2126 ],
|
|
244
|
+
[ 'green', { r: 0, g: 255, b: 0 }, 0.7152 ],
|
|
245
|
+
[ 'blue', { r: 0, g: 0, b: 255 }, 0.0722 ],
|
|
246
|
+
[ 'yellow', { r: 255, g: 255, b: 0 }, 0.9278 ],
|
|
247
|
+
[ 'cyan', { r: 0, g: 255, b: 255 }, 0.7874 ],
|
|
248
|
+
[ 'magenta', { r: 255, g: 0, b: 255 }, 0.2848 ],
|
|
249
|
+
[ 'gray', { r: 128, g: 128, b: 128 }, 0.215859375 ]
|
|
250
|
+
])('luminosity(%s)', (_, value, expected) => {
|
|
251
|
+
expect(
|
|
252
|
+
colors.luminosity(value)
|
|
253
|
+
).toBeCloseTo(expected)
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
test('luminosity(<invalid>) throws', () => {
|
|
257
|
+
expect(() => {
|
|
258
|
+
colors.luminosity()
|
|
259
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
260
|
+
|
|
261
|
+
expect(() => {
|
|
262
|
+
colors.luminosity(10)
|
|
263
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
264
|
+
|
|
265
|
+
expect(() => {
|
|
266
|
+
colors.luminosity({})
|
|
267
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
describe('[(function)brightness]', () => {
|
|
272
|
+
test.each([
|
|
273
|
+
[ 'black', { r: 0, g: 0, b: 0 }, 0 ],
|
|
274
|
+
[ 'white', { r: 255, g: 255, b: 255 }, 255 ],
|
|
275
|
+
[ 'red', { r: 255, g: 0, b: 0 }, 76.2458 ],
|
|
276
|
+
[ 'green', { r: 0, g: 255, b: 0 }, 149.685 ],
|
|
277
|
+
[ 'blue', { r: 0, g: 0, b: 255 }, 29.07 ],
|
|
278
|
+
[ 'yellow', { r: 255, g: 255, b: 0 }, 225.93 ],
|
|
279
|
+
[ 'cyan', { r: 0, g: 255, b: 255 }, 178.755 ],
|
|
280
|
+
[ 'magenta', { r: 255, g: 0, b: 255 }, 105.315 ],
|
|
281
|
+
[ 'gray', { r: 128, g: 128, b: 128 }, 128 ]
|
|
282
|
+
])('brightness(%s)', (_, value, expected) => {
|
|
283
|
+
expect(
|
|
284
|
+
colors.brightness(value)
|
|
285
|
+
).toBeCloseTo(expected)
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
test('brightness(<invalid>) throws', () => {
|
|
289
|
+
expect(() => {
|
|
290
|
+
colors.brightness()
|
|
291
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
292
|
+
|
|
293
|
+
expect(() => {
|
|
294
|
+
colors.brightness(10)
|
|
295
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
296
|
+
|
|
297
|
+
expect(() => {
|
|
298
|
+
colors.brightness({})
|
|
299
|
+
}).toThrow(/Expected a string or a {r, g, b} object as color/)
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
describe('[(function)blend]', () => {
|
|
304
|
+
test.each([
|
|
305
|
+
[ 'black', 'white', '#000000', '#ffffff', '#000000ff' ],
|
|
306
|
+
[ 'white', 'black', '#ffffff', '#000000', '#ffffffff' ],
|
|
307
|
+
[ 'red', 'green', '#ff0000', '#00ff00', '#ff0000ff' ],
|
|
308
|
+
[ 'green', 'red', '#00ff00', '#ff0000', '#00ff00ff' ],
|
|
309
|
+
[ 'blue', 'yellow', '#0000ff', '#ffff00', '#0000ffff' ],
|
|
310
|
+
[ 'yellow', 'blue', '#ffff00', '#0000ff', '#ffff00ff' ],
|
|
311
|
+
[ 'cyan', 'magenta', '#00ffff', '#ff00ff', '#00ffffff' ],
|
|
312
|
+
[ 'magenta', 'cyan', '#ff00ff', '#00ffff', '#ff00ffff' ],
|
|
313
|
+
[ 'gray', 'gray', '#808080', '#808080', '#808080ff' ]
|
|
314
|
+
])('blend(%s, %s) as hex str', (_, __, fgColor, bgColor, expected) => {
|
|
315
|
+
expect(
|
|
316
|
+
colors.blend(fgColor, bgColor)
|
|
317
|
+
).toBe(expected)
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
test.each([
|
|
321
|
+
[ 'black', 'white', { r: 0, g: 0, b: 0 }, { r: 255, g: 255, b: 255 }, { r: 0, g: 0, b: 0, a: 100 } ],
|
|
322
|
+
[ 'white', 'black', { r: 255, g: 255, b: 255 }, { r: 0, g: 0, b: 0 }, { r: 255, g: 255, b: 255, a: 100 } ],
|
|
323
|
+
[ 'red', 'green', { r: 255, g: 0, b: 0 }, { r: 0, g: 255, b: 0 }, { r: 255, g: 0, b: 0, a: 100 } ],
|
|
324
|
+
[ 'green', 'red', { r: 0, g: 255, b: 0 }, { r: 255, g: 0, b: 0 }, { r: 0, g: 255, b: 0, a: 100 } ],
|
|
325
|
+
[ 'blue', 'yellow', { r: 0, g: 0, b: 255 }, { r: 255, g: 255, b: 0 }, { r: 0, g: 0, b: 255, a: 100 } ],
|
|
326
|
+
[ 'yellow', 'blue', { r: 255, g: 255, b: 0 }, { r: 0, g: 0, b: 255 }, { r: 255, g: 255, b: 0, a: 100 } ],
|
|
327
|
+
[ 'cyan', 'magenta', { r: 0, g: 255, b: 255 }, { r: 255, g: 0, b: 255 }, { r: 0, g: 255, b: 255, a: 100 } ],
|
|
328
|
+
[ 'magenta', 'cyan', { r: 255, g: 0, b: 255 }, { r: 0, g: 255, b: 255 }, { r: 255, g: 0, b: 255, a: 100 } ],
|
|
329
|
+
[ 'gray', 'gray', { r: 128, g: 128, b: 128 }, { r: 128, g: 128, b: 128 }, { r: 128, g: 128, b: 128, a: 100 } ]
|
|
330
|
+
])('blend(%s, %s) as rgb object', (_, __, fgColor, bgColor, expected) => {
|
|
331
|
+
expect(
|
|
332
|
+
colors.blend(fgColor, bgColor)
|
|
333
|
+
).toStrictEqual(expected)
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
test.each([
|
|
337
|
+
[ 'black', 'white', '#000000', { r: 255, g: 255, b: 255 }, '#000000ff' ],
|
|
338
|
+
[ 'white', 'black', '#ffffff', { r: 0, g: 0, b: 0 }, '#ffffffff' ],
|
|
339
|
+
[ 'red', 'green', '#ff0000', { r: 0, g: 255, b: 0 }, '#ff0000ff' ],
|
|
340
|
+
[ 'green', 'red', '#00ff00', { r: 255, g: 0, b: 0 }, '#00ff00ff' ],
|
|
341
|
+
[ 'blue', 'yellow', '#0000ff', { r: 255, g: 255, b: 0 }, '#0000ffff' ],
|
|
342
|
+
[ 'yellow', 'blue', '#ffff00', { r: 0, g: 0, b: 255 }, '#ffff00ff' ],
|
|
343
|
+
[ 'cyan', 'magenta', '#00ffff', { r: 255, g: 0, b: 255 }, '#00ffffff' ],
|
|
344
|
+
[ 'magenta', 'cyan', '#ff00ff', { r: 0, g: 255, b: 255 }, '#ff00ffff' ],
|
|
345
|
+
[ 'gray', 'gray', '#808080', { r: 128, g: 128, b: 128 }, '#808080ff' ]
|
|
346
|
+
])('blend(%s, %s) as hex / rgb object', (_, __, fgColor, bgColor, expected) => {
|
|
347
|
+
expect(
|
|
348
|
+
colors.blend(fgColor, bgColor)
|
|
349
|
+
).toStrictEqual(expected)
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
test.each([
|
|
353
|
+
[ 'black', 'white', { r: 0, g: 0, b: 0 }, '#ffffff', { r: 0, g: 0, b: 0, a: 100 } ],
|
|
354
|
+
[ 'white', 'black', { r: 255, g: 255, b: 255 }, '#000000', { r: 255, g: 255, b: 255, a: 100 } ],
|
|
355
|
+
[ 'red', 'green', { r: 255, g: 0, b: 0 }, '#00ff00', { r: 255, g: 0, b: 0, a: 100 } ],
|
|
356
|
+
[ 'green', 'red', { r: 0, g: 255, b: 0 }, '#ff0000', { r: 0, g: 255, b: 0, a: 100 } ],
|
|
357
|
+
[ 'blue', 'yellow', { r: 0, g: 0, b: 255 }, '#ffff00', { r: 0, g: 0, b: 255, a: 100 } ],
|
|
358
|
+
[ 'yellow', 'blue', { r: 255, g: 255, b: 0 }, '#0000ff', { r: 255, g: 255, b: 0, a: 100 } ],
|
|
359
|
+
[ 'cyan', 'magenta', { r: 0, g: 255, b: 255 }, '#ff00ff', { r: 0, g: 255, b: 255, a: 100 } ],
|
|
360
|
+
[ 'magenta', 'cyan', { r: 255, g: 0, b: 255 }, '#00ffff', { r: 255, g: 0, b: 255, a: 100 } ],
|
|
361
|
+
[ 'gray', 'gray', { r: 128, g: 128, b: 128 }, '#808080', { r: 128, g: 128, b: 128, a: 100 } ]
|
|
362
|
+
])('blend(%s, %s) as rgb / hex', (_, __, fgColor, bgColor, expected) => {
|
|
363
|
+
expect(
|
|
364
|
+
colors.blend(fgColor, bgColor)
|
|
365
|
+
).toStrictEqual(expected)
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
|
|
369
|
+
describe('[(function)changeAlpha]', () => {
|
|
370
|
+
test.each([
|
|
371
|
+
[ 'white', '#ffffff', 0.1, '#ffffff1a' ],
|
|
372
|
+
[ 'black', '#000000', 0.1, '#0000001a' ],
|
|
373
|
+
[ 'red', '#ff0000', 0.1, '#ff00001a' ],
|
|
374
|
+
[ 'green', '#00ff00', 0.1, '#00ff001a' ],
|
|
375
|
+
[ 'blue', '#0000ff', 0.1, '#0000ff1a' ],
|
|
376
|
+
[ 'yellow', '#ffff00', 0.1, '#ffff001a' ],
|
|
377
|
+
[ 'cyan', '#00ffff', 0.1, '#00ffff1a' ],
|
|
378
|
+
[ 'magenta', '#ff00ff', 0.1, '#ff00ff1a' ],
|
|
379
|
+
[ 'gray', '#808080', 0.1, '#8080801a' ]
|
|
380
|
+
])('changeAlpha(%s, 0.1)', (_, color, offset, expected) => {
|
|
381
|
+
expect(
|
|
382
|
+
colors.changeAlpha(color, offset)
|
|
383
|
+
).toBe(expected)
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
test.each([
|
|
387
|
+
[ 'white', '#ffffff', -0.1, '#ffffff00' ],
|
|
388
|
+
[ 'black', '#000000', -0.1, '#00000000' ],
|
|
389
|
+
[ 'red', '#ff0000', -0.1, '#ff000000' ],
|
|
390
|
+
[ 'green', '#00ff00', -0.1, '#00ff0000' ],
|
|
391
|
+
[ 'blue', '#0000ff', -0.1, '#0000ff00' ],
|
|
392
|
+
[ 'yellow', '#ffff00', -0.1, '#ffff0000' ],
|
|
393
|
+
[ 'cyan', '#00ffff', -0.1, '#00ffff00' ],
|
|
394
|
+
[ 'magenta', '#ff00ff', -0.1, '#ff00ff00' ],
|
|
395
|
+
[ 'gray', '#808080', -0.1, '#80808000' ]
|
|
396
|
+
])('changeAlpha(%s, -0.1)', (_, color, offset, expected) => {
|
|
397
|
+
expect(
|
|
398
|
+
colors.changeAlpha(color, offset)
|
|
399
|
+
).toBe(expected)
|
|
400
|
+
})
|
|
401
|
+
|
|
402
|
+
test('changeAlpha(<invalid>) throws', () => {
|
|
403
|
+
expect(() => {
|
|
404
|
+
colors.changeAlpha()
|
|
405
|
+
}).toThrow(/Expected a string as color/)
|
|
406
|
+
|
|
407
|
+
expect(() => {
|
|
408
|
+
colors.changeAlpha('#f0f', 2)
|
|
409
|
+
}).toThrow(/Expected offset to be between -1 and 1/)
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
describe('[(function)getPaletteColor]', () => {
|
|
414
|
+
test('has correct return value', () => {
|
|
415
|
+
expect(
|
|
416
|
+
colors.getPaletteColor('blue')
|
|
417
|
+
).toBe('#2196f3')
|
|
418
|
+
|
|
419
|
+
expect(
|
|
420
|
+
colors.getPaletteColor('red')
|
|
421
|
+
).toBe('#f44336')
|
|
422
|
+
})
|
|
423
|
+
})
|
|
424
|
+
|
|
425
|
+
describe('[(function)rgbToString]', () => {
|
|
426
|
+
test.each([
|
|
427
|
+
[ 'black', { r: 0, g: 0, b: 0 }, 'rgb(0,0,0)' ],
|
|
428
|
+
[ 'white', { r: 255, g: 255, b: 255 }, 'rgb(255,255,255)' ],
|
|
429
|
+
[ 'red', { r: 255, g: 0, b: 0 }, 'rgb(255,0,0)' ],
|
|
430
|
+
[ 'green', { r: 0, g: 255, b: 0 }, 'rgb(0,255,0)' ],
|
|
431
|
+
[ 'blue', { r: 0, g: 0, b: 255 }, 'rgb(0,0,255)' ],
|
|
432
|
+
[ 'yellow', { r: 255, g: 255, b: 0 }, 'rgb(255,255,0)' ],
|
|
433
|
+
[ 'cyan', { r: 0, g: 255, b: 255 }, 'rgb(0,255,255)' ],
|
|
434
|
+
[ 'magenta', { r: 255, g: 0, b: 255 }, 'rgb(255,0,255)' ],
|
|
435
|
+
[ 'gray', { r: 128, g: 128, b: 128 }, 'rgb(128,128,128)' ]
|
|
436
|
+
])('rgbToString(%s)', (_, value, expected) => {
|
|
437
|
+
expect(
|
|
438
|
+
rgbToString(value)
|
|
439
|
+
).toBe(expected)
|
|
440
|
+
})
|
|
441
|
+
|
|
442
|
+
test.each([
|
|
443
|
+
[ 'black', { r: 0, g: 0, b: 0, a: 58 }, 'rgba(0,0,0,0.58)' ],
|
|
444
|
+
[ 'white', { r: 255, g: 255, b: 255, a: 58 }, 'rgba(255,255,255,0.58)' ],
|
|
445
|
+
[ 'red', { r: 255, g: 0, b: 0, a: 58 }, 'rgba(255,0,0,0.58)' ],
|
|
446
|
+
[ 'green', { r: 0, g: 255, b: 0, a: 58 }, 'rgba(0,255,0,0.58)' ],
|
|
447
|
+
[ 'blue', { r: 0, g: 0, b: 255, a: 58 }, 'rgba(0,0,255,0.58)' ],
|
|
448
|
+
[ 'yellow', { r: 255, g: 255, b: 0, a: 58 }, 'rgba(255,255,0,0.58)' ],
|
|
449
|
+
[ 'cyan', { r: 0, g: 255, b: 255, a: 58 }, 'rgba(0,255,255,0.58)' ],
|
|
450
|
+
[ 'magenta', { r: 255, g: 0, b: 255, a: 58 }, 'rgba(255,0,255,0.58)' ],
|
|
451
|
+
[ 'gray', { r: 128, g: 128, b: 128, a: 58 }, 'rgba(128,128,128,0.58)' ]
|
|
452
|
+
])('rgbToString(%s, a:58)', (_, value, expected) => {
|
|
453
|
+
expect(
|
|
454
|
+
rgbToString(value)
|
|
455
|
+
).toBe(expected)
|
|
456
|
+
})
|
|
457
|
+
})
|
|
458
|
+
})
|
|
459
|
+
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { coreProps, coreEmits, getRenderer } from '
|
|
1
|
+
import { coreProps, coreEmits, getRenderer } from '../../components/uploader/uploader-core.js'
|
|
2
2
|
|
|
3
|
-
import { createComponent } from '
|
|
4
|
-
import getEmitsObject from '
|
|
5
|
-
import { isObject } from '
|
|
3
|
+
import { createComponent } from '../private.create/create.js'
|
|
4
|
+
import getEmitsObject from '../private.get-emits-object/get-emits-object.js'
|
|
5
|
+
import { isObject } from '../is/is.js'
|
|
6
6
|
|
|
7
7
|
const coreEmitsObject = getEmitsObject(coreEmits)
|
|
8
8
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import getCssVar from './get-css-var.js'
|
|
4
|
+
|
|
5
|
+
describe('[getCssVar API]', () => {
|
|
6
|
+
describe('[Functions]', () => {
|
|
7
|
+
describe('[(function)default]', () => {
|
|
8
|
+
test('getCssVar(prop)', () => {
|
|
9
|
+
document.body.style.setProperty(
|
|
10
|
+
'--q-prop',
|
|
11
|
+
'my-value'
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
expect(
|
|
15
|
+
getCssVar('prop')
|
|
16
|
+
).toBe('my-value')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('getCssVar(prop, el)', () => {
|
|
20
|
+
const el = document.createElement('div')
|
|
21
|
+
document.body.appendChild(el)
|
|
22
|
+
el.style.setProperty('--q-my-prop', 'some-value')
|
|
23
|
+
|
|
24
|
+
expect.soft(
|
|
25
|
+
getCssVar('my-prop', el)
|
|
26
|
+
).toBe('some-value')
|
|
27
|
+
|
|
28
|
+
el.remove()
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import setCssVar from './set-css-var.js'
|
|
4
|
+
|
|
5
|
+
describe('[setCssVar API]', () => {
|
|
6
|
+
describe('[Functions]', () => {
|
|
7
|
+
describe('[(function)default]', () => {
|
|
8
|
+
test('setCss(prop)', () => {
|
|
9
|
+
expect(
|
|
10
|
+
setCssVar('prop', 'awesome')
|
|
11
|
+
).toBeUndefined()
|
|
12
|
+
|
|
13
|
+
expect(
|
|
14
|
+
getComputedStyle(document.body)
|
|
15
|
+
.getPropertyValue('--q-prop')
|
|
16
|
+
).toBe('awesome')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('setCss(prop, el)', () => {
|
|
20
|
+
const el = document.createElement('div')
|
|
21
|
+
document.body.appendChild(el)
|
|
22
|
+
|
|
23
|
+
expect.soft(
|
|
24
|
+
setCssVar('my-prop', 'cool', el)
|
|
25
|
+
).toBeUndefined()
|
|
26
|
+
|
|
27
|
+
expect.soft(
|
|
28
|
+
getComputedStyle(el)
|
|
29
|
+
.getPropertyValue('--q-my-prop')
|
|
30
|
+
).toBe('cool')
|
|
31
|
+
|
|
32
|
+
el.remove()
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint no-fallthrough: 0 */
|
|
2
2
|
|
|
3
|
-
import { isDate } from '
|
|
4
|
-
import { pad, capitalize } from '
|
|
5
|
-
import { jalaaliMonthLength } from './private
|
|
6
|
-
import
|
|
3
|
+
import { isDate } from '../is/is.js'
|
|
4
|
+
import { pad, capitalize } from '../format/format.js'
|
|
5
|
+
import { jalaaliMonthLength } from './private.persian.js'
|
|
6
|
+
import Lang, { defaultLang } from '../../plugins/lang/Lang.js'
|
|
7
7
|
|
|
8
8
|
const
|
|
9
9
|
MILLISECONDS_IN_DAY = 86400000,
|
|
@@ -352,7 +352,7 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
const
|
|
355
|
-
langOpts = getDateLocale(dateLocale,
|
|
355
|
+
langOpts = getDateLocale(dateLocale, Lang.props),
|
|
356
356
|
months = langOpts.months,
|
|
357
357
|
monthsShort = langOpts.monthsShort
|
|
358
358
|
|
|
@@ -961,7 +961,7 @@ export function formatDate (val, mask, dateLocale, __forcedYear, __forcedTimezon
|
|
|
961
961
|
mask = defaultMask
|
|
962
962
|
}
|
|
963
963
|
|
|
964
|
-
const locale = getDateLocale(dateLocale,
|
|
964
|
+
const locale = getDateLocale(dateLocale, Lang.props)
|
|
965
965
|
|
|
966
966
|
return mask.replace(
|
|
967
967
|
token,
|