quasar 2.3.4 → 2.4.3

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 (238) hide show
  1. package/dist/api/BottomSheet.json +1 -1
  2. package/dist/api/Loading.json +2 -6
  3. package/dist/api/Notify.json +5 -5
  4. package/dist/api/QAvatar.json +1 -1
  5. package/dist/api/QBreadcrumbsEl.json +32 -11
  6. package/dist/api/QBtn.json +32 -16
  7. package/dist/api/QBtnDropdown.json +33 -17
  8. package/dist/api/QBtnToggle.json +4 -1
  9. package/dist/api/QCarousel.json +4 -4
  10. package/dist/api/QChatMessage.json +4 -12
  11. package/dist/api/QChip.json +4 -4
  12. package/dist/api/QExpansionItem.json +34 -13
  13. package/dist/api/QFab.json +32 -2
  14. package/dist/api/QFabAction.json +9 -1
  15. package/dist/api/QField.json +1 -0
  16. package/dist/api/QFile.json +1 -0
  17. package/dist/api/QInput.json +1 -0
  18. package/dist/api/QItem.json +31 -10
  19. package/dist/api/QLinearProgress.json +1 -1
  20. package/dist/api/QOptionGroup.json +74 -4
  21. package/dist/api/QPagination.json +4 -4
  22. package/dist/api/QPullToRefresh.json +1 -1
  23. package/dist/api/QRange.json +592 -107
  24. package/dist/api/QRating.json +3 -3
  25. package/dist/api/QRouteTab.json +32 -12
  26. package/dist/api/QSelect.json +4 -7
  27. package/dist/api/QSlider.json +504 -39
  28. package/dist/api/QStep.json +4 -4
  29. package/dist/api/QStepper.json +4 -4
  30. package/dist/api/QTab.json +1 -1
  31. package/dist/api/QTable.json +4 -4
  32. package/dist/api/QTimelineEntry.json +1 -1
  33. package/dist/api/QToggle.json +1 -1
  34. package/dist/api/QTree.json +1 -1
  35. package/dist/api/QUploader.json +16 -2
  36. package/dist/api/QVideo.json +11 -1
  37. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  38. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  39. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  40. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  41. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  42. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  43. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  44. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  45. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  46. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  47. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  48. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  49. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  50. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  51. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  52. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  53. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  54. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  55. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  56. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  57. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  58. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  59. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  60. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  61. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  62. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  63. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  64. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  65. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  66. package/dist/icon-set/themify.umd.prod.js +1 -1
  67. package/dist/lang/ar.umd.prod.js +1 -1
  68. package/dist/lang/az-Latn.umd.prod.js +1 -1
  69. package/dist/lang/bg.umd.prod.js +1 -1
  70. package/dist/lang/bn.umd.prod.js +1 -1
  71. package/dist/lang/ca.umd.prod.js +1 -1
  72. package/dist/lang/cs.umd.prod.js +1 -1
  73. package/dist/lang/da.umd.prod.js +1 -1
  74. package/dist/lang/de.umd.prod.js +1 -1
  75. package/dist/lang/el.umd.prod.js +1 -1
  76. package/dist/lang/en-GB.umd.prod.js +1 -1
  77. package/dist/lang/en-US.umd.prod.js +1 -1
  78. package/dist/lang/eo.umd.prod.js +1 -1
  79. package/dist/lang/es.umd.prod.js +1 -1
  80. package/dist/lang/et.umd.prod.js +1 -1
  81. package/dist/lang/fa-IR.umd.prod.js +1 -1
  82. package/dist/lang/fa.umd.prod.js +1 -1
  83. package/dist/lang/fi.umd.prod.js +1 -1
  84. package/dist/lang/fr.umd.prod.js +1 -1
  85. package/dist/lang/gn.umd.prod.js +1 -1
  86. package/dist/lang/he.umd.prod.js +1 -1
  87. package/dist/lang/hr.umd.prod.js +1 -1
  88. package/dist/lang/hu.umd.prod.js +1 -1
  89. package/dist/lang/id.umd.prod.js +1 -1
  90. package/dist/lang/is.umd.prod.js +1 -1
  91. package/dist/lang/it.umd.prod.js +1 -1
  92. package/dist/lang/ja.umd.prod.js +1 -1
  93. package/dist/lang/km.umd.prod.js +1 -1
  94. package/dist/lang/ko-KR.umd.prod.js +1 -1
  95. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  96. package/dist/lang/lt.umd.prod.js +1 -1
  97. package/dist/lang/lu.umd.prod.js +1 -1
  98. package/dist/lang/lv.umd.prod.js +1 -1
  99. package/dist/lang/ml.umd.prod.js +1 -1
  100. package/dist/lang/ms.umd.prod.js +1 -1
  101. package/dist/lang/nb-NO.umd.prod.js +1 -1
  102. package/dist/lang/nl.umd.prod.js +1 -1
  103. package/dist/lang/pl.umd.prod.js +1 -1
  104. package/dist/lang/pt-BR.umd.prod.js +1 -1
  105. package/dist/lang/pt.umd.prod.js +1 -1
  106. package/dist/lang/ro.umd.prod.js +1 -1
  107. package/dist/lang/ru.umd.prod.js +1 -1
  108. package/dist/lang/sk.umd.prod.js +1 -1
  109. package/dist/lang/sl.umd.prod.js +1 -1
  110. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  111. package/dist/lang/sr.umd.prod.js +1 -1
  112. package/dist/lang/sv.umd.prod.js +1 -1
  113. package/dist/lang/ta.umd.prod.js +1 -1
  114. package/dist/lang/th.umd.prod.js +1 -1
  115. package/dist/lang/tr.umd.prod.js +1 -1
  116. package/dist/lang/ug.umd.prod.js +1 -1
  117. package/dist/lang/uk.umd.prod.js +1 -1
  118. package/dist/lang/vi.umd.prod.js +1 -1
  119. package/dist/lang/zh-CN.umd.prod.js +1 -1
  120. package/dist/lang/zh-TW.umd.prod.js +1 -1
  121. package/dist/quasar.cjs.prod.js +2 -2
  122. package/dist/quasar.css +277 -196
  123. package/dist/quasar.esm.prod.js +2 -2
  124. package/dist/quasar.prod.css +1 -1
  125. package/dist/quasar.rtl.css +344 -275
  126. package/dist/quasar.rtl.prod.css +1 -1
  127. package/dist/quasar.sass +243 -189
  128. package/dist/quasar.umd.js +16670 -16294
  129. package/dist/quasar.umd.prod.js +2 -2
  130. package/dist/ssr-directives/Morph.js +1 -1
  131. package/dist/transforms/loader-asset-urls.json +20 -0
  132. package/dist/types/api/slider.d.ts +46 -0
  133. package/dist/types/api/validation.d.ts +4 -0
  134. package/dist/types/api.d.ts +2 -0
  135. package/dist/types/composables.d.ts +3 -3
  136. package/dist/types/index.d.ts +599 -121
  137. package/dist/types/utils/date.d.ts +2 -1
  138. package/dist/vetur/quasar-attributes.json +254 -82
  139. package/dist/vetur/quasar-tags.json +61 -18
  140. package/dist/web-types/web-types.json +635 -197
  141. package/package.json +1 -1
  142. package/src/api.extends.json +1 -2
  143. package/src/components/breadcrumbs/QBreadcrumbs.js +7 -2
  144. package/src/components/breadcrumbs/QBreadcrumbs.sass +0 -3
  145. package/src/components/breadcrumbs/QBreadcrumbsEl.js +14 -8
  146. package/src/components/btn/QBtn.js +5 -5
  147. package/src/components/btn/use-btn.js +21 -21
  148. package/src/components/btn/use-btn.json +22 -13
  149. package/src/components/btn-toggle/QBtnToggle.json +3 -0
  150. package/src/components/checkbox/use-checkbox.js +1 -1
  151. package/src/components/color/QColor.js +32 -26
  152. package/src/components/color/QColor.sass +10 -23
  153. package/src/components/date/QDate.sass +2 -0
  154. package/src/components/dialog/QDialog.js +7 -5
  155. package/src/components/drawer/QDrawer.js +18 -15
  156. package/src/components/editor/QEditor.js +1 -1
  157. package/src/components/editor/QEditor.sass +10 -1
  158. package/src/components/expansion-item/QExpansionItem.js +4 -1
  159. package/src/components/fab/QFab.js +18 -12
  160. package/src/components/fab/QFab.json +33 -0
  161. package/src/components/fab/QFab.sass +1 -1
  162. package/src/components/fab/QFabAction.js +14 -7
  163. package/src/components/fab/QFabAction.json +10 -0
  164. package/src/components/file/QFile.js +12 -5
  165. package/src/components/file/QFile.sass +4 -2
  166. package/src/components/footer/QFooter.js +1 -1
  167. package/src/components/header/QHeader.js +1 -1
  168. package/src/components/icon/QIcon.js +1 -1
  169. package/src/components/infinite-scroll/QInfiniteScroll.js +4 -5
  170. package/src/components/item/QItem.js +2 -3
  171. package/src/components/linear-progress/QLinearProgress.json +1 -1
  172. package/src/components/menu/QMenu.js +6 -2
  173. package/src/components/option-group/QOptionGroup.js +3 -0
  174. package/src/components/option-group/QOptionGroup.json +48 -2
  175. package/src/components/parallax/QParallax.js +4 -2
  176. package/src/components/popup-edit/QPopupEdit.js +2 -5
  177. package/src/components/radio/QRadio.js +2 -7
  178. package/src/components/range/QRange.js +132 -273
  179. package/src/components/range/QRange.json +11 -121
  180. package/src/components/rating/QRating.json +3 -3
  181. package/src/components/resize-observer/QResizeObserver.js +11 -10
  182. package/src/components/scroll-area/QScrollArea.js +8 -2
  183. package/src/components/scroll-observer/QScrollObserver.js +2 -0
  184. package/src/components/select/QSelect.js +4 -1
  185. package/src/components/slider/QSlider.js +61 -137
  186. package/src/components/slider/QSlider.json +1 -121
  187. package/src/components/slider/QSlider.sass +203 -138
  188. package/src/components/slider/use-slider.js +454 -107
  189. package/src/components/slider/use-slider.json +546 -0
  190. package/src/components/stepper/QStepper.js +3 -3
  191. package/src/components/stepper/QStepper.sass +24 -26
  192. package/src/components/table/QTable.js +26 -46
  193. package/src/components/tabs/QRouteTab.js +1 -2
  194. package/src/components/tabs/QRouteTab.json +0 -7
  195. package/src/components/tabs/QTabs.js +91 -24
  196. package/src/components/tabs/use-tab.js +26 -13
  197. package/src/components/tooltip/QTooltip.js +1 -2
  198. package/src/components/tree/QTree.js +14 -12
  199. package/src/components/uploader/QUploader.json +14 -2
  200. package/src/components/uploader/uploader-core.js +16 -9
  201. package/src/components/video/QVideo.js +4 -1
  202. package/src/components/video/QVideo.json +12 -1
  203. package/src/components/virtual-scroll/QVirtualScroll.sass +1 -0
  204. package/src/components/virtual-scroll/use-virtual-scroll.js +30 -17
  205. package/src/composables/private/use-field.js +18 -20
  206. package/src/composables/private/use-file.js +20 -5
  207. package/src/composables/private/use-form.js +2 -3
  208. package/src/composables/private/use-fullscreen.js +15 -4
  209. package/src/composables/private/use-model-toggle.js +1 -1
  210. package/src/composables/private/use-portal.js +9 -7
  211. package/src/composables/private/use-router-link.js +44 -23
  212. package/src/composables/private/use-router-link.json +26 -10
  213. package/src/composables/private/use-split-attrs.js +4 -4
  214. package/src/composables/private/use-tick.js +7 -14
  215. package/src/composables/private/use-validate.js +21 -15
  216. package/src/composables/private/use-validate.json +1 -0
  217. package/src/css/core/helpers.sass +3 -0
  218. package/src/css/core/positioning.sass +5 -0
  219. package/src/css/variables.sass +4 -6
  220. package/src/directives/ScrollFire.js +1 -0
  221. package/src/icon-set.js +2 -4
  222. package/src/plugins/AppFullscreen.js +70 -53
  223. package/src/plugins/AppVisibility.js +2 -3
  224. package/src/plugins/BottomSheet.js +3 -5
  225. package/src/plugins/Dialog.js +3 -5
  226. package/src/plugins/LoadingBar.js +17 -18
  227. package/src/plugins/Notify.js +296 -295
  228. package/src/plugins/Platform.js +14 -14
  229. package/src/utils/clone.js +53 -4
  230. package/src/utils/date.js +4 -4
  231. package/src/utils/dom.js +2 -2
  232. package/src/utils/open-url.js +2 -2
  233. package/src/utils/patterns.js +1 -0
  234. package/src/utils/private/define-reactive-plugin.js +10 -8
  235. package/src/utils/private/focus-manager.js +8 -10
  236. package/src/utils/private/global-dialog.js +6 -8
  237. package/src/utils/private/inject-obj-prop.js +13 -0
  238. package/src/utils/private/is.js +2 -2
@@ -15,8 +15,8 @@ const scrollToEdges = [
15
15
  'end-force'
16
16
  ]
17
17
 
18
- const slice = Array.prototype.slice
19
18
  let id = 1
19
+ const filterProto = Array.prototype.filter
20
20
 
21
21
  const setOverflowAnchor = __QUASAR_SSR__ || window.getComputedStyle(document.body).overflowAnchor === void 0
22
22
  ? noop
@@ -66,7 +66,7 @@ function getScrollDetails (
66
66
  if (horizontal === true) {
67
67
  if (parent === window) {
68
68
  details.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0
69
- details.scrollViewSize += window.innerWidth
69
+ details.scrollViewSize += document.documentElement.clientWidth
70
70
  }
71
71
  else {
72
72
  details.scrollStart = parentCalc.scrollLeft
@@ -81,7 +81,7 @@ function getScrollDetails (
81
81
  else {
82
82
  if (parent === window) {
83
83
  details.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0
84
- details.scrollViewSize += window.innerHeight
84
+ details.scrollViewSize += document.documentElement.clientHeight
85
85
  }
86
86
  else {
87
87
  details.scrollStart = parentCalc.scrollTop
@@ -130,10 +130,16 @@ function getScrollDetails (
130
130
  }
131
131
 
132
132
  function setScroll (parent, scroll, horizontal, rtl) {
133
+ if (scroll === 'end') {
134
+ scroll = (parent === window ? document.body : parent)[
135
+ horizontal === true ? 'scrollWidth' : 'scrollHeight'
136
+ ]
137
+ }
138
+
133
139
  if (parent === window) {
134
140
  if (horizontal === true) {
135
141
  if (rtl === true) {
136
- scroll = (rtlHasScrollBug === true ? document.body.scrollWidth - window.innerWidth : 0) - scroll
142
+ scroll = (rtlHasScrollBug === true ? document.body.scrollWidth - document.documentElement.clientWidth : 0) - scroll
137
143
  }
138
144
  window.scrollTo(scroll, window.pageYOffset || window.scrollY || document.body.scrollTop || 0)
139
145
  }
@@ -398,20 +404,17 @@ export function useVirtualScroll ({
398
404
  }
399
405
 
400
406
  const { activeElement } = document
407
+ const contentEl = contentRef.value
401
408
  if (
402
409
  rangeChanged === true
403
- && contentRef.value !== null
404
- && contentRef.value !== activeElement
405
- && contentRef.value.contains(activeElement) === true
410
+ && contentEl !== null
411
+ && contentEl !== activeElement
412
+ && contentEl.contains(activeElement) === true
406
413
  ) {
407
- const onBlurFn = () => {
408
- contentRef.value.focus()
409
- }
414
+ contentEl.addEventListener('focusout', onBlurRefocusFn)
410
415
 
411
- activeElement.addEventListener('blur', onBlurFn, true)
412
-
413
- requestAnimationFrame(() => {
414
- activeElement.removeEventListener('blur', onBlurFn, true)
416
+ setTimeout(() => {
417
+ contentEl !== void 0 && contentEl.removeEventListener('focusout', onBlurRefocusFn)
415
418
  })
416
419
  }
417
420
 
@@ -489,8 +492,10 @@ export function useVirtualScroll ({
489
492
 
490
493
  if (contentEl) {
491
494
  const
492
- children = slice.call(contentEl.children)
493
- .filter(el => el.classList.contains('q-virtual-scroll--skip') === false),
495
+ children = filterProto.call(
496
+ contentEl.children,
497
+ el => el.classList && el.classList.contains('q-virtual-scroll--skip') === false
498
+ ),
494
499
  childrenLength = children.length,
495
500
  sizeFn = props.virtualScrollHorizontal === true
496
501
  ? el => el.getBoundingClientRect().width
@@ -521,6 +526,10 @@ export function useVirtualScroll ({
521
526
  }
522
527
  }
523
528
 
529
+ function onBlurRefocusFn () {
530
+ contentRef.value !== void 0 && contentRef.value.focus()
531
+ }
532
+
524
533
  function localResetVirtualScroll (toIndex, fullReset) {
525
534
  const defaultSize = 1 * virtualScrollItemSizeComputed.value
526
535
 
@@ -673,7 +682,10 @@ export function useVirtualScroll ({
673
682
  }
674
683
 
675
684
  setVirtualScrollSize()
676
- const onVirtualScrollEvt = debounce(localOnVirtualScrollEvt, $q.platform.is.ios === true ? 120 : 35)
685
+ const onVirtualScrollEvt = debounce(
686
+ localOnVirtualScrollEvt,
687
+ $q.platform.is.ios === true ? 120 : 35
688
+ )
677
689
 
678
690
  onBeforeMount(() => {
679
691
  setVirtualScrollSize()
@@ -698,6 +710,7 @@ export function useVirtualScroll ({
698
710
  setOverflowAnchor !== noop && onBeforeUnmount(() => {
699
711
  const styleSheet = document.getElementById(vsId + '_ss')
700
712
  styleSheet !== null && styleSheet.remove()
713
+ onVirtualScrollEvt.cancel()
701
714
  })
702
715
 
703
716
  // expose public methods
@@ -168,7 +168,7 @@ export default function (state) {
168
168
  isDirtyModel,
169
169
  hasRules,
170
170
  hasError,
171
- computedErrorMessage,
171
+ errorMessage,
172
172
  resetValidation
173
173
  } = useValidate(state.focused, state.innerLoading)
174
174
 
@@ -263,26 +263,24 @@ export default function (state) {
263
263
  state.targetUid.value = getTargetUid(val)
264
264
  })
265
265
 
266
- let focusFn
266
+ function focusHandler () {
267
+ const el = document.activeElement
268
+ let target = state.targetRef !== void 0 && state.targetRef.value
267
269
 
268
- function focus () {
269
- focusFn !== void 0 && removeFocusFn(focusFn)
270
- focusFn = addFocusFn(() => {
271
- focusFn = void 0
272
- const el = document.activeElement
273
- let target = state.targetRef !== void 0 && state.targetRef.value
274
-
275
- if (target && (el === null || el.id !== state.targetUid.value)) {
276
- target.hasAttribute('tabindex') === true || (target = target.querySelector('[tabindex]'))
277
- if (target && target !== el) {
278
- target.focus()
279
- }
270
+ if (target && (el === null || el.id !== state.targetUid.value)) {
271
+ target.hasAttribute('tabindex') === true || (target = target.querySelector('[tabindex]'))
272
+ if (target && target !== el) {
273
+ target.focus()
280
274
  }
281
- })
275
+ }
276
+ }
277
+
278
+ function focus () {
279
+ addFocusFn(focusHandler)
282
280
  }
283
281
 
284
282
  function blur () {
285
- focusFn !== void 0 && removeFocusFn(focusFn)
283
+ removeFocusFn(focusHandler)
286
284
  const el = document.activeElement
287
285
  if (el !== null && state.rootRef.value.contains(el)) {
288
286
  el.blur()
@@ -348,7 +346,7 @@ export default function (state) {
348
346
  nextTick(() => {
349
347
  resetValidation()
350
348
 
351
- if (props.lazyRules !== 'ondemand' && $q.platform.is.mobile !== true) {
349
+ if ($q.platform.is.mobile !== true) {
352
350
  isDirtyModel.value = false
353
351
  }
354
352
  })
@@ -473,9 +471,9 @@ export default function (state) {
473
471
  let msg, key
474
472
 
475
473
  if (hasError.value === true) {
476
- if (computedErrorMessage.value !== null) {
477
- msg = [ h('div', { role: 'alert' }, computedErrorMessage.value) ]
478
- key = `q--slot-error-${ computedErrorMessage.value }`
474
+ if (errorMessage.value !== null) {
475
+ msg = [ h('div', { role: 'alert' }, errorMessage.value) ]
476
+ key = `q--slot-error-${ errorMessage.value }`
479
477
  }
480
478
  else {
481
479
  msg = hSlot(slots.error)
@@ -1,6 +1,6 @@
1
1
  import { h, computed, getCurrentInstance } from 'vue'
2
2
 
3
- import { stopAndPrevent } from '../../utils/event.js'
3
+ import { stop, stopAndPrevent } from '../../utils/event.js'
4
4
 
5
5
  function filterFiles (files, rejectedFiles, failedPropValidation, filterFn) {
6
6
  const acceptedFiles = []
@@ -62,8 +62,18 @@ export default function ({
62
62
 
63
63
  function pickFiles (e) {
64
64
  if (editable.value) {
65
- const input = getFileInput()
66
- input && input.click(e)
65
+ if (e !== Object(e)) {
66
+ e = { target: null }
67
+ }
68
+
69
+ if (e.target !== null && e.target.matches('input[type="file"]') === true) {
70
+ // stop propagation if it's not a real pointer event
71
+ e.clientX === 0 && e.clientY === 0 && stop(e)
72
+ }
73
+ else {
74
+ const input = getFileInput()
75
+ input && input !== e.target && input.click(e)
76
+ }
67
77
  }
68
78
  }
69
79
 
@@ -112,10 +122,15 @@ export default function ({
112
122
  files = [ files[ 0 ] ]
113
123
  }
114
124
 
125
+ // Compute key to use for each file
126
+ files.forEach(file => {
127
+ file.__key = file.webkitRelativePath + file.lastModified + file.name + file.size
128
+ })
129
+
115
130
  // Avoid duplicate files
116
- const filenameMap = currentFileList.map(entry => entry.name)
131
+ const filenameMap = currentFileList.map(entry => entry.__key)
117
132
  files = filterFiles(files, rejectedFiles, 'duplicate', file => {
118
- return filenameMap.includes(file.name) === false
133
+ return filenameMap.includes(file.__key) === false
119
134
  })
120
135
 
121
136
  if (files.length === 0) { return done() }
@@ -12,13 +12,12 @@ export function useFormAttrs (props) {
12
12
  }))
13
13
  }
14
14
 
15
- export function useFormInject (formAttrs = {}, formDomProps = {}) {
15
+ export function useFormInject (formAttrs = {}) {
16
16
  return (child, action, className) => {
17
17
  child[ action ](
18
18
  h('input', {
19
19
  class: 'hidden' + (className || ''),
20
- ...formAttrs.value,
21
- ...formDomProps.value
20
+ ...formAttrs.value
22
21
  })
23
22
  )
24
23
  }
@@ -3,6 +3,8 @@ import { ref, watch, onBeforeMount, onMounted, onBeforeUnmount, getCurrentInstan
3
3
  import History from '../../history.js'
4
4
  import { vmHasRouter } from '../../utils/private/vm.js'
5
5
 
6
+ let counter = 0
7
+
6
8
  export const useFullscreenProps = {
7
9
  fullscreen: Boolean,
8
10
  noRouteFullscreenExit: Boolean
@@ -50,7 +52,11 @@ export default function () {
50
52
  container = proxy.$el.parentNode
51
53
  container.replaceChild(fullscreenFillerNode, proxy.$el)
52
54
  document.body.appendChild(proxy.$el)
53
- document.body.classList.add('q-body--fullscreen-mixin')
55
+
56
+ counter++
57
+ if (counter === 1) {
58
+ document.body.classList.add('q-body--fullscreen-mixin')
59
+ }
54
60
 
55
61
  historyEntry = {
56
62
  handler: exitFullscreen
@@ -69,11 +75,16 @@ export default function () {
69
75
  }
70
76
 
71
77
  container.replaceChild(proxy.$el, fullscreenFillerNode)
72
- document.body.classList.remove('q-body--fullscreen-mixin')
73
78
  inFullscreen.value = false
74
79
 
75
- if (proxy.$el.scrollIntoView !== void 0) {
76
- setTimeout(() => { proxy.$el.scrollIntoView() })
80
+ counter = Math.max(0, counter - 1)
81
+
82
+ if (counter === 0) {
83
+ document.body.classList.remove('q-body--fullscreen-mixin')
84
+
85
+ if (proxy.$el.scrollIntoView !== void 0) {
86
+ setTimeout(() => { proxy.$el.scrollIntoView() })
87
+ }
77
88
  }
78
89
  }
79
90
 
@@ -15,7 +15,7 @@ export const useModelToggleEmits = [
15
15
  'before-show', 'show', 'before-hide', 'hide'
16
16
  ]
17
17
 
18
- // handleShow/handleHide -> removeTick(), self (& emit show), prepareTick()
18
+ // handleShow/handleHide -> removeTick(), self (& emit show)
19
19
 
20
20
  export default function ({
21
21
  showing,
@@ -48,16 +48,18 @@ export default function (vm, innerRef, renderPortalContent, checkGlobalDialog) {
48
48
  return
49
49
  }
50
50
 
51
- if (onGlobalDialog === false && portalEl === null) {
52
- portalEl = createGlobalNode()
53
- }
51
+ if (portalIsActive.value === false) {
52
+ if (onGlobalDialog === false && portalEl === null) {
53
+ portalEl = createGlobalNode()
54
+ }
54
55
 
55
- portalIsActive.value = true
56
+ portalIsActive.value = true
56
57
 
57
- // register portal
58
- portalList.push(vm.proxy)
58
+ // register portal
59
+ portalList.push(vm.proxy)
59
60
 
60
- addFocusWaitFlag(focusObj)
61
+ addFocusWaitFlag(focusObj)
62
+ }
61
63
  }
62
64
 
63
65
  function hidePortal () {
@@ -79,6 +79,7 @@ function isSameRouteLocationParams (a, b) {
79
79
  }
80
80
 
81
81
  export const useRouterLinkProps = {
82
+ // router-link
82
83
  to: [ String, Object ],
83
84
  replace: Boolean,
84
85
  exact: Boolean,
@@ -90,23 +91,33 @@ export const useRouterLinkProps = {
90
91
  type: String,
91
92
  default: 'q-router-link--exact-active'
92
93
  },
94
+
95
+ // regular <a> link
96
+ href: String,
97
+ target: String,
98
+
99
+ // state
93
100
  disable: Boolean
94
101
  }
95
102
 
96
- export default function () {
103
+ // external props: type, tag
104
+
105
+ export default function (fallbackTag) {
97
106
  const vm = getCurrentInstance()
98
- const { props, attrs, proxy } = vm
107
+ const { props, proxy } = vm
99
108
 
100
109
  const hasRouter = vmHasRouter(vm)
110
+ const hasHrefLink = computed(() => props.disable !== true && props.href !== void 0)
101
111
 
102
- const hasLinkConfigured = computed(() =>
112
+ const hasRouterLinkProps = computed(() =>
103
113
  hasRouter === true
104
114
  && props.disable !== true
115
+ && hasHrefLink.value !== true
105
116
  && props.to !== void 0 && props.to !== null && props.to !== ''
106
117
  )
107
118
 
108
119
  const linkRoute = computed(() => {
109
- if (hasLinkConfigured.value === true) {
120
+ if (hasRouterLinkProps.value === true) {
110
121
  try { return proxy.$router.resolve(props.to) }
111
122
  catch (err) {}
112
123
  }
@@ -114,16 +125,33 @@ export default function () {
114
125
  return null
115
126
  })
116
127
 
117
- const hasLink = computed(() => linkRoute.value !== null)
128
+ const hasRouterLink = computed(() => linkRoute.value !== null)
129
+ const hasLink = computed(() => hasHrefLink.value === true || hasRouterLink.value === true)
118
130
 
119
131
  const linkTag = computed(() => (
120
- hasLink.value === true
132
+ props.type === 'a' || hasLink.value === true
121
133
  ? 'a'
122
- : (props.tag || 'div')
134
+ : (props.tag || fallbackTag || 'div')
135
+ ))
136
+
137
+ const linkProps = computed(() => (
138
+ hasHrefLink.value === true
139
+ ? {
140
+ href: props.href,
141
+ target: props.target
142
+ }
143
+ : (
144
+ hasRouterLink.value === true
145
+ ? {
146
+ href: linkRoute.value.href,
147
+ target: props.target
148
+ }
149
+ : {}
150
+ )
123
151
  ))
124
152
 
125
153
  const linkActiveIndex = computed(() => {
126
- if (hasLink.value === false) {
154
+ if (hasRouterLink.value === false) {
127
155
  return null
128
156
  }
129
157
 
@@ -170,7 +198,7 @@ export default function () {
170
198
  })
171
199
 
172
200
  const linkIsActive = computed(() =>
173
- hasLink.value === true
201
+ hasRouterLink.value === true
174
202
  && linkActiveIndex.value > -1
175
203
  && includesParams(proxy.$route.params, linkRoute.value.params)
176
204
  )
@@ -182,7 +210,7 @@ export default function () {
182
210
  )
183
211
 
184
212
  const linkClass = computed(() => (
185
- hasLink.value === true
213
+ hasRouterLink.value === true
186
214
  ? (
187
215
  linkIsExactActive.value === true
188
216
  ? ` ${ props.exactActiveClass } ${ props.activeClass }`
@@ -195,18 +223,8 @@ export default function () {
195
223
  : ''
196
224
  ))
197
225
 
198
- const linkProps = computed(() => (
199
- hasLink.value === true
200
- ? {
201
- href: linkRoute.value.href,
202
- target: attrs.target,
203
- role: 'link'
204
- }
205
- : {}
206
- ))
207
-
208
226
  // should match RouterLink from Vue Router
209
- function navigateToLink (e) {
227
+ function navigateToRouterLink (e) {
210
228
  if (
211
229
  // component is not disabled
212
230
  props.disable === true
@@ -222,7 +240,7 @@ export default function () {
222
240
  || (e.button !== undefined && e.button !== 0)
223
241
 
224
242
  // don't redirect if it should open in a new window
225
- || attrs.target === '_blank'
243
+ || props.target === '_blank'
226
244
  ) {
227
245
  return false
228
246
  }
@@ -234,7 +252,10 @@ export default function () {
234
252
  }
235
253
 
236
254
  return {
255
+ hasRouterLink,
256
+ hasHrefLink,
237
257
  hasLink,
258
+
238
259
  linkTag,
239
260
  linkRoute,
240
261
  linkIsActive,
@@ -242,6 +263,6 @@ export default function () {
242
263
  linkClass,
243
264
  linkProps,
244
265
 
245
- navigateToLink
266
+ navigateToRouterLink
246
267
  }
247
268
  }
@@ -2,38 +2,54 @@
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
  "replace": {
20
20
  "type": "Boolean",
21
- "desc": "Equivalent to Vue Router <router-link> 'replace' property",
22
- "category": "behavior"
21
+ "desc": "Equivalent to Vue Router <router-link> 'replace' property; Superseeded by 'href' prop if used",
22
+ "category": "navigation"
23
23
  },
24
24
 
25
25
  "active-class": {
26
26
  "type": "String",
27
- "desc": "Equivalent to Vue Router <router-link> 'active-class' property",
27
+ "desc": "Equivalent to Vue Router <router-link> 'active-class' property; Superseeded by 'href' prop if used",
28
28
  "examples": [ "my-active-class" ],
29
- "category": "behavior"
29
+ "category": "navigation"
30
30
  },
31
31
 
32
32
  "exact-active-class": {
33
33
  "type": "String",
34
- "desc": "Equivalent to Vue Router <router-link> 'active-class' property",
34
+ "desc": "Equivalent to Vue Router <router-link> 'active-class' property; Superseeded by 'href' prop if used",
35
35
  "examples": [ "my-exact-active-class" ],
36
- "category": "behavior"
36
+ "category": "navigation"
37
+ },
38
+
39
+ "href": {
40
+ "type": "String",
41
+ "desc": "Native <a> link href attribute; Has priority over the 'to'/'exact'/'replace'/'active-class'/'exact-active-class' props",
42
+ "examples": [ "http://quasar.dev" ],
43
+ "category": "navigation",
44
+ "addedIn": "v2.4"
45
+ },
46
+
47
+ "target": {
48
+ "type": "String",
49
+ "desc": "Native <a> link target attribute; Use it only along with 'href' prop; Has priority over the 'to'/'exact'/'replace'/'active-class'/'exact-active-class' props",
50
+ "examples": [ "_blank", "_self", "_parent", "_top" ],
51
+ "category": "navigation",
52
+ "addedIn": "v2.4"
37
53
  },
38
54
 
39
55
  "disable": {
@@ -12,17 +12,17 @@ export default function (attrs, vnode) {
12
12
  const attributes = {}
13
13
  const listeners = {}
14
14
 
15
- Object.keys(attrs).forEach(key => {
15
+ for (const key in attrs) {
16
16
  if (key !== 'class' && key !== 'style' && listenerRE.test(key) === false) {
17
17
  attributes[ key ] = attrs[ key ]
18
18
  }
19
- })
19
+ }
20
20
 
21
- Object.keys(vnode.props).forEach(key => {
21
+ for (const key in vnode.props) {
22
22
  if (listenerRE.test(key) === true) {
23
23
  listeners[ key ] = vnode.props[ key ]
24
24
  }
25
- })
25
+ }
26
26
 
27
27
  acc.attributes.value = attributes
28
28
  acc.listeners.value = listeners
@@ -4,8 +4,6 @@ import { nextTick, onBeforeUnmount } from 'vue'
4
4
  * Usage:
5
5
  * registerTick(fn)
6
6
  * registerTick(fn)
7
- * ....
8
- * prepareTick()
9
7
  */
10
8
 
11
9
  export default function () {
@@ -18,22 +16,17 @@ export default function () {
18
16
  return {
19
17
  registerTick (fn) {
20
18
  tickFn = fn
19
+
20
+ nextTick(() => {
21
+ if (tickFn === fn) {
22
+ tickFn()
23
+ tickFn = void 0
24
+ }
25
+ })
21
26
  },
22
27
 
23
28
  removeTick () {
24
29
  tickFn = void 0
25
- },
26
-
27
- prepareTick () {
28
- if (tickFn !== void 0) {
29
- const fn = tickFn
30
- nextTick(() => {
31
- if (tickFn === fn) {
32
- tickFn()
33
- tickFn = void 0
34
- }
35
- })
36
- }
37
30
  }
38
31
  }
39
32
  }