quasar 2.18.7 → 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 -29220
- 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 -29791
- 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 +126 -414
- 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/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 +50 -64
- 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 +41 -16
- 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 +10 -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 +56 -50
- 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,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
ref,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
onBeforeUpdate,
|
|
7
|
+
onUpdated,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
nextTick,
|
|
10
|
+
getCurrentInstance
|
|
11
|
+
} from 'vue'
|
|
2
12
|
|
|
3
13
|
import QField from '../field/QField.js'
|
|
4
14
|
import QIcon from '../icon/QIcon.js'
|
|
@@ -11,30 +21,45 @@ import QItemLabel from '../item/QItemLabel.js'
|
|
|
11
21
|
import QMenu from '../menu/QMenu.js'
|
|
12
22
|
import QDialog from '../dialog/QDialog.js'
|
|
13
23
|
|
|
14
|
-
import useField, {
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
import useField, {
|
|
25
|
+
useFieldState,
|
|
26
|
+
useFieldProps,
|
|
27
|
+
useFieldEmits,
|
|
28
|
+
fieldValueIsFilled
|
|
29
|
+
} from '../../composables/private.use-field/use-field.js'
|
|
30
|
+
import {
|
|
31
|
+
useVirtualScroll,
|
|
32
|
+
useVirtualScrollProps
|
|
33
|
+
} from '../virtual-scroll/use-virtual-scroll.js'
|
|
34
|
+
import {
|
|
35
|
+
useFormProps,
|
|
36
|
+
useFormInputNameAttr
|
|
37
|
+
} from '../../composables/use-form/private.use-form.js'
|
|
17
38
|
import useKeyComposition from '../../composables/private.use-key-composition/use-key-composition.js'
|
|
18
39
|
|
|
19
40
|
import { createComponent } from '../../utils/private.create/create.js'
|
|
20
41
|
import { isDeepEqual } from '../../utils/is/is.js'
|
|
21
42
|
import { stop, prevent, stopAndPrevent } from '../../utils/event/event.js'
|
|
22
43
|
import { normalizeToInterval } from '../../utils/format/format.js'
|
|
23
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
shouldIgnoreKey,
|
|
46
|
+
isKeyCode
|
|
47
|
+
} from '../../utils/private.keyboard/key-composition.js'
|
|
24
48
|
import { hMergeSlot } from '../../utils/private.render/render.js'
|
|
25
49
|
|
|
26
|
-
const validateNewValueMode = v => [
|
|
50
|
+
const validateNewValueMode = v => ['add', 'add-unique', 'toggle'].includes(v)
|
|
27
51
|
const reEscapeList = '.*+?^${}()|[]\\'
|
|
28
52
|
const fieldPropsList = Object.keys(useFieldProps)
|
|
29
53
|
|
|
30
|
-
function getPropValueFn
|
|
54
|
+
function getPropValueFn(userPropName, defaultPropName) {
|
|
31
55
|
if (typeof userPropName === 'function') return userPropName
|
|
32
56
|
|
|
33
|
-
const propName = userPropName !== void 0
|
|
34
|
-
? userPropName
|
|
35
|
-
: defaultPropName
|
|
57
|
+
const propName = userPropName !== void 0 ? userPropName : defaultPropName
|
|
36
58
|
|
|
37
|
-
return opt =>
|
|
59
|
+
return opt =>
|
|
60
|
+
opt !== null && typeof opt === 'object' && propName in opt
|
|
61
|
+
? opt[propName]
|
|
62
|
+
: opt
|
|
38
63
|
}
|
|
39
64
|
|
|
40
65
|
export default createComponent({
|
|
@@ -54,7 +79,7 @@ export default createComponent({
|
|
|
54
79
|
|
|
55
80
|
multiple: Boolean,
|
|
56
81
|
|
|
57
|
-
displayValue: [
|
|
82
|
+
displayValue: [String, Number],
|
|
58
83
|
displayValueHtml: Boolean,
|
|
59
84
|
dropdownIcon: String,
|
|
60
85
|
|
|
@@ -63,15 +88,15 @@ export default createComponent({
|
|
|
63
88
|
default: () => []
|
|
64
89
|
},
|
|
65
90
|
|
|
66
|
-
optionValue: [
|
|
67
|
-
optionLabel: [
|
|
68
|
-
optionDisable: [
|
|
91
|
+
optionValue: [Function, String],
|
|
92
|
+
optionLabel: [Function, String],
|
|
93
|
+
optionDisable: [Function, String],
|
|
69
94
|
|
|
70
95
|
hideSelected: Boolean,
|
|
71
96
|
hideDropdownIcon: Boolean,
|
|
72
97
|
fillInput: Boolean,
|
|
73
98
|
|
|
74
|
-
maxValues: [
|
|
99
|
+
maxValues: [Number, String],
|
|
75
100
|
|
|
76
101
|
optionsDense: Boolean,
|
|
77
102
|
optionsDark: {
|
|
@@ -89,7 +114,7 @@ export default createComponent({
|
|
|
89
114
|
menuOffset: Array,
|
|
90
115
|
|
|
91
116
|
popupContentClass: String,
|
|
92
|
-
popupContentStyle: [
|
|
117
|
+
popupContentStyle: [String, Array, Object],
|
|
93
118
|
popupNoRouteDismiss: Boolean,
|
|
94
119
|
|
|
95
120
|
useInput: Boolean,
|
|
@@ -106,15 +131,15 @@ export default createComponent({
|
|
|
106
131
|
disableTabSelection: Boolean,
|
|
107
132
|
|
|
108
133
|
inputDebounce: {
|
|
109
|
-
type: [
|
|
134
|
+
type: [Number, String],
|
|
110
135
|
default: 500
|
|
111
136
|
},
|
|
112
137
|
|
|
113
|
-
inputClass: [
|
|
114
|
-
inputStyle: [
|
|
138
|
+
inputClass: [Array, String, Object],
|
|
139
|
+
inputStyle: [Array, String, Object],
|
|
115
140
|
|
|
116
141
|
tabindex: {
|
|
117
|
-
type: [
|
|
142
|
+
type: [String, Number],
|
|
118
143
|
default: 0
|
|
119
144
|
},
|
|
120
145
|
|
|
@@ -126,7 +151,7 @@ export default createComponent({
|
|
|
126
151
|
|
|
127
152
|
behavior: {
|
|
128
153
|
type: String,
|
|
129
|
-
validator: v => [
|
|
154
|
+
validator: v => ['default', 'menu', 'dialog'].includes(v),
|
|
130
155
|
default: 'default'
|
|
131
156
|
},
|
|
132
157
|
|
|
@@ -139,13 +164,18 @@ export default createComponent({
|
|
|
139
164
|
|
|
140
165
|
emits: [
|
|
141
166
|
...useFieldEmits,
|
|
142
|
-
'add',
|
|
143
|
-
'
|
|
144
|
-
'
|
|
167
|
+
'add',
|
|
168
|
+
'remove',
|
|
169
|
+
'inputValue',
|
|
170
|
+
'keyup',
|
|
171
|
+
'keypress',
|
|
172
|
+
'keydown',
|
|
173
|
+
'popupShow',
|
|
174
|
+
'popupHide',
|
|
145
175
|
'filterAbort'
|
|
146
176
|
],
|
|
147
177
|
|
|
148
|
-
setup
|
|
178
|
+
setup(props, { slots, emit }) {
|
|
149
179
|
const { proxy } = getCurrentInstance()
|
|
150
180
|
const { $q } = proxy
|
|
151
181
|
|
|
@@ -156,10 +186,16 @@ export default createComponent({
|
|
|
156
186
|
const dialogFieldFocused = ref(false)
|
|
157
187
|
const innerLoadingIndicator = ref(false)
|
|
158
188
|
|
|
159
|
-
let filterTimer = null,
|
|
189
|
+
let filterTimer = null,
|
|
190
|
+
inputValueTimer = null,
|
|
160
191
|
innerValueCache,
|
|
161
|
-
hasDialog,
|
|
162
|
-
|
|
192
|
+
hasDialog,
|
|
193
|
+
userInputValue,
|
|
194
|
+
filterId = null,
|
|
195
|
+
defaultInputValue,
|
|
196
|
+
transitionShowComputed,
|
|
197
|
+
searchBuffer,
|
|
198
|
+
searchBufferExp
|
|
163
199
|
|
|
164
200
|
const inputRef = ref(null)
|
|
165
201
|
const targetRef = ref(null)
|
|
@@ -171,17 +207,17 @@ export default createComponent({
|
|
|
171
207
|
|
|
172
208
|
const onComposition = useKeyComposition(onInput)
|
|
173
209
|
|
|
174
|
-
const virtualScrollLength = computed(() =>
|
|
175
|
-
Array.isArray(props.options)
|
|
176
|
-
|
|
177
|
-
: 0
|
|
178
|
-
))
|
|
210
|
+
const virtualScrollLength = computed(() =>
|
|
211
|
+
Array.isArray(props.options) ? props.options.length : 0
|
|
212
|
+
)
|
|
179
213
|
|
|
180
|
-
const virtualScrollItemSizeComputed = computed(() =>
|
|
214
|
+
const virtualScrollItemSizeComputed = computed(() =>
|
|
181
215
|
props.virtualScrollItemSize === void 0
|
|
182
|
-
?
|
|
216
|
+
? props.optionsDense === true
|
|
217
|
+
? 24
|
|
218
|
+
: 48
|
|
183
219
|
: props.virtualScrollItemSize
|
|
184
|
-
)
|
|
220
|
+
)
|
|
185
221
|
|
|
186
222
|
const {
|
|
187
223
|
virtualScrollSliceRange,
|
|
@@ -192,23 +228,29 @@ export default createComponent({
|
|
|
192
228
|
scrollTo,
|
|
193
229
|
setVirtualScrollSize
|
|
194
230
|
} = useVirtualScroll({
|
|
195
|
-
virtualScrollLength,
|
|
231
|
+
virtualScrollLength,
|
|
232
|
+
getVirtualScrollTarget,
|
|
233
|
+
getVirtualScrollEl,
|
|
196
234
|
virtualScrollItemSizeComputed
|
|
197
235
|
})
|
|
198
236
|
|
|
199
237
|
const state = useFieldState()
|
|
200
238
|
|
|
201
239
|
const innerValue = computed(() => {
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
240
|
+
const mapNull = props.mapOptions === true && props.multiple !== true,
|
|
241
|
+
val =
|
|
242
|
+
props.modelValue !== void 0 &&
|
|
243
|
+
(props.modelValue !== null || mapNull === true)
|
|
244
|
+
? props.multiple === true && Array.isArray(props.modelValue)
|
|
245
|
+
? props.modelValue
|
|
246
|
+
: [props.modelValue]
|
|
247
|
+
: []
|
|
207
248
|
|
|
208
249
|
if (props.mapOptions === true && Array.isArray(props.options) === true) {
|
|
209
|
-
const cache =
|
|
210
|
-
|
|
211
|
-
|
|
250
|
+
const cache =
|
|
251
|
+
props.mapOptions === true && innerValueCache !== void 0
|
|
252
|
+
? innerValueCache
|
|
253
|
+
: []
|
|
212
254
|
const values = val.map(v => getOption(v, cache))
|
|
213
255
|
|
|
214
256
|
return props.modelValue === null && mapNull === true
|
|
@@ -222,19 +264,17 @@ export default createComponent({
|
|
|
222
264
|
const innerFieldProps = computed(() => {
|
|
223
265
|
const acc = {}
|
|
224
266
|
fieldPropsList.forEach(key => {
|
|
225
|
-
const val = props[
|
|
267
|
+
const val = props[key]
|
|
226
268
|
if (val !== void 0) {
|
|
227
|
-
acc[
|
|
269
|
+
acc[key] = val
|
|
228
270
|
}
|
|
229
271
|
})
|
|
230
272
|
return acc
|
|
231
273
|
})
|
|
232
274
|
|
|
233
|
-
const isOptionsDark = computed(() =>
|
|
234
|
-
props.optionsDark === null
|
|
235
|
-
|
|
236
|
-
: props.optionsDark
|
|
237
|
-
))
|
|
275
|
+
const isOptionsDark = computed(() =>
|
|
276
|
+
props.optionsDark === null ? state.isDark.value : props.optionsDark
|
|
277
|
+
)
|
|
238
278
|
|
|
239
279
|
const hasValue = computed(() => fieldValueIsFilled(innerValue.value))
|
|
240
280
|
|
|
@@ -242,50 +282,46 @@ export default createComponent({
|
|
|
242
282
|
let cls = 'q-field__input q-placeholder col'
|
|
243
283
|
|
|
244
284
|
if (props.hideSelected === true || innerValue.value.length === 0) {
|
|
245
|
-
return [
|
|
285
|
+
return [cls, props.inputClass]
|
|
246
286
|
}
|
|
247
287
|
|
|
248
288
|
cls += ' q-field__input--padding'
|
|
249
289
|
|
|
250
|
-
return props.inputClass === void 0
|
|
251
|
-
? cls
|
|
252
|
-
: [ cls, props.inputClass ]
|
|
290
|
+
return props.inputClass === void 0 ? cls : [cls, props.inputClass]
|
|
253
291
|
})
|
|
254
292
|
|
|
255
|
-
const menuContentClass = computed(
|
|
256
|
-
(
|
|
257
|
-
|
|
293
|
+
const menuContentClass = computed(
|
|
294
|
+
() =>
|
|
295
|
+
(props.virtualScrollHorizontal === true
|
|
296
|
+
? 'q-virtual-scroll--horizontal'
|
|
297
|
+
: '') + (props.popupContentClass ? ' ' + props.popupContentClass : '')
|
|
258
298
|
)
|
|
259
299
|
|
|
260
300
|
const noOptions = computed(() => virtualScrollLength.value === 0)
|
|
261
301
|
|
|
262
302
|
const selectedString = computed(() =>
|
|
263
|
-
innerValue.value
|
|
264
|
-
.map(opt => getOptionLabel.value(opt))
|
|
265
|
-
.join(', ')
|
|
303
|
+
innerValue.value.map(opt => getOptionLabel.value(opt)).join(', ')
|
|
266
304
|
)
|
|
267
305
|
|
|
268
|
-
const ariaCurrentValue = computed(() =>
|
|
269
|
-
? props.displayValue
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|| innerValue.value.some(needsHtmlFn.value)
|
|
284
|
-
)
|
|
285
|
-
)
|
|
286
|
-
))
|
|
306
|
+
const ariaCurrentValue = computed(() =>
|
|
307
|
+
props.displayValue !== void 0 ? props.displayValue : selectedString.value
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
const needsHtmlFn = computed(() =>
|
|
311
|
+
props.optionsHtml === true ? () => true : opt => opt?.html === true
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
const valueAsHtml = computed(
|
|
315
|
+
() =>
|
|
316
|
+
props.displayValueHtml === true ||
|
|
317
|
+
(props.displayValue === void 0 &&
|
|
318
|
+
(props.optionsHtml === true ||
|
|
319
|
+
innerValue.value.some(needsHtmlFn.value)))
|
|
320
|
+
)
|
|
287
321
|
|
|
288
|
-
const tabindex = computed(() =>
|
|
322
|
+
const tabindex = computed(() =>
|
|
323
|
+
state.focused.value === true ? props.tabindex : -1
|
|
324
|
+
)
|
|
289
325
|
|
|
290
326
|
const comboboxAttrs = computed(() => {
|
|
291
327
|
const attrs = {
|
|
@@ -295,24 +331,25 @@ export default createComponent({
|
|
|
295
331
|
'aria-readonly': props.readonly === true ? 'true' : 'false',
|
|
296
332
|
'aria-autocomplete': props.useInput === true ? 'list' : 'none',
|
|
297
333
|
'aria-expanded': menu.value === true ? 'true' : 'false',
|
|
298
|
-
'aria-controls': `${
|
|
334
|
+
'aria-controls': `${state.targetUid.value}_lb`
|
|
299
335
|
}
|
|
300
336
|
|
|
301
337
|
if (optionIndex.value >= 0) {
|
|
302
|
-
attrs[
|
|
338
|
+
attrs['aria-activedescendant'] =
|
|
339
|
+
`${state.targetUid.value}_${optionIndex.value}`
|
|
303
340
|
}
|
|
304
341
|
|
|
305
342
|
return attrs
|
|
306
343
|
})
|
|
307
344
|
|
|
308
345
|
const listboxAttrs = computed(() => ({
|
|
309
|
-
id: `${
|
|
346
|
+
id: `${state.targetUid.value}_lb`,
|
|
310
347
|
role: 'listbox',
|
|
311
348
|
'aria-multiselectable': props.multiple === true ? 'true' : 'false'
|
|
312
349
|
}))
|
|
313
350
|
|
|
314
|
-
const selectedScope = computed(() =>
|
|
315
|
-
|
|
351
|
+
const selectedScope = computed(() =>
|
|
352
|
+
innerValue.value.map((opt, i) => ({
|
|
316
353
|
index: i,
|
|
317
354
|
opt,
|
|
318
355
|
html: needsHtmlFn.value(opt),
|
|
@@ -321,7 +358,7 @@ export default createComponent({
|
|
|
321
358
|
toggleOption,
|
|
322
359
|
tabindex: tabindex.value
|
|
323
360
|
}))
|
|
324
|
-
|
|
361
|
+
)
|
|
325
362
|
|
|
326
363
|
const optionScope = computed(() => {
|
|
327
364
|
if (virtualScrollLength.value === 0) {
|
|
@@ -347,15 +384,19 @@ export default createComponent({
|
|
|
347
384
|
dark: isOptionsDark.value,
|
|
348
385
|
role: 'option',
|
|
349
386
|
'aria-selected': active === true ? 'true' : 'false',
|
|
350
|
-
id: `${
|
|
351
|
-
onClick: () => {
|
|
387
|
+
id: `${state.targetUid.value}_${index}`,
|
|
388
|
+
onClick: () => {
|
|
389
|
+
toggleOption(opt)
|
|
390
|
+
}
|
|
352
391
|
}
|
|
353
392
|
|
|
354
393
|
if (disable !== true) {
|
|
355
|
-
optionIndex.value === index
|
|
394
|
+
if (optionIndex.value === index) itemProps.focused = true
|
|
356
395
|
|
|
357
396
|
if ($q.platform.is.desktop === true) {
|
|
358
|
-
itemProps.onMousemove = () => {
|
|
397
|
+
itemProps.onMousemove = () => {
|
|
398
|
+
if (menu.value === true) setOptionIndex(index)
|
|
399
|
+
}
|
|
359
400
|
}
|
|
360
401
|
}
|
|
361
402
|
|
|
@@ -373,39 +414,50 @@ export default createComponent({
|
|
|
373
414
|
})
|
|
374
415
|
})
|
|
375
416
|
|
|
376
|
-
const dropdownArrowIcon = computed(() =>
|
|
417
|
+
const dropdownArrowIcon = computed(() =>
|
|
377
418
|
props.dropdownIcon !== void 0
|
|
378
419
|
? props.dropdownIcon
|
|
379
420
|
: $q.iconSet.arrow.dropdown
|
|
380
|
-
))
|
|
381
|
-
|
|
382
|
-
const squaredMenu = computed(() =>
|
|
383
|
-
props.optionsCover === false
|
|
384
|
-
&& props.outlined !== true
|
|
385
|
-
&& props.standout !== true
|
|
386
|
-
&& props.borderless !== true
|
|
387
|
-
&& props.rounded !== true
|
|
388
421
|
)
|
|
389
422
|
|
|
390
|
-
const
|
|
423
|
+
const squaredMenu = computed(
|
|
424
|
+
() =>
|
|
425
|
+
props.optionsCover === false &&
|
|
426
|
+
props.outlined !== true &&
|
|
427
|
+
props.standout !== true &&
|
|
428
|
+
props.borderless !== true &&
|
|
429
|
+
props.rounded !== true
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
const computedOptionsSelectedClass = computed(() =>
|
|
391
433
|
props.optionsSelectedClass !== void 0
|
|
392
434
|
? props.optionsSelectedClass
|
|
393
|
-
:
|
|
394
|
-
|
|
435
|
+
: props.color !== void 0
|
|
436
|
+
? `text-${props.color}`
|
|
437
|
+
: ''
|
|
438
|
+
)
|
|
395
439
|
|
|
396
440
|
// returns method to get value of an option;
|
|
397
441
|
// takes into account 'option-value' prop
|
|
398
|
-
const getOptionValue = computed(() =>
|
|
442
|
+
const getOptionValue = computed(() =>
|
|
443
|
+
getPropValueFn(props.optionValue, 'value')
|
|
444
|
+
)
|
|
399
445
|
|
|
400
446
|
// returns method to get label of an option;
|
|
401
447
|
// takes into account 'option-label' prop
|
|
402
|
-
const getOptionLabel = computed(() =>
|
|
448
|
+
const getOptionLabel = computed(() =>
|
|
449
|
+
getPropValueFn(props.optionLabel, 'label')
|
|
450
|
+
)
|
|
403
451
|
|
|
404
452
|
// returns method to tell if an option is disabled;
|
|
405
453
|
// takes into account 'option-disable' prop
|
|
406
|
-
const isOptionDisabled = computed(() =>
|
|
454
|
+
const isOptionDisabled = computed(() =>
|
|
455
|
+
getPropValueFn(props.optionDisable, 'disable')
|
|
456
|
+
)
|
|
407
457
|
|
|
408
|
-
const innerOptionsValue = computed(() =>
|
|
458
|
+
const innerOptionsValue = computed(() =>
|
|
459
|
+
innerValue.value.map(getOptionValue.value)
|
|
460
|
+
)
|
|
409
461
|
|
|
410
462
|
const inputControlEvents = computed(() => {
|
|
411
463
|
const evt = {
|
|
@@ -419,32 +471,42 @@ export default createComponent({
|
|
|
419
471
|
onKeyup: onTargetAutocomplete,
|
|
420
472
|
onKeypress: onTargetKeypress,
|
|
421
473
|
onFocus: selectInputText,
|
|
422
|
-
onClick
|
|
474
|
+
onClick(e) {
|
|
475
|
+
if (hasDialog === true) stop(e)
|
|
476
|
+
}
|
|
423
477
|
}
|
|
424
478
|
|
|
425
|
-
evt.onCompositionstart =
|
|
479
|
+
evt.onCompositionstart =
|
|
480
|
+
evt.onCompositionupdate =
|
|
481
|
+
evt.onCompositionend =
|
|
482
|
+
onComposition
|
|
426
483
|
|
|
427
484
|
return evt
|
|
428
485
|
})
|
|
429
486
|
|
|
430
|
-
watch(
|
|
431
|
-
|
|
487
|
+
watch(
|
|
488
|
+
innerValue,
|
|
489
|
+
val => {
|
|
490
|
+
innerValueCache = val
|
|
432
491
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
492
|
+
if (
|
|
493
|
+
props.useInput === true &&
|
|
494
|
+
props.fillInput === true &&
|
|
495
|
+
props.multiple !== true &&
|
|
496
|
+
// Prevent re-entering in filter while filtering
|
|
497
|
+
// Also prevent clearing inputValue while filtering
|
|
498
|
+
state.innerLoading.value !== true &&
|
|
499
|
+
((dialog.value !== true && menu.value !== true) ||
|
|
500
|
+
hasValue.value !== true)
|
|
501
|
+
) {
|
|
502
|
+
if (userInputValue !== true) resetInputValue()
|
|
503
|
+
if (dialog.value === true || menu.value === true) {
|
|
504
|
+
filter('')
|
|
505
|
+
}
|
|
445
506
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
507
|
+
},
|
|
508
|
+
{ immediate: true }
|
|
509
|
+
)
|
|
448
510
|
|
|
449
511
|
watch(() => props.fillInput, resetInputValue)
|
|
450
512
|
|
|
@@ -452,39 +514,34 @@ export default createComponent({
|
|
|
452
514
|
|
|
453
515
|
watch(virtualScrollLength, rerenderMenu)
|
|
454
516
|
|
|
455
|
-
function getEmittingOptionValue
|
|
456
|
-
return props.emitValue === true
|
|
457
|
-
? getOptionValue.value(opt)
|
|
458
|
-
: opt
|
|
517
|
+
function getEmittingOptionValue(opt) {
|
|
518
|
+
return props.emitValue === true ? getOptionValue.value(opt) : opt
|
|
459
519
|
}
|
|
460
520
|
|
|
461
|
-
function removeAtIndex
|
|
521
|
+
function removeAtIndex(index) {
|
|
462
522
|
if (index !== -1 && index < innerValue.value.length) {
|
|
463
523
|
if (props.multiple === true) {
|
|
464
524
|
const model = props.modelValue.slice()
|
|
465
|
-
emit('remove', { index, value: model.splice(index, 1)[
|
|
525
|
+
emit('remove', { index, value: model.splice(index, 1)[0] })
|
|
466
526
|
emit('update:modelValue', model)
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
527
|
+
} else {
|
|
469
528
|
emit('update:modelValue', null)
|
|
470
529
|
}
|
|
471
530
|
}
|
|
472
531
|
}
|
|
473
532
|
|
|
474
|
-
function removeAtIndexAndFocus
|
|
533
|
+
function removeAtIndexAndFocus(index) {
|
|
475
534
|
removeAtIndex(index)
|
|
476
535
|
state.focus()
|
|
477
536
|
}
|
|
478
537
|
|
|
479
|
-
function add
|
|
538
|
+
function add(opt, unique) {
|
|
480
539
|
const val = getEmittingOptionValue(opt)
|
|
481
540
|
|
|
482
541
|
if (props.multiple !== true) {
|
|
483
|
-
props.fillInput === true
|
|
484
|
-
getOptionLabel.value(opt),
|
|
485
|
-
|
|
486
|
-
true
|
|
487
|
-
)
|
|
542
|
+
if (props.fillInput === true) {
|
|
543
|
+
updateInputValue(getOptionLabel.value(opt), true, true)
|
|
544
|
+
}
|
|
488
545
|
|
|
489
546
|
emit('update:modelValue', val)
|
|
490
547
|
return
|
|
@@ -492,19 +549,18 @@ export default createComponent({
|
|
|
492
549
|
|
|
493
550
|
if (innerValue.value.length === 0) {
|
|
494
551
|
emit('add', { index: 0, value: val })
|
|
495
|
-
emit('update:modelValue', props.multiple === true ? [
|
|
552
|
+
emit('update:modelValue', props.multiple === true ? [val] : val)
|
|
496
553
|
return
|
|
497
554
|
}
|
|
498
555
|
|
|
499
|
-
if (
|
|
500
|
-
unique === true
|
|
501
|
-
&& isOptionSelected(opt) === true
|
|
502
|
-
) return
|
|
556
|
+
if (unique === true && isOptionSelected(opt) === true) return
|
|
503
557
|
|
|
504
558
|
if (
|
|
505
|
-
props.maxValues !== void 0
|
|
506
|
-
|
|
507
|
-
)
|
|
559
|
+
props.maxValues !== void 0 &&
|
|
560
|
+
props.modelValue.length >= props.maxValues
|
|
561
|
+
) {
|
|
562
|
+
return
|
|
563
|
+
}
|
|
508
564
|
|
|
509
565
|
const model = props.modelValue.slice()
|
|
510
566
|
|
|
@@ -513,12 +569,14 @@ export default createComponent({
|
|
|
513
569
|
emit('update:modelValue', model)
|
|
514
570
|
}
|
|
515
571
|
|
|
516
|
-
function toggleOption
|
|
572
|
+
function toggleOption(opt, keepOpen) {
|
|
517
573
|
if (
|
|
518
|
-
state.editable.value !== true
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
)
|
|
574
|
+
state.editable.value !== true ||
|
|
575
|
+
opt === void 0 ||
|
|
576
|
+
isOptionDisabled.value(opt) === true
|
|
577
|
+
) {
|
|
578
|
+
return
|
|
579
|
+
}
|
|
522
580
|
|
|
523
581
|
const optValue = getOptionValue.value(opt)
|
|
524
582
|
|
|
@@ -536,8 +594,9 @@ export default createComponent({
|
|
|
536
594
|
targetRef.value?.focus()
|
|
537
595
|
|
|
538
596
|
if (
|
|
539
|
-
innerValue.value.length === 0
|
|
540
|
-
|
|
597
|
+
innerValue.value.length === 0 ||
|
|
598
|
+
isDeepEqual(getOptionValue.value(innerValue.value[0]), optValue) !==
|
|
599
|
+
true
|
|
541
600
|
) {
|
|
542
601
|
emit('update:modelValue', props.emitValue === true ? optValue : opt)
|
|
543
602
|
}
|
|
@@ -554,22 +613,19 @@ export default createComponent({
|
|
|
554
613
|
if (innerValue.value.length === 0) {
|
|
555
614
|
const val = props.emitValue === true ? optValue : opt
|
|
556
615
|
emit('add', { index: 0, value: val })
|
|
557
|
-
emit('update:modelValue', props.multiple === true ? [
|
|
616
|
+
emit('update:modelValue', props.multiple === true ? [val] : val)
|
|
558
617
|
return
|
|
559
618
|
}
|
|
560
619
|
|
|
561
|
-
const
|
|
562
|
-
model = props.modelValue.slice(),
|
|
620
|
+
const model = props.modelValue.slice(),
|
|
563
621
|
index = innerOptionsValue.value.findIndex(v => isDeepEqual(v, optValue))
|
|
564
622
|
|
|
565
623
|
if (index !== -1) {
|
|
566
|
-
emit('remove', { index, value: model.splice(index, 1)[
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
&& model.length >= props.maxValues
|
|
572
|
-
) return
|
|
624
|
+
emit('remove', { index, value: model.splice(index, 1)[0] })
|
|
625
|
+
} else {
|
|
626
|
+
if (props.maxValues !== void 0 && model.length >= props.maxValues) {
|
|
627
|
+
return
|
|
628
|
+
}
|
|
573
629
|
|
|
574
630
|
const val = props.emitValue === true ? optValue : opt
|
|
575
631
|
|
|
@@ -580,38 +636,44 @@ export default createComponent({
|
|
|
580
636
|
emit('update:modelValue', model)
|
|
581
637
|
}
|
|
582
638
|
|
|
583
|
-
function setOptionIndex
|
|
639
|
+
function setOptionIndex(index) {
|
|
584
640
|
if ($q.platform.is.desktop !== true) return
|
|
585
641
|
|
|
586
|
-
const val = index !== -1 && index < virtualScrollLength.value
|
|
587
|
-
? index
|
|
588
|
-
: -1
|
|
642
|
+
const val = index !== -1 && index < virtualScrollLength.value ? index : -1
|
|
589
643
|
|
|
590
644
|
if (optionIndex.value !== val) {
|
|
591
645
|
optionIndex.value = val
|
|
592
646
|
}
|
|
593
647
|
}
|
|
594
648
|
|
|
595
|
-
|
|
649
|
+
// oxlint-disable-next-line default-param-last
|
|
650
|
+
function moveOptionSelection(localOffset = 1, skipInputValue) {
|
|
596
651
|
if (menu.value === true) {
|
|
597
652
|
let index = optionIndex.value
|
|
598
653
|
do {
|
|
599
654
|
index = normalizeToInterval(
|
|
600
|
-
index +
|
|
655
|
+
index + localOffset,
|
|
601
656
|
-1,
|
|
602
657
|
virtualScrollLength.value - 1
|
|
603
658
|
)
|
|
604
|
-
}
|
|
605
|
-
|
|
659
|
+
} while (
|
|
660
|
+
index !== -1 &&
|
|
661
|
+
index !== optionIndex.value &&
|
|
662
|
+
isOptionDisabled.value(props.options[index]) === true
|
|
663
|
+
)
|
|
606
664
|
|
|
607
665
|
if (optionIndex.value !== index) {
|
|
608
666
|
setOptionIndex(index)
|
|
609
667
|
scrollTo(index)
|
|
610
668
|
|
|
611
|
-
if (
|
|
669
|
+
if (
|
|
670
|
+
skipInputValue !== true &&
|
|
671
|
+
props.useInput === true &&
|
|
672
|
+
props.fillInput === true
|
|
673
|
+
) {
|
|
612
674
|
setInputValue(
|
|
613
675
|
index >= 0
|
|
614
|
-
? getOptionLabel.value(props.options[
|
|
676
|
+
? getOptionLabel.value(props.options[index])
|
|
615
677
|
: defaultInputValue,
|
|
616
678
|
true
|
|
617
679
|
)
|
|
@@ -620,27 +682,29 @@ export default createComponent({
|
|
|
620
682
|
}
|
|
621
683
|
}
|
|
622
684
|
|
|
623
|
-
function getOption
|
|
685
|
+
function getOption(value, valueCache) {
|
|
624
686
|
const fn = opt => isDeepEqual(getOptionValue.value(opt), value)
|
|
625
687
|
return props.options.find(fn) || valueCache.find(fn) || value
|
|
626
688
|
}
|
|
627
689
|
|
|
628
|
-
function isOptionSelected
|
|
690
|
+
function isOptionSelected(opt) {
|
|
629
691
|
const val = getOptionValue.value(opt)
|
|
630
692
|
return innerOptionsValue.value.find(v => isDeepEqual(v, val)) !== void 0
|
|
631
693
|
}
|
|
632
694
|
|
|
633
|
-
function selectInputText
|
|
695
|
+
function selectInputText(e) {
|
|
634
696
|
if (
|
|
635
|
-
props.useInput === true
|
|
636
|
-
|
|
637
|
-
|
|
697
|
+
props.useInput === true &&
|
|
698
|
+
targetRef.value !== null &&
|
|
699
|
+
(e === void 0 ||
|
|
700
|
+
(targetRef.value === e.target &&
|
|
701
|
+
e.target.value === selectedString.value))
|
|
638
702
|
) {
|
|
639
703
|
targetRef.value.select()
|
|
640
704
|
}
|
|
641
705
|
}
|
|
642
706
|
|
|
643
|
-
function onTargetKeyup
|
|
707
|
+
function onTargetKeyup(e) {
|
|
644
708
|
// if ESC and we have an opened menu
|
|
645
709
|
// then stop propagation (might be caught by a QDialog
|
|
646
710
|
// and so it will also close the QDialog, which is wrong)
|
|
@@ -654,7 +718,7 @@ export default createComponent({
|
|
|
654
718
|
emit('keyup', e)
|
|
655
719
|
}
|
|
656
720
|
|
|
657
|
-
function onTargetAutocomplete
|
|
721
|
+
function onTargetAutocomplete(e) {
|
|
658
722
|
const { value } = e.target
|
|
659
723
|
|
|
660
724
|
if (e.keyCode !== void 0) {
|
|
@@ -678,14 +742,15 @@ export default createComponent({
|
|
|
678
742
|
if (typeof value === 'string' && value.length !== 0) {
|
|
679
743
|
const needle = value.toLocaleLowerCase()
|
|
680
744
|
const findFn = extractFn => {
|
|
681
|
-
const option = props.options.find(
|
|
745
|
+
const option = props.options.find(
|
|
746
|
+
opt => String(extractFn.value(opt)).toLocaleLowerCase() === needle
|
|
747
|
+
)
|
|
682
748
|
|
|
683
749
|
if (option === void 0) return false
|
|
684
750
|
|
|
685
751
|
if (innerValue.value.indexOf(option) === -1) {
|
|
686
752
|
toggleOption(option)
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
753
|
+
} else {
|
|
689
754
|
hidePopup()
|
|
690
755
|
}
|
|
691
756
|
|
|
@@ -693,37 +758,38 @@ export default createComponent({
|
|
|
693
758
|
}
|
|
694
759
|
const fillFn = afterFilter => {
|
|
695
760
|
if (
|
|
696
|
-
findFn(getOptionValue) !== true
|
|
697
|
-
|
|
698
|
-
|
|
761
|
+
findFn(getOptionValue) !== true &&
|
|
762
|
+
afterFilter !== true &&
|
|
763
|
+
findFn(getOptionLabel) !== true
|
|
699
764
|
) {
|
|
700
765
|
filter(value, true, () => fillFn(true))
|
|
701
766
|
}
|
|
702
767
|
}
|
|
703
768
|
|
|
704
769
|
fillFn()
|
|
705
|
-
}
|
|
706
|
-
else {
|
|
770
|
+
} else {
|
|
707
771
|
state.clearValue(e)
|
|
708
772
|
}
|
|
709
773
|
}
|
|
710
774
|
|
|
711
|
-
function onTargetKeypress
|
|
775
|
+
function onTargetKeypress(e) {
|
|
712
776
|
emit('keypress', e)
|
|
713
777
|
}
|
|
714
778
|
|
|
715
|
-
function onTargetKeydown
|
|
779
|
+
function onTargetKeydown(e) {
|
|
716
780
|
emit('keydown', e)
|
|
717
781
|
|
|
718
782
|
if (shouldIgnoreKey(e) === true) return
|
|
719
783
|
|
|
720
|
-
const newValueModeValid =
|
|
721
|
-
|
|
784
|
+
const newValueModeValid =
|
|
785
|
+
inputValue.value.length !== 0 &&
|
|
786
|
+
(props.newValueMode !== void 0 || props.onNewValue !== void 0)
|
|
722
787
|
|
|
723
|
-
const tabShouldSelect =
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
788
|
+
const tabShouldSelect =
|
|
789
|
+
e.shiftKey !== true &&
|
|
790
|
+
props.disableTabSelection !== true &&
|
|
791
|
+
props.multiple !== true &&
|
|
792
|
+
(optionIndex.value !== -1 || newValueModeValid === true)
|
|
727
793
|
|
|
728
794
|
// escape
|
|
729
795
|
if (e.keyCode === 27) {
|
|
@@ -738,16 +804,18 @@ export default createComponent({
|
|
|
738
804
|
}
|
|
739
805
|
|
|
740
806
|
if (
|
|
741
|
-
e.target === void 0
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
)
|
|
807
|
+
e.target === void 0 ||
|
|
808
|
+
e.target.id !== state.targetUid.value ||
|
|
809
|
+
state.editable.value !== true
|
|
810
|
+
) {
|
|
811
|
+
return
|
|
812
|
+
}
|
|
745
813
|
|
|
746
814
|
// down
|
|
747
815
|
if (
|
|
748
|
-
e.keyCode === 40
|
|
749
|
-
|
|
750
|
-
|
|
816
|
+
e.keyCode === 40 &&
|
|
817
|
+
state.innerLoading.value !== true &&
|
|
818
|
+
menu.value === false
|
|
751
819
|
) {
|
|
752
820
|
stopAndPrevent(e)
|
|
753
821
|
showPopup()
|
|
@@ -756,18 +824,17 @@ export default createComponent({
|
|
|
756
824
|
|
|
757
825
|
// backspace
|
|
758
826
|
if (
|
|
759
|
-
e.keyCode === 8
|
|
760
|
-
&&
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
)
|
|
764
|
-
&& props.hideSelected !== true
|
|
765
|
-
&& inputValue.value.length === 0
|
|
827
|
+
e.keyCode === 8 &&
|
|
828
|
+
(props.useChips === true || props.clearable === true) &&
|
|
829
|
+
props.hideSelected !== true &&
|
|
830
|
+
inputValue.value.length === 0
|
|
766
831
|
) {
|
|
767
|
-
if (
|
|
832
|
+
if (
|
|
833
|
+
props.multiple === true &&
|
|
834
|
+
Array.isArray(props.modelValue) === true
|
|
835
|
+
) {
|
|
768
836
|
removeAtIndex(props.modelValue.length - 1)
|
|
769
|
-
}
|
|
770
|
-
else if (props.multiple !== true && props.modelValue !== null) {
|
|
837
|
+
} else if (props.multiple !== true && props.modelValue !== null) {
|
|
771
838
|
emit('update:modelValue', null)
|
|
772
839
|
}
|
|
773
840
|
|
|
@@ -776,8 +843,8 @@ export default createComponent({
|
|
|
776
843
|
|
|
777
844
|
// home, end - 36, 35
|
|
778
845
|
if (
|
|
779
|
-
(e.keyCode === 35 || e.keyCode === 36)
|
|
780
|
-
|
|
846
|
+
(e.keyCode === 35 || e.keyCode === 36) &&
|
|
847
|
+
(typeof inputValue.value !== 'string' || inputValue.value.length === 0)
|
|
781
848
|
) {
|
|
782
849
|
stopAndPrevent(e)
|
|
783
850
|
optionIndex.value = -1
|
|
@@ -786,15 +853,17 @@ export default createComponent({
|
|
|
786
853
|
|
|
787
854
|
// pg up, pg down - 33, 34
|
|
788
855
|
if (
|
|
789
|
-
(e.keyCode === 33 || e.keyCode === 34)
|
|
790
|
-
|
|
856
|
+
(e.keyCode === 33 || e.keyCode === 34) &&
|
|
857
|
+
virtualScrollSliceSizeComputed.value !== void 0
|
|
791
858
|
) {
|
|
792
859
|
stopAndPrevent(e)
|
|
793
860
|
optionIndex.value = Math.max(
|
|
794
861
|
-1,
|
|
795
862
|
Math.min(
|
|
796
863
|
virtualScrollLength.value,
|
|
797
|
-
optionIndex.value +
|
|
864
|
+
optionIndex.value +
|
|
865
|
+
(e.keyCode === 33 ? -1 : 1) *
|
|
866
|
+
virtualScrollSliceSizeComputed.value.view
|
|
798
867
|
)
|
|
799
868
|
)
|
|
800
869
|
moveOptionSelection(e.keyCode === 33 ? 1 : -1, props.multiple)
|
|
@@ -815,20 +884,19 @@ export default createComponent({
|
|
|
815
884
|
|
|
816
885
|
// keyboard search when not having use-input
|
|
817
886
|
if (
|
|
818
|
-
optionsLength > 0
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
887
|
+
optionsLength > 0 &&
|
|
888
|
+
props.useInput !== true &&
|
|
889
|
+
e.key !== void 0 &&
|
|
890
|
+
e.key.length === 1 && // printable char
|
|
891
|
+
e.altKey === false && // not kbd shortcut
|
|
892
|
+
e.ctrlKey === false && // not kbd shortcut
|
|
893
|
+
e.metaKey === false && // not kbd shortcut, especially on macOS with Command key
|
|
894
|
+
(e.keyCode !== 32 || searchBuffer.length !== 0) // space in middle of search
|
|
826
895
|
) {
|
|
827
|
-
menu.value !== true
|
|
896
|
+
if (menu.value !== true) showPopup(e)
|
|
828
897
|
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
keyRepeat = searchBuffer.length === 1 && searchBuffer[ 0 ] === char
|
|
898
|
+
const char = e.key.toLocaleLowerCase(),
|
|
899
|
+
keyRepeat = searchBuffer.length === 1 && searchBuffer[0] === char
|
|
832
900
|
|
|
833
901
|
searchBufferExp = Date.now() + 1500
|
|
834
902
|
if (keyRepeat === false) {
|
|
@@ -836,18 +904,30 @@ export default createComponent({
|
|
|
836
904
|
searchBuffer += char
|
|
837
905
|
}
|
|
838
906
|
|
|
839
|
-
const searchRe = new RegExp(
|
|
907
|
+
const searchRe = new RegExp(
|
|
908
|
+
'^' +
|
|
909
|
+
searchBuffer
|
|
910
|
+
.split('')
|
|
911
|
+
.map(l => (reEscapeList.indexOf(l) !== -1 ? '\\' + l : l))
|
|
912
|
+
.join('.*'),
|
|
913
|
+
'i'
|
|
914
|
+
)
|
|
840
915
|
|
|
841
916
|
let index = optionIndex.value
|
|
842
917
|
|
|
843
|
-
if (
|
|
918
|
+
if (
|
|
919
|
+
keyRepeat === true ||
|
|
920
|
+
index < 0 ||
|
|
921
|
+
searchRe.test(getOptionLabel.value(props.options[index])) !== true
|
|
922
|
+
) {
|
|
844
923
|
do {
|
|
845
924
|
index = normalizeToInterval(index + 1, -1, optionsLength - 1)
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
isOptionDisabled.value(props.options[
|
|
849
|
-
|
|
850
|
-
|
|
925
|
+
} while (
|
|
926
|
+
index !== optionIndex.value &&
|
|
927
|
+
(isOptionDisabled.value(props.options[index]) === true ||
|
|
928
|
+
searchRe.test(getOptionLabel.value(props.options[index])) !==
|
|
929
|
+
true)
|
|
930
|
+
)
|
|
851
931
|
}
|
|
852
932
|
|
|
853
933
|
if (optionIndex.value !== index) {
|
|
@@ -855,8 +935,12 @@ export default createComponent({
|
|
|
855
935
|
setOptionIndex(index)
|
|
856
936
|
scrollTo(index)
|
|
857
937
|
|
|
858
|
-
if (
|
|
859
|
-
|
|
938
|
+
if (
|
|
939
|
+
index >= 0 &&
|
|
940
|
+
props.useInput === true &&
|
|
941
|
+
props.fillInput === true
|
|
942
|
+
) {
|
|
943
|
+
setInputValue(getOptionLabel.value(props.options[index]), true)
|
|
860
944
|
}
|
|
861
945
|
})
|
|
862
946
|
}
|
|
@@ -867,15 +951,17 @@ export default createComponent({
|
|
|
867
951
|
// enter, space (when not using use-input and not in search), or tab (when not using multiple and option selected)
|
|
868
952
|
// same target is checked above
|
|
869
953
|
if (
|
|
870
|
-
e.keyCode !== 13
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
)
|
|
954
|
+
e.keyCode !== 13 &&
|
|
955
|
+
(e.keyCode !== 32 || props.useInput === true || searchBuffer !== '') &&
|
|
956
|
+
(e.keyCode !== 9 || tabShouldSelect === false)
|
|
957
|
+
) {
|
|
958
|
+
return
|
|
959
|
+
}
|
|
874
960
|
|
|
875
|
-
e.keyCode !== 9
|
|
961
|
+
if (e.keyCode !== 9) stopAndPrevent(e)
|
|
876
962
|
|
|
877
963
|
if (optionIndex.value !== -1 && optionIndex.value < optionsLength) {
|
|
878
|
-
toggleOption(props.options[
|
|
964
|
+
toggleOption(props.options[optionIndex.value])
|
|
879
965
|
return
|
|
880
966
|
}
|
|
881
967
|
|
|
@@ -883,8 +969,7 @@ export default createComponent({
|
|
|
883
969
|
const done = (val, mode) => {
|
|
884
970
|
if (mode) {
|
|
885
971
|
if (validateNewValueMode(mode) !== true) return
|
|
886
|
-
}
|
|
887
|
-
else {
|
|
972
|
+
} else {
|
|
888
973
|
mode = props.newValueMode
|
|
889
974
|
}
|
|
890
975
|
|
|
@@ -903,8 +988,7 @@ export default createComponent({
|
|
|
903
988
|
|
|
904
989
|
if (props.onNewValue !== void 0) {
|
|
905
990
|
emit('newValue', inputValue.value, done)
|
|
906
|
-
}
|
|
907
|
-
else {
|
|
991
|
+
} else {
|
|
908
992
|
done(inputValue.value)
|
|
909
993
|
}
|
|
910
994
|
|
|
@@ -913,33 +997,32 @@ export default createComponent({
|
|
|
913
997
|
|
|
914
998
|
if (menu.value === true) {
|
|
915
999
|
closeMenu()
|
|
916
|
-
}
|
|
917
|
-
else if (state.innerLoading.value !== true) {
|
|
1000
|
+
} else if (state.innerLoading.value !== true) {
|
|
918
1001
|
showPopup()
|
|
919
1002
|
}
|
|
920
1003
|
}
|
|
921
1004
|
|
|
922
|
-
function getVirtualScrollEl
|
|
1005
|
+
function getVirtualScrollEl() {
|
|
923
1006
|
return hasDialog === true
|
|
924
1007
|
? menuContentRef.value
|
|
925
|
-
:
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
: void 0
|
|
929
|
-
)
|
|
1008
|
+
: menuRef.value !== null && menuRef.value.contentEl !== null
|
|
1009
|
+
? menuRef.value.contentEl
|
|
1010
|
+
: void 0
|
|
930
1011
|
}
|
|
931
1012
|
|
|
932
|
-
function getVirtualScrollTarget
|
|
1013
|
+
function getVirtualScrollTarget() {
|
|
933
1014
|
return getVirtualScrollEl()
|
|
934
1015
|
}
|
|
935
1016
|
|
|
936
|
-
function getSelection
|
|
1017
|
+
function getSelection() {
|
|
937
1018
|
if (props.hideSelected === true) {
|
|
938
1019
|
return []
|
|
939
1020
|
}
|
|
940
1021
|
|
|
941
|
-
if (slots[
|
|
942
|
-
return selectedScope.value
|
|
1022
|
+
if (slots['selected-item'] !== void 0) {
|
|
1023
|
+
return selectedScope.value
|
|
1024
|
+
.map(scope => slots['selected-item'](scope))
|
|
1025
|
+
.slice()
|
|
943
1026
|
}
|
|
944
1027
|
|
|
945
1028
|
if (slots.selected !== void 0) {
|
|
@@ -947,64 +1030,82 @@ export default createComponent({
|
|
|
947
1030
|
}
|
|
948
1031
|
|
|
949
1032
|
if (props.useChips === true) {
|
|
950
|
-
return selectedScope.value.map((scope, i) =>
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1033
|
+
return selectedScope.value.map((scope, i) =>
|
|
1034
|
+
h(
|
|
1035
|
+
QChip,
|
|
1036
|
+
{
|
|
1037
|
+
key: 'option-' + i,
|
|
1038
|
+
removable:
|
|
1039
|
+
state.editable.value === true &&
|
|
1040
|
+
isOptionDisabled.value(scope.opt) !== true,
|
|
1041
|
+
dense: true,
|
|
1042
|
+
textColor: props.color,
|
|
1043
|
+
tabindex: tabindex.value,
|
|
1044
|
+
onRemove() {
|
|
1045
|
+
scope.removeAtIndex(i)
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
() =>
|
|
1049
|
+
h('span', {
|
|
1050
|
+
class: 'ellipsis',
|
|
1051
|
+
[scope.html === true ? 'innerHTML' : 'textContent']:
|
|
1052
|
+
getOptionLabel.value(scope.opt)
|
|
1053
|
+
})
|
|
1054
|
+
)
|
|
1055
|
+
)
|
|
961
1056
|
}
|
|
962
1057
|
|
|
963
1058
|
return [
|
|
964
1059
|
h('span', {
|
|
965
1060
|
class: 'ellipsis',
|
|
966
|
-
[
|
|
1061
|
+
[valueAsHtml.value === true ? 'innerHTML' : 'textContent']:
|
|
1062
|
+
ariaCurrentValue.value
|
|
967
1063
|
})
|
|
968
1064
|
]
|
|
969
1065
|
}
|
|
970
1066
|
|
|
971
|
-
function getAllOptions
|
|
1067
|
+
function getAllOptions() {
|
|
972
1068
|
if (noOptions.value === true) {
|
|
973
|
-
return slots[
|
|
974
|
-
? slots[
|
|
1069
|
+
return slots['no-option'] !== void 0
|
|
1070
|
+
? slots['no-option']({ inputValue: inputValue.value })
|
|
975
1071
|
: void 0
|
|
976
1072
|
}
|
|
977
1073
|
|
|
978
|
-
const fn =
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1074
|
+
const fn =
|
|
1075
|
+
slots.option !== void 0
|
|
1076
|
+
? slots.option
|
|
1077
|
+
: scope =>
|
|
1078
|
+
h(
|
|
1079
|
+
QItem,
|
|
1080
|
+
{
|
|
1081
|
+
key: scope.index,
|
|
1082
|
+
...scope.itemProps
|
|
1083
|
+
},
|
|
1084
|
+
() =>
|
|
1085
|
+
h(QItemSection, () =>
|
|
1086
|
+
h(QItemLabel, () =>
|
|
1087
|
+
h('span', {
|
|
1088
|
+
[scope.html === true ? 'innerHTML' : 'textContent']:
|
|
1089
|
+
scope.label
|
|
1090
|
+
})
|
|
1091
|
+
)
|
|
1092
|
+
)
|
|
992
1093
|
)
|
|
993
|
-
)
|
|
994
|
-
})
|
|
995
|
-
}
|
|
996
1094
|
|
|
997
1095
|
let options = padVirtualScroll('div', optionScope.value.map(fn))
|
|
998
1096
|
|
|
999
|
-
if (slots[
|
|
1000
|
-
options = slots[
|
|
1097
|
+
if (slots['before-options'] !== void 0) {
|
|
1098
|
+
options = slots['before-options']().concat(options)
|
|
1001
1099
|
}
|
|
1002
1100
|
|
|
1003
|
-
return hMergeSlot(slots[
|
|
1101
|
+
return hMergeSlot(slots['after-options'], options)
|
|
1004
1102
|
}
|
|
1005
1103
|
|
|
1006
|
-
function getInput
|
|
1007
|
-
const attrs =
|
|
1104
|
+
function getInput(fromDialog, isTarget) {
|
|
1105
|
+
const attrs =
|
|
1106
|
+
isTarget === true
|
|
1107
|
+
? { ...comboboxAttrs.value, ...state.splitAttrs.attributes.value }
|
|
1108
|
+
: void 0
|
|
1008
1109
|
|
|
1009
1110
|
const data = {
|
|
1010
1111
|
ref: isTarget === true ? targetRef : void 0,
|
|
@@ -1018,7 +1119,8 @@ export default createComponent({
|
|
|
1018
1119
|
id: isTarget === true ? state.targetUid.value : void 0,
|
|
1019
1120
|
maxlength: props.maxlength,
|
|
1020
1121
|
autocomplete: props.autocomplete,
|
|
1021
|
-
'data-autofocus':
|
|
1122
|
+
'data-autofocus':
|
|
1123
|
+
fromDialog === true || props.autofocus === true || void 0,
|
|
1022
1124
|
disabled: props.disable === true,
|
|
1023
1125
|
readonly: props.readonly === true,
|
|
1024
1126
|
...inputControlEvents.value
|
|
@@ -1026,9 +1128,8 @@ export default createComponent({
|
|
|
1026
1128
|
|
|
1027
1129
|
if (fromDialog !== true && hasDialog === true) {
|
|
1028
1130
|
if (Array.isArray(data.class) === true) {
|
|
1029
|
-
data.class = [
|
|
1030
|
-
}
|
|
1031
|
-
else {
|
|
1131
|
+
data.class = [...data.class, 'no-pointer-events']
|
|
1132
|
+
} else {
|
|
1032
1133
|
data.class += ' no-pointer-events'
|
|
1033
1134
|
}
|
|
1034
1135
|
}
|
|
@@ -1036,7 +1137,7 @@ export default createComponent({
|
|
|
1036
1137
|
return h('input', data)
|
|
1037
1138
|
}
|
|
1038
1139
|
|
|
1039
|
-
function onInput
|
|
1140
|
+
function onInput(e) {
|
|
1040
1141
|
if (filterTimer !== null) {
|
|
1041
1142
|
clearTimeout(filterTimer)
|
|
1042
1143
|
filterTimer = null
|
|
@@ -1046,11 +1147,7 @@ export default createComponent({
|
|
|
1046
1147
|
inputValueTimer = null
|
|
1047
1148
|
}
|
|
1048
1149
|
|
|
1049
|
-
if (
|
|
1050
|
-
e
|
|
1051
|
-
&& e.target
|
|
1052
|
-
&& e.target.qComposing === true
|
|
1053
|
-
) return
|
|
1150
|
+
if (e && e.target && e.target.qComposing === true) return
|
|
1054
1151
|
|
|
1055
1152
|
setInputValue(e.target.value || '')
|
|
1056
1153
|
// mark it here as user input so that if updateInputValue is called
|
|
@@ -1059,8 +1156,8 @@ export default createComponent({
|
|
|
1059
1156
|
defaultInputValue = inputValue.value
|
|
1060
1157
|
|
|
1061
1158
|
if (
|
|
1062
|
-
state.focused.value !== true
|
|
1063
|
-
|
|
1159
|
+
state.focused.value !== true &&
|
|
1160
|
+
(hasDialog !== true || dialogFieldFocused.value === true)
|
|
1064
1161
|
) {
|
|
1065
1162
|
state.focus()
|
|
1066
1163
|
}
|
|
@@ -1073,14 +1170,17 @@ export default createComponent({
|
|
|
1073
1170
|
}
|
|
1074
1171
|
}
|
|
1075
1172
|
|
|
1076
|
-
function setInputValue
|
|
1173
|
+
function setInputValue(val, emitImmediately) {
|
|
1077
1174
|
if (inputValue.value !== val) {
|
|
1078
1175
|
inputValue.value = val
|
|
1079
1176
|
|
|
1080
|
-
if (
|
|
1177
|
+
if (
|
|
1178
|
+
emitImmediately === true ||
|
|
1179
|
+
props.inputDebounce === 0 ||
|
|
1180
|
+
props.inputDebounce === '0'
|
|
1181
|
+
) {
|
|
1081
1182
|
emit('inputValue', val)
|
|
1082
|
-
}
|
|
1083
|
-
else {
|
|
1183
|
+
} else {
|
|
1084
1184
|
inputValueTimer = setTimeout(() => {
|
|
1085
1185
|
inputValueTimer = null
|
|
1086
1186
|
emit('inputValue', val)
|
|
@@ -1089,7 +1189,7 @@ export default createComponent({
|
|
|
1089
1189
|
}
|
|
1090
1190
|
}
|
|
1091
1191
|
|
|
1092
|
-
function updateInputValue
|
|
1192
|
+
function updateInputValue(val, noFiltering, internal) {
|
|
1093
1193
|
userInputValue = internal !== true
|
|
1094
1194
|
|
|
1095
1195
|
if (props.useInput === true) {
|
|
@@ -1099,49 +1199,53 @@ export default createComponent({
|
|
|
1099
1199
|
defaultInputValue = val
|
|
1100
1200
|
}
|
|
1101
1201
|
|
|
1102
|
-
noFiltering !== true
|
|
1202
|
+
if (noFiltering !== true) filter(val)
|
|
1103
1203
|
}
|
|
1104
1204
|
}
|
|
1105
1205
|
|
|
1106
|
-
function filter
|
|
1206
|
+
function filter(val, keepClosed, afterUpdateFn) {
|
|
1107
1207
|
if (
|
|
1108
|
-
props.onFilter === void 0
|
|
1109
|
-
|
|
1110
|
-
)
|
|
1208
|
+
props.onFilter === void 0 ||
|
|
1209
|
+
(keepClosed !== true && state.focused.value !== true)
|
|
1210
|
+
) {
|
|
1211
|
+
return
|
|
1212
|
+
}
|
|
1111
1213
|
|
|
1112
1214
|
if (state.innerLoading.value === true) {
|
|
1113
1215
|
emit('filterAbort')
|
|
1114
|
-
}
|
|
1115
|
-
else {
|
|
1216
|
+
} else {
|
|
1116
1217
|
state.innerLoading.value = true
|
|
1117
1218
|
innerLoadingIndicator.value = true
|
|
1118
1219
|
}
|
|
1119
1220
|
|
|
1120
1221
|
if (
|
|
1121
|
-
val !== ''
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1222
|
+
val !== '' &&
|
|
1223
|
+
props.multiple !== true &&
|
|
1224
|
+
innerValue.value.length !== 0 &&
|
|
1225
|
+
userInputValue !== true &&
|
|
1226
|
+
val === getOptionLabel.value(innerValue.value[0])
|
|
1126
1227
|
) {
|
|
1127
1228
|
val = ''
|
|
1128
1229
|
}
|
|
1129
1230
|
|
|
1130
1231
|
const localFilterId = setTimeout(() => {
|
|
1131
|
-
menu.value === true
|
|
1232
|
+
if (menu.value === true) menu.value = false
|
|
1132
1233
|
}, 10)
|
|
1133
1234
|
|
|
1134
|
-
filterId !== null
|
|
1235
|
+
if (filterId !== null) clearTimeout(filterId)
|
|
1135
1236
|
filterId = localFilterId
|
|
1136
1237
|
|
|
1137
1238
|
emit(
|
|
1138
1239
|
'filter',
|
|
1139
1240
|
val,
|
|
1140
1241
|
(fn, afterFn) => {
|
|
1141
|
-
if (
|
|
1242
|
+
if (
|
|
1243
|
+
(keepClosed === true || state.focused.value === true) &&
|
|
1244
|
+
filterId === localFilterId
|
|
1245
|
+
) {
|
|
1142
1246
|
clearTimeout(filterId)
|
|
1143
1247
|
|
|
1144
|
-
typeof fn === 'function'
|
|
1248
|
+
if (typeof fn === 'function') fn()
|
|
1145
1249
|
|
|
1146
1250
|
// hide indicator to allow arrow to animate
|
|
1147
1251
|
innerLoadingIndicator.value = false
|
|
@@ -1151,18 +1255,25 @@ export default createComponent({
|
|
|
1151
1255
|
|
|
1152
1256
|
if (state.editable.value === true) {
|
|
1153
1257
|
if (keepClosed === true) {
|
|
1154
|
-
menu.value === true
|
|
1155
|
-
}
|
|
1156
|
-
else if (menu.value === true) {
|
|
1258
|
+
if (menu.value === true) hidePopup()
|
|
1259
|
+
} else if (menu.value === true) {
|
|
1157
1260
|
updateMenu(true)
|
|
1158
|
-
}
|
|
1159
|
-
else {
|
|
1261
|
+
} else {
|
|
1160
1262
|
menu.value = true
|
|
1161
1263
|
}
|
|
1162
1264
|
}
|
|
1163
1265
|
|
|
1164
|
-
typeof afterFn === 'function'
|
|
1165
|
-
|
|
1266
|
+
if (typeof afterFn === 'function') {
|
|
1267
|
+
nextTick(() => {
|
|
1268
|
+
afterFn(proxy)
|
|
1269
|
+
})
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
if (typeof afterUpdateFn === 'function') {
|
|
1273
|
+
nextTick(() => {
|
|
1274
|
+
afterUpdateFn(proxy)
|
|
1275
|
+
})
|
|
1276
|
+
}
|
|
1166
1277
|
})
|
|
1167
1278
|
}
|
|
1168
1279
|
},
|
|
@@ -1172,140 +1283,177 @@ export default createComponent({
|
|
|
1172
1283
|
state.innerLoading.value = false
|
|
1173
1284
|
innerLoadingIndicator.value = false
|
|
1174
1285
|
}
|
|
1175
|
-
|
|
1286
|
+
|
|
1287
|
+
if (menu.value === true) menu.value = false
|
|
1176
1288
|
}
|
|
1177
1289
|
)
|
|
1178
1290
|
}
|
|
1179
1291
|
|
|
1180
|
-
function getMenu
|
|
1181
|
-
return h(
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1292
|
+
function getMenu() {
|
|
1293
|
+
return h(
|
|
1294
|
+
QMenu,
|
|
1295
|
+
{
|
|
1296
|
+
ref: menuRef,
|
|
1297
|
+
class: menuContentClass.value,
|
|
1298
|
+
style: props.popupContentStyle,
|
|
1299
|
+
modelValue: menu.value,
|
|
1300
|
+
fit: props.menuShrink !== true,
|
|
1301
|
+
cover:
|
|
1302
|
+
props.optionsCover === true &&
|
|
1303
|
+
noOptions.value !== true &&
|
|
1304
|
+
props.useInput !== true,
|
|
1305
|
+
anchor: props.menuAnchor,
|
|
1306
|
+
self: props.menuSelf,
|
|
1307
|
+
offset: props.menuOffset,
|
|
1308
|
+
dark: isOptionsDark.value,
|
|
1309
|
+
noParentEvent: true,
|
|
1310
|
+
noRefocus: true,
|
|
1311
|
+
noFocus: true,
|
|
1312
|
+
noRouteDismiss: props.popupNoRouteDismiss,
|
|
1313
|
+
square: squaredMenu.value,
|
|
1314
|
+
transitionShow: props.transitionShow,
|
|
1315
|
+
transitionHide: props.transitionHide,
|
|
1316
|
+
transitionDuration: props.transitionDuration,
|
|
1317
|
+
separateClosePopup: true,
|
|
1318
|
+
...listboxAttrs.value,
|
|
1319
|
+
onScrollPassive: onVirtualScrollEvt,
|
|
1320
|
+
onBeforeShow: onControlPopupShow,
|
|
1321
|
+
onBeforeHide: onMenuBeforeHide,
|
|
1322
|
+
onShow: onMenuShow
|
|
1323
|
+
},
|
|
1324
|
+
getAllOptions
|
|
1325
|
+
)
|
|
1207
1326
|
}
|
|
1208
1327
|
|
|
1209
|
-
function onMenuBeforeHide
|
|
1328
|
+
function onMenuBeforeHide(e) {
|
|
1210
1329
|
onControlPopupHide(e)
|
|
1211
1330
|
closeMenu()
|
|
1212
1331
|
}
|
|
1213
1332
|
|
|
1214
|
-
function onMenuShow
|
|
1333
|
+
function onMenuShow() {
|
|
1215
1334
|
setVirtualScrollSize()
|
|
1216
1335
|
}
|
|
1217
1336
|
|
|
1218
|
-
function onDialogFieldFocus
|
|
1337
|
+
function onDialogFieldFocus(e) {
|
|
1219
1338
|
stop(e)
|
|
1220
1339
|
targetRef.value?.focus()
|
|
1221
1340
|
dialogFieldFocused.value = true
|
|
1222
|
-
window.scrollTo(
|
|
1341
|
+
window.scrollTo(
|
|
1342
|
+
window.pageXOffset || window.scrollX || document.body.scrollLeft || 0,
|
|
1343
|
+
0
|
|
1344
|
+
)
|
|
1223
1345
|
}
|
|
1224
1346
|
|
|
1225
|
-
function onDialogFieldBlur
|
|
1347
|
+
function onDialogFieldBlur(e) {
|
|
1226
1348
|
stop(e)
|
|
1227
1349
|
nextTick(() => {
|
|
1228
1350
|
dialogFieldFocused.value = false
|
|
1229
1351
|
})
|
|
1230
1352
|
}
|
|
1231
1353
|
|
|
1232
|
-
function getDialog
|
|
1354
|
+
function getDialog() {
|
|
1233
1355
|
const content = [
|
|
1234
|
-
h(
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1356
|
+
h(
|
|
1357
|
+
QField,
|
|
1358
|
+
{
|
|
1359
|
+
class: `col-auto ${state.fieldClass.value}`,
|
|
1360
|
+
...innerFieldProps.value,
|
|
1361
|
+
for: state.targetUid.value,
|
|
1362
|
+
dark: isOptionsDark.value,
|
|
1363
|
+
square: true,
|
|
1364
|
+
loading: innerLoadingIndicator.value,
|
|
1365
|
+
itemAligned: false,
|
|
1366
|
+
filled: true,
|
|
1367
|
+
stackLabel: inputValue.value.length !== 0,
|
|
1368
|
+
...state.splitAttrs.listeners.value,
|
|
1369
|
+
onFocus: onDialogFieldFocus,
|
|
1370
|
+
onBlur: onDialogFieldBlur
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
...slots,
|
|
1374
|
+
rawControl: () => state.getControl(true),
|
|
1375
|
+
before: void 0,
|
|
1376
|
+
after: void 0
|
|
1377
|
+
}
|
|
1378
|
+
)
|
|
1253
1379
|
]
|
|
1254
1380
|
|
|
1255
|
-
menu.value === true
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1381
|
+
if (menu.value === true) {
|
|
1382
|
+
content.push(
|
|
1383
|
+
h(
|
|
1384
|
+
'div',
|
|
1385
|
+
{
|
|
1386
|
+
ref: menuContentRef,
|
|
1387
|
+
class: menuContentClass.value + ' scroll',
|
|
1388
|
+
style: props.popupContentStyle,
|
|
1389
|
+
...listboxAttrs.value,
|
|
1390
|
+
onClick: prevent,
|
|
1391
|
+
onScrollPassive: onVirtualScrollEvt
|
|
1392
|
+
},
|
|
1393
|
+
getAllOptions()
|
|
1394
|
+
)
|
|
1395
|
+
)
|
|
1396
|
+
}
|
|
1265
1397
|
|
|
1266
|
-
return h(
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1398
|
+
return h(
|
|
1399
|
+
QDialog,
|
|
1400
|
+
{
|
|
1401
|
+
ref: dialogRef,
|
|
1402
|
+
modelValue: dialog.value,
|
|
1403
|
+
position: props.useInput === true ? 'top' : void 0,
|
|
1404
|
+
transitionShow: transitionShowComputed,
|
|
1405
|
+
transitionHide: props.transitionHide,
|
|
1406
|
+
transitionDuration: props.transitionDuration,
|
|
1407
|
+
noRouteDismiss: props.popupNoRouteDismiss,
|
|
1408
|
+
onBeforeShow: onControlPopupShow,
|
|
1409
|
+
onBeforeHide: onDialogBeforeHide,
|
|
1410
|
+
onHide: onDialogHide,
|
|
1411
|
+
onShow: onDialogShow
|
|
1412
|
+
},
|
|
1413
|
+
() =>
|
|
1414
|
+
h(
|
|
1415
|
+
'div',
|
|
1416
|
+
{
|
|
1417
|
+
class:
|
|
1418
|
+
'q-select__dialog' +
|
|
1419
|
+
(isOptionsDark.value === true
|
|
1420
|
+
? ' q-select__dialog--dark q-dark'
|
|
1421
|
+
: '') +
|
|
1422
|
+
(dialogFieldFocused.value === true
|
|
1423
|
+
? ' q-select__dialog--focused'
|
|
1424
|
+
: '')
|
|
1425
|
+
},
|
|
1426
|
+
content
|
|
1427
|
+
)
|
|
1428
|
+
)
|
|
1283
1429
|
}
|
|
1284
1430
|
|
|
1285
|
-
function onDialogBeforeHide
|
|
1431
|
+
function onDialogBeforeHide(e) {
|
|
1286
1432
|
onControlPopupHide(e)
|
|
1287
1433
|
|
|
1288
1434
|
if (dialogRef.value !== null) {
|
|
1289
1435
|
dialogRef.value.__updateRefocusTarget(
|
|
1290
|
-
state.rootRef.value.querySelector(
|
|
1436
|
+
state.rootRef.value.querySelector(
|
|
1437
|
+
'.q-field__native > [tabindex]:last-child'
|
|
1438
|
+
)
|
|
1291
1439
|
)
|
|
1292
1440
|
}
|
|
1293
1441
|
|
|
1294
1442
|
state.focused.value = false
|
|
1295
1443
|
}
|
|
1296
1444
|
|
|
1297
|
-
function onDialogHide
|
|
1445
|
+
function onDialogHide(e) {
|
|
1298
1446
|
hidePopup()
|
|
1299
|
-
state.focused.value === false
|
|
1447
|
+
if (state.focused.value === false) emit('blur', e)
|
|
1300
1448
|
resetInputValue()
|
|
1301
1449
|
}
|
|
1302
1450
|
|
|
1303
|
-
function onDialogShow
|
|
1451
|
+
function onDialogShow() {
|
|
1304
1452
|
const el = document.activeElement
|
|
1305
1453
|
if (
|
|
1306
|
-
(el === null || el.id !== state.targetUid.value)
|
|
1307
|
-
|
|
1308
|
-
|
|
1454
|
+
(el === null || el.id !== state.targetUid.value) &&
|
|
1455
|
+
targetRef.value !== null &&
|
|
1456
|
+
targetRef.value !== el
|
|
1309
1457
|
) {
|
|
1310
1458
|
targetRef.value.focus()
|
|
1311
1459
|
}
|
|
@@ -1313,7 +1461,7 @@ export default createComponent({
|
|
|
1313
1461
|
setVirtualScrollSize()
|
|
1314
1462
|
}
|
|
1315
1463
|
|
|
1316
|
-
function closeMenu
|
|
1464
|
+
function closeMenu() {
|
|
1317
1465
|
if (dialog.value === true) return
|
|
1318
1466
|
|
|
1319
1467
|
optionIndex.value = -1
|
|
@@ -1336,7 +1484,7 @@ export default createComponent({
|
|
|
1336
1484
|
}
|
|
1337
1485
|
}
|
|
1338
1486
|
|
|
1339
|
-
function showPopup
|
|
1487
|
+
function showPopup(e) {
|
|
1340
1488
|
if (state.editable.value !== true) return
|
|
1341
1489
|
|
|
1342
1490
|
if (hasDialog === true) {
|
|
@@ -1345,50 +1493,54 @@ export default createComponent({
|
|
|
1345
1493
|
nextTick(() => {
|
|
1346
1494
|
state.focus()
|
|
1347
1495
|
})
|
|
1348
|
-
}
|
|
1349
|
-
else {
|
|
1496
|
+
} else {
|
|
1350
1497
|
state.focus()
|
|
1351
1498
|
}
|
|
1352
1499
|
|
|
1353
1500
|
if (props.onFilter !== void 0) {
|
|
1354
1501
|
filter(inputValue.value)
|
|
1355
|
-
}
|
|
1356
|
-
else if (noOptions.value !== true || slots[ 'no-option' ] !== void 0) {
|
|
1502
|
+
} else if (noOptions.value !== true || slots['no-option'] !== void 0) {
|
|
1357
1503
|
menu.value = true
|
|
1358
1504
|
}
|
|
1359
1505
|
}
|
|
1360
1506
|
|
|
1361
|
-
function hidePopup
|
|
1507
|
+
function hidePopup() {
|
|
1362
1508
|
dialog.value = false
|
|
1363
1509
|
closeMenu()
|
|
1364
1510
|
}
|
|
1365
1511
|
|
|
1366
|
-
function resetInputValue
|
|
1367
|
-
props.useInput === true
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1512
|
+
function resetInputValue() {
|
|
1513
|
+
if (props.useInput === true) {
|
|
1514
|
+
updateInputValue(
|
|
1515
|
+
props.multiple !== true &&
|
|
1516
|
+
props.fillInput === true &&
|
|
1517
|
+
innerValue.value.length !== 0
|
|
1518
|
+
? getOptionLabel.value(innerValue.value[0]) || ''
|
|
1519
|
+
: '',
|
|
1520
|
+
true,
|
|
1521
|
+
true
|
|
1522
|
+
)
|
|
1523
|
+
}
|
|
1374
1524
|
}
|
|
1375
1525
|
|
|
1376
|
-
function updateMenu
|
|
1377
|
-
let
|
|
1526
|
+
function updateMenu(show) {
|
|
1527
|
+
let localOptionIndex = -1
|
|
1378
1528
|
|
|
1379
1529
|
if (show === true) {
|
|
1380
1530
|
if (innerValue.value.length !== 0) {
|
|
1381
|
-
const val = getOptionValue.value(innerValue.value[
|
|
1382
|
-
|
|
1531
|
+
const val = getOptionValue.value(innerValue.value[0])
|
|
1532
|
+
localOptionIndex = props.options.findIndex(v =>
|
|
1533
|
+
isDeepEqual(getOptionValue.value(v), val)
|
|
1534
|
+
)
|
|
1383
1535
|
}
|
|
1384
1536
|
|
|
1385
|
-
localResetVirtualScroll(
|
|
1537
|
+
localResetVirtualScroll(localOptionIndex)
|
|
1386
1538
|
}
|
|
1387
1539
|
|
|
1388
|
-
setOptionIndex(
|
|
1540
|
+
setOptionIndex(localOptionIndex)
|
|
1389
1541
|
}
|
|
1390
1542
|
|
|
1391
|
-
function rerenderMenu
|
|
1543
|
+
function rerenderMenu(newLength, oldLength) {
|
|
1392
1544
|
if (menu.value === true && state.innerLoading.value === false) {
|
|
1393
1545
|
localResetVirtualScroll(-1, true)
|
|
1394
1546
|
|
|
@@ -1396,8 +1548,7 @@ export default createComponent({
|
|
|
1396
1548
|
if (menu.value === true && state.innerLoading.value === false) {
|
|
1397
1549
|
if (newLength > oldLength) {
|
|
1398
1550
|
localResetVirtualScroll()
|
|
1399
|
-
}
|
|
1400
|
-
else {
|
|
1551
|
+
} else {
|
|
1401
1552
|
updateMenu(true)
|
|
1402
1553
|
}
|
|
1403
1554
|
}
|
|
@@ -1405,38 +1556,43 @@ export default createComponent({
|
|
|
1405
1556
|
}
|
|
1406
1557
|
}
|
|
1407
1558
|
|
|
1408
|
-
function updateMenuPosition
|
|
1559
|
+
function updateMenuPosition() {
|
|
1409
1560
|
if (dialog.value === false && menuRef.value !== null) {
|
|
1410
1561
|
menuRef.value.updatePosition()
|
|
1411
1562
|
}
|
|
1412
1563
|
}
|
|
1413
1564
|
|
|
1414
|
-
function onControlPopupShow
|
|
1415
|
-
e !== void 0
|
|
1565
|
+
function onControlPopupShow(e) {
|
|
1566
|
+
if (e !== void 0) stop(e)
|
|
1416
1567
|
emit('popupShow', e)
|
|
1417
1568
|
state.hasPopupOpen = true
|
|
1418
1569
|
state.onControlFocusin(e)
|
|
1419
1570
|
}
|
|
1420
1571
|
|
|
1421
|
-
function onControlPopupHide
|
|
1422
|
-
e !== void 0
|
|
1572
|
+
function onControlPopupHide(e) {
|
|
1573
|
+
if (e !== void 0) stop(e)
|
|
1423
1574
|
emit('popupHide', e)
|
|
1424
1575
|
state.hasPopupOpen = false
|
|
1425
1576
|
state.onControlFocusout(e)
|
|
1426
1577
|
}
|
|
1427
1578
|
|
|
1428
|
-
function updatePreState
|
|
1429
|
-
hasDialog =
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
props.
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1579
|
+
function updatePreState() {
|
|
1580
|
+
hasDialog =
|
|
1581
|
+
$q.platform.is.mobile !== true && props.behavior !== 'dialog'
|
|
1582
|
+
? false
|
|
1583
|
+
: props.behavior !== 'menu' &&
|
|
1584
|
+
(props.useInput === true
|
|
1585
|
+
? slots['no-option'] !== void 0 ||
|
|
1586
|
+
props.onFilter !== void 0 ||
|
|
1587
|
+
noOptions.value === false
|
|
1588
|
+
: true)
|
|
1589
|
+
|
|
1590
|
+
transitionShowComputed =
|
|
1591
|
+
$q.platform.is.ios === true &&
|
|
1592
|
+
hasDialog === true &&
|
|
1593
|
+
props.useInput === true
|
|
1594
|
+
? 'fade'
|
|
1595
|
+
: props.transitionShow
|
|
1440
1596
|
}
|
|
1441
1597
|
|
|
1442
1598
|
onBeforeUpdate(updatePreState)
|
|
@@ -1445,20 +1601,27 @@ export default createComponent({
|
|
|
1445
1601
|
updatePreState()
|
|
1446
1602
|
|
|
1447
1603
|
onBeforeUnmount(() => {
|
|
1448
|
-
filterTimer !== null
|
|
1449
|
-
inputValueTimer !== null
|
|
1604
|
+
if (filterTimer !== null) clearTimeout(filterTimer)
|
|
1605
|
+
if (inputValueTimer !== null) clearTimeout(inputValueTimer)
|
|
1450
1606
|
})
|
|
1451
1607
|
|
|
1452
1608
|
// expose public methods
|
|
1453
1609
|
Object.assign(proxy, {
|
|
1454
|
-
showPopup,
|
|
1455
|
-
|
|
1610
|
+
showPopup,
|
|
1611
|
+
hidePopup,
|
|
1612
|
+
removeAtIndex,
|
|
1613
|
+
add,
|
|
1614
|
+
toggleOption,
|
|
1456
1615
|
getOptionIndex: () => optionIndex.value,
|
|
1457
|
-
setOptionIndex,
|
|
1458
|
-
|
|
1616
|
+
setOptionIndex,
|
|
1617
|
+
moveOptionSelection,
|
|
1618
|
+
filter,
|
|
1619
|
+
updateMenuPosition,
|
|
1620
|
+
updateInputValue,
|
|
1459
1621
|
isOptionSelected,
|
|
1460
1622
|
getEmittingOptionValue,
|
|
1461
|
-
isOptionDisabled: (...args) =>
|
|
1623
|
+
isOptionDisabled: (...args) =>
|
|
1624
|
+
isOptionDisabled.value.apply(null, args) === true,
|
|
1462
1625
|
getOptionValue: (...args) => getOptionValue.value.apply(null, args),
|
|
1463
1626
|
getOptionLabel: (...args) => getOptionLabel.value.apply(null, args)
|
|
1464
1627
|
})
|
|
@@ -1466,10 +1629,11 @@ export default createComponent({
|
|
|
1466
1629
|
Object.assign(state, {
|
|
1467
1630
|
innerValue,
|
|
1468
1631
|
|
|
1469
|
-
fieldClass: computed(
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1632
|
+
fieldClass: computed(
|
|
1633
|
+
() =>
|
|
1634
|
+
`q-select q-field--auto-height q-select--with${props.useInput !== true ? 'out' : ''}-input` +
|
|
1635
|
+
` q-select--with${props.useChips !== true ? 'out' : ''}-chips` +
|
|
1636
|
+
` q-select--${props.multiple === true ? 'multiple' : 'single'}`
|
|
1473
1637
|
),
|
|
1474
1638
|
|
|
1475
1639
|
inputRef,
|
|
@@ -1477,38 +1641,39 @@ export default createComponent({
|
|
|
1477
1641
|
hasValue,
|
|
1478
1642
|
showPopup,
|
|
1479
1643
|
|
|
1480
|
-
floatingLabel: computed(
|
|
1481
|
-
(
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1644
|
+
floatingLabel: computed(
|
|
1645
|
+
() =>
|
|
1646
|
+
(props.hideSelected !== true && hasValue.value === true) ||
|
|
1647
|
+
typeof inputValue.value === 'number' ||
|
|
1648
|
+
inputValue.value.length !== 0 ||
|
|
1649
|
+
fieldValueIsFilled(props.displayValue)
|
|
1485
1650
|
),
|
|
1486
1651
|
|
|
1487
1652
|
getControlChild: () => {
|
|
1488
1653
|
if (
|
|
1489
|
-
state.editable.value !== false &&
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
)
|
|
1654
|
+
state.editable.value !== false &&
|
|
1655
|
+
(dialog.value === true || // dialog always has menu displayed, so need to render it
|
|
1656
|
+
noOptions.value !== true ||
|
|
1657
|
+
slots['no-option'] !== void 0)
|
|
1494
1658
|
) {
|
|
1495
1659
|
return hasDialog === true ? getDialog() : getMenu()
|
|
1496
|
-
}
|
|
1497
|
-
else if (state.hasPopupOpen === true) {
|
|
1660
|
+
} else if (state.hasPopupOpen === true) {
|
|
1498
1661
|
// explicitly set it otherwise TAB will not blur component
|
|
1499
1662
|
state.hasPopupOpen = false
|
|
1500
1663
|
}
|
|
1501
1664
|
},
|
|
1502
1665
|
|
|
1503
1666
|
controlEvents: {
|
|
1504
|
-
onFocusin
|
|
1505
|
-
|
|
1667
|
+
onFocusin(e) {
|
|
1668
|
+
state.onControlFocusin(e)
|
|
1669
|
+
},
|
|
1670
|
+
onFocusout(e) {
|
|
1506
1671
|
state.onControlFocusout(e, () => {
|
|
1507
1672
|
resetInputValue()
|
|
1508
1673
|
closeMenu()
|
|
1509
1674
|
})
|
|
1510
1675
|
},
|
|
1511
|
-
onClick
|
|
1676
|
+
onClick(e) {
|
|
1512
1677
|
// label from QField will propagate click on the input
|
|
1513
1678
|
prevent(e)
|
|
1514
1679
|
|
|
@@ -1524,7 +1689,8 @@ export default createComponent({
|
|
|
1524
1689
|
|
|
1525
1690
|
getControl: fromDialog => {
|
|
1526
1691
|
const child = getSelection()
|
|
1527
|
-
const isTarget =
|
|
1692
|
+
const isTarget =
|
|
1693
|
+
fromDialog === true || dialog.value !== true || hasDialog !== true
|
|
1528
1694
|
|
|
1529
1695
|
if (props.useInput === true) {
|
|
1530
1696
|
child.push(getInput(fromDialog, isTarget))
|
|
@@ -1541,7 +1707,8 @@ export default createComponent({
|
|
|
1541
1707
|
id: isTarget === true ? state.targetUid.value : void 0,
|
|
1542
1708
|
value: ariaCurrentValue.value,
|
|
1543
1709
|
readonly: true,
|
|
1544
|
-
'data-autofocus':
|
|
1710
|
+
'data-autofocus':
|
|
1711
|
+
fromDialog === true || props.autofocus === true || void 0,
|
|
1545
1712
|
...attrs,
|
|
1546
1713
|
onKeydown: onTargetKeydown,
|
|
1547
1714
|
onKeyup: onTargetKeyup,
|
|
@@ -1549,7 +1716,11 @@ export default createComponent({
|
|
|
1549
1716
|
})
|
|
1550
1717
|
)
|
|
1551
1718
|
|
|
1552
|
-
if (
|
|
1719
|
+
if (
|
|
1720
|
+
isTarget === true &&
|
|
1721
|
+
typeof props.autocomplete === 'string' &&
|
|
1722
|
+
props.autocomplete.length !== 0
|
|
1723
|
+
) {
|
|
1553
1724
|
child.push(
|
|
1554
1725
|
h('input', {
|
|
1555
1726
|
class: 'q-select__autocomplete-input',
|
|
@@ -1561,37 +1732,57 @@ export default createComponent({
|
|
|
1561
1732
|
}
|
|
1562
1733
|
}
|
|
1563
1734
|
|
|
1564
|
-
if (
|
|
1565
|
-
|
|
1735
|
+
if (
|
|
1736
|
+
nameProp.value !== void 0 &&
|
|
1737
|
+
props.disable !== true &&
|
|
1738
|
+
innerOptionsValue.value.length !== 0
|
|
1739
|
+
) {
|
|
1740
|
+
const opts = innerOptionsValue.value.map(value =>
|
|
1741
|
+
h('option', { value, selected: true })
|
|
1742
|
+
)
|
|
1566
1743
|
|
|
1567
1744
|
child.push(
|
|
1568
|
-
h(
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1745
|
+
h(
|
|
1746
|
+
'select',
|
|
1747
|
+
{
|
|
1748
|
+
class: 'hidden',
|
|
1749
|
+
name: nameProp.value,
|
|
1750
|
+
multiple: props.multiple
|
|
1751
|
+
},
|
|
1752
|
+
opts
|
|
1753
|
+
)
|
|
1573
1754
|
)
|
|
1574
1755
|
}
|
|
1575
1756
|
|
|
1576
|
-
const attrs =
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1757
|
+
const attrs =
|
|
1758
|
+
props.useInput === true || isTarget !== true
|
|
1759
|
+
? void 0
|
|
1760
|
+
: state.splitAttrs.attributes.value
|
|
1761
|
+
|
|
1762
|
+
return h(
|
|
1763
|
+
'div',
|
|
1764
|
+
{
|
|
1765
|
+
class: 'q-field__native row items-center',
|
|
1766
|
+
...attrs,
|
|
1767
|
+
...state.splitAttrs.listeners.value
|
|
1768
|
+
},
|
|
1769
|
+
child
|
|
1770
|
+
)
|
|
1583
1771
|
},
|
|
1584
1772
|
|
|
1585
|
-
getInnerAppend: () =>
|
|
1586
|
-
props.loading !== true &&
|
|
1773
|
+
getInnerAppend: () =>
|
|
1774
|
+
props.loading !== true &&
|
|
1775
|
+
innerLoadingIndicator.value !== true &&
|
|
1776
|
+
props.hideDropdownIcon !== true
|
|
1587
1777
|
? [
|
|
1588
1778
|
h(QIcon, {
|
|
1589
|
-
class:
|
|
1779
|
+
class:
|
|
1780
|
+
'q-select__dropdown-icon' +
|
|
1781
|
+
(menu.value === true ? ' rotate-180' : ''),
|
|
1590
1782
|
name: dropdownArrowIcon.value
|
|
1591
1783
|
})
|
|
1592
1784
|
]
|
|
1593
1785
|
: null
|
|
1594
|
-
)
|
|
1595
1786
|
})
|
|
1596
1787
|
|
|
1597
1788
|
return useField(state)
|