quasar 2.3.3 → 2.4.2
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/Dialog.json +1 -1
- package/dist/api/Loading.json +2 -6
- package/dist/api/QBreadcrumbsEl.json +31 -10
- package/dist/api/QBtn.json +30 -14
- package/dist/api/QBtnDropdown.json +31 -15
- package/dist/api/QBtnToggle.json +3 -0
- package/dist/api/QChatMessage.json +4 -12
- package/dist/api/QExpansionItem.json +34 -12
- package/dist/api/QFab.json +33 -2
- package/dist/api/QFabAction.json +8 -0
- package/dist/api/QField.json +1 -0
- package/dist/api/QFile.json +5 -2
- package/dist/api/QForm.json +1 -1
- package/dist/api/QInput.json +1 -0
- package/dist/api/QItem.json +31 -10
- package/dist/api/QOptionGroup.json +74 -4
- package/dist/api/QPopupProxy.json +3 -2
- package/dist/api/QRange.json +592 -107
- package/dist/api/QRating.json +3 -1
- package/dist/api/QRouteTab.json +31 -11
- package/dist/api/QScrollArea.json +3 -2
- package/dist/api/QSelect.json +9 -16
- package/dist/api/QSlider.json +504 -39
- package/dist/api/QTree.json +8 -4
- package/dist/api/QUploader.json +16 -2
- package/dist/api/QVirtualScroll.json +3 -2
- 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 +275 -191
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +347 -270
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +275 -217
- package/dist/quasar.umd.js +16598 -16283
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/transforms/loader-asset-urls.json +20 -0
- package/dist/types/api/slider.d.ts +46 -0
- package/dist/types/api/validation.d.ts +4 -0
- package/dist/types/api.d.ts +2 -0
- package/dist/types/composables.d.ts +3 -3
- package/dist/types/index.d.ts +611 -140
- package/dist/vetur/quasar-attributes.json +251 -83
- package/dist/vetur/quasar-tags.json +59 -17
- package/dist/web-types/web-types.json +580 -152
- package/package.json +1 -1
- package/src/api.extends.json +0 -1
- package/src/components/breadcrumbs/QBreadcrumbs.js +7 -2
- package/src/components/breadcrumbs/QBreadcrumbs.sass +0 -3
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +14 -8
- package/src/components/btn/QBtn.js +5 -5
- package/src/components/btn/use-btn.js +21 -21
- package/src/components/btn/use-btn.json +22 -13
- package/src/components/btn-dropdown/QBtnDropdown.json +1 -0
- package/src/components/btn-toggle/QBtnToggle.json +3 -0
- package/src/components/checkbox/use-checkbox.js +1 -1
- package/src/components/chip/QChip.json +1 -2
- package/src/components/color/QColor.js +32 -26
- package/src/components/color/QColor.sass +10 -23
- package/src/components/date/QDate.sass +2 -0
- package/src/components/drawer/QDrawer.js +18 -15
- package/src/components/editor/QEditor.js +1 -1
- package/src/components/editor/QEditor.sass +10 -1
- package/src/components/expansion-item/QExpansionItem.js +4 -1
- package/src/components/expansion-item/QExpansionItem.json +2 -1
- package/src/components/fab/QFab.js +18 -12
- package/src/components/fab/QFab.json +36 -1
- package/src/components/fab/QFab.sass +1 -1
- package/src/components/fab/QFabAction.js +14 -7
- package/src/components/fab/QFabAction.json +10 -0
- package/src/components/file/QFile.js +12 -5
- package/src/components/file/QFile.json +6 -6
- package/src/components/file/QFile.sass +4 -2
- package/src/components/footer/QFooter.js +1 -1
- package/src/components/form/QForm.json +2 -3
- package/src/components/header/QHeader.js +1 -1
- package/src/components/icon/QIcon.js +2 -2
- package/src/components/infinite-scroll/QInfiniteScroll.js +4 -5
- package/src/components/item/QItem.js +2 -3
- package/src/components/linear-progress/QLinearProgress.js +3 -2
- package/src/components/option-group/QOptionGroup.js +3 -0
- package/src/components/option-group/QOptionGroup.json +48 -2
- package/src/components/parallax/QParallax.js +4 -2
- package/src/components/popup-edit/QPopupEdit.js +2 -5
- package/src/components/popup-proxy/QPopupProxy.json +2 -1
- package/src/components/radio/QRadio.js +2 -7
- package/src/components/range/QRange.js +103 -222
- package/src/components/range/QRange.json +11 -121
- package/src/components/rating/QRating.json +1 -1
- package/src/components/scroll-area/QScrollArea.js +3 -1
- package/src/components/scroll-area/QScrollArea.json +5 -6
- package/src/components/select/QSelect.js +4 -1
- package/src/components/select/QSelect.json +17 -4
- package/src/components/slider/QSlider.js +46 -132
- package/src/components/slider/QSlider.json +1 -121
- package/src/components/slider/QSlider.sass +198 -132
- package/src/components/slider/use-slider.js +453 -109
- package/src/components/slider/use-slider.json +546 -0
- package/src/components/stepper/QStepper.js +3 -3
- package/src/components/stepper/QStepper.sass +24 -26
- package/src/components/table/QTable.js +27 -47
- package/src/components/tabs/QRouteTab.js +1 -2
- package/src/components/tabs/QRouteTab.json +0 -7
- package/src/components/tabs/QTabs.js +71 -20
- package/src/components/tabs/use-tab.js +26 -13
- package/src/components/tree/QTree.js +14 -12
- package/src/components/tree/QTree.json +12 -12
- package/src/components/tree/QTree.sass +45 -41
- package/src/components/uploader/QUploader.json +14 -2
- package/src/components/uploader/uploader-core.js +16 -9
- package/src/components/virtual-scroll/QVirtualScroll.json +15 -0
- package/src/components/virtual-scroll/QVirtualScroll.sass +1 -0
- package/src/components/virtual-scroll/use-virtual-scroll.js +30 -17
- package/src/components/virtual-scroll/use-virtual-scroll.json +2 -5
- package/src/composables/private/use-field.js +5 -5
- package/src/composables/private/use-file.js +20 -5
- package/src/composables/private/use-form.js +2 -3
- package/src/composables/private/use-fullscreen.js +15 -4
- package/src/composables/private/use-router-link.js +44 -23
- package/src/composables/private/use-router-link.json +26 -10
- package/src/composables/private/use-split-attrs.js +4 -4
- package/src/composables/private/use-validate.js +21 -15
- package/src/composables/private/use-validate.json +1 -0
- package/src/css/core/helpers.sass +3 -0
- package/src/css/core/positioning.sass +5 -0
- package/src/css/variables.sass +4 -6
- package/src/directives/ScrollFire.js +1 -0
- package/src/icon-set.js +2 -4
- package/src/plugins/AppFullscreen.js +70 -53
- package/src/plugins/AppVisibility.js +2 -3
- package/src/plugins/BottomSheet.js +3 -5
- package/src/plugins/Dialog.js +3 -5
- package/src/plugins/Dialog.json +2 -3
- package/src/plugins/LoadingBar.js +17 -18
- package/src/plugins/Notify.js +296 -295
- package/src/plugins/Platform.js +14 -14
- package/src/utils/date.js +4 -4
- package/src/utils/dom.js +2 -2
- package/src/utils/open-url.js +2 -2
- package/src/utils/patterns.js +1 -0
- package/src/utils/private/define-reactive-plugin.js +10 -8
- package/src/utils/private/global-dialog.js +6 -8
- package/src/utils/private/inject-obj-prop.js +13 -0
- package/src/utils/private/is.js +2 -2
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"desc": "An object containing scroll information",
|
|
99
99
|
"definition": {
|
|
100
100
|
"ref": {
|
|
101
|
-
"type": "
|
|
101
|
+
"type": "Component",
|
|
102
|
+
"tsType": "QScrollArea",
|
|
102
103
|
"required": true,
|
|
103
|
-
"desc": "Vue reference to the QScrollArea which triggered the event"
|
|
104
|
-
"__exemption": [ "examples" ]
|
|
104
|
+
"desc": "Vue reference to the QScrollArea which triggered the event"
|
|
105
105
|
},
|
|
106
106
|
|
|
107
107
|
"verticalPosition": {
|
|
@@ -163,9 +163,8 @@
|
|
|
163
163
|
"getScrollTarget": {
|
|
164
164
|
"desc": "Get the scrolling DOM element target",
|
|
165
165
|
"returns": {
|
|
166
|
-
"type": "
|
|
167
|
-
"desc": "DOM element upon which scrolling takes place"
|
|
168
|
-
"__exemption": [ "examples" ]
|
|
166
|
+
"type": "Element",
|
|
167
|
+
"desc": "DOM element upon which scrolling takes place"
|
|
169
168
|
}
|
|
170
169
|
},
|
|
171
170
|
|
|
@@ -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
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"props": {
|
|
9
9
|
"model-value": {
|
|
10
10
|
"extends": "model-value",
|
|
11
|
-
"type":
|
|
11
|
+
"type": "Any",
|
|
12
12
|
"desc": "Model of the component; Must be Array if using 'multiple' prop; Either use this property (along with a listener for 'update:modelValue' event) OR use v-model directive",
|
|
13
13
|
"examples": [ "v-model=\"myModel\"" ]
|
|
14
14
|
},
|
|
@@ -597,10 +597,10 @@
|
|
|
597
597
|
"desc": "Callback to call at the end after the update has been fully processed by QSelect",
|
|
598
598
|
"params": {
|
|
599
599
|
"ref": {
|
|
600
|
-
"type": "
|
|
600
|
+
"type": "Component",
|
|
601
|
+
"tsType": "QSelect",
|
|
601
602
|
"required": true,
|
|
602
|
-
"desc": "Vue reference to the QSelect which triggered the filtering"
|
|
603
|
-
"__exemption": [ "examples" ]
|
|
603
|
+
"desc": "Vue reference to the QSelect which triggered the filtering"
|
|
604
604
|
}
|
|
605
605
|
},
|
|
606
606
|
"returns": null
|
|
@@ -641,6 +641,19 @@
|
|
|
641
641
|
"__exemption": [ "examples" ]
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
+
},
|
|
645
|
+
|
|
646
|
+
"virtual-scroll": {
|
|
647
|
+
"params": {
|
|
648
|
+
"details": {
|
|
649
|
+
"definition": {
|
|
650
|
+
"ref": {
|
|
651
|
+
"tsType": "QSelect",
|
|
652
|
+
"desc": "Vue reference to the QSelect"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
644
657
|
}
|
|
645
658
|
},
|
|
646
659
|
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import { h, ref, computed, watch, getCurrentInstance } from 'vue'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useFormAttrs } from '../../composables/private/use-form.js'
|
|
4
4
|
|
|
5
5
|
import useSlider, {
|
|
6
6
|
useSliderProps,
|
|
7
7
|
useSliderEmits,
|
|
8
|
-
getRatio,
|
|
9
|
-
getModel,
|
|
10
8
|
keyCodes
|
|
11
9
|
} from './use-slider.js'
|
|
12
10
|
|
|
13
11
|
import { createComponent } from '../../utils/private/create.js'
|
|
14
12
|
import { between } from '../../utils/format.js'
|
|
15
13
|
import { stopAndPrevent } from '../../utils/event.js'
|
|
16
|
-
import { hDir } from '../../utils/private/render.js'
|
|
17
14
|
|
|
18
15
|
export default createComponent({
|
|
19
16
|
name: 'QSlider',
|
|
20
17
|
|
|
21
18
|
props: {
|
|
22
19
|
...useSliderProps,
|
|
23
|
-
...useFormProps,
|
|
24
20
|
|
|
25
21
|
modelValue: {
|
|
26
22
|
required: true,
|
|
@@ -36,47 +32,42 @@ export default createComponent({
|
|
|
36
32
|
setup (props, { emit }) {
|
|
37
33
|
const { proxy: { $q } } = getCurrentInstance()
|
|
38
34
|
|
|
39
|
-
const
|
|
40
|
-
|
|
35
|
+
const { state, methods } = useSlider({
|
|
36
|
+
updateValue, updatePosition, getDragging,
|
|
37
|
+
formAttrs: useFormAttrs(props)
|
|
38
|
+
})
|
|
41
39
|
|
|
42
40
|
const rootRef = ref(null)
|
|
43
|
-
const model = ref(props.modelValue === null ? props.min : props.modelValue)
|
|
44
41
|
const curRatio = ref(0)
|
|
45
42
|
|
|
46
|
-
const
|
|
47
|
-
updateValue, updatePosition, getDragging
|
|
48
|
-
})
|
|
43
|
+
const model = ref(props.modelValue === null ? state.innerMin.value : props.modelValue)
|
|
49
44
|
|
|
50
|
-
const modelRatio = computed(() => (
|
|
51
|
-
state.minMaxDiff.value === 0 ? 0 : (model.value - props.min) / state.minMaxDiff.value
|
|
52
|
-
))
|
|
45
|
+
const modelRatio = computed(() => methods.convertModelToRatio(model.value))
|
|
53
46
|
const ratio = computed(() => (state.active.value === true ? curRatio.value : modelRatio.value))
|
|
54
47
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
state.preventFocus.value === false && state.focus.value === true
|
|
66
|
-
? ' q-slider--focus'
|
|
67
|
-
: ''
|
|
68
|
-
))
|
|
69
|
-
|
|
70
|
-
const pinClass = computed(() => (
|
|
71
|
-
props.labelColor !== void 0
|
|
72
|
-
? `text-${ props.labelColor }`
|
|
73
|
-
: ''
|
|
74
|
-
))
|
|
48
|
+
const selectionBarStyle = computed(() => {
|
|
49
|
+
const acc = {
|
|
50
|
+
[ state.positionProp.value ]: `${ 100 * state.innerMinRatio.value }%`,
|
|
51
|
+
[ state.sizeProp.value ]: `${ 100 * (ratio.value - state.innerMinRatio.value) }%`
|
|
52
|
+
}
|
|
53
|
+
if (props.selectionImg !== void 0) {
|
|
54
|
+
acc.backgroundImage = `url(${ props.selectionImg }) !important`
|
|
55
|
+
}
|
|
56
|
+
return acc
|
|
57
|
+
})
|
|
75
58
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
const getThumb = methods.getThumbRenderFn({
|
|
60
|
+
focusValue: true,
|
|
61
|
+
ratio,
|
|
62
|
+
label: computed(() => (
|
|
63
|
+
props.labelValue !== void 0
|
|
64
|
+
? props.labelValue
|
|
65
|
+
: model.value
|
|
66
|
+
)),
|
|
67
|
+
thumbColor: computed(() => props.thumbColor || props.color),
|
|
68
|
+
labelColor: computed(() => props.labelColor),
|
|
69
|
+
labelTextColor: computed(() => props.labelTextColor)
|
|
70
|
+
})
|
|
80
71
|
|
|
81
72
|
const events = computed(() => {
|
|
82
73
|
if (state.editable.value !== true) {
|
|
@@ -94,25 +85,10 @@ export default createComponent({
|
|
|
94
85
|
}
|
|
95
86
|
})
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
props.
|
|
99
|
-
?
|
|
100
|
-
:
|
|
101
|
-
))
|
|
102
|
-
|
|
103
|
-
const pinStyle = computed(() => {
|
|
104
|
-
const percent = (props.reverse === true ? -ratio.value : ratio.value - 1)
|
|
105
|
-
return methods.getPinStyle(percent, ratio.value)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
watch(() => props.modelValue, v => {
|
|
109
|
-
model.value = v === null
|
|
110
|
-
? 0
|
|
111
|
-
: between(v, props.min, props.max)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
watch(() => props.min + props.max, () => {
|
|
115
|
-
model.value = between(model.value, props.min, props.max)
|
|
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)
|
|
116
92
|
})
|
|
117
93
|
|
|
118
94
|
function updateValue (change) {
|
|
@@ -127,19 +103,13 @@ export default createComponent({
|
|
|
127
103
|
}
|
|
128
104
|
|
|
129
105
|
function updatePosition (event, dragging = state.dragging.value) {
|
|
130
|
-
const ratio =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
state.isReversed.value,
|
|
134
|
-
props.vertical
|
|
135
|
-
)
|
|
106
|
+
const ratio = methods.getDraggingRatio(event, dragging)
|
|
107
|
+
|
|
108
|
+
model.value = methods.convertRatioToModel(ratio)
|
|
136
109
|
|
|
137
|
-
model.value = getModel(ratio, props.min, props.max, props.step, state.decimals.value)
|
|
138
110
|
curRatio.value = props.snap !== true || props.step === 0
|
|
139
111
|
? ratio
|
|
140
|
-
: (
|
|
141
|
-
state.minMaxDiff.value === 0 ? 0 : (model.value - props.min) / state.minMaxDiff.value
|
|
142
|
-
)
|
|
112
|
+
: methods.convertModelToRatio(model.value)
|
|
143
113
|
}
|
|
144
114
|
|
|
145
115
|
function onFocus () {
|
|
@@ -159,82 +129,26 @@ export default createComponent({
|
|
|
159
129
|
|
|
160
130
|
model.value = between(
|
|
161
131
|
parseFloat((model.value + offset).toFixed(state.decimals.value)),
|
|
162
|
-
|
|
163
|
-
|
|
132
|
+
state.innerMin.value,
|
|
133
|
+
state.innerMax.value
|
|
164
134
|
)
|
|
165
135
|
|
|
166
136
|
updateValue()
|
|
167
137
|
}
|
|
168
138
|
|
|
169
139
|
return () => {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (props.label === true || props.labelAlways === true) {
|
|
176
|
-
child.push(
|
|
177
|
-
h('div', {
|
|
178
|
-
class: `q-slider__pin q-slider__pin${ state.axis.value } absolute ` + pinClass.value,
|
|
179
|
-
style: pinStyle.value.pin
|
|
180
|
-
}, [
|
|
181
|
-
h('div', {
|
|
182
|
-
class: `q-slider__pin-text-container q-slider__pin-text-container${ state.axis.value }`,
|
|
183
|
-
style: pinStyle.value.pinTextContainer
|
|
184
|
-
}, [
|
|
185
|
-
h('span', {
|
|
186
|
-
class: 'q-slider__pin-text ' + pinTextClass.value
|
|
187
|
-
}, [
|
|
188
|
-
label.value
|
|
189
|
-
])
|
|
190
|
-
])
|
|
191
|
-
]),
|
|
192
|
-
|
|
193
|
-
h('div', {
|
|
194
|
-
class: `q-slider__arrow q-slider__arrow${ state.axis.value } ${ pinClass.value }`
|
|
195
|
-
})
|
|
196
|
-
)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (props.name !== void 0 && props.disable !== true) {
|
|
200
|
-
injectFormInput(child, 'push')
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const track = [
|
|
204
|
-
h('div', {
|
|
205
|
-
class: `q-slider__track q-slider__track${ state.axis.value } absolute`,
|
|
206
|
-
style: trackStyle.value
|
|
207
|
-
})
|
|
208
|
-
]
|
|
209
|
-
|
|
210
|
-
props.markers !== false && track.push(
|
|
211
|
-
h('div', {
|
|
212
|
-
class: `q-slider__track-markers q-slider__track-markers${ state.axis.value } absolute-full fit`,
|
|
213
|
-
style: state.markerStyle.value
|
|
214
|
-
})
|
|
140
|
+
const content = methods.getContent(
|
|
141
|
+
selectionBarStyle,
|
|
142
|
+
events,
|
|
143
|
+
node => { node.push(getThumb()) }
|
|
215
144
|
)
|
|
216
145
|
|
|
217
|
-
|
|
218
|
-
h('div', {
|
|
219
|
-
class: `q-slider__track-container q-slider__track-container${ state.axis.value } absolute`
|
|
220
|
-
}, track),
|
|
221
|
-
|
|
222
|
-
h('div', {
|
|
223
|
-
class: `q-slider__thumb-container q-slider__thumb-container${ state.axis.value } absolute non-selectable` + thumbClass.value,
|
|
224
|
-
style: thumbStyle.value
|
|
225
|
-
}, child)
|
|
226
|
-
]
|
|
227
|
-
|
|
228
|
-
const data = {
|
|
146
|
+
return h('div', {
|
|
229
147
|
ref: rootRef,
|
|
230
148
|
class: state.classes.value + (props.modelValue === null ? ' q-slider--no-value' : ''),
|
|
231
149
|
...state.attributes.value,
|
|
232
|
-
'aria-valuenow': props.modelValue
|
|
233
|
-
|
|
234
|
-
...events.value
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return hDir('div', data, content, 'slide', state.editable.value, () => state.panDirective.value)
|
|
150
|
+
'aria-valuenow': props.modelValue
|
|
151
|
+
}, content)
|
|
238
152
|
}
|
|
239
153
|
}
|
|
240
154
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mixins": [ "
|
|
2
|
+
"mixins": [ "components/slider/use-slider" ],
|
|
3
3
|
|
|
4
4
|
"meta": {
|
|
5
5
|
"docsUrl": "https://v2.quasar.dev/vue-components/slider"
|
|
@@ -13,60 +13,6 @@
|
|
|
13
13
|
"examples": [ "v-model=\"positionModel\"" ]
|
|
14
14
|
},
|
|
15
15
|
|
|
16
|
-
"min": {
|
|
17
|
-
"type": "Number",
|
|
18
|
-
"desc": "Minimum value of the model",
|
|
19
|
-
"default": 0,
|
|
20
|
-
"examples": [ ":min=\"0\"" ],
|
|
21
|
-
"category": "model"
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
"max": {
|
|
25
|
-
"type": "Number",
|
|
26
|
-
"desc": "Maximum value of the model",
|
|
27
|
-
"default": 100,
|
|
28
|
-
"examples": [ ":max=\"100\"" ],
|
|
29
|
-
"category": "model"
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"step": {
|
|
33
|
-
"type": "Number",
|
|
34
|
-
"desc": "Specify step amount between valid values (> 0.0); When step equals to 0 it defines infinite granularity",
|
|
35
|
-
"default": 1,
|
|
36
|
-
"examples": [ ":step=\"1\"" ],
|
|
37
|
-
"category": "model"
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
"reverse": {
|
|
41
|
-
"type": "Boolean",
|
|
42
|
-
"desc": "Work in reverse (changes direction)",
|
|
43
|
-
"category": "behavior"
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
"vertical": {
|
|
47
|
-
"type": "Boolean",
|
|
48
|
-
"desc": "Display in vertical direction",
|
|
49
|
-
"category": "behavior"
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
"color": {
|
|
53
|
-
"extends": "color"
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
"label": {
|
|
57
|
-
"type": "Boolean",
|
|
58
|
-
"desc": "Popup a label when user clicks/taps on the slider thumb and moves it",
|
|
59
|
-
"category": "content"
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
"label-color": {
|
|
63
|
-
"extends": "color"
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
"label-text-color": {
|
|
67
|
-
"extends": "color"
|
|
68
|
-
},
|
|
69
|
-
|
|
70
16
|
"label-value": {
|
|
71
17
|
"type": [ "String", "Number" ],
|
|
72
18
|
"desc": "Override default label value",
|
|
@@ -74,56 +20,6 @@
|
|
|
74
20
|
":label-value=\"model + 'px'\""
|
|
75
21
|
],
|
|
76
22
|
"category": "content"
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
"label-always": {
|
|
80
|
-
"type": "Boolean",
|
|
81
|
-
"desc": "Always display the label",
|
|
82
|
-
"category": "behavior|content"
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
"markers": {
|
|
86
|
-
"type": [ "Boolean", "Number" ],
|
|
87
|
-
"desc": "Display markers on the track, one for each possible value for the model or using a custom step (when specifying a Number)",
|
|
88
|
-
"category": "content",
|
|
89
|
-
"examples": [
|
|
90
|
-
"markers",
|
|
91
|
-
":markers=\"5\""
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
"snap": {
|
|
96
|
-
"type": "Boolean",
|
|
97
|
-
"desc": "Snap on valid values, rather than sliding freely; Suggestion: use with 'step' prop",
|
|
98
|
-
"category": "behavior"
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
"thumb-path": {
|
|
102
|
-
"type": "String",
|
|
103
|
-
"desc": "Set custom thumb svg path",
|
|
104
|
-
"default": "M 4, 10 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0",
|
|
105
|
-
"examples": [ "M5 5 h10 v10 h-10 v-10" ],
|
|
106
|
-
"category": "style"
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
"dark": {
|
|
110
|
-
"extends": "dark"
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
"dense": {
|
|
114
|
-
"extends": "dense"
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
"disable": {
|
|
118
|
-
"extends": "disable"
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
"readonly": {
|
|
122
|
-
"extends": "readonly"
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
"tabindex": {
|
|
126
|
-
"extends": "tabindex"
|
|
127
23
|
}
|
|
128
24
|
},
|
|
129
25
|
|
|
@@ -135,22 +31,6 @@
|
|
|
135
31
|
"type": [ "Number", "null" ]
|
|
136
32
|
}
|
|
137
33
|
}
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
"change": {
|
|
141
|
-
"extends": "update:model-value",
|
|
142
|
-
"desc": "Emitted on lazy model value change (after user slides then releases the thumb)"
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
"pan": {
|
|
146
|
-
"desc": "Triggered when user starts panning on the component",
|
|
147
|
-
"params": {
|
|
148
|
-
"phase": {
|
|
149
|
-
"type": "String",
|
|
150
|
-
"desc": "Phase of panning",
|
|
151
|
-
"values": [ "start", "end" ]
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
34
|
}
|
|
155
35
|
}
|
|
156
36
|
}
|