quasar 2.4.0 → 2.4.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.
- package/dist/api/BottomSheet.json +6 -2
- package/dist/api/Notify.json +25 -25
- package/dist/api/QAvatar.json +1 -1
- package/dist/api/QBreadcrumbsEl.json +1 -1
- package/dist/api/QBtn.json +2 -2
- package/dist/api/QBtnDropdown.json +3 -3
- package/dist/api/QBtnToggle.json +1 -1
- package/dist/api/QCarousel.json +4 -4
- package/dist/api/QCarouselSlide.json +2 -2
- package/dist/api/QChatMessage.json +1 -1
- package/dist/api/QChip.json +4 -4
- package/dist/api/QExpansionItem.json +3 -3
- package/dist/api/QFab.json +2 -2
- package/dist/api/QFabAction.json +1 -1
- package/dist/api/QImg.json +2 -2
- package/dist/api/QLinearProgress.json +1 -1
- package/dist/api/QPagination.json +4 -4
- package/dist/api/QParallax.json +1 -1
- package/dist/api/QPullToRefresh.json +1 -1
- package/dist/api/QRating.json +3 -3
- package/dist/api/QRouteTab.json +1 -1
- package/dist/api/QSelect.json +2 -2
- package/dist/api/QStep.json +4 -4
- package/dist/api/QStepper.json +4 -4
- package/dist/api/QTab.json +1 -1
- package/dist/api/QTable.json +4 -4
- package/dist/api/QTimelineEntry.json +2 -2
- package/dist/api/QToggle.json +1 -1
- package/dist/api/QTree.json +1 -1
- package/dist/api/QVideo.json +11 -1
- 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/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/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/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-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-mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.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.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/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/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/ms.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/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/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.css +15 -14
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +15 -14
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +11 -13
- package/dist/quasar.umd.js +279 -209
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/types/api/slider.d.ts +6 -6
- package/dist/types/index.d.ts +20 -8
- package/dist/types/utils/date.d.ts +2 -1
- package/dist/vetur/quasar-attributes.json +5 -1
- package/dist/vetur/quasar-tags.json +2 -1
- package/dist/web-types/web-types.json +66 -57
- package/package.json +1 -1
- package/src/api.extends.json +1 -1
- package/src/components/btn/use-btn.js +5 -2
- package/src/components/btn-toggle/QBtnToggle.js +2 -0
- package/src/components/carousel/QCarouselSlide.json +2 -2
- package/src/components/chat/QChatMessage.json +1 -1
- package/src/components/dialog/QDialog.js +7 -5
- package/src/components/img/QImg.json +2 -2
- package/src/components/linear-progress/QLinearProgress.json +1 -1
- package/src/components/menu/QMenu.js +6 -2
- package/src/components/parallax/QParallax.json +1 -1
- package/src/components/range/QRange.js +67 -89
- package/src/components/rating/QRating.json +3 -3
- package/src/components/resize-observer/QResizeObserver.js +11 -10
- package/src/components/scroll-area/QScrollArea.js +5 -1
- package/src/components/scroll-area/QScrollArea.sass +1 -0
- package/src/components/scroll-observer/QScrollObserver.js +2 -0
- package/src/components/select/QSelect.js +4 -1
- package/src/components/select/QSelect.json +1 -1
- package/src/components/slider/QSlider.js +20 -10
- package/src/components/slider/QSlider.sass +5 -6
- package/src/components/slider/use-slider.js +19 -16
- package/src/components/tabs/QTabs.js +27 -11
- package/src/components/timeline/QTimeline.sass +1 -2
- package/src/components/timeline/QTimelineEntry.json +1 -1
- package/src/components/tooltip/QTooltip.js +1 -2
- package/src/components/video/QVideo.js +4 -1
- package/src/components/video/QVideo.json +12 -1
- package/src/composables/private/use-field.js +13 -15
- package/src/composables/private/use-model-toggle.js +1 -1
- package/src/composables/private/use-portal.js +9 -7
- package/src/composables/private/use-tick.js +7 -14
- package/src/css/variables.sass +4 -6
- package/src/plugins/BottomSheet.json +7 -1
- package/src/plugins/Notify.json +22 -22
- package/src/utils/clone.js +53 -4
- package/src/utils/private/focus-manager.js +8 -10
|
@@ -94,7 +94,7 @@ export default createComponent({
|
|
|
94
94
|
|
|
95
95
|
const { preventBodyScroll } = usePreventScroll()
|
|
96
96
|
const { registerTimeout, removeTimeout } = useTimeout()
|
|
97
|
-
const { registerTick, removeTick
|
|
97
|
+
const { registerTick, removeTick } = useTick()
|
|
98
98
|
|
|
99
99
|
const { showPortal, hidePortal, portalIsActive, renderPortal } = usePortal(
|
|
100
100
|
vm, innerRef, renderPortalContent, /* pls do check if on a global dialog */ true
|
|
@@ -193,7 +193,6 @@ export default createComponent({
|
|
|
193
193
|
if (props.noFocus !== true) {
|
|
194
194
|
document.activeElement !== null && document.activeElement.blur()
|
|
195
195
|
registerTick(focus)
|
|
196
|
-
prepareTick()
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
registerTimeout(() => {
|
|
@@ -239,6 +238,7 @@ export default createComponent({
|
|
|
239
238
|
|
|
240
239
|
if (refocusTarget !== null) {
|
|
241
240
|
refocusTarget.focus()
|
|
241
|
+
refocusTarget = null
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
registerTimeout(() => {
|
|
@@ -306,6 +306,10 @@ export default createComponent({
|
|
|
306
306
|
removeEscapeKey(onEscapeKey)
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
+
|
|
310
|
+
if (hiding !== true) {
|
|
311
|
+
refocusTarget = null
|
|
312
|
+
}
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
function updateMaximized (active) {
|
|
@@ -364,9 +368,7 @@ export default createComponent({
|
|
|
364
368
|
}
|
|
365
369
|
})
|
|
366
370
|
|
|
367
|
-
onBeforeUnmount(
|
|
368
|
-
cleanup()
|
|
369
|
-
})
|
|
371
|
+
onBeforeUnmount(cleanup)
|
|
370
372
|
|
|
371
373
|
function renderPortalContent () {
|
|
372
374
|
return h('div', {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"desc": "Path to image",
|
|
12
12
|
"transformAssetUrls": true,
|
|
13
13
|
"examples": [
|
|
14
|
-
"(
|
|
14
|
+
"(public folder) src=\"img/something.png\"",
|
|
15
15
|
"(assets folder) src=\"~assets/my-img.gif\"",
|
|
16
16
|
"(relative path format) :src=\"require('./my_img.jpg')\"",
|
|
17
17
|
"(URL) src=\"https://placeimg.com/500/300/nature\""
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"desc": "While waiting for your image to load, you can use a placeholder image",
|
|
45
45
|
"transformAssetUrls": true,
|
|
46
46
|
"examples": [
|
|
47
|
-
"(
|
|
47
|
+
"(public folder) src=\"img/some-placeholder.png\"",
|
|
48
48
|
"(assets folder) src=\"~assets/my-placeholder.gif\"",
|
|
49
49
|
"(relative path format) :src=\"require('./placeholder.jpg')\"",
|
|
50
50
|
"(URL) src=\"https://placeimg.com/500/300/nature\""
|
|
@@ -98,7 +98,7 @@ export default createComponent({
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
const isDark = useDark(props, $q)
|
|
101
|
-
const { registerTick, removeTick
|
|
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 () {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"desc": "Path to image (unless a 'media' slot is used)",
|
|
10
10
|
"transformAssetUrls": true,
|
|
11
11
|
"examples": [
|
|
12
|
-
"(
|
|
12
|
+
"(public folder) src=\"img/something.png\"",
|
|
13
13
|
"(assets folder) src=\"~assets/my-img.png\"",
|
|
14
14
|
"(relative path format) :src=\"require('./my_img.jpg')\"",
|
|
15
15
|
"(URL) src=\"https://some-site.net/some-img.jpg\""
|
|
@@ -24,13 +24,8 @@ export default createComponent({
|
|
|
24
24
|
|
|
25
25
|
modelValue: {
|
|
26
26
|
type: Object,
|
|
27
|
-
default: () => ({
|
|
28
|
-
|
|
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
|
-
|
|
70
|
-
min
|
|
71
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
119
|
-
|
|
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: () => {
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
314
|
-
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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 =
|
|
330
|
-
curMaxRatio.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) *
|
|
347
|
-
offset = [ 34, 37, 40 ].includes(evt.keyCode) ? -
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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 (
|
|
34
|
-
if (
|
|
35
|
-
|
|
33
|
+
function trigger (immediately) {
|
|
34
|
+
if (immediately === true || props.debounce === 0 || props.debounce === '0') {
|
|
35
|
+
emitEvent()
|
|
36
36
|
}
|
|
37
|
-
else if (
|
|
38
|
-
timer = setTimeout(
|
|
37
|
+
else if (timer === null) {
|
|
38
|
+
timer = setTimeout(emitEvent, props.debounce)
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
timer
|
|
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
|
-
|
|
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
|
-
|
|
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, {
|
|
407
|
+
h(QResizeObserver, {
|
|
408
|
+
debounce: 0,
|
|
409
|
+
onResize: updateContainer
|
|
410
|
+
}),
|
|
407
411
|
|
|
408
412
|
h('div', {
|
|
409
413
|
class: scroll.vertical.barClass.value,
|
|
@@ -511,7 +511,10 @@ export default createComponent({
|
|
|
511
511
|
|
|
512
512
|
targetRef.value !== null && targetRef.value.focus()
|
|
513
513
|
|
|
514
|
-
if (
|
|
514
|
+
if (
|
|
515
|
+
innerValue.value.length === 0
|
|
516
|
+
|| isDeepEqual(getOptionValue.value(innerValue.value[ 0 ]), optValue) !== true
|
|
517
|
+
) {
|
|
515
518
|
emit('update:modelValue', props.emitValue === true ? optValue : opt)
|
|
516
519
|
}
|
|
517
520
|
return
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"desc": "Style definitions to be attributed to the popup content",
|
|
229
229
|
"examples": [
|
|
230
230
|
"background-color: #ff0000",
|
|
231
|
-
":content-style=\"{ backgroundColor: '#ff0000' }\""
|
|
231
|
+
":popup-content-style=\"{ backgroundColor: '#ff0000' }\""
|
|
232
232
|
],
|
|
233
233
|
"category": "style"
|
|
234
234
|
},
|
|
@@ -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
|
-
|
|
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
|
|
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) ? -
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
241
|
+
opacity: 1
|
|
243
242
|
|
|
244
243
|
&--inactive
|
|
245
244
|
.q-slider__thumb
|