quasar 1.16.0 → 1.17.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 (304) hide show
  1. package/dist/api/BottomSheet.json +2 -2
  2. package/dist/api/Loading.json +0 -2
  3. package/dist/api/Notify.json +15 -15
  4. package/dist/api/QAvatar.json +1 -1
  5. package/dist/api/QBreadcrumbsEl.json +32 -11
  6. package/dist/api/QBtn.json +35 -14
  7. package/dist/api/QBtnDropdown.json +36 -15
  8. package/dist/api/QBtnToggle.json +1 -1
  9. package/dist/api/QCarousel.json +7 -7
  10. package/dist/api/QCarouselSlide.json +2 -2
  11. package/dist/api/QChatMessage.json +1 -5
  12. package/dist/api/QChip.json +4 -4
  13. package/dist/api/QColor.json +6 -0
  14. package/dist/api/QDialog.json +7 -1
  15. package/dist/api/QExpansionItem.json +34 -13
  16. package/dist/api/QFab.json +34 -2
  17. package/dist/api/QFabAction.json +9 -1
  18. package/dist/api/QField.json +80 -6
  19. package/dist/api/QFile.json +80 -6
  20. package/dist/api/QImg.json +2 -2
  21. package/dist/api/QInnerLoading.json +32 -0
  22. package/dist/api/QInput.json +82 -6
  23. package/dist/api/QItem.json +31 -10
  24. package/dist/api/QOptionGroup.json +58 -1
  25. package/dist/api/QPagination.json +4 -4
  26. package/dist/api/QParallax.json +1 -1
  27. package/dist/api/QPopupEdit.json +14 -7
  28. package/dist/api/QPullToRefresh.json +1 -1
  29. package/dist/api/QRange.json +581 -96
  30. package/dist/api/QRating.json +3 -3
  31. package/dist/api/QRouteTab.json +32 -12
  32. package/dist/api/QScrollArea.json +188 -20
  33. package/dist/api/QSelect.json +81 -9
  34. package/dist/api/QSeparator.json +1 -1
  35. package/dist/api/QSlider.json +499 -34
  36. package/dist/api/QStep.json +4 -4
  37. package/dist/api/QStepper.json +4 -4
  38. package/dist/api/QTab.json +1 -1
  39. package/dist/api/QTable.json +4 -4
  40. package/dist/api/QTabs.json +9 -0
  41. package/dist/api/QTimelineEntry.json +2 -2
  42. package/dist/api/QToggle.json +1 -1
  43. package/dist/api/QTree.json +7 -1
  44. package/dist/api/QVideo.json +10 -0
  45. package/dist/icon-set/bootstrap-icons.umd.min.js +1 -1
  46. package/dist/icon-set/eva-icons.umd.min.js +1 -1
  47. package/dist/icon-set/fontawesome-v5-pro.umd.min.js +1 -1
  48. package/dist/icon-set/fontawesome-v5.umd.min.js +1 -1
  49. package/dist/icon-set/ionicons-v4.umd.min.js +1 -1
  50. package/dist/icon-set/line-awesome.umd.min.js +1 -1
  51. package/dist/icon-set/material-icons-outlined.umd.min.js +1 -1
  52. package/dist/icon-set/material-icons-round.umd.min.js +1 -1
  53. package/dist/icon-set/material-icons-sharp.umd.min.js +1 -1
  54. package/dist/icon-set/material-icons.umd.min.js +1 -1
  55. package/dist/icon-set/mdi-v3.umd.min.js +1 -1
  56. package/dist/icon-set/mdi-v4.umd.min.js +1 -1
  57. package/dist/icon-set/mdi-v5.umd.min.js +1 -1
  58. package/dist/icon-set/mdi-v6.umd.min.js +1 -1
  59. package/dist/icon-set/svg-bootstrap-icons.umd.min.js +1 -1
  60. package/dist/icon-set/svg-eva-icons.umd.min.js +1 -1
  61. package/dist/icon-set/svg-fontawesome-v5.umd.min.js +1 -1
  62. package/dist/icon-set/svg-ionicons-v4.umd.min.js +1 -1
  63. package/dist/icon-set/svg-ionicons-v5.umd.min.js +1 -1
  64. package/dist/icon-set/svg-ionicons-v6.umd.min.js +6 -0
  65. package/dist/icon-set/svg-line-awesome.umd.min.js +1 -1
  66. package/dist/icon-set/svg-material-icons-outlined.umd.min.js +1 -1
  67. package/dist/icon-set/svg-material-icons-round.umd.min.js +1 -1
  68. package/dist/icon-set/svg-material-icons-sharp.umd.min.js +1 -1
  69. package/dist/icon-set/svg-material-icons.umd.min.js +1 -1
  70. package/dist/icon-set/svg-mdi-v4.umd.min.js +1 -1
  71. package/dist/icon-set/svg-mdi-v5.umd.min.js +1 -1
  72. package/dist/icon-set/svg-mdi-v6.umd.min.js +1 -1
  73. package/dist/icon-set/svg-themify.umd.min.js +1 -1
  74. package/dist/icon-set/themify.umd.min.js +1 -1
  75. package/dist/lang/ar.umd.min.js +2 -2
  76. package/dist/lang/az-latn.umd.min.js +1 -1
  77. package/dist/lang/bg.umd.min.js +1 -1
  78. package/dist/lang/ca.umd.min.js +1 -1
  79. package/dist/lang/cs.umd.min.js +1 -1
  80. package/dist/lang/da.umd.min.js +1 -1
  81. package/dist/lang/de.umd.min.js +2 -2
  82. package/dist/lang/el.umd.min.js +1 -1
  83. package/dist/lang/en-gb.umd.min.js +1 -1
  84. package/dist/lang/en-us.umd.min.js +1 -1
  85. package/dist/lang/eo.umd.min.js +1 -1
  86. package/dist/lang/es.umd.min.js +1 -1
  87. package/dist/lang/et.umd.min.js +1 -1
  88. package/dist/lang/fa-ir.umd.min.js +1 -1
  89. package/dist/lang/fa.umd.min.js +1 -1
  90. package/dist/lang/fi.umd.min.js +1 -1
  91. package/dist/lang/fr.umd.min.js +2 -2
  92. package/dist/lang/gn.umd.min.js +1 -1
  93. package/dist/lang/he.umd.min.js +1 -1
  94. package/dist/lang/hr.umd.min.js +1 -1
  95. package/dist/lang/hu.umd.min.js +1 -1
  96. package/dist/lang/id.umd.min.js +1 -1
  97. package/dist/lang/is.umd.min.js +1 -1
  98. package/dist/lang/it.umd.min.js +1 -1
  99. package/dist/lang/ja.umd.min.js +1 -1
  100. package/dist/lang/km.umd.min.js +1 -1
  101. package/dist/lang/ko-kr.umd.min.js +1 -1
  102. package/dist/lang/kur-ckb.umd.min.js +1 -1
  103. package/dist/lang/lu.umd.min.js +1 -1
  104. package/dist/lang/lv.umd.min.js +1 -1
  105. package/dist/lang/ml.umd.min.js +1 -1
  106. package/dist/lang/ms.umd.min.js +1 -1
  107. package/dist/lang/nb-no.umd.min.js +1 -1
  108. package/dist/lang/nl.umd.min.js +1 -1
  109. package/dist/lang/pl.umd.min.js +1 -1
  110. package/dist/lang/pt-br.umd.min.js +1 -1
  111. package/dist/lang/pt.umd.min.js +1 -1
  112. package/dist/lang/ro.umd.min.js +1 -1
  113. package/dist/lang/ru.umd.min.js +1 -1
  114. package/dist/lang/sk.umd.min.js +1 -1
  115. package/dist/lang/sl.umd.min.js +1 -1
  116. package/dist/lang/sr.umd.min.js +2 -2
  117. package/dist/lang/sv.umd.min.js +1 -1
  118. package/dist/lang/ta.umd.min.js +1 -1
  119. package/dist/lang/th.umd.min.js +1 -1
  120. package/dist/lang/tr.umd.min.js +1 -1
  121. package/dist/lang/ug.umd.min.js +2 -2
  122. package/dist/lang/uk.umd.min.js +1 -1
  123. package/dist/lang/vi.umd.min.js +1 -1
  124. package/dist/lang/zh-hans.umd.min.js +2 -2
  125. package/dist/lang/zh-hant.umd.min.js +2 -2
  126. package/dist/quasar.addon.css +1 -1
  127. package/dist/quasar.addon.rtl.css +1 -1
  128. package/dist/quasar.common.js +2 -2
  129. package/dist/quasar.css +376 -228
  130. package/dist/quasar.esm.js +2 -2
  131. package/dist/quasar.ie.polyfills.js +1 -1
  132. package/dist/quasar.ie.polyfills.umd.min.js +1 -1
  133. package/dist/quasar.min.css +1 -1
  134. package/dist/quasar.rtl.css +508 -304
  135. package/dist/quasar.rtl.min.css +1 -1
  136. package/dist/quasar.sass +324 -210
  137. package/dist/quasar.styl +324 -210
  138. package/dist/quasar.umd.js +3098 -1836
  139. package/dist/quasar.umd.min.js +2 -2
  140. package/dist/quasar.umd.modern.js +3057 -1817
  141. package/dist/quasar.umd.modern.min.js +2 -2
  142. package/dist/transform-asset-urls.json +20 -0
  143. package/dist/types/index.d.ts +421 -103
  144. package/dist/types/utils/scroll.d.ts +1 -0
  145. package/dist/vetur/quasar-attributes.json +313 -89
  146. package/dist/vetur/quasar-tags.json +74 -18
  147. package/dist/web-types/web-types.json +1289 -259
  148. package/icon-set/svg-ionicons-v6.js +225 -0
  149. package/lang/ar.js +1 -1
  150. package/lang/de.js +1 -1
  151. package/lang/fa-ir.js +3 -1
  152. package/lang/fa.js +3 -1
  153. package/lang/fr.js +1 -1
  154. package/lang/index.json +1 -1
  155. package/lang/kur-ckb.js +2 -2
  156. package/lang/sr.js +4 -4
  157. package/lang/ug.js +48 -46
  158. package/lang/zh-hans.js +1 -1
  159. package/lang/zh-hant.js +18 -18
  160. package/package.json +1 -1
  161. package/src/api.extends.json +1 -2
  162. package/src/components/breadcrumbs/QBreadcrumbs.js +15 -11
  163. package/src/components/breadcrumbs/QBreadcrumbs.sass +0 -3
  164. package/src/components/breadcrumbs/QBreadcrumbs.styl +0 -3
  165. package/src/components/breadcrumbs/QBreadcrumbsEl.js +25 -9
  166. package/src/components/btn/QBtn.js +3 -3
  167. package/src/components/btn-dropdown/QBtnDropdown.sass +2 -0
  168. package/src/components/btn-dropdown/QBtnDropdown.styl +2 -0
  169. package/src/components/carousel/QCarousel.js +6 -2
  170. package/src/components/carousel/QCarousel.json +9 -1
  171. package/src/components/carousel/QCarouselSlide.json +2 -2
  172. package/src/components/chat/QChatMessage.json +1 -1
  173. package/src/components/color/QColor.js +100 -85
  174. package/src/components/color/QColor.json +7 -0
  175. package/src/components/color/QColor.sass +14 -24
  176. package/src/components/color/QColor.styl +14 -24
  177. package/src/components/date/QDate.js +7 -1
  178. package/src/components/date/QDate.sass +2 -0
  179. package/src/components/date/QDate.styl +2 -0
  180. package/src/components/dialog/QDialog.js +8 -4
  181. package/src/components/dialog/QDialog.json +8 -1
  182. package/src/components/drawer/QDrawer.js +16 -15
  183. package/src/components/editor/QEditor.js +2 -2
  184. package/src/components/editor/QEditor.sass +13 -1
  185. package/src/components/editor/QEditor.styl +13 -1
  186. package/src/components/expansion-item/QExpansionItem.js +13 -11
  187. package/src/components/fab/QFab.js +20 -11
  188. package/src/components/fab/QFab.json +35 -0
  189. package/src/components/fab/QFabAction.js +16 -9
  190. package/src/components/fab/QFabAction.json +10 -0
  191. package/src/components/field/QField.js +28 -23
  192. package/src/components/field/__QField.json +72 -8
  193. package/src/components/file/QFile.js +12 -4
  194. package/src/components/file/QFile.sass +4 -3
  195. package/src/components/file/QFile.styl +4 -3
  196. package/src/components/footer/QFooter.js +1 -1
  197. package/src/components/form/QForm.js +1 -1
  198. package/src/components/header/QHeader.js +1 -1
  199. package/src/components/icon/QIcon.js +54 -49
  200. package/src/components/img/QImg.json +2 -2
  201. package/src/components/infinite-scroll/QInfiniteScroll.js +49 -36
  202. package/src/components/inner-loading/QInnerLoading.js +54 -22
  203. package/src/components/inner-loading/QInnerLoading.json +29 -0
  204. package/src/components/inner-loading/QInnerLoading.sass +3 -0
  205. package/src/components/inner-loading/QInnerLoading.styl +3 -0
  206. package/src/components/item/QItem.js +9 -15
  207. package/src/components/linear-progress/QLinearProgress.js +6 -2
  208. package/src/components/menu/QMenu.js +5 -1
  209. package/src/components/option-group/QOptionGroup.js +32 -22
  210. package/src/components/option-group/QOptionGroup.json +50 -1
  211. package/src/components/parallax/QParallax.js +3 -0
  212. package/src/components/parallax/QParallax.json +1 -1
  213. package/src/components/popup-edit/QPopupEdit.js +41 -16
  214. package/src/components/popup-edit/QPopupEdit.json +15 -8
  215. package/src/components/range/QRange.js +223 -278
  216. package/src/components/range/QRange.json +11 -122
  217. package/src/components/rating/QRating.js +56 -38
  218. package/src/components/rating/QRating.json +3 -3
  219. package/src/components/rating/QRating.sass +8 -6
  220. package/src/components/rating/QRating.styl +8 -6
  221. package/src/components/resize-observer/QResizeObserver.js +15 -10
  222. package/src/components/scroll-area/QScrollArea.js +342 -126
  223. package/src/components/scroll-area/QScrollArea.json +164 -20
  224. package/src/components/scroll-area/QScrollArea.sass +4 -0
  225. package/src/components/scroll-area/QScrollArea.styl +4 -0
  226. package/src/components/scroll-observer/QScrollObserver.js +9 -2
  227. package/src/components/select/QSelect.js +8 -2
  228. package/src/components/separator/QSeparator.js +0 -1
  229. package/src/components/separator/QSeparator.json +1 -1
  230. package/src/components/slider/QSlider.js +97 -140
  231. package/src/components/slider/QSlider.json +1 -122
  232. package/src/components/slider/QSlider.sass +205 -139
  233. package/src/components/slider/QSlider.styl +205 -139
  234. package/src/components/slider/slider-utils.js +468 -123
  235. package/src/components/slider/slider-utils.json +546 -0
  236. package/src/components/stepper/QStepper.js +1 -1
  237. package/src/components/stepper/QStepper.sass +25 -26
  238. package/src/components/stepper/QStepper.styl +25 -26
  239. package/src/components/table/QTable.sass +3 -0
  240. package/src/components/table/QTable.styl +3 -0
  241. package/src/components/tabs/QRouteTab.js +13 -13
  242. package/src/components/tabs/QRouteTab.json +0 -7
  243. package/src/components/tabs/QTab.js +71 -20
  244. package/src/components/tabs/QTabs.js +237 -52
  245. package/src/components/tabs/QTabs.json +8 -0
  246. package/src/components/tabs/QTabs.sass +6 -6
  247. package/src/components/tabs/QTabs.styl +6 -6
  248. package/src/components/time/QTime.js +6 -2
  249. package/src/components/timeline/QTimelineEntry.json +1 -1
  250. package/src/components/tree/QTree.js +10 -6
  251. package/src/components/tree/QTree.json +5 -0
  252. package/src/components/tree/QTree.sass +58 -4
  253. package/src/components/tree/QTree.styl +58 -4
  254. package/src/components/uploader/QUploaderBase.js +15 -19
  255. package/src/components/video/QVideo.js +4 -1
  256. package/src/components/video/QVideo.json +11 -0
  257. package/src/components/virtual-scroll/QVirtualScroll.sass +1 -0
  258. package/src/components/virtual-scroll/QVirtualScroll.styl +1 -0
  259. package/src/css/core/helpers.sass +3 -0
  260. package/src/css/core/helpers.styl +3 -0
  261. package/src/css/core/positioning.sass +5 -0
  262. package/src/css/core/positioning.styl +5 -0
  263. package/src/css/normalize.sass +0 -7
  264. package/src/css/normalize.styl +0 -7
  265. package/src/css/variables.sass +4 -6
  266. package/src/css/variables.styl +4 -6
  267. package/src/directives/Scroll.js +2 -2
  268. package/src/directives/ScrollFire.js +1 -0
  269. package/src/ie-compat/ie.js +13 -13
  270. package/src/install.js +1 -1
  271. package/src/lang.js +7 -4
  272. package/src/mixins/anchor.js +3 -13
  273. package/src/mixins/btn.js +30 -38
  274. package/src/mixins/btn.json +26 -11
  275. package/src/mixins/file.js +27 -5
  276. package/src/mixins/fullscreen.js +16 -4
  277. package/src/mixins/portal.js +10 -10
  278. package/src/mixins/router-link.js +88 -14
  279. package/src/mixins/router-link.json +26 -10
  280. package/src/mixins/validate.js +33 -15
  281. package/src/mixins/virtual-scroll.js +40 -42
  282. package/src/plugins/AppFullscreen.js +41 -16
  283. package/src/plugins/BottomSheet.json +1 -1
  284. package/src/plugins/Cookies.js +1 -1
  285. package/src/plugins/Loading.js +8 -0
  286. package/src/plugins/LoadingBar.js +9 -0
  287. package/src/plugins/Notify.js +351 -333
  288. package/src/plugins/Notify.json +10 -10
  289. package/src/plugins/Notify.sass +9 -3
  290. package/src/plugins/Notify.styl +9 -3
  291. package/src/utils/clone.js +53 -4
  292. package/src/utils/date.js +134 -69
  293. package/src/utils/dom.js +28 -9
  294. package/src/utils/extend.js +2 -2
  295. package/src/utils/focus-manager.js +8 -10
  296. package/src/utils/global-dialog.js +18 -1
  297. package/src/utils/is.js +2 -2
  298. package/src/utils/morph.js +2 -12
  299. package/src/utils/scroll.js +71 -35
  300. package/src/.DS_Store +0 -0
  301. package/src/components/.DS_Store +0 -0
  302. package/src/components/layout/.DS_Store +0 -0
  303. package/src/css/.DS_Store +0 -0
  304. package/src/utils/.DS_Store +0 -0
@@ -1,5 +1,6 @@
1
1
  import { clearSelection } from '../utils/selection.js'
2
2
  import { addEvt, cleanEvt, prevent, listenOpts } from '../utils/event.js'
3
+ import { getElement } from '../utils/dom.js'
3
4
  import { isKeyCode } from '../utils/key-composition.js'
4
5
 
5
6
  export default {
@@ -145,23 +146,12 @@ export default {
145
146
  this.__setAnchorEl(this.parentEl)
146
147
  }
147
148
  else {
148
- let el = this.target
149
-
150
- if (typeof this.target === 'string') {
151
- try {
152
- el = document.querySelector(this.target)
153
- }
154
- catch (err) {
155
- el = void 0
156
- }
157
- }
149
+ this.anchorEl = getElement(this.target) || void 0
158
150
 
159
- if (el !== void 0 && el !== null) {
160
- this.anchorEl = el._isVue === true && el.$el !== void 0 ? el.$el : el
151
+ if (this.anchorEl !== void 0) {
161
152
  this.__configureAnchorEl()
162
153
  }
163
154
  else {
164
- this.anchorEl = void 0
165
155
  console.error(`Anchor: target "${this.target}" not found`, this)
166
156
  }
167
157
  }
package/src/mixins/btn.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import AlignMixin from './align.js'
2
2
  import RippleMixin from './ripple.js'
3
3
  import ListenersMixin from './listeners.js'
4
+ import RouterLinkMixin from './router-link.js'
4
5
  import { getSizeMixin } from './size.js'
5
6
 
6
7
  const padding = {
@@ -12,10 +13,14 @@ const padding = {
12
13
  xl: 32
13
14
  }
14
15
 
16
+ const formTypes = [ 'button', 'submit', 'reset' ]
17
+ const mediaTypeRe = /[^\s]\/[^\s]/
18
+
15
19
  export default {
16
20
  mixins: [
17
21
  ListenersMixin,
18
22
  RippleMixin,
23
+ RouterLinkMixin,
19
24
  AlignMixin,
20
25
  getSizeMixin({
21
26
  xs: 8,
@@ -27,7 +32,10 @@ export default {
27
32
  ],
28
33
 
29
34
  props: {
30
- type: String,
35
+ type: {
36
+ type: String,
37
+ default: 'button'
38
+ },
31
39
 
32
40
  to: [ Object, String ],
33
41
  replace: Boolean,
@@ -87,14 +95,6 @@ export default {
87
95
  return this.isActionable === true ? this.tabindex || 0 : -1
88
96
  },
89
97
 
90
- hasRouterLink () {
91
- return this.disable !== true && this.to !== void 0 && this.to !== null && this.to !== ''
92
- },
93
-
94
- isLink () {
95
- return this.type === 'a' || this.hasRouterLink === true
96
- },
97
-
98
98
  design () {
99
99
  if (this.flat === true) return 'flat'
100
100
  if (this.outline === true) return 'outline'
@@ -103,45 +103,37 @@ export default {
103
103
  return 'standard'
104
104
  },
105
105
 
106
- currentLocation () {
107
- if (this.hasRouterLink === true) {
108
- // we protect from accessing this.$route without
109
- // actually needing it so that we won't trigger
110
- // unnecessary updates
111
- return this.append === true
112
- ? this.$router.resolve(this.to, this.$route, true)
113
- : this.$router.resolve(this.to)
114
- }
115
- },
116
-
117
106
  attrs () {
118
- const attrs = { tabindex: this.computedTabIndex }
107
+ const acc = { tabindex: this.computedTabIndex }
119
108
 
120
- if (this.type !== 'a') {
121
- attrs.type = this.type || 'button'
109
+ if (this.hasLink === true) {
110
+ Object.assign(acc, this.linkProps.attrs)
111
+ }
112
+ else if (formTypes.includes(this.type) === true) {
113
+ acc.type = this.type
122
114
  }
123
115
 
124
- if (this.hasRouterLink === true) {
125
- attrs.href = this.currentLocation.href
126
- attrs.role = 'link'
116
+ if (this.hasLink === true || this.type === 'a') {
117
+ if (acc.href === void 0) {
118
+ acc.role = 'button'
119
+ }
120
+ if (mediaTypeRe.test(this.type) === true) {
121
+ acc.type = this.type
122
+ }
127
123
  }
128
- else {
129
- attrs.role = this.type === 'a' ? 'link' : 'button'
124
+ else if (this.disable === true) {
125
+ acc.disabled = ''
126
+ acc['aria-disabled'] = 'true'
130
127
  }
131
128
 
132
129
  if (this.loading === true && this.percentage !== void 0) {
133
- attrs.role = 'progressbar'
134
- attrs['aria-valuemin'] = 0
135
- attrs['aria-valuemax'] = 100
136
- attrs['aria-valuenow'] = this.percentage
137
- }
138
-
139
- if (this.disable === true) {
140
- attrs.disabled = ''
141
- attrs['aria-disabled'] = 'true'
130
+ acc.role = 'progressbar'
131
+ acc['aria-valuemin'] = 0
132
+ acc['aria-valuemax'] = 100
133
+ acc['aria-valuenow'] = this.percentage
142
134
  }
143
135
 
144
- return attrs
136
+ return acc
145
137
  },
146
138
 
147
139
  classes () {
@@ -4,40 +4,55 @@
4
4
  "props": {
5
5
  "type":{
6
6
  "type": "String",
7
- "desc": "Define the button HTML DOM type",
7
+ "desc": "1) Define the button native type attribute (submit, reset, button) or 2) render component with <a> tag so you can access events even if disable or 3) Use 'href' prop and specify 'type' as a media tag",
8
8
  "default": "button",
9
- "values": [
10
- "a", "submit", "button", "reset"
11
- ],
12
9
  "examples": [
13
- "type=\"a\" href=\"http://some-site.net\" target=\"__blank\""
10
+ "a", "submit", "button", "reset",
11
+ "image/png",
12
+ "href=\"https://some-site.net\" target=\"_blank\""
14
13
  ],
15
14
  "category": "general"
16
15
  },
17
16
 
18
17
  "to": {
19
18
  "type": [ "String", "Object" ],
20
- "desc": "Equivalent to Vue Router <router-link> 'to' property",
19
+ "desc": "Equivalent to Vue Router <router-link> 'to' property; Superseeded by 'href' prop if used",
21
20
  "examples": [
22
21
  "/home/dashboard",
23
22
  ":to=\"{ name: 'my-route-name' }\""
24
23
  ],
25
- "category": "router"
24
+ "category": "navigation"
26
25
  },
27
26
 
28
27
  "replace": {
29
28
  "type": "Boolean",
30
- "desc": "Equivalent to Vue Router <router-link> 'replace' property",
31
- "category": "router"
29
+ "desc": "Equivalent to Vue Router <router-link> 'replace' property; Superseeded by 'href' prop if used",
30
+ "category": "navigation"
32
31
  },
33
32
 
34
33
  "append": {
35
34
  "type": "Boolean",
36
- "desc": "Equivalent to Vue Router <router-link> 'append' property",
37
- "category": "router",
35
+ "desc": "Equivalent to Vue Router <router-link> 'append' property; Superseeded by 'href' prop if used",
36
+ "category": "navigation",
38
37
  "addedIn": "v1.13.0"
39
38
  },
40
39
 
40
+ "href": {
41
+ "type": "String",
42
+ "desc": "Native <a> link href attribute; Has priority over the 'to' and 'replace' props",
43
+ "examples": [ "https://quasar.dev", "href=\"https://quasar.dev\" target=\"_blank\"" ],
44
+ "category": "navigation",
45
+ "addedIn": "v1.17"
46
+ },
47
+
48
+ "target": {
49
+ "type": "String",
50
+ "desc": "Native <a> link target attribute; Use it only with 'to' or 'href' props",
51
+ "examples": [ "_blank", "_self", "_parent", "_top" ],
52
+ "category": "navigation",
53
+ "addedIn": "v1.17"
54
+ },
55
+
41
56
  "label":{
42
57
  "type": [ "String", "Number" ],
43
58
  "desc": "The text that will be shown on the button",
@@ -1,4 +1,4 @@
1
- import { stopAndPrevent } from '../utils/event.js'
1
+ import { stop, stopAndPrevent } from '../utils/event.js'
2
2
  import cache from '../utils/cache.js'
3
3
 
4
4
  function filterFiles (files, rejectedFiles, failedPropValidation, filterFn) {
@@ -58,10 +58,20 @@ export default {
58
58
  },
59
59
 
60
60
  methods: {
61
- pickFiles (e) {
62
- if (this.editable) {
63
- const input = this.__getFileInput()
64
- input && input.click(e)
61
+ pickFiles (ev) {
62
+ if (this.editable === true) {
63
+ if (ev !== Object(ev)) {
64
+ ev = { target: null }
65
+ }
66
+
67
+ if (ev.target !== null && ev.target.matches('input[type="file"]') === true) {
68
+ // stop propagation if it's not a real pointer event
69
+ ev.clientX === 0 && ev.clientY === 0 && stop(ev)
70
+ }
71
+ else {
72
+ const input = this.__getFileInput()
73
+ input && input !== ev.target && input.click(ev)
74
+ }
65
75
  }
66
76
  },
67
77
 
@@ -110,6 +120,18 @@ export default {
110
120
  files = [ files[0] ]
111
121
  }
112
122
 
123
+ files.forEach(file => {
124
+ file.__key = file.webkitRelativePath + file.lastModified + file.name + file.size
125
+ })
126
+
127
+ // Avoid duplicate files
128
+ const filenameMap = currentFileList.map(entry => entry.__key)
129
+ files = filterFiles(files, rejectedFiles, 'duplicate', file => {
130
+ return filenameMap.includes(file.__key) === false
131
+ })
132
+
133
+ if (files.length === 0) { return done() }
134
+
113
135
  if (this.maxTotalSize !== void 0) {
114
136
  let size = append === true
115
137
  ? currentFileList.reduce((total, file) => total + file.size, 0)
@@ -1,5 +1,7 @@
1
1
  import History from '../history.js'
2
2
 
3
+ let fullscreenCounter = 0
4
+
3
5
  export default {
4
6
  props: {
5
7
  fullscreen: Boolean,
@@ -48,7 +50,12 @@ export default {
48
50
  this.container = this.$el.parentNode
49
51
  this.container.replaceChild(this.fullscreenFillerNode, this.$el)
50
52
  document.body.appendChild(this.$el)
51
- document.body.classList.add('q-body--fullscreen-mixin')
53
+
54
+ fullscreenCounter++
55
+
56
+ if (fullscreenCounter === 1) {
57
+ document.body.classList.add('q-body--fullscreen-mixin')
58
+ }
52
59
 
53
60
  this.__historyFullscreen = {
54
61
  handler: this.exitFullscreen
@@ -66,11 +73,16 @@ export default {
66
73
  this.__historyFullscreen = void 0
67
74
  }
68
75
  this.container.replaceChild(this.$el, this.fullscreenFillerNode)
69
- document.body.classList.remove('q-body--fullscreen-mixin')
70
76
  this.inFullscreen = false
71
77
 
72
- if (this.$el.scrollIntoView !== void 0) {
73
- setTimeout(() => { this.$el.scrollIntoView() })
78
+ fullscreenCounter = Math.max(0, fullscreenCounter - 1)
79
+
80
+ if (fullscreenCounter === 0) {
81
+ document.body.classList.remove('q-body--fullscreen-mixin')
82
+
83
+ if (this.$el.scrollIntoView !== void 0) {
84
+ setTimeout(() => { this.$el.scrollIntoView() })
85
+ }
74
86
  }
75
87
  }
76
88
  },
@@ -3,6 +3,7 @@ import Vue from 'vue'
3
3
  import { isSSR } from '../plugins/Platform.js'
4
4
  import { getBodyFullscreenElement } from '../utils/dom.js'
5
5
  import { addFocusWaitFlag, removeFocusWaitFlag } from '../utils/focus-manager.js'
6
+ import debounce from '../utils/debounce.js'
6
7
 
7
8
  export function closePortalMenus (vm, evt) {
8
9
  do {
@@ -81,6 +82,9 @@ const Portal = {
81
82
  return
82
83
  }
83
84
 
85
+ if (this.__portalIsActive === true) { return }
86
+ this.__portalIsActive = true
87
+
84
88
  if (this.focusObj === void 0) {
85
89
  this.focusObj = {}
86
90
  }
@@ -88,15 +92,12 @@ const Portal = {
88
92
  addFocusWaitFlag(this.focusObj)
89
93
 
90
94
  if (this.$q.fullscreen !== void 0 && this.$q.fullscreen.isCapable === true) {
91
- const append = isFullscreen => {
95
+ const append = () => {
92
96
  if (this.__portal === void 0) {
93
97
  return
94
98
  }
95
99
 
96
- const newParent = getBodyFullscreenElement(
97
- isFullscreen,
98
- this.$q.fullscreen.activeEl
99
- )
100
+ const newParent = getBodyFullscreenElement(this.$q.fullscreen.activeEl)
100
101
 
101
102
  if (
102
103
  this.__portal.$el.parentElement !== newParent &&
@@ -106,12 +107,10 @@ const Portal = {
106
107
  }
107
108
  }
108
109
 
109
- this.unwatchFullscreen = this.$watch('$q.fullscreen.isActive', append)
110
-
111
- const isActive = this.$q.fullscreen.isActive
110
+ this.unwatchFullscreen = this.$watch('$q.fullscreen.activeEl', debounce(append, 50))
112
111
 
113
- if (this.__onGlobalDialog === false || isActive === true) {
114
- append(isActive)
112
+ if (this.__onGlobalDialog === false || this.$q.fullscreen.isActive === true) {
113
+ append()
115
114
  }
116
115
  }
117
116
  else if (this.__portal !== void 0 && this.__onGlobalDialog === false) {
@@ -120,6 +119,7 @@ const Portal = {
120
119
  },
121
120
 
122
121
  __hidePortal () {
122
+ this.__portalIsActive = false
123
123
  removeFocusWaitFlag(this.focusObj)
124
124
 
125
125
  if (this.__portal !== void 0) {
@@ -1,31 +1,105 @@
1
- export const routerLinkProps = {
1
+ const routerLinkProps = {
2
+ // router-link
2
3
  to: [String, Object],
3
4
  exact: Boolean,
4
5
  append: Boolean,
5
6
  replace: Boolean,
6
- activeClass: String,
7
- exactActiveClass: String,
7
+ activeClass: {
8
+ type: String,
9
+ default: 'q-router-link--active'
10
+ },
11
+ exactActiveClass: {
12
+ type: String,
13
+ default: 'q-router-link--exact-active'
14
+ },
15
+
16
+ // regular <a> link
17
+ href: String,
18
+ target: String,
19
+
20
+ // state
8
21
  disable: Boolean
9
22
  }
10
23
 
11
- export const RouterLinkMixin = {
24
+ // external props: type, tag
25
+ // external: fallbackTag
26
+
27
+ export default {
12
28
  props: routerLinkProps,
13
29
 
14
30
  computed: {
31
+ hasHrefLink () {
32
+ return this.disable !== true && this.href !== void 0
33
+ },
34
+
35
+ hasRouterLinkProps () {
36
+ return this.$router !== void 0 &&
37
+ this.disable !== true &&
38
+ this.hasHrefLink !== true &&
39
+ this.to !== void 0 && this.to !== null && this.to !== ''
40
+ },
41
+
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
57
+ },
58
+
15
59
  hasRouterLink () {
16
- return this.disable !== true && this.to !== void 0 && this.to !== null && this.to !== ''
60
+ return this.linkRoute !== null
61
+ },
62
+
63
+ hasLink () {
64
+ return this.hasHrefLink === true || this.hasRouterLink === true
17
65
  },
18
66
 
19
- routerLinkProps () {
20
- return {
21
- to: this.to,
22
- exact: this.exact,
23
- append: this.append,
24
- replace: this.replace,
25
- activeClass: this.activeClass || 'q-router-link--active',
26
- exactActiveClass: this.exactActiveClass || 'q-router-link--exact-active',
27
- event: this.disable === true ? [] : void 0
67
+ linkTag () {
68
+ if (this.hasRouterLink === true) {
69
+ return 'router-link'
28
70
  }
71
+
72
+ return this.type === 'a' || this.hasLink === true
73
+ ? 'a'
74
+ : (this.tag || this.fallbackTag || 'div')
75
+ },
76
+
77
+ linkProps () {
78
+ return this.hasHrefLink === true
79
+ ? {
80
+ attrs: {
81
+ href: this.href,
82
+ target: this.target
83
+ }
84
+ }
85
+ : (
86
+ this.hasRouterLink === true
87
+ ? {
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
+ }
100
+ }
101
+ : {}
102
+ )
29
103
  }
30
104
  }
31
105
  }
@@ -2,44 +2,60 @@
2
2
  "props": {
3
3
  "to": {
4
4
  "type": [ "String", "Object" ],
5
- "desc": "Equivalent to Vue Router <router-link> 'to' property",
5
+ "desc": "Equivalent to Vue Router <router-link> 'to' property; Superseeded by 'href' prop if used",
6
6
  "examples": [
7
7
  "/home/dashboard",
8
8
  ":to=\"{ name: 'my-route-name' }\""
9
9
  ],
10
- "category": "behavior"
10
+ "category": "navigation"
11
11
  },
12
12
 
13
13
  "exact": {
14
14
  "type": "Boolean",
15
- "desc": "Equivalent to Vue Router <router-link> 'exact' property",
16
- "category": "behavior"
15
+ "desc": "Equivalent to Vue Router <router-link> 'exact' property; Superseeded by 'href' prop if used",
16
+ "category": "navigation"
17
17
  },
18
18
 
19
19
  "append": {
20
20
  "type": "Boolean",
21
- "desc": "Equivalent to Vue Router <router-link> 'append' property",
22
- "category": "behavior"
21
+ "desc": "Equivalent to Vue Router <router-link> 'append' property; Superseeded by 'href' prop if used",
22
+ "category": "navigation"
23
23
  },
24
24
 
25
25
  "replace": {
26
26
  "type": "Boolean",
27
- "desc": "Equivalent to Vue Router <router-link> 'replace' property",
28
- "category": "behavior"
27
+ "desc": "Equivalent to Vue Router <router-link> 'replace' property; Superseeded by 'href' prop if used",
28
+ "category": "navigation"
29
29
  },
30
30
 
31
31
  "active-class": {
32
32
  "type": "String",
33
33
  "desc": "Equivalent to Vue Router <router-link> 'active-class' property",
34
34
  "examples": [ "my-active-class" ],
35
- "category": "behavior"
35
+ "category": "navigation"
36
36
  },
37
37
 
38
38
  "exact-active-class": {
39
39
  "type": "String",
40
40
  "desc": "Equivalent to Vue Router <router-link> 'active-class' property",
41
41
  "examples": [ "my-exact-active-class" ],
42
- "category": "behavior"
42
+ "category": "navigation"
43
+ },
44
+
45
+ "href": {
46
+ "type": "String",
47
+ "desc": "Native <a> link href attribute; Has priority over the 'to'/'exact'/'replace' props",
48
+ "examples": [ "http://quasar.dev" ],
49
+ "category": "navigation",
50
+ "addedIn": "v1.17"
51
+ },
52
+
53
+ "target": {
54
+ "type": "String",
55
+ "desc": "Native <a> link target attribute; Use it only along with 'href' prop; Has priority over the 'to'/'exact'/'replace' props",
56
+ "examples": [ "_blank", "_self", "_parent", "_top" ],
57
+ "category": "navigation",
58
+ "addedIn": "v1.17"
43
59
  },
44
60
 
45
61
  "disable": {
@@ -1,4 +1,5 @@
1
1
  import { testPattern } from '../utils/patterns.js'
2
+ import debounce from '../utils/debounce.js'
2
3
 
3
4
  const lazyRulesValues = [ true, false, 'ondemand' ]
4
5
 
@@ -35,7 +36,12 @@ export default {
35
36
  },
36
37
 
37
38
  disable (val) {
38
- val === true && this.resetValidation()
39
+ if (val === true) {
40
+ this.__resetValidation()
41
+ }
42
+ else {
43
+ this.__validateIfNeeded(true)
44
+ }
39
45
  },
40
46
 
41
47
  reactiveRules: {
@@ -56,15 +62,16 @@ export default {
56
62
  },
57
63
 
58
64
  focused (focused) {
59
- if (this.lazyRules !== 'ondemand') {
60
- if (focused === true) {
61
- if (this.isDirty === null) {
62
- this.isDirty = false
63
- }
65
+ if (focused === true) {
66
+ if (this.isDirty === null) {
67
+ this.isDirty = false
64
68
  }
65
- else if (this.isDirty === false && this.hasRules === true) {
66
- this.isDirty = true
67
- this.validate()
69
+ }
70
+ else if (this.isDirty === false) {
71
+ this.isDirty = true
72
+
73
+ if (this.hasRules === true && this.lazyRules !== 'ondemand') {
74
+ this.debouncedValidate()
68
75
  }
69
76
  }
70
77
  },
@@ -77,7 +84,8 @@ export default {
77
84
 
78
85
  computed: {
79
86
  hasRules () {
80
- return this.rules !== void 0 &&
87
+ return this.disable !== true &&
88
+ this.rules !== void 0 &&
81
89
  this.rules !== null &&
82
90
  this.rules.length > 0
83
91
  },
@@ -93,21 +101,23 @@ export default {
93
101
  }
94
102
  },
95
103
 
104
+ created () {
105
+ this.debouncedValidate = debounce(this.validate, 0)
106
+ },
107
+
96
108
  mounted () {
97
109
  this.validateIndex = 0
98
110
  },
99
111
 
100
112
  beforeDestroy () {
101
113
  this.unwatchRules !== void 0 && this.unwatchRules()
114
+ this.debouncedValidate.cancel()
102
115
  },
103
116
 
104
117
  methods: {
105
118
  resetValidation () {
106
- this.validateIndex++
107
- this.innerLoading = false
108
119
  this.isDirty = null
109
- this.innerError = false
110
- this.innerErrorMessage = void 0
120
+ this.__resetValidation()
111
121
  },
112
122
 
113
123
  /*
@@ -203,13 +213,21 @@ export default {
203
213
  )
204
214
  },
205
215
 
216
+ __resetValidation () {
217
+ this.debouncedValidate.cancel()
218
+ this.validateIndex++
219
+ this.innerLoading = false
220
+ this.innerError = false
221
+ this.innerErrorMessage = void 0
222
+ },
223
+
206
224
  __validateIfNeeded (changedRules) {
207
225
  if (
208
226
  this.hasRules === true &&
209
227
  this.lazyRules !== 'ondemand' &&
210
228
  (this.isDirty === true || (this.lazyRules !== true && changedRules !== true))
211
229
  ) {
212
- this.validate()
230
+ this.debouncedValidate()
213
231
  }
214
232
  }
215
233
  }