quasar 2.4.4 → 2.4.8
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/LoadingBar.json +1 -1
- package/dist/api/QAjaxBar.json +23 -4
- package/dist/api/QRadio.json +3 -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 +2 -1
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +2 -1
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +3 -2
- package/dist/quasar.umd.js +157 -90
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/types/index.d.ts +9 -3
- package/dist/vetur/quasar-attributes.json +8 -4
- package/dist/vetur/quasar-tags.json +2 -1
- package/dist/web-types/web-types.json +15 -6
- package/package.json +1 -1
- package/src/components/ajax-bar/QAjaxBar.js +47 -26
- package/src/components/ajax-bar/QAjaxBar.json +22 -4
- package/src/components/breadcrumbs/QBreadcrumbs.js +3 -3
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +2 -2
- package/src/components/icon/QIcon.js +31 -32
- package/src/components/icon/QIcon.sass +2 -2
- package/src/components/layout/QLayout.js +50 -1
- package/src/components/pagination/QPagination.js +4 -4
- package/src/components/radio/QRadio.js +2 -6
- package/src/components/radio/QRadio.json +1 -1
- package/src/components/scroll-observer/QScrollObserver.js +12 -10
- package/src/css/core/visibility.sass +0 -1
- package/src/plugins/LoadingBar.json +1 -1
- package/src/utils/private/global-dialog.js +4 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -1155,14 +1155,20 @@ export interface QAjaxBarProps {
|
|
|
1155
1155
|
* Color name for component from the Quasar Color Palette
|
|
1156
1156
|
*/
|
|
1157
1157
|
color?: string | undefined;
|
|
1158
|
+
/**
|
|
1159
|
+
* Reverse direction of progress
|
|
1160
|
+
*/
|
|
1161
|
+
reverse?: boolean | undefined;
|
|
1158
1162
|
/**
|
|
1159
1163
|
* Skip Ajax hijacking (not a reactive prop)
|
|
1160
1164
|
*/
|
|
1161
1165
|
skipHijack?: boolean | undefined;
|
|
1162
1166
|
/**
|
|
1163
|
-
*
|
|
1167
|
+
* Filter which URL should trigger start() + stop()
|
|
1168
|
+
* @param url The URL being triggered
|
|
1169
|
+
* @returns Should the URL received as param trigger start() + stop()?
|
|
1164
1170
|
*/
|
|
1165
|
-
|
|
1171
|
+
hijackFilter?: ((url: string) => boolean) | undefined;
|
|
1166
1172
|
/**
|
|
1167
1173
|
* Emitted when bar is triggered to appear
|
|
1168
1174
|
*/
|
|
@@ -7215,7 +7221,7 @@ export interface QRadioProps {
|
|
|
7215
7221
|
/**
|
|
7216
7222
|
* The actual value of the option with which model value is changed
|
|
7217
7223
|
*/
|
|
7218
|
-
val: number | string;
|
|
7224
|
+
val: number | string | null | undefined;
|
|
7219
7225
|
/**
|
|
7220
7226
|
* Label to display along the radio control (or use the default slot instead of this prop)
|
|
7221
7227
|
*/
|
|
@@ -11,13 +11,17 @@
|
|
|
11
11
|
"type": "string",
|
|
12
12
|
"description": "Color name for component from the Quasar Color Palette"
|
|
13
13
|
},
|
|
14
|
+
"q-ajax-bar/reverse": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Reverse direction of progress"
|
|
17
|
+
},
|
|
14
18
|
"q-ajax-bar/skip-hijack": {
|
|
15
19
|
"type": "boolean",
|
|
16
20
|
"description": "Skip Ajax hijacking (not a reactive prop)"
|
|
17
21
|
},
|
|
18
|
-
"q-ajax-bar/
|
|
19
|
-
"type": "
|
|
20
|
-
"description": "
|
|
22
|
+
"q-ajax-bar/hijack-filter": {
|
|
23
|
+
"type": "function",
|
|
24
|
+
"description": "Filter which URL should trigger start() + stop()"
|
|
21
25
|
},
|
|
22
26
|
"q-avatar/size": {
|
|
23
27
|
"type": "string",
|
|
@@ -3372,7 +3376,7 @@
|
|
|
3372
3376
|
"description": "Model of the component; Either use this property (along with a listener for 'update:model-value' event) OR use v-model directive"
|
|
3373
3377
|
},
|
|
3374
3378
|
"q-radio/val": {
|
|
3375
|
-
"type": "number|string",
|
|
3379
|
+
"type": "number|string|null|undefined",
|
|
3376
3380
|
"description": "The actual value of the option with which model value is changed"
|
|
3377
3381
|
},
|
|
3378
3382
|
"q-radio/label": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "quasar",
|
|
5
|
-
"version": "2.4.
|
|
5
|
+
"version": "2.4.8",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -44,24 +44,33 @@
|
|
|
44
44
|
"doc-url": "https://v2.quasar.dev/vue-components/ajax-bar"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
"name": "
|
|
47
|
+
"name": "reverse",
|
|
48
48
|
"value": {
|
|
49
49
|
"kind": "expression",
|
|
50
50
|
"type": "boolean"
|
|
51
51
|
},
|
|
52
|
-
"description": "
|
|
52
|
+
"description": "Reverse direction of progress",
|
|
53
53
|
"doc-url": "https://v2.quasar.dev/vue-components/ajax-bar",
|
|
54
54
|
"type": "boolean"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
"name": "
|
|
57
|
+
"name": "skip-hijack",
|
|
58
58
|
"value": {
|
|
59
59
|
"kind": "expression",
|
|
60
60
|
"type": "boolean"
|
|
61
61
|
},
|
|
62
|
-
"description": "
|
|
62
|
+
"description": "Skip Ajax hijacking (not a reactive prop)",
|
|
63
63
|
"doc-url": "https://v2.quasar.dev/vue-components/ajax-bar",
|
|
64
64
|
"type": "boolean"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "hijack-filter",
|
|
68
|
+
"value": {
|
|
69
|
+
"kind": "expression",
|
|
70
|
+
"type": "Function"
|
|
71
|
+
},
|
|
72
|
+
"description": "Filter which URL should trigger start() + stop()",
|
|
73
|
+
"doc-url": "https://v2.quasar.dev/vue-components/ajax-bar"
|
|
65
74
|
}
|
|
66
75
|
],
|
|
67
76
|
"events": [
|
|
@@ -10853,7 +10862,7 @@
|
|
|
10853
10862
|
"name": "val",
|
|
10854
10863
|
"value": {
|
|
10855
10864
|
"kind": "expression",
|
|
10856
|
-
"type": "number|string"
|
|
10865
|
+
"type": "number|string|null|undefined"
|
|
10857
10866
|
},
|
|
10858
10867
|
"description": "The actual value of the option with which model value is changed\n\nExamples:\nopt1\n50",
|
|
10859
10868
|
"doc-url": "https://v2.quasar.dev/vue-components/radio",
|
package/package.json
CHANGED
|
@@ -5,22 +5,22 @@ import { between } from '../../utils/format.js'
|
|
|
5
5
|
|
|
6
6
|
const
|
|
7
7
|
xhr = __QUASAR_SSR_SERVER__ ? null : XMLHttpRequest,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
stackStop = []
|
|
8
|
+
open = __QUASAR_SSR_SERVER__ ? null : xhr.prototype.open,
|
|
9
|
+
positionValues = [ 'top', 'right', 'bottom', 'left' ]
|
|
11
10
|
|
|
11
|
+
let stack = []
|
|
12
12
|
let highjackCount = 0
|
|
13
13
|
|
|
14
14
|
function translate ({ p, pos, active, horiz, reverse, dir }) {
|
|
15
15
|
let x = 1, y = 1
|
|
16
16
|
|
|
17
|
-
if (horiz) {
|
|
18
|
-
if (reverse) { x = -1 }
|
|
17
|
+
if (horiz === true) {
|
|
18
|
+
if (reverse === true) { x = -1 }
|
|
19
19
|
if (pos === 'bottom') { y = -1 }
|
|
20
20
|
return { transform: `translate3d(${ x * (p - 100) }%,${ active ? 0 : y * -200 }%,0)` }
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (reverse) { y = -1 }
|
|
23
|
+
if (reverse === true) { y = -1 }
|
|
24
24
|
if (pos === 'right') { x = -1 }
|
|
25
25
|
return { transform: `translate3d(${ active ? 0 : dir * x * -200 }%,${ y * (p - 100) }%,0)` }
|
|
26
26
|
}
|
|
@@ -46,32 +46,45 @@ function inc (p, amount) {
|
|
|
46
46
|
return between(p + amount, 0, 100)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
function highjackAjax (
|
|
50
|
-
stackStart.push(start)
|
|
51
|
-
stackStop.push(stop)
|
|
52
|
-
|
|
49
|
+
function highjackAjax (stackEntry) {
|
|
53
50
|
highjackCount++
|
|
54
51
|
|
|
52
|
+
stack.push(stackEntry)
|
|
53
|
+
|
|
55
54
|
if (highjackCount > 1) { return }
|
|
56
55
|
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
xhr.prototype.open = function (_, url) {
|
|
57
|
+
const stopStack = []
|
|
58
|
+
|
|
59
|
+
const loadStart = () => {
|
|
60
|
+
stack.forEach(entry => {
|
|
61
|
+
if (
|
|
62
|
+
entry.hijackFilter.value === null
|
|
63
|
+
|| (entry.hijackFilter.value(url) === true)
|
|
64
|
+
) {
|
|
65
|
+
entry.start()
|
|
66
|
+
stopStack.push(entry.stop)
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}
|
|
60
70
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
const loadEnd = () => {
|
|
72
|
+
stopStack.forEach(stop => { stop() })
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this.addEventListener('loadstart', loadStart, { once: true })
|
|
76
|
+
this.addEventListener('loadend', loadEnd, { once: true })
|
|
77
|
+
|
|
78
|
+
open.apply(this, arguments)
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
81
|
|
|
68
|
-
function restoreAjax (start
|
|
69
|
-
|
|
70
|
-
stackStop.splice(stackStop.indexOf(stop), 1)
|
|
82
|
+
function restoreAjax (start) {
|
|
83
|
+
stack = stack.filter(entry => entry.start !== start)
|
|
71
84
|
|
|
72
85
|
highjackCount = Math.max(0, highjackCount - 1)
|
|
73
86
|
if (highjackCount === 0) {
|
|
74
|
-
xhr.prototype.
|
|
87
|
+
xhr.prototype.open = open
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
|
|
@@ -82,15 +95,19 @@ export default createComponent({
|
|
|
82
95
|
position: {
|
|
83
96
|
type: String,
|
|
84
97
|
default: 'top',
|
|
85
|
-
validator: val =>
|
|
98
|
+
validator: val => positionValues.includes(val)
|
|
86
99
|
},
|
|
100
|
+
|
|
87
101
|
size: {
|
|
88
102
|
type: String,
|
|
89
103
|
default: '2px'
|
|
90
104
|
},
|
|
105
|
+
|
|
91
106
|
color: String,
|
|
92
107
|
skipHijack: Boolean,
|
|
93
|
-
reverse: Boolean
|
|
108
|
+
reverse: Boolean,
|
|
109
|
+
|
|
110
|
+
hijackFilter: Function
|
|
94
111
|
},
|
|
95
112
|
|
|
96
113
|
emits: [ 'start', 'stop' ],
|
|
@@ -122,7 +139,7 @@ export default createComponent({
|
|
|
122
139
|
active,
|
|
123
140
|
horiz: horizontal.value,
|
|
124
141
|
reverse: proxy.$q.lang.rtl === true && [ 'top', 'bottom' ].includes(props.position)
|
|
125
|
-
?
|
|
142
|
+
? props.reverse === false
|
|
126
143
|
: props.reverse,
|
|
127
144
|
dir: proxy.$q.lang.rtl === true ? -1 : 1
|
|
128
145
|
})
|
|
@@ -218,13 +235,17 @@ export default createComponent({
|
|
|
218
235
|
onMounted(() => {
|
|
219
236
|
if (props.skipHijack !== true) {
|
|
220
237
|
hijacked = true
|
|
221
|
-
highjackAjax(
|
|
238
|
+
highjackAjax({
|
|
239
|
+
start,
|
|
240
|
+
stop,
|
|
241
|
+
hijackFilter: computed(() => props.hijackFilter || null)
|
|
242
|
+
})
|
|
222
243
|
}
|
|
223
244
|
})
|
|
224
245
|
|
|
225
246
|
onBeforeUnmount(() => {
|
|
226
247
|
clearTimeout(timer)
|
|
227
|
-
hijacked === true && restoreAjax(start
|
|
248
|
+
hijacked === true && restoreAjax(start)
|
|
228
249
|
})
|
|
229
250
|
|
|
230
251
|
// expose public methods
|
|
@@ -22,16 +22,34 @@
|
|
|
22
22
|
"extends": "color"
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
"
|
|
25
|
+
"reverse": {
|
|
26
26
|
"type": "Boolean",
|
|
27
|
-
"desc": "
|
|
27
|
+
"desc": "Reverse direction of progress",
|
|
28
28
|
"category": "behavior"
|
|
29
29
|
},
|
|
30
30
|
|
|
31
|
-
"
|
|
31
|
+
"skip-hijack": {
|
|
32
32
|
"type": "Boolean",
|
|
33
|
-
"desc": "
|
|
33
|
+
"desc": "Skip Ajax hijacking (not a reactive prop)",
|
|
34
34
|
"category": "behavior"
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"hijack-filter": {
|
|
38
|
+
"type": "Function",
|
|
39
|
+
"desc": "Filter which URL should trigger start() + stop()",
|
|
40
|
+
"params": {
|
|
41
|
+
"url": {
|
|
42
|
+
"type": "String",
|
|
43
|
+
"desc": "The URL being triggered",
|
|
44
|
+
"examples": [ "https://some.url/path" ]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"returns": {
|
|
48
|
+
"type": "Boolean",
|
|
49
|
+
"desc": "Should the URL received as param trigger start() + stop()?"
|
|
50
|
+
},
|
|
51
|
+
"category": "behavior",
|
|
52
|
+
"addedIn": "v2.4.5"
|
|
35
53
|
}
|
|
36
54
|
},
|
|
37
55
|
|
|
@@ -40,7 +40,7 @@ export default createComponent({
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
const sepClass = computed(() => (props.separatorColor ? ` text-${ props.separatorColor }` : ''))
|
|
43
|
-
const activeClass = computed(() => `text-${ props.activeColor }`)
|
|
43
|
+
const activeClass = computed(() => ` text-${ props.activeColor }`)
|
|
44
44
|
|
|
45
45
|
return () => {
|
|
46
46
|
const vnodes = getNormalizedVNodes(
|
|
@@ -62,8 +62,8 @@ export default createComponent({
|
|
|
62
62
|
if (comp.type !== void 0 && comp.type.name === 'QBreadcrumbsEl') {
|
|
63
63
|
const middle = els < len
|
|
64
64
|
const disabled = comp.props !== null && disabledValues.includes(comp.props.disable)
|
|
65
|
-
const cls = (middle === true ? ' q-breadcrumbs--last'
|
|
66
|
-
+ (disabled !== true && middle === true ?
|
|
65
|
+
const cls = (middle === true ? '' : ' q-breadcrumbs--last')
|
|
66
|
+
+ (disabled !== true && middle === true ? activeClass.value : '')
|
|
67
67
|
|
|
68
68
|
els++
|
|
69
69
|
|
|
@@ -22,13 +22,13 @@ export default createComponent({
|
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
setup (props, { slots }) {
|
|
25
|
-
const { linkTag, linkProps, hasRouterLink, navigateToRouterLink } = useRouterLink()
|
|
25
|
+
const { linkTag, linkProps, linkClass, hasRouterLink, navigateToRouterLink } = useRouterLink()
|
|
26
26
|
|
|
27
27
|
const data = computed(() => {
|
|
28
28
|
const acc = {
|
|
29
29
|
class: 'q-breadcrumbs__el q-link '
|
|
30
30
|
+ 'flex inline items-center relative-position '
|
|
31
|
-
+ (props.disable !== true ? 'q-link--focusable' : 'q-breadcrumbs__el--disable'),
|
|
31
|
+
+ (props.disable !== true ? 'q-link--focusable' + linkClass.value : 'q-breadcrumbs__el--disable'),
|
|
32
32
|
...linkProps.value
|
|
33
33
|
}
|
|
34
34
|
if (hasRouterLink.value === true) {
|
|
@@ -5,6 +5,8 @@ import useSize, { useSizeProps } from '../../composables/private/use-size.js'
|
|
|
5
5
|
import { createComponent } from '../../utils/private/create.js'
|
|
6
6
|
import { hSlot, hMergeSlot } from '../../utils/private/render.js'
|
|
7
7
|
|
|
8
|
+
const defaultViewBox = '0 0 24 24'
|
|
9
|
+
|
|
8
10
|
const sameFn = i => i
|
|
9
11
|
const ionFn = i => `ionicons ${ i }`
|
|
10
12
|
|
|
@@ -58,7 +60,7 @@ export default createComponent({
|
|
|
58
60
|
|
|
59
61
|
const classes = computed(() =>
|
|
60
62
|
'q-icon'
|
|
61
|
-
+ (props.left === true ? ' on-left' : '')
|
|
63
|
+
+ (props.left === true ? ' on-left' : '') // TODO Qv3: drop this
|
|
62
64
|
+ (props.right === true ? ' on-right' : '')
|
|
63
65
|
+ (props.color !== void 0 ? ` text-${ props.color }` : '')
|
|
64
66
|
)
|
|
@@ -68,10 +70,7 @@ export default createComponent({
|
|
|
68
70
|
let icon = props.name
|
|
69
71
|
|
|
70
72
|
if (!icon) {
|
|
71
|
-
return {
|
|
72
|
-
none: true,
|
|
73
|
-
cls: classes.value
|
|
74
|
-
}
|
|
73
|
+
return { none: true }
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
if ($q.iconMapFn !== null) {
|
|
@@ -82,7 +81,7 @@ export default createComponent({
|
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
83
|
return {
|
|
85
|
-
cls: res.cls
|
|
84
|
+
cls: res.cls,
|
|
86
85
|
content: res.content !== void 0
|
|
87
86
|
? res.content
|
|
88
87
|
: ' '
|
|
@@ -92,39 +91,32 @@ export default createComponent({
|
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
if (mRE.test(icon) === true) {
|
|
95
|
-
const [ def, viewBox ] = icon.split('|')
|
|
94
|
+
const [ def, viewBox = defaultViewBox ] = icon.split('|')
|
|
96
95
|
|
|
97
96
|
return {
|
|
98
97
|
svg: true,
|
|
99
|
-
|
|
98
|
+
viewBox,
|
|
100
99
|
nodes: def.split('&&').map(path => {
|
|
101
100
|
const [ d, style, transform ] = path.split('@@')
|
|
102
|
-
return h('path', {
|
|
103
|
-
|
|
104
|
-
d,
|
|
105
|
-
transform
|
|
106
|
-
})
|
|
107
|
-
}),
|
|
108
|
-
viewBox: viewBox !== void 0 ? viewBox : '0 0 24 24'
|
|
101
|
+
return h('path', { style, d, transform })
|
|
102
|
+
})
|
|
109
103
|
}
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
if (imgRE.test(icon) === true) {
|
|
113
107
|
return {
|
|
114
108
|
img: true,
|
|
115
|
-
cls: classes.value,
|
|
116
109
|
src: icon.substring(4)
|
|
117
110
|
}
|
|
118
111
|
}
|
|
119
112
|
|
|
120
113
|
if (svgUseRE.test(icon) === true) {
|
|
121
|
-
const [ def, viewBox ] = icon.split('|')
|
|
114
|
+
const [ def, viewBox = defaultViewBox ] = icon.split('|')
|
|
122
115
|
|
|
123
116
|
return {
|
|
124
117
|
svguse: true,
|
|
125
|
-
cls: classes.value,
|
|
126
118
|
src: def.substring(7),
|
|
127
|
-
viewBox
|
|
119
|
+
viewBox
|
|
128
120
|
}
|
|
129
121
|
}
|
|
130
122
|
|
|
@@ -158,14 +150,14 @@ export default createComponent({
|
|
|
158
150
|
}
|
|
159
151
|
|
|
160
152
|
return {
|
|
161
|
-
cls
|
|
153
|
+
cls,
|
|
162
154
|
content
|
|
163
155
|
}
|
|
164
156
|
})
|
|
165
157
|
|
|
166
158
|
return () => {
|
|
167
159
|
const data = {
|
|
168
|
-
class:
|
|
160
|
+
class: classes.value,
|
|
169
161
|
style: sizeStyle.value,
|
|
170
162
|
'aria-hidden': 'true',
|
|
171
163
|
role: 'presentation'
|
|
@@ -176,24 +168,31 @@ export default createComponent({
|
|
|
176
168
|
}
|
|
177
169
|
|
|
178
170
|
if (type.value.img === true) {
|
|
179
|
-
data.
|
|
180
|
-
|
|
171
|
+
return h('div', data, hMergeSlot(slots.default, [
|
|
172
|
+
h('img', { src: type.value.src })
|
|
173
|
+
]))
|
|
181
174
|
}
|
|
182
175
|
|
|
183
176
|
if (type.value.svg === true) {
|
|
184
|
-
data.
|
|
185
|
-
|
|
186
|
-
|
|
177
|
+
return h('div', data, hMergeSlot(slots.default, [
|
|
178
|
+
h('svg', {
|
|
179
|
+
viewBox: type.value.viewBox
|
|
180
|
+
}, type.value.nodes)
|
|
181
|
+
]))
|
|
187
182
|
}
|
|
188
183
|
|
|
189
184
|
if (type.value.svguse === true) {
|
|
190
|
-
data.
|
|
185
|
+
return h('div', data, hMergeSlot(slots.default, [
|
|
186
|
+
h('svg', {
|
|
187
|
+
viewBox: type.value.viewBox
|
|
188
|
+
}, [
|
|
189
|
+
h('use', { 'xlink:href': type.value.src })
|
|
190
|
+
])
|
|
191
|
+
]))
|
|
192
|
+
}
|
|
191
193
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
data,
|
|
195
|
-
hMergeSlot(slots.default, [ h('use', { 'xlink:href': type.value.src }) ])
|
|
196
|
-
)
|
|
194
|
+
if (type.value.cls !== void 0) {
|
|
195
|
+
data.class += ' ' + type.value.cls
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
return h(props.tag, data, hMergeSlot(slots.default, [
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
text-align: center
|
|
11
11
|
position: relative
|
|
12
12
|
box-sizing: content-box
|
|
13
|
-
|
|
14
13
|
fill: currentColor // for svg paths
|
|
15
14
|
|
|
16
15
|
&:before, &:after
|
|
@@ -20,7 +19,8 @@
|
|
|
20
19
|
align-items: center
|
|
21
20
|
justify-content: center
|
|
22
21
|
|
|
23
|
-
> svg
|
|
22
|
+
> svg,
|
|
23
|
+
> img
|
|
24
24
|
width: 100%
|
|
25
25
|
height: 100%
|
|
26
26
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, reactive, computed, provide, getCurrentInstance } from 'vue'
|
|
1
|
+
import { h, ref, reactive, computed, watch, provide, onUnmounted, getCurrentInstance } from 'vue'
|
|
2
2
|
|
|
3
3
|
import { isRuntimeSsrPreHydration } from '../../plugins/Platform.js'
|
|
4
4
|
|
|
@@ -173,6 +173,55 @@ export default createComponent({
|
|
|
173
173
|
|
|
174
174
|
provide(layoutKey, $layout)
|
|
175
175
|
|
|
176
|
+
// prevent scrollbar flicker while resizing window height
|
|
177
|
+
// if no page scrollbar is already present
|
|
178
|
+
if (__QUASAR_SSR_SERVER__ !== true && getScrollbarWidth() > 0) {
|
|
179
|
+
let timer = null
|
|
180
|
+
const el = document.body
|
|
181
|
+
|
|
182
|
+
function restoreScrollbar () {
|
|
183
|
+
timer = null
|
|
184
|
+
el.classList.remove('hide-scrollbar')
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function hideScrollbar () {
|
|
188
|
+
if (timer === null) {
|
|
189
|
+
// if it has no scrollbar then there's nothing to do
|
|
190
|
+
|
|
191
|
+
if (el.scrollHeight > $q.screen.height) {
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
el.classList.add('hide-scrollbar')
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
clearTimeout(timer)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
timer = setTimeout(restoreScrollbar, 300)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function updateScrollEvent (action) {
|
|
205
|
+
if (timer !== null && action === 'remove') {
|
|
206
|
+
clearTimeout(timer)
|
|
207
|
+
restoreScrollbar()
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
window[ `${ action }EventListener` ]('resize', hideScrollbar)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
watch(
|
|
214
|
+
() => (props.container !== true ? 'add' : 'remove'),
|
|
215
|
+
updateScrollEvent
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
props.container !== true && updateScrollEvent('add')
|
|
219
|
+
|
|
220
|
+
onUnmounted(() => {
|
|
221
|
+
updateScrollEvent('remove')
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
|
|
176
225
|
return () => {
|
|
177
226
|
const content = hMergeSlot(slots.default, [
|
|
178
227
|
h(QScrollObserver, { onScroll: onPageScroll }),
|
|
@@ -309,8 +309,8 @@ export default createComponent({
|
|
|
309
309
|
style,
|
|
310
310
|
disable: props.disable,
|
|
311
311
|
flat: !active,
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
label: props.min,
|
|
313
|
+
...(active ? activeBtnProps.value : {})
|
|
314
314
|
}, props.min))
|
|
315
315
|
}
|
|
316
316
|
if (boundaryEnd) {
|
|
@@ -320,8 +320,8 @@ export default createComponent({
|
|
|
320
320
|
style,
|
|
321
321
|
disable: props.disable,
|
|
322
322
|
flat: !active,
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
label: props.max,
|
|
324
|
+
...(active ? activeBtnProps.value : {})
|
|
325
325
|
}, props.max))
|
|
326
326
|
}
|
|
327
327
|
if (ellipsesStart) {
|
|
@@ -33,12 +33,8 @@ export default createComponent({
|
|
|
33
33
|
...useSizeProps,
|
|
34
34
|
...useFormProps,
|
|
35
35
|
|
|
36
|
-
modelValue: {
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
val: {
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
36
|
+
modelValue: { required: true },
|
|
37
|
+
val: { required: true },
|
|
42
38
|
|
|
43
39
|
label: String,
|
|
44
40
|
leftLabel: Boolean,
|