quasar 2.2.3 → 2.3.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/BottomSheet.json +17 -2
- package/dist/api/Dialog.json +17 -2
- package/dist/api/LocalStorage.json +8 -0
- package/dist/api/QCircularProgress.json +14 -0
- package/dist/api/QDate.json +46 -0
- package/dist/api/QEditor.json +7 -2
- package/dist/api/QFooter.json +1 -1
- package/dist/api/QHeader.json +1 -1
- package/dist/api/QIntersection.json +14 -0
- package/dist/api/QLinearProgress.json +14 -0
- package/dist/api/QRouteTab.json +1 -24
- package/dist/api/QScrollArea.json +3 -0
- package/dist/api/QSelect.json +62 -0
- package/dist/api/QSkeleton.json +1 -1
- package/dist/api/QTable.json +62 -5
- package/dist/api/QTree.json +6 -0
- package/dist/api/QUploader.json +81 -1
- package/dist/api/SessionStorage.json +8 -0
- 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 +6 -0
- 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 +57 -3
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +124 -3
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +47 -5
- package/dist/quasar.umd.js +206 -125
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/types/composables.d.ts +5 -1
- package/dist/types/extras/icon-set.d.ts +1 -0
- package/dist/types/index.d.ts +374 -141
- package/dist/vetur/quasar-attributes.json +18 -2
- package/dist/vetur/quasar-tags.json +6 -2
- package/dist/web-types/web-types.json +44 -3
- package/icon-set/svg-ionicons-v6.js +225 -0
- package/package.json +5 -2
- package/src/api.extends.json +7 -0
- package/src/body.js +14 -4
- package/src/components/circular-progress/QCircularProgress.js +6 -1
- package/src/components/circular-progress/QCircularProgress.json +6 -0
- package/src/components/date/QDate.json +34 -0
- package/src/components/editor/QEditor.js +2 -2
- package/src/components/editor/QEditor.json +6 -2
- package/src/components/footer/QFooter.json +1 -1
- package/src/components/header/QHeader.json +1 -1
- package/src/components/icon/QIcon.js +1 -1
- package/src/components/infinite-scroll/QInfiniteScroll.js +48 -31
- package/src/components/intersection/QIntersection.js +9 -1
- package/src/components/intersection/QIntersection.json +9 -0
- package/src/components/linear-progress/QLinearProgress.js +10 -1
- package/src/components/linear-progress/QLinearProgress.json +6 -0
- package/src/components/linear-progress/QLinearProgress.sass +2 -1
- package/src/components/popup-proxy/QPopupProxy.js +6 -15
- package/src/components/scroll-area/QScrollArea.js +1 -1
- package/src/components/scroll-area/QScrollArea.json +4 -1
- package/src/components/select/QSelect.js +15 -21
- package/src/components/select/QSelect.json +47 -0
- package/src/components/skeleton/QSkeleton.json +1 -4
- package/src/components/slider/use-slider.js +3 -3
- package/src/components/table/QTable.json +51 -5
- package/src/components/table/table-pagination.js +2 -2
- package/src/components/tabs/QRouteTab.json +1 -23
- package/src/components/tabs/QTabs.js +1 -1
- package/src/components/time/QTime.js +6 -5
- package/src/components/tree/QTree.js +9 -5
- package/src/components/tree/QTree.json +5 -0
- package/src/components/tree/QTree.sass +52 -4
- package/src/components/uploader/uploader-core.js +2 -7
- package/src/components/uploader/xhr-uploader-plugin.json +97 -1
- package/src/components/virtual-scroll/use-virtual-scroll.js +17 -1
- package/src/composables/private/use-field.js +4 -4
- package/src/composables/private/use-file.js +8 -0
- package/src/composables/private/use-model-toggle.js +1 -1
- package/src/composables/private/use-refocus-target.js +12 -3
- package/src/composables/private/use-split-attrs.js +7 -1
- package/src/composables/use-dialog-plugin-component.js +7 -1
- package/src/css/core/transitions.sass +3 -1
- package/src/install-quasar.js +1 -0
- package/src/utils/create-uploader-component.js +6 -4
- package/src/utils/date.js +1 -1
- package/src/utils/private/get-emits-object.js +11 -0
- package/src/utils/private/global-dialog.json +10 -2
- package/src/utils/private/vm.js +3 -3
- package/src/utils/private/web-storage.json +10 -0
- package/wrappers/index.js +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, computed, watch, onMounted, onBeforeUnmount, nextTick, getCurrentInstance } from 'vue'
|
|
1
|
+
import { h, ref, computed, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, nextTick, getCurrentInstance } from 'vue'
|
|
2
2
|
|
|
3
3
|
import { createComponent } from '../../utils/private/create.js'
|
|
4
4
|
import debounce from '../../utils/debounce.js'
|
|
@@ -7,6 +7,8 @@ import { getScrollTarget, getScrollHeight, getVerticalScrollPosition, setVertica
|
|
|
7
7
|
import { listenOpts } from '../../utils/event.js'
|
|
8
8
|
import { hSlot, hUniqueSlot } from '../../utils/private/render.js'
|
|
9
9
|
|
|
10
|
+
const { passive } = listenOpts
|
|
11
|
+
|
|
10
12
|
export default createComponent({
|
|
11
13
|
name: 'QInfiniteScroll',
|
|
12
14
|
|
|
@@ -34,20 +36,21 @@ export default createComponent({
|
|
|
34
36
|
emits: [ 'load' ],
|
|
35
37
|
|
|
36
38
|
setup (props, { slots, emit }) {
|
|
37
|
-
const
|
|
39
|
+
const isFetching = ref(false)
|
|
40
|
+
const isWorking = ref(true)
|
|
38
41
|
const rootRef = ref(null)
|
|
39
42
|
|
|
40
43
|
let index = props.initialIndex || 0
|
|
41
|
-
let
|
|
44
|
+
let scrollPos = false
|
|
42
45
|
let localScrollTarget, poll
|
|
43
46
|
|
|
44
47
|
const classes = computed(() =>
|
|
45
48
|
'q-infinite-scroll__loading'
|
|
46
|
-
+ (
|
|
49
|
+
+ (isFetching.value === true ? '' : ' invisible')
|
|
47
50
|
)
|
|
48
51
|
|
|
49
52
|
function immediatePoll () {
|
|
50
|
-
if (props.disable === true ||
|
|
53
|
+
if (props.disable === true || isFetching.value === true || isWorking.value === false) {
|
|
51
54
|
return
|
|
52
55
|
}
|
|
53
56
|
|
|
@@ -69,18 +72,18 @@ export default createComponent({
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
function trigger () {
|
|
72
|
-
if (props.disable === true ||
|
|
75
|
+
if (props.disable === true || isFetching.value === true || isWorking.value === false) {
|
|
73
76
|
return
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
index++
|
|
77
|
-
|
|
80
|
+
isFetching.value = true
|
|
78
81
|
|
|
79
82
|
const heightBefore = getScrollHeight(localScrollTarget)
|
|
80
83
|
|
|
81
84
|
emit('load', index, isDone => {
|
|
82
|
-
if (isWorking === true) {
|
|
83
|
-
|
|
85
|
+
if (isWorking.value === true) {
|
|
86
|
+
isFetching.value = false
|
|
84
87
|
nextTick(() => {
|
|
85
88
|
if (props.reverse === true) {
|
|
86
89
|
const
|
|
@@ -107,31 +110,31 @@ export default createComponent({
|
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
function resume () {
|
|
110
|
-
if (isWorking === false) {
|
|
111
|
-
isWorking = true
|
|
112
|
-
localScrollTarget.addEventListener('scroll', poll,
|
|
113
|
+
if (isWorking.value === false) {
|
|
114
|
+
isWorking.value = true
|
|
115
|
+
localScrollTarget.addEventListener('scroll', poll, passive)
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
immediatePoll()
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
function stop () {
|
|
119
|
-
if (isWorking === true) {
|
|
120
|
-
isWorking = false
|
|
121
|
-
|
|
122
|
-
localScrollTarget.removeEventListener('scroll', poll,
|
|
122
|
+
if (isWorking.value === true) {
|
|
123
|
+
isWorking.value = false
|
|
124
|
+
isFetching.value = false
|
|
125
|
+
localScrollTarget.removeEventListener('scroll', poll, passive)
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
function updateScrollTarget () {
|
|
127
|
-
if (localScrollTarget && isWorking === true) {
|
|
128
|
-
localScrollTarget.removeEventListener('scroll', poll,
|
|
130
|
+
if (localScrollTarget && isWorking.value === true) {
|
|
131
|
+
localScrollTarget.removeEventListener('scroll', poll, passive)
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
localScrollTarget = getScrollTarget(rootRef.value, props.scrollTarget)
|
|
132
135
|
|
|
133
|
-
if (isWorking === true) {
|
|
134
|
-
localScrollTarget.addEventListener('scroll', poll,
|
|
136
|
+
if (isWorking.value === true) {
|
|
137
|
+
localScrollTarget.addEventListener('scroll', poll, passive)
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
|
|
@@ -155,30 +158,44 @@ export default createComponent({
|
|
|
155
158
|
? immediatePoll
|
|
156
159
|
: debounce(immediatePoll, isNaN(val) === true ? 100 : val)
|
|
157
160
|
|
|
158
|
-
if (localScrollTarget && isWorking === true) {
|
|
161
|
+
if (localScrollTarget && isWorking.value === true) {
|
|
159
162
|
if (oldPoll !== void 0) {
|
|
160
|
-
localScrollTarget.removeEventListener('scroll', oldPoll,
|
|
163
|
+
localScrollTarget.removeEventListener('scroll', oldPoll, passive)
|
|
161
164
|
}
|
|
162
165
|
|
|
163
|
-
localScrollTarget.addEventListener('scroll', poll,
|
|
166
|
+
localScrollTarget.addEventListener('scroll', poll, passive)
|
|
164
167
|
}
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
watch(() => props.disable, val => {
|
|
168
|
-
if (val === true) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
if (val === true) { stop() }
|
|
172
|
+
else { resume() }
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
watch(() => props.reverse, val => {
|
|
176
|
+
if (isFetching.value === false && isWorking.value === true) {
|
|
177
|
+
immediatePoll()
|
|
173
178
|
}
|
|
174
179
|
})
|
|
175
180
|
|
|
176
181
|
watch(() => props.scrollTarget, updateScrollTarget)
|
|
177
182
|
watch(() => props.debounce, setDebounce)
|
|
178
183
|
|
|
184
|
+
onActivated(() => {
|
|
185
|
+
if (localScrollTarget && scrollPos !== false) {
|
|
186
|
+
setVerticalScrollPosition(localScrollTarget, scrollPos)
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
onDeactivated(() => {
|
|
191
|
+
scrollPos = localScrollTarget
|
|
192
|
+
? getVerticalScrollPosition(localScrollTarget)
|
|
193
|
+
: false
|
|
194
|
+
})
|
|
195
|
+
|
|
179
196
|
onBeforeUnmount(() => {
|
|
180
|
-
if (isWorking === true) {
|
|
181
|
-
localScrollTarget.removeEventListener('scroll', poll,
|
|
197
|
+
if (isWorking.value === true) {
|
|
198
|
+
localScrollTarget.removeEventListener('scroll', poll, passive)
|
|
182
199
|
}
|
|
183
200
|
})
|
|
184
201
|
|
|
@@ -201,7 +218,7 @@ export default createComponent({
|
|
|
201
218
|
return () => {
|
|
202
219
|
const child = hUniqueSlot(slots.default, [])
|
|
203
220
|
|
|
204
|
-
if (props.disable !== true && isWorking === true) {
|
|
221
|
+
if (props.disable !== true && isWorking.value === true) {
|
|
205
222
|
child[ props.reverse === false ? 'push' : 'unshift' ](
|
|
206
223
|
h('div', { class: classes.value }, hSlot(slots.loading))
|
|
207
224
|
)
|
|
@@ -18,6 +18,10 @@ export default createComponent({
|
|
|
18
18
|
|
|
19
19
|
once: Boolean,
|
|
20
20
|
transition: String,
|
|
21
|
+
transitionDuration: {
|
|
22
|
+
type: [ String, Number ],
|
|
23
|
+
default: 300
|
|
24
|
+
},
|
|
21
25
|
|
|
22
26
|
ssrPrerender: Boolean,
|
|
23
27
|
|
|
@@ -63,6 +67,10 @@ export default createComponent({
|
|
|
63
67
|
] ]
|
|
64
68
|
})
|
|
65
69
|
|
|
70
|
+
const transitionStyle = computed(
|
|
71
|
+
() => `--q-transition-duration: ${ props.transitionDuration }ms`
|
|
72
|
+
)
|
|
73
|
+
|
|
66
74
|
function trigger (entry) {
|
|
67
75
|
if (showing.value !== entry.isIntersecting) {
|
|
68
76
|
showing.value = entry.isIntersecting
|
|
@@ -72,7 +80,7 @@ export default createComponent({
|
|
|
72
80
|
|
|
73
81
|
function getContent () {
|
|
74
82
|
return showing.value === true
|
|
75
|
-
? [ h('div', { key: 'content' }, hSlot(slots.default)) ]
|
|
83
|
+
? [ h('div', { key: 'content', style: transitionStyle.value }, hSlot(slots.default)) ]
|
|
76
84
|
: void 0
|
|
77
85
|
}
|
|
78
86
|
|
|
@@ -51,6 +51,15 @@
|
|
|
51
51
|
"category": "behavior"
|
|
52
52
|
},
|
|
53
53
|
|
|
54
|
+
"transition-duration": {
|
|
55
|
+
"type": [ "String", "Number" ],
|
|
56
|
+
"desc": "Transition duration (in milliseconds, without unit)",
|
|
57
|
+
"default": 300,
|
|
58
|
+
"examples": [ 500, "1200" ],
|
|
59
|
+
"category": "behavior",
|
|
60
|
+
"addedIn": "v2.3.1"
|
|
61
|
+
},
|
|
62
|
+
|
|
54
63
|
"disable": {
|
|
55
64
|
"type": "Boolean",
|
|
56
65
|
"desc": "Disable visibility observable (content will remain as it was, visible or hidden)",
|
|
@@ -44,6 +44,11 @@ export default createComponent({
|
|
|
44
44
|
query: Boolean,
|
|
45
45
|
rounded: Boolean,
|
|
46
46
|
|
|
47
|
+
animationSpeed: {
|
|
48
|
+
type: [ String, Number ],
|
|
49
|
+
default: 2100
|
|
50
|
+
},
|
|
51
|
+
|
|
47
52
|
instantFeedback: Boolean
|
|
48
53
|
},
|
|
49
54
|
|
|
@@ -53,6 +58,10 @@ export default createComponent({
|
|
|
53
58
|
const sizeStyle = useSize(props, defaultSizes)
|
|
54
59
|
|
|
55
60
|
const motion = computed(() => props.indeterminate === true || props.query === true)
|
|
61
|
+
const style = computed(() => ({
|
|
62
|
+
...(sizeStyle.value !== null ? sizeStyle.value : {}),
|
|
63
|
+
'--q-linear-progress-speed': `${ props.animationSpeed }ms`
|
|
64
|
+
}))
|
|
56
65
|
|
|
57
66
|
const classes = computed(() =>
|
|
58
67
|
'q-linear-progress'
|
|
@@ -103,7 +112,7 @@ export default createComponent({
|
|
|
103
112
|
|
|
104
113
|
return h('div', {
|
|
105
114
|
class: classes.value,
|
|
106
|
-
style:
|
|
115
|
+
style: style.value,
|
|
107
116
|
role: 'progressbar',
|
|
108
117
|
'aria-valuemin': 0,
|
|
109
118
|
'aria-valuemax': 1,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.q-linear-progress
|
|
2
|
+
--q-linear-progress-speed: .3s
|
|
2
3
|
position: relative
|
|
3
4
|
width: 100%
|
|
4
5
|
overflow: hidden
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
transform-origin: 0 0
|
|
11
12
|
|
|
12
13
|
&--with-transition
|
|
13
|
-
transition: transform
|
|
14
|
+
transition: transform var(--q-linear-progress-speed)
|
|
14
15
|
|
|
15
16
|
&--reverse
|
|
16
17
|
.q-linear-progress
|
|
@@ -6,7 +6,6 @@ import QMenu from '../menu/QMenu.js'
|
|
|
6
6
|
import useAnchor, { useAnchorProps } from '../../composables/private/use-anchor.js'
|
|
7
7
|
|
|
8
8
|
import { createComponent } from '../../utils/private/create.js'
|
|
9
|
-
import { hSlot } from '../../utils/private/render.js'
|
|
10
9
|
|
|
11
10
|
export default createComponent({
|
|
12
11
|
name: 'QPopupProxy',
|
|
@@ -40,6 +39,10 @@ export default createComponent({
|
|
|
40
39
|
|
|
41
40
|
const type = ref(getType())
|
|
42
41
|
|
|
42
|
+
const popupProps = computed(() => (
|
|
43
|
+
type.value === 'menu' ? { maxHeight: '99vh' } : {})
|
|
44
|
+
)
|
|
45
|
+
|
|
43
46
|
watch(() => getType(), val => {
|
|
44
47
|
if (showing.value !== true) {
|
|
45
48
|
type.value = val
|
|
@@ -65,21 +68,9 @@ export default createComponent({
|
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
return () => {
|
|
68
|
-
const def = hSlot(slots.default)
|
|
69
|
-
|
|
70
|
-
const popupProps = (
|
|
71
|
-
type.value === 'menu'
|
|
72
|
-
&& def !== void 0
|
|
73
|
-
&& def[ 0 ] !== void 0
|
|
74
|
-
&& def[ 0 ].type !== void 0
|
|
75
|
-
&& [ 'QDate', 'QTime', 'QCarousel', 'QColor' ].includes(
|
|
76
|
-
def[ 0 ].type.name
|
|
77
|
-
)
|
|
78
|
-
) ? { cover: true, maxHeight: '99vh' } : {}
|
|
79
|
-
|
|
80
71
|
const data = {
|
|
81
72
|
ref: popupRef,
|
|
82
|
-
...popupProps,
|
|
73
|
+
...popupProps.value,
|
|
83
74
|
...attrs,
|
|
84
75
|
onShow,
|
|
85
76
|
onHide
|
|
@@ -100,7 +91,7 @@ export default createComponent({
|
|
|
100
91
|
})
|
|
101
92
|
}
|
|
102
93
|
|
|
103
|
-
return h(component, data,
|
|
94
|
+
return h(component, data, slots.default)
|
|
104
95
|
}
|
|
105
96
|
}
|
|
106
97
|
})
|
|
@@ -173,7 +173,7 @@ export default createComponent({
|
|
|
173
173
|
)
|
|
174
174
|
|
|
175
175
|
const mainStyle = computed(() => (
|
|
176
|
-
scroll.vertical.thumbHidden.value === true
|
|
176
|
+
scroll.vertical.thumbHidden.value === true && scroll.horizontal.thumbHidden.value === true
|
|
177
177
|
? props.contentStyle
|
|
178
178
|
: props.contentActiveStyle
|
|
179
179
|
))
|
|
@@ -95,13 +95,14 @@
|
|
|
95
95
|
"params": {
|
|
96
96
|
"info": {
|
|
97
97
|
"type": "Object",
|
|
98
|
-
"
|
|
98
|
+
"desc": "An object containing scroll information",
|
|
99
99
|
"definition": {
|
|
100
100
|
"ref": {
|
|
101
101
|
"type": "Object",
|
|
102
102
|
"desc": "Vue reference to the QScrollArea which triggered the event",
|
|
103
103
|
"__exemption": [ "examples" ]
|
|
104
104
|
},
|
|
105
|
+
|
|
105
106
|
"verticalPosition": {
|
|
106
107
|
"type": "Number",
|
|
107
108
|
"desc": "Vertical scroll position (in px)",
|
|
@@ -215,6 +216,7 @@
|
|
|
215
216
|
"desc": "Get current scroll position",
|
|
216
217
|
"returns": {
|
|
217
218
|
"type": "Object",
|
|
219
|
+
"desc": "An object containing scroll position information",
|
|
218
220
|
"definition": {
|
|
219
221
|
"top": {
|
|
220
222
|
"type": "Number",
|
|
@@ -235,6 +237,7 @@
|
|
|
235
237
|
"desc": "Get current scroll position in percentage (0.0 <= x <= 1.0)",
|
|
236
238
|
"returns": {
|
|
237
239
|
"type": "Object",
|
|
240
|
+
"desc": "An object containing scroll position information in percentage",
|
|
238
241
|
"definition": {
|
|
239
242
|
"top": {
|
|
240
243
|
"type": "Number",
|
|
@@ -933,6 +933,12 @@ export default createComponent({
|
|
|
933
933
|
}
|
|
934
934
|
|
|
935
935
|
function getAllOptions () {
|
|
936
|
+
if (noOptions.value === true) {
|
|
937
|
+
return slots[ 'no-option' ] !== void 0
|
|
938
|
+
? slots[ 'no-option' ]({ inputValue: inputValue.value })
|
|
939
|
+
: void 0
|
|
940
|
+
}
|
|
941
|
+
|
|
936
942
|
const fn = slots.option !== void 0
|
|
937
943
|
? slots.option
|
|
938
944
|
: scope => {
|
|
@@ -1114,14 +1120,6 @@ export default createComponent({
|
|
|
1114
1120
|
}
|
|
1115
1121
|
|
|
1116
1122
|
function getMenu () {
|
|
1117
|
-
const child = noOptions.value === true
|
|
1118
|
-
? (
|
|
1119
|
-
slots[ 'no-option' ] !== void 0
|
|
1120
|
-
? () => slots[ 'no-option' ]({ inputValue: inputValue.value })
|
|
1121
|
-
: void 0
|
|
1122
|
-
)
|
|
1123
|
-
: getAllOptions
|
|
1124
|
-
|
|
1125
1123
|
return h(QMenu, {
|
|
1126
1124
|
ref: menuRef,
|
|
1127
1125
|
class: menuContentClass.value,
|
|
@@ -1146,7 +1144,7 @@ export default createComponent({
|
|
|
1146
1144
|
onBeforeShow: onControlPopupShow,
|
|
1147
1145
|
onBeforeHide: onMenuBeforeHide,
|
|
1148
1146
|
onShow: onMenuShow
|
|
1149
|
-
},
|
|
1147
|
+
}, getAllOptions)
|
|
1150
1148
|
}
|
|
1151
1149
|
|
|
1152
1150
|
function onMenuBeforeHide (e) {
|
|
@@ -1175,7 +1173,7 @@ export default createComponent({
|
|
|
1175
1173
|
function getDialog () {
|
|
1176
1174
|
const content = [
|
|
1177
1175
|
h(QField, {
|
|
1178
|
-
class: `col-auto ${ state.fieldClass }`,
|
|
1176
|
+
class: `col-auto ${ state.fieldClass.value }`,
|
|
1179
1177
|
...innerFieldProps.value,
|
|
1180
1178
|
for: state.targetUid.value,
|
|
1181
1179
|
dark: isOptionsDark.value,
|
|
@@ -1203,15 +1201,7 @@ export default createComponent({
|
|
|
1203
1201
|
...listboxAttrs.value,
|
|
1204
1202
|
onClick: prevent,
|
|
1205
1203
|
onScrollPassive: onVirtualScrollEvt
|
|
1206
|
-
}, (
|
|
1207
|
-
noOptions.value === true
|
|
1208
|
-
? (
|
|
1209
|
-
slots[ 'no-option' ] !== void 0
|
|
1210
|
-
? slots[ 'no-option' ]({ inputValue: inputValue.value })
|
|
1211
|
-
: null
|
|
1212
|
-
)
|
|
1213
|
-
: getAllOptions()
|
|
1214
|
-
))
|
|
1204
|
+
}, getAllOptions())
|
|
1215
1205
|
)
|
|
1216
1206
|
|
|
1217
1207
|
return h(QDialog, {
|
|
@@ -1349,14 +1339,14 @@ export default createComponent({
|
|
|
1349
1339
|
function onControlPopupShow (e) {
|
|
1350
1340
|
e !== void 0 && stop(e)
|
|
1351
1341
|
emit('popup-show', e)
|
|
1352
|
-
state.hasPopupOpen
|
|
1342
|
+
state.hasPopupOpen = true
|
|
1353
1343
|
state.onControlFocusin(e)
|
|
1354
1344
|
}
|
|
1355
1345
|
|
|
1356
1346
|
function onControlPopupHide (e) {
|
|
1357
1347
|
e !== void 0 && stop(e)
|
|
1358
1348
|
emit('popup-hide', e)
|
|
1359
|
-
state.hasPopupOpen
|
|
1349
|
+
state.hasPopupOpen = false
|
|
1360
1350
|
state.onControlFocusout(e)
|
|
1361
1351
|
}
|
|
1362
1352
|
|
|
@@ -1428,6 +1418,10 @@ export default createComponent({
|
|
|
1428
1418
|
) {
|
|
1429
1419
|
return hasDialog === true ? getDialog() : getMenu()
|
|
1430
1420
|
}
|
|
1421
|
+
else if (state.hasPopupOpen === true) {
|
|
1422
|
+
// explicitly set it otherwise TAB will not blur component
|
|
1423
|
+
state.hasPopupOpen = false
|
|
1424
|
+
}
|
|
1431
1425
|
},
|
|
1432
1426
|
|
|
1433
1427
|
controlEvents: {
|
|
@@ -47,6 +47,22 @@
|
|
|
47
47
|
"type": [ "Function", "String" ],
|
|
48
48
|
"desc": "Property of option which holds the 'value'; If using a function then for best performance, reference it from your scope and do not define it inline",
|
|
49
49
|
"default": "value",
|
|
50
|
+
"params": {
|
|
51
|
+
"option": {
|
|
52
|
+
"type": [ "String", "Object" ],
|
|
53
|
+
"desc": "The current option being processed",
|
|
54
|
+
"examples": [
|
|
55
|
+
"'BMW'",
|
|
56
|
+
"'Samsung Phone'",
|
|
57
|
+
"{ label: 'BMW', value: 'car', cannotSelect: true }"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"returns": {
|
|
62
|
+
"type": "Any",
|
|
63
|
+
"desc": "Value of the current option",
|
|
64
|
+
"examples": [ "'car'", "34" ]
|
|
65
|
+
},
|
|
50
66
|
"examples": [
|
|
51
67
|
"option-value=\"modelNumber\"",
|
|
52
68
|
":option-value=\"(item) => item === null ? null : item.modelNumber\""
|
|
@@ -58,6 +74,22 @@
|
|
|
58
74
|
"type": [ "Function", "String" ],
|
|
59
75
|
"desc": "Property of option which holds the 'label'; If using a function then for best performance, reference it from your scope and do not define it inline",
|
|
60
76
|
"default": "label",
|
|
77
|
+
"params": {
|
|
78
|
+
"option": {
|
|
79
|
+
"type": [ "String", "Object" ],
|
|
80
|
+
"desc": "The current option being processed",
|
|
81
|
+
"examples": [
|
|
82
|
+
"'BMW'",
|
|
83
|
+
"'Samsung Phone'",
|
|
84
|
+
"{ label: 'BMW', value: 'car', cannotSelect: true }"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"returns": {
|
|
89
|
+
"type": "String",
|
|
90
|
+
"desc": "Label of the current option",
|
|
91
|
+
"examples": [ "'BMW'", "'Samsung Phone'" ]
|
|
92
|
+
},
|
|
61
93
|
"examples": [
|
|
62
94
|
"option-label=\"itemName\"",
|
|
63
95
|
":option-label=\"(item) => item === null ? 'Null value' : item.itemName\""
|
|
@@ -69,6 +101,21 @@
|
|
|
69
101
|
"type": [ "Function", "String" ],
|
|
70
102
|
"desc": "Property of option which tells it's disabled; The value of the property must be a Boolean; If using a function then for best performance, reference it from your scope and do not define it inline",
|
|
71
103
|
"default": "disable",
|
|
104
|
+
"params": {
|
|
105
|
+
"option": {
|
|
106
|
+
"type": [ "String", "Object" ],
|
|
107
|
+
"desc": "The current option being processed",
|
|
108
|
+
"examples": [
|
|
109
|
+
"'BMW'",
|
|
110
|
+
"'Samsung Phone'",
|
|
111
|
+
"{ label: 'BMW', value: 'car', cannotSelect: true }"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"returns": {
|
|
116
|
+
"type": "Boolean",
|
|
117
|
+
"desc": "If true, the current option will be disabled"
|
|
118
|
+
},
|
|
72
119
|
"examples": [
|
|
73
120
|
"option-disable=\"cannotSelect\"",
|
|
74
121
|
":option-disable=\"(item) => item === null ? true : item.cannotSelect\""
|
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
"animation-speed": {
|
|
36
|
-
"
|
|
37
|
-
"desc": "Animation speed (in milliseconds, without unit)",
|
|
36
|
+
"extends": "animation-speed",
|
|
38
37
|
"default": 300,
|
|
39
|
-
"examples": [ 500, "1200" ],
|
|
40
|
-
"category": "style",
|
|
41
38
|
"addedIn": "v2.2"
|
|
42
39
|
},
|
|
43
40
|
|
|
@@ -210,7 +210,7 @@ export default function ({ updateValue, updatePosition, getDragging }) {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
function onPan (event) {
|
|
213
|
-
if (event.isFinal) {
|
|
213
|
+
if (event.isFinal === true) {
|
|
214
214
|
if (dragging.value !== void 0) {
|
|
215
215
|
updatePosition(event.evt)
|
|
216
216
|
// only if touch, because we also have mousedown/up:
|
|
@@ -220,7 +220,7 @@ export default function ({ updateValue, updatePosition, getDragging }) {
|
|
|
220
220
|
}
|
|
221
221
|
active.value = false
|
|
222
222
|
}
|
|
223
|
-
else if (event.isFirst) {
|
|
223
|
+
else if (event.isFirst === true) {
|
|
224
224
|
dragging.value = getDragging(event.evt)
|
|
225
225
|
updatePosition(event.evt)
|
|
226
226
|
updateValue()
|
|
@@ -250,7 +250,7 @@ export default function ({ updateValue, updatePosition, getDragging }) {
|
|
|
250
250
|
function onDeactivate () {
|
|
251
251
|
preventFocus.value = false
|
|
252
252
|
|
|
253
|
-
if (dragging.value ===
|
|
253
|
+
if (dragging.value === false) {
|
|
254
254
|
active.value = false
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -17,6 +17,18 @@
|
|
|
17
17
|
"type": [ "String", "Function" ],
|
|
18
18
|
"desc": "Property of each row that defines the unique key of each row (the result must be a primitive, not Object, Array, etc); The value of property must be string or a function taking a row and returning the desired (nested) key in the row; If supplying a function then for best performance, reference it from your scope and do not define it inline",
|
|
19
19
|
"default": "id",
|
|
20
|
+
"params": {
|
|
21
|
+
"row": {
|
|
22
|
+
"type": "Object",
|
|
23
|
+
"desc": "The current row being processed",
|
|
24
|
+
"examples": [ "{ name: 'Lorem Ipsum', price: 19 }" ]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"returns": {
|
|
28
|
+
"type": "Any",
|
|
29
|
+
"desc": "Current row's key",
|
|
30
|
+
"examples": [ "'34f39dda-6206-4071-a9df-4393aabe49ac'", "34" ]
|
|
31
|
+
},
|
|
20
32
|
"examples": [ "row-key=\"name\"", ":row-key=\"row => row.name\"" ],
|
|
21
33
|
"category": "general"
|
|
22
34
|
},
|
|
@@ -146,7 +158,19 @@
|
|
|
146
158
|
"type": [ "String", "Function" ],
|
|
147
159
|
"desc": "Row Object property to determine value for this column or function which maps to the required property",
|
|
148
160
|
"required": true,
|
|
149
|
-
"
|
|
161
|
+
"params": {
|
|
162
|
+
"row": {
|
|
163
|
+
"type": "Object",
|
|
164
|
+
"desc": "The current row being processed",
|
|
165
|
+
"examples": [ "{ name: 'Lorem Ipsum', prices: { active: 19, old: 25, list: 29 } }" ]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"returns": {
|
|
169
|
+
"type": "Any",
|
|
170
|
+
"desc": "Value for this column",
|
|
171
|
+
"examples": [ "19" ]
|
|
172
|
+
},
|
|
173
|
+
"examples": [ "name", "row => row.prices.active" ]
|
|
150
174
|
},
|
|
151
175
|
"required": {
|
|
152
176
|
"type": "Boolean",
|
|
@@ -228,17 +252,39 @@
|
|
|
228
252
|
"style": {
|
|
229
253
|
"type": [ "String", "Function" ],
|
|
230
254
|
"desc": "Style to apply on normal cells of the column",
|
|
255
|
+
"params": {
|
|
256
|
+
"row": {
|
|
257
|
+
"type": "Object",
|
|
258
|
+
"desc": "The current row being processed",
|
|
259
|
+
"examples": [ "{ name: 'Frozen Yogurt', calories: 159 }" ]
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"returns": {
|
|
263
|
+
"type": "String",
|
|
264
|
+
"__exemption": [ "desc", "examples" ]
|
|
265
|
+
},
|
|
231
266
|
"examples": [
|
|
232
|
-
"width: 500px",
|
|
233
|
-
"row => (row.calories % 2 === 0 ? 'width:10px' : 'font-size:2em')"
|
|
267
|
+
"'width: 500px'",
|
|
268
|
+
"row => (row.calories % 2 === 0 ? 'width: 10px' : 'font-size: 2em; font-weight: bold')"
|
|
234
269
|
]
|
|
235
270
|
},
|
|
236
271
|
"classes": {
|
|
237
272
|
"type": [ "String", "Function" ],
|
|
238
273
|
"desc": "Classes to add on normal cells of the column",
|
|
274
|
+
"params": {
|
|
275
|
+
"row": {
|
|
276
|
+
"type": "Object",
|
|
277
|
+
"desc": "The current row being processed",
|
|
278
|
+
"examples": [ "{ name: 'Frozen Yogurt', calories: 159 }" ]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"returns": {
|
|
282
|
+
"type": "String",
|
|
283
|
+
"__exemption": [ "desc", "examples" ]
|
|
284
|
+
},
|
|
239
285
|
"examples": [
|
|
240
|
-
"my-special-class",
|
|
241
|
-
"row => (row.calories % 2 === 0 ? 'bg-green' : 'bg-yellow')"
|
|
286
|
+
"'my-special-class bg-primary'",
|
|
287
|
+
"row => (row.calories % 2 === 0 ? 'bg-green text-white' : 'bg-yellow')"
|
|
242
288
|
]
|
|
243
289
|
},
|
|
244
290
|
"headerStyle": {
|
|
@@ -26,7 +26,7 @@ export const useTablePaginationProps = {
|
|
|
26
26
|
default: () => [ 5, 7, 10, 15, 20, 25, 50, 0 ]
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
-
'onUpdate:pagination': Function
|
|
29
|
+
'onUpdate:pagination': [ Function, Array ]
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function useTablePaginationState (vm, getCellValue) {
|
|
@@ -76,7 +76,7 @@ export function useTablePaginationState (vm, getCellValue) {
|
|
|
76
76
|
...val
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
if (samePagination(computedPagination.value, newPagination)) {
|
|
79
|
+
if (samePagination(computedPagination.value, newPagination) === true) {
|
|
80
80
|
if (isServerSide.value === true && forceServerRequest === true) {
|
|
81
81
|
sendServerRequest(newPagination)
|
|
82
82
|
}
|