quasar 2.4.2 → 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 (148) hide show
  1. package/dist/api/BottomSheet.json +1 -1
  2. package/dist/api/Notify.json +5 -5
  3. package/dist/api/QAvatar.json +1 -1
  4. package/dist/api/QBreadcrumbsEl.json +1 -1
  5. package/dist/api/QBtn.json +2 -2
  6. package/dist/api/QBtnDropdown.json +3 -3
  7. package/dist/api/QBtnToggle.json +1 -1
  8. package/dist/api/QCarousel.json +4 -4
  9. package/dist/api/QChip.json +4 -4
  10. package/dist/api/QExpansionItem.json +3 -3
  11. package/dist/api/QFab.json +2 -2
  12. package/dist/api/QFabAction.json +1 -1
  13. package/dist/api/QLinearProgress.json +1 -1
  14. package/dist/api/QPagination.json +4 -4
  15. package/dist/api/QPullToRefresh.json +1 -1
  16. package/dist/api/QRating.json +3 -3
  17. package/dist/api/QRouteTab.json +1 -1
  18. package/dist/api/QSelect.json +1 -1
  19. package/dist/api/QStep.json +4 -4
  20. package/dist/api/QStepper.json +4 -4
  21. package/dist/api/QTab.json +1 -1
  22. package/dist/api/QTable.json +4 -4
  23. package/dist/api/QTimelineEntry.json +1 -1
  24. package/dist/api/QToggle.json +1 -1
  25. package/dist/api/QTree.json +1 -1
  26. package/dist/api/QVideo.json +11 -1
  27. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  28. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  29. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  30. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  31. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  32. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  33. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  34. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  35. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  36. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  37. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  38. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  39. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  40. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  44. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  45. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  46. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  47. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  48. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  49. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  50. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  51. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  52. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  53. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  54. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  55. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  56. package/dist/icon-set/themify.umd.prod.js +1 -1
  57. package/dist/lang/ar.umd.prod.js +1 -1
  58. package/dist/lang/az-Latn.umd.prod.js +1 -1
  59. package/dist/lang/bg.umd.prod.js +1 -1
  60. package/dist/lang/bn.umd.prod.js +1 -1
  61. package/dist/lang/ca.umd.prod.js +1 -1
  62. package/dist/lang/cs.umd.prod.js +1 -1
  63. package/dist/lang/da.umd.prod.js +1 -1
  64. package/dist/lang/de.umd.prod.js +1 -1
  65. package/dist/lang/el.umd.prod.js +1 -1
  66. package/dist/lang/en-GB.umd.prod.js +1 -1
  67. package/dist/lang/en-US.umd.prod.js +1 -1
  68. package/dist/lang/eo.umd.prod.js +1 -1
  69. package/dist/lang/es.umd.prod.js +1 -1
  70. package/dist/lang/et.umd.prod.js +1 -1
  71. package/dist/lang/fa-IR.umd.prod.js +1 -1
  72. package/dist/lang/fa.umd.prod.js +1 -1
  73. package/dist/lang/fi.umd.prod.js +1 -1
  74. package/dist/lang/fr.umd.prod.js +1 -1
  75. package/dist/lang/gn.umd.prod.js +1 -1
  76. package/dist/lang/he.umd.prod.js +1 -1
  77. package/dist/lang/hr.umd.prod.js +1 -1
  78. package/dist/lang/hu.umd.prod.js +1 -1
  79. package/dist/lang/id.umd.prod.js +1 -1
  80. package/dist/lang/is.umd.prod.js +1 -1
  81. package/dist/lang/it.umd.prod.js +1 -1
  82. package/dist/lang/ja.umd.prod.js +1 -1
  83. package/dist/lang/km.umd.prod.js +1 -1
  84. package/dist/lang/ko-KR.umd.prod.js +1 -1
  85. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  86. package/dist/lang/lt.umd.prod.js +1 -1
  87. package/dist/lang/lu.umd.prod.js +1 -1
  88. package/dist/lang/lv.umd.prod.js +1 -1
  89. package/dist/lang/ml.umd.prod.js +1 -1
  90. package/dist/lang/ms.umd.prod.js +1 -1
  91. package/dist/lang/nb-NO.umd.prod.js +1 -1
  92. package/dist/lang/nl.umd.prod.js +1 -1
  93. package/dist/lang/pl.umd.prod.js +1 -1
  94. package/dist/lang/pt-BR.umd.prod.js +1 -1
  95. package/dist/lang/pt.umd.prod.js +1 -1
  96. package/dist/lang/ro.umd.prod.js +1 -1
  97. package/dist/lang/ru.umd.prod.js +1 -1
  98. package/dist/lang/sk.umd.prod.js +1 -1
  99. package/dist/lang/sl.umd.prod.js +1 -1
  100. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  101. package/dist/lang/sr.umd.prod.js +1 -1
  102. package/dist/lang/sv.umd.prod.js +1 -1
  103. package/dist/lang/ta.umd.prod.js +1 -1
  104. package/dist/lang/th.umd.prod.js +1 -1
  105. package/dist/lang/tr.umd.prod.js +1 -1
  106. package/dist/lang/ug.umd.prod.js +1 -1
  107. package/dist/lang/uk.umd.prod.js +1 -1
  108. package/dist/lang/vi.umd.prod.js +1 -1
  109. package/dist/lang/zh-CN.umd.prod.js +1 -1
  110. package/dist/lang/zh-TW.umd.prod.js +1 -1
  111. package/dist/quasar.cjs.prod.js +2 -2
  112. package/dist/quasar.css +5 -5
  113. package/dist/quasar.esm.prod.js +2 -2
  114. package/dist/quasar.prod.css +1 -1
  115. package/dist/quasar.rtl.css +5 -5
  116. package/dist/quasar.rtl.prod.css +1 -1
  117. package/dist/quasar.sass +5 -6
  118. package/dist/quasar.umd.js +268 -206
  119. package/dist/quasar.umd.prod.js +2 -2
  120. package/dist/ssr-directives/Morph.js +1 -1
  121. package/dist/types/index.d.ts +5 -1
  122. package/dist/types/utils/date.d.ts +2 -1
  123. package/dist/vetur/quasar-attributes.json +4 -0
  124. package/dist/vetur/quasar-tags.json +2 -1
  125. package/dist/web-types/web-types.json +59 -50
  126. package/package.json +1 -1
  127. package/src/api.extends.json +1 -1
  128. package/src/components/dialog/QDialog.js +7 -5
  129. package/src/components/linear-progress/QLinearProgress.json +1 -1
  130. package/src/components/menu/QMenu.js +6 -2
  131. package/src/components/range/QRange.js +67 -89
  132. package/src/components/rating/QRating.json +3 -3
  133. package/src/components/resize-observer/QResizeObserver.js +11 -10
  134. package/src/components/scroll-area/QScrollArea.js +5 -1
  135. package/src/components/scroll-observer/QScrollObserver.js +2 -0
  136. package/src/components/slider/QSlider.js +20 -10
  137. package/src/components/slider/QSlider.sass +5 -6
  138. package/src/components/slider/use-slider.js +19 -16
  139. package/src/components/tabs/QTabs.js +27 -11
  140. package/src/components/tooltip/QTooltip.js +1 -2
  141. package/src/components/video/QVideo.js +4 -1
  142. package/src/components/video/QVideo.json +12 -1
  143. package/src/composables/private/use-field.js +13 -15
  144. package/src/composables/private/use-model-toggle.js +1 -1
  145. package/src/composables/private/use-portal.js +9 -7
  146. package/src/composables/private/use-tick.js +7 -14
  147. package/src/utils/clone.js +53 -4
  148. package/src/utils/private/focus-manager.js +8 -10
@@ -98,7 +98,7 @@ export default createComponent({
98
98
  )
99
99
 
100
100
  const isDark = useDark(props, $q)
101
- const { registerTick, removeTick, prepareTick } = useTick()
101
+ const { registerTick, removeTick } = useTick()
102
102
  const { registerTimeout, removeTimeout } = useTimeout()
103
103
  const { transition, transitionStyle } = useTransition(props, showing)
104
104
  const { localScrollTarget, changeScrollEvent, unconfigureScrollTarget } = useScrollTarget(props, configureScrollTarget)
@@ -225,7 +225,6 @@ export default createComponent({
225
225
  updatePosition()
226
226
  props.noFocus !== true && focus()
227
227
  })
228
- prepareTick()
229
228
 
230
229
  registerTimeout(() => {
231
230
  // required in order to avoid the "double-tap needed" issue
@@ -258,6 +257,7 @@ export default createComponent({
258
257
  )
259
258
  ) {
260
259
  refocusTarget.focus()
260
+ refocusTarget = null
261
261
  }
262
262
 
263
263
  registerTimeout(() => {
@@ -280,6 +280,10 @@ export default createComponent({
280
280
  removeClickOutside(clickOutsideProps)
281
281
  removeEscapeKey(onEscapeKey)
282
282
  }
283
+
284
+ if (hiding !== true) {
285
+ refocusTarget = null
286
+ }
283
287
  }
284
288
 
285
289
  function configureScrollTarget () {
@@ -24,13 +24,8 @@ export default createComponent({
24
24
 
25
25
  modelValue: {
26
26
  type: Object,
27
- default: () => ({
28
- min: null,
29
- max: null
30
- }),
31
- validator (val) {
32
- return 'min' in val && 'max' in val
33
- }
27
+ default: () => ({ min: null, max: null }),
28
+ validator: v => 'min' in v && 'max' in v
34
29
  },
35
30
 
36
31
  dragRange: Boolean,
@@ -65,13 +60,24 @@ export default createComponent({
65
60
  const rootRef = ref(null)
66
61
  const curMinRatio = ref(0)
67
62
  const curMaxRatio = ref(0)
63
+ const model = ref({ min: 0, max: 0 })
68
64
 
69
- const model = ref({
70
- min: props.modelValue.min === null ? state.innerMin.value : props.modelValue.min,
71
- max: props.modelValue.max === null ? state.innerMax.value : props.modelValue.max
72
- })
65
+ function normalizeModel () {
66
+ model.value.min = props.modelValue.min === null
67
+ ? state.innerMin.value
68
+ : between(props.modelValue.min, state.innerMin.value, state.innerMax.value)
73
69
 
74
- const nextFocus = ref(null)
70
+ model.value.max = props.modelValue.max === null
71
+ ? state.innerMax.value
72
+ : between(props.modelValue.max, state.innerMin.value, state.innerMax.value)
73
+ }
74
+
75
+ watch(
76
+ () => `${ props.modelValue.min }|${ props.modelValue.max }|${ state.innerMin.value }|${ state.innerMax.value }`,
77
+ normalizeModel
78
+ )
79
+
80
+ normalizeModel()
75
81
 
76
82
  const modelMinRatio = computed(() => methods.convertModelToRatio(model.value.min))
77
83
  const modelMaxRatio = computed(() => methods.convertModelToRatio(model.value.max))
@@ -94,7 +100,7 @@ export default createComponent({
94
100
  return acc
95
101
  })
96
102
 
97
- const events = computed(() => {
103
+ const trackContainerEvents = computed(() => {
98
104
  if (state.editable.value !== true) {
99
105
  return {}
100
106
  }
@@ -105,34 +111,45 @@ export default createComponent({
105
111
 
106
112
  const evt = { onMousedown: methods.onActivate }
107
113
 
108
- props.dragOnlyRange === true && Object.assign(evt, {
109
- onFocus: () => { onFocus('both') },
110
- onBlur: methods.onBlur,
111
- onKeydown,
112
- onKeyup: methods.onKeyup
113
- })
114
+ if (props.dragRange === true || props.dragOnlyRange === true) {
115
+ Object.assign(evt, {
116
+ onFocus: () => { state.focus.value = 'both' },
117
+ onBlur: methods.onBlur,
118
+ onKeydown,
119
+ onKeyup: methods.onKeyup
120
+ })
121
+ }
114
122
 
115
123
  return evt
116
124
  })
117
125
 
118
- const minThumbRef = ref(null)
119
- const minEvents = computed(() => (
120
- state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
126
+ function getEvents (side) {
127
+ return $q.platform.is.mobile !== true && state.editable.value === true && props.dragOnlyRange !== true
121
128
  ? {
122
- onFocus: () => { onFocus('min') },
129
+ onFocus: () => { state.focus.value = side },
123
130
  onBlur: methods.onBlur,
124
131
  onKeydown,
125
132
  onKeyup: methods.onKeyup
126
133
  }
127
134
  : {}
135
+ }
136
+
137
+ const thumbTabindex = computed(() => (props.dragOnlyRange !== true ? state.tabindex.value : null))
138
+ const trackContainerTabindex = computed(() => (
139
+ $q.platform.is.mobile !== true && (props.dragRange || props.dragOnlyRange === true)
140
+ ? state.tabindex.value
141
+ : null
128
142
  ))
143
+
144
+ const minThumbRef = ref(null)
145
+ const minEvents = computed(() => getEvents('min'))
129
146
  const getMinThumb = methods.getThumbRenderFn({
130
147
  focusValue: 'min',
131
- nextFocus,
132
148
  getNodeData: () => ({
133
149
  ref: minThumbRef,
150
+ key: 'tmin',
134
151
  ...minEvents.value,
135
- tabindex: props.dragOnlyRange !== true ? state.tabindex.value : null
152
+ tabindex: thumbTabindex.value
136
153
  }),
137
154
  ratio: ratioMin,
138
155
  label: computed(() => (
@@ -145,22 +162,13 @@ export default createComponent({
145
162
  labelTextColor: computed(() => props.leftLabelTextColor || props.labelTextColor)
146
163
  })
147
164
 
148
- const maxEvents = computed(() => (
149
- state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
150
- ? {
151
- onFocus: () => { onFocus('max') },
152
- onBlur: methods.onBlur,
153
- onKeydown,
154
- onKeyup: methods.onKeyup
155
- }
156
- : {}
157
- ))
165
+ const maxEvents = computed(() => getEvents('max'))
158
166
  const getMaxThumb = methods.getThumbRenderFn({
159
167
  focusValue: 'max',
160
- nextFocus,
161
168
  getNodeData: () => ({
162
169
  ...maxEvents.value,
163
- tabindex: props.dragOnlyRange !== true ? state.tabindex.value : null
170
+ key: 'tmax',
171
+ tabindex: thumbTabindex.value
164
172
  }),
165
173
  ratio: ratioMax,
166
174
  label: computed(() => (
@@ -173,19 +181,6 @@ export default createComponent({
173
181
  labelTextColor: computed(() => props.rightLabelTextColor || props.labelTextColor)
174
182
  })
175
183
 
176
- watch(
177
- () => props.modelValue.min + props.modelValue.max + state.innerMin.value + state.innerMax.value,
178
- () => {
179
- model.value.min = props.modelValue.min === null
180
- ? state.innerMin.value
181
- : between(props.modelValue.min, state.innerMin.value, state.innerMax.value)
182
-
183
- model.value.max = props.modelValue.max === null
184
- ? state.innerMax.value
185
- : between(props.modelValue.max, state.innerMin.value, state.innerMax.value)
186
- }
187
- )
188
-
189
184
  function updateValue (change) {
190
185
  if (model.value.min !== props.modelValue.min || model.value.max !== props.modelValue.max) {
191
186
  emit('update:modelValue', { ...model.value })
@@ -214,15 +209,14 @@ export default createComponent({
214
209
  ratioMax: modelMaxRatio.value
215
210
  }
216
211
 
217
- let type
218
212
  const ratio = methods.getDraggingRatio(event, dragging)
219
213
 
220
214
  if (props.dragOnlyRange !== true && ratio < dragging.ratioMin + sensitivity) {
221
- type = dragType.MIN
215
+ dragging.type = dragType.MIN
222
216
  }
223
217
  else if (props.dragOnlyRange === true || ratio < dragging.ratioMax - sensitivity) {
224
218
  if (props.dragRange === true || props.dragOnlyRange === true) {
225
- type = dragType.RANGE
219
+ dragging.type = dragType.RANGE
226
220
  Object.assign(dragging, {
227
221
  offsetRatio: ratio,
228
222
  offsetModel: methods.convertRatioToModel(ratio),
@@ -231,18 +225,15 @@ export default createComponent({
231
225
  })
232
226
  }
233
227
  else {
234
- type = dragging.ratioMax - ratio < ratio - dragging.ratioMin
228
+ dragging.type = dragging.ratioMax - ratio < ratio - dragging.ratioMin
235
229
  ? dragType.MAX
236
230
  : dragType.MIN
237
231
  }
238
232
  }
239
233
  else {
240
- type = dragType.MAX
234
+ dragging.type = dragType.MAX
241
235
  }
242
236
 
243
- dragging.type = type
244
- nextFocus.value = null
245
-
246
237
  return dragging
247
238
  }
248
239
 
@@ -260,7 +251,7 @@ export default createComponent({
260
251
  min: localModel,
261
252
  max: dragging.valueMax
262
253
  }
263
- nextFocus.value = 'min'
254
+ state.focus.value = 'min'
264
255
  }
265
256
  else {
266
257
  pos = {
@@ -269,7 +260,7 @@ export default createComponent({
269
260
  min: dragging.valueMax,
270
261
  max: localModel
271
262
  }
272
- nextFocus.value = 'max'
263
+ state.focus.value = 'max'
273
264
  }
274
265
  break
275
266
 
@@ -281,7 +272,7 @@ export default createComponent({
281
272
  min: dragging.valueMin,
282
273
  max: localModel
283
274
  }
284
- nextFocus.value = 'max'
275
+ state.focus.value = 'max'
285
276
  }
286
277
  else {
287
278
  pos = {
@@ -290,7 +281,7 @@ export default createComponent({
290
281
  min: localModel,
291
282
  max: dragging.valueMin
292
283
  }
293
- nextFocus.value = 'min'
284
+ state.focus.value = 'min'
294
285
  }
295
286
  break
296
287
 
@@ -307,34 +298,26 @@ export default createComponent({
307
298
  min: parseFloat(min.toFixed(state.decimals.value)),
308
299
  max: parseFloat((min + dragging.rangeValue).toFixed(state.decimals.value))
309
300
  }
310
- break
311
- }
312
301
 
313
- model.value = {
314
- min: pos.min,
315
- max: pos.max
302
+ state.focus.value = 'both'
303
+ break
316
304
  }
317
305
 
318
306
  // If either of the values to be emitted are null, set them to the defaults the user has entered.
319
- if (model.value.min === null || model.value.max === null) {
320
- model.value.min = pos.min || props.min
321
- model.value.max = pos.max || props.max
322
- }
307
+ model.value = model.value.min === null || model.value.max === null
308
+ ? { min: pos.min || props.min, max: pos.max || props.max }
309
+ : { min: pos.min, max: pos.max }
323
310
 
324
311
  if (props.snap !== true || props.step === 0) {
325
312
  curMinRatio.value = pos.minR
326
313
  curMaxRatio.value = pos.maxR
327
314
  }
328
315
  else {
329
- curMinRatio.value = state.trackLen.value === 0 ? 0 : (model.value.min - props.min) / state.trackLen.value
330
- curMaxRatio.value = state.trackLen.value === 0 ? 0 : (model.value.max - props.min) / state.trackLen.value
316
+ curMinRatio.value = methods.convertModelToRatio(model.value.min)
317
+ curMaxRatio.value = methods.convertModelToRatio(model.value.max)
331
318
  }
332
319
  }
333
320
 
334
- function onFocus (which) {
335
- state.focus.value = which
336
- }
337
-
338
321
  function onKeydown (evt) {
339
322
  if (!keyCodes.includes(evt.keyCode)) {
340
323
  return
@@ -343,14 +326,11 @@ export default createComponent({
343
326
  stopAndPrevent(evt)
344
327
 
345
328
  const
346
- stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * props.step,
347
- offset = [ 34, 37, 40 ].includes(evt.keyCode) ? -stepVal : stepVal
348
-
349
- if (props.dragOnlyRange) {
350
- const interval = props.dragOnlyRange
351
- ? model.value.max - model.value.min
352
- : 0
329
+ stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.step.value,
330
+ offset = ([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1) * (state.isReversed.value === true ? -1 : 1) * stepVal
353
331
 
332
+ if (state.focus.value === 'both') {
333
+ const interval = model.value.max - model.value.min
354
334
  const min = between(
355
335
  parseFloat((model.value.min + offset).toFixed(state.decimals.value)),
356
336
  state.innerMin.value,
@@ -384,7 +364,8 @@ export default createComponent({
384
364
  return () => {
385
365
  const content = methods.getContent(
386
366
  selectionBarStyle,
387
- events,
367
+ trackContainerTabindex,
368
+ trackContainerEvents,
388
369
  node => {
389
370
  node.push(
390
371
  getMinThumb(),
@@ -401,10 +382,7 @@ export default createComponent({
401
382
  : ''
402
383
  ),
403
384
  ...state.attributes.value,
404
- 'aria-valuenow': props.modelValue.min + '|' + props.modelValue.max,
405
- tabindex: props.dragOnlyRange === true && $q.platform.is.mobile !== true
406
- ? state.tabindex.value
407
- : null
385
+ 'aria-valuenow': props.modelValue.min + '|' + props.modelValue.max
408
386
  }, content)
409
387
  }
410
388
  }
@@ -27,7 +27,7 @@
27
27
  "map",
28
28
  "ion-add",
29
29
  "img:https://cdn.quasar.dev/logo-v2/svg/logo.svg",
30
- "img:statics/path/to/some_image.png"
30
+ "img:path/to/some_image.png"
31
31
  ],
32
32
  "category": "content"
33
33
  },
@@ -39,7 +39,7 @@
39
39
  "map",
40
40
  "ion-add",
41
41
  "img:https://cdn.quasar.dev/logo-v2/svg/logo.svg",
42
- "img:statics/path/to/some_image.png"
42
+ "img:path/to/some_image.png"
43
43
  ],
44
44
  "category": "content"
45
45
  },
@@ -51,7 +51,7 @@
51
51
  "map",
52
52
  "ion-add",
53
53
  "img:https://cdn.quasar.dev/logo-v2/svg/logo.svg",
54
- "img:statics/path/to/some_image.png"
54
+ "img:path/to/some_image.png"
55
55
  ],
56
56
  "category": "content"
57
57
  },
@@ -28,19 +28,20 @@ export default createComponent({
28
28
  setup (props, { emit }) {
29
29
  if (__QUASAR_SSR_SERVER__) { return noop }
30
30
 
31
- let timer, targetEl, size = { width: -1, height: -1 }
31
+ let timer = null, targetEl, size = { width: -1, height: -1 }
32
32
 
33
- function trigger (now) {
34
- if (now === true || props.debounce === 0 || props.debounce === '0') {
35
- onResize()
33
+ function trigger (immediately) {
34
+ if (immediately === true || props.debounce === 0 || props.debounce === '0') {
35
+ emitEvent()
36
36
  }
37
- else if (!timer) {
38
- timer = setTimeout(onResize, props.debounce)
37
+ else if (timer === null) {
38
+ timer = setTimeout(emitEvent, props.debounce)
39
39
  }
40
40
  }
41
41
 
42
- function onResize () {
43
- timer = void 0
42
+ function emitEvent () {
43
+ clearTimeout(timer)
44
+ timer = null
44
45
 
45
46
  if (targetEl) {
46
47
  const { offsetWidth: width, offsetHeight: height } = targetEl
@@ -67,7 +68,7 @@ export default createComponent({
67
68
  if (targetEl) {
68
69
  observer = new ResizeObserver(trigger)
69
70
  observer.observe(targetEl)
70
- onResize()
71
+ emitEvent()
71
72
  }
72
73
  })
73
74
  })
@@ -110,7 +111,7 @@ export default createComponent({
110
111
  if (targetEl && targetEl.contentDocument) {
111
112
  curDocView = targetEl.contentDocument.defaultView
112
113
  curDocView.addEventListener('resize', trigger, listenOpts.passive)
113
- onResize()
114
+ emitEvent()
114
115
  }
115
116
  }
116
117
 
@@ -393,6 +393,7 @@ export default createComponent({
393
393
  style: mainStyle.value
394
394
  }, hMergeSlot(slots.default, [
395
395
  h(QResizeObserver, {
396
+ debounce: 0,
396
397
  onResize: updateScrollSize
397
398
  })
398
399
  ])),
@@ -403,7 +404,10 @@ export default createComponent({
403
404
  })
404
405
  ]),
405
406
 
406
- h(QResizeObserver, { onResize: updateContainer }),
407
+ h(QResizeObserver, {
408
+ debounce: 0,
409
+ onResize: updateContainer
410
+ }),
407
411
 
408
412
  h('div', {
409
413
  class: scroll.vertical.barClass.value,
@@ -55,6 +55,8 @@ export default createComponent({
55
55
  })
56
56
 
57
57
  function emitEvent () {
58
+ clearTimeout(timer)
59
+ cancelAnimationFrame(timer)
58
60
  timer = null
59
61
 
60
62
  const top = Math.max(0, getVerticalScrollPosition(localScrollTarget))
@@ -12,6 +12,8 @@ import { createComponent } from '../../utils/private/create.js'
12
12
  import { between } from '../../utils/format.js'
13
13
  import { stopAndPrevent } from '../../utils/event.js'
14
14
 
15
+ const getNodeData = () => ({})
16
+
15
17
  export default createComponent({
16
18
  name: 'QSlider',
17
19
 
@@ -39,8 +41,20 @@ export default createComponent({
39
41
 
40
42
  const rootRef = ref(null)
41
43
  const curRatio = ref(0)
44
+ const model = ref(0)
45
+
46
+ function normalizeModel () {
47
+ model.value = props.modelValue === null
48
+ ? state.innerMin.value
49
+ : between(props.modelValue, state.innerMin.value, state.innerMax.value)
50
+ }
42
51
 
43
- const model = ref(props.modelValue === null ? state.innerMin.value : props.modelValue)
52
+ watch(
53
+ () => `${ props.modelValue }|${ state.innerMin.value }|${ state.innerMax.value }`,
54
+ normalizeModel
55
+ )
56
+
57
+ normalizeModel()
44
58
 
45
59
  const modelRatio = computed(() => methods.convertModelToRatio(model.value))
46
60
  const ratio = computed(() => (state.active.value === true ? curRatio.value : modelRatio.value))
@@ -58,6 +72,7 @@ export default createComponent({
58
72
 
59
73
  const getThumb = methods.getThumbRenderFn({
60
74
  focusValue: true,
75
+ getNodeData,
61
76
  ratio,
62
77
  label: computed(() => (
63
78
  props.labelValue !== void 0
@@ -69,7 +84,7 @@ export default createComponent({
69
84
  labelTextColor: computed(() => props.labelTextColor)
70
85
  })
71
86
 
72
- const events = computed(() => {
87
+ const trackContainerEvents = computed(() => {
73
88
  if (state.editable.value !== true) {
74
89
  return {}
75
90
  }
@@ -85,12 +100,6 @@ export default createComponent({
85
100
  }
86
101
  })
87
102
 
88
- watch(() => props.modelValue + state.innerMin.value + state.innerMax.value, () => {
89
- model.value = props.modelValue === null
90
- ? state.innerMin.value
91
- : between(props.modelValue, state.innerMin.value, state.innerMax.value)
92
- })
93
-
94
103
  function updateValue (change) {
95
104
  if (model.value !== props.modelValue) {
96
105
  emit('update:modelValue', model.value)
@@ -125,7 +134,7 @@ export default createComponent({
125
134
 
126
135
  const
127
136
  stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.step.value,
128
- offset = [ 34, 37, 40 ].includes(evt.keyCode) ? -stepVal : stepVal
137
+ offset = ([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1) * (state.isReversed.value === true ? -1 : 1) * stepVal
129
138
 
130
139
  model.value = between(
131
140
  parseFloat((model.value + offset).toFixed(state.decimals.value)),
@@ -139,7 +148,8 @@ export default createComponent({
139
148
  return () => {
140
149
  const content = methods.getContent(
141
150
  selectionBarStyle,
142
- events,
151
+ state.tabindex,
152
+ trackContainerEvents,
143
153
  node => { node.push(getThumb()) }
144
154
  )
145
155
 
@@ -107,6 +107,9 @@
107
107
  color: var(--q-primary)
108
108
  transition: transform .18s ease-out, fill .18s ease-out, stroke .18s ease-out
109
109
 
110
+ &.q-slider--focus
111
+ opacity: 1 !important
112
+
110
113
  &--h
111
114
  top: 50%
112
115
  will-change: left
@@ -224,11 +227,7 @@
224
227
  .q-slider__thumb,
225
228
  .q-slider__inner,
226
229
  .q-slider__selection
227
- visibility: hidden
228
-
229
- &--focus
230
- .q-slider__thumb
231
- transform: scale(1)
230
+ opacity: 0
232
231
 
233
232
  &--focus,
234
233
  body.desktop &.q-slider--editable .q-slider__track-container:hover
@@ -239,7 +238,7 @@
239
238
  .q-slider__thumb,
240
239
  .q-slider__inner,
241
240
  .q-slider__selection
242
- visibility: visible
241
+ opacity: 1
243
242
 
244
243
  &--inactive
245
244
  .q-slider__thumb
@@ -142,7 +142,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
142
142
  const positionProp = computed(() => (
143
143
  props.vertical === true
144
144
  ? (isReversed.value === true ? 'bottom' : 'top')
145
- : isReversed.value === true ? 'right' : 'left'
145
+ : (isReversed.value === true ? 'right' : 'left')
146
146
  ))
147
147
 
148
148
  const sizeProp = computed(() => (props.vertical === true ? 'height' : 'width'))
@@ -152,8 +152,8 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
152
152
  const attributes = computed(() => {
153
153
  const acc = {
154
154
  role: 'slider',
155
- 'aria-valuemin': props.min,
156
- 'aria-valuemax': props.max,
155
+ 'aria-valuemin': innerMin.value,
156
+ 'aria-valuemax': innerMax.value,
157
157
  'aria-orientation': orientation.value,
158
158
  'data-step': props.step
159
159
  }
@@ -344,15 +344,19 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
344
344
  })
345
345
  }
346
346
 
347
+ const filterFn = ({ value }) => value >= props.min && value <= props.max
348
+
347
349
  if (Array.isArray(def) === true) {
348
- return def.map(item => (Object(item) === item ? item : { value: item }))
350
+ return def
351
+ .map(item => (Object(item) === item ? item : { value: item }))
352
+ .filter(filterFn)
349
353
  }
350
354
 
351
355
  return Object.keys(def).map(key => {
352
356
  const item = def[ key ]
353
357
  const value = Number(key)
354
358
  return Object(item) === item ? { ...item, value } : { value, label: item }
355
- })
359
+ }).filter(filterFn)
356
360
  }
357
361
 
358
362
  function getMarkerLabelStyle (val) {
@@ -407,6 +411,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
407
411
  emit('pan', 'end')
408
412
  }
409
413
  active.value = false
414
+ focus.value = false
410
415
  }
411
416
  else if (event.isFirst === true) {
412
417
  dragging.value = getDragging(event.evt)
@@ -467,7 +472,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
467
472
 
468
473
  function getThumbRenderFn (thumb) {
469
474
  const focusClass = computed(() => (
470
- preventFocus.value === false && focus.value === thumb.focusValue
475
+ preventFocus.value === false && (focus.value === thumb.focusValue || focus.value === 'both')
471
476
  ? ' q-slider--focus'
472
477
  : ''
473
478
  ))
@@ -482,9 +487,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
482
487
  width: props.thumbSize,
483
488
  height: props.thumbSize,
484
489
  [ positionProp.value ]: `${ 100 * thumb.ratio.value }%`,
485
- 'z-index': thumb.nextFocus !== void 0
486
- ? thumb.nextFocus.value === 'min' ? 2 : void 0
487
- : void 0
490
+ zIndex: focus.value === thumb.focusValue ? 2 : void 0
488
491
  }))
489
492
 
490
493
  const pinColor = computed(() => (
@@ -540,12 +543,12 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
540
543
  return h('div', {
541
544
  class: classes.value,
542
545
  style: style.value,
543
- ...(thumb.getNodeData !== void 0 ? thumb.getNodeData() : {})
546
+ ...thumb.getNodeData()
544
547
  }, thumbContent)
545
548
  }
546
549
  }
547
550
 
548
- function getContent (selectionBarStyle, events, injectThumb) {
551
+ function getContent (selectionBarStyle, trackContainerTabindex, trackContainerEvents, injectThumb) {
549
552
  const trackContent = []
550
553
 
551
554
  props.innerTrackColor !== 'transparent' && trackContent.push(
@@ -580,15 +583,14 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
580
583
  {
581
584
  key: 'trackC',
582
585
  class: trackContainerClass.value,
583
- tabindex: tabindex.value,
584
- ...events.value
586
+ tabindex: trackContainerTabindex.value,
587
+ ...trackContainerEvents.value
585
588
  },
586
589
  [
587
590
  h('div', {
588
591
  class: trackClass.value,
589
592
  style: trackStyle.value
590
- },
591
- trackContent)
593
+ }, trackContent)
592
594
  ],
593
595
  'slide',
594
596
  editable.value, () => panDirective.value
@@ -635,7 +637,8 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
635
637
  innerMax,
636
638
  innerMaxRatio,
637
639
  positionProp,
638
- sizeProp
640
+ sizeProp,
641
+ isReversed
639
642
  },
640
643
 
641
644
  methods: {