quasar 2.11.2 → 2.11.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/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/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.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/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.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/mdi-v7.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-fontawesome-v6.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-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +2 -2
- 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-TN.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/eu.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/kk.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/mm.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.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/sm.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/uz-Cyrl.umd.prod.js +1 -1
- package/dist/lang/uz-Latn.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 +4 -0
- package/dist/quasar.esm.js +386 -179
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +4 -0
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +3 -1
- package/dist/quasar.umd.js +386 -179
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/web-types/web-types.json +1 -1
- package/package.json +8 -8
- package/src/components/ajax-bar/QAjaxBar.js +13 -5
- package/src/components/btn/QBtn.js +3 -2
- package/src/components/carousel/QCarousel.js +17 -10
- package/src/components/checkbox/use-checkbox.js +2 -0
- package/src/components/dialog/QDialog.js +8 -4
- package/src/components/drawer/QDrawer.js +8 -3
- package/src/components/img/QImg.js +25 -11
- package/src/components/input/QInput.js +14 -4
- package/src/components/layout/QLayout.js +5 -5
- package/src/components/menu/QMenu.js +1 -1
- package/src/components/pull-to-refresh/QPullToRefresh.js +5 -4
- package/src/components/radio/QRadio.js +2 -0
- package/src/components/resize-observer/QResizeObserver.js +9 -4
- package/src/components/scroll-area/QScrollArea.js +8 -8
- package/src/components/select/QSelect.js +19 -8
- package/src/components/slide-item/QSlideItem.js +4 -2
- package/src/components/slide-transition/QSlideTransition.js +17 -3
- package/src/components/tabs/QTabs.js +12 -5
- package/src/components/tooltip/QTooltip.js +1 -1
- package/src/composables/private/use-anchor.js +8 -3
- package/src/composables/private/use-field.js +10 -4
- package/src/composables/private/use-portal.js +3 -3
- package/src/composables/private/use-timeout.js +6 -3
- package/src/css/core/visibility.sass +2 -0
- package/src/directives/TouchHold.js +9 -4
- package/src/directives/TouchRepeat.js +10 -3
- package/src/lang.js +17 -11
- package/src/plugins/Loading.js +5 -5
- package/src/plugins/Meta.js +4 -2
- package/src/plugins/Notify.js +13 -3
- package/src/utils/debounce.js +9 -6
- package/src/utils/morph.js +7 -6
- package/src/utils/prevent-scroll.js +5 -6
- package/src/utils/private/click-outside.js +10 -3
- package/src/utils/private/global-dialog.js +1 -1
- package/src/utils/private/global-nodes.js +44 -13
- package/src/utils/private/position-engine.js +67 -25
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { globalConfig } from './global-config.js'
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const nodesList = []
|
|
4
|
+
const portalTypeList = []
|
|
5
|
+
|
|
6
|
+
let portalIndex = 1
|
|
4
7
|
let target = __QUASAR_SSR_SERVER__
|
|
5
8
|
? void 0
|
|
6
9
|
: document.body
|
|
7
10
|
|
|
8
|
-
export function createGlobalNode (id) {
|
|
11
|
+
export function createGlobalNode (id, portalType) {
|
|
9
12
|
const el = document.createElement('div')
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
el.id = portalType !== void 0
|
|
15
|
+
? `q-portal--${ portalType }--${ portalIndex++ }`
|
|
16
|
+
: id
|
|
14
17
|
|
|
15
18
|
if (globalConfig.globalNodes !== void 0) {
|
|
16
19
|
const cls = globalConfig.globalNodes.class
|
|
@@ -20,24 +23,52 @@ export function createGlobalNode (id) {
|
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
target.appendChild(el)
|
|
23
|
-
|
|
26
|
+
nodesList.push(el)
|
|
27
|
+
portalTypeList.push(portalType)
|
|
24
28
|
|
|
25
29
|
return el
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
export function removeGlobalNode (el) {
|
|
29
|
-
|
|
33
|
+
const nodeIndex = nodesList.indexOf(el)
|
|
34
|
+
|
|
35
|
+
nodesList.splice(nodeIndex, 1)
|
|
36
|
+
portalTypeList.splice(nodeIndex, 1)
|
|
37
|
+
|
|
30
38
|
el.remove()
|
|
31
39
|
}
|
|
32
40
|
|
|
33
|
-
export function changeGlobalNodesTarget (
|
|
34
|
-
if (
|
|
35
|
-
|
|
41
|
+
export function changeGlobalNodesTarget (newTarget) {
|
|
42
|
+
if (newTarget === target) {
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
target = newTarget
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
if (
|
|
49
|
+
target === document.body
|
|
50
|
+
// or we have less than 2 dialogs:
|
|
51
|
+
|| portalTypeList.reduce((acc, type) => (type === 'dialog' ? acc + 1 : acc), 0) < 2
|
|
52
|
+
) {
|
|
53
|
+
nodesList.forEach(node => {
|
|
54
|
+
if (node.contains(target) === false) {
|
|
55
|
+
target.appendChild(node)
|
|
40
56
|
}
|
|
41
57
|
})
|
|
58
|
+
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const lastDialogIndex = portalTypeList.lastIndexOf('dialog')
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < nodesList.length; i++) {
|
|
65
|
+
const el = nodesList[ i ]
|
|
66
|
+
|
|
67
|
+
if (
|
|
68
|
+
(i === lastDialogIndex || portalTypeList[ i ] !== 'dialog')
|
|
69
|
+
&& el.contains(target) === false
|
|
70
|
+
) {
|
|
71
|
+
target.appendChild(el)
|
|
72
|
+
}
|
|
42
73
|
}
|
|
43
74
|
}
|
|
@@ -62,17 +62,32 @@ export function getAnchorProps (el, offset) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
-
top,
|
|
66
|
-
left,
|
|
67
|
-
right,
|
|
68
|
-
bottom,
|
|
69
|
-
width,
|
|
70
|
-
height,
|
|
65
|
+
top, bottom, height,
|
|
66
|
+
left, right, width,
|
|
71
67
|
middle: left + (right - left) / 2,
|
|
72
68
|
center: top + (bottom - top) / 2
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
|
|
72
|
+
function getAbsoluteAnchorProps (el, absoluteOffset, offset) {
|
|
73
|
+
let { top, left } = el.getBoundingClientRect()
|
|
74
|
+
|
|
75
|
+
top += absoluteOffset.top
|
|
76
|
+
left += absoluteOffset.left
|
|
77
|
+
|
|
78
|
+
if (offset !== void 0) {
|
|
79
|
+
top += offset[ 1 ]
|
|
80
|
+
left += offset[ 0 ]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
top, bottom: top + 1, height: 1,
|
|
85
|
+
left, right: left + 1, width: 1,
|
|
86
|
+
middle: left,
|
|
87
|
+
center: top
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
76
91
|
export function getTargetProps (el) {
|
|
77
92
|
return {
|
|
78
93
|
top: 0,
|
|
@@ -84,6 +99,13 @@ export function getTargetProps (el) {
|
|
|
84
99
|
}
|
|
85
100
|
}
|
|
86
101
|
|
|
102
|
+
function getTopLeftProps (anchorProps, targetProps, cfg) {
|
|
103
|
+
return {
|
|
104
|
+
top: anchorProps[ cfg.anchorOrigin.vertical ] - targetProps[ cfg.selfOrigin.vertical ],
|
|
105
|
+
left: anchorProps[ cfg.anchorOrigin.horizontal ] - targetProps[ cfg.selfOrigin.horizontal ]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
87
109
|
// cfg: { el, anchorEl, anchorOrigin, selfOrigin, offset, absoluteOffset, cover, fit, maxHeight, maxWidth }
|
|
88
110
|
export function setPosition (cfg) {
|
|
89
111
|
if (client.is.ios === true && window.visualViewport !== void 0) {
|
|
@@ -102,25 +124,15 @@ export function setPosition (cfg) {
|
|
|
102
124
|
}
|
|
103
125
|
}
|
|
104
126
|
|
|
105
|
-
let anchorProps
|
|
106
|
-
|
|
107
127
|
// scroll position might change
|
|
108
128
|
// if max-height/-width changes, so we
|
|
109
129
|
// need to restore it after we calculate
|
|
110
130
|
// the new positioning
|
|
111
131
|
const { scrollLeft, scrollTop } = cfg.el
|
|
112
132
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
else {
|
|
117
|
-
const
|
|
118
|
-
{ top: anchorTop, left: anchorLeft } = cfg.anchorEl.getBoundingClientRect(),
|
|
119
|
-
top = anchorTop + cfg.absoluteOffset.top,
|
|
120
|
-
left = anchorLeft + cfg.absoluteOffset.left
|
|
121
|
-
|
|
122
|
-
anchorProps = { top, left, width: 1, height: 1, right: left + 1, center: top, middle: left, bottom: top + 1 }
|
|
123
|
-
}
|
|
133
|
+
const anchorProps = cfg.absoluteOffset === void 0
|
|
134
|
+
? getAnchorProps(cfg.anchorEl, cfg.cover === true ? [ 0, 0 ] : cfg.offset)
|
|
135
|
+
: getAbsoluteAnchorProps(cfg.anchorEl, cfg.absoluteOffset, cfg.offset)
|
|
124
136
|
|
|
125
137
|
let elStyle = {
|
|
126
138
|
maxHeight: cfg.maxHeight,
|
|
@@ -137,14 +149,44 @@ export function setPosition (cfg) {
|
|
|
137
149
|
|
|
138
150
|
Object.assign(cfg.el.style, elStyle)
|
|
139
151
|
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
152
|
+
const targetProps = getTargetProps(cfg.el)
|
|
153
|
+
let props = getTopLeftProps(anchorProps, targetProps, cfg)
|
|
154
|
+
|
|
155
|
+
if (cfg.absoluteOffset === void 0 || cfg.offset === void 0) {
|
|
156
|
+
applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin)
|
|
157
|
+
}
|
|
158
|
+
else { // we have touch position or context menu with offset
|
|
159
|
+
const { top, left } = props // cache initial values
|
|
160
|
+
|
|
161
|
+
// apply initial boundaries
|
|
162
|
+
applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin)
|
|
163
|
+
|
|
164
|
+
let hasChanged = false
|
|
165
|
+
|
|
166
|
+
// did it flip vertically?
|
|
167
|
+
if (props.top !== top) {
|
|
168
|
+
hasChanged = true
|
|
169
|
+
const offsetY = 2 * cfg.offset[ 1 ]
|
|
170
|
+
anchorProps.center = anchorProps.top -= offsetY
|
|
171
|
+
anchorProps.bottom -= offsetY + 2
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// did it flip horizontally?
|
|
175
|
+
if (props.left !== left) {
|
|
176
|
+
hasChanged = true
|
|
177
|
+
const offsetX = 2 * cfg.offset[ 0 ]
|
|
178
|
+
anchorProps.middle = anchorProps.left -= offsetX
|
|
179
|
+
anchorProps.right -= offsetX + 2
|
|
145
180
|
}
|
|
146
181
|
|
|
147
|
-
|
|
182
|
+
if (hasChanged === true) {
|
|
183
|
+
// re-calculate props with the new anchor
|
|
184
|
+
props = getTopLeftProps(anchorProps, targetProps, cfg)
|
|
185
|
+
|
|
186
|
+
// and re-apply boundaries
|
|
187
|
+
applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
148
190
|
|
|
149
191
|
elStyle = {
|
|
150
192
|
top: props.top + 'px',
|