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.
Files changed (287) hide show
  1. package/dist/api/QBreadcrumbsEl.json +53 -0
  2. package/dist/api/QBtn.json +42 -5
  3. package/dist/api/QBtnDropdown.json +1 -1
  4. package/dist/api/QChip.json +1 -1
  5. package/dist/api/QDialog.json +6 -0
  6. package/dist/api/QExpansionItem.json +1 -1
  7. package/dist/api/QItem.json +53 -0
  8. package/dist/api/QRating.json +13 -0
  9. package/dist/api/QRouteTab.json +6 -2
  10. package/dist/babel-transforms/imports.js +2 -12
  11. package/dist/icon-set/bootstrap-icons.umd.min.js +1 -1
  12. package/dist/icon-set/eva-icons.umd.min.js +1 -1
  13. package/dist/icon-set/fontawesome-v5-pro.umd.min.js +1 -1
  14. package/dist/icon-set/fontawesome-v5.umd.min.js +1 -1
  15. package/dist/icon-set/fontawesome-v6-pro.umd.min.js +1 -1
  16. package/dist/icon-set/fontawesome-v6.umd.min.js +1 -1
  17. package/dist/icon-set/ionicons-v4.umd.min.js +1 -1
  18. package/dist/icon-set/line-awesome.umd.min.js +1 -1
  19. package/dist/icon-set/material-icons-outlined.umd.min.js +1 -1
  20. package/dist/icon-set/material-icons-round.umd.min.js +1 -1
  21. package/dist/icon-set/material-icons-sharp.umd.min.js +1 -1
  22. package/dist/icon-set/material-icons.umd.min.js +1 -1
  23. package/dist/icon-set/material-symbols-outlined.umd.min.js +1 -1
  24. package/dist/icon-set/material-symbols-rounded.umd.min.js +1 -1
  25. package/dist/icon-set/material-symbols-sharp.umd.min.js +1 -1
  26. package/dist/icon-set/mdi-v3.umd.min.js +1 -1
  27. package/dist/icon-set/mdi-v4.umd.min.js +1 -1
  28. package/dist/icon-set/mdi-v5.umd.min.js +1 -1
  29. package/dist/icon-set/mdi-v6.umd.min.js +1 -1
  30. package/dist/icon-set/svg-bootstrap-icons.umd.min.js +1 -1
  31. package/dist/icon-set/svg-eva-icons.umd.min.js +1 -1
  32. package/dist/icon-set/svg-fontawesome-v5.umd.min.js +1 -1
  33. package/dist/icon-set/svg-fontawesome-v6.umd.min.js +2 -2
  34. package/dist/icon-set/svg-ionicons-v4.umd.min.js +1 -1
  35. package/dist/icon-set/svg-ionicons-v5.umd.min.js +1 -1
  36. package/dist/icon-set/svg-ionicons-v6.umd.min.js +1 -1
  37. package/dist/icon-set/svg-line-awesome.umd.min.js +1 -1
  38. package/dist/icon-set/svg-material-icons-outlined.umd.min.js +1 -1
  39. package/dist/icon-set/svg-material-icons-round.umd.min.js +1 -1
  40. package/dist/icon-set/svg-material-icons-sharp.umd.min.js +1 -1
  41. package/dist/icon-set/svg-material-icons.umd.min.js +1 -1
  42. package/dist/icon-set/svg-material-symbols-outlined.umd.min.js +2 -2
  43. package/dist/icon-set/svg-material-symbols-rounded.umd.min.js +2 -2
  44. package/dist/icon-set/svg-material-symbols-sharp.umd.min.js +2 -2
  45. package/dist/icon-set/svg-mdi-v4.umd.min.js +1 -1
  46. package/dist/icon-set/svg-mdi-v5.umd.min.js +1 -1
  47. package/dist/icon-set/svg-mdi-v6.umd.min.js +1 -1
  48. package/dist/icon-set/svg-themify.umd.min.js +1 -1
  49. package/dist/icon-set/themify.umd.min.js +1 -1
  50. package/dist/lang/ar.umd.min.js +1 -1
  51. package/dist/lang/az-latn.umd.min.js +1 -1
  52. package/dist/lang/bg.umd.min.js +1 -1
  53. package/dist/lang/ca.umd.min.js +1 -1
  54. package/dist/lang/cs.umd.min.js +1 -1
  55. package/dist/lang/da.umd.min.js +1 -1
  56. package/dist/lang/de.umd.min.js +1 -1
  57. package/dist/lang/el.umd.min.js +1 -1
  58. package/dist/lang/en-gb.umd.min.js +1 -1
  59. package/dist/lang/en-us.umd.min.js +1 -1
  60. package/dist/lang/eo.umd.min.js +1 -1
  61. package/dist/lang/es.umd.min.js +1 -1
  62. package/dist/lang/et.umd.min.js +1 -1
  63. package/dist/lang/eu.umd.min.js +1 -1
  64. package/dist/lang/fa-ir.umd.min.js +1 -1
  65. package/dist/lang/fa.umd.min.js +1 -1
  66. package/dist/lang/fi.umd.min.js +1 -1
  67. package/dist/lang/fr.umd.min.js +1 -1
  68. package/dist/lang/gn.umd.min.js +1 -1
  69. package/dist/lang/he.umd.min.js +1 -1
  70. package/dist/lang/hr.umd.min.js +1 -1
  71. package/dist/lang/hu.umd.min.js +1 -1
  72. package/dist/lang/id.umd.min.js +1 -1
  73. package/dist/lang/is.umd.min.js +1 -1
  74. package/dist/lang/it.umd.min.js +1 -1
  75. package/dist/lang/ja.umd.min.js +1 -1
  76. package/dist/lang/km.umd.min.js +1 -1
  77. package/dist/lang/ko-kr.umd.min.js +1 -1
  78. package/dist/lang/kur-ckb.umd.min.js +1 -1
  79. package/dist/lang/kz.umd.min.js +1 -1
  80. package/dist/lang/lu.umd.min.js +1 -1
  81. package/dist/lang/lv.umd.min.js +1 -1
  82. package/dist/lang/ml.umd.min.js +1 -1
  83. package/dist/lang/mm.umd.min.js +1 -1
  84. package/dist/lang/ms.umd.min.js +1 -1
  85. package/dist/lang/my.umd.min.js +1 -1
  86. package/dist/lang/nb-no.umd.min.js +1 -1
  87. package/dist/lang/nl.umd.min.js +2 -2
  88. package/dist/lang/pl.umd.min.js +1 -1
  89. package/dist/lang/pt-br.umd.min.js +1 -1
  90. package/dist/lang/pt.umd.min.js +1 -1
  91. package/dist/lang/ro.umd.min.js +1 -1
  92. package/dist/lang/ru.umd.min.js +1 -1
  93. package/dist/lang/sk.umd.min.js +1 -1
  94. package/dist/lang/sl.umd.min.js +1 -1
  95. package/dist/lang/sm.umd.min.js +1 -1
  96. package/dist/lang/sr.umd.min.js +1 -1
  97. package/dist/lang/sv.umd.min.js +1 -1
  98. package/dist/lang/ta.umd.min.js +1 -1
  99. package/dist/lang/th.umd.min.js +1 -1
  100. package/dist/lang/tr.umd.min.js +1 -1
  101. package/dist/lang/ug.umd.min.js +1 -1
  102. package/dist/lang/uk.umd.min.js +1 -1
  103. package/dist/lang/uz-Cyrl.umd.min.js +1 -1
  104. package/dist/lang/uz-Latn.umd.min.js +1 -1
  105. package/dist/lang/vi.umd.min.js +1 -1
  106. package/dist/lang/zh-hans.umd.min.js +1 -1
  107. package/dist/lang/zh-hant.umd.min.js +1 -1
  108. package/dist/quasar.addon.css +1 -1
  109. package/dist/quasar.addon.rtl.css +1 -1
  110. package/dist/quasar.common.js +2 -2
  111. package/dist/quasar.css +43 -288
  112. package/dist/quasar.esm.js +2 -2
  113. package/dist/quasar.ie.polyfills.js +1 -1
  114. package/dist/quasar.ie.polyfills.umd.min.js +1 -1
  115. package/dist/quasar.min.css +1 -1
  116. package/dist/quasar.rtl.css +46 -408
  117. package/dist/quasar.rtl.min.css +1 -1
  118. package/dist/quasar.sass +3 -7
  119. package/dist/quasar.styl +3 -7
  120. package/dist/quasar.umd.js +1062 -867
  121. package/dist/quasar.umd.min.js +2 -2
  122. package/dist/quasar.umd.modern.js +1017 -854
  123. package/dist/quasar.umd.modern.min.js +2 -2
  124. package/dist/types/index.d.ts +8 -0
  125. package/dist/types/utils/run-sequential-promises.d.ts +1 -1
  126. package/dist/vetur/quasar-attributes.json +8 -0
  127. package/dist/vetur/quasar-tags.json +3 -1
  128. package/dist/web-types/web-types.json +66 -5
  129. package/lang/nl.js +2 -2
  130. package/package.json +1 -1
  131. package/src/body.js +1 -1
  132. package/src/components/avatar/QAvatar.js +1 -1
  133. package/src/components/badge/QBadge.js +1 -1
  134. package/src/components/banner/QBanner.js +1 -1
  135. package/src/components/bar/QBar.js +1 -1
  136. package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
  137. package/src/components/breadcrumbs/QBreadcrumbsEl.js +7 -4
  138. package/src/components/breadcrumbs/QBreadcrumbsEl.json +56 -0
  139. package/src/components/btn/QBtn.js +7 -29
  140. package/src/components/btn/QBtn.json +43 -5
  141. package/src/components/btn-dropdown/QBtnDropdown.js +2 -2
  142. package/src/components/btn-dropdown/QBtnDropdown.json +1 -1
  143. package/src/components/btn-group/QBtnGroup.js +1 -1
  144. package/src/components/btn-toggle/QBtnToggle.js +1 -1
  145. package/src/components/card/QCard.js +1 -1
  146. package/src/components/card/QCardActions.js +1 -1
  147. package/src/components/card/QCardSection.js +1 -1
  148. package/src/components/carousel/QCarousel.js +2 -2
  149. package/src/components/carousel/QCarouselControl.js +1 -1
  150. package/src/components/carousel/QCarouselSlide.js +1 -1
  151. package/src/components/checkbox/QCheckbox.js +1 -1
  152. package/src/components/chip/QChip.js +2 -2
  153. package/src/components/chip/QChip.json +1 -1
  154. package/src/components/circular-progress/QCircularProgress.js +1 -1
  155. package/src/components/color/QColor.js +1 -1
  156. package/src/components/date/QDate.js +3 -3
  157. package/src/components/dialog/QDialog.js +22 -7
  158. package/src/components/dialog/QDialog.json +7 -0
  159. package/src/components/dialog-bottom-sheet/BottomSheet.js +1 -1
  160. package/src/components/dialog-plugin/DialogPlugin.js +2 -2
  161. package/src/components/drawer/QDrawer.js +13 -7
  162. package/src/components/editor/QEditor.js +2 -2
  163. package/src/components/editor/editor-utils.js +2 -2
  164. package/src/components/expansion-item/QExpansionItem.js +29 -14
  165. package/src/components/expansion-item/QExpansionItem.json +1 -1
  166. package/src/components/fab/QFab.js +2 -2
  167. package/src/components/fab/QFabAction.js +1 -1
  168. package/src/components/field/QField.js +2 -2
  169. package/src/components/file/QFile.js +1 -1
  170. package/src/components/footer/QFooter.js +2 -2
  171. package/src/components/form/QForm.js +3 -3
  172. package/src/components/header/QHeader.js +2 -2
  173. package/src/components/icon/QIcon.js +1 -1
  174. package/src/components/img/QImg.js +1 -1
  175. package/src/components/infinite-scroll/QInfiniteScroll.js +1 -1
  176. package/src/components/input/QInput.js +1 -1
  177. package/src/components/intersection/QIntersection.js +1 -1
  178. package/src/components/item/QItem.js +39 -33
  179. package/src/components/item/QItem.json +56 -0
  180. package/src/components/item/QItemLabel.js +1 -1
  181. package/src/components/item/QItemSection.js +1 -1
  182. package/src/components/item/QList.js +1 -1
  183. package/src/components/knob/QKnob.js +2 -2
  184. package/src/components/layout/QLayout.js +2 -2
  185. package/src/components/linear-progress/QLinearProgress.js +1 -1
  186. package/src/components/markup-table/QMarkupTable.js +1 -1
  187. package/src/components/menu/ClickOutside.js +1 -1
  188. package/src/components/menu/QMenu.js +16 -7
  189. package/src/components/no-ssr/QNoSsr.js +1 -1
  190. package/src/components/option-group/QOptionGroup.js +1 -1
  191. package/src/components/page/QPage.js +1 -1
  192. package/src/components/page/QPageContainer.js +1 -1
  193. package/src/components/page-sticky/QPageSticky.js +1 -1
  194. package/src/components/pagination/QPagination.js +2 -2
  195. package/src/components/parallax/QParallax.js +1 -1
  196. package/src/components/popup-edit/QPopupEdit.js +6 -12
  197. package/src/components/popup-proxy/QPopupProxy.js +1 -1
  198. package/src/components/pull-to-refresh/QPullToRefresh.js +1 -1
  199. package/src/components/radio/QRadio.js +5 -4
  200. package/src/components/rating/QRating.js +46 -15
  201. package/src/components/rating/QRating.json +11 -0
  202. package/src/components/resize-observer/QResizeObserver.js +1 -1
  203. package/src/components/responsive/QResponsive.js +1 -1
  204. package/src/components/scroll-area/QScrollArea.js +2 -2
  205. package/src/components/select/QSelect.js +3 -3
  206. package/src/components/skeleton/QSkeleton.js +1 -1
  207. package/src/components/slide-item/QSlideItem.js +2 -2
  208. package/src/components/slide-transition/QSlideTransition.js +2 -2
  209. package/src/components/splitter/QSplitter.js +2 -2
  210. package/src/components/stepper/QStep.js +2 -2
  211. package/src/components/stepper/QStepper.js +2 -2
  212. package/src/components/stepper/QStepperNavigation.js +1 -1
  213. package/src/components/stepper/StepHeader.js +1 -1
  214. package/src/components/tab-panels/QTabPanel.js +1 -1
  215. package/src/components/table/QTable.js +1 -1
  216. package/src/components/table/QTd.js +1 -1
  217. package/src/components/table/QTh.js +1 -1
  218. package/src/components/table/QTr.js +1 -1
  219. package/src/components/table/table-body.js +21 -32
  220. package/src/components/table/table-bottom.js +1 -1
  221. package/src/components/table/table-header.js +9 -9
  222. package/src/components/table/table-sort.js +1 -1
  223. package/src/components/tabs/QRouteTab.js +10 -120
  224. package/src/components/tabs/QRouteTab.json +7 -2
  225. package/src/components/tabs/QTab.js +112 -75
  226. package/src/components/tabs/QTabs.js +411 -329
  227. package/src/components/tabs/QTabs.sass +2 -7
  228. package/src/components/tabs/QTabs.styl +2 -7
  229. package/src/components/time/QTime.js +2 -2
  230. package/src/components/timeline/QTimeline.js +1 -1
  231. package/src/components/timeline/QTimelineEntry.js +1 -1
  232. package/src/components/toolbar/QToolbar.js +1 -1
  233. package/src/components/toolbar/QToolbarTitle.js +1 -1
  234. package/src/components/tooltip/QTooltip.js +19 -15
  235. package/src/components/tree/QTree.js +17 -15
  236. package/src/components/uploader/QUploaderBase.js +1 -1
  237. package/src/components/virtual-scroll/QVirtualScroll.js +1 -1
  238. package/src/directives/ClosePopup.js +1 -1
  239. package/src/directives/GoBack.js +1 -1
  240. package/src/directives/Ripple.js +1 -1
  241. package/src/directives/TouchHold.js +2 -2
  242. package/src/directives/TouchPan.js +4 -4
  243. package/src/directives/TouchRepeat.js +3 -3
  244. package/src/directives/TouchSwipe.js +3 -3
  245. package/src/mixins/anchor.js +2 -2
  246. package/src/mixins/attrs.js +1 -1
  247. package/src/mixins/btn.js +4 -3
  248. package/src/mixins/checkbox.js +4 -3
  249. package/src/mixins/datetime.js +1 -1
  250. package/src/mixins/file.js +1 -1
  251. package/src/mixins/listeners.js +1 -1
  252. package/src/mixins/mask.js +1 -1
  253. package/src/mixins/model-toggle.js +5 -7
  254. package/src/mixins/panel.js +2 -2
  255. package/src/mixins/portal.js +1 -1
  256. package/src/mixins/router-link.js +164 -38
  257. package/src/mixins/timeout.js +57 -26
  258. package/src/plugins/BottomSheet.js +1 -1
  259. package/src/plugins/BottomSheet.json +1 -1
  260. package/src/plugins/Dialog.js +1 -1
  261. package/src/plugins/Dialog.json +1 -1
  262. package/src/plugins/Loading.js +1 -1
  263. package/src/plugins/LocalStorage.js +1 -1
  264. package/src/plugins/LocalStorage.json +1 -1
  265. package/src/plugins/SessionStorage.js +1 -1
  266. package/src/plugins/SessionStorage.json +1 -1
  267. package/src/utils/date.js +1 -1
  268. package/src/utils/extend.js +15 -19
  269. package/src/utils/{cache.js → private/cache.js} +1 -1
  270. package/src/utils/{date-persian.js → private/date-persian.js} +0 -0
  271. package/src/utils/{escape-key.js → private/escape-key.js} +0 -0
  272. package/src/utils/{focus-manager.js → private/focus-manager.js} +0 -0
  273. package/src/utils/{global-dialog.js → private/global-dialog.js} +1 -1
  274. package/src/utils/{global-dialog.json → private/global-dialog.json} +0 -0
  275. package/src/utils/private/inject-obj-prop.js +15 -0
  276. package/src/utils/{key-composition.js → private/key-composition.js} +0 -0
  277. package/src/utils/{position-engine.js → private/position-engine.js} +2 -2
  278. package/src/utils/{selection.js → private/selection.js} +1 -1
  279. package/src/utils/{slot.js → private/slot.js} +0 -0
  280. package/src/utils/{sort.js → private/sort.js} +0 -0
  281. package/src/utils/{touch.js → private/touch.js} +0 -0
  282. package/src/utils/{vm.js → private/vm.js} +0 -0
  283. package/src/utils/{web-storage.js → private/web-storage.js} +2 -2
  284. package/src/utils/{web-storage.json → private/web-storage.json} +0 -0
  285. package/src/utils/run-sequential-promises.js +1 -1
  286. package/src/utils.js +4 -4
  287. package/src/utils/router.js +0 -50
@@ -1,4 +1,55 @@
1
- const routerLinkProps = {
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
- linkRoute () {
43
- if (this.hasRouterLinkProps === true) {
44
- // we protect from accessing this.$route without
45
- // actually needing it so that we won't trigger
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.linkRoute !== null
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
- linkProps () {
114
+ linkAttrs () {
78
115
  return this.hasHrefLink === true
79
116
  ? {
80
- attrs: {
81
- href: this.href,
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
- props: {
89
- to: this.to,
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
  }
@@ -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
- __nextTick (fn) {
4
- this.__tickFn = fn
5
- },
21
+ __useTick (registerFnName, removeFnName) {
22
+ const tick = {
23
+ removeTick () {
24
+ tick.fn = void 0
25
+ },
6
26
 
7
- __prepareTick () {
8
- if (this.__tickFn !== void 0) {
9
- const fn = this.__tickFn
10
- this.$nextTick(() => {
11
- if (this.__tickFn === fn) {
12
- this.__tickFn()
13
- this.__tickFn = void 0
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
- __clearTick () {
20
- this.__tickFn = void 0
21
- },
41
+ this.__tickFnList.push(tick)
22
42
 
23
- __setTimeout (fn, delay) {
24
- clearTimeout(this.__timer)
25
- this.__timer = setTimeout(fn, delay)
43
+ this[registerFnName] = tick.registerTick
44
+ removeFnName !== void 0 && (this[removeFnName] = tick.removeTick)
26
45
  },
27
46
 
28
- __clearTimeout () {
29
- clearTimeout(this.__timer)
30
- }
31
- },
47
+ __useTimeout (registerFnName, removeFnName) {
48
+ const timeout = {
49
+ removeTimeout () {
50
+ clearTimeout(timeout.timer)
51
+ },
32
52
 
33
- beforeDestroy () {
34
- this.__tickFn = void 0
35
- clearTimeout(this.__timer)
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
  }
@@ -1,5 +1,5 @@
1
1
  import BottomSheet from '../components/dialog-bottom-sheet/BottomSheet.js'
2
- import globalDialog from '../utils/global-dialog.js'
2
+ import globalDialog from '../utils/private/global-dialog.js'
3
3
 
4
4
  export default {
5
5
  install ({ $q }) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "mixins": [ "utils/global-dialog" ],
2
+ "mixins": [ "utils/private/global-dialog" ],
3
3
 
4
4
  "meta": {
5
5
  "docsUrl": "https://v1.quasar.dev/quasar-plugins/bottom-sheet"
@@ -1,5 +1,5 @@
1
1
  import DialogPlugin from '../components/dialog-plugin/DialogPlugin.js'
2
- import globalDialog from '../utils/global-dialog.js'
2
+ import globalDialog from '../utils/private/global-dialog.js'
3
3
 
4
4
  export default {
5
5
  install ({ $q }) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "mixins": [ "utils/global-dialog" ],
2
+ "mixins": [ "utils/private/global-dialog" ],
3
3
 
4
4
  "meta": {
5
5
  "docsUrl": "https://v1.quasar.dev/quasar-plugins/dialog"
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  import { isSSR, client } from './Platform.js'
2
- import { getEmptyStorage, getStorage } from '../utils/web-storage.js'
2
+ import { getEmptyStorage, getStorage } from '../utils/private/web-storage.js'
3
3
 
4
4
  export default {
5
5
  install ({ $q }) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "mixins": [ "utils/web-storage" ],
2
+ "mixins": [ "utils/private/web-storage" ],
3
3
 
4
4
  "injection": "$q.localStorage"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { isSSR, client } from './Platform.js'
2
- import { getEmptyStorage, getStorage } from '../utils/web-storage.js'
2
+ import { getEmptyStorage, getStorage } from '../utils/private/web-storage.js'
3
3
 
4
4
  export default {
5
5
  install ({ $q }) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "mixins": [ "utils/web-storage" ],
2
+ "mixins": [ "utils/private/web-storage" ],
3
3
 
4
4
  "injection": "$q.sessionStorage"
5
5
  }
package/src/utils/date.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { isDate } from './is.js'
4
4
  import { pad, capitalize } from './format.js'
5
- import { jalaaliMonthLength } from './date-persian.js'
5
+ import { jalaaliMonthLength } from './private/date-persian.js'
6
6
  import lang, { defaultLang } from '../lang.js'
7
7
 
8
8
  const
@@ -1,24 +1,21 @@
1
1
  const
2
2
  toString = Object.prototype.toString,
3
3
  hasOwn = Object.prototype.hasOwnProperty,
4
- class2type = {}
5
-
6
- 'Boolean Number String Function Array Date RegExp Object'.split(' ').forEach(name => {
7
- class2type['[object ' + name + ']'] = name.toLowerCase()
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 (!obj || type(obj) !== 'object') {
10
+ if (obj !== Object(obj) || notPlainObject.has(toString.call(obj)) === true) {
16
11
  return false
17
12
  }
18
13
 
19
- if (obj.constructor &&
20
- !hasOwn.call(obj, 'constructor') &&
21
- !hasOwn.call(obj.constructor.prototype, 'isPrototypeOf')) {
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 && type(target) !== 'function') {
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 && (isPlainObject(copy) === true || (copyIsArray = type(copy) === 'array'))) {
65
- if (copyIsArray) {
66
- copyIsArray = false
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 = src && isPlainObject(src) === true ? src : {}
66
+ clone = isPlainObject(src) === true ? src : {}
71
67
  }
72
68
 
73
69
  target[name] = extend(deep, clone, copy)
@@ -1,4 +1,4 @@
1
- import { isSSR } from '../plugins/Platform.js'
1
+ import { isSSR } from '../../plugins/Platform.js'
2
2
 
3
3
  export default function cache (vm, key, obj) {
4
4
  if (isSSR === true) return obj
@@ -1,6 +1,6 @@
1
1
  import Vue from 'vue'
2
2
 
3
- import { isSSR } from '../plugins/Platform.js'
3
+ import { isSSR } from '../../plugins/Platform.js'
4
4
 
5
5
  const ssrAPI = {
6
6
  onOk: () => ssrAPI,
@@ -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
+ }
@@ -1,5 +1,5 @@
1
- import { getScrollbarWidth } from './scroll.js'
2
- import { client } from '../plugins/Platform.js'
1
+ import { getScrollbarWidth } from '../scroll.js'
2
+ import { client } from '../../plugins/Platform.js'
3
3
 
4
4
  let vpLeft, vpTop
5
5
 
@@ -1,4 +1,4 @@
1
- import Platform from '../plugins/Platform.js'
1
+ import Platform from '../../plugins/Platform.js'
2
2
 
3
3
  export function clearSelection () {
4
4
  if (window.getSelection !== void 0) {
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
- import { noop } from '../utils/event.js'
2
- import { isDate, isRegexp } from '../utils/is.js'
1
+ import { noop } from '../event.js'
2
+ import { isDate, isRegexp } from '../is.js'
3
3
 
4
4
  function encode (value) {
5
5
  if (isDate(value) === true) {
@@ -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 3); any number of threads above that
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 openURL from './utils/open-url.js'
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,
@@ -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
- }