quasar 2.11.3 → 2.11.4

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 (147) hide show
  1. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  2. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  3. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  4. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  5. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  6. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  7. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  8. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  9. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  10. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  13. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  14. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  15. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  16. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  17. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  19. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  21. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  22. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  23. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  24. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  39. package/dist/icon-set/themify.umd.prod.js +1 -1
  40. package/dist/lang/ar-TN.umd.prod.js +1 -1
  41. package/dist/lang/ar.umd.prod.js +1 -1
  42. package/dist/lang/az-Latn.umd.prod.js +1 -1
  43. package/dist/lang/bg.umd.prod.js +1 -1
  44. package/dist/lang/bn.umd.prod.js +1 -1
  45. package/dist/lang/ca.umd.prod.js +1 -1
  46. package/dist/lang/cs.umd.prod.js +1 -1
  47. package/dist/lang/da.umd.prod.js +1 -1
  48. package/dist/lang/de.umd.prod.js +1 -1
  49. package/dist/lang/el.umd.prod.js +1 -1
  50. package/dist/lang/en-GB.umd.prod.js +1 -1
  51. package/dist/lang/en-US.umd.prod.js +1 -1
  52. package/dist/lang/eo.umd.prod.js +1 -1
  53. package/dist/lang/es.umd.prod.js +1 -1
  54. package/dist/lang/et.umd.prod.js +1 -1
  55. package/dist/lang/eu.umd.prod.js +1 -1
  56. package/dist/lang/fa-IR.umd.prod.js +1 -1
  57. package/dist/lang/fa.umd.prod.js +1 -1
  58. package/dist/lang/fi.umd.prod.js +1 -1
  59. package/dist/lang/fr.umd.prod.js +1 -1
  60. package/dist/lang/gn.umd.prod.js +1 -1
  61. package/dist/lang/he.umd.prod.js +1 -1
  62. package/dist/lang/hr.umd.prod.js +1 -1
  63. package/dist/lang/hu.umd.prod.js +1 -1
  64. package/dist/lang/id.umd.prod.js +1 -1
  65. package/dist/lang/is.umd.prod.js +1 -1
  66. package/dist/lang/it.umd.prod.js +1 -1
  67. package/dist/lang/ja.umd.prod.js +1 -1
  68. package/dist/lang/kk.umd.prod.js +1 -1
  69. package/dist/lang/km.umd.prod.js +1 -1
  70. package/dist/lang/ko-KR.umd.prod.js +1 -1
  71. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  72. package/dist/lang/lt.umd.prod.js +1 -1
  73. package/dist/lang/lu.umd.prod.js +1 -1
  74. package/dist/lang/lv.umd.prod.js +1 -1
  75. package/dist/lang/ml.umd.prod.js +1 -1
  76. package/dist/lang/mm.umd.prod.js +1 -1
  77. package/dist/lang/ms.umd.prod.js +1 -1
  78. package/dist/lang/my.umd.prod.js +1 -1
  79. package/dist/lang/nb-NO.umd.prod.js +1 -1
  80. package/dist/lang/nl.umd.prod.js +1 -1
  81. package/dist/lang/pl.umd.prod.js +1 -1
  82. package/dist/lang/pt-BR.umd.prod.js +1 -1
  83. package/dist/lang/pt.umd.prod.js +1 -1
  84. package/dist/lang/ro.umd.prod.js +1 -1
  85. package/dist/lang/ru.umd.prod.js +1 -1
  86. package/dist/lang/sk.umd.prod.js +1 -1
  87. package/dist/lang/sl.umd.prod.js +1 -1
  88. package/dist/lang/sm.umd.prod.js +1 -1
  89. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  90. package/dist/lang/sr.umd.prod.js +1 -1
  91. package/dist/lang/sv.umd.prod.js +1 -1
  92. package/dist/lang/ta.umd.prod.js +1 -1
  93. package/dist/lang/th.umd.prod.js +1 -1
  94. package/dist/lang/tr.umd.prod.js +1 -1
  95. package/dist/lang/ug.umd.prod.js +1 -1
  96. package/dist/lang/uk.umd.prod.js +1 -1
  97. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  98. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  99. package/dist/lang/vi.umd.prod.js +1 -1
  100. package/dist/lang/zh-CN.umd.prod.js +1 -1
  101. package/dist/lang/zh-TW.umd.prod.js +1 -1
  102. package/dist/quasar.cjs.prod.js +2 -2
  103. package/dist/quasar.css +4 -0
  104. package/dist/quasar.esm.js +375 -175
  105. package/dist/quasar.esm.prod.js +2 -2
  106. package/dist/quasar.prod.css +1 -1
  107. package/dist/quasar.rtl.css +4 -0
  108. package/dist/quasar.rtl.prod.css +1 -1
  109. package/dist/quasar.sass +3 -1
  110. package/dist/quasar.umd.js +375 -175
  111. package/dist/quasar.umd.prod.js +2 -2
  112. package/dist/web-types/web-types.json +1 -1
  113. package/package.json +1 -1
  114. package/src/components/ajax-bar/QAjaxBar.js +13 -5
  115. package/src/components/btn/QBtn.js +3 -2
  116. package/src/components/carousel/QCarousel.js +17 -10
  117. package/src/components/dialog/QDialog.js +8 -4
  118. package/src/components/drawer/QDrawer.js +8 -3
  119. package/src/components/img/QImg.js +25 -11
  120. package/src/components/input/QInput.js +14 -4
  121. package/src/components/layout/QLayout.js +5 -5
  122. package/src/components/menu/QMenu.js +1 -1
  123. package/src/components/pull-to-refresh/QPullToRefresh.js +5 -4
  124. package/src/components/resize-observer/QResizeObserver.js +9 -4
  125. package/src/components/scroll-area/QScrollArea.js +8 -8
  126. package/src/components/select/QSelect.js +19 -8
  127. package/src/components/slide-item/QSlideItem.js +4 -2
  128. package/src/components/slide-transition/QSlideTransition.js +17 -3
  129. package/src/components/tabs/QTabs.js +12 -5
  130. package/src/components/tooltip/QTooltip.js +1 -1
  131. package/src/composables/private/use-anchor.js +8 -3
  132. package/src/composables/private/use-field.js +10 -4
  133. package/src/composables/private/use-portal.js +3 -3
  134. package/src/composables/private/use-timeout.js +6 -3
  135. package/src/css/core/visibility.sass +2 -0
  136. package/src/directives/TouchHold.js +9 -4
  137. package/src/directives/TouchRepeat.js +10 -3
  138. package/src/plugins/Loading.js +5 -5
  139. package/src/plugins/Meta.js +4 -2
  140. package/src/plugins/Notify.js +13 -3
  141. package/src/utils/debounce.js +9 -6
  142. package/src/utils/morph.js +7 -6
  143. package/src/utils/prevent-scroll.js +5 -6
  144. package/src/utils/private/click-outside.js +10 -3
  145. package/src/utils/private/global-dialog.js +1 -1
  146. package/src/utils/private/global-nodes.js +44 -13
  147. package/src/utils/private/position-engine.js +67 -25
@@ -88,7 +88,7 @@ export default createComponent({
88
88
  const tabDataListLen = ref(0)
89
89
  const hasFocus = ref(false)
90
90
 
91
- let animateTimer, scrollTimer, unwatchRoute
91
+ let animateTimer = null, scrollTimer = null, unwatchRoute
92
92
 
93
93
  const tabProps = computed(() => ({
94
94
  activeClass: props.activeClass,
@@ -224,7 +224,10 @@ export default createComponent({
224
224
  oldEl = oldTab.tabIndicatorRef.value,
225
225
  newEl = newTab.tabIndicatorRef.value
226
226
 
227
- clearTimeout(animateTimer)
227
+ if (animateTimer !== null) {
228
+ clearTimeout(animateTimer)
229
+ animateTimer = null
230
+ }
228
231
 
229
232
  oldEl.style.transition = 'none'
230
233
  oldEl.style.transform = 'none'
@@ -242,6 +245,7 @@ export default createComponent({
242
245
  // allow scope updates to kick in (QRouteTab needs more time)
243
246
  registerAnimateTick(() => {
244
247
  animateTimer = setTimeout(() => {
248
+ animateTimer = null
245
249
  newEl.style.transition = 'transform .25s cubic-bezier(.4, 0, .2, 1)'
246
250
  newEl.style.transform = 'none'
247
251
  }, 70)
@@ -294,7 +298,7 @@ export default createComponent({
294
298
  }
295
299
 
296
300
  function animScrollTo (value) {
297
- stopAnimScroll()
301
+ scrollTimer !== null && clearInterval(scrollTimer)
298
302
  scrollTimer = setInterval(() => {
299
303
  if (scrollTowards(value) === true) {
300
304
  stopAnimScroll()
@@ -311,7 +315,10 @@ export default createComponent({
311
315
  }
312
316
 
313
317
  function stopAnimScroll () {
314
- clearInterval(scrollTimer)
318
+ if (scrollTimer !== null) {
319
+ clearInterval(scrollTimer)
320
+ scrollTimer = null
321
+ }
315
322
  }
316
323
 
317
324
  function onKbdNavigate (keyCode, fromEl) {
@@ -615,7 +622,7 @@ export default createComponent({
615
622
  provide(tabsKey, $tabs)
616
623
 
617
624
  function cleanup () {
618
- clearTimeout(animateTimer)
625
+ animateTimer !== null && clearTimeout(animateTimer)
619
626
  stopAnimScroll()
620
627
  unwatchRoute !== void 0 && unwatchRoute()
621
628
  }
@@ -107,7 +107,7 @@ export default createComponent({
107
107
 
108
108
  Object.assign(anchorEvents, { delayShow, delayHide })
109
109
 
110
- const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent)
110
+ const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent, 'tooltip')
111
111
 
112
112
  // if we're on mobile, let's improve the experience
113
113
  // by closing it when user taps outside of it
@@ -21,7 +21,7 @@ export default function ({
21
21
 
22
22
  const anchorEl = ref(null)
23
23
 
24
- let touchTimer
24
+ let touchTimer = null
25
25
 
26
26
  function canShow (evt) {
27
27
  // abort with no parent configured or on multi-touch
@@ -80,6 +80,7 @@ export default function ({
80
80
  ])
81
81
 
82
82
  touchTimer = setTimeout(() => {
83
+ touchTimer = null
83
84
  proxy.show(evt)
84
85
  evt.qAnchorHandled = true
85
86
  }, 300)
@@ -87,7 +88,11 @@ export default function ({
87
88
 
88
89
  mobileCleanup (evt) {
89
90
  anchorEl.value.classList.remove('non-selectable')
90
- clearTimeout(touchTimer)
91
+
92
+ if (touchTimer !== null) {
93
+ clearTimeout(touchTimer)
94
+ touchTimer = null
95
+ }
91
96
 
92
97
  if (showing.value === true && evt !== void 0) {
93
98
  clearSelection()
@@ -201,7 +206,7 @@ export default function ({
201
206
  })
202
207
 
203
208
  onBeforeUnmount(() => {
204
- clearTimeout(touchTimer)
209
+ touchTimer !== null && clearTimeout(touchTimer)
205
210
  unconfigureAnchorEl()
206
211
  })
207
212
 
@@ -122,7 +122,7 @@ export default function (state) {
122
122
  const { props, emit, slots, attrs, proxy } = getCurrentInstance()
123
123
  const { $q } = proxy
124
124
 
125
- let focusoutTimer
125
+ let focusoutTimer = null
126
126
 
127
127
  if (state.hasValue === void 0) {
128
128
  state.hasValue = computed(() => fieldValueIsFilled(props.modelValue))
@@ -288,7 +288,11 @@ export default function (state) {
288
288
  }
289
289
 
290
290
  function onControlFocusin (e) {
291
- clearTimeout(focusoutTimer)
291
+ if (focusoutTimer !== null) {
292
+ clearTimeout(focusoutTimer)
293
+ focusoutTimer = null
294
+ }
295
+
292
296
  if (state.editable.value === true && state.focused.value === false) {
293
297
  state.focused.value = true
294
298
  emit('focus', e)
@@ -296,8 +300,10 @@ export default function (state) {
296
300
  }
297
301
 
298
302
  function onControlFocusout (e, then) {
299
- clearTimeout(focusoutTimer)
303
+ focusoutTimer !== null && clearTimeout(focusoutTimer)
300
304
  focusoutTimer = setTimeout(() => {
305
+ focusoutTimer = null
306
+
301
307
  if (
302
308
  document.hasFocus() === true && (
303
309
  state.hasPopupOpen === true
@@ -547,7 +553,7 @@ export default function (state) {
547
553
  })
548
554
 
549
555
  onBeforeUnmount(() => {
550
- clearTimeout(focusoutTimer)
556
+ focusoutTimer !== null && clearTimeout(focusoutTimer)
551
557
  })
552
558
 
553
559
  // expose public methods
@@ -26,7 +26,7 @@ function isOnGlobalDialog (vm) {
26
26
  // Warning!
27
27
  // You MUST specify "inheritAttrs: false" in your component
28
28
 
29
- export default function (vm, innerRef, renderPortalContent, checkGlobalDialog) {
29
+ export default function (vm, innerRef, renderPortalContent, type) {
30
30
  // showing, including while in show/hide transition
31
31
  const portalIsActive = ref(false)
32
32
 
@@ -46,7 +46,7 @@ export default function (vm, innerRef, renderPortalContent, checkGlobalDialog) {
46
46
 
47
47
  let portalEl = null
48
48
  const focusObj = {}
49
- const onGlobalDialog = checkGlobalDialog === true && isOnGlobalDialog(vm)
49
+ const onGlobalDialog = type === 'dialog' && isOnGlobalDialog(vm)
50
50
 
51
51
  function showPortal (isReady) {
52
52
  if (isReady === true) {
@@ -59,7 +59,7 @@ export default function (vm, innerRef, renderPortalContent, checkGlobalDialog) {
59
59
 
60
60
  if (portalIsActive.value === false) {
61
61
  if (onGlobalDialog === false && portalEl === null) {
62
- portalEl = createGlobalNode()
62
+ portalEl = createGlobalNode(false, type)
63
63
  }
64
64
 
65
65
  portalIsActive.value = true
@@ -9,11 +9,14 @@ import { vmIsDestroyed } from '../../utils/private/vm'
9
9
  */
10
10
 
11
11
  export default function () {
12
- let timer
12
+ let timer = null
13
13
  const vm = getCurrentInstance()
14
14
 
15
15
  function removeTimeout () {
16
- clearTimeout(timer)
16
+ if (timer !== null) {
17
+ clearTimeout(timer)
18
+ timer = null
19
+ }
17
20
  }
18
21
 
19
22
  onDeactivated(removeTimeout)
@@ -23,7 +26,7 @@ export default function () {
23
26
  removeTimeout,
24
27
 
25
28
  registerTimeout (fn, delay) {
26
- clearTimeout(timer)
29
+ removeTimeout(timer)
27
30
 
28
31
  if (vmIsDestroyed(vm) === false) {
29
32
  timer = setTimeout(fn, delay)
@@ -40,6 +40,8 @@
40
40
  visibility: hidden !important
41
41
  transition: none !important
42
42
  animation: none !important
43
+ .invisible svg *
44
+ display: none
43
45
  .transparent
44
46
  background: transparent !important
45
47
 
@@ -74,6 +74,7 @@ export default createDirective(__QUASAR_SSR_SERVER__
74
74
  : ctx.touchSensitivity
75
75
 
76
76
  ctx.timer = setTimeout(() => {
77
+ ctx.timer = void 0
77
78
  clearSelection()
78
79
  ctx.triggered = true
79
80
 
@@ -90,10 +91,13 @@ export default createDirective(__QUASAR_SSR_SERVER__
90
91
  move (evt) {
91
92
  const { top, left } = position(evt)
92
93
  if (
93
- Math.abs(left - ctx.origin.left) >= ctx.sensitivity
94
- || Math.abs(top - ctx.origin.top) >= ctx.sensitivity
94
+ ctx.timer !== void 0 && (
95
+ Math.abs(left - ctx.origin.left) >= ctx.sensitivity
96
+ || Math.abs(top - ctx.origin.top) >= ctx.sensitivity
97
+ )
95
98
  ) {
96
99
  clearTimeout(ctx.timer)
100
+ ctx.timer = void 0
97
101
  }
98
102
  },
99
103
 
@@ -106,8 +110,9 @@ export default createDirective(__QUASAR_SSR_SERVER__
106
110
  if (ctx.triggered === true) {
107
111
  evt !== void 0 && stopAndPrevent(evt)
108
112
  }
109
- else {
113
+ else if (ctx.timer !== void 0) {
110
114
  clearTimeout(ctx.timer)
115
+ ctx.timer = void 0
111
116
  }
112
117
  }
113
118
  }
@@ -159,7 +164,7 @@ export default createDirective(__QUASAR_SSR_SERVER__
159
164
  cleanEvt(ctx, 'main')
160
165
  cleanEvt(ctx, 'temp')
161
166
 
162
- clearTimeout(ctx.timer)
167
+ ctx.timer !== void 0 && clearTimeout(ctx.timer)
163
168
  ctx.styleCleanup !== void 0 && ctx.styleCleanup()
164
169
 
165
170
  delete el.__qtouchhold
@@ -138,6 +138,8 @@ export default createDirective(__QUASAR_SSR_SERVER__
138
138
  }
139
139
 
140
140
  const fn = () => {
141
+ ctx.timer = void 0
142
+
141
143
  if (ctx.event === void 0) {
142
144
  return
143
145
  }
@@ -181,8 +183,9 @@ export default createDirective(__QUASAR_SSR_SERVER__
181
183
  },
182
184
 
183
185
  move (evt) {
184
- if (ctx.event !== void 0 && shouldEnd(evt, ctx.origin) === true) {
186
+ if (ctx.event !== void 0 && ctx.timer !== void 0 && shouldEnd(evt, ctx.origin) === true) {
185
187
  clearTimeout(ctx.timer)
188
+ ctx.timer = void 0
186
189
  }
187
190
  },
188
191
 
@@ -195,7 +198,11 @@ export default createDirective(__QUASAR_SSR_SERVER__
195
198
  evt !== void 0 && ctx.event.repeatCount > 0 && stopAndPrevent(evt)
196
199
 
197
200
  cleanEvt(ctx, 'temp')
198
- clearTimeout(ctx.timer)
201
+
202
+ if (ctx.timer !== void 0) {
203
+ clearTimeout(ctx.timer)
204
+ ctx.timer = void 0
205
+ }
199
206
 
200
207
  ctx.event = void 0
201
208
  }
@@ -244,7 +251,7 @@ export default createDirective(__QUASAR_SSR_SERVER__
244
251
  const ctx = el.__qtouchrepeat
245
252
 
246
253
  if (ctx !== void 0) {
247
- clearTimeout(ctx.timer)
254
+ ctx.timer !== void 0 && clearTimeout(ctx.timer)
248
255
 
249
256
  cleanEvt(ctx, 'main')
250
257
  cleanEvt(ctx, 'temp')
@@ -11,7 +11,7 @@ let
11
11
  app,
12
12
  vm,
13
13
  uid = 0,
14
- timeout,
14
+ timeout = null,
15
15
  props = {},
16
16
  activeGroups = {}
17
17
 
@@ -61,10 +61,10 @@ const Plugin = defineReactivePlugin({
61
61
  }
62
62
  else {
63
63
  props.uid = ++uid
64
- clearTimeout(timeout)
64
+ timeout !== null && clearTimeout(timeout)
65
65
 
66
66
  timeout = setTimeout(() => {
67
- timeout = void 0
67
+ timeout = null
68
68
 
69
69
  const el = createGlobalNode('q-loading')
70
70
 
@@ -174,9 +174,9 @@ const Plugin = defineReactivePlugin({
174
174
  }
175
175
  }
176
176
 
177
- if (timeout !== void 0) {
177
+ if (timeout !== null) {
178
178
  clearTimeout(timeout)
179
- timeout = void 0
179
+ timeout = null
180
180
  }
181
181
 
182
182
  Plugin.isActive = false
@@ -1,7 +1,7 @@
1
1
  import { isRuntimeSsrPreHydration } from './Platform.js'
2
2
  import extend from '../utils/extend.js'
3
3
 
4
- let updateId, currentClientMeta
4
+ let updateId = null, currentClientMeta
5
5
  export const clientList = []
6
6
 
7
7
  function normalize (meta) {
@@ -218,6 +218,8 @@ function injectServerMeta (ssrContext) {
218
218
  }
219
219
 
220
220
  function updateClientMeta () {
221
+ updateId = null
222
+
221
223
  const data = {
222
224
  title: '',
223
225
  titleTemplate: null,
@@ -243,7 +245,7 @@ function updateClientMeta () {
243
245
  }
244
246
 
245
247
  export function planClientUpdate () {
246
- clearTimeout(updateId)
248
+ updateId !== null && clearTimeout(updateId)
247
249
  updateId = setTimeout(updateClientMeta, 50)
248
250
  }
249
251
 
@@ -225,7 +225,10 @@ function addNotification (config, $q, originalApi) {
225
225
 
226
226
  if (originalApi !== void 0) {
227
227
  // reset timeout if any
228
- clearTimeout(originalApi.notif.meta.timer)
228
+ if (originalApi.notif.meta.timer) {
229
+ clearTimeout(originalApi.notif.meta.timer)
230
+ originalApi.notif.meta.timer = void 0
231
+ }
229
232
 
230
233
  // retain uid
231
234
  notif.meta.uid = originalApi.notif.meta.uid
@@ -261,7 +264,10 @@ function addNotification (config, $q, originalApi) {
261
264
  // ok, so it's NOT a new one
262
265
  else {
263
266
  // reset timeout if any
264
- clearTimeout(original.meta.timer)
267
+ if (original.meta.timer) {
268
+ clearTimeout(original.meta.timer)
269
+ original.meta.timer = void 0
270
+ }
265
271
 
266
272
  if (notif.badgePosition !== void 0) {
267
273
  if (badgePositions.includes(notif.badgePosition) === false) {
@@ -291,6 +297,7 @@ function addNotification (config, $q, originalApi) {
291
297
 
292
298
  if (notif.timeout > 0) {
293
299
  notif.meta.timer = setTimeout(() => {
300
+ notif.meta.timer = void 0
294
301
  dismiss()
295
302
  }, notif.timeout + /* show duration */ 1000)
296
303
  }
@@ -339,7 +346,10 @@ function addNotification (config, $q, originalApi) {
339
346
  }
340
347
 
341
348
  function removeNotification (notif) {
342
- clearTimeout(notif.meta.timer)
349
+ if (notif.meta.timer) {
350
+ clearTimeout(notif.meta.timer)
351
+ notif.meta.timer = void 0
352
+ }
343
353
 
344
354
  const index = notificationsList[ notif.position ].value.indexOf(notif)
345
355
  if (index !== -1) {
@@ -1,25 +1,28 @@
1
1
  export default function (fn, wait = 250, immediate) {
2
- let timeout
2
+ let timer = null
3
3
 
4
4
  function debounced (/* ...args */) {
5
5
  const args = arguments
6
6
 
7
7
  const later = () => {
8
- timeout = void 0
8
+ timer = null
9
9
  if (immediate !== true) {
10
10
  fn.apply(this, args)
11
11
  }
12
12
  }
13
13
 
14
- clearTimeout(timeout)
15
- if (immediate === true && timeout === void 0) {
14
+ if (timer !== null) {
15
+ clearTimeout(timer)
16
+ }
17
+ else if (immediate === true) {
16
18
  fn.apply(this, args)
17
19
  }
18
- timeout = setTimeout(later, wait)
20
+
21
+ timer = setTimeout(later, wait)
19
22
  }
20
23
 
21
24
  debounced.cancel = () => {
22
- clearTimeout(timeout)
25
+ timer !== null && clearTimeout(timer)
23
26
  }
24
27
 
25
28
  return debounced
@@ -950,12 +950,11 @@ export default function morph (_options) {
950
950
  : (
951
951
  options.waitFor === 'transitionend'
952
952
  ? new Promise(resolve => {
953
- const timer = setTimeout(() => {
954
- endFn()
955
- }, 400)
956
-
957
- const endFn = ev => {
958
- clearTimeout(timer)
953
+ const endFn = () => {
954
+ if (timer !== null) {
955
+ clearTimeout(timer)
956
+ timer = null
957
+ }
959
958
 
960
959
  if (elTo) {
961
960
  elTo.removeEventListener('transitionend', endFn)
@@ -965,6 +964,8 @@ export default function morph (_options) {
965
964
  resolve()
966
965
  }
967
966
 
967
+ let timer = setTimeout(endFn, 400)
968
+
968
969
  elTo.addEventListener('transitionend', endFn)
969
970
  elTo.addEventListener('transitioncancel', endFn)
970
971
  })
@@ -10,7 +10,7 @@ let
10
10
  vpPendingUpdate = false,
11
11
  bodyLeft,
12
12
  bodyTop,
13
- closeTimer
13
+ closeTimer = null
14
14
 
15
15
  function onWheel (e) {
16
16
  if (shouldPreventScroll(e)) {
@@ -157,9 +157,9 @@ export default function (state) {
157
157
  if (state === true) {
158
158
  registered++
159
159
 
160
- if (closeTimer !== void 0) {
160
+ if (closeTimer !== null) {
161
161
  clearTimeout(closeTimer)
162
- closeTimer = void 0
162
+ closeTimer = null
163
163
  return
164
164
  }
165
165
 
@@ -181,11 +181,10 @@ export default function (state) {
181
181
  action = 'remove'
182
182
 
183
183
  if (client.is.ios === true && client.is.nativeMobile === true) {
184
- clearTimeout(closeTimer)
185
-
184
+ closeTimer !== null && clearTimeout(closeTimer)
186
185
  closeTimer = setTimeout(() => {
187
186
  apply(action)
188
- closeTimer = void 0
187
+ closeTimer = null
189
188
  }, 100)
190
189
  return
191
190
  }
@@ -1,14 +1,17 @@
1
1
  import { listenOpts } from '../event.js'
2
2
  import { portalProxyList } from '../private/portal.js'
3
3
 
4
- let timer
4
+ let timer = null
5
5
 
6
6
  const
7
7
  { notPassiveCapture } = listenOpts,
8
8
  registeredList = []
9
9
 
10
10
  function globalHandler (evt) {
11
- clearTimeout(timer)
11
+ if (timer !== null) {
12
+ clearTimeout(timer)
13
+ timer = null
14
+ }
12
15
 
13
16
  const target = evt.target
14
17
 
@@ -81,7 +84,11 @@ export function removeClickOutside (clickOutsideProps) {
81
84
  registeredList.splice(index, 1)
82
85
 
83
86
  if (registeredList.length === 0) {
84
- clearTimeout(timer)
87
+ if (timer !== null) {
88
+ clearTimeout(timer)
89
+ timer = null
90
+ }
91
+
85
92
  document.removeEventListener('mousedown', globalHandler, notPassiveCapture)
86
93
  document.removeEventListener('touchstart', globalHandler, notPassiveCapture)
87
94
  }
@@ -54,7 +54,7 @@ export default function (DefaultComponent, supportsCustomComponent, parentApp) {
54
54
 
55
55
  let vm, emittedOK = false
56
56
  const dialogRef = ref(null)
57
- const el = createGlobalNode()
57
+ const el = createGlobalNode(false, 'dialog')
58
58
 
59
59
  const applyState = cmd => {
60
60
  if (dialogRef.value !== null && dialogRef.value[ cmd ] !== void 0) {
@@ -1,16 +1,19 @@
1
1
  import { globalConfig } from './global-config.js'
2
2
 
3
- const globalNodes = []
3
+ const nodesList = []
4
+ const portalTypeList = []
5
+
6
+ let portalIndex = 1
4
7
  let target = __QUASAR_SSR_SERVER__
5
8
  ? void 0
6
9
  : document.body
7
10
 
8
- export function createGlobalNode (id) {
11
+ export function createGlobalNode (id, portalType) {
9
12
  const el = document.createElement('div')
10
13
 
11
- if (id !== void 0) {
12
- el.id = id
13
- }
14
+ el.id = portalType !== void 0
15
+ ? `q-portal--${ portalType }--${ portalIndex++ }`
16
+ : id
14
17
 
15
18
  if (globalConfig.globalNodes !== void 0) {
16
19
  const cls = globalConfig.globalNodes.class
@@ -20,24 +23,52 @@ export function createGlobalNode (id) {
20
23
  }
21
24
 
22
25
  target.appendChild(el)
23
- globalNodes.push(el)
26
+ nodesList.push(el)
27
+ portalTypeList.push(portalType)
24
28
 
25
29
  return el
26
30
  }
27
31
 
28
32
  export function removeGlobalNode (el) {
29
- globalNodes.splice(globalNodes.indexOf(el), 1)
33
+ const nodeIndex = nodesList.indexOf(el)
34
+
35
+ nodesList.splice(nodeIndex, 1)
36
+ portalTypeList.splice(nodeIndex, 1)
37
+
30
38
  el.remove()
31
39
  }
32
40
 
33
- export function changeGlobalNodesTarget (el) {
34
- if (el !== target) {
35
- target = el
41
+ export function changeGlobalNodesTarget (newTarget) {
42
+ if (newTarget === target) {
43
+ return
44
+ }
45
+
46
+ target = newTarget
36
47
 
37
- globalNodes.forEach(el => {
38
- if (el.contains(target) === false) {
39
- target.appendChild(el)
48
+ if (
49
+ target === document.body
50
+ // or we have less than 2 dialogs:
51
+ || portalTypeList.reduce((acc, type) => (type === 'dialog' ? acc + 1 : acc), 0) < 2
52
+ ) {
53
+ nodesList.forEach(node => {
54
+ if (node.contains(target) === false) {
55
+ target.appendChild(node)
40
56
  }
41
57
  })
58
+
59
+ return
60
+ }
61
+
62
+ const lastDialogIndex = portalTypeList.lastIndexOf('dialog')
63
+
64
+ for (let i = 0; i < nodesList.length; i++) {
65
+ const el = nodesList[ i ]
66
+
67
+ if (
68
+ (i === lastDialogIndex || portalTypeList[ i ] !== 'dialog')
69
+ && el.contains(target) === false
70
+ ) {
71
+ target.appendChild(el)
72
+ }
42
73
  }
43
74
  }