quasar 2.11.3 → 2.11.5
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.
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +1 -1
- package/dist/lang/ar.umd.prod.js +1 -1
- package/dist/lang/az-Latn.umd.prod.js +1 -1
- package/dist/lang/bg.umd.prod.js +1 -1
- package/dist/lang/bn.umd.prod.js +1 -1
- package/dist/lang/ca.umd.prod.js +1 -1
- package/dist/lang/cs.umd.prod.js +1 -1
- package/dist/lang/da.umd.prod.js +1 -1
- package/dist/lang/de.umd.prod.js +1 -1
- package/dist/lang/el.umd.prod.js +1 -1
- package/dist/lang/en-GB.umd.prod.js +1 -1
- package/dist/lang/en-US.umd.prod.js +1 -1
- package/dist/lang/eo.umd.prod.js +1 -1
- package/dist/lang/es.umd.prod.js +1 -1
- package/dist/lang/et.umd.prod.js +1 -1
- package/dist/lang/eu.umd.prod.js +1 -1
- package/dist/lang/fa-IR.umd.prod.js +1 -1
- package/dist/lang/fa.umd.prod.js +1 -1
- package/dist/lang/fi.umd.prod.js +1 -1
- package/dist/lang/fr.umd.prod.js +1 -1
- package/dist/lang/gn.umd.prod.js +1 -1
- package/dist/lang/he.umd.prod.js +1 -1
- package/dist/lang/hr.umd.prod.js +1 -1
- package/dist/lang/hu.umd.prod.js +1 -1
- package/dist/lang/id.umd.prod.js +1 -1
- package/dist/lang/is.umd.prod.js +1 -1
- package/dist/lang/it.umd.prod.js +1 -1
- package/dist/lang/ja.umd.prod.js +1 -1
- package/dist/lang/kk.umd.prod.js +1 -1
- package/dist/lang/km.umd.prod.js +1 -1
- package/dist/lang/ko-KR.umd.prod.js +1 -1
- package/dist/lang/kur-CKB.umd.prod.js +1 -1
- package/dist/lang/lt.umd.prod.js +1 -1
- package/dist/lang/lu.umd.prod.js +1 -1
- package/dist/lang/lv.umd.prod.js +1 -1
- package/dist/lang/ml.umd.prod.js +1 -1
- package/dist/lang/mm.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +1 -1
- package/dist/lang/nb-NO.umd.prod.js +1 -1
- package/dist/lang/nl.umd.prod.js +1 -1
- package/dist/lang/pl.umd.prod.js +1 -1
- package/dist/lang/pt-BR.umd.prod.js +1 -1
- package/dist/lang/pt.umd.prod.js +1 -1
- package/dist/lang/ro.umd.prod.js +1 -1
- package/dist/lang/ru.umd.prod.js +1 -1
- package/dist/lang/sk.umd.prod.js +1 -1
- package/dist/lang/sl.umd.prod.js +1 -1
- package/dist/lang/sm.umd.prod.js +1 -1
- package/dist/lang/sr-CYR.umd.prod.js +1 -1
- package/dist/lang/sr.umd.prod.js +1 -1
- package/dist/lang/sv.umd.prod.js +1 -1
- package/dist/lang/ta.umd.prod.js +1 -1
- package/dist/lang/th.umd.prod.js +1 -1
- package/dist/lang/tr.umd.prod.js +1 -1
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +1 -1
- package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
- package/dist/lang/uz-Latn.umd.prod.js +1 -1
- package/dist/lang/vi.umd.prod.js +1 -1
- package/dist/lang/zh-CN.umd.prod.js +1 -1
- package/dist/lang/zh-TW.umd.prod.js +1 -1
- package/dist/quasar.cjs.prod.js +2 -2
- package/dist/quasar.esm.js +445 -196
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.sass +1 -1
- package/dist/quasar.umd.js +445 -196
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/web-types/web-types.json +1 -1
- package/package.json +1 -1
- package/src/components/ajax-bar/QAjaxBar.js +13 -5
- package/src/components/btn/QBtn.js +3 -2
- package/src/components/carousel/QCarousel.js +17 -10
- package/src/components/dialog/QDialog.js +10 -5
- package/src/components/drawer/QDrawer.js +8 -3
- package/src/components/img/QImg.js +25 -11
- package/src/components/infinite-scroll/QInfiniteScroll.js +26 -4
- package/src/components/input/QInput.js +14 -4
- package/src/components/layout/QLayout.js +5 -5
- package/src/components/menu/QMenu.js +1 -1
- package/src/components/pull-to-refresh/QPullToRefresh.js +5 -4
- package/src/components/rating/QRating.js +3 -3
- package/src/components/resize-observer/QResizeObserver.js +9 -4
- package/src/components/scroll-area/QScrollArea.js +8 -8
- package/src/components/select/QSelect.js +19 -8
- package/src/components/slide-item/QSlideItem.js +4 -2
- package/src/components/slide-transition/QSlideTransition.js +17 -3
- package/src/components/tabs/QTabs.js +12 -5
- package/src/components/tooltip/QTooltip.js +1 -1
- package/src/components/virtual-scroll/use-virtual-scroll.js +5 -1
- package/src/composables/private/use-anchor.js +8 -3
- package/src/composables/private/use-field.js +10 -4
- package/src/composables/private/use-portal.js +3 -3
- package/src/composables/private/use-timeout.js +6 -3
- package/src/directives/TouchHold.js +9 -4
- package/src/directives/TouchRepeat.js +10 -3
- package/src/plugins/Loading.js +16 -11
- package/src/plugins/Meta.js +4 -2
- package/src/plugins/Notify.js +13 -3
- package/src/utils/copy-to-clipboard.js +8 -0
- package/src/utils/debounce.js +9 -6
- package/src/utils/is.js +11 -6
- package/src/utils/morph.js +7 -6
- package/src/utils/prevent-scroll.js +14 -7
- package/src/utils/private/click-outside.js +10 -3
- package/src/utils/private/global-dialog.js +1 -1
- package/src/utils/private/global-nodes.js +44 -13
- package/src/utils/private/position-engine.js +67 -25
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
162
|
+
timer !== null && clearTimeout(timer)
|
|
156
163
|
})
|
|
157
164
|
|
|
158
165
|
function getNavigationContainer (type, mapping) {
|
|
@@ -79,12 +79,13 @@ export default createComponent({
|
|
|
79
79
|
|
|
80
80
|
setup (props, { slots, emit, attrs }) {
|
|
81
81
|
const vm = getCurrentInstance()
|
|
82
|
+
const { proxy: { $q } } = vm
|
|
82
83
|
|
|
83
84
|
const innerRef = ref(null)
|
|
84
85
|
const showing = ref(false)
|
|
85
86
|
const animating = ref(false)
|
|
86
87
|
|
|
87
|
-
let shakeTimeout, refocusTarget = null, isMaximized, avoidAutoClose
|
|
88
|
+
let shakeTimeout = null, refocusTarget = null, isMaximized, avoidAutoClose
|
|
88
89
|
|
|
89
90
|
const hideOnRouteChange = computed(() =>
|
|
90
91
|
props.persistent !== true
|
|
@@ -103,7 +104,7 @@ export default createComponent({
|
|
|
103
104
|
)
|
|
104
105
|
|
|
105
106
|
const { showPortal, hidePortal, portalIsAccessible, renderPortal } = usePortal(
|
|
106
|
-
vm, innerRef, renderPortalContent,
|
|
107
|
+
vm, innerRef, renderPortalContent, 'dialog'
|
|
107
108
|
)
|
|
108
109
|
|
|
109
110
|
const { hide } = useModelToggle({
|
|
@@ -266,8 +267,9 @@ export default createComponent({
|
|
|
266
267
|
if (node !== null) {
|
|
267
268
|
node.classList.remove('q-animate--scale')
|
|
268
269
|
node.classList.add('q-animate--scale')
|
|
269
|
-
clearTimeout(shakeTimeout)
|
|
270
|
+
shakeTimeout !== null && clearTimeout(shakeTimeout)
|
|
270
271
|
shakeTimeout = setTimeout(() => {
|
|
272
|
+
shakeTimeout = null
|
|
271
273
|
if (innerRef.value !== null) {
|
|
272
274
|
node.classList.remove('q-animate--scale')
|
|
273
275
|
// some platforms (like desktop Chrome)
|
|
@@ -291,7 +293,10 @@ export default createComponent({
|
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
function cleanup (hiding) {
|
|
294
|
-
|
|
296
|
+
if (shakeTimeout !== null) {
|
|
297
|
+
clearTimeout(shakeTimeout)
|
|
298
|
+
shakeTimeout = null
|
|
299
|
+
}
|
|
295
300
|
|
|
296
301
|
if (hiding === true || showing.value === true) {
|
|
297
302
|
updateMaximized(false)
|
|
@@ -366,7 +371,7 @@ export default createComponent({
|
|
|
366
371
|
|
|
367
372
|
onBeforeUnmount(cleanup)
|
|
368
373
|
|
|
369
|
-
const backdropEvt =
|
|
374
|
+
const backdropEvt = $q.platform.is.ios === true || $q.platform.is.safari ? 'onClick' : 'onFocusin'
|
|
370
375
|
|
|
371
376
|
function renderPortalContent () {
|
|
372
377
|
return h('div', {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
139
|
-
if (loadTimer === null) { return }
|
|
142
|
+
if (isDestroyed === true) { return }
|
|
140
143
|
|
|
141
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
257
|
-
|
|
266
|
+
isDestroyed = true
|
|
267
|
+
|
|
268
|
+
if (loadTimer !== null) {
|
|
269
|
+
clearTimeout(loadTimer)
|
|
270
|
+
loadTimer = null
|
|
271
|
+
}
|
|
258
272
|
})
|
|
259
273
|
}
|
|
260
274
|
|
|
@@ -39,6 +39,7 @@ export default createComponent({
|
|
|
39
39
|
const isFetching = ref(false)
|
|
40
40
|
const isWorking = ref(true)
|
|
41
41
|
const rootRef = ref(null)
|
|
42
|
+
const loadingRef = ref(null)
|
|
42
43
|
|
|
43
44
|
let index = props.initialIndex || 0
|
|
44
45
|
let localScrollTarget, poll
|
|
@@ -170,12 +171,32 @@ export default createComponent({
|
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
|
|
174
|
+
function updateSvgAnimations (isRetry) {
|
|
175
|
+
if (renderLoadingSlot.value === true) {
|
|
176
|
+
if (loadingRef.value === null) {
|
|
177
|
+
isRetry !== true && nextTick(() => { updateSvgAnimations(true) })
|
|
178
|
+
return
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// we need to pause svg animations (if any) when hiding
|
|
182
|
+
// otherwise the browser will keep on recalculating the style
|
|
183
|
+
const action = `${ isFetching.value === true ? 'un' : '' }pauseAnimations`
|
|
184
|
+
Array.from(loadingRef.value.getElementsByTagName('svg')).forEach(el => {
|
|
185
|
+
el[ action ]()
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const renderLoadingSlot = computed(() => props.disable !== true && isWorking.value === true)
|
|
191
|
+
|
|
192
|
+
watch([ isFetching, renderLoadingSlot ], () => { updateSvgAnimations() })
|
|
193
|
+
|
|
173
194
|
watch(() => props.disable, val => {
|
|
174
195
|
if (val === true) { stop() }
|
|
175
196
|
else { resume() }
|
|
176
197
|
})
|
|
177
198
|
|
|
178
|
-
watch(() => props.reverse,
|
|
199
|
+
watch(() => props.reverse, () => {
|
|
179
200
|
if (isFetching.value === false && isWorking.value === true) {
|
|
180
201
|
immediatePoll()
|
|
181
202
|
}
|
|
@@ -206,8 +227,9 @@ export default createComponent({
|
|
|
206
227
|
|
|
207
228
|
onMounted(() => {
|
|
208
229
|
setDebounce(props.debounce)
|
|
209
|
-
|
|
210
230
|
updateScrollTarget()
|
|
231
|
+
|
|
232
|
+
isFetching.value === false && updateSvgAnimations()
|
|
211
233
|
})
|
|
212
234
|
|
|
213
235
|
// expose public methods
|
|
@@ -220,9 +242,9 @@ export default createComponent({
|
|
|
220
242
|
return () => {
|
|
221
243
|
const child = hUniqueSlot(slots.default, [])
|
|
222
244
|
|
|
223
|
-
if (
|
|
245
|
+
if (renderLoadingSlot.value === true) {
|
|
224
246
|
child[ props.reverse === false ? 'push' : 'unshift' ](
|
|
225
|
-
h('div', { class: classes.value }, hSlot(slots.loading))
|
|
247
|
+
h('div', { ref: loadingRef, class: classes.value }, hSlot(slots.loading))
|
|
226
248
|
)
|
|
227
249
|
}
|
|
228
250
|
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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 (
|
|
157
|
-
clearTimeout(
|
|
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
|
-
|
|
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
|
|
@@ -216,13 +216,13 @@ export default createComponent({
|
|
|
216
216
|
case 37: // LEFT ARROW
|
|
217
217
|
case 40: // DOWN ARROW
|
|
218
218
|
if (iconRefs[ `rt${ i - 1 }` ]) {
|
|
219
|
-
iconRefs[ `rt${ i - 1 }` ]
|
|
219
|
+
iconRefs[ `rt${ i - 1 }` ].focus()
|
|
220
220
|
}
|
|
221
221
|
return stopAndPrevent(e)
|
|
222
222
|
case 39: // RIGHT ARROW
|
|
223
223
|
case 38: // UP ARROW
|
|
224
224
|
if (iconRefs[ `rt${ i + 1 }` ]) {
|
|
225
|
-
iconRefs[ `rt${ i + 1 }` ]
|
|
225
|
+
iconRefs[ `rt${ i + 1 }` ].focus()
|
|
226
226
|
}
|
|
227
227
|
return stopAndPrevent(e)
|
|
228
228
|
}
|
|
@@ -245,7 +245,7 @@ export default createComponent({
|
|
|
245
245
|
child.push(
|
|
246
246
|
h('div', {
|
|
247
247
|
key: i,
|
|
248
|
-
ref:
|
|
248
|
+
ref: el => { iconRefs[ `rt${ i }` ] = el },
|
|
249
249
|
class: 'q-rating__icon-container flex flex-center',
|
|
250
250
|
...attrs,
|
|
251
251
|
onClick () { set(i) },
|
|
@@ -40,8 +40,10 @@ export default createComponent({
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function emitEvent () {
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
|