quasar 2.18.6 → 2.19.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/README.md +2 -0
- package/dist/api/BottomSheet.json +1 -1
- package/dist/api/Dialog.json +1 -1
- package/dist/api/Intersection.json +1 -1
- package/dist/api/Lang.json +1 -1
- package/dist/api/LocalStorage.json +1 -1
- package/dist/api/Notify.json +1 -1
- package/dist/api/QBtnDropdown.json +1 -1
- package/dist/api/QBtnToggle.json +1 -1
- package/dist/api/QCarousel.json +1 -1
- package/dist/api/QCarouselControl.json +1 -1
- package/dist/api/QChatMessage.json +1 -1
- package/dist/api/QCheckbox.json +1 -1
- package/dist/api/QColor.json +1 -1
- package/dist/api/QDate.json +1 -1
- package/dist/api/QEditor.json +1 -1
- package/dist/api/QField.json +1 -1
- package/dist/api/QFile.json +1 -1
- package/dist/api/QInput.json +1 -1
- package/dist/api/QIntersection.json +1 -1
- package/dist/api/QMenu.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/QPopupEdit.json +1 -1
- package/dist/api/QRange.json +1 -1
- package/dist/api/QRating.json +1 -1
- package/dist/api/QScrollArea.json +1 -1
- package/dist/api/QSelect.json +1 -1
- package/dist/api/QSlider.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/QTime.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/SessionStorage.json +1 -1
- package/dist/icon-set/bootstrap-icons.umd.prod.js +5 -6
- package/dist/icon-set/eva-icons.umd.prod.js +5 -6
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +5 -6
- package/dist/icon-set/fontawesome-v5.umd.prod.js +5 -6
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +5 -6
- package/dist/icon-set/fontawesome-v6.umd.prod.js +5 -6
- package/dist/icon-set/ionicons-v4.umd.prod.js +5 -6
- package/dist/icon-set/line-awesome.umd.prod.js +5 -6
- package/dist/icon-set/material-icons-outlined.umd.prod.js +5 -6
- package/dist/icon-set/material-icons-round.umd.prod.js +5 -6
- package/dist/icon-set/material-icons-sharp.umd.prod.js +5 -6
- package/dist/icon-set/material-icons.umd.prod.js +5 -6
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +5 -6
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +5 -6
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +5 -6
- package/dist/icon-set/mdi-v3.umd.prod.js +5 -6
- package/dist/icon-set/mdi-v4.umd.prod.js +5 -6
- package/dist/icon-set/mdi-v5.umd.prod.js +5 -6
- package/dist/icon-set/mdi-v6.umd.prod.js +5 -6
- package/dist/icon-set/mdi-v7.umd.prod.js +5 -6
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +5 -6
- package/dist/icon-set/svg-eva-icons.umd.prod.js +5 -6
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +5 -6
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +5 -6
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +5 -6
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +5 -6
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +5 -6
- package/dist/icon-set/svg-line-awesome.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-icons.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +5 -6
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +5 -6
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +5 -6
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +5 -6
- package/dist/icon-set/svg-themify.umd.prod.js +5 -6
- package/dist/icon-set/themify.umd.prod.js +5 -6
- package/dist/lang/ar-TN.umd.prod.js +5 -6
- package/dist/lang/ar.umd.prod.js +5 -6
- package/dist/lang/az-Latn.umd.prod.js +5 -6
- package/dist/lang/bg.umd.prod.js +5 -6
- package/dist/lang/bn.umd.prod.js +5 -6
- package/dist/lang/bs-BA.umd.prod.js +5 -6
- package/dist/lang/ca.umd.prod.js +5 -6
- package/dist/lang/cs.umd.prod.js +5 -6
- package/dist/lang/da.umd.prod.js +5 -6
- package/dist/lang/de-CH.umd.prod.js +5 -6
- package/dist/lang/de-DE.umd.prod.js +5 -6
- package/dist/lang/de.umd.prod.js +5 -6
- package/dist/lang/el.umd.prod.js +5 -6
- package/dist/lang/en-GB.umd.prod.js +5 -6
- package/dist/lang/en-US.umd.prod.js +5 -6
- package/dist/lang/eo.umd.prod.js +5 -6
- package/dist/lang/es.umd.prod.js +5 -6
- package/dist/lang/et.umd.prod.js +5 -6
- package/dist/lang/eu.umd.prod.js +5 -6
- package/dist/lang/fa-IR.umd.prod.js +5 -6
- package/dist/lang/fa.umd.prod.js +5 -6
- package/dist/lang/fi.umd.prod.js +5 -6
- package/dist/lang/fr.umd.prod.js +5 -6
- package/dist/lang/gn.umd.prod.js +5 -6
- package/dist/lang/he.umd.prod.js +5 -6
- package/dist/lang/hi.umd.prod.js +5 -6
- package/dist/lang/hr.umd.prod.js +5 -6
- package/dist/lang/hu.umd.prod.js +5 -6
- package/dist/lang/id.umd.prod.js +5 -6
- package/dist/lang/is.umd.prod.js +5 -6
- package/dist/lang/it.umd.prod.js +5 -6
- package/dist/lang/ja.umd.prod.js +5 -6
- package/dist/lang/kk.umd.prod.js +5 -6
- package/dist/lang/km.umd.prod.js +5 -6
- package/dist/lang/ko-KR.umd.prod.js +5 -6
- package/dist/lang/kur-CKB.umd.prod.js +5 -6
- package/dist/lang/lt.umd.prod.js +5 -6
- package/dist/lang/lu.umd.prod.js +5 -6
- package/dist/lang/lv.umd.prod.js +5 -6
- package/dist/lang/mk.umd.prod.js +5 -6
- package/dist/lang/ml.umd.prod.js +5 -6
- package/dist/lang/mm.umd.prod.js +5 -6
- package/dist/lang/ms-MY.umd.prod.js +5 -6
- package/dist/lang/ms.umd.prod.js +5 -6
- package/dist/lang/my.umd.prod.js +5 -6
- package/dist/lang/nb-NO.umd.prod.js +5 -6
- package/dist/lang/nl.umd.prod.js +5 -6
- package/dist/lang/pl.umd.prod.js +5 -6
- package/dist/lang/pt-BR.umd.prod.js +5 -6
- package/dist/lang/pt.umd.prod.js +5 -6
- package/dist/lang/ro.umd.prod.js +5 -6
- package/dist/lang/ru.umd.prod.js +5 -6
- package/dist/lang/sk.umd.prod.js +5 -6
- package/dist/lang/sl.umd.prod.js +5 -6
- package/dist/lang/sm.umd.prod.js +5 -6
- package/dist/lang/sq.umd.prod.js +5 -6
- package/dist/lang/sr-CYR.umd.prod.js +5 -6
- package/dist/lang/sr.umd.prod.js +5 -6
- package/dist/lang/sv.umd.prod.js +5 -6
- package/dist/lang/ta.umd.prod.js +5 -6
- package/dist/lang/th.umd.prod.js +5 -6
- package/dist/lang/tl.umd.prod.js +5 -6
- package/dist/lang/tr.umd.prod.js +5 -6
- package/dist/lang/ug.umd.prod.js +5 -6
- package/dist/lang/uk.umd.prod.js +5 -6
- package/dist/lang/ur-PK.umd.prod.js +5 -6
- package/dist/lang/uz-Cyrl.umd.prod.js +5 -6
- package/dist/lang/uz-Latn.umd.prod.js +5 -6
- package/dist/lang/vi.umd.prod.js +5 -6
- package/dist/lang/zh-CN.umd.prod.js +5 -6
- package/dist/lang/zh-TW.umd.prod.js +5 -6
- package/dist/quasar.addon.prod.css +1 -1
- package/dist/quasar.addon.rtl.prod.css +1 -1
- package/dist/quasar.client.js +24830 -29218
- package/dist/quasar.css +24 -30
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +25 -30
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +7 -16
- package/dist/quasar.server.prod.cjs +78 -79
- package/dist/quasar.server.prod.js +78 -79
- package/dist/quasar.umd.js +25876 -29789
- package/dist/quasar.umd.prod.js +78 -79
- package/dist/types/api/dialog.d.ts +1 -1
- package/dist/types/api/qinput.d.ts +1 -1
- package/dist/types/api/qtable.d.ts +1 -1
- package/dist/types/api/qtree.d.ts +1 -1
- package/dist/types/api/quploader.d.ts +1 -1
- package/dist/types/api/slider.d.ts +2 -4
- package/dist/types/api/validation.d.ts +1 -1
- package/dist/types/api/web-storage.d.ts +6 -6
- package/dist/types/feature-flag.d.ts +1 -1
- package/dist/types/globals.d.ts +7 -4
- package/dist/types/index.d.ts +127 -415
- package/dist/types/lang.d.ts +3 -3
- package/dist/types/ts-helpers.d.ts +4 -9
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/date.d.ts +8 -8
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/run-sequential-promises.d.ts +12 -12
- package/dist/types/utils/scroll.d.ts +5 -5
- package/dist/types/utils.d.ts +16 -19
- package/dist/vetur/quasar-attributes.json +1 -1
- package/dist/web-types/web-types.json +1 -1
- package/icon-set/bootstrap-icons.js +1 -4
- package/icon-set/svg-bootstrap-icons.js +1 -4
- package/icon-set/svg-fontawesome-v5.js +0 -1
- package/icon-set/svg-ionicons-v5.js +2 -2
- package/lang/ar-TN.js +10 -8
- package/lang/ar.js +10 -8
- package/lang/az-Latn.js +13 -9
- package/lang/bg.js +10 -8
- package/lang/bn.js +14 -9
- package/lang/bs-BA.js +13 -9
- package/lang/ca.js +18 -14
- package/lang/cs.js +9 -7
- package/lang/da.js +10 -8
- package/lang/de-CH.js +13 -9
- package/lang/de-DE.js +13 -9
- package/lang/de.js +13 -9
- package/lang/el.js +10 -8
- package/lang/en-GB.js +10 -8
- package/lang/en-US.js +10 -8
- package/lang/eo.js +14 -9
- package/lang/es.js +10 -8
- package/lang/et.js +15 -12
- package/lang/eu.js +15 -12
- package/lang/fa-IR.js +16 -8
- package/lang/fa.js +16 -8
- package/lang/fi.js +17 -8
- package/lang/fr.js +21 -13
- package/lang/gn.js +14 -12
- package/lang/he.js +15 -10
- package/lang/hi.js +8 -8
- package/lang/hr.js +13 -9
- package/lang/hu.js +10 -8
- package/lang/id.js +11 -9
- package/lang/is.js +13 -9
- package/lang/it.js +14 -9
- package/lang/ja.js +13 -8
- package/lang/kk.js +22 -11
- package/lang/km.js +9 -8
- package/lang/ko-KR.js +9 -10
- package/lang/kur-CKB.js +16 -17
- package/lang/lt.js +26 -19
- package/lang/lu.js +13 -9
- package/lang/lv.js +13 -9
- package/lang/mk.js +10 -8
- package/lang/ml.js +15 -14
- package/lang/mm.js +16 -13
- package/lang/ms-MY.js +16 -11
- package/lang/ms.js +10 -8
- package/lang/my.js +15 -8
- package/lang/nb-NO.js +10 -8
- package/lang/nl.js +13 -9
- package/lang/pl.js +13 -9
- package/lang/pt-BR.js +17 -10
- package/lang/pt.js +17 -10
- package/lang/ro.js +10 -8
- package/lang/ru.js +25 -12
- package/lang/sk.js +18 -9
- package/lang/sl.js +12 -8
- package/lang/sm.js +51 -47
- package/lang/sq.js +13 -9
- package/lang/sr-CYR.js +10 -8
- package/lang/sr.js +10 -8
- package/lang/sv.js +10 -8
- package/lang/ta.js +10 -8
- package/lang/th.js +12 -11
- package/lang/tl.js +10 -8
- package/lang/tr.js +8 -5
- package/lang/ug.js +16 -8
- package/lang/uk.js +22 -11
- package/lang/ur-PK.js +13 -11
- package/lang/uz-Cyrl.js +5 -5
- package/lang/uz-Latn.js +24 -24
- package/lang/vi.js +13 -9
- package/lang/zh-CN.js +18 -9
- package/lang/zh-TW.js +20 -10
- package/package.json +52 -66
- package/src/api.extends.json +15 -12
- package/src/components/ajax-bar/QAjaxBar.js +91 -65
- package/src/components/ajax-bar/QAjaxBar.json +2 -2
- package/src/components/ajax-bar/index.js +1 -3
- package/src/components/avatar/QAvatar.js +36 -28
- package/src/components/avatar/QAvatar.json +2 -2
- package/src/components/avatar/QAvatar.test.js +29 -78
- package/src/components/avatar/index.js +1 -3
- package/src/components/badge/QBadge.js +33 -26
- package/src/components/badge/QBadge.json +3 -3
- package/src/components/badge/QBadge.test.js +40 -95
- package/src/components/badge/index.js +1 -3
- package/src/components/banner/QBanner.js +46 -25
- package/src/components/banner/QBanner.test.js +14 -35
- package/src/components/banner/index.js +1 -3
- package/src/components/bar/QBar.js +21 -11
- package/src/components/bar/QBar.test.js +6 -17
- package/src/components/bar/index.js +1 -3
- package/src/components/breadcrumbs/QBreadcrumbs.js +44 -32
- package/src/components/breadcrumbs/QBreadcrumbs.json +10 -3
- package/src/components/breadcrumbs/QBreadcrumbs.test.js +56 -69
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +28 -22
- package/src/components/breadcrumbs/QBreadcrumbsEl.json +5 -8
- package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +60 -134
- package/src/components/breadcrumbs/index.js +1 -4
- package/src/components/btn/QBtn.js +159 -103
- package/src/components/btn/QBtn.json +3 -6
- package/src/components/btn/QBtn.test.js +269 -496
- package/src/components/btn/index.js +1 -3
- package/src/components/btn/use-btn.js +82 -70
- package/src/components/btn/use-btn.json +33 -16
- package/src/components/btn/use-btn.test.js +30 -47
- package/src/components/btn-dropdown/QBtnDropdown.js +143 -104
- package/src/components/btn-dropdown/QBtnDropdown.json +42 -17
- package/src/components/btn-dropdown/index.js +1 -3
- package/src/components/btn-group/QBtnGroup.js +18 -6
- package/src/components/btn-group/index.js +1 -3
- package/src/components/btn-toggle/QBtnToggle.js +80 -61
- package/src/components/btn-toggle/QBtnToggle.json +16 -9
- package/src/components/btn-toggle/index.js +1 -3
- package/src/components/card/QCard.js +14 -9
- package/src/components/card/QCard.json +1 -1
- package/src/components/card/QCardActions.js +8 -5
- package/src/components/card/QCardActions.json +9 -1
- package/src/components/card/QCardSection.js +5 -4
- package/src/components/card/QCardSection.json +1 -1
- package/src/components/card/index.js +1 -5
- package/src/components/carousel/QCarousel.js +194 -125
- package/src/components/carousel/QCarousel.json +10 -11
- package/src/components/carousel/QCarouselControl.js +26 -13
- package/src/components/carousel/QCarouselControl.json +10 -5
- package/src/components/carousel/QCarouselSlide.js +13 -10
- package/src/components/carousel/QCarouselSlide.json +1 -1
- package/src/components/carousel/index.js +1 -5
- package/src/components/chat/QChatMessage.js +62 -57
- package/src/components/chat/QChatMessage.json +8 -5
- package/src/components/chat/index.js +1 -3
- package/src/components/checkbox/QCheckbox.js +56 -41
- package/src/components/checkbox/QCheckbox.json +1 -1
- package/src/components/checkbox/index.js +1 -3
- package/src/components/checkbox/use-checkbox.js +112 -83
- package/src/components/checkbox/use-checkbox.json +15 -12
- package/src/components/chip/QChip.js +101 -73
- package/src/components/chip/QChip.json +6 -6
- package/src/components/chip/QChip.test.js +72 -180
- package/src/components/chip/index.js +1 -3
- package/src/components/circular-progress/QCircularProgress.js +92 -57
- package/src/components/circular-progress/QCircularProgress.json +2 -2
- package/src/components/circular-progress/index.js +1 -3
- package/src/components/color/QColor.js +550 -367
- package/src/components/color/QColor.json +8 -8
- package/src/components/color/index.js +1 -3
- package/src/components/date/QDate.js +902 -607
- package/src/components/date/QDate.json +32 -23
- package/src/components/date/index.js +1 -3
- package/src/components/date/use-datetime.js +12 -14
- package/src/components/date/use-datetime.json +7 -7
- package/src/components/dialog/QDialog.js +178 -139
- package/src/components/dialog/QDialog.json +8 -4
- package/src/components/dialog/QDialog.test.js +123 -228
- package/src/components/dialog/index.js +1 -3
- package/src/components/drawer/QDrawer.js +306 -242
- package/src/components/drawer/QDrawer.json +4 -4
- package/src/components/drawer/index.js +1 -3
- package/src/components/editor/QEditor.js +409 -190
- package/src/components/editor/QEditor.json +33 -32
- package/src/components/editor/editor-caret.js +78 -83
- package/src/components/editor/editor-utils.js +176 -130
- package/src/components/editor/index.js +1 -3
- package/src/components/expansion-item/QExpansionItem.js +149 -103
- package/src/components/expansion-item/QExpansionItem.json +21 -24
- package/src/components/expansion-item/index.js +1 -3
- package/src/components/fab/QFab.js +86 -54
- package/src/components/fab/QFab.json +6 -3
- package/src/components/fab/QFabAction.js +34 -29
- package/src/components/fab/QFabAction.json +4 -7
- package/src/components/fab/index.js +1 -4
- package/src/components/fab/use-fab.js +20 -20
- package/src/components/fab/use-fab.json +10 -13
- package/src/components/field/QField.js +7 -5
- package/src/components/field/QField.json +6 -6
- package/src/components/field/QField.sass +5 -6
- package/src/components/field/index.js +1 -3
- package/src/components/file/QFile.js +95 -74
- package/src/components/file/QFile.json +17 -14
- package/src/components/file/index.js +1 -3
- package/src/components/footer/QFooter.js +110 -67
- package/src/components/footer/QFooter.json +2 -2
- package/src/components/footer/index.js +1 -3
- package/src/components/form/QForm.js +93 -58
- package/src/components/form/QForm.json +2 -2
- package/src/components/form/QFormChildMixin.js +10 -11
- package/src/components/form/QFormChildMixin.json +2 -2
- package/src/components/form/index.js +1 -4
- package/src/components/header/QHeader.js +93 -56
- package/src/components/header/QHeader.json +2 -2
- package/src/components/header/index.js +1 -3
- package/src/components/icon/QIcon.js +70 -57
- package/src/components/icon/QIcon.json +2 -2
- package/src/components/icon/index.js +1 -3
- package/src/components/img/QImg.js +104 -98
- package/src/components/img/QImg.json +20 -18
- package/src/components/img/index.js +1 -3
- package/src/components/infinite-scroll/QInfiniteScroll.js +123 -64
- package/src/components/infinite-scroll/QInfiniteScroll.json +1 -1
- package/src/components/infinite-scroll/index.js +1 -3
- package/src/components/inner-loading/QInnerLoading.js +31 -23
- package/src/components/inner-loading/QInnerLoading.json +9 -9
- package/src/components/inner-loading/index.js +1 -3
- package/src/components/input/QInput.js +179 -137
- package/src/components/input/QInput.json +25 -15
- package/src/components/input/index.js +1 -3
- package/src/components/input/use-mask.js +328 -243
- package/src/components/input/use-mask.json +16 -8
- package/src/components/intersection/QIntersection.js +45 -28
- package/src/components/intersection/QIntersection.json +7 -10
- package/src/components/intersection/index.js +1 -3
- package/src/components/item/QItem.js +60 -52
- package/src/components/item/QItem.json +6 -9
- package/src/components/item/QItemLabel.js +23 -15
- package/src/components/item/QItemLabel.json +1 -1
- package/src/components/item/QItemSection.js +11 -8
- package/src/components/item/QList.js +21 -13
- package/src/components/item/QList.json +1 -1
- package/src/components/item/QList.test.js +7 -11
- package/src/components/item/index.js +1 -7
- package/src/components/knob/QKnob.js +86 -76
- package/src/components/knob/QKnob.json +6 -3
- package/src/components/knob/index.js +1 -3
- package/src/components/layout/QLayout.js +98 -69
- package/src/components/layout/QLayout.json +2 -2
- package/src/components/layout/index.js +1 -3
- package/src/components/linear-progress/QLinearProgress.js +78 -47
- package/src/components/linear-progress/QLinearProgress.json +3 -3
- package/src/components/linear-progress/index.js +1 -3
- package/src/components/markup-table/QMarkupTable.js +25 -17
- package/src/components/markup-table/QMarkupTable.json +2 -2
- package/src/components/markup-table/index.js +1 -3
- package/src/components/menu/QMenu.js +144 -100
- package/src/components/menu/QMenu.json +39 -10
- package/src/components/menu/index.js +1 -3
- package/src/components/no-ssr/QNoSsr.js +5 -5
- package/src/components/no-ssr/QNoSsr.json +2 -2
- package/src/components/no-ssr/index.js +1 -3
- package/src/components/option-group/QOptionGroup.js +84 -66
- package/src/components/option-group/QOptionGroup.json +35 -21
- package/src/components/option-group/index.js +1 -3
- package/src/components/page/QPage.js +35 -22
- package/src/components/page/QPage.json +1 -1
- package/src/components/page/QPageContainer.js +24 -11
- package/src/components/page/index.js +1 -4
- package/src/components/page-scroller/QPageScroller.js +49 -32
- package/src/components/page-scroller/QPageScroller.json +2 -2
- package/src/components/page-scroller/index.js +1 -3
- package/src/components/page-sticky/QPageSticky.js +1 -1
- package/src/components/page-sticky/QPageSticky.json +9 -4
- package/src/components/page-sticky/index.js +1 -3
- package/src/components/page-sticky/use-page-sticky.js +47 -36
- package/src/components/pagination/QPagination.js +210 -146
- package/src/components/pagination/QPagination.json +35 -21
- package/src/components/pagination/index.js +1 -3
- package/src/components/parallax/QParallax.js +81 -56
- package/src/components/parallax/index.js +1 -3
- package/src/components/popup-edit/QPopupEdit.js +88 -59
- package/src/components/popup-edit/QPopupEdit.json +40 -16
- package/src/components/popup-edit/index.js +1 -3
- package/src/components/popup-proxy/QPopupProxy.js +30 -19
- package/src/components/popup-proxy/QPopupProxy.json +3 -3
- package/src/components/popup-proxy/index.js +1 -3
- package/src/components/pull-to-refresh/QPullToRefresh.js +71 -49
- package/src/components/pull-to-refresh/index.js +1 -3
- package/src/components/radio/QRadio.js +133 -95
- package/src/components/radio/QRadio.json +11 -8
- package/src/components/radio/index.js +1 -3
- package/src/components/range/QRange.js +151 -104
- package/src/components/range/QRange.json +9 -9
- package/src/components/range/index.js +1 -3
- package/src/components/rating/QRating.js +171 -112
- package/src/components/rating/QRating.json +19 -12
- package/src/components/rating/index.js +1 -3
- package/src/components/resize-observer/QResizeObserver.js +52 -30
- package/src/components/resize-observer/QResizeObserver.json +2 -2
- package/src/components/resize-observer/index.js +1 -3
- package/src/components/responsive/QResponsive.js +27 -14
- package/src/components/responsive/QResponsive.json +1 -1
- package/src/components/responsive/index.js +1 -3
- package/src/components/scroll-area/QScrollArea.js +279 -192
- package/src/components/scroll-area/QScrollArea.json +31 -21
- package/src/components/scroll-area/ScrollAreaControls.js +6 -11
- package/src/components/scroll-area/index.js +1 -3
- package/src/components/scroll-observer/QScrollObserver.js +46 -26
- package/src/components/scroll-observer/QScrollObserver.json +4 -4
- package/src/components/scroll-observer/index.js +1 -3
- package/src/components/select/QSelect.js +710 -519
- package/src/components/select/QSelect.json +70 -45
- package/src/components/select/index.js +1 -3
- package/src/components/separator/QSeparator.js +34 -30
- package/src/components/separator/QSeparator.json +4 -4
- package/src/components/separator/index.js +1 -3
- package/src/components/skeleton/QSkeleton.js +49 -23
- package/src/components/skeleton/QSkeleton.json +26 -9
- package/src/components/skeleton/index.js +1 -3
- package/src/components/slide-item/QSlideItem.js +121 -94
- package/src/components/slide-item/QSlideItem.json +2 -2
- package/src/components/slide-item/index.js +1 -3
- package/src/components/slide-transition/QSlideTransition.js +34 -26
- package/src/components/slide-transition/index.js +1 -3
- package/src/components/slider/QSlider.js +64 -43
- package/src/components/slider/QSlider.json +6 -6
- package/src/components/slider/index.js +1 -3
- package/src/components/slider/use-slider.js +327 -220
- package/src/components/slider/use-slider.json +32 -32
- package/src/components/space/QSpace.js +1 -1
- package/src/components/space/QSpace.test.js +1 -4
- package/src/components/space/index.js +1 -3
- package/src/components/spinner/QSpinner.js +23 -18
- package/src/components/spinner/QSpinner.json +1 -1
- package/src/components/spinner/QSpinner.test.js +11 -27
- package/src/components/spinner/QSpinnerAudio.js +13 -11
- package/src/components/spinner/QSpinnerAudio.json +1 -1
- package/src/components/spinner/QSpinnerAudio.test.js +9 -21
- package/src/components/spinner/QSpinnerBall.js +13 -11
- package/src/components/spinner/QSpinnerBall.json +1 -1
- package/src/components/spinner/QSpinnerBall.test.js +9 -21
- package/src/components/spinner/QSpinnerBars.js +13 -11
- package/src/components/spinner/QSpinnerBars.json +1 -1
- package/src/components/spinner/QSpinnerBars.test.js +9 -21
- package/src/components/spinner/QSpinnerBox.js +13 -11
- package/src/components/spinner/QSpinnerBox.json +1 -1
- package/src/components/spinner/QSpinnerBox.test.js +9 -21
- package/src/components/spinner/QSpinnerClock.js +13 -11
- package/src/components/spinner/QSpinnerClock.json +1 -1
- package/src/components/spinner/QSpinnerClock.test.js +9 -21
- package/src/components/spinner/QSpinnerComment.js +13 -11
- package/src/components/spinner/QSpinnerComment.json +1 -1
- package/src/components/spinner/QSpinnerComment.test.js +9 -21
- package/src/components/spinner/QSpinnerCube.js +13 -11
- package/src/components/spinner/QSpinnerCube.json +1 -1
- package/src/components/spinner/QSpinnerCube.test.js +9 -21
- package/src/components/spinner/QSpinnerDots.js +13 -11
- package/src/components/spinner/QSpinnerDots.json +1 -1
- package/src/components/spinner/QSpinnerDots.test.js +9 -21
- package/src/components/spinner/QSpinnerFacebook.js +13 -11
- package/src/components/spinner/QSpinnerFacebook.json +1 -1
- package/src/components/spinner/QSpinnerFacebook.test.js +9 -21
- package/src/components/spinner/QSpinnerGears.js +13 -11
- package/src/components/spinner/QSpinnerGears.json +1 -1
- package/src/components/spinner/QSpinnerGears.test.js +9 -21
- package/src/components/spinner/QSpinnerGrid.js +13 -11
- package/src/components/spinner/QSpinnerGrid.json +1 -1
- package/src/components/spinner/QSpinnerGrid.test.js +9 -21
- package/src/components/spinner/QSpinnerHearts.js +13 -11
- package/src/components/spinner/QSpinnerHearts.json +1 -1
- package/src/components/spinner/QSpinnerHearts.test.js +9 -21
- package/src/components/spinner/QSpinnerHourglass.js +13 -11
- package/src/components/spinner/QSpinnerHourglass.json +1 -1
- package/src/components/spinner/QSpinnerHourglass.test.js +9 -21
- package/src/components/spinner/QSpinnerInfinity.js +12 -10
- package/src/components/spinner/QSpinnerInfinity.json +1 -1
- package/src/components/spinner/QSpinnerInfinity.test.js +9 -21
- package/src/components/spinner/QSpinnerIos.js +13 -11
- package/src/components/spinner/QSpinnerIos.json +1 -1
- package/src/components/spinner/QSpinnerIos.test.js +9 -21
- package/src/components/spinner/QSpinnerOrbit.js +13 -11
- package/src/components/spinner/QSpinnerOrbit.json +1 -1
- package/src/components/spinner/QSpinnerOrbit.test.js +9 -21
- package/src/components/spinner/QSpinnerOval.js +13 -11
- package/src/components/spinner/QSpinnerOval.json +1 -1
- package/src/components/spinner/QSpinnerOval.test.js +9 -21
- package/src/components/spinner/QSpinnerPie.js +13 -11
- package/src/components/spinner/QSpinnerPie.json +1 -1
- package/src/components/spinner/QSpinnerPie.test.js +9 -21
- package/src/components/spinner/QSpinnerPuff.js +13 -11
- package/src/components/spinner/QSpinnerPuff.json +1 -1
- package/src/components/spinner/QSpinnerPuff.test.js +9 -21
- package/src/components/spinner/QSpinnerRadio.js +13 -11
- package/src/components/spinner/QSpinnerRadio.json +1 -1
- package/src/components/spinner/QSpinnerRadio.test.js +9 -21
- package/src/components/spinner/QSpinnerRings.js +13 -11
- package/src/components/spinner/QSpinnerRings.json +1 -1
- package/src/components/spinner/QSpinnerRings.test.js +9 -21
- package/src/components/spinner/QSpinnerTail.js +12 -10
- package/src/components/spinner/QSpinnerTail.json +1 -1
- package/src/components/spinner/QSpinnerTail.test.js +9 -21
- package/src/components/spinner/index.js +0 -1
- package/src/components/spinner/spinner.json +2 -2
- package/src/components/spinner/use-spinner.js +7 -7
- package/src/components/spinner/use-spinner.test.js +1 -1
- package/src/components/splitter/QSplitter.js +133 -94
- package/src/components/splitter/QSplitter.json +10 -19
- package/src/components/splitter/index.js +1 -3
- package/src/components/stepper/QStep.js +65 -42
- package/src/components/stepper/QStep.json +5 -5
- package/src/components/stepper/QStepper.js +62 -39
- package/src/components/stepper/QStepper.json +2 -2
- package/src/components/stepper/QStepperNavigation.js +1 -1
- package/src/components/stepper/StepHeader.js +87 -67
- package/src/components/stepper/index.js +1 -5
- package/src/components/tab-panels/QTabPanel.js +3 -2
- package/src/components/tab-panels/QTabPanel.json +1 -1
- package/src/components/tab-panels/QTabPanels.js +12 -6
- package/src/components/tab-panels/QTabPanels.json +1 -1
- package/src/components/tab-panels/index.js +1 -4
- package/src/components/table/QTable.js +544 -426
- package/src/components/table/QTable.json +168 -165
- package/src/components/table/QTd.js +18 -13
- package/src/components/table/QTd.json +1 -1
- package/src/components/table/QTh.js +25 -20
- package/src/components/table/QTh.json +1 -1
- package/src/components/table/QTr.js +17 -9
- package/src/components/table/QTr.json +1 -1
- package/src/components/table/get-table-middle.js +2 -4
- package/src/components/table/index.js +1 -6
- package/src/components/table/table-column-selection.js +45 -35
- package/src/components/table/table-filter.js +9 -8
- package/src/components/table/table-pagination.js +75 -52
- package/src/components/table/table-row-expand.js +15 -16
- package/src/components/table/table-row-selection.js +31 -31
- package/src/components/table/table-sort.js +26 -29
- package/src/components/tabs/QRouteTab.js +10 -12
- package/src/components/tabs/QRouteTab.json +6 -6
- package/src/components/tabs/QTab.js +1 -1
- package/src/components/tabs/QTab.json +1 -1
- package/src/components/tabs/QTabs.js +283 -205
- package/src/components/tabs/QTabs.json +9 -9
- package/src/components/tabs/index.js +1 -5
- package/src/components/tabs/use-tab.js +127 -103
- package/src/components/tabs/use-tab.json +8 -8
- package/src/components/time/QTime.js +502 -383
- package/src/components/time/QTime.json +19 -15
- package/src/components/time/index.js +1 -3
- package/src/components/timeline/QTimeline.js +10 -7
- package/src/components/timeline/QTimeline.json +2 -2
- package/src/components/timeline/QTimelineEntry.js +44 -27
- package/src/components/timeline/QTimelineEntry.json +7 -5
- package/src/components/timeline/index.js +1 -4
- package/src/components/toggle/QToggle.js +29 -19
- package/src/components/toggle/QToggle.json +1 -1
- package/src/components/toggle/index.js +1 -3
- package/src/components/toolbar/QToolbar.js +7 -5
- package/src/components/toolbar/QToolbar.test.js +2 -6
- package/src/components/toolbar/QToolbarTitle.js +5 -4
- package/src/components/toolbar/QToolbarTitle.test.js +2 -6
- package/src/components/toolbar/index.js +1 -4
- package/src/components/tooltip/QTooltip.js +125 -72
- package/src/components/tooltip/QTooltip.json +34 -10
- package/src/components/tooltip/index.js +1 -3
- package/src/components/tree/QTree.js +417 -297
- package/src/components/tree/QTree.json +27 -25
- package/src/components/tree/index.js +1 -3
- package/src/components/uploader/QUploader.json +9 -6
- package/src/components/uploader/QUploaderAddTrigger.js +5 -2
- package/src/components/uploader/index.js +1 -4
- package/src/components/uploader/uploader-core.js +262 -178
- package/src/components/uploader/xhr-uploader-plugin.js +96 -89
- package/src/components/uploader/xhr-uploader-plugin.json +29 -29
- package/src/components/video/QVideo.js +25 -19
- package/src/components/video/QVideo.json +5 -5
- package/src/components/video/QVideo.test.js +55 -85
- package/src/components/video/index.js +1 -3
- package/src/components/virtual-scroll/QVirtualScroll.js +89 -37
- package/src/components/virtual-scroll/QVirtualScroll.json +6 -6
- package/src/components/virtual-scroll/index.js +1 -3
- package/src/components/virtual-scroll/use-virtual-scroll.js +421 -240
- package/src/components/virtual-scroll/use-virtual-scroll.json +20 -13
- package/src/composables/private.use-align/use-align.js +8 -5
- package/src/composables/private.use-align/use-align.test.js +9 -17
- package/src/composables/private.use-anchor/use-anchor-static.json +2 -7
- package/src/composables/private.use-anchor/use-anchor.js +79 -62
- package/src/composables/private.use-anchor/use-anchor.json +1 -1
- package/src/composables/private.use-dark/use-dark.js +2 -6
- package/src/composables/private.use-dark/use-dark.test.js +7 -21
- package/src/composables/private.use-field/use-field.js +384 -251
- package/src/composables/private.use-field/use-field.json +10 -10
- package/src/composables/private.use-file/use-file-dom-props.js +11 -15
- package/src/composables/private.use-file/use-file.js +86 -67
- package/src/composables/private.use-file/use-file.json +8 -8
- package/src/composables/private.use-fullscreen/use-fullscreen.js +35 -17
- package/src/composables/private.use-fullscreen/use-fullscreen.json +1 -1
- package/src/composables/private.use-history/use-history.js +4 -4
- package/src/composables/private.use-history/use-history.test.js +9 -21
- package/src/composables/private.use-key-composition/use-key-composition.js +16 -12
- package/src/composables/private.use-model-toggle/use-model-toggle.js +44 -35
- package/src/composables/private.use-model-toggle/use-model-toggle.json +2 -2
- package/src/composables/private.use-panel/use-panel.child.json +1 -1
- package/src/composables/private.use-panel/use-panel.js +131 -91
- package/src/composables/private.use-panel/use-panel.json +18 -18
- package/src/composables/private.use-portal/use-portal.js +20 -15
- package/src/composables/private.use-prevent-scroll/use-prevent-scroll.js +4 -4
- package/src/composables/private.use-ratio/use-ratio.js +3 -3
- package/src/composables/private.use-ratio/use-ratio.json +2 -7
- package/src/composables/private.use-refocus-target/use-refocus-target.js +7 -8
- package/src/composables/private.use-router-link/use-router-link.js +111 -110
- package/src/composables/private.use-router-link/use-router-link.json +6 -9
- package/src/composables/private.use-scroll-target/use-scroll-target.js +14 -11
- package/src/composables/private.use-size/use-size.js +6 -4
- package/src/composables/private.use-size/use-size.json +1 -1
- package/src/composables/private.use-size/use-size.test.js +1 -1
- package/src/composables/private.use-transition/use-transition.js +17 -11
- package/src/composables/private.use-transition/use-transition.json +1 -1
- package/src/composables/private.use-transition/use-transition.test.js +7 -21
- package/src/composables/private.use-validate/use-validate.js +78 -67
- package/src/composables/private.use-validate/use-validate.json +9 -12
- package/src/composables/use-dialog-plugin-component/use-dialog-plugin-component.js +12 -6
- package/src/composables/use-form/private.use-form.js +4 -4
- package/src/composables/use-form/private.use-form.json +1 -1
- package/src/composables/use-form/private.use-form.test.js +17 -15
- package/src/composables/use-form/use-form-child.js +25 -14
- package/src/composables/use-hydration/use-hydration.js +1 -1
- package/src/composables/use-hydration/use-hydration.test.js +2 -4
- package/src/composables/use-id/use-id.js +10 -12
- package/src/composables/use-id/use-id.test.js +1 -1
- package/src/composables/use-interval/use-interval.js +3 -3
- package/src/composables/use-interval/use-interval.test.js +6 -9
- package/src/composables/use-meta/use-meta.js +13 -10
- package/src/composables/use-quasar/use-quasar.js +1 -1
- package/src/composables/use-quasar/use-quasar.test.js +4 -10
- package/src/composables/use-render-cache/use-render-cache.js +16 -24
- package/src/composables/use-split-attrs/use-split-attrs.js +9 -5
- package/src/composables/use-split-attrs/use-split-attrs.test.js +17 -15
- package/src/composables/use-tick/use-tick.js +10 -5
- package/src/composables/use-tick/use-tick.test.js +5 -8
- package/src/composables/use-timeout/use-timeout.js +3 -3
- package/src/composables/use-timeout/use-timeout.test.js +6 -9
- package/src/composables.js +0 -1
- package/src/css/core/helpers.sass +4 -9
- package/src/directives/close-popup/ClosePopup.js +41 -35
- package/src/directives/close-popup/ClosePopup.json +1 -1
- package/src/directives/intersection/Intersection.js +25 -28
- package/src/directives/intersection/Intersection.json +6 -6
- package/src/directives/morph/Morph.js +87 -87
- package/src/directives/morph/Morph.json +15 -13
- package/src/directives/mutation/Mutation.js +23 -24
- package/src/directives/mutation/Mutation.json +11 -11
- package/src/directives/ripple/Ripple.js +88 -79
- package/src/directives/ripple/Ripple.json +10 -10
- package/src/directives/ripple/Ripple.test.js +31 -87
- package/src/directives/scroll/Scroll.js +43 -30
- package/src/directives/scroll/Scroll.json +4 -2
- package/src/directives/scroll-fire/ScrollFire.js +43 -38
- package/src/directives/scroll-fire/ScrollFire.json +1 -1
- package/src/directives/touch-hold/TouchHold.js +155 -139
- package/src/directives/touch-hold/TouchHold.json +2 -2
- package/src/directives/touch-pan/TouchPan.js +311 -278
- package/src/directives/touch-pan/TouchPan.json +6 -4
- package/src/directives/touch-repeat/TouchRepeat.js +222 -188
- package/src/directives/touch-repeat/TouchRepeat.json +5 -3
- package/src/directives/touch-swipe/TouchSwipe.js +235 -214
- package/src/directives/touch-swipe/TouchSwipe.json +5 -3
- package/src/flags.dev.js +10 -17
- package/src/index.dev.js +2 -0
- package/src/index.ssr.js +2 -6
- package/src/index.umd.js +4 -2
- package/src/install-quasar.js +92 -76
- package/src/plugins/addressbar/AddressbarColor.js +28 -25
- package/src/plugins/addressbar/AddressbarColor.json +1 -1
- package/src/plugins/addressbar/AddressbarColor.test.js +10 -9
- package/src/plugins/app-fullscreen/AppFullscreen.js +50 -51
- package/src/plugins/app-fullscreen/AppFullscreen.json +6 -10
- package/src/plugins/app-fullscreen/AppFullscreen.test.js +11 -26
- package/src/plugins/app-fullscreen/test/mock-fullscreen.js +7 -5
- package/src/plugins/app-visibility/AppVisibility.js +21 -17
- package/src/plugins/app-visibility/AppVisibility.test.js +3 -1
- package/src/plugins/bottom-sheet/BottomSheet.js +1 -1
- package/src/plugins/bottom-sheet/BottomSheet.json +9 -9
- package/src/plugins/bottom-sheet/component/BottomSheetComponent.js +132 -95
- package/src/plugins/cookies/Cookies.js +50 -58
- package/src/plugins/cookies/Cookies.json +24 -16
- package/src/plugins/dark/Dark.js +61 -55
- package/src/plugins/dark/Dark.json +6 -6
- package/src/plugins/dark/Dark.test.js +26 -44
- package/src/plugins/dialog/Dialog.js +1 -1
- package/src/plugins/dialog/Dialog.json +29 -21
- package/src/plugins/dialog/component/DialogPluginComponent.js +122 -121
- package/src/plugins/icon-set/IconSet.js +63 -56
- package/src/plugins/icon-set/IconSet.json +421 -419
- package/src/plugins/icon-set/IconSet.test.js +8 -7
- package/src/plugins/lang/Lang.js +115 -96
- package/src/plugins/lang/Lang.json +201 -175
- package/src/plugins/lang/Lang.test.js +52 -20
- package/src/plugins/loading/Loading.js +175 -143
- package/src/plugins/loading/Loading.json +15 -15
- package/src/plugins/loading-bar/LoadingBar.js +61 -56
- package/src/plugins/loading-bar/LoadingBar.json +2 -2
- package/src/plugins/meta/Meta.js +91 -81
- package/src/plugins/notify/Notify.js +275 -221
- package/src/plugins/notify/Notify.json +79 -71
- package/src/plugins/platform/Platform.js +105 -112
- package/src/plugins/platform/Platform.json +12 -8
- package/src/plugins/platform/Platform.test.js +4 -7
- package/src/plugins/private.body/Body.js +19 -23
- package/src/plugins/private.body/Body.test.js +4 -6
- package/src/plugins/private.history/History.js +27 -30
- package/src/plugins/screen/Screen.js +160 -147
- package/src/plugins/screen/Screen.json +6 -6
- package/src/plugins/screen/Screen.test.js +6 -12
- package/src/plugins/storage/LocalStorage.js +5 -4
- package/src/plugins/storage/LocalStorage.json +1 -1
- package/src/plugins/storage/LocalStorage.test.js +56 -62
- package/src/plugins/storage/SessionStorage.js +5 -4
- package/src/plugins/storage/SessionStorage.json +1 -1
- package/src/plugins/storage/SessionStorage.test.js +56 -62
- package/src/plugins/storage/engine/web-storage.js +24 -26
- package/src/plugins/storage/engine/web-storage.json +45 -15
- package/src/utils/EventBus/EventBus.js +12 -13
- package/src/utils/clone/clone.js +27 -28
- package/src/utils/clone/clone.test.js +27 -52
- package/src/utils/colors/colors.js +69 -63
- package/src/utils/colors/colors.test.js +360 -270
- package/src/utils/copy-to-clipboard/copy-to-clipboard.js +9 -10
- package/src/utils/create-meta-mixin/create-meta-mixin.js +17 -19
- package/src/utils/create-uploader-component/create-uploader-component.js +20 -14
- package/src/utils/css-var/get-css-var.js +4 -2
- package/src/utils/css-var/get-css-var.test.js +4 -11
- package/src/utils/css-var/set-css-var.js +2 -2
- package/src/utils/css-var/set-css-var.test.js +6 -12
- package/src/utils/date/date.js +251 -243
- package/src/utils/date/private.persian.js +54 -44
- package/src/utils/debounce/debounce.js +5 -5
- package/src/utils/debounce/debounce.test.js +3 -10
- package/src/utils/dom/dom.js +21 -22
- package/src/utils/dom/dom.test.js +19 -39
- package/src/utils/event/event.js +53 -49
- package/src/utils/export-file/export-file.js +11 -12
- package/src/utils/extend/extend.js +30 -26
- package/src/utils/extend/extend.test.js +36 -42
- package/src/utils/format/format.js +11 -13
- package/src/utils/format/format.test.js +50 -61
- package/src/utils/frame-debounce/frame-debounce.js +5 -3
- package/src/utils/frame-debounce/frame-debounce.test.js +3 -10
- package/src/utils/is/is.js +27 -23
- package/src/utils/is/is.test.js +100 -84
- package/src/utils/morph/morph.js +470 -377
- package/src/utils/open-url/open-url.js +18 -21
- package/src/utils/patterns/patterns.js +11 -7
- package/src/utils/patterns/patterns.test.js +2 -0
- package/src/utils/private.click-outside/click-outside.js +28 -26
- package/src/utils/private.config/instance-config.js +1 -1
- package/src/utils/private.config/instance-config.test.js +11 -7
- package/src/utils/private.config/nodes.js +14 -14
- package/src/utils/private.config/nodes.test.js +32 -38
- package/src/utils/private.create/create.js +10 -4
- package/src/utils/private.create/create.test.js +11 -7
- package/src/utils/private.dialog/create-dialog.js +70 -59
- package/src/utils/private.dialog/create-dialog.json +13 -6
- package/src/utils/private.focus/focus-manager.js +7 -8
- package/src/utils/private.focus/focus-manager.test.js +13 -18
- package/src/utils/private.focus/focusout.js +4 -4
- package/src/utils/private.focus/focusout.test.js +10 -22
- package/src/utils/private.get-emits-object/get-emits-object.js +2 -2
- package/src/utils/private.get-emits-object/get-emits-object.test.js +4 -10
- package/src/utils/private.inject-obj-prop/inject-obj-prop.js +3 -3
- package/src/utils/private.inject-obj-prop/inject-obj-prop.test.js +20 -49
- package/src/utils/private.keyboard/escape-key.js +10 -10
- package/src/utils/private.keyboard/escape-key.test.js +10 -22
- package/src/utils/private.keyboard/key-composition.js +9 -7
- package/src/utils/private.portal/portal.js +7 -10
- package/src/utils/private.position-engine/position-engine.js +127 -75
- package/src/utils/private.render/render.js +9 -24
- package/src/utils/private.render/render.test.js +40 -55
- package/src/utils/private.rtl/rtl.js +1 -3
- package/src/utils/private.selection/selection.js +6 -6
- package/src/utils/private.selection/selection.test.js +7 -13
- package/src/utils/private.sort/sort.js +4 -6
- package/src/utils/private.symbols/symbols.js +1 -1
- package/src/utils/private.touch/touch.js +16 -16
- package/src/utils/private.touch/touch.test.js +56 -16
- package/src/utils/private.vm/vm.js +6 -7
- package/src/utils/private.vm/vm.test.js +32 -32
- package/src/utils/run-sequential-promises/run-sequential-promises.js +57 -51
- package/src/utils/scroll/prevent-scroll.js +75 -47
- package/src/utils/scroll/scroll.js +51 -44
- package/src/utils/throttle/throttle.js +7 -4
- package/src/utils/throttle/throttle.test.js +2 -7
- package/src/utils/uid/uid.js +34 -22
- package/wrappers/index.cjs +17 -15
- package/wrappers/index.js +15 -15
package/src/utils/morph/morph.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isObject } from '../is/is.js'
|
|
|
3
3
|
let id = 0
|
|
4
4
|
let offsetBase = void 0
|
|
5
5
|
|
|
6
|
-
function getAbsolutePosition
|
|
6
|
+
function getAbsolutePosition(el, resize) {
|
|
7
7
|
if (offsetBase === void 0) {
|
|
8
8
|
offsetBase = document.createElement('div')
|
|
9
9
|
offsetBase.style.cssText = 'position: absolute; left: 0; top: 0'
|
|
@@ -12,7 +12,8 @@ function getAbsolutePosition (el, resize) {
|
|
|
12
12
|
|
|
13
13
|
const boundingRect = el.getBoundingClientRect()
|
|
14
14
|
const baseRect = offsetBase.getBoundingClientRect()
|
|
15
|
-
const { marginLeft, marginRight, marginTop, marginBottom } =
|
|
15
|
+
const { marginLeft, marginRight, marginTop, marginBottom } =
|
|
16
|
+
window.getComputedStyle(el)
|
|
16
17
|
const marginH = parseInt(marginLeft, 10) + parseInt(marginRight, 10)
|
|
17
18
|
const marginV = parseInt(marginTop, 10) + parseInt(marginBottom, 10)
|
|
18
19
|
|
|
@@ -21,14 +22,16 @@ function getAbsolutePosition (el, resize) {
|
|
|
21
22
|
top: boundingRect.top - baseRect.top,
|
|
22
23
|
width: boundingRect.right - boundingRect.left,
|
|
23
24
|
height: boundingRect.bottom - boundingRect.top,
|
|
24
|
-
widthM:
|
|
25
|
-
|
|
25
|
+
widthM:
|
|
26
|
+
boundingRect.right - boundingRect.left + (resize === true ? 0 : marginH),
|
|
27
|
+
heightM:
|
|
28
|
+
boundingRect.bottom - boundingRect.top + (resize === true ? 0 : marginV),
|
|
26
29
|
marginH: resize === true ? marginH : 0,
|
|
27
30
|
marginV: resize === true ? marginV : 0
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
function getAbsoluteSize
|
|
34
|
+
function getAbsoluteSize(el) {
|
|
32
35
|
return {
|
|
33
36
|
width: el.scrollWidth,
|
|
34
37
|
height: el.scrollHeight
|
|
@@ -36,72 +39,72 @@ function getAbsoluteSize (el) {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
// firefox rulez
|
|
39
|
-
const styleEdges = [
|
|
40
|
-
const styleBorderRadiuses = [
|
|
42
|
+
const styleEdges = ['Top', 'Right', 'Bottom', 'Left']
|
|
43
|
+
const styleBorderRadiuses = [
|
|
44
|
+
'borderTopLeftRadius',
|
|
45
|
+
'borderTopRightRadius',
|
|
46
|
+
'borderBottomRightRadius',
|
|
47
|
+
'borderBottomLeftRadius'
|
|
48
|
+
]
|
|
41
49
|
const reStyleSkipKey = /-block|-inline|block-|inline-/
|
|
42
50
|
const reStyleSkipRule = /(-block|-inline|block-|inline-).*:/
|
|
43
51
|
|
|
44
|
-
function getComputedStyle
|
|
52
|
+
function getComputedStyle(el, props) {
|
|
45
53
|
const style = window.getComputedStyle(el)
|
|
46
54
|
const fixed = {}
|
|
47
55
|
for (let i = 0; i < props.length; i++) {
|
|
48
|
-
const prop = props[
|
|
56
|
+
const prop = props[i]
|
|
49
57
|
|
|
50
|
-
if (style[
|
|
58
|
+
if (style[prop] === '') {
|
|
51
59
|
if (prop === 'cssText') {
|
|
52
60
|
const styleLen = style.length
|
|
53
61
|
let val = ''
|
|
54
62
|
|
|
55
|
-
for (let
|
|
56
|
-
if (reStyleSkipKey.test(style[
|
|
57
|
-
val += style[
|
|
63
|
+
for (let styleIndex = 0; styleIndex < styleLen; styleIndex++) {
|
|
64
|
+
if (reStyleSkipKey.test(style[styleIndex]) !== true) {
|
|
65
|
+
val += style[styleIndex] + ': ' + style[style[styleIndex]] + '; '
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
fixed[
|
|
62
|
-
}
|
|
63
|
-
|
|
69
|
+
fixed[prop] = val
|
|
70
|
+
} else if (
|
|
71
|
+
['borderWidth', 'borderStyle', 'borderColor'].indexOf(prop) !== -1
|
|
72
|
+
) {
|
|
64
73
|
const suffix = prop.replace('border', '')
|
|
65
74
|
let val = ''
|
|
66
75
|
for (let j = 0; j < styleEdges.length; j++) {
|
|
67
|
-
const subProp = 'border' + styleEdges[
|
|
68
|
-
val += style[
|
|
76
|
+
const subProp = 'border' + styleEdges[j] + suffix
|
|
77
|
+
val += style[subProp] + ' '
|
|
69
78
|
}
|
|
70
|
-
fixed[
|
|
71
|
-
}
|
|
72
|
-
else if (prop === 'borderRadius') {
|
|
79
|
+
fixed[prop] = val
|
|
80
|
+
} else if (prop === 'borderRadius') {
|
|
73
81
|
let val1 = ''
|
|
74
82
|
let val2 = ''
|
|
75
83
|
for (let j = 0; j < styleBorderRadiuses.length; j++) {
|
|
76
|
-
const val = style[
|
|
77
|
-
val1 += val[
|
|
78
|
-
val2 += (val[
|
|
84
|
+
const val = style[styleBorderRadiuses[j]].split(' ')
|
|
85
|
+
val1 += val[0] + ' '
|
|
86
|
+
val2 += (val[1] === void 0 ? val[0] : val[1]) + ' '
|
|
79
87
|
}
|
|
80
|
-
fixed[
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
fixed[ prop ] = style[ prop ]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
if (prop === 'cssText') {
|
|
88
|
-
fixed[ prop ] = style[ prop ]
|
|
89
|
-
.split(';')
|
|
90
|
-
.filter(val => reStyleSkipRule.test(val) !== true)
|
|
91
|
-
.join(';')
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
fixed[ prop ] = style[ prop ]
|
|
88
|
+
fixed[prop] = val1 + '/ ' + val2
|
|
89
|
+
} else {
|
|
90
|
+
fixed[prop] = style[prop]
|
|
95
91
|
}
|
|
92
|
+
} else if (prop === 'cssText') {
|
|
93
|
+
fixed[prop] = style[prop]
|
|
94
|
+
.split(';')
|
|
95
|
+
.filter(val => reStyleSkipRule.test(val) !== true)
|
|
96
|
+
.join(';')
|
|
97
|
+
} else {
|
|
98
|
+
fixed[prop] = style[prop]
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
return fixed
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
const zIndexPositions = [
|
|
105
|
+
const zIndexPositions = ['absolute', 'fixed', 'relative', 'sticky']
|
|
103
106
|
|
|
104
|
-
function getMaxZIndex
|
|
107
|
+
function getMaxZIndex(elStart) {
|
|
105
108
|
let el = elStart
|
|
106
109
|
let maxIndex = 0
|
|
107
110
|
|
|
@@ -110,8 +113,8 @@ function getMaxZIndex (elStart) {
|
|
|
110
113
|
const zIndexNum = Number(zIndex)
|
|
111
114
|
|
|
112
115
|
if (
|
|
113
|
-
zIndexNum > maxIndex
|
|
114
|
-
|
|
116
|
+
zIndexNum > maxIndex &&
|
|
117
|
+
(el === elStart || zIndexPositions.includes(position) === true)
|
|
115
118
|
) {
|
|
116
119
|
maxIndex = zIndexNum
|
|
117
120
|
}
|
|
@@ -122,22 +125,19 @@ function getMaxZIndex (elStart) {
|
|
|
122
125
|
return maxIndex
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
function normalizeElements
|
|
128
|
+
function normalizeElements(opts) {
|
|
126
129
|
return {
|
|
127
130
|
from: opts.from,
|
|
128
|
-
to: opts.to !== void 0
|
|
129
|
-
? opts.to
|
|
130
|
-
: opts.from
|
|
131
|
+
to: opts.to !== void 0 ? opts.to : opts.from
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
|
|
134
|
-
function normalizeOptions
|
|
135
|
+
function normalizeOptions(options) {
|
|
135
136
|
if (typeof options === 'number') {
|
|
136
137
|
options = {
|
|
137
138
|
duration: options
|
|
138
139
|
}
|
|
139
|
-
}
|
|
140
|
-
else if (typeof options === 'function') {
|
|
140
|
+
} else if (typeof options === 'function') {
|
|
141
141
|
options = {
|
|
142
142
|
onEnd: options
|
|
143
143
|
}
|
|
@@ -148,45 +148,57 @@ function normalizeOptions (options) {
|
|
|
148
148
|
|
|
149
149
|
waitFor: options.waitFor === void 0 ? 0 : options.waitFor,
|
|
150
150
|
|
|
151
|
-
duration:
|
|
152
|
-
|
|
151
|
+
duration:
|
|
152
|
+
isNaN(options.duration) === true ? 300 : parseInt(options.duration, 10),
|
|
153
|
+
easing:
|
|
154
|
+
typeof options.easing === 'string' && options.easing.length !== 0
|
|
155
|
+
? options.easing
|
|
156
|
+
: 'ease-in-out',
|
|
153
157
|
delay: isNaN(options.delay) === true ? 0 : parseInt(options.delay, 10),
|
|
154
|
-
fill:
|
|
158
|
+
fill:
|
|
159
|
+
typeof options.fill === 'string' && options.fill.length !== 0
|
|
160
|
+
? options.fill
|
|
161
|
+
: 'none',
|
|
155
162
|
|
|
156
163
|
resize: options.resize === true,
|
|
157
164
|
|
|
158
165
|
// account for UMD too where modifiers will be lowercased to work
|
|
159
166
|
useCSS: options.useCSS === true || options.usecss === true,
|
|
160
167
|
// account for UMD too where modifiers will be lowercased to work
|
|
161
|
-
hideFromClone:
|
|
168
|
+
hideFromClone:
|
|
169
|
+
options.hideFromClone === true || options.hidefromclone === true,
|
|
162
170
|
// account for UMD too where modifiers will be lowercased to work
|
|
163
171
|
keepToClone: options.keepToClone === true || options.keeptoclone === true,
|
|
164
172
|
|
|
165
173
|
tween: options.tween === true,
|
|
166
|
-
tweenFromOpacity:
|
|
167
|
-
|
|
174
|
+
tweenFromOpacity:
|
|
175
|
+
isNaN(options.tweenFromOpacity) === true
|
|
176
|
+
? 0.6
|
|
177
|
+
: parseFloat(options.tweenFromOpacity),
|
|
178
|
+
tweenToOpacity:
|
|
179
|
+
isNaN(options.tweenToOpacity) === true
|
|
180
|
+
? 0.5
|
|
181
|
+
: parseFloat(options.tweenToOpacity)
|
|
168
182
|
}
|
|
169
183
|
}
|
|
170
184
|
|
|
171
|
-
function getElement
|
|
185
|
+
function getElement(element) {
|
|
172
186
|
const type = typeof element
|
|
173
187
|
|
|
174
188
|
return type === 'function'
|
|
175
189
|
? element()
|
|
176
|
-
:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
: element
|
|
180
|
-
)
|
|
190
|
+
: type === 'string'
|
|
191
|
+
? document.querySelector(element)
|
|
192
|
+
: element
|
|
181
193
|
}
|
|
182
194
|
|
|
183
|
-
function isValidElement
|
|
184
|
-
return
|
|
185
|
-
&& element.ownerDocument === document
|
|
186
|
-
|
|
195
|
+
function isValidElement(element) {
|
|
196
|
+
return (
|
|
197
|
+
element && element.ownerDocument === document && element.parentNode !== null
|
|
198
|
+
)
|
|
187
199
|
}
|
|
188
200
|
|
|
189
|
-
export default function morph
|
|
201
|
+
export default function morph(_options) {
|
|
190
202
|
let cancel = () => false
|
|
191
203
|
let cancelStatus = false
|
|
192
204
|
let endElementTo = true
|
|
@@ -200,7 +212,7 @@ export default function morph (_options) {
|
|
|
200
212
|
return cancel
|
|
201
213
|
}
|
|
202
214
|
// we clean other morphs running on this element
|
|
203
|
-
typeof elFrom.qMorphCancel === 'function'
|
|
215
|
+
if (typeof elFrom.qMorphCancel === 'function') elFrom.qMorphCancel()
|
|
204
216
|
|
|
205
217
|
let animationFromClone = void 0
|
|
206
218
|
let animationFromTween = void 0
|
|
@@ -213,10 +225,8 @@ export default function morph (_options) {
|
|
|
213
225
|
// we get the dimensions and characteristics
|
|
214
226
|
// of the parent of the initial element before changes
|
|
215
227
|
const elFromPosition = getAbsolutePosition(elFrom, options.resize)
|
|
216
|
-
const {
|
|
217
|
-
|
|
218
|
-
height: elFromParentHeightBefore
|
|
219
|
-
} = getAbsoluteSize(elFromParent)
|
|
228
|
+
const { width: elFromParentWidthBefore, height: elFromParentHeightBefore } =
|
|
229
|
+
getAbsoluteSize(elFromParent)
|
|
220
230
|
const {
|
|
221
231
|
borderWidth: elFromBorderWidth,
|
|
222
232
|
borderStyle: elFromBorderStyle,
|
|
@@ -226,7 +236,16 @@ export default function morph (_options) {
|
|
|
226
236
|
transform: elFromTransform,
|
|
227
237
|
position: elFromPositioningType,
|
|
228
238
|
cssText: elFromCssText
|
|
229
|
-
} = getComputedStyle(elFrom, [
|
|
239
|
+
} = getComputedStyle(elFrom, [
|
|
240
|
+
'borderWidth',
|
|
241
|
+
'borderStyle',
|
|
242
|
+
'borderColor',
|
|
243
|
+
'borderRadius',
|
|
244
|
+
'backgroundColor',
|
|
245
|
+
'transform',
|
|
246
|
+
'position',
|
|
247
|
+
'cssText'
|
|
248
|
+
])
|
|
230
249
|
const elFromClassSaved = elFrom.classList.toString()
|
|
231
250
|
const elFromStyleSaved = elFrom.style.cssText
|
|
232
251
|
|
|
@@ -237,11 +256,17 @@ export default function morph (_options) {
|
|
|
237
256
|
const elFromTween = options.tween === true ? elFrom.cloneNode(true) : void 0
|
|
238
257
|
|
|
239
258
|
if (elFromTween !== void 0) {
|
|
240
|
-
elFromTween.className = elFromTween.classList
|
|
259
|
+
elFromTween.className = elFromTween.classList
|
|
260
|
+
.toString()
|
|
261
|
+
.split(' ')
|
|
262
|
+
.filter(c => /^bg-/.test(c) === false)
|
|
263
|
+
.join(' ')
|
|
241
264
|
}
|
|
242
265
|
|
|
243
266
|
// if the initial element is not going to be removed do not show the placeholder
|
|
244
|
-
options.hideFromClone === true
|
|
267
|
+
if (options.hideFromClone === true) {
|
|
268
|
+
elFromClone.classList.add('q-morph--internal')
|
|
269
|
+
}
|
|
245
270
|
|
|
246
271
|
// prevent interaction with placeholder
|
|
247
272
|
elFromClone.setAttribute('aria-hidden', 'true')
|
|
@@ -258,7 +283,9 @@ export default function morph (_options) {
|
|
|
258
283
|
elFromClone.remove()
|
|
259
284
|
elFromTween?.remove()
|
|
260
285
|
|
|
261
|
-
options.hideFromClone === true
|
|
286
|
+
if (options.hideFromClone === true) {
|
|
287
|
+
elFromClone.classList.remove('q-morph--internal')
|
|
288
|
+
}
|
|
262
289
|
|
|
263
290
|
// we remove the cleanup function from the element
|
|
264
291
|
elFrom.qMorphCancel = void 0
|
|
@@ -268,32 +295,32 @@ export default function morph (_options) {
|
|
|
268
295
|
const calculateFinalState = () => {
|
|
269
296
|
const elTo = getElement(elements.to)
|
|
270
297
|
if (cancelStatus === true || isValidElement(elTo) !== true) {
|
|
271
|
-
typeof elFrom.qMorphCancel === 'function'
|
|
298
|
+
if (typeof elFrom.qMorphCancel === 'function') elFrom.qMorphCancel()
|
|
272
299
|
return
|
|
273
300
|
}
|
|
274
301
|
// we clean other morphs running on this element
|
|
275
|
-
elFrom !== elTo && typeof elTo.qMorphCancel === 'function'
|
|
302
|
+
if (elFrom !== elTo && typeof elTo.qMorphCancel === 'function') {
|
|
303
|
+
elTo.qMorphCancel()
|
|
304
|
+
}
|
|
276
305
|
|
|
277
306
|
// we hide the final element and the clone of the initial element
|
|
278
307
|
// we don't hide the final element if we want both it and the animated one visible
|
|
279
|
-
options.keepToClone !== true
|
|
308
|
+
if (options.keepToClone !== true) elTo.classList.add('q-morph--internal')
|
|
280
309
|
elFromClone.classList.add('q-morph--internal')
|
|
281
310
|
|
|
282
311
|
// we get the dimensions of the parent of the initial element after changes
|
|
283
312
|
// the difference is how much we should animate the clone
|
|
284
|
-
const {
|
|
285
|
-
|
|
286
|
-
height: elFromParentHeightAfter
|
|
287
|
-
} = getAbsoluteSize(elFromParent)
|
|
313
|
+
const { width: elFromParentWidthAfter, height: elFromParentHeightAfter } =
|
|
314
|
+
getAbsoluteSize(elFromParent)
|
|
288
315
|
|
|
289
316
|
// we get the dimensions of the parent of the final element before changes
|
|
290
|
-
const {
|
|
291
|
-
|
|
292
|
-
height: elToParentHeightBefore
|
|
293
|
-
} = getAbsoluteSize(elTo.parentNode)
|
|
317
|
+
const { width: elToParentWidthBefore, height: elToParentHeightBefore } =
|
|
318
|
+
getAbsoluteSize(elTo.parentNode)
|
|
294
319
|
|
|
295
320
|
// then we show the clone of the initial element if we don't want it hidden
|
|
296
|
-
options.hideFromClone !== true
|
|
321
|
+
if (options.hideFromClone !== true) {
|
|
322
|
+
elFromClone.classList.remove('q-morph--internal')
|
|
323
|
+
}
|
|
297
324
|
|
|
298
325
|
// we mark the element with its cleanup function
|
|
299
326
|
elTo.qMorphCancel = () => {
|
|
@@ -303,10 +330,14 @@ export default function morph (_options) {
|
|
|
303
330
|
elFromClone.remove()
|
|
304
331
|
elFromTween?.remove()
|
|
305
332
|
|
|
306
|
-
options.hideFromClone === true
|
|
333
|
+
if (options.hideFromClone === true) {
|
|
334
|
+
elFromClone.classList.remove('q-morph--internal')
|
|
335
|
+
}
|
|
307
336
|
|
|
308
337
|
// we show the final element
|
|
309
|
-
options.keepToClone !== true
|
|
338
|
+
if (options.keepToClone !== true) {
|
|
339
|
+
elTo.classList.remove('q-morph--internal')
|
|
340
|
+
}
|
|
310
341
|
|
|
311
342
|
// we remove the cleanup function from the elements
|
|
312
343
|
elFrom.qMorphCancel = void 0
|
|
@@ -316,7 +347,7 @@ export default function morph (_options) {
|
|
|
316
347
|
// will be called after waitFor (give time to render the final element)
|
|
317
348
|
const animate = () => {
|
|
318
349
|
if (cancelStatus === true) {
|
|
319
|
-
typeof elTo.qMorphCancel === 'function'
|
|
350
|
+
if (typeof elTo.qMorphCancel === 'function') elTo.qMorphCancel()
|
|
320
351
|
return
|
|
321
352
|
}
|
|
322
353
|
|
|
@@ -342,10 +373,8 @@ export default function morph (_options) {
|
|
|
342
373
|
// we get the dimensions of the parent of the final element after changes
|
|
343
374
|
// the difference is how much we should animate the clone
|
|
344
375
|
const elToParent = elTo.parentNode
|
|
345
|
-
const {
|
|
346
|
-
|
|
347
|
-
height: elToParentHeightAfter
|
|
348
|
-
} = getAbsoluteSize(elToParent)
|
|
376
|
+
const { width: elToParentWidthAfter, height: elToParentHeightAfter } =
|
|
377
|
+
getAbsoluteSize(elToParent)
|
|
349
378
|
|
|
350
379
|
const elToClone = elTo.cloneNode(options.keepToClone)
|
|
351
380
|
elToClone.setAttribute('aria-hidden', 'true')
|
|
@@ -360,7 +389,10 @@ export default function morph (_options) {
|
|
|
360
389
|
elToClone.classList.add('q-morph--internal')
|
|
361
390
|
|
|
362
391
|
// if elFrom is the same as elTo the next element is elFromClone
|
|
363
|
-
const elToNext =
|
|
392
|
+
const elToNext =
|
|
393
|
+
elTo === elFrom && elFromParent === elToParent
|
|
394
|
+
? elFromClone
|
|
395
|
+
: elTo.nextElementSibling
|
|
364
396
|
elToParent.insertBefore(elToClone, elToNext)
|
|
365
397
|
|
|
366
398
|
const {
|
|
@@ -372,7 +404,16 @@ export default function morph (_options) {
|
|
|
372
404
|
transform: elToTransform,
|
|
373
405
|
position: elToPositioningType,
|
|
374
406
|
cssText: elToCssText
|
|
375
|
-
} = getComputedStyle(elTo, [
|
|
407
|
+
} = getComputedStyle(elTo, [
|
|
408
|
+
'borderWidth',
|
|
409
|
+
'borderStyle',
|
|
410
|
+
'borderColor',
|
|
411
|
+
'borderRadius',
|
|
412
|
+
'backgroundColor',
|
|
413
|
+
'transform',
|
|
414
|
+
'position',
|
|
415
|
+
'cssText'
|
|
416
|
+
])
|
|
376
417
|
const elToClassSaved = elTo.classList.toString()
|
|
377
418
|
const elToStyleSaved = elTo.style.cssText
|
|
378
419
|
|
|
@@ -382,35 +423,56 @@ export default function morph (_options) {
|
|
|
382
423
|
elTo.style.animation = 'none'
|
|
383
424
|
elTo.style.transition = 'none'
|
|
384
425
|
// we strip the background classes (background color can no longer be animated if !important is used)
|
|
385
|
-
elTo.className = elToClassSaved
|
|
426
|
+
elTo.className = elToClassSaved
|
|
427
|
+
.split(' ')
|
|
428
|
+
.filter(c => /^bg-/.test(c) === false)
|
|
429
|
+
.join(' ')
|
|
386
430
|
|
|
387
431
|
const elToPosition = getAbsolutePosition(elTo, options.resize)
|
|
388
432
|
|
|
389
433
|
const deltaX = elFromPosition.left - elToPosition.left
|
|
390
434
|
const deltaY = elFromPosition.top - elToPosition.top
|
|
391
|
-
const scaleX =
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
|
|
435
|
+
const scaleX =
|
|
436
|
+
elFromPosition.width /
|
|
437
|
+
(elToPosition.width > 0 ? elToPosition.width : 10)
|
|
438
|
+
const scaleY =
|
|
439
|
+
elFromPosition.height /
|
|
440
|
+
(elToPosition.height > 0 ? elToPosition.height : 100)
|
|
441
|
+
|
|
442
|
+
const elFromParentWidthDiff =
|
|
443
|
+
elFromParentWidthBefore - elFromParentWidthAfter
|
|
444
|
+
const elFromParentHeightDiff =
|
|
445
|
+
elFromParentHeightBefore - elFromParentHeightAfter
|
|
396
446
|
const elToParentWidthDiff = elToParentWidthAfter - elToParentWidthBefore
|
|
397
|
-
const elToParentHeightDiff =
|
|
447
|
+
const elToParentHeightDiff =
|
|
448
|
+
elToParentHeightAfter - elToParentHeightBefore
|
|
398
449
|
|
|
399
|
-
const elFromCloneWidth = Math.max(
|
|
400
|
-
|
|
450
|
+
const elFromCloneWidth = Math.max(
|
|
451
|
+
elFromPosition.widthM,
|
|
452
|
+
elFromParentWidthDiff
|
|
453
|
+
)
|
|
454
|
+
const elFromCloneHeight = Math.max(
|
|
455
|
+
elFromPosition.heightM,
|
|
456
|
+
elFromParentHeightDiff
|
|
457
|
+
)
|
|
401
458
|
const elToCloneWidth = Math.max(elToPosition.widthM, elToParentWidthDiff)
|
|
402
|
-
const elToCloneHeight = Math.max(
|
|
459
|
+
const elToCloneHeight = Math.max(
|
|
460
|
+
elToPosition.heightM,
|
|
461
|
+
elToParentHeightDiff
|
|
462
|
+
)
|
|
403
463
|
|
|
404
|
-
const elSharedSize =
|
|
405
|
-
|
|
406
|
-
|
|
464
|
+
const elSharedSize =
|
|
465
|
+
elFrom === elTo &&
|
|
466
|
+
['absolute', 'fixed'].includes(elToPositioningType) === false &&
|
|
467
|
+
['absolute', 'fixed'].includes(elFromPositioningType) === false
|
|
407
468
|
|
|
408
469
|
// if the final element has fixed position or if a parent
|
|
409
470
|
// has fixed position we need to animate it as fixed
|
|
410
471
|
let elToNeedsFixedPosition = elToPositioningType === 'fixed'
|
|
411
472
|
let parent = elToParent
|
|
412
473
|
while (elToNeedsFixedPosition !== true && parent !== document) {
|
|
413
|
-
elToNeedsFixedPosition =
|
|
474
|
+
elToNeedsFixedPosition =
|
|
475
|
+
window.getComputedStyle(parent).position === 'fixed'
|
|
414
476
|
parent = parent.parentNode
|
|
415
477
|
}
|
|
416
478
|
|
|
@@ -446,10 +508,9 @@ export default function morph (_options) {
|
|
|
446
508
|
// we apply styles specified by user
|
|
447
509
|
if (typeof options.style === 'string') {
|
|
448
510
|
elTo.style.cssText += ' ' + options.style
|
|
449
|
-
}
|
|
450
|
-
else if (isObject(options.style) === true) {
|
|
511
|
+
} else if (isObject(options.style) === true) {
|
|
451
512
|
for (const prop in options.style) {
|
|
452
|
-
elTo.style[
|
|
513
|
+
elTo.style[prop] = options.style[prop]
|
|
453
514
|
}
|
|
454
515
|
}
|
|
455
516
|
|
|
@@ -458,13 +519,15 @@ export default function morph (_options) {
|
|
|
458
519
|
|
|
459
520
|
// we position the morphing element
|
|
460
521
|
// if we use fixed position for the final element we need to adjust for scroll
|
|
461
|
-
const documentScroll =
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
elTo.style.
|
|
522
|
+
const documentScroll =
|
|
523
|
+
elToNeedsFixedPosition === true
|
|
524
|
+
? document.documentElement
|
|
525
|
+
: { scrollLeft: 0, scrollTop: 0 }
|
|
526
|
+
elTo.style.position =
|
|
527
|
+
elToNeedsFixedPosition === true ? 'fixed' : 'absolute'
|
|
528
|
+
elTo.style.left = `${elToPosition.left - documentScroll.scrollLeft}px`
|
|
466
529
|
elTo.style.right = 'unset'
|
|
467
|
-
elTo.style.top = `${
|
|
530
|
+
elTo.style.top = `${elToPosition.top - documentScroll.scrollTop}px`
|
|
468
531
|
elTo.style.margin = 0
|
|
469
532
|
|
|
470
533
|
if (options.resize === true) {
|
|
@@ -486,9 +549,9 @@ export default function morph (_options) {
|
|
|
486
549
|
elFromTween.style.transition = 'none'
|
|
487
550
|
|
|
488
551
|
elFromTween.style.position = elTo.style.position
|
|
489
|
-
elFromTween.style.left = `${
|
|
552
|
+
elFromTween.style.left = `${elFromPosition.left - documentScroll.scrollLeft}px`
|
|
490
553
|
elFromTween.style.right = 'unset'
|
|
491
|
-
elFromTween.style.top = `${
|
|
554
|
+
elFromTween.style.top = `${elFromPosition.top - documentScroll.scrollTop}px`
|
|
492
555
|
elFromTween.style.margin = 0
|
|
493
556
|
elFromTween.style.pointerEvents = 'none'
|
|
494
557
|
|
|
@@ -511,8 +574,7 @@ export default function morph (_options) {
|
|
|
511
574
|
if (elFrom === elTo && endElementTo !== true) {
|
|
512
575
|
elTo.style.cssText = elFromStyleSaved
|
|
513
576
|
elTo.className = elFromClassSaved
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
577
|
+
} else {
|
|
516
578
|
elTo.style.cssText = elToStyleSaved
|
|
517
579
|
elTo.className = elToClassSaved
|
|
518
580
|
}
|
|
@@ -539,145 +601,172 @@ export default function morph (_options) {
|
|
|
539
601
|
}
|
|
540
602
|
|
|
541
603
|
if (options.useCSS !== true && typeof elTo.animate === 'function') {
|
|
542
|
-
const resizeFrom =
|
|
543
|
-
|
|
544
|
-
transform: `translate(${ deltaX }px, ${ deltaY }px)`,
|
|
545
|
-
width: `${ elFromCloneWidth }px`,
|
|
546
|
-
height: `${ elFromCloneHeight }px`
|
|
547
|
-
}
|
|
548
|
-
: {
|
|
549
|
-
transform: `translate(${ deltaX }px, ${ deltaY }px) scale(${ scaleX }, ${ scaleY })`
|
|
550
|
-
}
|
|
551
|
-
const resizeTo = options.resize === true
|
|
552
|
-
? {
|
|
553
|
-
width: `${ elToCloneWidth }px`,
|
|
554
|
-
height: `${ elToCloneHeight }px`
|
|
555
|
-
}
|
|
556
|
-
: {}
|
|
557
|
-
const resizeFromTween = options.resize === true
|
|
558
|
-
? {
|
|
559
|
-
width: `${ elFromCloneWidth }px`,
|
|
560
|
-
height: `${ elFromCloneHeight }px`
|
|
561
|
-
}
|
|
562
|
-
: {}
|
|
563
|
-
const resizeToTween = options.resize === true
|
|
564
|
-
? {
|
|
565
|
-
transform: `translate(${ -1 * deltaX }px, ${ -1 * deltaY }px)`,
|
|
566
|
-
width: `${ elToCloneWidth }px`,
|
|
567
|
-
height: `${ elToCloneHeight }px`
|
|
568
|
-
}
|
|
569
|
-
: {
|
|
570
|
-
transform: `translate(${ -1 * deltaX }px, ${ -1 * deltaY }px) scale(${ 1 / scaleX }, ${ 1 / scaleY })`
|
|
571
|
-
}
|
|
572
|
-
const tweenFrom = elFromTween !== void 0
|
|
573
|
-
? { opacity: options.tweenToOpacity }
|
|
574
|
-
: { backgroundColor: elFromBackground }
|
|
575
|
-
const tweenTo = elFromTween !== void 0
|
|
576
|
-
? { opacity: 1 }
|
|
577
|
-
: { backgroundColor: elToBackground }
|
|
578
|
-
animationTo = elTo.animate([
|
|
579
|
-
{
|
|
580
|
-
margin: 0,
|
|
581
|
-
borderWidth: elFromBorderWidth,
|
|
582
|
-
borderStyle: elFromBorderStyle,
|
|
583
|
-
borderColor: elFromBorderColor,
|
|
584
|
-
borderRadius: elFromBorderRadius,
|
|
585
|
-
zIndex: elFromZIndex,
|
|
586
|
-
transformOrigin: '0 0',
|
|
587
|
-
...resizeFrom,
|
|
588
|
-
...tweenFrom
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
margin: 0,
|
|
592
|
-
borderWidth: elToBorderWidth,
|
|
593
|
-
borderStyle: elToBorderStyle,
|
|
594
|
-
borderColor: elToBorderColor,
|
|
595
|
-
borderRadius: elToBorderRadius,
|
|
596
|
-
zIndex: elToZIndex,
|
|
597
|
-
transformOrigin: '0 0',
|
|
598
|
-
transform: elToTransform,
|
|
599
|
-
...resizeTo,
|
|
600
|
-
...tweenTo
|
|
601
|
-
}
|
|
602
|
-
], {
|
|
603
|
-
duration: options.duration,
|
|
604
|
-
easing: options.easing,
|
|
605
|
-
fill: options.fill,
|
|
606
|
-
delay: options.delay
|
|
607
|
-
})
|
|
608
|
-
|
|
609
|
-
animationFromTween = elFromTween === void 0 ? void 0 : elFromTween.animate([
|
|
610
|
-
{
|
|
611
|
-
opacity: options.tweenFromOpacity,
|
|
612
|
-
margin: 0,
|
|
613
|
-
borderWidth: elFromBorderWidth,
|
|
614
|
-
borderStyle: elFromBorderStyle,
|
|
615
|
-
borderColor: elFromBorderColor,
|
|
616
|
-
borderRadius: elFromBorderRadius,
|
|
617
|
-
zIndex: elFromZIndex,
|
|
618
|
-
transformOrigin: '0 0',
|
|
619
|
-
transform: elFromTransform,
|
|
620
|
-
...resizeFromTween
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
opacity: 0,
|
|
624
|
-
margin: 0,
|
|
625
|
-
borderWidth: elToBorderWidth,
|
|
626
|
-
borderStyle: elToBorderStyle,
|
|
627
|
-
borderColor: elToBorderColor,
|
|
628
|
-
borderRadius: elToBorderRadius,
|
|
629
|
-
zIndex: elToZIndex,
|
|
630
|
-
transformOrigin: '0 0',
|
|
631
|
-
...resizeToTween
|
|
632
|
-
}
|
|
633
|
-
], {
|
|
634
|
-
duration: options.duration,
|
|
635
|
-
easing: options.easing,
|
|
636
|
-
fill: options.fill,
|
|
637
|
-
delay: options.delay
|
|
638
|
-
})
|
|
639
|
-
|
|
640
|
-
animationFromClone = options.hideFromClone === true || elSharedSize === true ? void 0 : elFromClone.animate([
|
|
641
|
-
{
|
|
642
|
-
margin: `${ elFromParentHeightDiff < 0 ? elFromParentHeightDiff / 2 : 0 }px ${ elFromParentWidthDiff < 0 ? elFromParentWidthDiff / 2 : 0 }px`,
|
|
643
|
-
width: `${ elFromCloneWidth + elFromPosition.marginH }px`,
|
|
644
|
-
height: `${ elFromCloneHeight + elFromPosition.marginV }px`
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
margin: 0,
|
|
648
|
-
width: 0,
|
|
649
|
-
height: 0
|
|
650
|
-
}
|
|
651
|
-
], {
|
|
652
|
-
duration: options.duration,
|
|
653
|
-
easing: options.easing,
|
|
654
|
-
fill: options.fill,
|
|
655
|
-
delay: options.delay
|
|
656
|
-
})
|
|
657
|
-
|
|
658
|
-
animationToClone = options.keepToClone === true ? void 0 : elToClone.animate([
|
|
659
|
-
elSharedSize === true
|
|
604
|
+
const resizeFrom =
|
|
605
|
+
options.resize === true
|
|
660
606
|
? {
|
|
661
|
-
|
|
662
|
-
width: `${
|
|
663
|
-
height: `${
|
|
607
|
+
transform: `translate(${deltaX}px, ${deltaY}px)`,
|
|
608
|
+
width: `${elFromCloneWidth}px`,
|
|
609
|
+
height: `${elFromCloneHeight}px`
|
|
664
610
|
}
|
|
665
611
|
: {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
612
|
+
transform: `translate(${deltaX}px, ${deltaY}px) scale(${scaleX}, ${scaleY})`
|
|
613
|
+
}
|
|
614
|
+
const resizeTo =
|
|
615
|
+
options.resize === true
|
|
616
|
+
? {
|
|
617
|
+
width: `${elToCloneWidth}px`,
|
|
618
|
+
height: `${elToCloneHeight}px`
|
|
619
|
+
}
|
|
620
|
+
: {}
|
|
621
|
+
const resizeFromTween =
|
|
622
|
+
options.resize === true
|
|
623
|
+
? {
|
|
624
|
+
width: `${elFromCloneWidth}px`,
|
|
625
|
+
height: `${elFromCloneHeight}px`
|
|
626
|
+
}
|
|
627
|
+
: {}
|
|
628
|
+
const resizeToTween =
|
|
629
|
+
options.resize === true
|
|
630
|
+
? {
|
|
631
|
+
transform: `translate(${-1 * deltaX}px, ${-1 * deltaY}px)`,
|
|
632
|
+
width: `${elToCloneWidth}px`,
|
|
633
|
+
height: `${elToCloneHeight}px`
|
|
634
|
+
}
|
|
635
|
+
: {
|
|
636
|
+
transform: `translate(${-1 * deltaX}px, ${-1 * deltaY}px) scale(${1 / scaleX}, ${1 / scaleY})`
|
|
637
|
+
}
|
|
638
|
+
const tweenFrom =
|
|
639
|
+
elFromTween !== void 0
|
|
640
|
+
? { opacity: options.tweenToOpacity }
|
|
641
|
+
: { backgroundColor: elFromBackground }
|
|
642
|
+
const tweenTo =
|
|
643
|
+
elFromTween !== void 0
|
|
644
|
+
? { opacity: 1 }
|
|
645
|
+
: { backgroundColor: elToBackground }
|
|
646
|
+
animationTo = elTo.animate(
|
|
647
|
+
[
|
|
648
|
+
{
|
|
649
|
+
margin: 0,
|
|
650
|
+
borderWidth: elFromBorderWidth,
|
|
651
|
+
borderStyle: elFromBorderStyle,
|
|
652
|
+
borderColor: elFromBorderColor,
|
|
653
|
+
borderRadius: elFromBorderRadius,
|
|
654
|
+
zIndex: elFromZIndex,
|
|
655
|
+
transformOrigin: '0 0',
|
|
656
|
+
...resizeFrom,
|
|
657
|
+
...tweenFrom
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
margin: 0,
|
|
661
|
+
borderWidth: elToBorderWidth,
|
|
662
|
+
borderStyle: elToBorderStyle,
|
|
663
|
+
borderColor: elToBorderColor,
|
|
664
|
+
borderRadius: elToBorderRadius,
|
|
665
|
+
zIndex: elToZIndex,
|
|
666
|
+
transformOrigin: '0 0',
|
|
667
|
+
transform: elToTransform,
|
|
668
|
+
...resizeTo,
|
|
669
|
+
...tweenTo
|
|
670
|
+
}
|
|
671
|
+
],
|
|
670
672
|
{
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
673
|
+
duration: options.duration,
|
|
674
|
+
easing: options.easing,
|
|
675
|
+
fill: options.fill,
|
|
676
|
+
delay: options.delay
|
|
674
677
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
678
|
+
)
|
|
679
|
+
|
|
680
|
+
animationFromTween =
|
|
681
|
+
elFromTween === void 0
|
|
682
|
+
? void 0
|
|
683
|
+
: elFromTween.animate(
|
|
684
|
+
[
|
|
685
|
+
{
|
|
686
|
+
opacity: options.tweenFromOpacity,
|
|
687
|
+
margin: 0,
|
|
688
|
+
borderWidth: elFromBorderWidth,
|
|
689
|
+
borderStyle: elFromBorderStyle,
|
|
690
|
+
borderColor: elFromBorderColor,
|
|
691
|
+
borderRadius: elFromBorderRadius,
|
|
692
|
+
zIndex: elFromZIndex,
|
|
693
|
+
transformOrigin: '0 0',
|
|
694
|
+
transform: elFromTransform,
|
|
695
|
+
...resizeFromTween
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
opacity: 0,
|
|
699
|
+
margin: 0,
|
|
700
|
+
borderWidth: elToBorderWidth,
|
|
701
|
+
borderStyle: elToBorderStyle,
|
|
702
|
+
borderColor: elToBorderColor,
|
|
703
|
+
borderRadius: elToBorderRadius,
|
|
704
|
+
zIndex: elToZIndex,
|
|
705
|
+
transformOrigin: '0 0',
|
|
706
|
+
...resizeToTween
|
|
707
|
+
}
|
|
708
|
+
],
|
|
709
|
+
{
|
|
710
|
+
duration: options.duration,
|
|
711
|
+
easing: options.easing,
|
|
712
|
+
fill: options.fill,
|
|
713
|
+
delay: options.delay
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
animationFromClone =
|
|
718
|
+
options.hideFromClone === true || elSharedSize === true
|
|
719
|
+
? void 0
|
|
720
|
+
: elFromClone.animate(
|
|
721
|
+
[
|
|
722
|
+
{
|
|
723
|
+
margin: `${elFromParentHeightDiff < 0 ? elFromParentHeightDiff / 2 : 0}px ${elFromParentWidthDiff < 0 ? elFromParentWidthDiff / 2 : 0}px`,
|
|
724
|
+
width: `${elFromCloneWidth + elFromPosition.marginH}px`,
|
|
725
|
+
height: `${elFromCloneHeight + elFromPosition.marginV}px`
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
margin: 0,
|
|
729
|
+
width: 0,
|
|
730
|
+
height: 0
|
|
731
|
+
}
|
|
732
|
+
],
|
|
733
|
+
{
|
|
734
|
+
duration: options.duration,
|
|
735
|
+
easing: options.easing,
|
|
736
|
+
fill: options.fill,
|
|
737
|
+
delay: options.delay
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
animationToClone =
|
|
742
|
+
options.keepToClone === true
|
|
743
|
+
? void 0
|
|
744
|
+
: elToClone.animate(
|
|
745
|
+
[
|
|
746
|
+
elSharedSize === true
|
|
747
|
+
? {
|
|
748
|
+
margin: `${elFromParentHeightDiff < 0 ? elFromParentHeightDiff / 2 : 0}px ${elFromParentWidthDiff < 0 ? elFromParentWidthDiff / 2 : 0}px`,
|
|
749
|
+
width: `${elFromCloneWidth + elFromPosition.marginH}px`,
|
|
750
|
+
height: `${elFromCloneHeight + elFromPosition.marginV}px`
|
|
751
|
+
}
|
|
752
|
+
: {
|
|
753
|
+
margin: 0,
|
|
754
|
+
width: 0,
|
|
755
|
+
height: 0
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
margin: `${elToParentHeightDiff < 0 ? elToParentHeightDiff / 2 : 0}px ${elToParentWidthDiff < 0 ? elToParentWidthDiff / 2 : 0}px`,
|
|
759
|
+
width: `${elToCloneWidth + elToPosition.marginH}px`,
|
|
760
|
+
height: `${elToCloneHeight + elToPosition.marginV}px`
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
{
|
|
764
|
+
duration: options.duration,
|
|
765
|
+
easing: options.easing,
|
|
766
|
+
fill: options.fill,
|
|
767
|
+
delay: options.delay
|
|
768
|
+
}
|
|
769
|
+
)
|
|
681
770
|
|
|
682
771
|
const cleanup = abort => {
|
|
683
772
|
animationFromClone?.cancel()
|
|
@@ -731,80 +820,87 @@ export default function morph (_options) {
|
|
|
731
820
|
|
|
732
821
|
return true
|
|
733
822
|
}
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
const qAnimId = `q-morph-anim-${ ++id }`
|
|
823
|
+
} else {
|
|
824
|
+
const qAnimId = `q-morph-anim-${++id}`
|
|
737
825
|
const style = document.createElement('style')
|
|
738
|
-
const resizeFrom =
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
826
|
+
const resizeFrom =
|
|
827
|
+
options.resize === true
|
|
828
|
+
? `
|
|
829
|
+
transform: translate(${deltaX}px, ${deltaY}px);
|
|
830
|
+
width: ${elFromCloneWidth}px;
|
|
831
|
+
height: ${elFromCloneHeight}px;
|
|
743
832
|
`
|
|
744
|
-
|
|
745
|
-
const resizeTo =
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
833
|
+
: `transform: translate(${deltaX}px, ${deltaY}px) scale(${scaleX}, ${scaleY});`
|
|
834
|
+
const resizeTo =
|
|
835
|
+
options.resize === true
|
|
836
|
+
? `
|
|
837
|
+
width: ${elToCloneWidth}px;
|
|
838
|
+
height: ${elToCloneHeight}px;
|
|
749
839
|
`
|
|
750
|
-
|
|
751
|
-
const resizeFromTween =
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
840
|
+
: ''
|
|
841
|
+
const resizeFromTween =
|
|
842
|
+
options.resize === true
|
|
843
|
+
? `
|
|
844
|
+
width: ${elFromCloneWidth}px;
|
|
845
|
+
height: ${elFromCloneHeight}px;
|
|
755
846
|
`
|
|
756
|
-
|
|
757
|
-
const resizeToTween =
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
847
|
+
: ''
|
|
848
|
+
const resizeToTween =
|
|
849
|
+
options.resize === true
|
|
850
|
+
? `
|
|
851
|
+
transform: translate(${-1 * deltaX}px, ${-1 * deltaY}px);
|
|
852
|
+
width: ${elToCloneWidth}px;
|
|
853
|
+
height: ${elToCloneHeight}px;
|
|
762
854
|
`
|
|
763
|
-
|
|
764
|
-
const tweenFrom =
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
855
|
+
: `transform: translate(${-1 * deltaX}px, ${-1 * deltaY}px) scale(${1 / scaleX}, ${1 / scaleY});`
|
|
856
|
+
const tweenFrom =
|
|
857
|
+
elFromTween !== void 0
|
|
858
|
+
? `opacity: ${options.tweenToOpacity};`
|
|
859
|
+
: `background-color: ${elFromBackground};`
|
|
860
|
+
const tweenTo =
|
|
861
|
+
elFromTween !== void 0
|
|
862
|
+
? 'opacity: 1;'
|
|
863
|
+
: `background-color: ${elToBackground};`
|
|
864
|
+
const keyframesFromTween =
|
|
865
|
+
elFromTween === void 0
|
|
866
|
+
? ''
|
|
867
|
+
: `
|
|
868
|
+
@keyframes ${qAnimId}-from-tween {
|
|
774
869
|
0% {
|
|
775
|
-
opacity: ${
|
|
870
|
+
opacity: ${options.tweenFromOpacity};
|
|
776
871
|
margin: 0;
|
|
777
|
-
border-width: ${
|
|
778
|
-
border-style: ${
|
|
779
|
-
border-color: ${
|
|
780
|
-
border-radius: ${
|
|
781
|
-
z-index: ${
|
|
872
|
+
border-width: ${elFromBorderWidth};
|
|
873
|
+
border-style: ${elFromBorderStyle};
|
|
874
|
+
border-color: ${elFromBorderColor};
|
|
875
|
+
border-radius: ${elFromBorderRadius};
|
|
876
|
+
z-index: ${elFromZIndex};
|
|
782
877
|
transform-origin: 0 0;
|
|
783
|
-
transform: ${
|
|
784
|
-
${
|
|
878
|
+
transform: ${elFromTransform};
|
|
879
|
+
${resizeFromTween}
|
|
785
880
|
}
|
|
786
881
|
|
|
787
882
|
100% {
|
|
788
883
|
opacity: 0;
|
|
789
884
|
margin: 0;
|
|
790
|
-
border-width: ${
|
|
791
|
-
border-style: ${
|
|
792
|
-
border-color: ${
|
|
793
|
-
border-radius: ${
|
|
794
|
-
z-index: ${
|
|
885
|
+
border-width: ${elToBorderWidth};
|
|
886
|
+
border-style: ${elToBorderStyle};
|
|
887
|
+
border-color: ${elToBorderColor};
|
|
888
|
+
border-radius: ${elToBorderRadius};
|
|
889
|
+
z-index: ${elToZIndex};
|
|
795
890
|
transform-origin: 0 0;
|
|
796
|
-
${
|
|
891
|
+
${resizeToTween}
|
|
797
892
|
}
|
|
798
893
|
}
|
|
799
894
|
`
|
|
800
|
-
const keyframesFrom =
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
895
|
+
const keyframesFrom =
|
|
896
|
+
options.hideFromClone === true || elSharedSize === true
|
|
897
|
+
? ''
|
|
898
|
+
: `
|
|
899
|
+
@keyframes ${qAnimId}-from {
|
|
804
900
|
0% {
|
|
805
|
-
margin: ${
|
|
806
|
-
width: ${
|
|
807
|
-
height: ${
|
|
901
|
+
margin: ${elFromParentHeightDiff < 0 ? elFromParentHeightDiff / 2 : 0}px ${elFromParentWidthDiff < 0 ? elFromParentWidthDiff / 2 : 0}px;
|
|
902
|
+
width: ${elFromCloneWidth + elFromPosition.marginH}px;
|
|
903
|
+
height: ${elFromCloneHeight + elFromPosition.marginV}px;
|
|
808
904
|
}
|
|
809
905
|
|
|
810
906
|
100% {
|
|
@@ -814,84 +910,83 @@ export default function morph (_options) {
|
|
|
814
910
|
}
|
|
815
911
|
}
|
|
816
912
|
`
|
|
817
|
-
const keyframeToStart =
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
913
|
+
const keyframeToStart =
|
|
914
|
+
elSharedSize === true
|
|
915
|
+
? `
|
|
916
|
+
margin: ${elFromParentHeightDiff < 0 ? elFromParentHeightDiff / 2 : 0}px ${elFromParentWidthDiff < 0 ? elFromParentWidthDiff / 2 : 0}px;
|
|
917
|
+
width: ${elFromCloneWidth + elFromPosition.marginH}px;
|
|
918
|
+
height: ${elFromCloneHeight + elFromPosition.marginV}px;
|
|
822
919
|
`
|
|
823
|
-
|
|
920
|
+
: `
|
|
824
921
|
margin: 0;
|
|
825
922
|
width: 0;
|
|
826
923
|
height: 0;
|
|
827
924
|
`
|
|
828
|
-
const keyframesTo =
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
925
|
+
const keyframesTo =
|
|
926
|
+
options.keepToClone === true
|
|
927
|
+
? ''
|
|
928
|
+
: `
|
|
929
|
+
@keyframes ${qAnimId}-to {
|
|
832
930
|
0% {
|
|
833
|
-
${
|
|
931
|
+
${keyframeToStart}
|
|
834
932
|
}
|
|
835
933
|
|
|
836
934
|
100% {
|
|
837
|
-
margin: ${
|
|
838
|
-
width: ${
|
|
839
|
-
height: ${
|
|
935
|
+
margin: ${elToParentHeightDiff < 0 ? elToParentHeightDiff / 2 : 0}px ${elToParentWidthDiff < 0 ? elToParentWidthDiff / 2 : 0}px;
|
|
936
|
+
width: ${elToCloneWidth + elToPosition.marginH}px;
|
|
937
|
+
height: ${elToCloneHeight + elToPosition.marginV}px;
|
|
840
938
|
}
|
|
841
939
|
}
|
|
842
940
|
`
|
|
843
941
|
style.innerHTML = `
|
|
844
|
-
@keyframes ${
|
|
942
|
+
@keyframes ${qAnimId} {
|
|
845
943
|
0% {
|
|
846
944
|
margin: 0;
|
|
847
|
-
border-width: ${
|
|
848
|
-
border-style: ${
|
|
849
|
-
border-color: ${
|
|
850
|
-
border-radius: ${
|
|
851
|
-
background-color: ${
|
|
852
|
-
z-index: ${
|
|
945
|
+
border-width: ${elFromBorderWidth};
|
|
946
|
+
border-style: ${elFromBorderStyle};
|
|
947
|
+
border-color: ${elFromBorderColor};
|
|
948
|
+
border-radius: ${elFromBorderRadius};
|
|
949
|
+
background-color: ${elFromBackground};
|
|
950
|
+
z-index: ${elFromZIndex};
|
|
853
951
|
transform-origin: 0 0;
|
|
854
|
-
${
|
|
855
|
-
${
|
|
952
|
+
${resizeFrom}
|
|
953
|
+
${tweenFrom}
|
|
856
954
|
}
|
|
857
955
|
|
|
858
956
|
100% {
|
|
859
957
|
margin: 0;
|
|
860
|
-
border-width: ${
|
|
861
|
-
border-style: ${
|
|
862
|
-
border-color: ${
|
|
863
|
-
border-radius: ${
|
|
864
|
-
background-color: ${
|
|
865
|
-
z-index: ${
|
|
958
|
+
border-width: ${elToBorderWidth};
|
|
959
|
+
border-style: ${elToBorderStyle};
|
|
960
|
+
border-color: ${elToBorderColor};
|
|
961
|
+
border-radius: ${elToBorderRadius};
|
|
962
|
+
background-color: ${elToBackground};
|
|
963
|
+
z-index: ${elToZIndex};
|
|
866
964
|
transform-origin: 0 0;
|
|
867
|
-
transform: ${
|
|
868
|
-
${
|
|
869
|
-
${
|
|
965
|
+
transform: ${elToTransform};
|
|
966
|
+
${resizeTo}
|
|
967
|
+
${tweenTo}
|
|
870
968
|
}
|
|
871
969
|
}
|
|
872
970
|
|
|
873
|
-
${
|
|
971
|
+
${keyframesFrom}
|
|
874
972
|
|
|
875
|
-
${
|
|
973
|
+
${keyframesFromTween}
|
|
876
974
|
|
|
877
|
-
${
|
|
975
|
+
${keyframesTo}
|
|
878
976
|
`
|
|
879
977
|
document.head.appendChild(style)
|
|
880
978
|
|
|
881
979
|
let animationDirection = 'normal'
|
|
882
980
|
|
|
883
|
-
elFromClone.style.animation = `${
|
|
981
|
+
elFromClone.style.animation = `${options.duration}ms ${options.easing} ${options.delay}ms ${animationDirection} ${options.fill} ${qAnimId}-from`
|
|
884
982
|
if (elFromTween !== void 0) {
|
|
885
|
-
elFromTween.style.animation = `${
|
|
983
|
+
elFromTween.style.animation = `${options.duration}ms ${options.easing} ${options.delay}ms ${animationDirection} ${options.fill} ${qAnimId}-from-tween`
|
|
886
984
|
}
|
|
887
|
-
elToClone.style.animation = `${
|
|
888
|
-
elTo.style.animation = `${
|
|
985
|
+
elToClone.style.animation = `${options.duration}ms ${options.easing} ${options.delay}ms ${animationDirection} ${options.fill} ${qAnimId}-to`
|
|
986
|
+
elTo.style.animation = `${options.duration}ms ${options.easing} ${options.delay}ms ${animationDirection} ${options.fill} ${qAnimId}`
|
|
889
987
|
|
|
890
988
|
const cleanup = evt => {
|
|
891
|
-
if (
|
|
892
|
-
evt === Object(evt)
|
|
893
|
-
&& evt.animationName !== qAnimId
|
|
894
|
-
) return
|
|
989
|
+
if (evt === Object(evt) && evt.animationName !== qAnimId) return
|
|
895
990
|
|
|
896
991
|
elTo.removeEventListener('animationend', cleanup)
|
|
897
992
|
elTo.removeEventListener('animationcancel', cleanup)
|
|
@@ -930,7 +1025,8 @@ export default function morph (_options) {
|
|
|
930
1025
|
|
|
931
1026
|
endElementTo = endElementTo !== true
|
|
932
1027
|
|
|
933
|
-
animationDirection =
|
|
1028
|
+
animationDirection =
|
|
1029
|
+
animationDirection === 'normal' ? 'reverse' : 'normal'
|
|
934
1030
|
|
|
935
1031
|
elFromClone.style.animationDirection = animationDirection
|
|
936
1032
|
elFromTween.style.animationDirection = animationDirection
|
|
@@ -943,15 +1039,16 @@ export default function morph (_options) {
|
|
|
943
1039
|
}
|
|
944
1040
|
|
|
945
1041
|
if (
|
|
946
|
-
options.waitFor > 0
|
|
947
|
-
|
|
948
|
-
|
|
1042
|
+
options.waitFor > 0 ||
|
|
1043
|
+
options.waitFor === 'transitionend' ||
|
|
1044
|
+
(options.waitFor === Object(options.waitFor) &&
|
|
1045
|
+
typeof options.waitFor.then === 'function')
|
|
949
1046
|
) {
|
|
950
|
-
const delayPromise =
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1047
|
+
const delayPromise =
|
|
1048
|
+
options.waitFor > 0
|
|
1049
|
+
? new Promise(resolve => setTimeout(resolve, options.waitFor))
|
|
1050
|
+
: options.waitFor === 'transitionend'
|
|
1051
|
+
? new Promise(resolve => {
|
|
955
1052
|
const endFn = () => {
|
|
956
1053
|
if (timer !== null) {
|
|
957
1054
|
clearTimeout(timer)
|
|
@@ -971,21 +1068,17 @@ export default function morph (_options) {
|
|
|
971
1068
|
elTo.addEventListener('transitionend', endFn)
|
|
972
1069
|
elTo.addEventListener('transitioncancel', endFn)
|
|
973
1070
|
})
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
typeof elTo.qMorphCancel === 'function' && elTo.qMorphCancel()
|
|
981
|
-
})
|
|
982
|
-
}
|
|
983
|
-
else {
|
|
1071
|
+
: options.waitFor
|
|
1072
|
+
|
|
1073
|
+
delayPromise.then(animate).catch(() => {
|
|
1074
|
+
if (typeof elTo.qMorphCancel === 'function') elTo.qMorphCancel()
|
|
1075
|
+
})
|
|
1076
|
+
} else {
|
|
984
1077
|
animate()
|
|
985
1078
|
}
|
|
986
1079
|
}
|
|
987
1080
|
|
|
988
|
-
typeof _options.onToggle === 'function'
|
|
1081
|
+
if (typeof _options.onToggle === 'function') _options.onToggle()
|
|
989
1082
|
requestAnimationFrame(calculateFinalState)
|
|
990
1083
|
|
|
991
1084
|
// we return the cancel function
|