quasar 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/QBreadcrumbsEl.json +53 -0
- package/dist/api/QBtn.json +42 -5
- package/dist/api/QBtnDropdown.json +1 -1
- package/dist/api/QChip.json +1 -1
- package/dist/api/QDialog.json +6 -0
- package/dist/api/QExpansionItem.json +1 -1
- package/dist/api/QItem.json +53 -0
- package/dist/api/QRating.json +13 -0
- package/dist/api/QRouteTab.json +6 -2
- package/dist/babel-transforms/imports.js +2 -12
- package/dist/icon-set/bootstrap-icons.umd.min.js +1 -1
- package/dist/icon-set/eva-icons.umd.min.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.min.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.min.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.min.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.min.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.min.js +1 -1
- package/dist/icon-set/line-awesome.umd.min.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.min.js +1 -1
- package/dist/icon-set/material-icons-round.umd.min.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.min.js +1 -1
- package/dist/icon-set/material-icons.umd.min.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.min.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.min.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.min.js +1 -1
- package/dist/icon-set/mdi-v3.umd.min.js +1 -1
- package/dist/icon-set/mdi-v4.umd.min.js +1 -1
- package/dist/icon-set/mdi-v5.umd.min.js +1 -1
- package/dist/icon-set/mdi-v6.umd.min.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.min.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.min.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.min.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.min.js +2 -2
- package/dist/icon-set/svg-ionicons-v4.umd.min.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.min.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.min.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.min.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.min.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.min.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.min.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.min.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.min.js +2 -2
- package/dist/icon-set/svg-material-symbols-rounded.umd.min.js +2 -2
- package/dist/icon-set/svg-material-symbols-sharp.umd.min.js +2 -2
- package/dist/icon-set/svg-mdi-v4.umd.min.js +1 -1
- package/dist/icon-set/svg-mdi-v5.umd.min.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.min.js +1 -1
- package/dist/icon-set/svg-themify.umd.min.js +1 -1
- package/dist/icon-set/themify.umd.min.js +1 -1
- package/dist/lang/ar.umd.min.js +1 -1
- package/dist/lang/az-latn.umd.min.js +1 -1
- package/dist/lang/bg.umd.min.js +1 -1
- package/dist/lang/ca.umd.min.js +1 -1
- package/dist/lang/cs.umd.min.js +1 -1
- package/dist/lang/da.umd.min.js +1 -1
- package/dist/lang/de.umd.min.js +1 -1
- package/dist/lang/el.umd.min.js +1 -1
- package/dist/lang/en-gb.umd.min.js +1 -1
- package/dist/lang/en-us.umd.min.js +1 -1
- package/dist/lang/eo.umd.min.js +1 -1
- package/dist/lang/es.umd.min.js +1 -1
- package/dist/lang/et.umd.min.js +1 -1
- package/dist/lang/eu.umd.min.js +1 -1
- package/dist/lang/fa-ir.umd.min.js +1 -1
- package/dist/lang/fa.umd.min.js +1 -1
- package/dist/lang/fi.umd.min.js +1 -1
- package/dist/lang/fr.umd.min.js +1 -1
- package/dist/lang/gn.umd.min.js +1 -1
- package/dist/lang/he.umd.min.js +1 -1
- package/dist/lang/hr.umd.min.js +1 -1
- package/dist/lang/hu.umd.min.js +1 -1
- package/dist/lang/id.umd.min.js +1 -1
- package/dist/lang/is.umd.min.js +1 -1
- package/dist/lang/it.umd.min.js +1 -1
- package/dist/lang/ja.umd.min.js +1 -1
- package/dist/lang/km.umd.min.js +1 -1
- package/dist/lang/ko-kr.umd.min.js +1 -1
- package/dist/lang/kur-ckb.umd.min.js +1 -1
- package/dist/lang/kz.umd.min.js +1 -1
- package/dist/lang/lu.umd.min.js +1 -1
- package/dist/lang/lv.umd.min.js +1 -1
- package/dist/lang/ml.umd.min.js +1 -1
- package/dist/lang/mm.umd.min.js +1 -1
- package/dist/lang/ms.umd.min.js +1 -1
- package/dist/lang/my.umd.min.js +1 -1
- package/dist/lang/nb-no.umd.min.js +1 -1
- package/dist/lang/nl.umd.min.js +2 -2
- package/dist/lang/pl.umd.min.js +1 -1
- package/dist/lang/pt-br.umd.min.js +1 -1
- package/dist/lang/pt.umd.min.js +1 -1
- package/dist/lang/ro.umd.min.js +1 -1
- package/dist/lang/ru.umd.min.js +1 -1
- package/dist/lang/sk.umd.min.js +1 -1
- package/dist/lang/sl.umd.min.js +1 -1
- package/dist/lang/sm.umd.min.js +1 -1
- package/dist/lang/sr.umd.min.js +1 -1
- package/dist/lang/sv.umd.min.js +1 -1
- package/dist/lang/ta.umd.min.js +1 -1
- package/dist/lang/th.umd.min.js +1 -1
- package/dist/lang/tr.umd.min.js +1 -1
- package/dist/lang/ug.umd.min.js +1 -1
- package/dist/lang/uk.umd.min.js +1 -1
- package/dist/lang/uz-Cyrl.umd.min.js +1 -1
- package/dist/lang/uz-Latn.umd.min.js +1 -1
- package/dist/lang/vi.umd.min.js +1 -1
- package/dist/lang/zh-hans.umd.min.js +1 -1
- package/dist/lang/zh-hant.umd.min.js +1 -1
- package/dist/quasar.addon.css +1 -1
- package/dist/quasar.addon.rtl.css +1 -1
- package/dist/quasar.common.js +2 -2
- package/dist/quasar.css +43 -288
- package/dist/quasar.esm.js +2 -2
- package/dist/quasar.ie.polyfills.js +1 -1
- package/dist/quasar.ie.polyfills.umd.min.js +1 -1
- package/dist/quasar.min.css +1 -1
- package/dist/quasar.rtl.css +46 -408
- package/dist/quasar.rtl.min.css +1 -1
- package/dist/quasar.sass +3 -7
- package/dist/quasar.styl +3 -7
- package/dist/quasar.umd.js +1062 -867
- package/dist/quasar.umd.min.js +2 -2
- package/dist/quasar.umd.modern.js +1017 -854
- package/dist/quasar.umd.modern.min.js +2 -2
- package/dist/types/index.d.ts +8 -0
- package/dist/types/utils/run-sequential-promises.d.ts +1 -1
- package/dist/vetur/quasar-attributes.json +8 -0
- package/dist/vetur/quasar-tags.json +3 -1
- package/dist/web-types/web-types.json +66 -5
- package/lang/nl.js +2 -2
- package/package.json +1 -1
- package/src/body.js +1 -1
- package/src/components/avatar/QAvatar.js +1 -1
- package/src/components/badge/QBadge.js +1 -1
- package/src/components/banner/QBanner.js +1 -1
- package/src/components/bar/QBar.js +1 -1
- package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +7 -4
- package/src/components/breadcrumbs/QBreadcrumbsEl.json +56 -0
- package/src/components/btn/QBtn.js +7 -29
- package/src/components/btn/QBtn.json +43 -5
- package/src/components/btn-dropdown/QBtnDropdown.js +2 -2
- package/src/components/btn-dropdown/QBtnDropdown.json +1 -1
- package/src/components/btn-group/QBtnGroup.js +1 -1
- package/src/components/btn-toggle/QBtnToggle.js +1 -1
- package/src/components/card/QCard.js +1 -1
- package/src/components/card/QCardActions.js +1 -1
- package/src/components/card/QCardSection.js +1 -1
- package/src/components/carousel/QCarousel.js +2 -2
- package/src/components/carousel/QCarouselControl.js +1 -1
- package/src/components/carousel/QCarouselSlide.js +1 -1
- package/src/components/checkbox/QCheckbox.js +1 -1
- package/src/components/chip/QChip.js +2 -2
- package/src/components/chip/QChip.json +1 -1
- package/src/components/circular-progress/QCircularProgress.js +1 -1
- package/src/components/color/QColor.js +1 -1
- package/src/components/date/QDate.js +3 -3
- package/src/components/dialog/QDialog.js +22 -7
- package/src/components/dialog/QDialog.json +7 -0
- package/src/components/dialog-bottom-sheet/BottomSheet.js +1 -1
- package/src/components/dialog-plugin/DialogPlugin.js +2 -2
- package/src/components/drawer/QDrawer.js +13 -7
- package/src/components/editor/QEditor.js +2 -2
- package/src/components/editor/editor-utils.js +2 -2
- package/src/components/expansion-item/QExpansionItem.js +29 -14
- package/src/components/expansion-item/QExpansionItem.json +1 -1
- package/src/components/fab/QFab.js +2 -2
- package/src/components/fab/QFabAction.js +1 -1
- package/src/components/field/QField.js +2 -2
- package/src/components/file/QFile.js +1 -1
- package/src/components/footer/QFooter.js +2 -2
- package/src/components/form/QForm.js +3 -3
- package/src/components/header/QHeader.js +2 -2
- package/src/components/icon/QIcon.js +1 -1
- package/src/components/img/QImg.js +1 -1
- package/src/components/infinite-scroll/QInfiniteScroll.js +1 -1
- package/src/components/input/QInput.js +1 -1
- package/src/components/intersection/QIntersection.js +1 -1
- package/src/components/item/QItem.js +39 -33
- package/src/components/item/QItem.json +56 -0
- package/src/components/item/QItemLabel.js +1 -1
- package/src/components/item/QItemSection.js +1 -1
- package/src/components/item/QList.js +1 -1
- package/src/components/knob/QKnob.js +2 -2
- package/src/components/layout/QLayout.js +2 -2
- package/src/components/linear-progress/QLinearProgress.js +1 -1
- package/src/components/markup-table/QMarkupTable.js +1 -1
- package/src/components/menu/ClickOutside.js +1 -1
- package/src/components/menu/QMenu.js +16 -7
- package/src/components/no-ssr/QNoSsr.js +1 -1
- package/src/components/option-group/QOptionGroup.js +1 -1
- package/src/components/page/QPage.js +1 -1
- package/src/components/page/QPageContainer.js +1 -1
- package/src/components/page-sticky/QPageSticky.js +1 -1
- package/src/components/pagination/QPagination.js +2 -2
- package/src/components/parallax/QParallax.js +1 -1
- package/src/components/popup-edit/QPopupEdit.js +6 -12
- package/src/components/popup-proxy/QPopupProxy.js +1 -1
- package/src/components/pull-to-refresh/QPullToRefresh.js +1 -1
- package/src/components/radio/QRadio.js +5 -4
- package/src/components/rating/QRating.js +46 -15
- package/src/components/rating/QRating.json +11 -0
- package/src/components/resize-observer/QResizeObserver.js +1 -1
- package/src/components/responsive/QResponsive.js +1 -1
- package/src/components/scroll-area/QScrollArea.js +2 -2
- package/src/components/select/QSelect.js +3 -3
- package/src/components/skeleton/QSkeleton.js +1 -1
- package/src/components/slide-item/QSlideItem.js +2 -2
- package/src/components/slide-transition/QSlideTransition.js +2 -2
- package/src/components/splitter/QSplitter.js +2 -2
- package/src/components/stepper/QStep.js +2 -2
- package/src/components/stepper/QStepper.js +2 -2
- package/src/components/stepper/QStepperNavigation.js +1 -1
- package/src/components/stepper/StepHeader.js +1 -1
- package/src/components/tab-panels/QTabPanel.js +1 -1
- package/src/components/table/QTable.js +1 -1
- package/src/components/table/QTd.js +1 -1
- package/src/components/table/QTh.js +1 -1
- package/src/components/table/QTr.js +1 -1
- package/src/components/table/table-body.js +21 -32
- package/src/components/table/table-bottom.js +1 -1
- package/src/components/table/table-header.js +9 -9
- package/src/components/table/table-sort.js +1 -1
- package/src/components/tabs/QRouteTab.js +10 -120
- package/src/components/tabs/QRouteTab.json +7 -2
- package/src/components/tabs/QTab.js +112 -75
- package/src/components/tabs/QTabs.js +411 -329
- package/src/components/tabs/QTabs.sass +2 -7
- package/src/components/tabs/QTabs.styl +2 -7
- package/src/components/time/QTime.js +2 -2
- package/src/components/timeline/QTimeline.js +1 -1
- package/src/components/timeline/QTimelineEntry.js +1 -1
- package/src/components/toolbar/QToolbar.js +1 -1
- package/src/components/toolbar/QToolbarTitle.js +1 -1
- package/src/components/tooltip/QTooltip.js +19 -15
- package/src/components/tree/QTree.js +17 -15
- package/src/components/uploader/QUploaderBase.js +1 -1
- package/src/components/virtual-scroll/QVirtualScroll.js +1 -1
- package/src/directives/ClosePopup.js +1 -1
- package/src/directives/GoBack.js +1 -1
- package/src/directives/Ripple.js +1 -1
- package/src/directives/TouchHold.js +2 -2
- package/src/directives/TouchPan.js +4 -4
- package/src/directives/TouchRepeat.js +3 -3
- package/src/directives/TouchSwipe.js +3 -3
- package/src/mixins/anchor.js +2 -2
- package/src/mixins/attrs.js +1 -1
- package/src/mixins/btn.js +4 -3
- package/src/mixins/checkbox.js +4 -3
- package/src/mixins/datetime.js +1 -1
- package/src/mixins/file.js +1 -1
- package/src/mixins/listeners.js +1 -1
- package/src/mixins/mask.js +1 -1
- package/src/mixins/model-toggle.js +5 -7
- package/src/mixins/panel.js +2 -2
- package/src/mixins/portal.js +1 -1
- package/src/mixins/router-link.js +164 -38
- package/src/mixins/timeout.js +57 -26
- package/src/plugins/BottomSheet.js +1 -1
- package/src/plugins/BottomSheet.json +1 -1
- package/src/plugins/Dialog.js +1 -1
- package/src/plugins/Dialog.json +1 -1
- package/src/plugins/Loading.js +1 -1
- package/src/plugins/LocalStorage.js +1 -1
- package/src/plugins/LocalStorage.json +1 -1
- package/src/plugins/SessionStorage.js +1 -1
- package/src/plugins/SessionStorage.json +1 -1
- package/src/utils/date.js +1 -1
- package/src/utils/extend.js +15 -19
- package/src/utils/{cache.js → private/cache.js} +1 -1
- package/src/utils/{date-persian.js → private/date-persian.js} +0 -0
- package/src/utils/{escape-key.js → private/escape-key.js} +0 -0
- package/src/utils/{focus-manager.js → private/focus-manager.js} +0 -0
- package/src/utils/{global-dialog.js → private/global-dialog.js} +1 -1
- package/src/utils/{global-dialog.json → private/global-dialog.json} +0 -0
- package/src/utils/private/inject-obj-prop.js +15 -0
- package/src/utils/{key-composition.js → private/key-composition.js} +0 -0
- package/src/utils/{position-engine.js → private/position-engine.js} +2 -2
- package/src/utils/{selection.js → private/selection.js} +1 -1
- package/src/utils/{slot.js → private/slot.js} +0 -0
- package/src/utils/{sort.js → private/sort.js} +0 -0
- package/src/utils/{touch.js → private/touch.js} +0 -0
- package/src/utils/{vm.js → private/vm.js} +0 -0
- package/src/utils/{web-storage.js → private/web-storage.js} +2 -2
- package/src/utils/{web-storage.json → private/web-storage.json} +0 -0
- package/src/utils/run-sequential-promises.js +1 -1
- package/src/utils.js +4 -4
- package/src/utils/router.js +0 -50
|
@@ -1,4 +1,55 @@
|
|
|
1
|
-
const
|
|
1
|
+
const trailingSlashRE = /\/?$/
|
|
2
|
+
|
|
3
|
+
function equals (current, target) {
|
|
4
|
+
if (Object.keys(current).length !== Object.keys(target).length) {
|
|
5
|
+
return false
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// route query and params are strings when read from URL
|
|
9
|
+
for (const key in target) {
|
|
10
|
+
if (!(key in current) || String(current[key]) !== String(target[key])) {
|
|
11
|
+
return false
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return true
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function includes (current, target) {
|
|
18
|
+
for (const key in target) {
|
|
19
|
+
if (!(key in current)) {
|
|
20
|
+
return false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isSameRoute (current, target) {
|
|
27
|
+
if (!target) {
|
|
28
|
+
return false
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (current.path && target.path) {
|
|
32
|
+
return (
|
|
33
|
+
current.path.replace(trailingSlashRE, '') === target.path.replace(trailingSlashRE, '') &&
|
|
34
|
+
current.hash === target.hash &&
|
|
35
|
+
equals(current.query, target.query)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return typeof current.name === 'string' &&
|
|
40
|
+
current.name === target.name &&
|
|
41
|
+
current.hash === target.hash &&
|
|
42
|
+
equals(current.query, target.query) === true &&
|
|
43
|
+
equals(current.params, target.params) === true
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isIncludedRoute (current, target) {
|
|
47
|
+
return current.path.replace(trailingSlashRE, '/').indexOf(target.path.replace(trailingSlashRE, '/')) === 0 &&
|
|
48
|
+
(typeof target.hash !== 'string' || target.hash.length < 2 || current.hash === target.hash) &&
|
|
49
|
+
includes(current.query, target.query) === true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const routerLinkProps = {
|
|
2
53
|
// router-link
|
|
3
54
|
to: [String, Object],
|
|
4
55
|
exact: Boolean,
|
|
@@ -32,6 +83,7 @@ export default {
|
|
|
32
83
|
return this.disable !== true && this.href !== void 0
|
|
33
84
|
},
|
|
34
85
|
|
|
86
|
+
// beware, it gets overwritten in QRouteTab
|
|
35
87
|
hasRouterLinkProps () {
|
|
36
88
|
return this.$router !== void 0 &&
|
|
37
89
|
this.disable !== true &&
|
|
@@ -39,25 +91,14 @@ export default {
|
|
|
39
91
|
this.to !== void 0 && this.to !== null && this.to !== ''
|
|
40
92
|
},
|
|
41
93
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// unnecessary updates
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
return this.append === true
|
|
50
|
-
? this.$router.resolve(this.to, this.$route, true)
|
|
51
|
-
: this.$router.resolve(this.to)
|
|
52
|
-
}
|
|
53
|
-
catch (err) {}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return null
|
|
94
|
+
resolvedLink () {
|
|
95
|
+
return this.hasRouterLinkProps === true
|
|
96
|
+
? this.__getLink(this.to, this.append)
|
|
97
|
+
: null
|
|
57
98
|
},
|
|
58
99
|
|
|
59
100
|
hasRouterLink () {
|
|
60
|
-
return this.
|
|
101
|
+
return this.resolvedLink !== null
|
|
61
102
|
},
|
|
62
103
|
|
|
63
104
|
hasLink () {
|
|
@@ -65,41 +106,126 @@ export default {
|
|
|
65
106
|
},
|
|
66
107
|
|
|
67
108
|
linkTag () {
|
|
68
|
-
if (this.hasRouterLink === true) {
|
|
69
|
-
return 'router-link'
|
|
70
|
-
}
|
|
71
|
-
|
|
72
109
|
return this.type === 'a' || this.hasLink === true
|
|
73
110
|
? 'a'
|
|
74
111
|
: (this.tag || this.fallbackTag || 'div')
|
|
75
112
|
},
|
|
76
113
|
|
|
77
|
-
|
|
114
|
+
linkAttrs () {
|
|
78
115
|
return this.hasHrefLink === true
|
|
79
116
|
? {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
target: this.target
|
|
83
|
-
}
|
|
117
|
+
href: this.href,
|
|
118
|
+
target: this.target
|
|
84
119
|
}
|
|
85
120
|
: (
|
|
86
121
|
this.hasRouterLink === true
|
|
87
122
|
? {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
exact: this.exact,
|
|
91
|
-
append: this.append,
|
|
92
|
-
replace: this.replace,
|
|
93
|
-
activeClass: this.activeClass,
|
|
94
|
-
exactActiveClass: this.exactActiveClass
|
|
95
|
-
},
|
|
96
|
-
attrs: {
|
|
97
|
-
href: this.linkRoute.href,
|
|
98
|
-
target: this.target
|
|
99
|
-
}
|
|
123
|
+
href: this.resolvedLink.href,
|
|
124
|
+
target: this.target
|
|
100
125
|
}
|
|
101
126
|
: {}
|
|
102
127
|
)
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
linkIsActive () {
|
|
131
|
+
return this.hasRouterLink === true &&
|
|
132
|
+
isIncludedRoute(this.$route, this.resolvedLink.route)
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
linkIsExactActive () {
|
|
136
|
+
return this.hasRouterLink === true &&
|
|
137
|
+
isSameRoute(this.$route, this.resolvedLink.route)
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
linkClass () {
|
|
141
|
+
return this.hasRouterLink === true
|
|
142
|
+
? (
|
|
143
|
+
this.linkIsExactActive === true
|
|
144
|
+
? ` ${this.exactActiveClass} ${this.activeClass}`
|
|
145
|
+
: (
|
|
146
|
+
this.exact === true
|
|
147
|
+
? ''
|
|
148
|
+
: (this.linkIsActive === true ? ` ${this.activeClass}` : '')
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
: ''
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
methods: {
|
|
156
|
+
__getLink (to, append) {
|
|
157
|
+
// we protect from accessing this.$route without
|
|
158
|
+
// actually needing it so that we won't trigger
|
|
159
|
+
// unnecessary updates in computed props using this method
|
|
160
|
+
try {
|
|
161
|
+
return append === true
|
|
162
|
+
? this.$router.resolve(to, this.$route, true)
|
|
163
|
+
: this.$router.resolve(to)
|
|
164
|
+
}
|
|
165
|
+
catch (_) {}
|
|
166
|
+
|
|
167
|
+
return null
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @returns Promise<RouterLocation|RouterError|false> | Promise<RouterLocation|false|void>
|
|
172
|
+
*/
|
|
173
|
+
__navigateToRouterLink (
|
|
174
|
+
e,
|
|
175
|
+
{ returnRouterError, to, replace = this.replace, append } = {}
|
|
176
|
+
) {
|
|
177
|
+
if (this.disable === true) {
|
|
178
|
+
// ensure native navigation is prevented in all cases,
|
|
179
|
+
// like in QRouteTab where hasRouterLinkProps does not care about disable state
|
|
180
|
+
e.preventDefault()
|
|
181
|
+
return Promise.resolve(false)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (
|
|
185
|
+
// don't redirect with control keys;
|
|
186
|
+
// should match RouterLink from Vue Router
|
|
187
|
+
e.metaKey || e.altKey || e.ctrlKey || e.shiftKey ||
|
|
188
|
+
|
|
189
|
+
// don't redirect on right click
|
|
190
|
+
(e.button !== void 0 && e.button !== 0) ||
|
|
191
|
+
|
|
192
|
+
// don't redirect if it should open in a new window
|
|
193
|
+
this.target === '_blank'
|
|
194
|
+
) {
|
|
195
|
+
return Promise.resolve(false)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
e.preventDefault()
|
|
199
|
+
|
|
200
|
+
const resolvedLink = to === void 0
|
|
201
|
+
? this.resolvedLink
|
|
202
|
+
: this.__getLink(to, append)
|
|
203
|
+
|
|
204
|
+
if (resolvedLink === null) {
|
|
205
|
+
return Promise[returnRouterError === true ? 'reject' : 'resolve'](false)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const promise = this.$router[replace === true ? 'replace' : 'push'](resolvedLink.location)
|
|
209
|
+
|
|
210
|
+
return returnRouterError === true
|
|
211
|
+
? promise
|
|
212
|
+
: promise.catch(() => {})
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
__navigateOnClick (e) {
|
|
216
|
+
if (this.hasRouterLink === true) {
|
|
217
|
+
const go = opts => this.__navigateToRouterLink(e, opts)
|
|
218
|
+
|
|
219
|
+
this.$emit('click', e, go)
|
|
220
|
+
|
|
221
|
+
// for backward compatibility
|
|
222
|
+
e.navigate === false && e.preventDefault()
|
|
223
|
+
|
|
224
|
+
e.defaultPrevented !== true && go()
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
this.$emit('click', e)
|
|
228
|
+
}
|
|
103
229
|
}
|
|
104
230
|
}
|
|
105
231
|
}
|
package/src/mixins/timeout.js
CHANGED
|
@@ -1,37 +1,68 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
created () {
|
|
3
|
+
this.__tickFnList = []
|
|
4
|
+
this.__timeoutFnList = []
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
deactivated () {
|
|
8
|
+
this.__tickFnList.forEach(tick => { tick.removeTick() })
|
|
9
|
+
this.__timeoutFnList.forEach(tick => { tick.removeTimeout() })
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
beforeDestroy () {
|
|
13
|
+
this.__tickFnList.forEach(tick => { tick.removeTick() })
|
|
14
|
+
this.__tickFnList = void 0
|
|
15
|
+
|
|
16
|
+
this.__timeoutFnList.forEach(tick => { tick.removeTimeout() })
|
|
17
|
+
this.__timeoutFnList = void 0
|
|
18
|
+
},
|
|
19
|
+
|
|
2
20
|
methods: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
21
|
+
__useTick (registerFnName, removeFnName) {
|
|
22
|
+
const tick = {
|
|
23
|
+
removeTick () {
|
|
24
|
+
tick.fn = void 0
|
|
25
|
+
},
|
|
6
26
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
registerTick: fn => {
|
|
28
|
+
tick.fn = fn
|
|
29
|
+
|
|
30
|
+
this.$nextTick(() => {
|
|
31
|
+
if (tick.fn === fn) {
|
|
32
|
+
// we also check if VM is destroyed, since if it
|
|
33
|
+
// got to trigger one nextTick() we cannot stop it
|
|
34
|
+
this._isDestroyed === false && tick.fn()
|
|
35
|
+
tick.fn = void 0
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
16
39
|
}
|
|
17
|
-
},
|
|
18
40
|
|
|
19
|
-
|
|
20
|
-
this.__tickFn = void 0
|
|
21
|
-
},
|
|
41
|
+
this.__tickFnList.push(tick)
|
|
22
42
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.__timer = setTimeout(fn, delay)
|
|
43
|
+
this[registerFnName] = tick.registerTick
|
|
44
|
+
removeFnName !== void 0 && (this[removeFnName] = tick.removeTick)
|
|
26
45
|
},
|
|
27
46
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
__useTimeout (registerFnName, removeFnName) {
|
|
48
|
+
const timeout = {
|
|
49
|
+
removeTimeout () {
|
|
50
|
+
clearTimeout(timeout.timer)
|
|
51
|
+
},
|
|
32
52
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
registerTimeout: (fn, delay) => {
|
|
54
|
+
clearTimeout(timeout.timer)
|
|
55
|
+
|
|
56
|
+
if (this._isDestroyed === false) {
|
|
57
|
+
timeout.timer = setTimeout(fn, delay)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.__timeoutFnList.push(timeout)
|
|
63
|
+
|
|
64
|
+
this[registerFnName] = timeout.registerTimeout
|
|
65
|
+
removeFnName !== void 0 && (this[removeFnName] = timeout.removeTimeout)
|
|
66
|
+
}
|
|
36
67
|
}
|
|
37
68
|
}
|
package/src/plugins/Dialog.js
CHANGED
package/src/plugins/Dialog.json
CHANGED
package/src/plugins/Loading.js
CHANGED
|
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
|
|
2
2
|
|
|
3
3
|
import QSpinner from '../components/spinner/QSpinner.js'
|
|
4
4
|
import { isSSR } from './Platform.js'
|
|
5
|
-
import cache from '../utils/cache.js'
|
|
5
|
+
import cache from '../utils/private/cache.js'
|
|
6
6
|
import { isObject } from '../utils/is.js'
|
|
7
7
|
import { preventScroll } from '../mixins/prevent-scroll.js'
|
|
8
8
|
|
package/src/utils/date.js
CHANGED
package/src/utils/extend.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
const
|
|
2
2
|
toString = Object.prototype.toString,
|
|
3
3
|
hasOwn = Object.prototype.hasOwnProperty,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
function type (obj) {
|
|
11
|
-
return obj === null ? String(obj) : class2type[toString.call(obj)] || 'object'
|
|
12
|
-
}
|
|
4
|
+
notPlainObject = new Set(
|
|
5
|
+
['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp']
|
|
6
|
+
.map(name => '[object ' + name + ']')
|
|
7
|
+
)
|
|
13
8
|
|
|
14
9
|
function isPlainObject (obj) {
|
|
15
|
-
if (
|
|
10
|
+
if (obj !== Object(obj) || notPlainObject.has(toString.call(obj)) === true) {
|
|
16
11
|
return false
|
|
17
12
|
}
|
|
18
13
|
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
if (
|
|
15
|
+
obj.constructor &&
|
|
16
|
+
hasOwn.call(obj, 'constructor') === false &&
|
|
17
|
+
hasOwn.call(obj.constructor.prototype, 'isPrototypeOf') === false
|
|
18
|
+
) {
|
|
22
19
|
return false
|
|
23
20
|
}
|
|
24
21
|
|
|
@@ -42,7 +39,7 @@ export default function extend () {
|
|
|
42
39
|
i = 2
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
if (Object(target) !== target &&
|
|
42
|
+
if (Object(target) !== target && typeof target !== 'function') {
|
|
46
43
|
target = {}
|
|
47
44
|
}
|
|
48
45
|
|
|
@@ -61,13 +58,12 @@ export default function extend () {
|
|
|
61
58
|
continue
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
if (deep && copy && (
|
|
65
|
-
if (copyIsArray) {
|
|
66
|
-
|
|
67
|
-
clone = src && type(src) === 'array' ? src : []
|
|
61
|
+
if (deep === true && copy && ((copyIsArray = Array.isArray(copy)) || isPlainObject(copy) === true)) {
|
|
62
|
+
if (copyIsArray === true) {
|
|
63
|
+
clone = Array.isArray(src) === true ? src : []
|
|
68
64
|
}
|
|
69
65
|
else {
|
|
70
|
-
clone =
|
|
66
|
+
clone = isPlainObject(src) === true ? src : {}
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
target[name] = extend(deep, clone, copy)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function injectProp (target, propName, get, set) {
|
|
2
|
+
Object.defineProperty(target, propName, {
|
|
3
|
+
get,
|
|
4
|
+
set,
|
|
5
|
+
enumerable: true
|
|
6
|
+
})
|
|
7
|
+
return target
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function injectMultipleProps (target, props) {
|
|
11
|
+
Object.keys(props).forEach(key => {
|
|
12
|
+
injectProp(target, key, props[ key ])
|
|
13
|
+
})
|
|
14
|
+
return target
|
|
15
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -34,7 +34,7 @@ function parsePromises (sequentialPromises) {
|
|
|
34
34
|
* Default: { threadsNumber: 1, abortOnFail: true }
|
|
35
35
|
* When configuring threadsNumber AND using http requests, be
|
|
36
36
|
* aware of the maximum threads that the hosting browser
|
|
37
|
-
* supports (usually
|
|
37
|
+
* supports (usually 5); any number of threads above that
|
|
38
38
|
* won't add any real benefits
|
|
39
39
|
* @returns Promise<Array<Object> | Object>
|
|
40
40
|
* With opts.abortOnFail set to true (which is default):
|
package/src/utils.js
CHANGED
|
@@ -5,13 +5,13 @@ import date from './utils/date.js'
|
|
|
5
5
|
import debounce from './utils/debounce.js'
|
|
6
6
|
import dom from './utils/dom.js'
|
|
7
7
|
import event, { noop } from './utils/event.js'
|
|
8
|
-
import is from './utils/is.js'
|
|
9
8
|
import exportFile from './utils/export-file.js'
|
|
10
9
|
import extend from './utils/extend.js'
|
|
11
10
|
import format from './utils/format.js'
|
|
12
11
|
import frameDebounce from './utils/frame-debounce.js'
|
|
13
|
-
import
|
|
12
|
+
import is from './utils/is.js'
|
|
14
13
|
import morph from './utils/morph.js'
|
|
14
|
+
import openURL from './utils/open-url.js'
|
|
15
15
|
import patterns from './utils/patterns.js'
|
|
16
16
|
import runSequentialPromises from './utils/run-sequential-promises.js'
|
|
17
17
|
import scroll from './utils/scroll.js'
|
|
@@ -26,14 +26,14 @@ export {
|
|
|
26
26
|
debounce,
|
|
27
27
|
dom,
|
|
28
28
|
event,
|
|
29
|
+
noop,
|
|
29
30
|
exportFile,
|
|
30
31
|
extend,
|
|
31
32
|
format,
|
|
32
33
|
frameDebounce,
|
|
33
|
-
noop,
|
|
34
34
|
is,
|
|
35
|
-
openURL,
|
|
36
35
|
morph,
|
|
36
|
+
openURL,
|
|
37
37
|
patterns,
|
|
38
38
|
runSequentialPromises,
|
|
39
39
|
scroll,
|
package/src/utils/router.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const trailingSlashRE = /\/?$/
|
|
2
|
-
|
|
3
|
-
function equals (current, target) {
|
|
4
|
-
if (Object.keys(current).length !== Object.keys(target).length) {
|
|
5
|
-
return false
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// route query and params are strings when read from URL
|
|
9
|
-
for (const key in target) {
|
|
10
|
-
if (!(key in current) || String(current[key]) !== String(target[key])) {
|
|
11
|
-
return false
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return true
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function includes (current, target) {
|
|
18
|
-
for (const key in target) {
|
|
19
|
-
if (!(key in current)) {
|
|
20
|
-
return false
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function isSameRoute (current, target) {
|
|
27
|
-
if (!target) {
|
|
28
|
-
return false
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (current.path && target.path) {
|
|
32
|
-
return (
|
|
33
|
-
current.path.replace(trailingSlashRE, '') === target.path.replace(trailingSlashRE, '') &&
|
|
34
|
-
current.hash === target.hash &&
|
|
35
|
-
equals(current.query, target.query)
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return typeof current.name === 'string' &&
|
|
40
|
-
current.name === target.name &&
|
|
41
|
-
current.hash === target.hash &&
|
|
42
|
-
equals(current.query, target.query) === true &&
|
|
43
|
-
equals(current.params, target.params) === true
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function isIncludedRoute (current, target) {
|
|
47
|
-
return current.path.replace(trailingSlashRE, '/').indexOf(target.path.replace(trailingSlashRE, '/')) === 0 &&
|
|
48
|
-
(typeof target.hash !== 'string' || target.hash.length < 2 || current.hash === target.hash) &&
|
|
49
|
-
includes(current.query, target.query) === true
|
|
50
|
-
}
|