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
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
ref,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
Transition,
|
|
7
|
+
nextTick,
|
|
8
|
+
getCurrentInstance
|
|
9
|
+
} from 'vue'
|
|
2
10
|
|
|
3
11
|
import QBtn from '../btn/QBtn.js'
|
|
4
12
|
|
|
5
|
-
import useDark, {
|
|
13
|
+
import useDark, {
|
|
14
|
+
useDarkProps
|
|
15
|
+
} from '../../composables/private.use-dark/use-dark.js'
|
|
6
16
|
import useRenderCache from '../../composables/use-render-cache/use-render-cache.js'
|
|
7
|
-
import {
|
|
8
|
-
|
|
17
|
+
import {
|
|
18
|
+
useFormProps,
|
|
19
|
+
useFormAttrs,
|
|
20
|
+
useFormInject
|
|
21
|
+
} from '../../composables/use-form/private.use-form.js'
|
|
22
|
+
import useDatetime, {
|
|
23
|
+
useDatetimeProps,
|
|
24
|
+
useDatetimeEmits,
|
|
25
|
+
getDayHash
|
|
26
|
+
} from './use-datetime.js'
|
|
9
27
|
|
|
10
28
|
import { createComponent } from '../../utils/private.create/create.js'
|
|
11
29
|
import { hSlot } from '../../utils/private.render/render.js'
|
|
12
30
|
import { formatDate, __splitDate, getDateDiff } from '../../utils/date/date.js'
|
|
13
31
|
import { pad } from '../../utils/format/format.js'
|
|
14
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
jalaaliMonthLength,
|
|
34
|
+
toGregorian
|
|
35
|
+
} from '../../utils/date/private.persian.js'
|
|
15
36
|
import { isObject } from '../../utils/is/is.js'
|
|
16
37
|
|
|
17
38
|
const yearsInterval = 20
|
|
18
|
-
const views = [
|
|
39
|
+
const views = ['Calendar', 'Years', 'Months']
|
|
19
40
|
const viewIsValid = v => views.includes(v)
|
|
20
41
|
const yearMonthValidator = v => /^-?[\d]+\/[0-1]\d$/.test(v)
|
|
21
42
|
const lineStr = ' \u2014 '
|
|
22
43
|
|
|
23
|
-
function getMonthHash
|
|
44
|
+
function getMonthHash(date) {
|
|
24
45
|
return date.year + '/' + pad(date.month)
|
|
25
46
|
}
|
|
26
47
|
|
|
@@ -34,7 +55,11 @@ export default createComponent({
|
|
|
34
55
|
|
|
35
56
|
modelValue: {
|
|
36
57
|
required: true,
|
|
37
|
-
validator: val =>
|
|
58
|
+
validator: val =>
|
|
59
|
+
typeof val === 'string' ||
|
|
60
|
+
Array.isArray(val) === true ||
|
|
61
|
+
Object(val) === val ||
|
|
62
|
+
val === null
|
|
38
63
|
},
|
|
39
64
|
|
|
40
65
|
multiple: Boolean,
|
|
@@ -57,12 +82,12 @@ export default createComponent({
|
|
|
57
82
|
|
|
58
83
|
yearsInMonthView: Boolean,
|
|
59
84
|
|
|
60
|
-
events: [
|
|
61
|
-
eventColor: [
|
|
85
|
+
events: [Array, Function],
|
|
86
|
+
eventColor: [String, Function],
|
|
62
87
|
|
|
63
88
|
emitImmediately: Boolean,
|
|
64
89
|
|
|
65
|
-
options: [
|
|
90
|
+
options: [Array, Function],
|
|
66
91
|
|
|
67
92
|
navigationMinYearMonth: {
|
|
68
93
|
type: String,
|
|
@@ -76,7 +101,7 @@ export default createComponent({
|
|
|
76
101
|
|
|
77
102
|
noUnset: Boolean,
|
|
78
103
|
|
|
79
|
-
firstDayOfWeek: [
|
|
104
|
+
firstDayOfWeek: [String, Number],
|
|
80
105
|
todayBtn: Boolean,
|
|
81
106
|
minimal: Boolean,
|
|
82
107
|
defaultView: {
|
|
@@ -86,18 +111,18 @@ export default createComponent({
|
|
|
86
111
|
}
|
|
87
112
|
},
|
|
88
113
|
|
|
89
|
-
emits: [
|
|
90
|
-
...useDatetimeEmits,
|
|
91
|
-
'rangeStart', 'rangeEnd', 'navigation'
|
|
92
|
-
],
|
|
114
|
+
emits: [...useDatetimeEmits, 'rangeStart', 'rangeEnd', 'navigation'],
|
|
93
115
|
|
|
94
|
-
setup
|
|
116
|
+
setup(props, { slots, emit }) {
|
|
95
117
|
const { proxy } = getCurrentInstance()
|
|
96
118
|
const { $q } = proxy
|
|
97
119
|
|
|
98
120
|
const isDark = useDark(props, $q)
|
|
99
121
|
const { getCache } = useRenderCache()
|
|
100
|
-
const { tabindex, headerClass, getLocale, getCurrentDate } = useDatetime(
|
|
122
|
+
const { tabindex, headerClass, getLocale, getCurrentDate } = useDatetime(
|
|
123
|
+
props,
|
|
124
|
+
$q
|
|
125
|
+
)
|
|
101
126
|
|
|
102
127
|
let lastEmitValue
|
|
103
128
|
|
|
@@ -122,101 +147,131 @@ export default createComponent({
|
|
|
122
147
|
const monthDirection = ref(direction.value)
|
|
123
148
|
const yearDirection = ref(direction.value)
|
|
124
149
|
|
|
125
|
-
const
|
|
126
|
-
const startYear = ref(
|
|
150
|
+
const localYear = viewModel.value.year
|
|
151
|
+
const startYear = ref(
|
|
152
|
+
localYear -
|
|
153
|
+
(localYear % yearsInterval) -
|
|
154
|
+
(localYear < 0 ? yearsInterval : 0)
|
|
155
|
+
)
|
|
127
156
|
const editRange = ref(null)
|
|
128
157
|
|
|
129
158
|
const classes = computed(() => {
|
|
130
159
|
const type = props.landscape === true ? 'landscape' : 'portrait'
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
160
|
+
return (
|
|
161
|
+
`q-date q-date--${type} q-date--${type}-${props.minimal === true ? 'minimal' : 'standard'}` +
|
|
162
|
+
(isDark.value === true ? ' q-date--dark q-dark' : '') +
|
|
163
|
+
(props.bordered === true ? ' q-date--bordered' : '') +
|
|
164
|
+
(props.square === true ? ' q-date--square no-border-radius' : '') +
|
|
165
|
+
(props.flat === true ? ' q-date--flat no-shadow' : '') +
|
|
166
|
+
(props.disable === true
|
|
167
|
+
? ' disabled'
|
|
168
|
+
: props.readonly === true
|
|
169
|
+
? ' q-date--readonly'
|
|
170
|
+
: '')
|
|
171
|
+
)
|
|
137
172
|
})
|
|
138
173
|
|
|
139
|
-
const computedColor = computed(() =>
|
|
140
|
-
return props.color || 'primary'
|
|
141
|
-
})
|
|
174
|
+
const computedColor = computed(() => props.color || 'primary')
|
|
142
175
|
|
|
143
|
-
const computedTextColor = computed(() =>
|
|
144
|
-
return props.textColor || 'white'
|
|
145
|
-
})
|
|
176
|
+
const computedTextColor = computed(() => props.textColor || 'white')
|
|
146
177
|
|
|
147
|
-
const isImmediate = computed(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
178
|
+
const isImmediate = computed(
|
|
179
|
+
() =>
|
|
180
|
+
props.emitImmediately === true &&
|
|
181
|
+
props.multiple !== true &&
|
|
182
|
+
props.range !== true
|
|
151
183
|
)
|
|
152
184
|
|
|
153
|
-
const normalizedModel = computed(() =>
|
|
185
|
+
const normalizedModel = computed(() =>
|
|
154
186
|
Array.isArray(props.modelValue) === true
|
|
155
187
|
? props.modelValue
|
|
156
|
-
:
|
|
157
|
-
|
|
188
|
+
: props.modelValue !== null && props.modelValue !== void 0
|
|
189
|
+
? [props.modelValue]
|
|
190
|
+
: []
|
|
191
|
+
)
|
|
158
192
|
|
|
159
193
|
const daysModel = computed(() =>
|
|
160
194
|
normalizedModel.value
|
|
161
195
|
.filter(date => typeof date === 'string')
|
|
162
196
|
.map(date => decodeString(date, innerMask.value, innerLocale.value))
|
|
163
|
-
.filter(
|
|
164
|
-
date
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
197
|
+
.filter(
|
|
198
|
+
date =>
|
|
199
|
+
date.dateHash !== null &&
|
|
200
|
+
date.day !== null &&
|
|
201
|
+
date.month !== null &&
|
|
202
|
+
date.year !== null
|
|
168
203
|
)
|
|
169
204
|
)
|
|
170
205
|
|
|
171
206
|
const rangeModel = computed(() => {
|
|
172
207
|
const fn = date => decodeString(date, innerMask.value, innerLocale.value)
|
|
173
208
|
return normalizedModel.value
|
|
174
|
-
.filter(
|
|
209
|
+
.filter(
|
|
210
|
+
date =>
|
|
211
|
+
isObject(date) === true &&
|
|
212
|
+
date.from !== void 0 &&
|
|
213
|
+
date.to !== void 0
|
|
214
|
+
)
|
|
175
215
|
.map(range => ({ from: fn(range.from), to: fn(range.to) }))
|
|
176
|
-
.filter(
|
|
216
|
+
.filter(
|
|
217
|
+
range =>
|
|
218
|
+
range.from.dateHash !== null &&
|
|
219
|
+
range.to.dateHash !== null &&
|
|
220
|
+
range.from.dateHash < range.to.dateHash
|
|
221
|
+
)
|
|
177
222
|
})
|
|
178
223
|
|
|
179
|
-
const getNativeDateFn = computed(() =>
|
|
224
|
+
const getNativeDateFn = computed(() =>
|
|
180
225
|
props.calendar !== 'persian'
|
|
181
226
|
? model => new Date(model.year, model.month - 1, model.day)
|
|
182
227
|
: model => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
)
|
|
228
|
+
const gDate = toGregorian(model.year, model.month, model.day)
|
|
229
|
+
return new Date(gDate.gy, gDate.gm - 1, gDate.gd)
|
|
230
|
+
}
|
|
231
|
+
)
|
|
187
232
|
|
|
188
|
-
const encodeObjectFn = computed(() =>
|
|
233
|
+
const encodeObjectFn = computed(() =>
|
|
189
234
|
props.calendar === 'persian'
|
|
190
235
|
? getDayHash
|
|
191
|
-
: (date,
|
|
192
|
-
|
|
236
|
+
: (date, dateMask, dateLocale) =>
|
|
237
|
+
formatDate(
|
|
238
|
+
new Date(
|
|
239
|
+
date.year,
|
|
240
|
+
date.month - 1,
|
|
241
|
+
date.day,
|
|
242
|
+
date.hour,
|
|
243
|
+
date.minute,
|
|
244
|
+
date.second,
|
|
245
|
+
date.millisecond
|
|
246
|
+
),
|
|
247
|
+
dateMask === void 0 ? innerMask.value : dateMask,
|
|
248
|
+
dateLocale === void 0 ? innerLocale.value : dateLocale,
|
|
193
249
|
date.year,
|
|
194
|
-
date.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
date.minute,
|
|
198
|
-
date.second,
|
|
199
|
-
date.millisecond
|
|
200
|
-
),
|
|
201
|
-
mask === void 0 ? innerMask.value : mask,
|
|
202
|
-
locale === void 0 ? innerLocale.value : locale,
|
|
203
|
-
date.year,
|
|
204
|
-
date.timezoneOffset
|
|
205
|
-
)
|
|
206
|
-
))
|
|
250
|
+
date.timezoneOffset
|
|
251
|
+
)
|
|
252
|
+
)
|
|
207
253
|
|
|
208
|
-
const daysInModel = computed(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
254
|
+
const daysInModel = computed(
|
|
255
|
+
() =>
|
|
256
|
+
daysModel.value.length +
|
|
257
|
+
rangeModel.value.reduce(
|
|
258
|
+
(acc, range) =>
|
|
259
|
+
acc +
|
|
260
|
+
1 +
|
|
261
|
+
getDateDiff(
|
|
262
|
+
getNativeDateFn.value(range.to),
|
|
263
|
+
getNativeDateFn.value(range.from)
|
|
264
|
+
),
|
|
265
|
+
0
|
|
266
|
+
)
|
|
216
267
|
)
|
|
217
268
|
|
|
218
269
|
const headerTitle = computed(() => {
|
|
219
|
-
if (
|
|
270
|
+
if (
|
|
271
|
+
props.title !== void 0 &&
|
|
272
|
+
props.title !== null &&
|
|
273
|
+
props.title.length !== 0
|
|
274
|
+
) {
|
|
220
275
|
return props.title
|
|
221
276
|
}
|
|
222
277
|
|
|
@@ -224,9 +279,15 @@ export default createComponent({
|
|
|
224
279
|
const model = editRange.value.init
|
|
225
280
|
const date = getNativeDateFn.value(model)
|
|
226
281
|
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
282
|
+
return (
|
|
283
|
+
innerLocale.value.daysShort[date.getDay()] +
|
|
284
|
+
', ' +
|
|
285
|
+
innerLocale.value.monthsShort[model.month - 1] +
|
|
286
|
+
' ' +
|
|
287
|
+
model.day +
|
|
288
|
+
lineStr +
|
|
289
|
+
'?'
|
|
290
|
+
)
|
|
230
291
|
}
|
|
231
292
|
|
|
232
293
|
if (daysInModel.value === 0) {
|
|
@@ -234,10 +295,10 @@ export default createComponent({
|
|
|
234
295
|
}
|
|
235
296
|
|
|
236
297
|
if (daysInModel.value > 1) {
|
|
237
|
-
return `${
|
|
298
|
+
return `${daysInModel.value} ${innerLocale.value.pluralDay}`
|
|
238
299
|
}
|
|
239
300
|
|
|
240
|
-
const model = daysModel.value[
|
|
301
|
+
const model = daysModel.value[0]
|
|
241
302
|
const date = getNativeDateFn.value(model)
|
|
242
303
|
|
|
243
304
|
if (isNaN(date.valueOf()) === true) {
|
|
@@ -248,27 +309,37 @@ export default createComponent({
|
|
|
248
309
|
return innerLocale.value.headerTitle(date, model)
|
|
249
310
|
}
|
|
250
311
|
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
+
|
|
312
|
+
return (
|
|
313
|
+
innerLocale.value.daysShort[date.getDay()] +
|
|
314
|
+
', ' +
|
|
315
|
+
innerLocale.value.monthsShort[model.month - 1] +
|
|
316
|
+
' ' +
|
|
317
|
+
model.day
|
|
318
|
+
)
|
|
254
319
|
})
|
|
255
320
|
|
|
256
321
|
const minSelectedModel = computed(() => {
|
|
257
|
-
const model = daysModel.value
|
|
322
|
+
const model = daysModel.value
|
|
323
|
+
.concat(rangeModel.value.map(range => range.from))
|
|
258
324
|
.sort((a, b) => a.year - b.year || a.month - b.month)
|
|
259
325
|
|
|
260
|
-
return model[
|
|
326
|
+
return model[0]
|
|
261
327
|
})
|
|
262
328
|
|
|
263
329
|
const maxSelectedModel = computed(() => {
|
|
264
|
-
const model = daysModel.value
|
|
330
|
+
const model = daysModel.value
|
|
331
|
+
.concat(rangeModel.value.map(range => range.to))
|
|
265
332
|
.sort((a, b) => b.year - a.year || b.month - a.month)
|
|
266
333
|
|
|
267
|
-
return model[
|
|
334
|
+
return model[0]
|
|
268
335
|
})
|
|
269
336
|
|
|
270
337
|
const headerSubtitle = computed(() => {
|
|
271
|
-
if (
|
|
338
|
+
if (
|
|
339
|
+
props.subtitle !== void 0 &&
|
|
340
|
+
props.subtitle !== null &&
|
|
341
|
+
props.subtitle.length !== 0
|
|
342
|
+
) {
|
|
272
343
|
return props.subtitle
|
|
273
344
|
}
|
|
274
345
|
|
|
@@ -281,34 +352,37 @@ export default createComponent({
|
|
|
281
352
|
const to = maxSelectedModel.value
|
|
282
353
|
const month = innerLocale.value.monthsShort
|
|
283
354
|
|
|
284
|
-
return
|
|
285
|
-
from.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
355
|
+
return (
|
|
356
|
+
month[from.month - 1] +
|
|
357
|
+
(from.year !== to.year
|
|
358
|
+
? ' ' + from.year + lineStr + month[to.month - 1] + ' '
|
|
359
|
+
: from.month !== to.month
|
|
360
|
+
? lineStr + month[to.month - 1]
|
|
361
|
+
: '') +
|
|
362
|
+
' ' +
|
|
363
|
+
to.year
|
|
364
|
+
)
|
|
293
365
|
}
|
|
294
366
|
|
|
295
|
-
return daysModel.value[
|
|
367
|
+
return daysModel.value[0].year
|
|
296
368
|
})
|
|
297
369
|
|
|
298
370
|
const dateArrow = computed(() => {
|
|
299
|
-
const val = [
|
|
371
|
+
const val = [
|
|
372
|
+
$q.iconSet.datetime.arrowLeft,
|
|
373
|
+
$q.iconSet.datetime.arrowRight
|
|
374
|
+
]
|
|
300
375
|
return $q.lang.rtl === true ? val.reverse() : val
|
|
301
376
|
})
|
|
302
377
|
|
|
303
|
-
const computedFirstDayOfWeek = computed(() =>
|
|
378
|
+
const computedFirstDayOfWeek = computed(() =>
|
|
304
379
|
props.firstDayOfWeek !== void 0
|
|
305
380
|
? Number(props.firstDayOfWeek)
|
|
306
381
|
: innerLocale.value.firstDayOfWeek
|
|
307
|
-
)
|
|
382
|
+
)
|
|
308
383
|
|
|
309
384
|
const daysOfWeek = computed(() => {
|
|
310
|
-
const
|
|
311
|
-
days = innerLocale.value.daysShort,
|
|
385
|
+
const days = innerLocale.value.daysShort,
|
|
312
386
|
first = computedFirstDayOfWeek.value
|
|
313
387
|
|
|
314
388
|
return first > 0
|
|
@@ -319,15 +393,15 @@ export default createComponent({
|
|
|
319
393
|
const daysInMonth = computed(() => {
|
|
320
394
|
const date = viewModel.value
|
|
321
395
|
return props.calendar !== 'persian'
|
|
322
|
-
?
|
|
396
|
+
? new Date(date.year, date.month, 0).getDate()
|
|
323
397
|
: jalaaliMonthLength(date.year, date.month)
|
|
324
398
|
})
|
|
325
399
|
|
|
326
|
-
const evtColor = computed(() =>
|
|
400
|
+
const evtColor = computed(() =>
|
|
327
401
|
typeof props.eventColor === 'function'
|
|
328
402
|
? props.eventColor
|
|
329
403
|
: () => props.eventColor
|
|
330
|
-
)
|
|
404
|
+
)
|
|
331
405
|
|
|
332
406
|
const minNav = computed(() => {
|
|
333
407
|
if (props.navigationMinYearMonth === void 0) {
|
|
@@ -335,7 +409,7 @@ export default createComponent({
|
|
|
335
409
|
}
|
|
336
410
|
|
|
337
411
|
const data = props.navigationMinYearMonth.split('/')
|
|
338
|
-
return { year: parseInt(data[
|
|
412
|
+
return { year: parseInt(data[0], 10), month: parseInt(data[1], 10) }
|
|
339
413
|
})
|
|
340
414
|
|
|
341
415
|
const maxNav = computed(() => {
|
|
@@ -344,7 +418,7 @@ export default createComponent({
|
|
|
344
418
|
}
|
|
345
419
|
|
|
346
420
|
const data = props.navigationMaxYearMonth.split('/')
|
|
347
|
-
return { year: parseInt(data[
|
|
421
|
+
return { year: parseInt(data[0], 10), month: parseInt(data[1], 10) }
|
|
348
422
|
})
|
|
349
423
|
|
|
350
424
|
const navBoundaries = computed(() => {
|
|
@@ -355,14 +429,20 @@ export default createComponent({
|
|
|
355
429
|
|
|
356
430
|
if (minNav.value !== null && minNav.value.year >= viewModel.value.year) {
|
|
357
431
|
data.year.prev = false
|
|
358
|
-
if (
|
|
432
|
+
if (
|
|
433
|
+
minNav.value.year === viewModel.value.year &&
|
|
434
|
+
minNav.value.month >= viewModel.value.month
|
|
435
|
+
) {
|
|
359
436
|
data.month.prev = false
|
|
360
437
|
}
|
|
361
438
|
}
|
|
362
439
|
|
|
363
440
|
if (maxNav.value !== null && maxNav.value.year <= viewModel.value.year) {
|
|
364
441
|
data.year.next = false
|
|
365
|
-
if (
|
|
442
|
+
if (
|
|
443
|
+
maxNav.value.year === viewModel.value.year &&
|
|
444
|
+
maxNav.value.month <= viewModel.value.month
|
|
445
|
+
) {
|
|
366
446
|
data.month.next = false
|
|
367
447
|
}
|
|
368
448
|
}
|
|
@@ -376,11 +456,11 @@ export default createComponent({
|
|
|
376
456
|
daysModel.value.forEach(entry => {
|
|
377
457
|
const hash = getMonthHash(entry)
|
|
378
458
|
|
|
379
|
-
if (map[
|
|
380
|
-
map[
|
|
459
|
+
if (map[hash] === void 0) {
|
|
460
|
+
map[hash] = []
|
|
381
461
|
}
|
|
382
462
|
|
|
383
|
-
map[
|
|
463
|
+
map[hash].push(entry.day)
|
|
384
464
|
})
|
|
385
465
|
|
|
386
466
|
return map
|
|
@@ -393,11 +473,11 @@ export default createComponent({
|
|
|
393
473
|
const hashFrom = getMonthHash(entry.from)
|
|
394
474
|
const hashTo = getMonthHash(entry.to)
|
|
395
475
|
|
|
396
|
-
if (map[
|
|
397
|
-
map[
|
|
476
|
+
if (map[hashFrom] === void 0) {
|
|
477
|
+
map[hashFrom] = []
|
|
398
478
|
}
|
|
399
479
|
|
|
400
|
-
map[
|
|
480
|
+
map[hashFrom].push({
|
|
401
481
|
from: entry.from.day,
|
|
402
482
|
to: hashFrom === hashTo ? entry.to.day : void 0,
|
|
403
483
|
range: entry
|
|
@@ -406,16 +486,17 @@ export default createComponent({
|
|
|
406
486
|
if (hashFrom < hashTo) {
|
|
407
487
|
let hash
|
|
408
488
|
const { year, month } = entry.from
|
|
409
|
-
const cur =
|
|
410
|
-
|
|
411
|
-
|
|
489
|
+
const cur =
|
|
490
|
+
month < 12
|
|
491
|
+
? { year, month: month + 1 }
|
|
492
|
+
: { year: year + 1, month: 1 }
|
|
412
493
|
|
|
413
494
|
while ((hash = getMonthHash(cur)) <= hashTo) {
|
|
414
|
-
if (map[
|
|
415
|
-
map[
|
|
495
|
+
if (map[hash] === void 0) {
|
|
496
|
+
map[hash] = []
|
|
416
497
|
}
|
|
417
498
|
|
|
418
|
-
map[
|
|
499
|
+
map[hash].push({
|
|
419
500
|
from: void 0,
|
|
420
501
|
to: hash === hashTo ? entry.to.day : void 0,
|
|
421
502
|
range: entry
|
|
@@ -438,37 +519,32 @@ export default createComponent({
|
|
|
438
519
|
|
|
439
520
|
const { init, initHash, final, finalHash } = editRange.value
|
|
440
521
|
|
|
441
|
-
const [
|
|
442
|
-
? [ init, final ]
|
|
443
|
-
: [ final, init ]
|
|
522
|
+
const [from, to] = initHash <= finalHash ? [init, final] : [final, init]
|
|
444
523
|
|
|
445
524
|
const fromHash = getMonthHash(from)
|
|
446
525
|
const toHash = getMonthHash(to)
|
|
447
526
|
|
|
448
|
-
if (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
) return
|
|
527
|
+
if (fromHash !== viewMonthHash.value && toHash !== viewMonthHash.value) {
|
|
528
|
+
return
|
|
529
|
+
}
|
|
452
530
|
|
|
453
|
-
const
|
|
531
|
+
const localView = {}
|
|
454
532
|
|
|
455
533
|
if (fromHash === viewMonthHash.value) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
view.from = 1
|
|
534
|
+
localView.from = from.day
|
|
535
|
+
localView.includeFrom = true
|
|
536
|
+
} else {
|
|
537
|
+
localView.from = 1
|
|
461
538
|
}
|
|
462
539
|
|
|
463
540
|
if (toHash === viewMonthHash.value) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
view.to = daysInMonth.value
|
|
541
|
+
localView.to = to.day
|
|
542
|
+
localView.includeTo = true
|
|
543
|
+
} else {
|
|
544
|
+
localView.to = daysInMonth.value
|
|
469
545
|
}
|
|
470
546
|
|
|
471
|
-
return
|
|
547
|
+
return localView
|
|
472
548
|
})
|
|
473
549
|
|
|
474
550
|
const viewMonthHash = computed(() => getMonthHash(viewModel.value))
|
|
@@ -478,19 +554,20 @@ export default createComponent({
|
|
|
478
554
|
|
|
479
555
|
if (props.options === void 0) {
|
|
480
556
|
for (let i = 1; i <= daysInMonth.value; i++) {
|
|
481
|
-
map[
|
|
557
|
+
map[i] = true
|
|
482
558
|
}
|
|
483
559
|
|
|
484
560
|
return map
|
|
485
561
|
}
|
|
486
562
|
|
|
487
|
-
const fn =
|
|
488
|
-
|
|
489
|
-
|
|
563
|
+
const fn =
|
|
564
|
+
typeof props.options === 'function'
|
|
565
|
+
? props.options
|
|
566
|
+
: date => props.options.includes(date)
|
|
490
567
|
|
|
491
568
|
for (let i = 1; i <= daysInMonth.value; i++) {
|
|
492
569
|
const dayHash = viewMonthHash.value + '/' + pad(i)
|
|
493
|
-
map[
|
|
570
|
+
map[i] = fn(dayHash)
|
|
494
571
|
}
|
|
495
572
|
|
|
496
573
|
return map
|
|
@@ -501,17 +578,17 @@ export default createComponent({
|
|
|
501
578
|
|
|
502
579
|
if (props.events === void 0) {
|
|
503
580
|
for (let i = 1; i <= daysInMonth.value; i++) {
|
|
504
|
-
map[
|
|
581
|
+
map[i] = false
|
|
505
582
|
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
583
|
+
} else {
|
|
584
|
+
const fn =
|
|
585
|
+
typeof props.events === 'function'
|
|
586
|
+
? props.events
|
|
587
|
+
: date => props.events.includes(date)
|
|
511
588
|
|
|
512
589
|
for (let i = 1; i <= daysInMonth.value; i++) {
|
|
513
590
|
const dayHash = viewMonthHash.value + '/' + pad(i)
|
|
514
|
-
map[
|
|
591
|
+
map[i] = fn(dayHash) === true && evtColor.value(dayHash)
|
|
515
592
|
}
|
|
516
593
|
}
|
|
517
594
|
|
|
@@ -524,9 +601,8 @@ export default createComponent({
|
|
|
524
601
|
|
|
525
602
|
if (props.calendar !== 'persian') {
|
|
526
603
|
date = new Date(year, month - 1, 1)
|
|
527
|
-
endDay =
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
604
|
+
endDay = new Date(year, month - 1, 0).getDate()
|
|
605
|
+
} else {
|
|
530
606
|
const gDate = toGregorian(year, month, 1)
|
|
531
607
|
date = new Date(gDate.gy, gDate.gm - 1, gDate.gd)
|
|
532
608
|
let prevJM = month - 1
|
|
@@ -546,9 +622,9 @@ export default createComponent({
|
|
|
546
622
|
|
|
547
623
|
const days = computed(() => {
|
|
548
624
|
const res = []
|
|
549
|
-
const { days, endDay } = viewDays.value
|
|
625
|
+
const { days: localDays, endDay } = viewDays.value
|
|
550
626
|
|
|
551
|
-
const len =
|
|
627
|
+
const len = localDays < 0 ? localDays + 7 : localDays
|
|
552
628
|
if (len < 6) {
|
|
553
629
|
for (let i = endDay - len; i <= endDay; i++) {
|
|
554
630
|
res.push({ i, fill: true })
|
|
@@ -558,9 +634,9 @@ export default createComponent({
|
|
|
558
634
|
const index = res.length
|
|
559
635
|
|
|
560
636
|
for (let i = 1; i <= daysInMonth.value; i++) {
|
|
561
|
-
const day = { i, event: eventDaysMap.value[
|
|
637
|
+
const day = { i, event: eventDaysMap.value[i], classes: [] }
|
|
562
638
|
|
|
563
|
-
if (selectionDaysMap.value[
|
|
639
|
+
if (selectionDaysMap.value[i] === true) {
|
|
564
640
|
day.in = true
|
|
565
641
|
day.flat = true
|
|
566
642
|
}
|
|
@@ -569,10 +645,10 @@ export default createComponent({
|
|
|
569
645
|
}
|
|
570
646
|
|
|
571
647
|
// if current view has days in model
|
|
572
|
-
if (daysMap.value[
|
|
573
|
-
daysMap.value[
|
|
648
|
+
if (daysMap.value[viewMonthHash.value] !== void 0) {
|
|
649
|
+
daysMap.value[viewMonthHash.value].forEach(day => {
|
|
574
650
|
const i = index + day - 1
|
|
575
|
-
Object.assign(res[
|
|
651
|
+
Object.assign(res[i], {
|
|
576
652
|
selected: true,
|
|
577
653
|
unelevated: true,
|
|
578
654
|
flat: false,
|
|
@@ -583,14 +659,14 @@ export default createComponent({
|
|
|
583
659
|
}
|
|
584
660
|
|
|
585
661
|
// if current view has ranges in model
|
|
586
|
-
if (rangeMap.value[
|
|
587
|
-
rangeMap.value[
|
|
662
|
+
if (rangeMap.value[viewMonthHash.value] !== void 0) {
|
|
663
|
+
rangeMap.value[viewMonthHash.value].forEach(entry => {
|
|
588
664
|
if (entry.from !== void 0) {
|
|
589
665
|
const from = index + entry.from - 1
|
|
590
666
|
const to = index + (entry.to || daysInMonth.value) - 1
|
|
591
667
|
|
|
592
668
|
for (let day = from; day <= to; day++) {
|
|
593
|
-
Object.assign(res[
|
|
669
|
+
Object.assign(res[day], {
|
|
594
670
|
range: entry.range,
|
|
595
671
|
unelevated: true,
|
|
596
672
|
color: computedColor.value,
|
|
@@ -598,21 +674,22 @@ export default createComponent({
|
|
|
598
674
|
})
|
|
599
675
|
}
|
|
600
676
|
|
|
601
|
-
Object.assign(res[
|
|
677
|
+
Object.assign(res[from], {
|
|
602
678
|
rangeFrom: true,
|
|
603
679
|
flat: false
|
|
604
680
|
})
|
|
605
681
|
|
|
606
|
-
entry.to !== void 0
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
682
|
+
if (entry.to !== void 0) {
|
|
683
|
+
Object.assign(res[to], {
|
|
684
|
+
rangeTo: true,
|
|
685
|
+
flat: false
|
|
686
|
+
})
|
|
687
|
+
}
|
|
688
|
+
} else if (entry.to !== void 0) {
|
|
612
689
|
const to = index + entry.to - 1
|
|
613
690
|
|
|
614
691
|
for (let day = index; day <= to; day++) {
|
|
615
|
-
Object.assign(res[
|
|
692
|
+
Object.assign(res[day], {
|
|
616
693
|
range: entry.range,
|
|
617
694
|
unelevated: true,
|
|
618
695
|
color: computedColor.value,
|
|
@@ -620,15 +697,14 @@ export default createComponent({
|
|
|
620
697
|
})
|
|
621
698
|
}
|
|
622
699
|
|
|
623
|
-
Object.assign(res[
|
|
700
|
+
Object.assign(res[to], {
|
|
624
701
|
flat: false,
|
|
625
702
|
rangeTo: true
|
|
626
703
|
})
|
|
627
|
-
}
|
|
628
|
-
else {
|
|
704
|
+
} else {
|
|
629
705
|
const to = index + daysInMonth.value - 1
|
|
630
706
|
for (let day = index; day <= to; day++) {
|
|
631
|
-
Object.assign(res[
|
|
707
|
+
Object.assign(res[day], {
|
|
632
708
|
range: entry.range,
|
|
633
709
|
unelevated: true,
|
|
634
710
|
color: computedColor.value,
|
|
@@ -644,20 +720,23 @@ export default createComponent({
|
|
|
644
720
|
const to = index + rangeView.value.to - 1
|
|
645
721
|
|
|
646
722
|
for (let day = from; day <= to; day++) {
|
|
647
|
-
res[
|
|
648
|
-
res[
|
|
723
|
+
res[day].color = computedColor.value
|
|
724
|
+
res[day].editRange = true
|
|
649
725
|
}
|
|
650
726
|
|
|
651
727
|
if (rangeView.value.includeFrom === true) {
|
|
652
|
-
res[
|
|
728
|
+
res[from].editRangeFrom = true
|
|
653
729
|
}
|
|
654
730
|
if (rangeView.value.includeTo === true) {
|
|
655
|
-
res[
|
|
731
|
+
res[to].editRangeTo = true
|
|
656
732
|
}
|
|
657
733
|
}
|
|
658
734
|
|
|
659
|
-
if (
|
|
660
|
-
|
|
735
|
+
if (
|
|
736
|
+
viewModel.value.year === today.value.year &&
|
|
737
|
+
viewModel.value.month === today.value.month
|
|
738
|
+
) {
|
|
739
|
+
res[index + today.value.day - 1].today = true
|
|
661
740
|
}
|
|
662
741
|
|
|
663
742
|
const left = res.length % 7
|
|
@@ -673,20 +752,19 @@ export default createComponent({
|
|
|
673
752
|
|
|
674
753
|
if (day.fill === true) {
|
|
675
754
|
cls += 'q-date__calendar-item--fill'
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
cls += `q-date__calendar-item--${ day.in === true ? 'in' : 'out' }`
|
|
755
|
+
} else {
|
|
756
|
+
cls += `q-date__calendar-item--${day.in === true ? 'in' : 'out'}`
|
|
679
757
|
|
|
680
758
|
if (day.range !== void 0) {
|
|
681
|
-
cls += ` q-date__range${
|
|
759
|
+
cls += ` q-date__range${day.rangeTo === true ? '-to' : day.rangeFrom === true ? '-from' : ''}`
|
|
682
760
|
}
|
|
683
761
|
|
|
684
762
|
if (day.editRange === true) {
|
|
685
|
-
cls += ` q-date__edit-range${
|
|
763
|
+
cls += ` q-date__edit-range${day.editRangeFrom === true ? '-from' : ''}${day.editRangeTo === true ? '-to' : ''}`
|
|
686
764
|
}
|
|
687
765
|
|
|
688
766
|
if (day.range !== void 0 || day.editRange === true) {
|
|
689
|
-
cls += ` text-${
|
|
767
|
+
cls += ` text-${day.color}`
|
|
690
768
|
}
|
|
691
769
|
}
|
|
692
770
|
|
|
@@ -696,31 +774,40 @@ export default createComponent({
|
|
|
696
774
|
return res
|
|
697
775
|
})
|
|
698
776
|
|
|
699
|
-
const attributes = computed(() =>
|
|
700
|
-
props.disable === true
|
|
701
|
-
|
|
702
|
-
: {}
|
|
703
|
-
))
|
|
777
|
+
const attributes = computed(() =>
|
|
778
|
+
props.disable === true ? { 'aria-disabled': 'true' } : {}
|
|
779
|
+
)
|
|
704
780
|
|
|
705
|
-
watch(
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
781
|
+
watch(
|
|
782
|
+
() => props.modelValue,
|
|
783
|
+
v => {
|
|
784
|
+
if (lastEmitValue === JSON.stringify(v)) {
|
|
785
|
+
lastEmitValue = 0
|
|
786
|
+
} else {
|
|
787
|
+
const model = getViewModel(innerMask.value, innerLocale.value)
|
|
788
|
+
updateViewModel(model.year, model.month, model)
|
|
789
|
+
}
|
|
712
790
|
}
|
|
713
|
-
|
|
791
|
+
)
|
|
714
792
|
|
|
715
793
|
watch(view, () => {
|
|
716
|
-
if (
|
|
794
|
+
if (
|
|
795
|
+
blurTargetRef.value !== null &&
|
|
796
|
+
proxy.$el.contains(document.activeElement) === true
|
|
797
|
+
) {
|
|
717
798
|
blurTargetRef.value.focus()
|
|
718
799
|
}
|
|
719
800
|
})
|
|
720
801
|
|
|
721
|
-
watch(
|
|
722
|
-
|
|
723
|
-
|
|
802
|
+
watch(
|
|
803
|
+
() => viewModel.value.year + '|' + viewModel.value.month,
|
|
804
|
+
() => {
|
|
805
|
+
emit('navigation', {
|
|
806
|
+
year: viewModel.value.year,
|
|
807
|
+
month: viewModel.value.month
|
|
808
|
+
})
|
|
809
|
+
}
|
|
810
|
+
)
|
|
724
811
|
|
|
725
812
|
watch(mask, val => {
|
|
726
813
|
updateValue(val, innerLocale.value, 'mask')
|
|
@@ -732,11 +819,11 @@ export default createComponent({
|
|
|
732
819
|
innerLocale.value = val
|
|
733
820
|
})
|
|
734
821
|
|
|
735
|
-
function setLastValue
|
|
822
|
+
function setLastValue(v) {
|
|
736
823
|
lastEmitValue = JSON.stringify(v)
|
|
737
824
|
}
|
|
738
825
|
|
|
739
|
-
function setToday
|
|
826
|
+
function setToday() {
|
|
740
827
|
const { year, month, day } = today.value
|
|
741
828
|
|
|
742
829
|
const date = {
|
|
@@ -750,7 +837,7 @@ export default createComponent({
|
|
|
750
837
|
day
|
|
751
838
|
}
|
|
752
839
|
|
|
753
|
-
const monthMap = daysMap.value[
|
|
840
|
+
const monthMap = daysMap.value[getMonthHash(date)]
|
|
754
841
|
|
|
755
842
|
if (monthMap === void 0 || monthMap.includes(date.day) === false) {
|
|
756
843
|
addToModel(date)
|
|
@@ -759,34 +846,33 @@ export default createComponent({
|
|
|
759
846
|
setCalendarTo(date.year, date.month)
|
|
760
847
|
}
|
|
761
848
|
|
|
762
|
-
function setView
|
|
849
|
+
function setView(viewMode) {
|
|
763
850
|
if (viewIsValid(viewMode) === true) {
|
|
764
851
|
view.value = viewMode
|
|
765
852
|
}
|
|
766
853
|
}
|
|
767
854
|
|
|
768
|
-
function offsetCalendar
|
|
769
|
-
if ([
|
|
855
|
+
function offsetCalendar(type, descending) {
|
|
856
|
+
if (['month', 'year'].includes(type)) {
|
|
770
857
|
const fn = type === 'month' ? goToMonth : goToYear
|
|
771
858
|
fn(descending === true ? -1 : 1)
|
|
772
859
|
}
|
|
773
860
|
}
|
|
774
861
|
|
|
775
|
-
function setCalendarTo
|
|
862
|
+
function setCalendarTo(year, month) {
|
|
776
863
|
view.value = 'Calendar'
|
|
777
864
|
updateViewModel(year, month)
|
|
778
865
|
}
|
|
779
866
|
|
|
780
|
-
function setEditingRange
|
|
867
|
+
function setEditingRange(from, to) {
|
|
781
868
|
if (props.range === false || !from) {
|
|
782
869
|
editRange.value = null
|
|
783
870
|
return
|
|
784
871
|
}
|
|
785
872
|
|
|
786
873
|
const init = Object.assign({ ...viewModel.value }, from)
|
|
787
|
-
const final =
|
|
788
|
-
? Object.assign({ ...viewModel.value }, to)
|
|
789
|
-
: init
|
|
874
|
+
const final =
|
|
875
|
+
to !== void 0 ? Object.assign({ ...viewModel.value }, to) : init
|
|
790
876
|
|
|
791
877
|
editRange.value = {
|
|
792
878
|
init,
|
|
@@ -798,60 +884,52 @@ export default createComponent({
|
|
|
798
884
|
setCalendarTo(init.year, init.month)
|
|
799
885
|
}
|
|
800
886
|
|
|
801
|
-
function getMask
|
|
887
|
+
function getMask() {
|
|
802
888
|
return props.calendar === 'persian' ? 'YYYY/MM/DD' : props.mask
|
|
803
889
|
}
|
|
804
890
|
|
|
805
|
-
function decodeString
|
|
806
|
-
return __splitDate(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
hour: 0,
|
|
813
|
-
minute: 0,
|
|
814
|
-
second: 0,
|
|
815
|
-
millisecond: 0
|
|
816
|
-
}
|
|
817
|
-
)
|
|
891
|
+
function decodeString(date, dateMask, dateLocale) {
|
|
892
|
+
return __splitDate(date, dateMask, dateLocale, props.calendar, {
|
|
893
|
+
hour: 0,
|
|
894
|
+
minute: 0,
|
|
895
|
+
second: 0,
|
|
896
|
+
millisecond: 0
|
|
897
|
+
})
|
|
818
898
|
}
|
|
819
899
|
|
|
820
|
-
function getViewModel
|
|
821
|
-
const model =
|
|
822
|
-
|
|
823
|
-
|
|
900
|
+
function getViewModel(dateMask, dateLocale) {
|
|
901
|
+
const model =
|
|
902
|
+
Array.isArray(props.modelValue) === true
|
|
903
|
+
? props.modelValue
|
|
904
|
+
: props.modelValue
|
|
905
|
+
? [props.modelValue]
|
|
906
|
+
: []
|
|
824
907
|
|
|
825
908
|
if (model.length === 0) {
|
|
826
909
|
return getDefaultViewModel()
|
|
827
910
|
}
|
|
828
911
|
|
|
829
|
-
const target = model[
|
|
912
|
+
const target = model[model.length - 1]
|
|
830
913
|
const decoded = decodeString(
|
|
831
914
|
target.from !== void 0 ? target.from : target,
|
|
832
|
-
|
|
833
|
-
|
|
915
|
+
dateMask,
|
|
916
|
+
dateLocale
|
|
834
917
|
)
|
|
835
918
|
|
|
836
|
-
return decoded.dateHash === null
|
|
837
|
-
? getDefaultViewModel()
|
|
838
|
-
: decoded
|
|
919
|
+
return decoded.dateHash === null ? getDefaultViewModel() : decoded
|
|
839
920
|
}
|
|
840
921
|
|
|
841
|
-
function getDefaultViewModel
|
|
922
|
+
function getDefaultViewModel() {
|
|
842
923
|
let year, month
|
|
843
924
|
|
|
844
925
|
if (props.defaultYearMonth !== void 0) {
|
|
845
926
|
const d = props.defaultYearMonth.split('/')
|
|
846
|
-
year = parseInt(d[
|
|
847
|
-
month = parseInt(d[
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
927
|
+
year = parseInt(d[0], 10)
|
|
928
|
+
month = parseInt(d[1], 10)
|
|
929
|
+
} else {
|
|
850
930
|
// may come from data() where computed
|
|
851
931
|
// props are not yet available
|
|
852
|
-
const d = today.value !== void 0
|
|
853
|
-
? today.value
|
|
854
|
-
: getCurrentDate()
|
|
932
|
+
const d = today.value !== void 0 ? today.value : getCurrentDate()
|
|
855
933
|
|
|
856
934
|
year = d.year
|
|
857
935
|
month = d.month
|
|
@@ -869,55 +947,53 @@ export default createComponent({
|
|
|
869
947
|
}
|
|
870
948
|
}
|
|
871
949
|
|
|
872
|
-
function goToMonth
|
|
950
|
+
function goToMonth(offset) {
|
|
873
951
|
let year = viewModel.value.year
|
|
874
952
|
let month = Number(viewModel.value.month) + offset
|
|
875
953
|
|
|
876
954
|
if (month === 13) {
|
|
877
955
|
month = 1
|
|
878
956
|
year++
|
|
879
|
-
}
|
|
880
|
-
else if (month === 0) {
|
|
957
|
+
} else if (month === 0) {
|
|
881
958
|
month = 12
|
|
882
959
|
year--
|
|
883
960
|
}
|
|
884
961
|
|
|
885
962
|
updateViewModel(year, month)
|
|
886
|
-
isImmediate.value === true
|
|
963
|
+
if (isImmediate.value === true) emitImmediately('month')
|
|
887
964
|
}
|
|
888
965
|
|
|
889
|
-
function goToYear
|
|
966
|
+
function goToYear(offset) {
|
|
890
967
|
const year = Number(viewModel.value.year) + offset
|
|
891
968
|
updateViewModel(year, viewModel.value.month)
|
|
892
|
-
isImmediate.value === true
|
|
969
|
+
if (isImmediate.value === true) emitImmediately('year')
|
|
893
970
|
}
|
|
894
971
|
|
|
895
|
-
function setYear
|
|
972
|
+
function setYear(year) {
|
|
896
973
|
updateViewModel(year, viewModel.value.month)
|
|
897
974
|
view.value = props.defaultView === 'Years' ? 'Months' : 'Calendar'
|
|
898
|
-
isImmediate.value === true
|
|
975
|
+
if (isImmediate.value === true) emitImmediately('year')
|
|
899
976
|
}
|
|
900
977
|
|
|
901
|
-
function setMonth
|
|
978
|
+
function setMonth(month) {
|
|
902
979
|
updateViewModel(viewModel.value.year, month)
|
|
903
980
|
view.value = 'Calendar'
|
|
904
|
-
isImmediate.value === true
|
|
981
|
+
if (isImmediate.value === true) emitImmediately('month')
|
|
905
982
|
}
|
|
906
983
|
|
|
907
|
-
function toggleDate
|
|
908
|
-
const month = daysMap.value[
|
|
909
|
-
const fn =
|
|
910
|
-
? removeFromModel
|
|
911
|
-
: addToModel
|
|
984
|
+
function toggleDate(date, monthHash) {
|
|
985
|
+
const month = daysMap.value[monthHash]
|
|
986
|
+
const fn =
|
|
987
|
+
month?.includes(date.day) === true ? removeFromModel : addToModel
|
|
912
988
|
|
|
913
989
|
fn(date)
|
|
914
990
|
}
|
|
915
991
|
|
|
916
|
-
function getShortDate
|
|
992
|
+
function getShortDate(date) {
|
|
917
993
|
return { year: date.year, month: date.month, day: date.day }
|
|
918
994
|
}
|
|
919
995
|
|
|
920
|
-
function updateViewModel
|
|
996
|
+
function updateViewModel(year, month, time) {
|
|
921
997
|
if (minNav.value !== null && year <= minNav.value.year) {
|
|
922
998
|
if (month < minNav.value.month || year < minNav.value.year) {
|
|
923
999
|
month = minNav.value.month
|
|
@@ -933,20 +1009,32 @@ export default createComponent({
|
|
|
933
1009
|
}
|
|
934
1010
|
|
|
935
1011
|
if (time !== void 0) {
|
|
936
|
-
const { hour, minute, second, millisecond, timezoneOffset, timeHash } =
|
|
937
|
-
|
|
1012
|
+
const { hour, minute, second, millisecond, timezoneOffset, timeHash } =
|
|
1013
|
+
time
|
|
1014
|
+
Object.assign(viewModel.value, {
|
|
1015
|
+
hour,
|
|
1016
|
+
minute,
|
|
1017
|
+
second,
|
|
1018
|
+
millisecond,
|
|
1019
|
+
timezoneOffset,
|
|
1020
|
+
timeHash
|
|
1021
|
+
})
|
|
938
1022
|
}
|
|
939
1023
|
|
|
940
1024
|
const newHash = year + '/' + pad(month) + '/01'
|
|
941
1025
|
|
|
942
1026
|
if (newHash !== viewModel.value.dateHash) {
|
|
943
|
-
monthDirection.value =
|
|
1027
|
+
monthDirection.value =
|
|
1028
|
+
viewModel.value.dateHash < newHash === ($q.lang.rtl !== true)
|
|
1029
|
+
? 'left'
|
|
1030
|
+
: 'right'
|
|
944
1031
|
if (year !== viewModel.value.year) {
|
|
945
1032
|
yearDirection.value = monthDirection.value
|
|
946
1033
|
}
|
|
947
1034
|
|
|
948
1035
|
nextTick(() => {
|
|
949
|
-
startYear.value =
|
|
1036
|
+
startYear.value =
|
|
1037
|
+
year - (year % yearsInterval) - (year < 0 ? yearsInterval : 0)
|
|
950
1038
|
Object.assign(viewModel.value, {
|
|
951
1039
|
year,
|
|
952
1040
|
month,
|
|
@@ -957,10 +1045,11 @@ export default createComponent({
|
|
|
957
1045
|
}
|
|
958
1046
|
}
|
|
959
1047
|
|
|
960
|
-
function emitValue
|
|
961
|
-
const value =
|
|
962
|
-
|
|
963
|
-
|
|
1048
|
+
function emitValue(val, action, date) {
|
|
1049
|
+
const value =
|
|
1050
|
+
val !== null && val.length === 1 && props.multiple === false
|
|
1051
|
+
? val[0]
|
|
1052
|
+
: val
|
|
964
1053
|
|
|
965
1054
|
const { reason, details } = getEmitParams(action, date)
|
|
966
1055
|
|
|
@@ -968,19 +1057,21 @@ export default createComponent({
|
|
|
968
1057
|
emit('update:modelValue', value, reason, details)
|
|
969
1058
|
}
|
|
970
1059
|
|
|
971
|
-
function emitImmediately
|
|
972
|
-
const date =
|
|
973
|
-
|
|
974
|
-
|
|
1060
|
+
function emitImmediately(reason) {
|
|
1061
|
+
const date =
|
|
1062
|
+
daysModel.value[0] !== void 0 && daysModel.value[0].dateHash !== null
|
|
1063
|
+
? { ...daysModel.value[0] }
|
|
1064
|
+
: { ...viewModel.value } // inherit day, hours, minutes, milliseconds...
|
|
975
1065
|
|
|
976
1066
|
// nextTick required because of animation delay in viewModel
|
|
977
1067
|
nextTick(() => {
|
|
978
1068
|
date.year = viewModel.value.year
|
|
979
1069
|
date.month = viewModel.value.month
|
|
980
1070
|
|
|
981
|
-
const maxDay =
|
|
982
|
-
|
|
983
|
-
|
|
1071
|
+
const maxDay =
|
|
1072
|
+
props.calendar !== 'persian'
|
|
1073
|
+
? new Date(date.year, date.month, 0).getDate()
|
|
1074
|
+
: jalaaliMonthLength(date.year, date.month)
|
|
984
1075
|
|
|
985
1076
|
date.day = Math.min(Math.max(1, date.day), maxDay)
|
|
986
1077
|
|
|
@@ -992,10 +1083,10 @@ export default createComponent({
|
|
|
992
1083
|
})
|
|
993
1084
|
}
|
|
994
1085
|
|
|
995
|
-
function getEmitParams
|
|
1086
|
+
function getEmitParams(action, date) {
|
|
996
1087
|
return date.from !== void 0
|
|
997
1088
|
? {
|
|
998
|
-
reason: `${
|
|
1089
|
+
reason: `${action}-range`,
|
|
999
1090
|
details: {
|
|
1000
1091
|
...getShortDate(date.target),
|
|
1001
1092
|
from: getShortDate(date.from),
|
|
@@ -1003,18 +1094,21 @@ export default createComponent({
|
|
|
1003
1094
|
}
|
|
1004
1095
|
}
|
|
1005
1096
|
: {
|
|
1006
|
-
reason: `${
|
|
1097
|
+
reason: `${action}-day`,
|
|
1007
1098
|
details: getShortDate(date)
|
|
1008
1099
|
}
|
|
1009
1100
|
}
|
|
1010
1101
|
|
|
1011
|
-
function encodeEntry
|
|
1102
|
+
function encodeEntry(date, dateMask, dateLocale) {
|
|
1012
1103
|
return date.from !== void 0
|
|
1013
|
-
? {
|
|
1014
|
-
|
|
1104
|
+
? {
|
|
1105
|
+
from: encodeObjectFn.value(date.from, dateMask, dateLocale),
|
|
1106
|
+
to: encodeObjectFn.value(date.to, dateMask, dateLocale)
|
|
1107
|
+
}
|
|
1108
|
+
: encodeObjectFn.value(date, dateMask, dateLocale)
|
|
1015
1109
|
}
|
|
1016
1110
|
|
|
1017
|
-
function addToModel
|
|
1111
|
+
function addToModel(date) {
|
|
1018
1112
|
let value
|
|
1019
1113
|
|
|
1020
1114
|
if (props.multiple === true) {
|
|
@@ -1024,28 +1118,31 @@ export default createComponent({
|
|
|
1024
1118
|
const fromHash = getDayHash(date.from)
|
|
1025
1119
|
const toHash = getDayHash(date.to)
|
|
1026
1120
|
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1121
|
+
const localDays = daysModel.value.filter(
|
|
1122
|
+
day => day.dateHash < fromHash || day.dateHash > toHash
|
|
1123
|
+
)
|
|
1029
1124
|
|
|
1030
|
-
const ranges = rangeModel.value
|
|
1031
|
-
|
|
1125
|
+
const ranges = rangeModel.value.filter(
|
|
1126
|
+
({ from, to }) => to.dateHash < fromHash || from.dateHash > toHash
|
|
1127
|
+
)
|
|
1032
1128
|
|
|
1033
|
-
value =
|
|
1034
|
-
|
|
1035
|
-
|
|
1129
|
+
value = localDays
|
|
1130
|
+
.concat(ranges)
|
|
1131
|
+
.concat(date)
|
|
1132
|
+
.map(entry => encodeEntry(entry))
|
|
1133
|
+
} else {
|
|
1036
1134
|
const model = normalizedModel.value.slice()
|
|
1037
1135
|
model.push(encodeEntry(date))
|
|
1038
1136
|
value = model
|
|
1039
1137
|
}
|
|
1040
|
-
}
|
|
1041
|
-
else {
|
|
1138
|
+
} else {
|
|
1042
1139
|
value = encodeEntry(date)
|
|
1043
1140
|
}
|
|
1044
1141
|
|
|
1045
1142
|
emitValue(value, 'add', date)
|
|
1046
1143
|
}
|
|
1047
1144
|
|
|
1048
|
-
function removeFromModel
|
|
1145
|
+
function removeFromModel(date) {
|
|
1049
1146
|
if (props.noUnset === true) return
|
|
1050
1147
|
|
|
1051
1148
|
let model = null
|
|
@@ -1054,16 +1151,13 @@ export default createComponent({
|
|
|
1054
1151
|
const val = encodeEntry(date)
|
|
1055
1152
|
|
|
1056
1153
|
if (date.from !== void 0) {
|
|
1057
|
-
model = props.modelValue.filter(
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
: true
|
|
1062
|
-
)
|
|
1154
|
+
model = props.modelValue.filter(item =>
|
|
1155
|
+
item.from !== void 0
|
|
1156
|
+
? item.from !== val.from && item.to !== val.to
|
|
1157
|
+
: true
|
|
1063
1158
|
)
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
model = props.modelValue.filter(date => date !== val)
|
|
1159
|
+
} else {
|
|
1160
|
+
model = props.modelValue.filter(item => item !== val)
|
|
1067
1161
|
}
|
|
1068
1162
|
|
|
1069
1163
|
if (model.length === 0) {
|
|
@@ -1074,324 +1168,500 @@ export default createComponent({
|
|
|
1074
1168
|
emitValue(model, 'remove', date)
|
|
1075
1169
|
}
|
|
1076
1170
|
|
|
1077
|
-
function updateValue
|
|
1171
|
+
function updateValue(dateMask, dateLocale, reason) {
|
|
1078
1172
|
const model = daysModel.value
|
|
1079
1173
|
.concat(rangeModel.value)
|
|
1080
|
-
.map(entry => encodeEntry(entry,
|
|
1081
|
-
.filter(entry =>
|
|
1082
|
-
|
|
1174
|
+
.map(entry => encodeEntry(entry, dateMask, dateLocale))
|
|
1175
|
+
.filter(entry =>
|
|
1176
|
+
entry.from !== void 0
|
|
1083
1177
|
? entry.from.dateHash !== null && entry.to.dateHash !== null
|
|
1084
1178
|
: entry.dateHash !== null
|
|
1085
|
-
|
|
1179
|
+
)
|
|
1086
1180
|
|
|
1087
|
-
const value = (props.multiple === true ? model : model[
|
|
1181
|
+
const value = (props.multiple === true ? model : model[0]) || null
|
|
1088
1182
|
|
|
1089
1183
|
setLastValue(value)
|
|
1090
1184
|
emit('update:modelValue', value, reason)
|
|
1091
1185
|
}
|
|
1092
1186
|
|
|
1093
|
-
function getHeader
|
|
1187
|
+
function getHeader() {
|
|
1094
1188
|
if (props.minimal === true) return
|
|
1095
1189
|
|
|
1096
|
-
return h(
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
h(
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1190
|
+
return h(
|
|
1191
|
+
'div',
|
|
1192
|
+
{
|
|
1193
|
+
class: 'q-date__header ' + headerClass.value
|
|
1194
|
+
},
|
|
1195
|
+
[
|
|
1196
|
+
h(
|
|
1197
|
+
'div',
|
|
1198
|
+
{
|
|
1199
|
+
class: 'relative-position'
|
|
1200
|
+
},
|
|
1201
|
+
[
|
|
1202
|
+
h(
|
|
1203
|
+
Transition,
|
|
1204
|
+
{
|
|
1205
|
+
name: 'q-transition--fade'
|
|
1206
|
+
},
|
|
1207
|
+
() =>
|
|
1208
|
+
h(
|
|
1209
|
+
'div',
|
|
1210
|
+
{
|
|
1211
|
+
key: 'h-yr-' + headerSubtitle.value,
|
|
1212
|
+
class:
|
|
1213
|
+
'q-date__header-subtitle q-date__header-link ' +
|
|
1214
|
+
(view.value === 'Years'
|
|
1215
|
+
? 'q-date__header-link--active'
|
|
1216
|
+
: 'cursor-pointer'),
|
|
1217
|
+
tabindex: tabindex.value,
|
|
1218
|
+
...getCache('vY', {
|
|
1219
|
+
onClick() {
|
|
1220
|
+
view.value = 'Years'
|
|
1221
|
+
},
|
|
1222
|
+
onKeyup(e) {
|
|
1223
|
+
if (e.keyCode === 13) {
|
|
1224
|
+
view.value = 'Years'
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
})
|
|
1228
|
+
},
|
|
1229
|
+
[headerSubtitle.value]
|
|
1230
|
+
)
|
|
1231
|
+
)
|
|
1232
|
+
]
|
|
1233
|
+
),
|
|
1234
|
+
|
|
1235
|
+
h(
|
|
1236
|
+
'div',
|
|
1237
|
+
{
|
|
1238
|
+
class: 'q-date__header-title relative-position flex no-wrap'
|
|
1239
|
+
},
|
|
1240
|
+
[
|
|
1241
|
+
h(
|
|
1242
|
+
'div',
|
|
1243
|
+
{
|
|
1244
|
+
class: 'relative-position col'
|
|
1245
|
+
},
|
|
1246
|
+
[
|
|
1247
|
+
h(
|
|
1248
|
+
Transition,
|
|
1249
|
+
{
|
|
1250
|
+
name: 'q-transition--fade'
|
|
1251
|
+
},
|
|
1252
|
+
() =>
|
|
1253
|
+
h(
|
|
1254
|
+
'div',
|
|
1255
|
+
{
|
|
1256
|
+
key: 'h-sub' + headerTitle.value,
|
|
1257
|
+
class:
|
|
1258
|
+
'q-date__header-title-label q-date__header-link ' +
|
|
1259
|
+
(view.value === 'Calendar'
|
|
1260
|
+
? 'q-date__header-link--active'
|
|
1261
|
+
: 'cursor-pointer'),
|
|
1262
|
+
tabindex: tabindex.value,
|
|
1263
|
+
...getCache('vC', {
|
|
1264
|
+
onClick() {
|
|
1265
|
+
view.value = 'Calendar'
|
|
1266
|
+
},
|
|
1267
|
+
onKeyup(e) {
|
|
1268
|
+
if (e.keyCode === 13) {
|
|
1269
|
+
view.value = 'Calendar'
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
})
|
|
1273
|
+
},
|
|
1274
|
+
[headerTitle.value]
|
|
1275
|
+
)
|
|
1276
|
+
)
|
|
1277
|
+
]
|
|
1278
|
+
),
|
|
1279
|
+
|
|
1280
|
+
props.todayBtn === true
|
|
1281
|
+
? h(QBtn, {
|
|
1282
|
+
class: 'q-date__header-today self-start',
|
|
1283
|
+
icon: $q.iconSet.datetime.today,
|
|
1284
|
+
'aria-label': $q.lang.date.today,
|
|
1285
|
+
flat: true,
|
|
1286
|
+
size: 'sm',
|
|
1287
|
+
round: true,
|
|
1288
|
+
tabindex: tabindex.value,
|
|
1289
|
+
onClick: setToday
|
|
1290
|
+
})
|
|
1291
|
+
: null
|
|
1292
|
+
]
|
|
1293
|
+
)
|
|
1294
|
+
]
|
|
1295
|
+
)
|
|
1148
1296
|
}
|
|
1149
1297
|
|
|
1150
|
-
function getNavigation
|
|
1298
|
+
function getNavigation({ label, type, key, dir, goTo, boundaries, cls }) {
|
|
1151
1299
|
return [
|
|
1152
|
-
h(
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
size: 'sm',
|
|
1159
|
-
flat: true,
|
|
1160
|
-
icon: dateArrow.value[ 0 ],
|
|
1161
|
-
'aria-label': type === 'Years' ? $q.lang.date.prevYear : $q.lang.date.prevMonth,
|
|
1162
|
-
tabindex: tabindex.value,
|
|
1163
|
-
disable: boundaries.prev === false,
|
|
1164
|
-
...getCache('go-#' + type, { onClick () { goTo(-1) } })
|
|
1165
|
-
})
|
|
1166
|
-
]),
|
|
1167
|
-
|
|
1168
|
-
h('div', {
|
|
1169
|
-
class: 'relative-position overflow-hidden flex flex-center' + cls
|
|
1170
|
-
}, [
|
|
1171
|
-
h(Transition, {
|
|
1172
|
-
name: 'q-transition--jump-' + dir
|
|
1173
|
-
}, () => h('div', { key }, [
|
|
1300
|
+
h(
|
|
1301
|
+
'div',
|
|
1302
|
+
{
|
|
1303
|
+
class: 'row items-center q-date__arrow'
|
|
1304
|
+
},
|
|
1305
|
+
[
|
|
1174
1306
|
h(QBtn, {
|
|
1307
|
+
round: true,
|
|
1308
|
+
dense: true,
|
|
1309
|
+
size: 'sm',
|
|
1175
1310
|
flat: true,
|
|
1311
|
+
icon: dateArrow.value[0],
|
|
1312
|
+
'aria-label':
|
|
1313
|
+
type === 'Years'
|
|
1314
|
+
? $q.lang.date.prevYear
|
|
1315
|
+
: $q.lang.date.prevMonth,
|
|
1316
|
+
tabindex: tabindex.value,
|
|
1317
|
+
disable: boundaries.prev === false,
|
|
1318
|
+
...getCache('go-#' + type, {
|
|
1319
|
+
onClick() {
|
|
1320
|
+
goTo(-1)
|
|
1321
|
+
}
|
|
1322
|
+
})
|
|
1323
|
+
})
|
|
1324
|
+
]
|
|
1325
|
+
),
|
|
1326
|
+
|
|
1327
|
+
h(
|
|
1328
|
+
'div',
|
|
1329
|
+
{
|
|
1330
|
+
class: 'relative-position overflow-hidden flex flex-center' + cls
|
|
1331
|
+
},
|
|
1332
|
+
[
|
|
1333
|
+
h(
|
|
1334
|
+
Transition,
|
|
1335
|
+
{
|
|
1336
|
+
name: 'q-transition--jump-' + dir
|
|
1337
|
+
},
|
|
1338
|
+
() =>
|
|
1339
|
+
h('div', { key }, [
|
|
1340
|
+
h(QBtn, {
|
|
1341
|
+
flat: true,
|
|
1342
|
+
dense: true,
|
|
1343
|
+
noCaps: true,
|
|
1344
|
+
label,
|
|
1345
|
+
tabindex: tabindex.value,
|
|
1346
|
+
...getCache('view#' + type, {
|
|
1347
|
+
onClick: () => {
|
|
1348
|
+
view.value = type
|
|
1349
|
+
}
|
|
1350
|
+
})
|
|
1351
|
+
})
|
|
1352
|
+
])
|
|
1353
|
+
)
|
|
1354
|
+
]
|
|
1355
|
+
),
|
|
1356
|
+
|
|
1357
|
+
h(
|
|
1358
|
+
'div',
|
|
1359
|
+
{
|
|
1360
|
+
class: 'row items-center q-date__arrow'
|
|
1361
|
+
},
|
|
1362
|
+
[
|
|
1363
|
+
h(QBtn, {
|
|
1364
|
+
round: true,
|
|
1176
1365
|
dense: true,
|
|
1177
|
-
|
|
1178
|
-
|
|
1366
|
+
size: 'sm',
|
|
1367
|
+
flat: true,
|
|
1368
|
+
icon: dateArrow.value[1],
|
|
1369
|
+
'aria-label':
|
|
1370
|
+
type === 'Years'
|
|
1371
|
+
? $q.lang.date.nextYear
|
|
1372
|
+
: $q.lang.date.nextMonth,
|
|
1179
1373
|
tabindex: tabindex.value,
|
|
1180
|
-
|
|
1374
|
+
disable: boundaries.next === false,
|
|
1375
|
+
...getCache('go+#' + type, {
|
|
1376
|
+
onClick() {
|
|
1377
|
+
goTo(1)
|
|
1378
|
+
}
|
|
1379
|
+
})
|
|
1181
1380
|
})
|
|
1182
|
-
]
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
h('div', {
|
|
1186
|
-
class: 'row items-center q-date__arrow'
|
|
1187
|
-
}, [
|
|
1188
|
-
h(QBtn, {
|
|
1189
|
-
round: true,
|
|
1190
|
-
dense: true,
|
|
1191
|
-
size: 'sm',
|
|
1192
|
-
flat: true,
|
|
1193
|
-
icon: dateArrow.value[ 1 ],
|
|
1194
|
-
'aria-label': type === 'Years' ? $q.lang.date.nextYear : $q.lang.date.nextMonth,
|
|
1195
|
-
tabindex: tabindex.value,
|
|
1196
|
-
disable: boundaries.next === false,
|
|
1197
|
-
...getCache('go+#' + type, { onClick () { goTo(1) } })
|
|
1198
|
-
})
|
|
1199
|
-
])
|
|
1381
|
+
]
|
|
1382
|
+
)
|
|
1200
1383
|
]
|
|
1201
1384
|
}
|
|
1202
1385
|
|
|
1203
1386
|
const renderViews = {
|
|
1204
|
-
Calendar: () =>
|
|
1205
|
-
h(
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1387
|
+
Calendar: () => [
|
|
1388
|
+
h(
|
|
1389
|
+
'div',
|
|
1390
|
+
{
|
|
1391
|
+
key: 'calendar-view',
|
|
1392
|
+
class: 'q-date__view q-date__calendar'
|
|
1393
|
+
},
|
|
1394
|
+
[
|
|
1395
|
+
h(
|
|
1396
|
+
'div',
|
|
1397
|
+
{
|
|
1398
|
+
class: 'q-date__navigation row items-center no-wrap'
|
|
1399
|
+
},
|
|
1400
|
+
getNavigation({
|
|
1401
|
+
label: innerLocale.value.months[viewModel.value.month - 1],
|
|
1402
|
+
type: 'Months',
|
|
1403
|
+
key: viewModel.value.month,
|
|
1404
|
+
dir: monthDirection.value,
|
|
1405
|
+
goTo: goToMonth,
|
|
1406
|
+
boundaries: navBoundaries.value.month,
|
|
1407
|
+
cls: ' col'
|
|
1408
|
+
}).concat(
|
|
1409
|
+
getNavigation({
|
|
1410
|
+
label: viewModel.value.year,
|
|
1411
|
+
type: 'Years',
|
|
1412
|
+
key: viewModel.value.year,
|
|
1413
|
+
dir: yearDirection.value,
|
|
1414
|
+
goTo: goToYear,
|
|
1415
|
+
boundaries: navBoundaries.value.year,
|
|
1416
|
+
cls: ''
|
|
1417
|
+
})
|
|
1418
|
+
)
|
|
1419
|
+
),
|
|
1420
|
+
|
|
1421
|
+
h(
|
|
1422
|
+
'div',
|
|
1423
|
+
{
|
|
1424
|
+
class: 'q-date__calendar-weekdays row items-center no-wrap'
|
|
1425
|
+
},
|
|
1426
|
+
daysOfWeek.value.map(day =>
|
|
1427
|
+
h('div', { class: 'q-date__calendar-item' }, [h('div', day)])
|
|
1428
|
+
)
|
|
1429
|
+
),
|
|
1430
|
+
|
|
1431
|
+
h(
|
|
1432
|
+
'div',
|
|
1433
|
+
{
|
|
1434
|
+
class:
|
|
1435
|
+
'q-date__calendar-days-container relative-position overflow-hidden'
|
|
1436
|
+
},
|
|
1437
|
+
[
|
|
1438
|
+
h(
|
|
1439
|
+
Transition,
|
|
1440
|
+
{
|
|
1441
|
+
name: 'q-transition--slide-' + monthDirection.value
|
|
1257
1442
|
},
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1443
|
+
() =>
|
|
1444
|
+
h(
|
|
1445
|
+
'div',
|
|
1446
|
+
{
|
|
1447
|
+
key: viewMonthHash.value,
|
|
1448
|
+
class: 'q-date__calendar-days fit'
|
|
1449
|
+
},
|
|
1450
|
+
days.value.map(day =>
|
|
1451
|
+
h('div', { class: day.classes }, [
|
|
1452
|
+
day.in === true
|
|
1453
|
+
? h(
|
|
1454
|
+
QBtn,
|
|
1455
|
+
{
|
|
1456
|
+
class:
|
|
1457
|
+
day.today === true ? 'q-date__today' : '',
|
|
1458
|
+
dense: true,
|
|
1459
|
+
flat: day.flat,
|
|
1460
|
+
unelevated: day.unelevated,
|
|
1461
|
+
color: day.color,
|
|
1462
|
+
textColor: day.textColor,
|
|
1463
|
+
label: day.i,
|
|
1464
|
+
tabindex: tabindex.value,
|
|
1465
|
+
...getCache('day#' + day.i, {
|
|
1466
|
+
onClick: () => {
|
|
1467
|
+
onDayClick(day.i)
|
|
1468
|
+
},
|
|
1469
|
+
onMouseover: () => {
|
|
1470
|
+
onDayMouseover(day.i)
|
|
1471
|
+
}
|
|
1472
|
+
})
|
|
1473
|
+
},
|
|
1474
|
+
day.event !== false
|
|
1475
|
+
? () =>
|
|
1476
|
+
h('div', {
|
|
1477
|
+
class: 'q-date__event bg-' + day.event
|
|
1478
|
+
})
|
|
1479
|
+
: null
|
|
1480
|
+
)
|
|
1481
|
+
: h('div', String(day.i))
|
|
1482
|
+
])
|
|
1483
|
+
)
|
|
1484
|
+
)
|
|
1261
1485
|
)
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
]
|
|
1265
|
-
|
|
1266
|
-
]
|
|
1486
|
+
]
|
|
1487
|
+
)
|
|
1488
|
+
]
|
|
1489
|
+
)
|
|
1490
|
+
],
|
|
1267
1491
|
|
|
1268
|
-
Months
|
|
1492
|
+
Months() {
|
|
1269
1493
|
const currentYear = viewModel.value.year === today.value.year
|
|
1270
|
-
const isDisabled = month =>
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1494
|
+
const isDisabled = month =>
|
|
1495
|
+
(minNav.value !== null &&
|
|
1496
|
+
viewModel.value.year === minNav.value.year &&
|
|
1497
|
+
minNav.value.month > month) ||
|
|
1498
|
+
(maxNav.value !== null &&
|
|
1499
|
+
viewModel.value.year === maxNav.value.year &&
|
|
1500
|
+
maxNav.value.month < month)
|
|
1276
1501
|
|
|
1277
1502
|
const content = innerLocale.value.monthsShort.map((month, i) => {
|
|
1278
1503
|
const active = viewModel.value.month === i + 1
|
|
1279
1504
|
|
|
1280
|
-
return h(
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1505
|
+
return h(
|
|
1506
|
+
'div',
|
|
1507
|
+
{
|
|
1508
|
+
class: 'q-date__months-item flex flex-center'
|
|
1509
|
+
},
|
|
1510
|
+
[
|
|
1511
|
+
h(QBtn, {
|
|
1512
|
+
class:
|
|
1513
|
+
currentYear === true && today.value.month === i + 1
|
|
1514
|
+
? 'q-date__today'
|
|
1515
|
+
: null,
|
|
1516
|
+
flat: active !== true,
|
|
1517
|
+
label: month,
|
|
1518
|
+
unelevated: active,
|
|
1519
|
+
color: active === true ? computedColor.value : null,
|
|
1520
|
+
textColor: active === true ? computedTextColor.value : null,
|
|
1521
|
+
tabindex: tabindex.value,
|
|
1522
|
+
disable: isDisabled(i + 1),
|
|
1523
|
+
...getCache('month#' + i, {
|
|
1524
|
+
onClick: () => {
|
|
1525
|
+
setMonth(i + 1)
|
|
1526
|
+
}
|
|
1527
|
+
})
|
|
1528
|
+
})
|
|
1529
|
+
]
|
|
1530
|
+
)
|
|
1295
1531
|
})
|
|
1296
1532
|
|
|
1297
|
-
props.yearsInMonthView === true
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1533
|
+
if (props.yearsInMonthView === true) {
|
|
1534
|
+
content.unshift(
|
|
1535
|
+
h('div', { class: 'row no-wrap full-width' }, [
|
|
1536
|
+
getNavigation({
|
|
1537
|
+
label: viewModel.value.year,
|
|
1538
|
+
type: 'Years',
|
|
1539
|
+
key: viewModel.value.year,
|
|
1540
|
+
dir: yearDirection.value,
|
|
1541
|
+
goTo: goToYear,
|
|
1542
|
+
boundaries: navBoundaries.value.year,
|
|
1543
|
+
cls: ' col'
|
|
1544
|
+
})
|
|
1545
|
+
])
|
|
1546
|
+
)
|
|
1547
|
+
}
|
|
1310
1548
|
|
|
1311
|
-
return h(
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1549
|
+
return h(
|
|
1550
|
+
'div',
|
|
1551
|
+
{
|
|
1552
|
+
key: 'months-view',
|
|
1553
|
+
class: 'q-date__view q-date__months flex flex-center'
|
|
1554
|
+
},
|
|
1555
|
+
content
|
|
1556
|
+
)
|
|
1315
1557
|
},
|
|
1316
1558
|
|
|
1317
|
-
Years
|
|
1318
|
-
const
|
|
1319
|
-
start = startYear.value,
|
|
1559
|
+
Years() {
|
|
1560
|
+
const start = startYear.value,
|
|
1320
1561
|
stop = start + yearsInterval,
|
|
1321
1562
|
years = []
|
|
1322
1563
|
|
|
1323
|
-
const isDisabled = year =>
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|| (maxNav.value !== null && maxNav.value.year < year)
|
|
1327
|
-
)
|
|
1328
|
-
}
|
|
1564
|
+
const isDisabled = year =>
|
|
1565
|
+
(minNav.value !== null && minNav.value.year > year) ||
|
|
1566
|
+
(maxNav.value !== null && maxNav.value.year < year)
|
|
1329
1567
|
|
|
1330
1568
|
for (let i = start; i <= stop; i++) {
|
|
1331
1569
|
const active = viewModel.value.year === i
|
|
1332
1570
|
|
|
1333
1571
|
years.push(
|
|
1334
|
-
h(
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1572
|
+
h(
|
|
1573
|
+
'div',
|
|
1574
|
+
{
|
|
1575
|
+
class: 'q-date__years-item flex flex-center'
|
|
1576
|
+
},
|
|
1577
|
+
[
|
|
1578
|
+
h(QBtn, {
|
|
1579
|
+
key: 'yr' + i,
|
|
1580
|
+
class: today.value.year === i ? 'q-date__today' : null,
|
|
1581
|
+
flat: !active,
|
|
1582
|
+
label: i,
|
|
1583
|
+
dense: true,
|
|
1584
|
+
unelevated: active,
|
|
1585
|
+
color: active === true ? computedColor.value : null,
|
|
1586
|
+
textColor: active === true ? computedTextColor.value : null,
|
|
1587
|
+
tabindex: tabindex.value,
|
|
1588
|
+
disable: isDisabled(i),
|
|
1589
|
+
...getCache('yr#' + i, {
|
|
1590
|
+
onClick: () => {
|
|
1591
|
+
setYear(i)
|
|
1592
|
+
}
|
|
1593
|
+
})
|
|
1594
|
+
})
|
|
1595
|
+
]
|
|
1596
|
+
)
|
|
1351
1597
|
)
|
|
1352
1598
|
}
|
|
1353
1599
|
|
|
1354
|
-
return h(
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
h(
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1600
|
+
return h(
|
|
1601
|
+
'div',
|
|
1602
|
+
{
|
|
1603
|
+
class: 'q-date__view q-date__years flex flex-center'
|
|
1604
|
+
},
|
|
1605
|
+
[
|
|
1606
|
+
h(
|
|
1607
|
+
'div',
|
|
1608
|
+
{
|
|
1609
|
+
class: 'col-auto'
|
|
1610
|
+
},
|
|
1611
|
+
[
|
|
1612
|
+
h(QBtn, {
|
|
1613
|
+
round: true,
|
|
1614
|
+
dense: true,
|
|
1615
|
+
flat: true,
|
|
1616
|
+
icon: dateArrow.value[0],
|
|
1617
|
+
'aria-label': $q.lang.date.prevRangeYears(yearsInterval),
|
|
1618
|
+
tabindex: tabindex.value,
|
|
1619
|
+
disable: isDisabled(start),
|
|
1620
|
+
...getCache('y-', {
|
|
1621
|
+
onClick: () => {
|
|
1622
|
+
startYear.value -= yearsInterval
|
|
1623
|
+
}
|
|
1624
|
+
})
|
|
1625
|
+
})
|
|
1626
|
+
]
|
|
1627
|
+
),
|
|
1371
1628
|
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1629
|
+
h(
|
|
1630
|
+
'div',
|
|
1631
|
+
{
|
|
1632
|
+
class: 'q-date__years-content col self-stretch row items-center'
|
|
1633
|
+
},
|
|
1634
|
+
years
|
|
1635
|
+
),
|
|
1375
1636
|
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1637
|
+
h(
|
|
1638
|
+
'div',
|
|
1639
|
+
{
|
|
1640
|
+
class: 'col-auto'
|
|
1641
|
+
},
|
|
1642
|
+
[
|
|
1643
|
+
h(QBtn, {
|
|
1644
|
+
round: true,
|
|
1645
|
+
dense: true,
|
|
1646
|
+
flat: true,
|
|
1647
|
+
icon: dateArrow.value[1],
|
|
1648
|
+
'aria-label': $q.lang.date.nextRangeYears(yearsInterval),
|
|
1649
|
+
tabindex: tabindex.value,
|
|
1650
|
+
disable: isDisabled(stop),
|
|
1651
|
+
...getCache('y+', {
|
|
1652
|
+
onClick: () => {
|
|
1653
|
+
startYear.value += yearsInterval
|
|
1654
|
+
}
|
|
1655
|
+
})
|
|
1656
|
+
})
|
|
1657
|
+
]
|
|
1658
|
+
)
|
|
1659
|
+
]
|
|
1660
|
+
)
|
|
1391
1661
|
}
|
|
1392
1662
|
}
|
|
1393
1663
|
|
|
1394
|
-
function onDayClick
|
|
1664
|
+
function onDayClick(dayIndex) {
|
|
1395
1665
|
const day = { ...viewModel.value, day: dayIndex }
|
|
1396
1666
|
|
|
1397
1667
|
if (props.range === false) {
|
|
@@ -1400,10 +1670,16 @@ export default createComponent({
|
|
|
1400
1670
|
}
|
|
1401
1671
|
|
|
1402
1672
|
if (editRange.value === null) {
|
|
1403
|
-
const dayProps = days.value.find(
|
|
1673
|
+
const dayProps = days.value.find(
|
|
1674
|
+
item => item.fill !== true && item.i === dayIndex
|
|
1675
|
+
)
|
|
1404
1676
|
|
|
1405
1677
|
if (props.noUnset !== true && dayProps.range !== void 0) {
|
|
1406
|
-
removeFromModel({
|
|
1678
|
+
removeFromModel({
|
|
1679
|
+
target: day,
|
|
1680
|
+
from: dayProps.range.from,
|
|
1681
|
+
to: dayProps.range.to
|
|
1682
|
+
})
|
|
1407
1683
|
return
|
|
1408
1684
|
}
|
|
1409
1685
|
|
|
@@ -1422,14 +1698,13 @@ export default createComponent({
|
|
|
1422
1698
|
}
|
|
1423
1699
|
|
|
1424
1700
|
emit('rangeStart', getShortDate(day))
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
const
|
|
1428
|
-
initHash = editRange.value.initHash,
|
|
1701
|
+
} else {
|
|
1702
|
+
const initHash = editRange.value.initHash,
|
|
1429
1703
|
finalHash = getDayHash(day),
|
|
1430
|
-
payload =
|
|
1431
|
-
|
|
1432
|
-
|
|
1704
|
+
payload =
|
|
1705
|
+
initHash <= finalHash
|
|
1706
|
+
? { from: editRange.value.init, to: day }
|
|
1707
|
+
: { from: day, to: editRange.value.init }
|
|
1433
1708
|
|
|
1434
1709
|
editRange.value = null
|
|
1435
1710
|
addToModel(initHash === finalHash ? day : { target: day, ...payload })
|
|
@@ -1441,7 +1716,7 @@ export default createComponent({
|
|
|
1441
1716
|
}
|
|
1442
1717
|
}
|
|
1443
1718
|
|
|
1444
|
-
function onDayMouseover
|
|
1719
|
+
function onDayMouseover(dayIndex) {
|
|
1445
1720
|
if (editRange.value !== null) {
|
|
1446
1721
|
const final = { ...viewModel.value, day: dayIndex }
|
|
1447
1722
|
|
|
@@ -1454,41 +1729,61 @@ export default createComponent({
|
|
|
1454
1729
|
|
|
1455
1730
|
// expose public methods
|
|
1456
1731
|
Object.assign(proxy, {
|
|
1457
|
-
setToday,
|
|
1732
|
+
setToday,
|
|
1733
|
+
setView,
|
|
1734
|
+
offsetCalendar,
|
|
1735
|
+
setCalendarTo,
|
|
1736
|
+
setEditingRange
|
|
1458
1737
|
})
|
|
1459
1738
|
|
|
1460
1739
|
return () => {
|
|
1461
1740
|
const content = [
|
|
1462
|
-
h(
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1741
|
+
h(
|
|
1742
|
+
'div',
|
|
1743
|
+
{
|
|
1744
|
+
class: 'q-date__content col relative-position'
|
|
1745
|
+
},
|
|
1746
|
+
[
|
|
1747
|
+
h(
|
|
1748
|
+
Transition,
|
|
1749
|
+
{
|
|
1750
|
+
name: 'q-transition--fade'
|
|
1751
|
+
},
|
|
1752
|
+
renderViews[view.value]
|
|
1753
|
+
)
|
|
1754
|
+
]
|
|
1755
|
+
)
|
|
1469
1756
|
]
|
|
1470
1757
|
|
|
1471
1758
|
const def = hSlot(slots.default)
|
|
1472
|
-
def !== void 0
|
|
1473
|
-
h('div', { class: 'q-date__actions' }, def)
|
|
1474
|
-
|
|
1759
|
+
if (def !== void 0) {
|
|
1760
|
+
content.push(h('div', { class: 'q-date__actions' }, def))
|
|
1761
|
+
}
|
|
1475
1762
|
|
|
1476
1763
|
if (props.name !== void 0 && props.disable !== true) {
|
|
1477
1764
|
injectFormInput(content, 'push')
|
|
1478
1765
|
}
|
|
1479
1766
|
|
|
1480
|
-
return h(
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1767
|
+
return h(
|
|
1768
|
+
'div',
|
|
1769
|
+
{
|
|
1770
|
+
class: classes.value,
|
|
1771
|
+
...attributes.value
|
|
1772
|
+
},
|
|
1773
|
+
[
|
|
1774
|
+
getHeader(),
|
|
1775
|
+
|
|
1776
|
+
h(
|
|
1777
|
+
'div',
|
|
1778
|
+
{
|
|
1779
|
+
ref: blurTargetRef,
|
|
1780
|
+
class: 'q-date__main col column',
|
|
1781
|
+
tabindex: -1
|
|
1782
|
+
},
|
|
1783
|
+
content
|
|
1784
|
+
)
|
|
1785
|
+
]
|
|
1786
|
+
)
|
|
1492
1787
|
}
|
|
1493
1788
|
}
|
|
1494
1789
|
})
|