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
@@ -2,7 +2,7 @@
2
2
  "$schema": "",
3
3
  "framework": "vue",
4
4
  "name": "quasar",
5
- "version": "2.11.3",
5
+ "version": "2.11.4",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time",
5
5
  "main": "dist/quasar.cjs.prod.js",
6
6
  "module": "dist/quasar.esm.prod.js",
@@ -119,7 +119,7 @@ export default createComponent({
119
119
  const onScreen = ref(false)
120
120
  const animate = ref(true)
121
121
 
122
- let sessions = 0, timer, speed
122
+ let sessions = 0, timer = null, speed
123
123
 
124
124
  const classes = computed(() =>
125
125
  `q-loading-bar q-loading-bar--${ props.position }`
@@ -171,19 +171,21 @@ export default createComponent({
171
171
  if (oldSpeed === 0 && newSpeed > 0) {
172
172
  planNextStep()
173
173
  }
174
- else if (oldSpeed > 0 && newSpeed <= 0) {
174
+ else if (timer !== null && oldSpeed > 0 && newSpeed <= 0) {
175
175
  clearTimeout(timer)
176
+ timer = null
176
177
  }
177
178
 
178
179
  return sessions
179
180
  }
180
181
 
181
- clearTimeout(timer)
182
+ timer !== null && clearTimeout(timer)
182
183
  emit('start')
183
184
 
184
185
  progress.value = 0
185
186
 
186
187
  timer = setTimeout(() => {
188
+ timer = null
187
189
  animate.value = true
188
190
  newSpeed > 0 && planNextStep()
189
191
  }, onScreen.value === true ? 500 : 1)
@@ -210,13 +212,18 @@ export default createComponent({
210
212
  return sessions
211
213
  }
212
214
 
213
- clearTimeout(timer)
215
+ if (timer !== null) {
216
+ clearTimeout(timer)
217
+ timer = null
218
+ }
219
+
214
220
  emit('stop')
215
221
 
216
222
  const end = () => {
217
223
  animate.value = true
218
224
  progress.value = 100
219
225
  timer = setTimeout(() => {
226
+ timer = null
220
227
  onScreen.value = false
221
228
  }, 1000)
222
229
  }
@@ -234,6 +241,7 @@ export default createComponent({
234
241
  function planNextStep () {
235
242
  if (progress.value < 100) {
236
243
  timer = setTimeout(() => {
244
+ timer = null
237
245
  increment()
238
246
  planNextStep()
239
247
  }, speed)
@@ -254,7 +262,7 @@ export default createComponent({
254
262
  })
255
263
 
256
264
  onBeforeUnmount(() => {
257
- clearTimeout(timer)
265
+ timer !== null && clearTimeout(timer)
258
266
  hijacked === true && restoreAjax(start)
259
267
  })
260
268
 
@@ -46,7 +46,7 @@ export default createComponent({
46
46
  const rootRef = ref(null)
47
47
  const blurTargetRef = ref(null)
48
48
 
49
- let localTouchTargetEl = null, avoidMouseRipple, mouseTimer
49
+ let localTouchTargetEl = null, avoidMouseRipple, mouseTimer = null
50
50
 
51
51
  const hasLabel = computed(() =>
52
52
  props.label !== void 0 && props.label !== null && props.label !== ''
@@ -192,8 +192,9 @@ export default createComponent({
192
192
  // avoid duplicated mousedown event
193
193
  // triggering another early ripple
194
194
  avoidMouseRipple = true
195
- clearTimeout(mouseTimer)
195
+ mouseTimer !== null && clearTimeout(mouseTimer)
196
196
  mouseTimer = setTimeout(() => {
197
+ mouseTimer = null
197
198
  avoidMouseRipple = false
198
199
  }, 200)
199
200
  }
@@ -68,7 +68,7 @@ export default createComponent({
68
68
 
69
69
  const isDark = useDark(props, $q)
70
70
 
71
- let timer, panelsLen
71
+ let timer = null, panelsLen
72
72
 
73
73
  const {
74
74
  updatePanelsList, getPanelContent,
@@ -122,7 +122,6 @@ export default createComponent({
122
122
 
123
123
  watch(() => props.modelValue, () => {
124
124
  if (props.autoplay) {
125
- clearInterval(timer)
126
125
  startTimer()
127
126
  }
128
127
  })
@@ -131,20 +130,28 @@ export default createComponent({
131
130
  if (val) {
132
131
  startTimer()
133
132
  }
134
- else {
135
- clearInterval(timer)
133
+ else if (timer !== null) {
134
+ clearTimeout(timer)
135
+ timer = null
136
136
  }
137
137
  })
138
138
 
139
139
  function startTimer () {
140
140
  const duration = isNumber(props.autoplay) === true
141
- ? props.autoplay
141
+ ? Math.abs(props.autoplay)
142
142
  : 5000
143
143
 
144
- timer = setTimeout(
145
- duration >= 0 ? nextPanel : previousPanel,
146
- Math.abs(duration)
147
- )
144
+ timer !== null && clearTimeout(timer)
145
+ timer = setTimeout(() => {
146
+ timer = null
147
+
148
+ if (duration >= 0) {
149
+ nextPanel()
150
+ }
151
+ else {
152
+ previousPanel()
153
+ }
154
+ }, duration)
148
155
  }
149
156
 
150
157
  onMounted(() => {
@@ -152,7 +159,7 @@ export default createComponent({
152
159
  })
153
160
 
154
161
  onBeforeUnmount(() => {
155
- clearInterval(timer)
162
+ timer !== null && clearTimeout(timer)
156
163
  })
157
164
 
158
165
  function getNavigationContainer (type, mapping) {
@@ -84,7 +84,7 @@ export default createComponent({
84
84
  const showing = ref(false)
85
85
  const animating = ref(false)
86
86
 
87
- let shakeTimeout, refocusTarget = null, isMaximized, avoidAutoClose
87
+ let shakeTimeout = null, refocusTarget = null, isMaximized, avoidAutoClose
88
88
 
89
89
  const hideOnRouteChange = computed(() =>
90
90
  props.persistent !== true
@@ -103,7 +103,7 @@ export default createComponent({
103
103
  )
104
104
 
105
105
  const { showPortal, hidePortal, portalIsAccessible, renderPortal } = usePortal(
106
- vm, innerRef, renderPortalContent, /* pls do check if on a global dialog */ true
106
+ vm, innerRef, renderPortalContent, 'dialog'
107
107
  )
108
108
 
109
109
  const { hide } = useModelToggle({
@@ -266,8 +266,9 @@ export default createComponent({
266
266
  if (node !== null) {
267
267
  node.classList.remove('q-animate--scale')
268
268
  node.classList.add('q-animate--scale')
269
- clearTimeout(shakeTimeout)
269
+ shakeTimeout !== null && clearTimeout(shakeTimeout)
270
270
  shakeTimeout = setTimeout(() => {
271
+ shakeTimeout = null
271
272
  if (innerRef.value !== null) {
272
273
  node.classList.remove('q-animate--scale')
273
274
  // some platforms (like desktop Chrome)
@@ -291,7 +292,10 @@ export default createComponent({
291
292
  }
292
293
 
293
294
  function cleanup (hiding) {
294
- clearTimeout(shakeTimeout)
295
+ if (shakeTimeout !== null) {
296
+ clearTimeout(shakeTimeout)
297
+ shakeTimeout = null
298
+ }
295
299
 
296
300
  if (hiding === true || showing.value === true) {
297
301
  updateMaximized(false)
@@ -83,7 +83,7 @@ export default createComponent({
83
83
  return emptyRenderFn
84
84
  }
85
85
 
86
- let lastDesktopState, timerMini, layoutTotalWidthWatcher
86
+ let lastDesktopState, timerMini = null, layoutTotalWidthWatcher
87
87
 
88
88
  const belowBreakpoint = ref(
89
89
  props.behavior === 'mobile'
@@ -458,7 +458,7 @@ export default createComponent({
458
458
  }
459
459
 
460
460
  function animateMini () {
461
- clearTimeout(timerMini)
461
+ timerMini !== null && clearTimeout(timerMini)
462
462
 
463
463
  if (vm.proxy && vm.proxy.$el) {
464
464
  // need to speed it up and apply it immediately,
@@ -468,6 +468,7 @@ export default createComponent({
468
468
 
469
469
  flagMiniAnimate.value = true
470
470
  timerMini = setTimeout(() => {
471
+ timerMini = null
471
472
  flagMiniAnimate.value = false
472
473
  if (vm && vm.proxy && vm.proxy.$el) {
473
474
  vm.proxy.$el.classList.remove('q-drawer--mini-animate')
@@ -620,7 +621,11 @@ export default createComponent({
620
621
 
621
622
  onBeforeUnmount(() => {
622
623
  layoutTotalWidthWatcher !== void 0 && layoutTotalWidthWatcher()
623
- clearTimeout(timerMini)
624
+
625
+ if (timerMini !== null) {
626
+ clearTimeout(timerMini)
627
+ timerMini = null
628
+ }
624
629
 
625
630
  showing.value === true && cleanup()
626
631
 
@@ -69,7 +69,7 @@ export default createComponent({
69
69
  const naturalRatio = ref(props.initialRatio)
70
70
  const ratioStyle = useRatio(props, naturalRatio)
71
71
 
72
- let loadTimer
72
+ let loadTimer = null, isDestroyed = false
73
73
 
74
74
  const images = [
75
75
  ref(null),
@@ -120,7 +120,11 @@ export default createComponent({
120
120
  }
121
121
 
122
122
  function addImage (imgProps) {
123
- clearTimeout(loadTimer)
123
+ if (loadTimer !== null) {
124
+ clearTimeout(loadTimer)
125
+ loadTimer = null
126
+ }
127
+
124
128
  hasError.value = false
125
129
 
126
130
  if (imgProps === null) {
@@ -135,10 +139,12 @@ export default createComponent({
135
139
  }
136
140
 
137
141
  function onLoad ({ target }) {
138
- // if component has been already destroyed
139
- if (loadTimer === null) { return }
142
+ if (isDestroyed === true) { return }
140
143
 
141
- clearTimeout(loadTimer)
144
+ if (loadTimer !== null) {
145
+ clearTimeout(loadTimer)
146
+ loadTimer = null
147
+ }
142
148
 
143
149
  naturalRatio.value = target.naturalHeight === 0
144
150
  ? 0.5
@@ -149,21 +155,21 @@ export default createComponent({
149
155
 
150
156
  function waitForCompleteness (target, count) {
151
157
  // protect against running forever
152
- if (loadTimer === null || count === 1000) { return }
158
+ if (isDestroyed === true || count === 1000) { return }
153
159
 
154
160
  if (target.complete === true) {
155
161
  onReady(target)
156
162
  }
157
163
  else {
158
164
  loadTimer = setTimeout(() => {
165
+ loadTimer = null
159
166
  waitForCompleteness(target, count + 1)
160
167
  }, 50)
161
168
  }
162
169
  }
163
170
 
164
171
  function onReady (img) {
165
- // if component has been already destroyed
166
- if (loadTimer === null) { return }
172
+ if (isDestroyed === true) { return }
167
173
 
168
174
  position.value = position.value ^ 1
169
175
  images[ position.value ].value = null
@@ -173,7 +179,11 @@ export default createComponent({
173
179
  }
174
180
 
175
181
  function onError (err) {
176
- clearTimeout(loadTimer)
182
+ if (loadTimer !== null) {
183
+ clearTimeout(loadTimer)
184
+ loadTimer = null
185
+ }
186
+
177
187
  isLoading.value = false
178
188
  hasError.value = true
179
189
  images[ position.value ].value = null
@@ -253,8 +263,12 @@ export default createComponent({
253
263
  }
254
264
 
255
265
  onBeforeUnmount(() => {
256
- clearTimeout(loadTimer)
257
- loadTimer = null
266
+ isDestroyed = true
267
+
268
+ if (loadTimer !== null) {
269
+ clearTimeout(loadTimer)
270
+ loadTimer = null
271
+ }
258
272
  })
259
273
  }
260
274
 
@@ -49,7 +49,7 @@ export default createComponent({
49
49
  const { $q } = proxy
50
50
 
51
51
  const temp = {}
52
- let emitCachedValue = NaN, typedNumber, stopValueWatcher, emitTimer, emitValueFn
52
+ let emitCachedValue = NaN, typedNumber, stopValueWatcher, emitTimer = null, emitValueFn
53
53
 
54
54
  const inputRef = ref(null)
55
55
  const nameProp = useFormInputNameAttr(props)
@@ -261,6 +261,8 @@ export default createComponent({
261
261
 
262
262
  function emitValue (val, stopWatcher) {
263
263
  emitValueFn = () => {
264
+ emitTimer = null
265
+
264
266
  if (
265
267
  props.type !== 'number'
266
268
  && temp.hasOwnProperty('value') === true
@@ -288,7 +290,7 @@ export default createComponent({
288
290
  }
289
291
 
290
292
  if (props.debounce !== void 0) {
291
- clearTimeout(emitTimer)
293
+ emitTimer !== null && clearTimeout(emitTimer)
292
294
  temp.value = val
293
295
  emitTimer = setTimeout(emitValueFn, props.debounce)
294
296
  }
@@ -322,7 +324,11 @@ export default createComponent({
322
324
  function onChange (e) {
323
325
  onComposition(e)
324
326
 
325
- clearTimeout(emitTimer)
327
+ if (emitTimer !== null) {
328
+ clearTimeout(emitTimer)
329
+ emitTimer = null
330
+ }
331
+
326
332
  emitValueFn !== void 0 && emitValueFn()
327
333
 
328
334
  emit('change', e.target.value)
@@ -331,7 +337,11 @@ export default createComponent({
331
337
  function onFinishEditing (e) {
332
338
  e !== void 0 && stop(e)
333
339
 
334
- clearTimeout(emitTimer)
340
+ if (emitTimer !== null) {
341
+ clearTimeout(emitTimer)
342
+ emitTimer = null
343
+ }
344
+
335
345
  emitValueFn !== void 0 && emitValueFn()
336
346
 
337
347
  typedNumber = false
@@ -122,7 +122,7 @@ export default createComponent({
122
122
  }
123
123
  }
124
124
 
125
- let timer
125
+ let animateTimer = null
126
126
 
127
127
  const $layout = {
128
128
  instances: {},
@@ -153,16 +153,16 @@ export default createComponent({
153
153
  scroll,
154
154
 
155
155
  animate () {
156
- if (timer !== void 0) {
157
- clearTimeout(timer)
156
+ if (animateTimer !== null) {
157
+ clearTimeout(animateTimer)
158
158
  }
159
159
  else {
160
160
  document.body.classList.add('q-body--layout-animate')
161
161
  }
162
162
 
163
- timer = setTimeout(() => {
163
+ animateTimer = setTimeout(() => {
164
+ animateTimer = null
164
165
  document.body.classList.remove('q-body--layout-animate')
165
- timer = void 0
166
166
  }, 155)
167
167
  },
168
168
 
@@ -111,7 +111,7 @@ export default createComponent({
111
111
  processOnMount: true
112
112
  })
113
113
 
114
- const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent)
114
+ const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent, 'menu')
115
115
 
116
116
  const clickOutsideProps = {
117
117
  anchorEl,
@@ -137,6 +137,8 @@ export default createComponent({
137
137
  })
138
138
  }
139
139
 
140
+ let $el, localScrollTarget, timer = null
141
+
140
142
  function animateTo ({ pos, ratio }, done) {
141
143
  animating.value = true
142
144
  pullPosition.value = pos
@@ -145,15 +147,14 @@ export default createComponent({
145
147
  pullRatio.value = ratio
146
148
  }
147
149
 
148
- clearTimeout(timer)
150
+ timer !== null && clearTimeout(timer)
149
151
  timer = setTimeout(() => {
152
+ timer = null
150
153
  animating.value = false
151
154
  done && done()
152
155
  }, 300)
153
156
  }
154
157
 
155
- let $el, localScrollTarget, timer
156
-
157
158
  function updateScrollTarget () {
158
159
  localScrollTarget = getScrollTarget($el, props.scrollTarget)
159
160
  }
@@ -166,7 +167,7 @@ export default createComponent({
166
167
  })
167
168
 
168
169
  onBeforeUnmount(() => {
169
- clearTimeout(timer)
170
+ timer !== null && clearTimeout(timer)
170
171
  })
171
172
 
172
173
  // expose public methods
@@ -40,8 +40,10 @@ export default createComponent({
40
40
  }
41
41
 
42
42
  function emitEvent () {
43
- clearTimeout(timer)
44
- timer = null
43
+ if (timer !== null) {
44
+ clearTimeout(timer)
45
+ timer = null
46
+ }
45
47
 
46
48
  if (targetEl) {
47
49
  const { offsetWidth: width, offsetHeight: height } = targetEl
@@ -75,7 +77,7 @@ export default createComponent({
75
77
  onMounted(() => { init() })
76
78
 
77
79
  onBeforeUnmount(() => {
78
- clearTimeout(timer)
80
+ timer !== null && clearTimeout(timer)
79
81
 
80
82
  if (observer !== void 0) {
81
83
  if (observer.disconnect !== void 0) {
@@ -95,7 +97,10 @@ export default createComponent({
95
97
  let curDocView
96
98
 
97
99
  function cleanup () {
98
- clearTimeout(timer)
100
+ if (timer !== null) {
101
+ clearTimeout(timer)
102
+ timer = null
103
+ }
99
104
 
100
105
  if (curDocView !== void 0) {
101
106
  // iOS is fuzzy, need to check it first
@@ -88,7 +88,7 @@ export default createComponent({
88
88
 
89
89
  const isDark = useDark(props, proxy.$q)
90
90
 
91
- let timer, panRefPos
91
+ let timer = null, panRefPos
92
92
 
93
93
  const targetRef = ref(null)
94
94
 
@@ -337,14 +337,14 @@ export default createComponent({
337
337
  }
338
338
 
339
339
  function startTimer () {
340
- if (tempShowing.value === true) {
341
- clearTimeout(timer)
342
- }
343
- else {
344
- tempShowing.value = true
345
- }
340
+ tempShowing.value = true
341
+
342
+ timer !== null && clearTimeout(timer)
343
+ timer = setTimeout(() => {
344
+ timer = null
345
+ tempShowing.value = false
346
+ }, props.delay)
346
347
 
347
- timer = setTimeout(() => { tempShowing.value = false }, props.delay)
348
348
  props.onScroll !== void 0 && emitScroll()
349
349
  }
350
350
 
@@ -143,8 +143,8 @@ export default createComponent({
143
143
  const dialogFieldFocused = ref(false)
144
144
  const innerLoadingIndicator = ref(false)
145
145
 
146
- let inputTimer, innerValueCache,
147
- hasDialog, userInputValue, filterId, defaultInputValue,
146
+ let inputTimer = null, innerValueCache,
147
+ hasDialog, userInputValue, filterId = null, defaultInputValue,
148
148
  transitionShowComputed, searchBuffer, searchBufferExp
149
149
 
150
150
  const inputRef = ref(null)
@@ -650,7 +650,12 @@ export default createComponent({
650
650
  }
651
651
 
652
652
  e.target.value = ''
653
- clearTimeout(inputTimer)
653
+
654
+ if (inputTimer !== null) {
655
+ clearTimeout(inputTimer)
656
+ inputTimer = null
657
+ }
658
+
654
659
  resetInputValue()
655
660
 
656
661
  if (typeof value === 'string' && value.length > 0) {
@@ -1015,7 +1020,10 @@ export default createComponent({
1015
1020
  }
1016
1021
 
1017
1022
  function onInput (e) {
1018
- clearTimeout(inputTimer)
1023
+ if (inputTimer !== null) {
1024
+ clearTimeout(inputTimer)
1025
+ inputTimer = null
1026
+ }
1019
1027
 
1020
1028
  if (e && e.target && e.target.qComposing === true) {
1021
1029
  return
@@ -1036,6 +1044,7 @@ export default createComponent({
1036
1044
 
1037
1045
  if (props.onFilter !== void 0) {
1038
1046
  inputTimer = setTimeout(() => {
1047
+ inputTimer = null
1039
1048
  filter(inputValue.value)
1040
1049
  }, props.inputDebounce)
1041
1050
  }
@@ -1089,7 +1098,7 @@ export default createComponent({
1089
1098
  menu.value === true && (menu.value = false)
1090
1099
  }, 10)
1091
1100
 
1092
- clearTimeout(filterId)
1101
+ filterId !== null && clearTimeout(filterId)
1093
1102
  filterId = localFilterId
1094
1103
 
1095
1104
  emit(
@@ -1281,8 +1290,10 @@ export default createComponent({
1281
1290
  }
1282
1291
 
1283
1292
  if (state.focused.value === false) {
1284
- clearTimeout(filterId)
1285
- filterId = void 0
1293
+ if (filterId !== null) {
1294
+ clearTimeout(filterId)
1295
+ filterId = null
1296
+ }
1286
1297
 
1287
1298
  if (state.innerLoading.value === true) {
1288
1299
  emit('filterAbort')
@@ -1403,7 +1414,7 @@ export default createComponent({
1403
1414
  updatePreState()
1404
1415
 
1405
1416
  onBeforeUnmount(() => {
1406
- clearTimeout(inputTimer)
1417
+ inputTimer !== null && clearTimeout(inputTimer)
1407
1418
  })
1408
1419
 
1409
1420
  // expose public methods
@@ -40,7 +40,7 @@ export default createComponent({
40
40
 
41
41
  const contentRef = ref(null)
42
42
 
43
- let timer, pan = {}, dirRefs = {}, dirContentRefs = {}
43
+ let timer = null, pan = {}, dirRefs = {}, dirContentRefs = {}
44
44
 
45
45
  const langDir = computed(() => (
46
46
  $q.lang.rtl === true
@@ -91,7 +91,9 @@ export default createComponent({
91
91
  if (pan.scale === 1) {
92
92
  node.style.transform = `translate${ pan.axis }(${ pan.dir * 100 }%)`
93
93
 
94
+ timer !== null && clearTimeout(timer)
94
95
  timer = setTimeout(() => {
96
+ timer = null
95
97
  emit(pan.showing, { reset })
96
98
  emit('action', { side: pan.showing, reset })
97
99
  }, 230)
@@ -162,7 +164,7 @@ export default createComponent({
162
164
  })
163
165
 
164
166
  onBeforeUnmount(() => {
165
- clearTimeout(timer)
167
+ timer !== null && clearTimeout(timer)
166
168
  })
167
169
 
168
170
  // expose public methods
@@ -17,15 +17,23 @@ export default createComponent({
17
17
 
18
18
  setup (props, { slots, emit }) {
19
19
  let animating = false, doneFn, element
20
- let timer, timerFallback, animListener, lastEvent
20
+ let timer = null, timerFallback = null, animListener, lastEvent
21
21
 
22
22
  function cleanup () {
23
23
  doneFn && doneFn()
24
24
  doneFn = null
25
25
  animating = false
26
26
 
27
- clearTimeout(timer)
28
- clearTimeout(timerFallback)
27
+ if (timer !== null) {
28
+ clearTimeout(timer)
29
+ timer = null
30
+ }
31
+
32
+ if (timerFallback !== null) {
33
+ clearTimeout(timerFallback)
34
+ timerFallback = null
35
+ }
36
+
29
37
  element !== void 0 && element.removeEventListener('transitionend', animListener)
30
38
  animListener = null
31
39
  }
@@ -64,8 +72,11 @@ export default createComponent({
64
72
  begin(el, pos, done)
65
73
 
66
74
  timer = setTimeout(() => {
75
+ timer = null
67
76
  el.style.height = `${ el.scrollHeight }px`
68
77
  animListener = evt => {
78
+ timerFallback = null
79
+
69
80
  if (Object(evt) !== evt || evt.target === el) {
70
81
  end(el, 'show')
71
82
  }
@@ -90,8 +101,11 @@ export default createComponent({
90
101
  begin(el, pos, done)
91
102
 
92
103
  timer = setTimeout(() => {
104
+ timer = null
93
105
  el.style.height = 0
94
106
  animListener = evt => {
107
+ timerFallback = null
108
+
95
109
  if (Object(evt) !== evt || evt.target === el) {
96
110
  end(el, 'hide')
97
111
  }